瀏覽代碼

Merge remote-tracking branch 'origin/master'

‘xugp 1 年之前
父節點
當前提交
5fe1142d9d

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

@@ -1,11 +1,11 @@
 package com.ims.eval.controller;
 
 
-import com.ims.eval.config.CustomException;
-import com.ims.eval.entity.dto.request.OrganizationEvaluationInfoUpdateDTO;
+import com.ims.eval.entity.OrganizationEvaluationInfo;
 import com.ims.eval.entity.dto.result.R;
 import com.ims.eval.service.IOrganizationEvaluationInfoService;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -22,6 +22,7 @@ import java.util.Map;
  * @author wang
  * @since 2023-03-16
  */
+@Slf4j
 @RestController
 @RequestMapping("//organization-evaluation-info")
 public class OrganizationEvaluationInfoController {
@@ -49,23 +50,24 @@ public class OrganizationEvaluationInfoController {
 	/**
 	 * 批量修改
 	 *
-	 * @param evaluationInfoUpdateDTOS
+	 * @param OrganizationEvaluationInfo
 	 * @return
 	 */
 
 	//@ImsPreAuth("eval:organizationEvaluationInfo:edit")
 	@PostMapping(value = "/saveBatchDto")
 	@ApiOperation(value = "批量新增(修改)", notes = "批量新增(修改)")
-	public R saveBatchDto(@RequestBody List<OrganizationEvaluationInfoUpdateDTO> evaluationInfoUpdateDTOS) {
+	public R saveBatchDto(@RequestBody List<OrganizationEvaluationInfo> OrganizationEvaluationInfo) {
 
 		try {
-			boolean b = organizationEvaluationInfoService.saveBatchDto(evaluationInfoUpdateDTOS);
+			boolean b = organizationEvaluationInfoService.saveBatchDto(OrganizationEvaluationInfo);
 			if (b) {
 				return R.ok().data(b);
 			} else {
 				return R.error().data("保存失败!");
 			}
 		} catch (Exception e) {
+			log.error("错误",e);
 			return R.customError(e.getMessage()).data("失败!");
 		}
 	}

+ 6 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/OrganizationEvaluationInfo.java

@@ -95,4 +95,10 @@ public class OrganizationEvaluationInfo extends Model {
     private String remark;
 
 
+	/**
+	 * 状态(-1:未开始;0:待确认;1:已确认)
+	 */
+	private String state;
+
+
 }

+ 5 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/ResponsibilityIndicatorInfo.java

@@ -92,5 +92,10 @@ public class ResponsibilityIndicatorInfo extends Model {
 	 */
 	private String remark;
 
+	/**
+	 * 状态(-1:未开始;0:待确认;1:已确认)
+	 */
+	private String state;
+
 
 }

+ 22 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/request/OrganizationEvaluationInfoUpdateDTO.java

@@ -13,6 +13,28 @@ public class OrganizationEvaluationInfoUpdateDTO {
 	 */
 	private String id;
 
+	/**
+	 * 考评记录id
+	 */
+	private String organizationEvaluationId;
+
+	/**
+	 * 组织考评规则id
+	 */
+	private String  organizationEvaluationRuleId;
+
+
+	/**
+	 * 指标ID
+	 */
+	private String indicatorId;
+
+
+	/**
+	 * 指标编码
+	 */
+	private String indicatorDictionaryId;
+
 
 	/**
 	 * 能否量化

+ 5 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/request/ResponsibilityIndicatorInfoUpdateDTO.java

@@ -66,4 +66,9 @@ public class ResponsibilityIndicatorInfoUpdateDTO {
 	 */
 	private String remark;
 
+	/**
+	 * 状态(-1:未开始;0:待确认;1:已确认)
+	 */
+	private String state;
+
 }

+ 27 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/response/OrganizationEvaluationInfoResDTO.java

@@ -16,6 +16,12 @@ public class OrganizationEvaluationInfoResDTO {
 	private String id;
 
 	/**
+	 * 考评记录id
+	 */
+	private String organizationEvaluationId;
+
+
+	/**
 	 * 指标ID
 	 */
 	private String indicatorId;
@@ -24,17 +30,33 @@ public class OrganizationEvaluationInfoResDTO {
 	 * 能否量化
 	 */
 	private String isQuantified;
+	/**
+	 * 业务阶段
+	 */
+	private String binStage;
 
 	/**
 	 * 业务阶段
 	 */
 	private String stageName;
 
+
+	/**
+	 * 业务版块
+	 */
+	private String binSection;
+
 	/**
 	 * 业务板块
 	 */
 	private String sectionName;
 
+
+	/**
+	 * 考评规则id
+	 */
+	private String organizationEvaluationRuleId;
+
 	/**
 	 * 组织名
 	 */
@@ -85,4 +107,9 @@ public class OrganizationEvaluationInfoResDTO {
 	 * 指标单位
 	 */
 	private String unit;
+
+	/**
+	 * 状态
+	 */
+	private String state;
 }

+ 6 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/response/ResponsibilityIndicatorInfoResDTO.java

@@ -111,4 +111,10 @@ public class ResponsibilityIndicatorInfoResDTO {
 	private String unit;
 
 
+	/**
+	 * 状态(-1:未开始;0:待确认;1:已确认)
+	 */
+	private String state;
+
+
 }

+ 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) throws Exception;
+	boolean saveBatchDto(List<OrganizationEvaluationInfo>  organizationEvaluationInfoList) throws Exception;
 
 }

+ 59 - 16
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationInfoServiceImpl.java

@@ -1,6 +1,9 @@
 package com.ims.eval.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ims.common.utils.StringUtils;
 import com.ims.eval.config.CustomException;
+import com.ims.eval.entity.IndicatorDictionary;
 import com.ims.eval.entity.OrganizationEvaluationInfo;
 import com.ims.eval.dao.OrganizationEvaluationInfoMapper;
 import com.ims.eval.entity.ResponsibilityIndicatorInfo;
@@ -9,6 +12,7 @@ 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.IIndicatorDictionaryService;
 import com.ims.eval.service.IOrganizationEvaluationInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -37,6 +41,10 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 	@Autowired
 	private ICalculateIndicatorItemInfoService iCalculateIndicatorItemInfoService;
 
+
+	@Autowired
+	private IIndicatorDictionaryService indicatorDictionaryService;
+
 	@Override
 	public Map finishValueList(String organizationEvaluationId, String dept) {
 
@@ -50,25 +58,55 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 
 	@Transactional
 	@Override
-	public boolean saveBatchDto(List<OrganizationEvaluationInfoUpdateDTO> evaluationInfoUpdateDTOS) throws Exception {
-		for (OrganizationEvaluationInfoUpdateDTO entity : evaluationInfoUpdateDTOS) {
-			OrganizationEvaluationInfo organizationEvaluationInfo = baseMapper.selectById(entity.getId());
-
-			organizationEvaluationInfo.setQuantifiedValue(entity.getQuantifiedValue());//量化值
-			organizationEvaluationInfo.setNonQuantifiedValue(entity.getNonQuantifiedValue());//非量化值
-			organizationEvaluationInfo.setUpdateTime(new Date());//更新时间
-			organizationEvaluationInfo.setUpdateBy(entity.getUpdateBy());//更新者
-			organizationEvaluationInfo.setRemark(entity.getRemark());//备注
-
-			boolean b = super.saveOrUpdate(organizationEvaluationInfo);
-			if(!b){
-				throw new CustomException("更新失败");
+	public boolean saveBatchDto(List<OrganizationEvaluationInfo> organizationEvaluationInfoList) throws Exception {
+		for (OrganizationEvaluationInfo entity : organizationEvaluationInfoList) {
+
+			if (null != entity && null != entity.getId() && !"".equals(entity.getId().trim())) {
+				OrganizationEvaluationInfo info = baseMapper.selectById(entity.getId());
+				info.setQuantifiedValue(entity.getQuantifiedValue());//量化值
+				info.setNonQuantifiedValue(entity.getNonQuantifiedValue());//非量化值
+				info.setUpdateTime(new Date());//更新时间
+				info.setUpdateBy(entity.getUpdateBy());//更新者
+				info.setRemark(entity.getRemark());//备注
+				info.setState(entity.getState());//初始状态
+				boolean b = super.saveOrUpdate(info);
+				if(!b){
+					throw new CustomException("更新失败");
+				}
+			}else {
+				entity.setCreateTime(new Date());
+
+				if (StringUtils.isEmpty(entity.getIndicatorId())) {
+					throw new CustomException("保存失败");
+				}
+				List<IndicatorDictionary> dictionaryList =  indicatorDictionaryService.list("",entity.getIndicatorId(),"","");
+				for(IndicatorDictionary d : dictionaryList){
+
+					OrganizationEvaluationInfo addinfo = new OrganizationEvaluationInfo();
+					addinfo.setOrganizationEvaluationId(entity.getOrganizationEvaluationId());
+					addinfo.setOrganizationEvaluationRuleId(entity.getOrganizationEvaluationRuleId());
+					addinfo.setIndicatorId(entity.getIndicatorId());
+					addinfo.setIndicatorDictionaryId(d.getId());
+					addinfo.setOptionCode(d.getOptionCode());
+					addinfo.setIsQuantified(entity.getIsQuantified());
+					addinfo.setQuantifiedValue(entity.getQuantifiedValue());
+					addinfo.setNonQuantifiedValue(entity.getNonQuantifiedValue());
+					addinfo.setState("-1");//初始状态
+					addinfo.setCreateTime(new Date());
+
+					boolean b = super.saveOrUpdate(addinfo);
+					if(!b){
+						throw new CustomException("保存失败");
+					}
+				}
+
 			}
+
 		}
 
-		OrganizationEvaluationInfo organizationEvaluationInfo = baseMapper.selectById(evaluationInfoUpdateDTOS.get(0).getId());
+//		OrganizationEvaluationInfo organizationEvaluationInfo = baseMapper.selectById(organizationEvaluationInfoList.get(0).getId());
 		//查询本次考评所有考评指标明细
-		List<OrganizationEvaluationInfo> organizationEvaluationInfos = baseMapper.selectByEvaluationInfoId(organizationEvaluationInfo.getOrganizationEvaluationId());
+		List<OrganizationEvaluationInfo> organizationEvaluationInfos = baseMapper.selectByEvaluationInfoId(organizationEvaluationInfoList.get(0).getOrganizationEvaluationId());
 
 		//调用需要计算指标项的方法
 		boolean calculate = calculateIdicatorItem(organizationEvaluationInfos);
@@ -123,7 +161,12 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 						double wczValue = lrgxl.get(0).getQuantifiedValue();
 						double dbzvalue = zjrl.get(0).getQuantifiedValue();
 						if (dbzvalue == 0 || dbzvalue == 0.0){
-							throw new CustomException("被除数不能为零");
+							dwqwlr.get(0).setQuantifiedValue(0);
+							dwqwlr.get(0).setCreateTime(new Date());
+							boolean b = super.saveOrUpdate(dwqwlr.get(0));
+							if(!b){
+								throw new CustomException("更新失败");
+							}
 						}else{
 							//double保留两位小数
 							double v = new BigDecimal(wczValue / dbzvalue).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

+ 2 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/ResponsibilityIndicatorInfoServiceImpl.java

@@ -76,6 +76,7 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
 				indicatorInfo.setUpdateTime(new Date());//更新时间
 				indicatorInfo.setUpdateBy(entity.getUpdateBy());//更新者
 				indicatorInfo.setRemark(entity.getRemark());//备注
+				indicatorInfo.setState(entity.getState());//状态
 				boolean b = super.saveOrUpdate(indicatorInfo);
 				if(!b){
 					throw new CustomException("更新失败");
@@ -92,6 +93,7 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
 				addInfo.setNonQuantifiedValue(entity.getNonQuantifiedValue());
 				addInfo.setRemark(entity.getRemark());//备注
 				addInfo.setCreateTime(new Date());
+				addInfo.setState("-1");//状态
 				boolean b = super.saveOrUpdate(addInfo);
 				if(!b){
 					throw new CustomException("新增失败");

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

@@ -28,10 +28,14 @@
 
         select
         ei.id,
+        oe.id organizationEvaluationId,
         ei.indicator_id,
         ei.is_quantified,
         be.stage_name,
+        be.id binStage,
+        bn.id binSection,
         bn.section_name,
+        oer.id organizationEvaluationRuleId,
         oer.organization_name,
         dd.key_name deptName,
         it.type_name,
@@ -41,7 +45,8 @@
         id.option_code,
         ei.quantified_value,
         ei.non_quantified_value,
-        i.unit
+        i.unit,
+        ei.state
         from
         organization_evaluation_info ei
         inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id

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

@@ -44,7 +44,8 @@
         i.indicator_name,
         ri.quantified_value,
         ri.non_quantified_value,
-        i.unit
+        i.unit,
+        ri.state
         from
         responsibility_indicator_info ri
         inner join dept_responsibility dr on dr.id = ri.dept_responsibility_id