main 75
hshansha 1 month ago
parent 729e7e1bc3
commit afbec553f0

@ -247,7 +247,7 @@ public class KhPingceController extends BaseController {
* ids id-----votevoteemp
*/
// @PreAuthorize("@ss.hasPermi('kaohe:pingce:remove')")
@Log(title = "任务清除打分数据", businessType = BusinessType.DELETE)
@Log(title = "任务清除打分数据", businessType = BusinessType.DELETE)
@DeleteMapping("/clean")
@Transactional
public AjaxResult removeTest(@RequestParam Long[] ids) {
@ -260,6 +260,12 @@ public class KhPingceController extends BaseController {
List<Long> vIds = votes.stream().map(KhVote::getId).collect(Collectors.toList());
//修改voteemp
for (Long vId : vIds) {
//修改投票为未统计计算平均分、最终分
KhVote v = new KhVote();
v.setId(vId);
v.setStatistical("0");
khVoteService.updateKhVote(v);
KhVoteEmp vemp = new KhVoteEmp();
vemp.setVoteId(vId);
List<KhVoteEmp> vEmps = khVoteEmpService.selectKhVoteEmpList(vemp);
@ -291,7 +297,8 @@ public class KhPingceController extends BaseController {
}
}
return toAjax(1);
} /*else {//null认为清理所有 (已完成删除全部数据,进行中数据清除评分数据)
}
/*else {//null认为清理所有 (已完成删除全部数据,进行中数据清除评分数据)
//已完成的数据直接清除任务及所有关联数据————完全删除已完成任务
KhPingce khPingce = new KhPingce();
khPingce.setState("2");
@ -348,7 +355,6 @@ public class KhPingceController extends BaseController {
}
AjaxResult.success("按要求清理数据库成功")
}*/
return AjaxResult.error("请选择需要清理的考核任务!");
}
}

@ -118,14 +118,14 @@ public class KhVoteEmpController extends BaseController
return khVoteEmpService.voteSubmit(param);
}
/**
*
*
*/
@PreAuthorize("@ss.hasPermi('kaohe:vote_emp:edit')")
@Log(title = "投票统计", businessType = BusinessType.UPDATE)
@PutMapping("/StatisticalResults/{id}")
public AjaxResult StatisticalResults(@PathVariable Long id)
@PutMapping("/statisticalResults/{id}")
public AjaxResult statisticalResults(@PathVariable Long id)
{
return khVoteEmpService.StatisticalResults(id);
return khVoteEmpService.statisticalResults(id);
}
/**

@ -66,5 +66,5 @@ public interface IKhVoteEmpService
List<KhVoteEmp> selectVoteEmpsByVoteId(KhVoteEmp khVoteEmp);
AjaxResult StatisticalResults(Long id);
AjaxResult statisticalResults(Long id);
}

@ -140,10 +140,10 @@ public class KhKhrwResultServiceImpl implements IKhKhrwResultService
//查询该考核任务下的所有评分任务
List<KhVote> votes = khVoteMapper.selectKhVoteList(khVote);
for (KhVote vote : votes) {
//当前投票是否统计计算平均分和最终得分
if(vote.getStatistical().equals("0")){
khVoteEmpService.StatisticalResults(vote.getId());
}
//当前投票是否统计计算平均分和最终得分————去掉if 担心客户在评测结束前点击统计平均值及最终分
//if(vote.getStatistical().equals("0")){
khVoteEmpService.statisticalResults(vote.getId());
//}
KhVoteEmp khVoteEmp = new KhVoteEmp();
khVoteEmp.setVoteId(vote.getId());

@ -115,7 +115,7 @@ public class KhVoteEmpServiceImpl implements IKhVoteEmpService {
@Override
@Transactional
public AjaxResult StatisticalResults(Long id) {
public AjaxResult statisticalResults(Long id) {
//修改未已统计计算
KhVote vote = new KhVote();
vote.setId(id);
@ -127,6 +127,9 @@ public class KhVoteEmpServiceImpl implements IKhVoteEmpService {
vEmp.setVoteId(id);
List<KhVoteEmp> khVoteEmps = khVoteEmpMapper.selectKhVoteEmpList(vEmp);
for (KhVoteEmp voteEmp : khVoteEmps) {
if(!(voteEmp.getVoteNum().compareTo(BigDecimal.ZERO) == 1)){
return AjaxResult.error("投票人数需大于0才能统计");
}
if (voteEmp.getKhitemTypeid().equals(1L)) { //选项评分
List<KhVoteItems> voteItems = khVoteItemsMapper.selectKhVoteItemsList(null);//从数据库获取分值
BigDecimal a = new BigDecimal("100");

Loading…
Cancel
Save