|
@@ -9,10 +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;
|
|
|
+import com.ims.eval.entity.dto.response.*;
|
|
|
import com.ims.eval.service.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -160,7 +157,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
if ("NDKP".equals(entity.getCheckCycle())) {
|
|
|
oriList = list("", entity.getCheckCycle(), entity.getYear(), "");
|
|
|
responsibilityCode.append(entity.getYear()).append("_");
|
|
|
- responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(oriList.size()+1), 4, "l"));
|
|
|
+ responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(oriList.size() + 1), 4, "l"));
|
|
|
}
|
|
|
if ("JDKP".equals(entity.getCheckCycle())) {
|
|
|
Date newDate = DateUtils.toDate(entity.getYear() + "-" + entity.getMonth() + "-01");
|
|
@@ -169,13 +166,13 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
oriList = list("", entity.getCheckCycle(), entity.getYear(), month);
|
|
|
List<OrganizationEvaluation> count = list("", entity.getCheckCycle(), entity.getYear(), "");
|
|
|
responsibilityCode.append(entity.getYear()).append("_").append(month).append("_");
|
|
|
- responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(count.size()+1), 4, "l"));
|
|
|
+ responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(count.size() + 1), 4, "l"));
|
|
|
}
|
|
|
if ("YDKP".equals(entity.getCheckCycle())) {
|
|
|
oriList = list("", entity.getCheckCycle(), entity.getYear(), entity.getMonth());
|
|
|
responsibilityCode.append(entity.getYear()).append("_").append(entity.getMonth()).append("_");
|
|
|
List<OrganizationEvaluation> count = list("", entity.getCheckCycle(), entity.getYear(), "");
|
|
|
- responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(count.size()+1), 4, "l"));
|
|
|
+ responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(count.size() + 1), 4, "l"));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -209,7 +206,6 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public boolean saveOrUpdate2(OrganizationEvaluation entity) {
|
|
|
//获取指定部门的规则
|
|
|
List<OrganizationEvaluationRule> list = organizationEvaluationRuleService.listByIsCheck(entity.getOrganizationType(), entity.getCheckCycle(), true, false);
|
|
@@ -234,7 +230,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
oriList = list("", entity.getCheckCycle(), entity.getYear(), month);
|
|
|
List<OrganizationEvaluation> count = list("", entity.getCheckCycle(), entity.getYear(), "");
|
|
|
responsibilityCode.append(entity.getYear()).append("_").append(month).append("_");
|
|
|
- responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(count.size()+1), 4, "l"));
|
|
|
+ responsibilityCode.append(StringUtils.addZeroForStr(String.valueOf(count.size() + 1), 4, "l"));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -272,7 +268,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
@Override
|
|
|
public boolean generateUnitEvaluationInfo(List<String> ids) {
|
|
|
|
|
|
- for (String id :ids) {
|
|
|
+ for (String id : ids) {
|
|
|
OrganizationEvaluation organizationEvaluation = baseMapper.selectById(id);
|
|
|
if (null == organizationEvaluation) {
|
|
|
throw new CustomException("不存在考评记录");
|
|
@@ -301,7 +297,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
for (String ruleId : evaluationRuleIds) {
|
|
|
|
|
|
//获取指定部门的规则
|
|
|
- OrganizationEvaluationRule evaluationRule = organizationEvaluationRuleService.getByIdIsCheck(ruleId,true,false);
|
|
|
+ OrganizationEvaluationRule evaluationRule = organizationEvaluationRuleService.getByIdIsCheck(ruleId, true, false);
|
|
|
if (null == evaluationRule) {
|
|
|
throw new CustomException("不存在此单位规则权重配置");
|
|
|
}
|
|
@@ -344,11 +340,11 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
info.setIsQuantified(r.getIsQuantified());
|
|
|
//
|
|
|
if ("JHZ".equals(r.getOptionCode()) || "MBZ".equals(r.getOptionCode()) || "DBZ".equals(r.getOptionCode())) {
|
|
|
- if(null != objectMap.get(r.getId())){
|
|
|
+ if (null != objectMap.get(r.getId())) {
|
|
|
if ("是".equals(r.getIsQuantified())) {
|
|
|
- info.setQuantifiedValue(null == objectMap.get(r.getId()) ? null :Double.valueOf(objectMap.get(r.getId()).toString()));
|
|
|
+ info.setQuantifiedValue(null == objectMap.get(r.getId()) ? null : Double.valueOf(objectMap.get(r.getId()).toString()));
|
|
|
} else {
|
|
|
- info.setNonQuantifiedValue(null == objectMap.get(r.getId()) ?null :objectMap.get(r.getId()).toString());
|
|
|
+ info.setNonQuantifiedValue(null == objectMap.get(r.getId()) ? null : objectMap.get(r.getId()).toString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -368,7 +364,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
@Override
|
|
|
public boolean generateUnitMonthEvaluation(List<String> ids) {
|
|
|
|
|
|
- for (String id :ids) {
|
|
|
+ for (String id : ids) {
|
|
|
OrganizationEvaluation organizationEvaluation = baseMapper.selectById(id);
|
|
|
if (null == organizationEvaluation) {
|
|
|
throw new CustomException("不存在考评记录");
|
|
@@ -386,13 +382,13 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
baseMapper.updateById(organizationEvaluation);
|
|
|
|
|
|
List<String> evaluationRuleIds = Arrays.asList(organizationEvaluation.getOrganizationEvaluationRuleId().split(","));
|
|
|
- evaluationRuleIds = evaluationRuleIds.stream().distinct().collect(Collectors.toList());
|
|
|
+ evaluationRuleIds = evaluationRuleIds.stream().distinct().collect(Collectors.toList());
|
|
|
for (String ruleId : evaluationRuleIds) {
|
|
|
|
|
|
//获取指定部门的规则
|
|
|
OrganizationEvaluationRule evaluationRule = organizationEvaluationRuleService.getById(ruleId);
|
|
|
- if (null == evaluationRule|| evaluationRule.getDelFlag().equals(true)) {
|
|
|
- throw new CustomException(evaluationRule.getOrganizationShortName()+"不存在此单位规则权重配置");
|
|
|
+ if (null == evaluationRule || evaluationRule.getDelFlag().equals(true)) {
|
|
|
+ throw new CustomException(evaluationRule.getOrganizationShortName() + "不存在此单位规则权重配置");
|
|
|
}
|
|
|
//获取对应的考评规(至少存在一条)
|
|
|
List<String> evaluateRuleIds = Arrays.asList(evaluationRule.getEvaluateRuleId().split(","));
|
|
@@ -413,14 +409,14 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
List<String> ruleInfoIds = ruleInfos.stream().map(EvaluateRuleInfo::getId).collect(Collectors.toList());
|
|
|
|
|
|
//通过规则id获取指标明细项
|
|
|
- List<EvaluateRuleInfoIndicatorDTO> resDTOS = evaluateRuleInfoService.listByIndicatorInfo(ruleInfoIds);
|
|
|
+ List<EvaluateRuleInfoIndicatorDTO> resDTOS = evaluateRuleInfoService.listByIndicatorInfo(ruleInfoIds);
|
|
|
|
|
|
|
|
|
if (null == resDTOS || resDTOS.size() <= 0) {
|
|
|
throw new CustomException("指标规则明细项为空");
|
|
|
}
|
|
|
- for (EvaluateRuleInfoIndicatorDTO r: resDTOS){
|
|
|
- if(null == r.getIndicatorDictionaryID()){
|
|
|
+ for (EvaluateRuleInfoIndicatorDTO r : resDTOS) {
|
|
|
+ if (null == r.getIndicatorDictionaryID()) {
|
|
|
continue;
|
|
|
}
|
|
|
OrganizationEvaluationInfo info = new OrganizationEvaluationInfo();
|
|
@@ -450,7 +446,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
public boolean generateUnitSeasonEvaluation(List<String> ids) {
|
|
|
|
|
|
|
|
|
- for (String id :ids) {
|
|
|
+ for (String id : ids) {
|
|
|
OrganizationEvaluation organizationEvaluation = baseMapper.selectById(id);
|
|
|
if (null == organizationEvaluation) {
|
|
|
throw new CustomException("不存在考评记录");
|
|
@@ -522,7 +518,6 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public List<OrganizationEvaluation> list(String organizationId, String checkCycle, String year, String month) {
|
|
|
QueryWrapper<OrganizationEvaluation> qw = new QueryWrapper<>();
|
|
@@ -544,7 +539,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean editState(String id, String state,String instId) {
|
|
|
+ public boolean editState(String id, String state, String instId) {
|
|
|
OrganizationEvaluation evaluation = baseMapper.selectById(id);
|
|
|
|
|
|
if (StringUtils.isNotEmpty(state)) {
|
|
@@ -559,10 +554,10 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public OrganizationEvaluationResDTO getByidAndInfo(String id, String dept,HttpServletRequest request) {
|
|
|
+ public OrganizationEvaluationResDTO getByidAndInfo(String id, String dept, HttpServletRequest request) {
|
|
|
OrganizationEvaluationResDTO resDTO = baseMapper.selectById(id);
|
|
|
- Map<String ,List<OrganizationEvaluationInfoResDTO>> map = organizationEvaluationInfoService.finishValueList(id,dept,request);
|
|
|
- if(null != resDTO){
|
|
|
+ Map<String, List<OrganizationEvaluationInfoResDTO>> map = organizationEvaluationInfoService.finishValueList(id, dept, request);
|
|
|
+ if (null != resDTO) {
|
|
|
resDTO.setMap(map);
|
|
|
}
|
|
|
return resDTO;
|
|
@@ -590,4 +585,51 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map getEvaluationScoreInfo(String id, String binSection, String indicatorId, String organizationEvaluationRuleId) {
|
|
|
+ Map map = new HashMap();
|
|
|
+
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ Map<String, Object> onmap = new HashMap<>();
|
|
|
+ onmap.put("key", zb[1]);
|
|
|
+ onmap.put("value", oplist);
|
|
|
+ onlist.add(onmap);
|
|
|
+ }
|
|
|
+ indicatorNam.put(indicatorNamEntry.getKey(), onlist);
|
|
|
+ map.put("title",indicatorNam);
|
|
|
+ }
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|