فهرست منبع

Merge branch 'master' of http://124.70.43.205:3000/wangchangsheng/evaluation

hlf 1 سال پیش
والد
کامیت
f5258bb7a3

+ 3 - 3
ims-service/ims-eval/src/main/java/com/ims/eval/controller/FunctionController.java

@@ -1,6 +1,6 @@
 package com.ims.eval.controller;
 
-import com.ims.eval.entity.Function;
+import com.ims.eval.entity.dto.response.FunctionDTO;
 import com.ims.eval.entity.SelfMathFormulaEnum;
 import com.ims.eval.entity.dto.result.R;
 import lombok.extern.slf4j.Slf4j;
@@ -27,11 +27,11 @@ public class FunctionController {
 	@RequestMapping(value = "list")
 	public R functionList(){
 
-		List<Function> functionList = new ArrayList<>();
+		List<FunctionDTO> functionList = new ArrayList<>();
 		try {
 			List<SelfMathFormulaEnum> selfMathFormulas = SelfMathFormulaEnum.getSelfMathFormulas();
 			selfMathFormulas.stream().forEach(r ->{
-				Function function = new Function();
+				FunctionDTO function = new FunctionDTO();
 				function.setDescription(r.getDescription());
 				function.setFormulaArgCount(r.getFormulaArgCount());
 				function.setFormulaExpresion(r.getFormulaExpresion());

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/OrganizationEvaluationRuleController.java

@@ -18,7 +18,7 @@ import java.util.Map;
 
 /**
  * <p>
- * 单位/部门考评配置 前端控制器
+ * 单位考评配置 前端控制器
  * </p>
  *
  * @author wang

+ 3 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/EvaluationPortal.java

@@ -106,6 +106,9 @@ public class EvaluationPortal extends Model {
 	private Date createTime;
 
 
+	/**
+	 * (占用:保存公司组织id)
+	 */
 	private String memo1;
 	private String memo2;
 	private String memo3;

+ 22 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/EvaluationScoreCount.java

@@ -47,6 +47,16 @@ public class 	EvaluationScoreCount extends Model {
     private double score;
 
 	/**
+	 * 加分得分
+	 */
+	private double jfScore;
+
+	/**
+	 * 扣分得分
+	 */
+	private double kfScore;
+
+	/**
 	 * 折算得分
 	 */
 	private double obversionScore;
@@ -62,6 +72,18 @@ public class 	EvaluationScoreCount extends Model {
 	 */
 	private String  remark;
 
+
+	/**
+	 * 加分原因;
+	 */
+	private String  jfRemark;
+
+
+	/**
+	 * 扣分原因;
+	 */
+	private String  kfRemark;
+
 	/**
 	 * 阶段;
 	 */

+ 2 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/entity/Function.java

@@ -1,4 +1,4 @@
-package com.ims.eval.entity;
+package com.ims.eval.entity.dto.response;
 
 import lombok.Data;
 
@@ -10,7 +10,7 @@ import lombok.Data;
  * @version: $
  */
 @Data
-public class Function {
+public class FunctionDTO {
 
 	/**
 	 * 公式名称

+ 9 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationPortalAttachService.java

@@ -3,6 +3,8 @@ package com.ims.eval.service;
 import com.ims.eval.entity.EvaluationPortalAttach;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 考评首页附件 服务类
@@ -13,4 +15,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IEvaluationPortalAttachService extends IService<EvaluationPortalAttach> {
 
+
+	boolean removeEvaluationPortalAttach(String id, List<String> portalIds);
+
+
+
+
+
 }

+ 42 - 40
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/CalculateIndicatorItemInfoServiceImpl.java

@@ -76,57 +76,59 @@ public class CalculateIndicatorItemInfoServiceImpl extends ServiceImpl<Calculate
 				}
 			}
 
-			int code = saveCalculate(list);
-			if(code>0) {
-
-				List<CiteCalculationIndicator> cciList = citeCalculationIndicatorService.getListLikeIndicatorIds(indicatorId, "");
-				if (null != cciList && cciList.size() > 0) {
-					for (CiteCalculationIndicator cci : cciList) {
-						List<String> indicatorIds =  Arrays.asList(cci.getIndicatorIds().split(","));
-						List<CalculateIndicatorItemInfo> ciiList = calculateIndicatorItemInfoMapper.selectItemInfoByIndicatorIdList("",organizationEvaluationId,indicatorIds);
-						Map<String, List<CalculateIndicatorItemInfo>> optionCodeGropList = ciiList.stream().collect(Collectors.groupingBy(CalculateIndicatorItemInfo::getOptionCode));
-						for (Map.Entry<String, List<CalculateIndicatorItemInfo>> optionCodeGropListEntry : optionCodeGropList.entrySet()){
-
-							//从小到大的顺序排序
-							Collections.sort(optionCodeGropListEntry.getValue(), new Comparator<CalculateIndicatorItemInfo>() {
-								@Override
-								public int compare(CalculateIndicatorItemInfo u1, CalculateIndicatorItemInfo u2) {
-									double diff = u1.getQuantifiedValue() - u2.getQuantifiedValue();
-									BigDecimal two = new BigDecimal(diff);
-									double three = two.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
-									if (three > 0) {
-										return 1;
-									} else if (three < 0) {
-										return -1;
+			if (null != list && list.size() > 0) {
+				int code = saveCalculate(list);
+				if (code > 0) {
+
+					List<CiteCalculationIndicator> cciList = citeCalculationIndicatorService.getListLikeIndicatorIds(indicatorId, "");
+					if (null != cciList && cciList.size() > 0) {
+						for (CiteCalculationIndicator cci : cciList) {
+							List<String> indicatorIds = Arrays.asList(cci.getIndicatorIds().split(","));
+							List<CalculateIndicatorItemInfo> ciiList = calculateIndicatorItemInfoMapper.selectItemInfoByIndicatorIdList("", organizationEvaluationId, indicatorIds);
+							Map<String, List<CalculateIndicatorItemInfo>> optionCodeGropList = ciiList.stream().collect(Collectors.groupingBy(CalculateIndicatorItemInfo::getOptionCode));
+							for (Map.Entry<String, List<CalculateIndicatorItemInfo>> optionCodeGropListEntry : optionCodeGropList.entrySet()) {
+
+								//从小到大的顺序排序
+								Collections.sort(optionCodeGropListEntry.getValue(), new Comparator<CalculateIndicatorItemInfo>() {
+									@Override
+									public int compare(CalculateIndicatorItemInfo u1, CalculateIndicatorItemInfo u2) {
+										double diff = u1.getQuantifiedValue() - u2.getQuantifiedValue();
+										BigDecimal two = new BigDecimal(diff);
+										double three = two.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+										if (three > 0) {
+											return 1;
+										} else if (three < 0) {
+											return -1;
+										}
+										return 0; //相等为0
 									}
-									return 0; //相等为0
+								});
+
+								double value = 0.0;
+								if (optionCodeGropListEntry.getKey().endsWith("MAX")) {
+									CalculateIndicatorItemInfo maxNum = (CalculateIndicatorItemInfo) optionCodeGropListEntry.getValue().get(optionCodeGropListEntry.getValue().size() - 1).clone();
+									value = maxNum.getQuantifiedValue();
+								} else if (optionCodeGropListEntry.getKey().endsWith("MIN")) {
+									CalculateIndicatorItemInfo minNum = (CalculateIndicatorItemInfo) optionCodeGropListEntry.getValue().get(0).clone();
+									value = minNum.getQuantifiedValue();
+								} else {
+									continue;
 								}
-							});
-
-							double value = 0.0;
-							if (optionCodeGropListEntry.getKey().endsWith("MAX")){
-								CalculateIndicatorItemInfo maxNum =  (CalculateIndicatorItemInfo)optionCodeGropListEntry.getValue().get(optionCodeGropListEntry.getValue().size()-1).clone();
-								value = maxNum.getQuantifiedValue();
-							}else if (optionCodeGropListEntry.getKey().endsWith("MIN")){
-								CalculateIndicatorItemInfo minNum  = (CalculateIndicatorItemInfo)optionCodeGropListEntry.getValue().get(0).clone();
-								value = minNum.getQuantifiedValue();
-							}else {
-								continue;
-							}
-							for(CalculateIndicatorItemInfo cii : optionCodeGropListEntry.getValue()){
-								cii.setQuantifiedValue(value);
+								for (CalculateIndicatorItemInfo cii : optionCodeGropListEntry.getValue()) {
+									cii.setQuantifiedValue(value);
+								}
+								calculateIndicatorItemInfoService.saveOrUpdateBatch(optionCodeGropListEntry.getValue());
 							}
-							calculateIndicatorItemInfoService.saveOrUpdateBatch(optionCodeGropListEntry.getValue());
 						}
 					}
 				}
+				return code;
 			}
-
-			return code;
 		} catch (Exception e) {
 			e.printStackTrace();
 			return -1;
 		}
+		return 1;
 	}
 
 

+ 126 - 4
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateReportServiceImpl.java

@@ -1,6 +1,5 @@
 package com.ims.eval.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ims.common.utils.DoubleUtils;
@@ -10,7 +9,6 @@ import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.*;
 import com.ims.eval.dao.EvaluateReportMapper;
 import com.ims.eval.entity.dto.response.EvaluateReportInfoResDTO;
-import com.ims.eval.entity.dto.response.EvaluateRuleInfoResDTO;
 import com.ims.eval.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,6 +16,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -203,7 +202,9 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 			//各板块明细存储
 			List<EvaluateReportInfo> evaluateRuleInfoList = new ArrayList<>();
 
-
+			//首页数据
+			List<EvaluationPortal> portalList = new ArrayList<>();
+			List<EvaluationPortalAttach> portalAttachList = new ArrayList<>();
 
 			for (OrganizationEvaluationRule rule : ruleList) {
 
@@ -249,6 +250,10 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 				Double totalProfit = 0.00;//累加收入
 				Double spMultiply = 0.00;//收入
 				Double scjyScore = 0.0;//分数
+
+				String heighStandard = "";//高于基准分指标
+				String lowStandard ="";//低于基准分指标
+
 				if (null != brands && brands.size() > 0) {
 					MultipleBrand mb = brands.get(0);
 					//累加收入
@@ -256,6 +261,14 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 					//累加收入和分数的积
 
 					List<EvaluationScoreCount> scoreCount1 = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, rule.getId(), null, Arrays.asList("SCJY".split(",")),bi.getId());
+
+					heighStandard = scoreCount1.stream().filter(s->s.getStandard().equals("1")).map(EvaluationScoreCount::getRemark).collect(Collectors.joining(System.lineSeparator()));
+					lowStandard = scoreCount1.stream().filter(s->s.getStandard().equals("-1")).map(EvaluationScoreCount::getRemark).collect(Collectors.joining(System.lineSeparator()));
+
+
+
+
+					//等分
 					double score1 = scoreCount1.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
 					spMultiply = spMultiply + (mb.getProfit() * score1);
 
@@ -273,6 +286,27 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 				}
 
 
+
+				//首页季度考评排行数据对象
+				EvaluationPortal portal = new EvaluationPortal();
+				portal.setId(StringUtils.getUUID());
+				portal.setBinSection(bi.getSectionCode());
+				portal.setCompany(rule.getOrganizationShortName());
+				portal.setGrade("0");
+				portal.setBaseScore("NDKP".equals(rule.getEvaluationCycle()) ?150:100);
+				portal.setYear(evaluation.getYear());
+				portal.setSeason(evaluation.getMonth());//季度和月份用同一个字段;不同维度存储数据
+				portal.setMemo1(rule.getOrganizationId());//组织编码
+				portal.setCreateTime(new Date());
+
+
+				// 首页季度考评排行悬浮信息数据对象
+				EvaluationPortalAttach portalAttach = new EvaluationPortalAttach();
+				portalAttach.setId(StringUtils.getUUID());
+				portalAttach.setPortalId(portal.getId());
+
+
+				//报告详情数据对象
 				EvaluateReportInfo reportInfo = new EvaluateReportInfo();
 				reportInfo.setEvaluateReportId(evaluateReport.getId());
 				reportInfo.setOrganizationId(rule.getOrganizationId());
@@ -280,11 +314,19 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 
 				//生产经营得分
 				if(scjyScore>0){
-					reportInfo.setScjyScore(DoubleUtils.keepPrecision(scjyScore, 2));
+					reportInfo.setScjyScore(DoubleUtils.keepPrecision(scjyScore, 2));//保存到考评报告
+					portal.setScore(DoubleUtils.keepPrecision(scjyScore, 2));//保存到首页排行
 				}else {
+					//保存到考评报告
 					List<EvaluationScoreCount> scjyScoreCount = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, rule.getId(), null, Arrays.asList("SCJY".split(",")),bi.getId());
 					scjyScore = scjyScoreCount.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
 					reportInfo.setScjyScore(DoubleUtils.keepPrecision(scjyScore, 2));
+
+					//基准风
+					heighStandard = scjyScoreCount.stream().filter(s->s.getStandard().equals("1")).map(EvaluationScoreCount::getRemark).collect(Collectors.joining(System.lineSeparator()));
+					lowStandard = scjyScoreCount.stream().filter(s->s.getStandard().equals("-1")).map(EvaluationScoreCount::getRemark).collect(Collectors.joining(System.lineSeparator()));
+
+					portal.setScore(DoubleUtils.keepPrecision(scjyScore, 2));//保存到首页排行
 				}
 
 				//前期得分
@@ -299,6 +341,71 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 
 
 				List<EvaluationScoreCount> addSubScoreCount = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, rule.getId(), null, Arrays.asList("ZDZX,GLSX".split(",")),"");
+
+				//重点专项
+				List<EvaluationScoreCount> zdzxScoreCount  = addSubScoreCount.stream().filter(a->a.getBinStage().equals(CacheContext.bseCodeObject.get("ZDZX").getId())).collect(Collectors.toList());
+				//重点专项-加分
+				Double zdzxJfScore = zdzxScoreCount.stream().mapToDouble(EvaluationScoreCount::getJfScore).sum();
+				String zdzxJfRemark = zdzxScoreCount.stream().map(EvaluationScoreCount::getJfRemark).collect(Collectors.joining(System.lineSeparator()));
+
+				//重点专项-减分
+				Double zdzxkfScore = zdzxScoreCount.stream().mapToDouble(EvaluationScoreCount::getJfScore).sum();
+				String zdzxKfRemark = zdzxScoreCount.stream().map(EvaluationScoreCount::getKfRemark).collect(Collectors.joining(System.lineSeparator()));
+
+
+				//管理事项
+				List<EvaluationScoreCount> glsxScoreCount = addSubScoreCount.stream().filter(a -> a.getBinStage().equals(CacheContext.bseCodeObject.get("GLSX").getId())).collect(Collectors.toList());
+				//管理事项-加分
+				Double glsxjfScore = glsxScoreCount.stream().mapToDouble(EvaluationScoreCount::getJfScore).sum();
+				String glsxJfRemark = glsxScoreCount.stream().map(EvaluationScoreCount::getJfRemark).filter(Objects::nonNull).collect(Collectors.joining(System.lineSeparator()));
+
+				//管理事项-减分
+				Double glsxkfScore = glsxScoreCount.stream().mapToDouble(EvaluationScoreCount::getKfScore).sum();
+				String glsxKfRemark =  glsxScoreCount.stream().map(EvaluationScoreCount::getKfRemark).filter(Objects::nonNull).collect(Collectors.joining(System.lineSeparator()));
+
+
+
+				//重点专项-加分事项
+				if(zdzxJfScore>0){
+					portal.setMatterHeigh(1);
+					portalAttach.setMatterHeighNote(zdzxJfRemark);
+				}
+				//重点专项-扣分事项
+				if(zdzxkfScore<0){
+					portal.setMatterLow(-1);
+					portalAttach.setMatterHeighNote(zdzxKfRemark);
+				}
+
+				//管理事项-加分事项
+				if(glsxjfScore>0){
+					portal.setManageHeigh(1);
+					portalAttach.setManageHeightNote(glsxJfRemark);
+				}
+				//管理事项-扣分事项
+				if(glsxkfScore<0){
+					portal.setManageLow(-1);
+					portalAttach.setManageLowNote(glsxKfRemark);
+				}
+
+
+				//指标-高于基准分
+				if(StringUtils.isNotEmpty(heighStandard)){
+					portal.setStandardHeigh(1);
+					portalAttach.setStandardHeighNote(heighStandard);
+				}
+
+				//指标-低于基准分 lowStandard
+				if(StringUtils.isNotEmpty(lowStandard)){
+					portal.setStandardLow(-1);
+					portalAttach.setStandardLowNote(lowStandard);
+				}
+
+				//只有季度考评生成该记录
+				if("JDKP".equals(rule.getEvaluationCycle())){
+					portalList.add(portal);
+					portalAttachList.add(portalAttach);
+				}
+
 				Double addSubScore = addSubScoreCount.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
 				//加分项
 				double addScore = addSubScoreCount.stream().filter(a->a.getScore()>0).collect(Collectors.toList()).stream().mapToDouble(EvaluationScoreCount::getScore).sum();
@@ -354,6 +461,21 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 					throw new CustomException("综合考核评分汇总明细存储失败");
 				}
 			}
+
+			if(null !=portalList && portalList.size()>0){
+
+				Map<String, EvaluationPortalAttach> portalAttachMap = portalAttachList.stream()
+					.collect(Collectors.toMap(EvaluationPortalAttach::getPortalId, Function.identity()));
+				for (EvaluationPortal  po : portalList) {
+
+					try {
+						evaluationPortalService.saveSeasonPerformanceRanking(po,portalAttachMap.get(po.getId()));
+					} catch (Exception e) {
+						e.printStackTrace();
+					}
+				}
+			}
+
 		}
 		return true;
 	}

+ 26 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationPortalAttachServiceImpl.java

@@ -1,11 +1,16 @@
 package com.ims.eval.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ims.common.utils.StringUtils;
 import com.ims.eval.entity.EvaluationPortalAttach;
 import com.ims.eval.dao.EvaluationPortalAttachMapper;
 import com.ims.eval.service.IEvaluationPortalAttachService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+import java.util.stream.Collectors;
+
 /**
  * <p>
  * 考评首页附件 服务实现类
@@ -17,4 +22,25 @@ import org.springframework.stereotype.Service;
 @Service
 public class EvaluationPortalAttachServiceImpl extends ServiceImpl<EvaluationPortalAttachMapper, EvaluationPortalAttach> implements IEvaluationPortalAttachService {
 
+	@Override
+	public boolean removeEvaluationPortalAttach(String id, List<String> portalIds) {
+
+		QueryWrapper<EvaluationPortalAttach> qw = new QueryWrapper<>();
+
+		if(StringUtils.isNotEmpty(id)){
+			qw.lambda().eq(EvaluationPortalAttach::getId,id);
+		}
+		if(null != portalIds && portalIds.size()>0){
+			qw.lambda().in(EvaluationPortalAttach::getPortalId,portalIds);
+		}
+
+		List<EvaluationPortalAttach> list = baseMapper.selectList(qw);
+		if(null == list || list.size()<0){
+			return true;
+		}
+		List<String> idList = list.stream().map(EvaluationPortalAttach::getId).collect(Collectors.toList());
+		boolean b = this.removeByIds(idList);
+
+		return b;
+	}
 }

+ 12 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationPortalServiceImpl.java

@@ -16,6 +16,7 @@ import com.ims.eval.service.IOrganizationEvaluationService;
 import groovy.util.logging.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
 import java.util.stream.Collectors;
@@ -68,8 +69,12 @@ public class EvaluationPortalServiceImpl extends ServiceImpl<EvaluationPortalMap
 		return list;
 	}
 
+	@Transactional
 	@Override
 	public boolean saveSeasonPerformanceRanking(EvaluationPortal portal, EvaluationPortalAttach attach) {
+		if("FD".equals(portal.getBinSection())){
+			portal.setBinSection("XNYFG");
+		}
 		List<EvaluationPortal> portals = getEvaluationPortalList(portal.getYear(), portal.getSeason(), portal.getBinSection(), portal.getMemo1());
 		if (null != portals && portals.size() > 0) {
 			List<String> idList = portals.stream().map(EvaluationPortal::getId).collect(Collectors.toList());
@@ -77,8 +82,14 @@ public class EvaluationPortalServiceImpl extends ServiceImpl<EvaluationPortalMap
 			if (!b) {
 				throw new CustomException("操作失败");
 			}
-
+			if (null != idList && idList.size() > 0) {
+				b = evaluationPortalAttachService.removeEvaluationPortalAttach("", idList);
+				if (!b) {
+					throw new CustomException("操作失败");
+				}
+			}
 		}
+
 		boolean b1 = this.saveOrUpdate(portal);
 		if (!b1) {
 			throw new CustomException("操作失败");

+ 66 - 22
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationInfoServiceImpl.java

@@ -276,7 +276,10 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 						}
 						//计算差值等的最大值最小值
 
-						this.saveOrUpdateBatch(listUpdateInfos);
+						if(null != listUpdateInfos && listUpdateInfos.size()>0){
+							this.saveOrUpdateBatch(listUpdateInfos);
+						}
+
 						iCalculateIndicatorItemInfoService.saveIndicatorInfoDTO(organizationEvaluationId,indicatorGropListEntry.getValue(),indicatorId);
 					}
 				}
@@ -327,6 +330,22 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 										}
 
 										for (OrganizationEvaluationInfoResDTO dto: childCodeGropListEntry.getValue()){
+
+											//保存加减分原因
+											if("YY".equals(dto.getOptionCode()) || "JFYY".equals(dto.getOptionCode()) ||"KFYY".equals(dto.getOptionCode())){
+												scoreCount.setJfRemark(("YY".equals(dto.getOptionCode()) || "JFYY".equals(dto.getOptionCode()))?dto.getNonQuantifiedValue():"");
+												scoreCount.setKfRemark("KFYY".equals(dto.getOptionCode()) ? dto.getNonQuantifiedValue():"");
+											}
+
+											//保存加减分
+											if("JF".equals(dto.getOptionCode())){
+												scoreCount.setJfScore(dto.getQuantifiedValue());
+											}
+											if("KF".equals(dto.getOptionCode())){
+												scoreCount.setKfScore(dto.getQuantifiedValue());
+											}
+
+
 											if ((dto.getOptionCode().endsWith("MAX") ||dto.getOptionCode().endsWith("MIN")
 												||dto.getOptionCode().equals("CZ") || dto.getOptionCode().equals("LRGXL")
 												|| dto.getOptionCode().equals("DWQWLR")) || StringUtils.isEmpty(dto.getFormula())){
@@ -352,7 +371,6 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 											//替换属性值
 											for (OrganizationEvaluationInfoResDTO f : newInfoResInfo){
 												if(f.getOptionCode().endsWith("MIN") || f.getOptionCode().endsWith("MAX")){
-													System.out.println("-------"+f.getOptionCode());
 													f.setQuantifiedValue(map.get(f.getOptionCode()));
 												}
 												dto.setFormula(dto.getFormula().replace("["+f.getOptionCode()+"]", f.getQuantifiedValue() + ""));
@@ -369,13 +387,9 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 												||dto.getOptionCode().equals("JHDF")){
 												standardScore = dto.getStandardScore();
 												totalScore = totalScore+score;
-												//保存加减分原因
-												if("YY".equals(dto.getOptionCode())){
-													scoreCount.setRemark(dto.getNonQuantifiedValue());
-												}else if(!"ZDZX".equals(dto.getStageCode()) && !"GLSX".equals(dto.getStageCode())){
-													scoreCount.setRemark(dto.getIndicatorName());
-												}
+												scoreCount.setRemark(dto.getIndicatorName());
 											}
+
 											log.info(dto.getOrganizationShortName()+"|"+dto.getIndicatorName()+"|"+dto.getOptionCode()+"----------"+dto.getFormula()+"="+score);
 											OrganizationEvaluationInfo info  = new OrganizationEvaluationInfo();
 											//将计算结果保存
@@ -925,34 +939,58 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 			}
 
 			List<OrganizationEvaluationInfo> evaluationInfos =new ArrayList<>();
+			//总分 加扣分
 			double score = 0.00;
+			double jfScore = 0.00;
+			double kfScore = 0.00;
+
+			//加扣分原因
+			String  jfRemark ="";
+			String  kfRemark ="";
+
 			String scoreid ="";
+
 			for (Map.Entry<String,Object > entry : idMap.entrySet()) {
 				OrganizationEvaluationInfo info = new OrganizationEvaluationInfo();
 				info.setId(entry.getValue().toString());
 				String quantified = valueMap.get(entry.getKey().replace("ID_","IS_LH_")).toString();
-				if(null != valueMap.get(entry.getKey().replace("ID_", ""))){
-				if ("1".equals(quantified)) {
+				if(null != valueMap.get(entry.getKey().replace("ID_", ""))) {
 
-					if (MathCalculatorUtil.isNumber(String.valueOf(valueMap.get(entry.getKey().replace("ID_", "")).toString()))) {
-						info.setQuantifiedValue(Double.valueOf(valueMap.get(entry.getKey().replace("ID_", "")).toString()));
+					//加分 扣分 加扣分原因
+					if (entry.getKey().endsWith("_JFYY")) {
+						jfRemark = valueMap.get(entry.getKey().replace("ID_", "")).toString();
+					}
 
-						//得分
-						if (entry.getKey().endsWith("_DF") || entry.getKey().endsWith("_DF2")|| entry.getKey().endsWith("_JHDF")) {
-							score = score + info.getQuantifiedValue();
-							scoreid = entry.getValue().toString();
-						}
+					if (entry.getKey().endsWith("_KFYY")) {
+						kfRemark = valueMap.get(entry.getKey().replace("ID_", "")).toString();
+					}
 
 
+					if ("1".equals(quantified)) {
 
-					} else {
-						info.setQuantifiedValue(0);
+						if (MathCalculatorUtil.isNumber(String.valueOf(valueMap.get(entry.getKey().replace("ID_", "")).toString()))) {
+							info.setQuantifiedValue(Double.valueOf(valueMap.get(entry.getKey().replace("ID_", "")).toString()));
 
-					}
+							//得分
+							if (entry.getKey().endsWith("_DF") || entry.getKey().endsWith("_DF2") || entry.getKey().endsWith("_JHDF")) {
+								score = score + info.getQuantifiedValue();
+								scoreid = entry.getValue().toString();
+							}
 
-				}
+							//加分 扣分
+							if (entry.getKey().endsWith("_JF")) {
+								jfScore = Double.valueOf(valueMap.get(entry.getKey().replace("ID_", "")).toString());
+							}
+							if (entry.getKey().endsWith("_KF")) {
+								kfScore = Double.valueOf(valueMap.get(entry.getKey().replace("ID_", "")).toString());
+							}
+
+						} else {
+							info.setQuantifiedValue(0);
+						}
+					}
 
-				info.setNonQuantifiedValue(valueMap.get(entry.getKey().replace("ID_","")).toString());
+					info.setNonQuantifiedValue(valueMap.get(entry.getKey().replace("ID_", "")).toString());
 				}else {
 					info.setQuantifiedValue(0);
 					info.setNonQuantifiedValue("");
@@ -967,9 +1005,15 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 				List<EvaluationScoreCount>  listcount = evaluatioinScoreCountService.getEvaluationScoreCountList(info.getOrganizationEvaluationId(),info.getOrganizationEvaluationRuleId(),info.getIndicatorId(),"");
 				if(null != listcount && listcount.size()>0){
 					EvaluationScoreCount count = listcount.get(0);
+					count.setJfScore(jfScore);
+					count.setKfScore(kfScore);
+					count.setJfRemark(jfRemark);
+					count.setKfRemark(kfRemark);
 					count.setScore(score);
 					count.setObversionScore(score);
 					evaluatioinScoreCountService.saveOrUpdate(count);
+				}else {
+					calculationByEvaluationId("", info.getIndicatorId(),info.getOrganizationEvaluationId(),"");
 				}
 			}
 		}

+ 11 - 20
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationRuleServiceImpl.java

@@ -292,13 +292,6 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 	@Transactional
 	@Override
 	public boolean saveOrUpdate(OrganizationEvaluationRule entity) {
-		//如果是存在主键  则修改
-		if (null != entity && (null != entity.getId() && !"".equals(entity.getId().trim()))) {
-			OrganizationEvaluationRule update = baseMapper.selectById(entity.getId());
-			update.setDelFlag(true);
-			update.setUpdateTime(new Date());
-			baseMapper.updateById(update);
-		}
 
 		List<String> evaluateRuleIds = Arrays.asList(entity.getEvaluateRuleId().split(","));
 		List<EvaluateRule> evaluateRuleList = evaluateRuleService.listAll(evaluateRuleIds);
@@ -312,25 +305,23 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 			entity.setBinStage(String.join(",", binStages));
 		}
 
-		//型增时判断当前组织是否存在同期考评配置
-		QueryWrapper<OrganizationEvaluationRule> qw = new QueryWrapper<>();
-		qw.lambda().eq(OrganizationEvaluationRule::getOrganizationId, entity.getOrganizationId());
-		qw.lambda().eq(OrganizationEvaluationRule::getEvaluationCycle, entity.getEvaluationCycle());
-//		qw.lambda().eq(OrganizationEvaluationRule::getBinSection, entity.getBinSection());
-
-		qw.lambda().eq(OrganizationEvaluationRule::getDelFlag, false);
-		List<OrganizationEvaluationRule> list = baseMapper.selectList(qw);
-		if (null != list && list.size() > 0) {
-			throw new CustomException("已存在同期考评配置");
+		if (null != entity && (null == entity.getId() || "".equals(entity.getId().trim()))) {
+			//型增时判断当前组织是否存在同期考评配置
+			QueryWrapper<OrganizationEvaluationRule> qw = new QueryWrapper<>();
+			qw.lambda().eq(OrganizationEvaluationRule::getOrganizationId, entity.getOrganizationId());
+			qw.lambda().eq(OrganizationEvaluationRule::getEvaluationCycle, entity.getEvaluationCycle());
+			qw.lambda().eq(OrganizationEvaluationRule::getYear,entity.getYear());
+			qw.lambda().eq(OrganizationEvaluationRule::getDelFlag, false);
+			List<OrganizationEvaluationRule> list = baseMapper.selectList(qw);
+			if (null != list && list.size() > 0) {
+				throw new CustomException("已存在同期考评配置");
+			}
 		}
-
 		//判断排序字段是否有值
 		if(null==entity.getOrderNum()){
 			int count = baseMapper.selectCount(null);
 			entity.setOrderNum(count);
 		}
-		//处理id为空
-		entity.setId(null);
 		//默认未删除
 		entity.setDelFlag(false);
 		return super.saveOrUpdate(entity);

+ 1 - 1
ims-service/ims-eval/src/main/resources/mappers/EvaluationPortalMapper.xml

@@ -91,7 +91,7 @@
                 AND ep.season = #{season}
             </if>
 
-            <if test="season ==null or season !=''">
+            <if test="season ==null or season ==''">
                 AND ep.season is null
             </if>