|
@@ -100,6 +100,15 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
@Autowired
|
|
|
private RemoteServiceBuilder serviceBuilder;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IOrganizationRatingService iOrganizationRatingService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IOrganizationEvaluationRuleService iOrganizationEvaluationRuleService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IBinSectionService iBinSectionService;
|
|
|
+
|
|
|
|
|
|
@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) {
|
|
@@ -149,10 +158,22 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
qw.lambda().like(OrganizationEvaluation::getDes, des);
|
|
|
}
|
|
|
|
|
|
- qw.lambda().orderByDesc(OrganizationEvaluation::getYear,OrganizationEvaluation::getMonth);
|
|
|
+ qw.lambda().orderByDesc(OrganizationEvaluation::getYear, OrganizationEvaluation::getMonth);
|
|
|
|
|
|
IPage<OrganizationEvaluation> list = baseMapper.selectPage(page, qw);
|
|
|
|
|
|
+ if (checkCycle.contains("DWPJ")) {
|
|
|
+ List<OrganizationEvaluation> dwpj = list.getRecords().stream().filter(ll -> "DWPJ".equals(ll.getCheckCycle())).collect(Collectors.toList());
|
|
|
+ QueryWrapper<OrganizationEvaluation> q = new QueryWrapper<>();
|
|
|
+ q.eq("check_cycle","NDKP");
|
|
|
+ List<OrganizationEvaluation> organizationEvaluations = baseMapper.selectList(q);
|
|
|
+ List<OrganizationEvaluation> ndkp = organizationEvaluations.stream().filter(yy -> "NDKP".equals(yy.getCheckCycle()) && "2023".equals(yy.getYear())).collect(Collectors.toList());
|
|
|
+ if (dwpj.isEmpty()) {
|
|
|
+ orgRating(ndkp.get(0));
|
|
|
+ }
|
|
|
+ return baseMapper.selectPage(page, qw);
|
|
|
+ }
|
|
|
+
|
|
|
return list;
|
|
|
}
|
|
|
|
|
@@ -160,7 +181,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
@Override
|
|
|
public boolean saveOrUpdate(OrganizationEvaluation entity) {
|
|
|
//获取指定部门的规则
|
|
|
- List<OrganizationEvaluationRule> list = organizationEvaluationRuleService.listByIsCheck(entity.getOrganizationType(), entity.getCheckCycle(), "",true, false);
|
|
|
+ List<OrganizationEvaluationRule> list = organizationEvaluationRuleService.listByIsCheck(entity.getOrganizationType(), entity.getCheckCycle(), "", true, false);
|
|
|
if (!"JDKP".equals(entity.getCheckCycle()) && (null == list || list.size() <= 0)) {
|
|
|
throw new CustomException("不存在单位权重配置");
|
|
|
}
|
|
@@ -220,15 +241,67 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
entity.setUpdateTime(new Date());
|
|
|
}
|
|
|
boolean b = super.saveOrUpdate(entity);
|
|
|
+ if (b) {
|
|
|
+ orgRating(entity);
|
|
|
+ return b;
|
|
|
+ }
|
|
|
return b;
|
|
|
}
|
|
|
|
|
|
+ private void orgRating(OrganizationEvaluation entity) {
|
|
|
+ String uuid = UUID.randomUUID().toString().replace("-", "");
|
|
|
+ entity.setOrganizationEvaluationCode("dwpj_"+entity.getYear());
|
|
|
+ entity.setId(uuid);
|
|
|
+ entity.setCheckCycle("DWPJ");
|
|
|
+ boolean c = super.save(entity);
|
|
|
+ OrganizationEvaluationResDTO orgEva = baseMapper.selectById(uuid);
|
|
|
+
|
|
|
+ List<OrganizationRating> lors = new ArrayList<>();
|
|
|
+ String ruls = orgEva.getOrganizationEvaluationRuleId();
|
|
|
+ String[] ru = ruls.split(",");
|
|
|
+ List<OrganizationEvaluationRule> oers = iOrganizationEvaluationRuleService.listByIds(Arrays.asList(ru));
|
|
|
+ List<BinSection> binList = iBinSectionService.list();
|
|
|
+ for (OrganizationEvaluationRule oer : oers) {
|
|
|
+ if (!oer.getBinSection().contains(",")) {
|
|
|
+ OrganizationRating or = new OrganizationRating();
|
|
|
+ or.setYear(orgEva.getYear());
|
|
|
+ or.setOrganizationShortName(oer.getOrganizationShortName());
|
|
|
+ or.setOrganizationId(oer.getOrganizationId());
|
|
|
+ or.setOrganizationYearRatingId(uuid);
|
|
|
+ for (BinSection bl : binList) {
|
|
|
+ if (bl.getId().equals(oer.getBinSection())) {
|
|
|
+ or.setBinSection(bl.getSectionCode());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lors.add(or);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String[] split = oer.getBinSection().split(",");
|
|
|
+ Set<String> splitSet = new LinkedHashSet<>(Arrays.asList(split));
|
|
|
+ for (String s : splitSet) {
|
|
|
+ OrganizationRating or = new OrganizationRating();
|
|
|
+ or.setYear(orgEva.getYear());
|
|
|
+ or.setOrganizationShortName(oer.getOrganizationShortName());
|
|
|
+ or.setOrganizationId(oer.getOrganizationId());
|
|
|
+ or.setOrganizationYearRatingId(uuid);
|
|
|
+ for (BinSection bl : binList) {
|
|
|
+ if (bl.getId().equals(s)) {
|
|
|
+ or.setBinSection(bl.getSectionCode());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lors.add(or);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ iOrganizationRatingService.saveBatch(lors);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
|
- public boolean generateUnitEvaluationInfo(List<String> ids,String indicatorId,String organizationId) {
|
|
|
+ public boolean generateUnitEvaluationInfo(List<String> ids, String indicatorId, String organizationId) {
|
|
|
|
|
|
for (String id : ids) {
|
|
|
OrganizationEvaluation organizationEvaluation = baseMapper.selectById(id);
|
|
@@ -262,25 +335,24 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
String year = organizationEvaluation.getYear();//年份
|
|
|
|
|
|
//查询当前周期下对应的考评权重(需要考评的单位)
|
|
|
- List<OrganizationEvaluationRule> evaluationRules = organizationEvaluationRuleService.getOrganizationEvaluationRuleByYearAndCycle(organizationType,checkCycle,year,"");
|
|
|
+ List<OrganizationEvaluationRule> evaluationRules = organizationEvaluationRuleService.getOrganizationEvaluationRuleByYearAndCycle(organizationType, checkCycle, year, "");
|
|
|
|
|
|
//判断组织id 是否有值;不为空只生成当前组织的数据
|
|
|
- if(StringUtils.isNotEmpty(organizationId)){
|
|
|
+ if (StringUtils.isNotEmpty(organizationId)) {
|
|
|
evaluationRules = evaluationRules.stream().filter(rule -> rule.getOrganizationId().equals(organizationId)).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
//遍历考核的单位
|
|
|
- for(OrganizationEvaluationRule evaluationRule : evaluationRules){
|
|
|
+ for (OrganizationEvaluationRule evaluationRule : evaluationRules) {
|
|
|
//规则集合
|
|
|
List<EvaluateRule> evaluateRuleList = new ArrayList<>();
|
|
|
//根据权重获取对应的考评规则
|
|
|
//生产经营
|
|
|
double scjyWeight = evaluationRule.getScjyWeight();
|
|
|
- if(scjyWeight>0){
|
|
|
- List<EvaluateRule> scjyevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(evaluationRule.getBinSection(),CacheContext.bseCodeObject.get("SCJY").getId(),"NDKP",evaluationRule.getYear());
|
|
|
- if(null!=scjyevaluateRuleList &&scjyevaluateRuleList.size()>0){
|
|
|
+ if (scjyWeight > 0) {
|
|
|
+ List<EvaluateRule> scjyevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(evaluationRule.getBinSection(), CacheContext.bseCodeObject.get("SCJY").getId(), "NDKP", evaluationRule.getYear());
|
|
|
+ if (null != scjyevaluateRuleList && scjyevaluateRuleList.size() > 0) {
|
|
|
evaluateRuleList.addAll(scjyevaluateRuleList);
|
|
|
}
|
|
|
}
|
|
@@ -291,7 +363,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
List<MultipleBrand> filteredList = dkpz.stream()
|
|
|
.filter(multipleBrand -> !"0".equals(multipleBrand.getParentId()))
|
|
|
.collect(Collectors.toList());
|
|
|
- if (null == filteredList || filteredList.size() <= 0) {
|
|
|
+ if (null == filteredList || filteredList.size() <= 0) {
|
|
|
//重点专项管理事项
|
|
|
List<EvaluateRule> zkevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(CacheContext.bsnCodeObject.get("GLSX").getId() + "," + CacheContext.bsnCodeObject.get("ZDZX").getId(), CacheContext.bseCodeObject.get("ZDZX").getId() + "," + CacheContext.bseCodeObject.get("GLSX").getId(), "NDKP", evaluationRule.getYear());
|
|
|
|
|
@@ -303,24 +375,24 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
//前期
|
|
|
double qqWeight = evaluationRule.getQqWeight();
|
|
|
- if(qqWeight>0){
|
|
|
- List<EvaluateRule> qqevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(CacheContext.bsnCodeObject.get("QQ").getId(),CacheContext.bseCodeObject.get("QQXM").getId(),"NDKP",evaluationRule.getYear());
|
|
|
- if(null!=qqevaluateRuleList &&qqevaluateRuleList.size()>0){
|
|
|
+ if (qqWeight > 0) {
|
|
|
+ List<EvaluateRule> qqevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(CacheContext.bsnCodeObject.get("QQ").getId(), CacheContext.bseCodeObject.get("QQXM").getId(), "NDKP", evaluationRule.getYear());
|
|
|
+ if (null != qqevaluateRuleList && qqevaluateRuleList.size() > 0) {
|
|
|
evaluateRuleList.addAll(qqevaluateRuleList);
|
|
|
}
|
|
|
}
|
|
|
//基建
|
|
|
double jjWeight = evaluationRule.getJjWeight();
|
|
|
- if(jjWeight>0){
|
|
|
- List<EvaluateRule> jjevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(CacheContext.bsnCodeObject.get("JJ").getId(),CacheContext.bseCodeObject.get("JJXM").getId(),"NDKP",evaluationRule.getYear());
|
|
|
- if(null!=jjevaluateRuleList &&jjevaluateRuleList.size()>0){
|
|
|
+ if (jjWeight > 0) {
|
|
|
+ List<EvaluateRule> jjevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(CacheContext.bsnCodeObject.get("JJ").getId(), CacheContext.bseCodeObject.get("JJXM").getId(), "NDKP", evaluationRule.getYear());
|
|
|
+ if (null != jjevaluateRuleList && jjevaluateRuleList.size() > 0) {
|
|
|
evaluateRuleList.addAll(jjevaluateRuleList);
|
|
|
}
|
|
|
}
|
|
|
//获取考评规则的id
|
|
|
List<String> ruleIds = evaluateRuleList.stream().map(EvaluateRule::getId).collect(Collectors.toList());
|
|
|
//通过规则id获取对应的规则明细
|
|
|
- if(ruleIds.size()<=0){
|
|
|
+ if (ruleIds.size() <= 0) {
|
|
|
continue;
|
|
|
}
|
|
|
List<EvaluateRuleInfo> ruleInfos = evaluateRuleInfoService.list(ruleIds);
|
|
@@ -334,7 +406,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
List<EvaluateRuleInfoIndicatorDTO> resDTOS = evaluateRuleInfoService.listByIndicatorInfo(ruleInfoIds);
|
|
|
|
|
|
//判断指标id和组织id s是否为空
|
|
|
- if(StringUtils.isNotEmpty(indicatorId) ) {
|
|
|
+ if (StringUtils.isNotEmpty(indicatorId)) {
|
|
|
|
|
|
resDTOS = resDTOS.stream().filter(dto -> dto.getIndicatorId().equals(indicatorId)).collect(Collectors.toList());
|
|
|
if (resDTOS.size() <= 0) {
|
|
@@ -401,7 +473,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
|
- public boolean generateUnitMonthEvaluation(List<String> ids,String indicatorId,String organizationId) {
|
|
|
+ public boolean generateUnitMonthEvaluation(List<String> ids, String indicatorId, String organizationId) {
|
|
|
|
|
|
for (String id : ids) {
|
|
|
OrganizationEvaluation organizationEvaluation = baseMapper.selectById(id);
|
|
@@ -421,25 +493,25 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
String year = organizationEvaluation.getYear();//年份
|
|
|
|
|
|
//查询当前周期下对应的考评权重(需要考评的单位)
|
|
|
- List<OrganizationEvaluationRule> evaluationRules = organizationEvaluationRuleService.getOrganizationEvaluationRuleByYearAndCycle(organizationType,checkCycle,year,"");
|
|
|
+ List<OrganizationEvaluationRule> evaluationRules = organizationEvaluationRuleService.getOrganizationEvaluationRuleByYearAndCycle(organizationType, checkCycle, year, "");
|
|
|
|
|
|
|
|
|
//判断组织id 是否有值;不为空只生成当前组织的数据
|
|
|
- if(StringUtils.isNotEmpty(organizationId)){
|
|
|
+ if (StringUtils.isNotEmpty(organizationId)) {
|
|
|
evaluationRules = evaluationRules.stream().filter(rule -> rule.getOrganizationId().equals(organizationId)).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
|
|
|
//遍历考核的单位
|
|
|
- for(OrganizationEvaluationRule evaluationRule : evaluationRules){
|
|
|
+ for (OrganizationEvaluationRule evaluationRule : evaluationRules) {
|
|
|
//规则集合
|
|
|
List<EvaluateRule> evaluateRuleList = new ArrayList<>();
|
|
|
//根据权重获取对应的考评规则
|
|
|
//生产经营
|
|
|
double scjyWeight = evaluationRule.getScjyWeight();
|
|
|
- if(scjyWeight>0){
|
|
|
- List<EvaluateRule> scjyevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(evaluationRule.getBinSection(),CacheContext.bseCodeObject.get("SCJY").getId(),"JDKP",evaluationRule.getYear());
|
|
|
- if(null!=scjyevaluateRuleList &&scjyevaluateRuleList.size()>0){
|
|
|
+ if (scjyWeight > 0) {
|
|
|
+ List<EvaluateRule> scjyevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(evaluationRule.getBinSection(), CacheContext.bseCodeObject.get("SCJY").getId(), "JDKP", evaluationRule.getYear());
|
|
|
+ if (null != scjyevaluateRuleList && scjyevaluateRuleList.size() > 0) {
|
|
|
evaluateRuleList.addAll(scjyevaluateRuleList);
|
|
|
}
|
|
|
}
|
|
@@ -450,7 +522,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
List<MultipleBrand> filteredList = dkpz.stream()
|
|
|
.filter(multipleBrand -> !"0".equals(multipleBrand.getParentId()))
|
|
|
.collect(Collectors.toList());
|
|
|
- if (null == filteredList || filteredList.size() <= 0) {
|
|
|
+ if (null == filteredList || filteredList.size() <= 0) {
|
|
|
//重点专项管理事项
|
|
|
List<EvaluateRule> zkevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(CacheContext.bsnCodeObject.get("GLSX").getId() + "," + CacheContext.bsnCodeObject.get("ZDZX").getId(), CacheContext.bseCodeObject.get("ZDZX").getId() + "," + CacheContext.bseCodeObject.get("GLSX").getId(), "JDKP", evaluationRule.getYear());
|
|
|
|
|
@@ -462,24 +534,24 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
//前期
|
|
|
double qqWeight = evaluationRule.getQqWeight();
|
|
|
- if(qqWeight>0){
|
|
|
- List<EvaluateRule> qqevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(CacheContext.bsnCodeObject.get("QQ").getId(),CacheContext.bseCodeObject.get("QQXM").getId(),"JDKP",evaluationRule.getYear());
|
|
|
- if(null!=qqevaluateRuleList &&qqevaluateRuleList.size()>0){
|
|
|
+ if (qqWeight > 0) {
|
|
|
+ List<EvaluateRule> qqevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(CacheContext.bsnCodeObject.get("QQ").getId(), CacheContext.bseCodeObject.get("QQXM").getId(), "JDKP", evaluationRule.getYear());
|
|
|
+ if (null != qqevaluateRuleList && qqevaluateRuleList.size() > 0) {
|
|
|
evaluateRuleList.addAll(qqevaluateRuleList);
|
|
|
}
|
|
|
}
|
|
|
//基建
|
|
|
double jjWeight = evaluationRule.getJjWeight();
|
|
|
- if(jjWeight>0){
|
|
|
- List<EvaluateRule> jjevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(CacheContext.bsnCodeObject.get("JJ").getId(),CacheContext.bseCodeObject.get("JJXM").getId(),"JDKP",evaluationRule.getYear());
|
|
|
- if(null!=jjevaluateRuleList &&jjevaluateRuleList.size()>0){
|
|
|
+ if (jjWeight > 0) {
|
|
|
+ List<EvaluateRule> jjevaluateRuleList = evaluateRuleService.getEvaluateRuleByYear(CacheContext.bsnCodeObject.get("JJ").getId(), CacheContext.bseCodeObject.get("JJXM").getId(), "JDKP", evaluationRule.getYear());
|
|
|
+ if (null != jjevaluateRuleList && jjevaluateRuleList.size() > 0) {
|
|
|
evaluateRuleList.addAll(jjevaluateRuleList);
|
|
|
}
|
|
|
}
|
|
|
//获取考评规则的id
|
|
|
List<String> ruleIds = evaluateRuleList.stream().map(EvaluateRule::getId).collect(Collectors.toList());
|
|
|
//通过规则id获取对应的规则明细
|
|
|
- if(ruleIds.size()<=0){
|
|
|
+ if (ruleIds.size() <= 0) {
|
|
|
continue;
|
|
|
}
|
|
|
List<EvaluateRuleInfo> ruleInfos = evaluateRuleInfoService.list(ruleIds);
|
|
@@ -493,7 +565,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
List<EvaluateRuleInfoIndicatorDTO> resDTOS = evaluateRuleInfoService.listByIndicatorInfo(ruleInfoIds);
|
|
|
|
|
|
//判断指标id和组织id s是否为空
|
|
|
- if(StringUtils.isNotEmpty(indicatorId)) {
|
|
|
+ if (StringUtils.isNotEmpty(indicatorId)) {
|
|
|
|
|
|
resDTOS = resDTOS.stream().filter(dto -> dto.getIndicatorId().equals(indicatorId)).collect(Collectors.toList());
|
|
|
if (resDTOS.size() <= 0) {
|
|
@@ -651,13 +723,13 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
public boolean editState(String id, String state, String instId) {
|
|
|
OrganizationEvaluation evaluation = baseMapper.selectById(id);
|
|
|
|
|
|
- if("人事部审核".equals(state)){
|
|
|
+ if ("人事部审核".equals(state)) {
|
|
|
state = "流程已结束";
|
|
|
|
|
|
//流程结束 计算相应的得分和汇总报告
|
|
|
- boolean b1 = organizationEvaluationInfoService.calculationByEvaluationId("","",id,"");
|
|
|
- if(b1){
|
|
|
- boolean b2 = evaluateReportService.generateEvaluateReport(id,false);
|
|
|
+ boolean b1 = organizationEvaluationInfoService.calculationByEvaluationId("", "", id, "");
|
|
|
+ if (b1) {
|
|
|
+ boolean b2 = evaluateReportService.generateEvaluateReport(id, false);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -709,7 +781,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
@Override
|
|
|
public Map getEvaluationScoreInfo(String id, String binSection, String indicatorId, String organizationEvaluationRuleId) {
|
|
|
|
|
|
- BinSection section = CacheContext.bsnIdObject.get(binSection);
|
|
|
+ BinSection section = CacheContext.bsnIdObject.get(binSection);
|
|
|
|
|
|
Map map = new HashMap();
|
|
|
String title1 = "";
|
|
@@ -720,7 +792,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
//获取到数据
|
|
|
List<EvaluationScoreInfoResDTO> listdt = baseMapper.selectEvaluationScoreInfoList(id, binSection, indicatorId, organizationEvaluationRuleId);
|
|
|
|
|
|
- if(null == listdt || listdt.size()<=0){
|
|
|
+ if (null == listdt || listdt.size() <= 0) {
|
|
|
throw new CustomException("未找到对应的打分记录");
|
|
|
}
|
|
|
|
|
@@ -729,15 +801,15 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
|
|
|
IndicatorDTO indicator = iIndicatorService.getById(indicatorId);
|
|
|
- title1 = indicator.getIndicatorName()+"打分表";
|
|
|
+ title1 = indicator.getIndicatorName() + "打分表";
|
|
|
|
|
|
List<Object> childlist = new ArrayList<>();
|
|
|
List<IndicatorDictionaryDTO> indicatorDictionaryDTOList = indicator.getDtoList();
|
|
|
- for(IndicatorDictionaryDTO dto:indicatorDictionaryDTOList){
|
|
|
+ for (IndicatorDictionaryDTO dto : indicatorDictionaryDTOList) {
|
|
|
Map<String, Object> childName = new LinkedHashMap<>();
|
|
|
List<Object> oplist = new ArrayList<>();
|
|
|
- for(IndicatorDictionary ids : dto.getList()){
|
|
|
- if(!ids.getIsShow()){
|
|
|
+ for (IndicatorDictionary ids : dto.getList()) {
|
|
|
+ if (!ids.getIsShow()) {
|
|
|
continue;
|
|
|
}
|
|
|
Map<String, Object> opmap = new HashMap<>();
|
|
@@ -746,23 +818,23 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
oplist.add(opmap);
|
|
|
}
|
|
|
//有子指标和没有子指标区别
|
|
|
- if(indicatorDictionaryDTOList.size()>1){
|
|
|
- childName.put(dto.getChildName(),oplist);
|
|
|
+ if (indicatorDictionaryDTOList.size() > 1) {
|
|
|
+ childName.put(dto.getChildName(), oplist);
|
|
|
childlist.add(childName);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
childlist.addAll(oplist);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- indicatorName.put(indicator.getIndicatorName(),childlist);
|
|
|
+ indicatorName.put(indicator.getIndicatorName(), childlist);
|
|
|
|
|
|
//按照公司分组
|
|
|
- Map<String, List<EvaluationScoreInfoResDTO>> organizationScoreMap = listdt.stream().collect(Collectors.groupingBy(score->score.getOrganizationId()+","+score.getOrganizationShortName()));
|
|
|
+ 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]);
|
|
|
+ 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()) {
|
|
@@ -770,37 +842,37 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
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(),binSection);
|
|
|
- opmap.put("zhdf",scoreCounts.get(0).getObversionScore());
|
|
|
+ if (zhdfflg && (childNameMap.size() > 1 || dto.getChildName().equals("净利润"))) {
|
|
|
+ List<EvaluationScoreCount> scoreCounts = evaluationScoreCountService.getEvaluationScoreCountList(id, dto.getOrganizationEvaluationRuleId(), dto.getIndicatorId(), binSection);
|
|
|
+ opmap.put("zhdf", scoreCounts.get(0).getObversionScore());
|
|
|
zhdfflg = false;
|
|
|
}
|
|
|
- opmap.put(dto.getChildCode()+"_"+dto.getOptionCode(),dto.getQuantifiedValue());
|
|
|
+ opmap.put(dto.getChildCode() + "_" + dto.getOptionCode(), dto.getQuantifiedValue());
|
|
|
}
|
|
|
}
|
|
|
bodylist.add(opmap);
|
|
|
}
|
|
|
|
|
|
Map<String, Object> title = new LinkedHashMap<>();
|
|
|
- title.put(title1,indicatorName);
|
|
|
- map.put("title",title);
|
|
|
- map.put("values",bodylist);
|
|
|
+ title.put(title1, indicatorName);
|
|
|
+ map.put("title", title);
|
|
|
+ map.put("values", bodylist);
|
|
|
|
|
|
} else {
|
|
|
//2.指标id为空(显示所有指标打分)
|
|
|
|
|
|
- if(section.getSectionCode().equals("JJ")){
|
|
|
- title1 = section.getSectionName()+"项目指标打分表(工程建设部)";
|
|
|
+ if (section.getSectionCode().equals("JJ")) {
|
|
|
+ title1 = section.getSectionName() + "项目指标打分表(工程建设部)";
|
|
|
|
|
|
- }else if(section.getSectionCode().equals("QQ")){
|
|
|
- title1 = section.getSectionName()+"项目指标打分表(计划发展部)";
|
|
|
- }else {
|
|
|
- title1 = section.getSectionName()+"企业生产指标考核打分表";
|
|
|
+ } else if (section.getSectionCode().equals("QQ")) {
|
|
|
+ title1 = section.getSectionName() + "项目指标打分表(计划发展部)";
|
|
|
+ } else {
|
|
|
+ title1 = section.getSectionName() + "企业生产指标考核打分表";
|
|
|
}
|
|
|
|
|
|
List<String> ruleIds = listdt.stream().map(EvaluationScoreInfoResDTO::getEvaluateRuleId).collect(Collectors.toList());
|
|
|
ruleIds = ruleIds.stream().distinct().collect(Collectors.toList());
|
|
|
- if(ruleIds.size()>1){
|
|
|
+ if (ruleIds.size() > 1) {
|
|
|
return null;
|
|
|
}
|
|
|
//规则中配置的指标
|
|
@@ -814,7 +886,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
for (String i : indicatorIds) {
|
|
|
|
|
|
- if(!indicatorId2s.contains(i)){
|
|
|
+ if (!indicatorId2s.contains(i)) {
|
|
|
continue;
|
|
|
}
|
|
|
Map<String, Object> indicatorName2 = new LinkedHashMap<>();
|
|
@@ -826,7 +898,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
int count = 0;
|
|
|
for (IndicatorDictionaryDTO dto : indicatorDictionaryDTOList) {
|
|
|
count++;
|
|
|
- if(count>1){
|
|
|
+ if (count > 1) {
|
|
|
continue;
|
|
|
}
|
|
|
List<Object> oplist = new ArrayList<>();
|
|
@@ -837,14 +909,14 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
Map<String, Object> opmap = new HashMap<>();
|
|
|
opmap.put("key", dto.getChildCode() + "_" + ids.getOptionCode());
|
|
|
opmap.put("name", ids.getOptionName());
|
|
|
- opmap.put("flag", ids.getIsQuantified()?"1":"2");
|
|
|
+ opmap.put("flag", ids.getIsQuantified() ? "1" : "2");
|
|
|
|
|
|
oplist.add(opmap);
|
|
|
}
|
|
|
//有子指标和没有子指标区别
|
|
|
if (zhdfflg && (dto.getChildCode().endsWith("LRZE"))) {
|
|
|
Map<String, Object> zhdf = new HashMap<>();
|
|
|
- zhdf.put("key", dto.getChildCode()+"_zhdf");
|
|
|
+ zhdf.put("key", dto.getChildCode() + "_zhdf");
|
|
|
zhdf.put("name", "综合得分");
|
|
|
zhdf.put("flag", "1");
|
|
|
zhdfflg = false;
|
|
@@ -862,13 +934,13 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
List<Object> bodylist2 = new ArrayList<>();
|
|
|
//按照公司分组
|
|
|
- Map<String, List<EvaluationScoreInfoResDTO>> organizationScoreMap = listdt.stream().collect(Collectors.groupingBy(score->score.getOrganizationId()+","+score.getOrganizationShortName()));
|
|
|
+ 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]);
|
|
|
+ opmap.put("organizationShortName", organizationScoreEntry.getKey().split(",")[1]);
|
|
|
//按照子指标分组
|
|
|
Map<String, List<EvaluationScoreInfoResDTO>> indicatorIdMap = organizationScoreEntry.getValue().stream().collect(Collectors.groupingBy(EvaluationScoreInfoResDTO::getIndicatorId));
|
|
|
|
|
@@ -878,31 +950,31 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
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(),binSection);
|
|
|
- if(null != scoreCounts && scoreCounts.size()>0){
|
|
|
- opmap.put(dto.getChildCode()+"_"+dto.getOptionCode(),scoreCounts.get(0).getObversionScore());
|
|
|
- }else {
|
|
|
- opmap.put(dto.getChildCode()+"_"+dto.getOptionCode(),0.0);
|
|
|
+ if (iChildCodeMap.size() > 1 && dto.getOptionCode().equals("DF")) {
|
|
|
+ List<EvaluationScoreCount> scoreCounts = evaluationScoreCountService.getEvaluationScoreCountList(id, dto.getOrganizationEvaluationRuleId(), dto.getIndicatorId(), binSection);
|
|
|
+ if (null != scoreCounts && scoreCounts.size() > 0) {
|
|
|
+ opmap.put(dto.getChildCode() + "_" + dto.getOptionCode(), scoreCounts.get(0).getObversionScore());
|
|
|
+ } else {
|
|
|
+ opmap.put(dto.getChildCode() + "_" + dto.getOptionCode(), 0.0);
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//获取每个单元格的数据
|
|
|
- if(dto.getIsQuantified()){
|
|
|
+ if (dto.getIsQuantified()) {
|
|
|
|
|
|
- opmap.put(dto.getChildCode()+"_"+dto.getOptionCode(),dto.getQuantifiedValue());
|
|
|
- }else {
|
|
|
- opmap.put(dto.getChildCode()+"_"+dto.getOptionCode(),dto.getNonQuantifiedValue());
|
|
|
+ opmap.put(dto.getChildCode() + "_" + dto.getOptionCode(), dto.getQuantifiedValue());
|
|
|
+ } else {
|
|
|
+ opmap.put(dto.getChildCode() + "_" + dto.getOptionCode(), dto.getNonQuantifiedValue());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//综合得分
|
|
|
- if(zhdfflg2 && (dto.getChildCode().endsWith("LRZE"))){
|
|
|
- List<EvaluationScoreCount> scoreCounts = evaluationScoreCountService.getEvaluationScoreCountList(id,dto.getOrganizationEvaluationRuleId(),dto.getIndicatorId(),binSection);
|
|
|
+ if (zhdfflg2 && (dto.getChildCode().endsWith("LRZE"))) {
|
|
|
+ List<EvaluationScoreCount> scoreCounts = evaluationScoreCountService.getEvaluationScoreCountList(id, dto.getOrganizationEvaluationRuleId(), dto.getIndicatorId(), binSection);
|
|
|
if (null != scoreCounts && scoreCounts.size() > 0) {
|
|
|
- opmap.put(dto.getChildCode()+"_zhdf",scoreCounts.get(0).getObversionScore());
|
|
|
- }else {
|
|
|
- opmap.put(dto.getChildCode()+"_zhdf",0.00);
|
|
|
+ opmap.put(dto.getChildCode() + "_zhdf", scoreCounts.get(0).getObversionScore());
|
|
|
+ } else {
|
|
|
+ opmap.put(dto.getChildCode() + "_zhdf", 0.00);
|
|
|
}
|
|
|
|
|
|
zhdfflg2 = false;
|
|
@@ -923,11 +995,11 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
Map<String, Object> title1map = new LinkedHashMap<>();
|
|
|
Map<String, Object> title2map = new LinkedHashMap<>();
|
|
|
- title2map.put("考核指标名称",indicatorNamelist);
|
|
|
- title1map.put(title1,title2map);
|
|
|
- map.put("zhdf",true);
|
|
|
- map.put("title",title1map);
|
|
|
- map.put("values",bodylist2);
|
|
|
+ title2map.put("考核指标名称", indicatorNamelist);
|
|
|
+ title1map.put(title1, title2map);
|
|
|
+ map.put("zhdf", true);
|
|
|
+ map.put("title", title1map);
|
|
|
+ map.put("values", bodylist2);
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
@@ -935,7 +1007,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
@Override
|
|
|
public OrganizationEvaluation getOrganizationEvaluation(String id) {
|
|
|
- if(StringUtils.isEmpty(id)){
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
return null;
|
|
|
}
|
|
|
OrganizationEvaluation res = this.getById(id);
|