wangchangsheng преди 2 години
родител
ревизия
cd864d77c7

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

@@ -48,4 +48,9 @@ public class EvaluationScoreCount extends Model {
      */
     private double score;
 
+	/**
+	 * 能否量化
+	 */
+	private String isQuantified;
+
 }

+ 29 - 10
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/ResponsibilityIndicatorInfoServiceImpl.java

@@ -67,18 +67,37 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
 	@Override
 	public boolean saveBatchDto(List<ResponsibilityIndicatorInfoUpdateDTO> infoUpdateDTOs) {
 		for (ResponsibilityIndicatorInfoUpdateDTO entity : infoUpdateDTOs) {
-			ResponsibilityIndicatorInfo indicatorInfo = baseMapper.selectById(entity.getId());
 
-			indicatorInfo.setQuantifiedValue(entity.getQuantifiedValue());//量化值
-			indicatorInfo.setNonQuantifiedValue(entity.getNonQuantifiedValue());//非量化值
-			indicatorInfo.setUpdateTime(new Date());//更新时间
-			indicatorInfo.setUpdateBy(entity.getUpdateBy());//更新者
-			indicatorInfo.setRemark(entity.getRemark());//备注
-
-			boolean b = super.saveOrUpdate(indicatorInfo);
-			if(!b){
-				throw new CustomException("更新失败");
+			if (null != entity && null != entity.getId() && !"".equals(entity.getId().trim())) {
+				ResponsibilityIndicatorInfo indicatorInfo = baseMapper.selectById(entity.getId());
+
+				indicatorInfo.setQuantifiedValue(entity.getQuantifiedValue());//量化值
+				indicatorInfo.setNonQuantifiedValue(entity.getNonQuantifiedValue());//非量化值
+				indicatorInfo.setUpdateTime(new Date());//更新时间
+				indicatorInfo.setUpdateBy(entity.getUpdateBy());//更新者
+				indicatorInfo.setRemark(entity.getRemark());//备注
+				boolean b = super.saveOrUpdate(indicatorInfo);
+				if(!b){
+					throw new CustomException("更新失败");
+				}
+			}else {
+				ResponsibilityIndicatorInfo addInfo = new ResponsibilityIndicatorInfo();
+				addInfo.setDeptResponsibilityId(entity.getDeptResponsibilityId());
+				addInfo.setOrganizationEvaluationRuleId(entity.getOrganizationEvaluationRuleId());
+				addInfo.setIndicatorId(entity.getIndicatorId());
+//				addInfo.setIndicatorDictionaryId(entity.getIndicatorDictionaryId());
+				addInfo.setOptionCode(entity.getOptionCode());
+				addInfo.setIsQuantified(entity.getIsQuantified());
+				addInfo.setQuantifiedValue(entity.getQuantifiedValue());
+				addInfo.setNonQuantifiedValue(entity.getNonQuantifiedValue());
+				addInfo.setRemark(entity.getRemark());//备注
+				addInfo.setCreateTime(new Date());
+				boolean b = super.saveOrUpdate(addInfo);
+				if(!b){
+					throw new CustomException("新增失败");
+				}
 			}
+
 		}
 		return true;
 	}