Commit 8d8ecc40 authored by wangxl's avatar wangxl

1

parent 4b0eb472
......@@ -169,10 +169,10 @@ public class ComTalentAssignServiceImpl extends BaseServiceImpl<ComTalentAssignD
if (null == comTalentAssign)
throw new BusinessException("分配记录不存在或已删除!");
ComTalentAssign entity = convert2Entity(dto);
BigDecimal totalScore=comEvaluationValueService.insertListByAssignId(dto.getScoreList(),dto.getId());
BigDecimal totalScore = comEvaluationValueService.insertListByAssignId(dto.getScoreList(), dto.getId());
entity.setTotalScore(totalScore);
this.update(entity);
if (Objects.nonNull(dto.getAuditState()) && dto.getAuditState().equals(2)) {
if (Objects.nonNull(dto.getAuditState())){
this.updateAssignState(entity.getTalentId());
}
return entity.getId();
......@@ -209,20 +209,19 @@ public class ComTalentAssignServiceImpl extends BaseServiceImpl<ComTalentAssignD
public void updateAssignState(String talentId) {
Integer assignState;
Integer completed;
BigDecimal totalScore = new BigDecimal(0);
BigDecimal averageScore = new BigDecimal(0);
List<ComTalentAssignDTO> list = this.getAssignExpertList(talentId);
if (null == list || list.size() == 0) {
completed = 0;
assignState = 0;
} else {
int personCount = list.size();
int personCount = 0;
for (ComTalentAssignDTO obj : list) {
if (Objects.nonNull(obj.getAuditState()) && obj.getAuditState().equals(2)) {
totalScore.add(obj.getTotalScore());
personCount++;
}
totalScore = totalScore.add(obj.getTotalScore());
}
BigDecimal personCountBD = BigDecimal.valueOf(personCount);
averageScore = totalScore.divide(personCountBD, 2, RoundingMode.HALF_UP);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment