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