‘xugp 1 рік тому
батько
коміт
0df16815d7

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

@@ -65,7 +65,7 @@ public class OrganizationEvaluationInfoController {
 			} else {
 				return R.error().data("保存失败!");
 			}
-		} catch (CustomException e){
+		} catch (Exception e) {
 			return R.customError(e.getMessage()).data("失败!");
 		}
 	}

+ 3 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/dao/CalculateIndicatorItemInfoMapper.java

@@ -1,9 +1,7 @@
 package com.ims.eval.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ims.eval.entity.BinSection;
-import com.ims.eval.entity.CalculateIndicatorItmeInfo;
-import jdk.internal.dynalink.linker.LinkerServices;
+import com.ims.eval.entity.CalculateIndicatorItemInfo;
 
 import java.util.List;
 
@@ -15,8 +13,8 @@ import java.util.List;
  * @author xugp
  * @since 2023-03-26
  */
-public interface CalculateIndicatorItemInfoMapper extends BaseMapper<CalculateIndicatorItmeInfo> {
+public interface CalculateIndicatorItemInfoMapper extends BaseMapper<CalculateIndicatorItemInfo> {
 
-	List<CalculateIndicatorItmeInfo> selectList(String organizationType,String checkCycle,String year,String month);
+	List<CalculateIndicatorItemInfo> selectList(String organizationType, String checkCycle, String year, String month);
 
 }

+ 6 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/entity/CalculateIndicatorItmeInfo.java

@@ -12,7 +12,7 @@ import lombok.Data;
  */
 
 @Data
-public class CalculateIndicatorItmeInfo extends Model {
+public class CalculateIndicatorItemInfo extends Model {
 
 	private static final long serialVersionUID = 1L;
 
@@ -61,6 +61,11 @@ public class CalculateIndicatorItmeInfo extends Model {
 	 */
 	private double quantifiedValue;
 
+	/**
+	 * 标识  1标记最大值  0标记最小值
+	 */
+	private String mark;
+
 
 
 }

+ 4 - 4
ims-service/ims-eval/src/main/java/com/ims/eval/schedule/ScoreCalculationSchedule.java

@@ -122,8 +122,8 @@ public class ScoreCalculationSchedule {
 			Map<String, Double> doubleMap = list.stream().collect(Collectors.toMap(OrganizationEvaluationInfo::getOptionCode, OrganizationEvaluationInfo::getQuantifiedValue));
 			//添加计算指标项的code和值  例如:差值最大值和最小值
 			OrganizationEvaluation organizationEvaluation = organizationEvaluationMapper.selectById(list.get(0).getOrganizationEvaluationId());
-			List<CalculateIndicatorItmeInfo> calculateIndicatorItmeInfos = calculateIndicatorItemInfoMapper.selectList(organizationEvaluation.getOrganizationType(),organizationEvaluation.getCheckCycle(),organizationEvaluation.getYear(),organizationEvaluation.getMonth());
-			calculateIndicatorItmeInfos.stream().forEach(r ->{
+			List<CalculateIndicatorItemInfo> calculateIndicatorItemInfos = calculateIndicatorItemInfoMapper.selectList(organizationEvaluation.getOrganizationType(),organizationEvaluation.getCheckCycle(),organizationEvaluation.getYear(),organizationEvaluation.getMonth());
+			calculateIndicatorItemInfos.stream().forEach(r ->{
 				doubleMap.put(r.getOptionCode(),r.getQuantifiedValue());
 			});
 			//查询得分规则公式
@@ -208,7 +208,7 @@ public class ScoreCalculationSchedule {
 	public static void main(String[] args) {
 
 
-		String sc = "if(1>0,-1*1/maxnum(1)+5,1*1/minnum(2)+5)*2";
+		String sc = "if(10+1*2/maxnum(1)>12,12,if(1<0,10-1*2/minnum(1),10+1*2/maxnum(1)))";
 
 
 		String s2 = "if(1>0,-1*2/maxnum(2)+10,1*2/minnum(1)+10)";
@@ -220,7 +220,7 @@ public class ScoreCalculationSchedule {
 		String sc = MathCalculatorUtil.calculator(sd);*/
 		String ss = "if(max(1,3)<1,1,2)";
 		String s9 = "maxmin()";
-		ArrayList<Token> tokens = Analyzer.getTokens(s2);
+		ArrayList<Token> tokens = Analyzer.getTokens(sc);
 
 		//使用不同编码代替函数
 		AlarmExpression alarmExpression = Analyzer.createAlarmExpression(tokens);

+ 4 - 4
ims-service/ims-eval/src/main/java/com/ims/eval/service/ICalculateIndicatorItemInfoService.java

@@ -1,8 +1,8 @@
 package com.ims.eval.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ims.eval.entity.BinSection;
-import com.ims.eval.entity.CalculateIndicatorItmeInfo;
+import com.ims.eval.entity.CalculateIndicatorItemInfo;
+import com.ims.eval.entity.OrganizationEvaluationInfo;
 
 import java.util.List;
 
@@ -14,7 +14,7 @@ import java.util.List;
  * @author xugp
  * @since 2023-03-26
  */
-public interface ICalculateIndicatorItemInfoService extends IService<CalculateIndicatorItmeInfo> {
+public interface ICalculateIndicatorItemInfoService extends IService<CalculateIndicatorItemInfo> {
 
-	int save(String organizationType,String checkCycle,String year,String month) throws Exception;
+	int saveIndicatorInfo(List<OrganizationEvaluationInfo> organizationEvaluationInfos) throws Exception;
 }

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

@@ -21,6 +21,6 @@ public interface IOrganizationEvaluationInfoService extends IService<Organizatio
 
 	Map finishValueList(String organizationEvaluationId, String dept);
 
-	boolean saveBatchDto(List<OrganizationEvaluationInfoUpdateDTO>  evaluationInfoUpdateDTOS);
+	boolean saveBatchDto(List<OrganizationEvaluationInfoUpdateDTO>  evaluationInfoUpdateDTOS) throws Exception;
 
 }

+ 100 - 114
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/CalculateIndicatorItemInfoServiceImpl.java

@@ -2,20 +2,15 @@ package com.ims.eval.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ims.common.utils.StringUtils;
-import com.ims.eval.config.CustomException;
 import com.ims.eval.dao.*;
-import com.ims.eval.entity.BinSection;
-import com.ims.eval.entity.CalculateIndicatorItmeInfo;
-import com.ims.eval.entity.OrganizationEvaluation;
+import com.ims.eval.entity.CalculateIndicatorItemInfo;
 import com.ims.eval.entity.OrganizationEvaluationInfo;
-import com.ims.eval.service.IBinSectionService;
+import com.ims.eval.entity.dto.response.OrganizationEvaluationResDTO;
 import com.ims.eval.service.ICalculateIndicatorItemInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import javax.annotation.Resource;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -28,11 +23,9 @@ import java.util.stream.Collectors;
  * @since 2023-03-26
  */
 @Service
-public class CalculateIndicatorItemInfoServiceImpl extends ServiceImpl<CalculateIndicatorItemInfoMapper, CalculateIndicatorItmeInfo> implements ICalculateIndicatorItemInfoService {
+public class CalculateIndicatorItemInfoServiceImpl extends ServiceImpl<CalculateIndicatorItemInfoMapper, CalculateIndicatorItemInfo> implements ICalculateIndicatorItemInfoService {
 
 
-	@Resource
-	private OrganizationEvaluationInfoMapper organizationEvaluationInfoMapper;
 
 	@Autowired
 	private OrganizationEvaluationMapper organizationEvaluationMapper;
@@ -43,127 +36,120 @@ public class CalculateIndicatorItemInfoServiceImpl extends ServiceImpl<Calculate
 	@Autowired
 	private IndicatorMapper indicatorMapper;
 
-	@Override
-	public int save(String organizationType,String checkCycle, String year,String month) throws Exception {
-
-		List<CalculateIndicatorItmeInfo> list = new ArrayList<>();
-		//加载单位/部门考评记录
-		QueryWrapper<OrganizationEvaluation> or = new QueryWrapper<>();
-
-		if (StringUtils.isNotEmpty(organizationType)) {
-			or.lambda().eq(OrganizationEvaluation::getOrganizationType, organizationType);
-		}
-
-		if (StringUtils.isNotEmpty(checkCycle)) {
-			or.lambda().eq(OrganizationEvaluation::getCheckCycle, checkCycle);
-		}
-		if (StringUtils.isNotEmpty(year)) {
-			or.lambda().eq(OrganizationEvaluation::getYear, year);
-		}
-
-		if (StringUtils.isNotEmpty(month)) {
-			or.lambda().eq(OrganizationEvaluation::getMonth, month);
-		}
 
-		List<OrganizationEvaluation> organizationEvaluations = organizationEvaluationMapper.selectList(or);
-		if (organizationEvaluations.size() <= 0) {
-			throw new Exception("考评记录为空!!!");
-		}
-
-		for (OrganizationEvaluation organizationEvaluation : organizationEvaluations) {
-			//加载该考评记录下的考评指标明细数据
-			QueryWrapper<OrganizationEvaluationInfo> qw = new QueryWrapper<>();
-			if (StringUtils.isNotEmpty(organizationEvaluation.getOrganizationEvaluationRuleId())) {
-				qw.lambda().in(OrganizationEvaluationInfo::getOrganizationEvaluationRuleId, organizationEvaluation.getOrganizationEvaluationRuleId());
-			}
-			List<OrganizationEvaluationInfo> organizationEvaluationInfos = organizationEvaluationInfoMapper.selectList(qw);
-			//对考评规则id进行分组
-			Map<String, List<OrganizationEvaluationInfo>> collect = organizationEvaluationInfos.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfo::getOrganizationEvaluationRuleId));
-			for (Map.Entry<String, List<OrganizationEvaluationInfo>> entry : collect.entrySet()) {
-				if (entry.getValue().size() > 0) {
-					//对指标id进行分组
-					Map<String, List<OrganizationEvaluationInfo>> collectIn = entry.getValue().stream().collect(Collectors.groupingBy(OrganizationEvaluationInfo::getIndicatorId));
-					for (Map.Entry<String, List<OrganizationEvaluationInfo>> listEntry : collectIn.entrySet()) {
-						List<OrganizationEvaluationInfo> listEntryValue = listEntry.getValue();
-						listEntryValue.stream().forEach(r -> {
-							if (r.getOptionCode().equals("CZ") || r.getOptionCode().equals("LRGXKL") || r.getOptionCode().equals("DWQWLR")) {
-								CalculateIndicatorItmeInfo calculateIndicatorItmeInfo = new CalculateIndicatorItmeInfo();
-								calculateIndicatorItmeInfo.setIndicatorId(listEntry.getKey());
-								calculateIndicatorItmeInfo.setOptionCode(r.getOptionCode());
-								calculateIndicatorItmeInfo.setQuantifiedValue(r.getQuantifiedValue());
-								calculateIndicatorItmeInfo.setSectionId(indicatorMapper.selectById(listEntry.getKey()).getBinSection());
-								calculateIndicatorItmeInfo.setOrganizationType(organizationEvaluation.getOrganizationType());
-								calculateIndicatorItmeInfo.setCheckCycle(organizationEvaluation.getCheckCycle());
-								calculateIndicatorItmeInfo.setYear(organizationEvaluation.getYear());
-								calculateIndicatorItmeInfo.setMonth(organizationEvaluation.getMonth());
-								list.add(calculateIndicatorItmeInfo);
-							}
-						});
+	@Override
+	public int saveIndicatorInfo(List<OrganizationEvaluationInfo> organizationEvaluationInfos) throws Exception {
+
+		List<CalculateIndicatorItemInfo> list = new ArrayList<>();
+
+		OrganizationEvaluationResDTO organizationEvaluationResDTO = organizationEvaluationMapper.selectById(organizationEvaluationInfos.get(0).getOrganizationEvaluationId());
+		//对考评规则id进行分组
+		Map<String, List<OrganizationEvaluationInfo>> collect = organizationEvaluationInfos.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfo::getOrganizationEvaluationRuleId));
+		for (Map.Entry<String, List<OrganizationEvaluationInfo>> entry : collect.entrySet()) {
+			if (entry.getValue().size() > 0) {
+				//对指标id进行分组
+				Map<String, List<OrganizationEvaluationInfo>> collectIn = entry.getValue().stream().collect(Collectors.groupingBy(OrganizationEvaluationInfo::getIndicatorId));
+				for (Map.Entry<String, List<OrganizationEvaluationInfo>> listEntry : collectIn.entrySet()) {
+					List<OrganizationEvaluationInfo> listEntryValue = listEntry.getValue();
+					for (OrganizationEvaluationInfo r : listEntryValue){
+						if (r.getOptionCode().equals("CZ") || r.getOptionCode().equals("LRGXL") || r.getOptionCode().equals("DWQWLR")) {
+							CalculateIndicatorItemInfo calculateIndicatorItemInfo = new CalculateIndicatorItemInfo();
+							calculateIndicatorItemInfo.setIndicatorId(listEntry.getKey());
+							calculateIndicatorItemInfo.setOptionCode(r.getOptionCode());
+							calculateIndicatorItemInfo.setQuantifiedValue(r.getQuantifiedValue());
+							calculateIndicatorItemInfo.setSectionId(indicatorMapper.selectById(listEntry.getKey()).getBinSection());
+							calculateIndicatorItemInfo.setOrganizationType(organizationEvaluationResDTO.getOrganizationType());
+							calculateIndicatorItemInfo.setCheckCycle(organizationEvaluationResDTO.getCheckCycle());
+							calculateIndicatorItemInfo.setYear(organizationEvaluationResDTO.getYear());
+							calculateIndicatorItemInfo.setMonth(organizationEvaluationResDTO.getMonth());
+							list.add(calculateIndicatorItemInfo);
+						}
 					}
 				}
 			}
 		}
+
 		return saveCalculate(list);
 	}
 
 
-	public int saveCalculate(List<CalculateIndicatorItmeInfo> list) throws Exception {
+	@Transactional
+	public int saveCalculate(List<CalculateIndicatorItemInfo> list) throws Exception {
 
 		//遍历list解析最大值和最小值
 		if (list.size() > 0){
-			Map<String, List<CalculateIndicatorItmeInfo>> collect = list.stream().collect(Collectors.groupingBy(CalculateIndicatorItmeInfo::getOptionCode));
-			for (Map.Entry<String, List<CalculateIndicatorItmeInfo>> listEntry : collect.entrySet()){
-				CalculateIndicatorItmeInfo maxNum = listEntry.getValue().stream().max(Comparator.comparing(CalculateIndicatorItmeInfo::getQuantifiedValue)).get();
-				//判断计算指标明细中之前是否存在记录 如果存在删除之前记录,重新新增
-				QueryWrapper<CalculateIndicatorItmeInfo> qw = new QueryWrapper<>();
-				qw.lambda().eq(CalculateIndicatorItmeInfo::getYear, maxNum.getYear());
-				qw.lambda().eq(CalculateIndicatorItmeInfo::getMonth, maxNum.getMonth());
-				qw.lambda().eq(CalculateIndicatorItmeInfo::getOptionCode, maxNum.getOptionCode());
-				qw.lambda().eq(CalculateIndicatorItmeInfo::getCheckCycle, maxNum.getCheckCycle());
-				qw.lambda().eq(CalculateIndicatorItmeInfo::getOrganizationType, maxNum.getOrganizationType());
-				CalculateIndicatorItmeInfo calculateIndicatorItmeInfo = calculateIndicatorItemInfoMapper.selectOne(qw);
-				if (calculateIndicatorItmeInfo != null){
-					calculateIndicatorItemInfoMapper.deleteById(calculateIndicatorItmeInfo.getId());
-				}else {
-					if (listEntry.getKey().equals("CZ")){
-						//存储最大值
-						maxNum.setOptionCode("CZMAX");
-						calculateIndicatorItemInfoMapper.insert(maxNum);
-					}else if (listEntry.getKey().equals("LRGXKL")){
-						maxNum.setOptionCode("LRGXKLMAX");
-						calculateIndicatorItemInfoMapper.insert(maxNum);
-					}else if (listEntry.getKey().equals("DWQWLR")){
-						maxNum.setOptionCode("DWQWLRMAX");
-						calculateIndicatorItemInfoMapper.insert(maxNum);
+			Map<String, List<CalculateIndicatorItemInfo>> collect = list.stream().collect(Collectors.groupingBy(CalculateIndicatorItemInfo::getOptionCode));
+			for (Map.Entry<String, List<CalculateIndicatorItemInfo>> listEntry : collect.entrySet()){
+
+				//从小到大的顺序排序
+				Collections.sort(listEntry.getValue(), new Comparator<CalculateIndicatorItemInfo>() {
+					@Override
+					public int compare(CalculateIndicatorItemInfo u1, CalculateIndicatorItemInfo u2) {
+						double diff = u1.getQuantifiedValue() - u2.getQuantifiedValue();
+						if (diff > 0) {
+							return 1;
+						} else if (diff < 0) {
+							return -1;
+						}
+						return 0; //相等为0
 					}
+				});
+
+				CalculateIndicatorItemInfo maxNum = listEntry.getValue().get(listEntry.getValue().size()-1);
+				maxNum.setMark("1");
+
+				CalculateIndicatorItemInfo minNum = listEntry.getValue().get(0);
+				minNum.setMark("0");
+
+				//判断计算指标明细中之前是否存在记录 如果存在删除之前记录,重新新增
+				QueryWrapper<CalculateIndicatorItemInfo> qw = new QueryWrapper<>();
+				qw.lambda().eq(CalculateIndicatorItemInfo::getYear, maxNum.getYear());
+				qw.lambda().eq(CalculateIndicatorItemInfo::getMonth, maxNum.getMonth());
+				qw.lambda().eq(CalculateIndicatorItemInfo::getOptionCode, maxNum.getOptionCode());
+				qw.lambda().eq(CalculateIndicatorItemInfo::getCheckCycle, maxNum.getCheckCycle());
+				qw.lambda().eq(CalculateIndicatorItemInfo::getOrganizationType, maxNum.getOrganizationType());
+				qw.lambda().eq(CalculateIndicatorItemInfo::getMark, maxNum.getMark());
+				CalculateIndicatorItemInfo calculateIndicatorItemInfo = calculateIndicatorItemInfoMapper.selectOne(qw);
+
+				if (calculateIndicatorItemInfo != null){
+					calculateIndicatorItemInfoMapper.deleteById(calculateIndicatorItemInfo.getId());
+				}
+
+				if (listEntry.getKey().equals("CZ")){
+					//存储最大值
+					maxNum.setOptionCode("CZMAX");
+				}else if (listEntry.getKey().equals("LRGXL")){
+					maxNum.setOptionCode("LRGXKLMAX");
+				}else if (listEntry.getKey().equals("DWQWLR")){
+					maxNum.setOptionCode("DWQWLRMAX");
 				}
+				int insert = calculateIndicatorItemInfoMapper.insert(maxNum);
 
-				CalculateIndicatorItmeInfo minNum = listEntry.getValue().stream().min(Comparator.comparing(CalculateIndicatorItmeInfo::getQuantifiedValue)).get();
 				//判断计算指标明细中之前是否存在记录 如果存在删除之前记录,重新新增
-				QueryWrapper<CalculateIndicatorItmeInfo> qw1 = new QueryWrapper<>();
-				qw.lambda().eq(CalculateIndicatorItmeInfo::getYear, minNum.getYear());
-				qw.lambda().eq(CalculateIndicatorItmeInfo::getMonth, minNum.getMonth());
-				qw.lambda().eq(CalculateIndicatorItmeInfo::getOptionCode, minNum.getOptionCode());
-				qw.lambda().eq(CalculateIndicatorItmeInfo::getCheckCycle, minNum.getCheckCycle());
-				qw.lambda().eq(CalculateIndicatorItmeInfo::getOrganizationType, minNum.getOrganizationType());
-				CalculateIndicatorItmeInfo calculateIndicatorItmeInfo1 = calculateIndicatorItemInfoMapper.selectOne(qw1);
-				if (calculateIndicatorItmeInfo1 != null){
-					calculateIndicatorItemInfoMapper.deleteById(calculateIndicatorItmeInfo1.getId());
-				}else {
-					if (listEntry.getKey().equals("CZ")){
-						//存储最小值
-						maxNum.setOptionCode("CZMIN");
-						calculateIndicatorItemInfoMapper.insert(minNum);
-					}else if (listEntry.getKey().equals("LRGXKL")){
-						//存储最小值
-						maxNum.setOptionCode("LRGXKLMIN");
-						calculateIndicatorItemInfoMapper.insert(minNum);
-					}else if (listEntry.getKey().equals("DWQWLR")){
-						//存储最小值
-						maxNum.setOptionCode("DWQWLRMIN");
-						calculateIndicatorItemInfoMapper.insert(minNum);
-					}
+				QueryWrapper<CalculateIndicatorItemInfo> qw1 = new QueryWrapper<>();
+				qw1.lambda().eq(CalculateIndicatorItemInfo::getYear, minNum.getYear());
+				qw1.lambda().eq(CalculateIndicatorItemInfo::getMonth, minNum.getMonth());
+				qw1.lambda().eq(CalculateIndicatorItemInfo::getOptionCode, minNum.getOptionCode());
+				qw1.lambda().eq(CalculateIndicatorItemInfo::getCheckCycle, minNum.getCheckCycle());
+				qw1.lambda().eq(CalculateIndicatorItemInfo::getOrganizationType, minNum.getOrganizationType());
+				qw1.lambda().eq(CalculateIndicatorItemInfo::getMark, minNum.getMark());
+				CalculateIndicatorItemInfo calculateIndicatorItemInfo1 = calculateIndicatorItemInfoMapper.selectOne(qw1);
+
+				if (calculateIndicatorItemInfo1 != null){
+					calculateIndicatorItemInfoMapper.deleteById(calculateIndicatorItemInfo1.getId());
+				}
+
+				if (listEntry.getKey().equals("CZ")){
+					//存储最小值
+					minNum.setOptionCode("CZMIN");
+				}else if (listEntry.getKey().equals("LRGXL")){
+					//存储最小值
+					minNum.setOptionCode("LRGXKLMIN");
+				}else if (listEntry.getKey().equals("DWQWLR")){
+					//存储最小值
+					minNum.setOptionCode("DWQWLRMIN");
 				}
+				int insert1 = calculateIndicatorItemInfoMapper.insert(minNum);
 			}
 		}else {
 			throw new Exception("计算指标项明细为空");

+ 24 - 3
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationInfoServiceImpl.java

@@ -8,8 +8,10 @@ import com.ims.eval.entity.dto.request.OrganizationEvaluationInfoUpdateDTO;
 import com.ims.eval.entity.dto.request.ResponsibilityIndicatorInfoUpdateDTO;
 import com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO;
 import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
+import com.ims.eval.service.ICalculateIndicatorItemInfoService;
 import com.ims.eval.service.IOrganizationEvaluationInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -32,6 +34,9 @@ import java.util.stream.Collectors;
 @Service
 public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<OrganizationEvaluationInfoMapper, OrganizationEvaluationInfo> implements IOrganizationEvaluationInfoService {
 
+	@Autowired
+	private ICalculateIndicatorItemInfoService iCalculateIndicatorItemInfoService;
+
 	@Override
 	public Map finishValueList(String organizationEvaluationId, String dept) {
 
@@ -45,7 +50,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 
 	@Transactional
 	@Override
-	public boolean saveBatchDto(List<OrganizationEvaluationInfoUpdateDTO> evaluationInfoUpdateDTOS) {
+	public boolean saveBatchDto(List<OrganizationEvaluationInfoUpdateDTO> evaluationInfoUpdateDTOS) throws Exception {
 		for (OrganizationEvaluationInfoUpdateDTO entity : evaluationInfoUpdateDTOS) {
 			OrganizationEvaluationInfo organizationEvaluationInfo = baseMapper.selectById(entity.getId());
 
@@ -64,6 +69,24 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 		OrganizationEvaluationInfo organizationEvaluationInfo = baseMapper.selectById(evaluationInfoUpdateDTOS.get(0).getId());
 		//查询本次考评所有考评指标明细
 		List<OrganizationEvaluationInfo> organizationEvaluationInfos = baseMapper.selectByEvaluationInfoId(organizationEvaluationInfo.getOrganizationEvaluationId());
+
+		//调用需要计算指标项的方法
+		boolean calculate = calculateIdicatorItem(organizationEvaluationInfos);
+
+		//调用计算存储最大值,最小值的方法
+		if (calculate){
+			iCalculateIndicatorItemInfoService.saveIndicatorInfo(organizationEvaluationInfos);
+		}
+
+
+		return true;
+	}
+
+
+	//todo  后续添加需要计算的指标项
+	public boolean calculateIdicatorItem(List<OrganizationEvaluationInfo> organizationEvaluationInfos){
+
+
 		//根据考评规则分组
 		Map<String, List<OrganizationEvaluationInfo>> collect1 = organizationEvaluationInfos.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfo::getOrganizationEvaluationRuleId));
 		for (Map.Entry<String, List<OrganizationEvaluationInfo>> entry1 : collect1.entrySet()){
@@ -76,7 +99,6 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 					List<OrganizationEvaluationInfo> wcz = entry.getValue().stream().filter(r -> r.getOptionCode().equals("WCZ")).collect(Collectors.toList());
 					List<OrganizationEvaluationInfo> value = entry.getValue().stream().filter(r -> r.getOptionCode().equals("JHZ") || r.getOptionCode().equals("DBZ") || r.getOptionCode().equals("MBZ")).collect(Collectors.toList());
 
-					//todo  后续添加需要计算的指标项
 					//完成值与目标值 ||计划值||对标值进行计算
 					if (wcz.size() == 1 && value.size() == 1){
 						double wczValue = wcz.get(0).getQuantifiedValue();
@@ -117,7 +139,6 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 
 			}
 		}
-
 		return true;
 	}
 }

+ 2 - 2
ims-service/ims-eval/src/main/resources/mappers/CalculateIndicatorItemInfoMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ims.eval.dao.CalculateIndicatorItemInfoMapper">
 
-    <select id="selectList" resultType="com.ims.eval.entity.CalculateIndicatorItmeInfo">
+    <select id="selectList" resultType="com.ims.eval.entity.CalculateIndicatorItemInfo">
         SELECT
             *
         FROM
@@ -10,7 +10,7 @@
         <where>
             1=1
             <if test="organizationType !=null and organizationType !=''">
-                and a.organizator_type=#{organizationType}
+                and a.organization_type=#{organizationType}
             </if>
             <if test="checkCycle !=null and checkCycle !=''">
                 and a.check_cycle=#{checkCycle}