|
@@ -9,6 +9,7 @@ import com.ims.eval.config.CustomException;
|
|
|
import com.ims.eval.dao.ResponsibilityIndicatorInfoMapper;
|
|
|
import com.ims.eval.entity.*;
|
|
|
import com.ims.eval.dao.OrganizationEvaluationMapper;
|
|
|
+import com.ims.eval.entity.dto.response.EvaluateRuleInfoIndicatorDTO;
|
|
|
import com.ims.eval.entity.dto.response.IndicatorResDTO;
|
|
|
import com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO;
|
|
|
import com.ims.eval.entity.dto.response.OrganizationEvaluationResDTO;
|
|
@@ -384,7 +385,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
baseMapper.updateById(organizationEvaluation);
|
|
|
|
|
|
List<String> evaluationRuleIds = Arrays.asList(organizationEvaluation.getOrganizationEvaluationRuleId().split(","));
|
|
|
-
|
|
|
+ evaluationRuleIds = evaluationRuleIds.stream().distinct().collect(Collectors.toList());
|
|
|
for (String ruleId : evaluationRuleIds) {
|
|
|
|
|
|
//获取指定部门的规则
|
|
@@ -396,32 +397,36 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
List<String> evaluateRuleIds = Arrays.asList(evaluationRule.getEvaluateRuleId().split(","));
|
|
|
List<EvaluateRule> evaluateRuleList = evaluateRuleService.listAll(evaluateRuleIds);
|
|
|
if (null == evaluateRuleList || evaluateRuleList.size() <= 0) {
|
|
|
- throw new CustomException("未获取到配置的规则");
|
|
|
+ //throw new CustomException("未获取到配置的规则");
|
|
|
+ continue;
|
|
|
}
|
|
|
//获取考评规则的id
|
|
|
List<String> ruleIds = evaluateRuleList.stream().map(EvaluateRule::getId).collect(Collectors.toList());
|
|
|
//通过规则id获取对应的规则明细
|
|
|
List<EvaluateRuleInfo> ruleInfos = evaluateRuleInfoService.list(ruleIds);
|
|
|
if (null == ruleInfos || ruleInfos.size() <= 0) {
|
|
|
- throw new CustomException("规则明细配置为空");
|
|
|
+// throw new CustomException("规则明细配置为空");
|
|
|
+ continue;
|
|
|
}
|
|
|
- //获取考评规则中的指标id
|
|
|
- List<String> indicatorIds = ruleInfos.stream().map(EvaluateRuleInfo::getIndicatorId).collect(Collectors.toList());
|
|
|
+ //获取考评规则中的规则明细id
|
|
|
+ List<String> ruleInfoIds = ruleInfos.stream().map(EvaluateRuleInfo::getId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ //通过规则id获取指标明细项
|
|
|
+ List<EvaluateRuleInfoIndicatorDTO> resDTOS = evaluateRuleInfoService.listByIndicatorInfo(ruleInfoIds);
|
|
|
+
|
|
|
|
|
|
- //通过指标id获取指标明细项
|
|
|
- List<IndicatorResDTO> resDTOS = iIndicatorService.listByIds(indicatorIds);
|
|
|
if (null == resDTOS || resDTOS.size() <= 0) {
|
|
|
throw new CustomException("指标规则明细项为空");
|
|
|
}
|
|
|
-
|
|
|
- for (IndicatorResDTO r: resDTOS){
|
|
|
+ for (EvaluateRuleInfoIndicatorDTO r: resDTOS){
|
|
|
if(null == r.getIndicatorDictionaryID()){
|
|
|
continue;
|
|
|
}
|
|
|
OrganizationEvaluationInfo info = new OrganizationEvaluationInfo();
|
|
|
info.setOrganizationEvaluationId(organizationEvaluation.getId());
|
|
|
info.setOrganizationEvaluationRuleId(ruleId);
|
|
|
- info.setIndicatorId(r.getId());
|
|
|
+ info.setEvaluateRuleInfoId(r.getId());
|
|
|
+ info.setIndicatorId(r.getIndicatorId());
|
|
|
info.setChildCode(r.getChildCode());
|
|
|
info.setIndicatorDictionaryId(r.getIndicatorDictionaryID());
|
|
|
info.setOptionCode(r.getOptionCode());
|