|
|
@ -1,7 +1,5 @@ |
|
|
|
package org.dromara.platform.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import org.dromara.common.core.exception.ServiceException; |
|
|
|
import org.dromara.common.core.utils.MapstructUtils; |
|
|
@ -106,6 +104,8 @@ public class EvaluationInfoServiceImpl implements IEvaluationInfoService { |
|
|
|
String checkProject = bo.getCheckProject(); |
|
|
|
String checkName = bo.getCheckName(); |
|
|
|
Date checkTime = bo.getCheckTime(); |
|
|
|
// 重复提交判断
|
|
|
|
checkRepeatSubmit(ioCompany, checkTime); |
|
|
|
|
|
|
|
LambdaQueryWrapper<EvaluationTemplate> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(EvaluationTemplate::getFlag,"模板1"); |
|
|
@ -133,6 +133,16 @@ public class EvaluationInfoServiceImpl implements IEvaluationInfoService { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
private void checkRepeatSubmit(String ioCompany, Date checkTime) { |
|
|
|
LambdaQueryWrapper<EvaluationInfo> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(EvaluationInfo::getIoCompany, ioCompany); |
|
|
|
queryWrapper.eq(EvaluationInfo::getCheckTime, checkTime); |
|
|
|
Long size = baseMapper.selectCount(queryWrapper); |
|
|
|
if (size > 0) { |
|
|
|
throw new ServiceException("当前新增考核已存在,请重新选择考核时间"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改考核评分信息 |
|
|
|
* |
|
|
@ -143,6 +153,14 @@ public class EvaluationInfoServiceImpl implements IEvaluationInfoService { |
|
|
|
public Boolean updateByBo(EvaluationInfoBo bo) { |
|
|
|
EvaluationInfo update = MapstructUtils.convert(bo, EvaluationInfo.class); |
|
|
|
validEntityBeforeSave(update); |
|
|
|
LambdaQueryWrapper<EvaluationInfo> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(EvaluationInfo::getIoCompany, bo.getIoCompany()); |
|
|
|
queryWrapper.eq(EvaluationInfo::getCheckTime, bo.getCheckTime()); |
|
|
|
queryWrapper.ne(EvaluationInfo::getId, bo.getId()); |
|
|
|
Long size = baseMapper.selectCount(queryWrapper); |
|
|
|
if (size > 0) { |
|
|
|
throw new ServiceException("当前新增考核已存在,请重新选择考核时间"); |
|
|
|
} |
|
|
|
return baseMapper.updateById(update) > 0; |
|
|
|
} |
|
|
|
|
|
|
|