浏览代码

修改单位权重表

wangchangsheng 1 年之前
父节点
当前提交
c9b69fa36e

+ 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

+ 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);