|
@@ -9,6 +9,8 @@ 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.request.IndicatorDTO;
|
|
|
+import com.ims.eval.entity.dto.request.IndicatorDictionaryDTO;
|
|
|
import com.ims.eval.entity.dto.response.*;
|
|
|
import com.ims.eval.service.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -79,6 +81,9 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
@Resource
|
|
|
private IResponsibilityIndicatorInfoService responsibilityIndicatorInfoService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private IEvaluationScoreCountService evaluationScoreCountService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public IPage<OrganizationEvaluation> list(Integer pageNum, Integer pageSize, String id, String organizationEvaluationCode, List<String> checkCycle, String beginDate, String endDate, String stage, String createBy, String year, String month, String des) {
|
|
@@ -588,48 +593,173 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
@Override
|
|
|
public Map getEvaluationScoreInfo(String id, String binSection, String indicatorId, String organizationEvaluationRuleId) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
Map map = new HashMap();
|
|
|
+ String title1 = "";
|
|
|
+ List<Object> indicatorNamelist = new ArrayList<>();
|
|
|
+ Map<String, Object> indicatorName = new LinkedHashMap<>();
|
|
|
+ List<Object> bodylist = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
+ List<EvaluationScoreInfoResDTO> listdt = baseMapper.selectEvaluationScoreInfoList(id, binSection, indicatorId, organizationEvaluationRuleId);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (!StringUtils.isNotEmpty(indicatorId)) {
|
|
|
+ IndicatorDTO indicator = iIndicatorService.getById(indicatorId);
|
|
|
+ title1 = indicator.getIndicatorName()+"打分表";
|
|
|
+
|
|
|
+ List<Object> childlist = new ArrayList<>();
|
|
|
+ List<IndicatorDictionaryDTO> indicatorDictionaryDTOList = indicator.getDtoList();
|
|
|
+ for(IndicatorDictionaryDTO dto:indicatorDictionaryDTOList){
|
|
|
+ Map<String, Object> childName = new LinkedHashMap<>();
|
|
|
+ List<Object> oplist = new ArrayList<>();
|
|
|
+ for(IndicatorDictionary ids : dto.getList()){
|
|
|
+ if(!ids.getIsShow()){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Map<String, Object> opmap = new HashMap<>();
|
|
|
+ opmap.put("key", dto.getChildCode() + "_" + ids.getOptionCode());
|
|
|
+ opmap.put("name", ids.getOptionName());
|
|
|
+ oplist.add(opmap);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(indicatorDictionaryDTOList.size()>1){
|
|
|
+ childName.put(dto.getChildName(),oplist);
|
|
|
+ childlist.add(childName);
|
|
|
+ }else {
|
|
|
+ childlist.addAll(oplist);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- Map<String, Object> indicatorNam = new LinkedHashMap<>();
|
|
|
-
|
|
|
- if (StringUtils.isNotEmpty(indicatorId)) {
|
|
|
-
|
|
|
- List<EvaluationScoreInfoResDTO> listdt = baseMapper.selectEvaluationScoreInfoList(id, binSection, indicatorId, organizationEvaluationRuleId);
|
|
|
-
|
|
|
- Boolean flag = true;
|
|
|
-
|
|
|
- if (flag) {
|
|
|
- Map<String, List<EvaluationScoreInfoResDTO>> indicatorNamMap = listdt.stream().collect(Collectors.groupingBy(EvaluationScoreInfoResDTO::getIndicatorName));
|
|
|
- Map<String, List<EvaluationScoreInfoResDTO>> childNameMap = listdt.stream().collect(Collectors.groupingBy(dto -> dto.getChildCode() + "," + dto.getChildName()));
|
|
|
- for (Map.Entry<String, List<EvaluationScoreInfoResDTO>> indicatorNamEntry : indicatorNamMap.entrySet()) {
|
|
|
- List<Object> onlist = new ArrayList<>();
|
|
|
- for (Map.Entry<String, List<EvaluationScoreInfoResDTO>> childNameEntry : childNameMap.entrySet()) {
|
|
|
- String[] zb = childNameEntry.getKey().split(",");
|
|
|
- List<EvaluationScoreInfoResDTO> listdto = childNameEntry.getValue();
|
|
|
- List<Object> oplist = new ArrayList<>();
|
|
|
- for (EvaluationScoreInfoResDTO dto : listdto) {
|
|
|
- Map<String, Object> opmap = new HashMap<>();
|
|
|
- opmap.put("key", zb[0] + "_" + dto.getOptionCode());
|
|
|
- opmap.put("name", dto.getOptionName());
|
|
|
- oplist.add(oplist);
|
|
|
+ indicatorName.put(indicator.getIndicatorName(),childlist);
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, List<EvaluationScoreInfoResDTO>> organizationScoreMap = listdt.stream().collect(Collectors.groupingBy(score->score.getOrganizationId()+","+score.getOrganizationShortName()));
|
|
|
+ for (Map.Entry<String, List<EvaluationScoreInfoResDTO>> organizationScoreEntry : organizationScoreMap.entrySet()) {
|
|
|
+ Map<String, Object> opmap = new HashMap<>();
|
|
|
+
|
|
|
+ opmap.put("organizationShortName",organizationScoreEntry.getKey().split(",")[1]);
|
|
|
+
|
|
|
+ Map<String, List<EvaluationScoreInfoResDTO>> childNameMap = organizationScoreEntry.getValue().stream().collect(Collectors.groupingBy(EvaluationScoreInfoResDTO::getChildCode));
|
|
|
+ for (Map.Entry<String, List<EvaluationScoreInfoResDTO>> childNameEntry : childNameMap.entrySet()) {
|
|
|
+ List<EvaluationScoreInfoResDTO> listdto = childNameEntry.getValue();
|
|
|
+ Boolean zhdfflg = true;
|
|
|
+ for (EvaluationScoreInfoResDTO dto : listdto) {
|
|
|
+
|
|
|
+ if(zhdfflg && (childNameMap.size()>1 || dto.getChildName().equals("净利润"))){
|
|
|
+ List<EvaluationScoreCount> scoreCounts = evaluationScoreCountService.getEvaluationScoreCountList(id,dto.getOrganizationEvaluationRuleId(),dto.getIndicatorId());
|
|
|
+ opmap.put("zhdf",scoreCounts.get(0).getObversionScore());
|
|
|
+ zhdfflg = false;
|
|
|
}
|
|
|
- Map<String, Object> onmap = new HashMap<>();
|
|
|
- onmap.put("key", zb[1]);
|
|
|
- onmap.put("value", oplist);
|
|
|
- onlist.add(onmap);
|
|
|
+ opmap.put(dto.getChildCode()+"_"+dto.getOptionCode(),dto.getQuantifiedValue());
|
|
|
}
|
|
|
- indicatorNam.put(indicatorNamEntry.getKey(), onlist);
|
|
|
- map.put("title",indicatorNam);
|
|
|
}
|
|
|
- flag = false;
|
|
|
+ bodylist.add(opmap);
|
|
|
}
|
|
|
+ map.put("title1",title1);
|
|
|
+ map.put("title2",indicatorName);
|
|
|
+ map.put("values",bodylist);
|
|
|
|
|
|
} else {
|
|
|
+
|
|
|
|
|
|
+ List<String> ruleIds = listdt.stream().map(EvaluationScoreInfoResDTO::getEvaluateRuleId).collect(Collectors.toList());
|
|
|
+ ruleIds = ruleIds.stream().distinct().collect(Collectors.toList());
|
|
|
+ if(ruleIds.size()>1){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ List<EvaluateRuleInfo> ruleInfos = evaluateRuleInfoService.list(ruleIds);
|
|
|
+ List<String> indicatorIds = ruleInfos.stream().map(EvaluateRuleInfo::getIndicatorId).distinct().collect(Collectors.toList());
|
|
|
+ for (String i : indicatorIds) {
|
|
|
+ Map<String, Object> indicatorName2 = new LinkedHashMap<>();
|
|
|
+ IndicatorDTO indicator = iIndicatorService.getById(i);
|
|
|
+
|
|
|
+ List<Object> childlist = new ArrayList<>();
|
|
|
+ List<IndicatorDictionaryDTO> indicatorDictionaryDTOList = indicator.getDtoList();
|
|
|
+ Boolean zhdfflg = true;
|
|
|
+ int count = 0;
|
|
|
+ for (IndicatorDictionaryDTO dto : indicatorDictionaryDTOList) {
|
|
|
+ count++;
|
|
|
+ if(count>1){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ List<Object> oplist = new ArrayList<>();
|
|
|
+ for (IndicatorDictionary ids : dto.getList()) {
|
|
|
+ if (!ids.getIsShow() || ids.getOptionCode().equals("CZ")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Map<String, Object> opmap = new HashMap<>();
|
|
|
+ opmap.put("key", dto.getChildCode() + "_" + ids.getOptionCode());
|
|
|
+ opmap.put("name", ids.getOptionName());
|
|
|
+
|
|
|
+ oplist.add(opmap);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (zhdfflg && (dto.getChildName().equals("净利润"))) {
|
|
|
+ Map<String, Object> zhdf = new HashMap<>();
|
|
|
+ zhdf.put("key", "zhdf");
|
|
|
+ zhdf.put("name", "综合得分");
|
|
|
+ zhdfflg = false;
|
|
|
+ oplist.add(zhdf);
|
|
|
+ }
|
|
|
+
|
|
|
+ childlist.addAll(oplist);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ indicatorName2.put(indicator.getIndicatorName(), childlist);
|
|
|
+ indicatorNamelist.add(indicatorName2);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<Object> bodylist2 = new ArrayList<>();
|
|
|
+
|
|
|
+ Map<String, List<EvaluationScoreInfoResDTO>> organizationScoreMap = listdt.stream().collect(Collectors.groupingBy(score->score.getOrganizationId()+","+score.getOrganizationShortName()));
|
|
|
+
|
|
|
+
|
|
|
+ for (Map.Entry<String, List<EvaluationScoreInfoResDTO>> organizationScoreEntry : organizationScoreMap.entrySet()) {
|
|
|
+ Map<String, Object> opmap = new HashMap<>();
|
|
|
+
|
|
|
+ opmap.put("organizationShortName",organizationScoreEntry.getKey().split(",")[1]);
|
|
|
+
|
|
|
+ Map<String, List<EvaluationScoreInfoResDTO>> indicatorIdMap = organizationScoreEntry.getValue().stream().collect(Collectors.groupingBy(EvaluationScoreInfoResDTO::getIndicatorId));
|
|
|
+
|
|
|
+
|
|
|
+ Boolean zhdfflg2 = true;
|
|
|
+ for (Map.Entry<String, List<EvaluationScoreInfoResDTO>> indicatorIdEntry : indicatorIdMap.entrySet()) {
|
|
|
+ Map<String, List<EvaluationScoreInfoResDTO>> iChildCodeMap = indicatorIdEntry.getValue().stream().collect(Collectors.groupingBy(EvaluationScoreInfoResDTO::getChildCode));
|
|
|
+
|
|
|
+ for (EvaluationScoreInfoResDTO dto : indicatorIdEntry.getValue()) {
|
|
|
+ if(iChildCodeMap.size()>1 && dto.getOptionCode().equals("DF")){
|
|
|
+ List<EvaluationScoreCount> scoreCounts = evaluationScoreCountService.getEvaluationScoreCountList(id,dto.getOrganizationEvaluationRuleId(),dto.getIndicatorId());
|
|
|
+ opmap.put(dto.getChildCode()+"_"+dto.getOptionCode(),scoreCounts.get(0).getObversionScore());
|
|
|
+ }else {
|
|
|
+ opmap.put(dto.getChildCode()+"_"+dto.getOptionCode(),dto.getQuantifiedValue());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(zhdfflg2 && (dto.getChildName().equals("净利润"))){
|
|
|
+ List<EvaluationScoreCount> scoreCounts = evaluationScoreCountService.getEvaluationScoreCountList(id,dto.getOrganizationEvaluationRuleId(),dto.getIndicatorId());
|
|
|
+ opmap.put("zhdf",scoreCounts.get(0).getObversionScore());
|
|
|
+ zhdfflg2 = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ bodylist2.add(opmap);
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("title",indicatorNamelist);
|
|
|
+ map.put("values",bodylist2);
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
return map;
|
|
|
}
|
|
|
}
|