|
@@ -140,12 +140,6 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
public CheckStandard saveModelByDTO(CheckStandardDTO model) {
|
|
public CheckStandard saveModelByDTO(CheckStandardDTO model) {
|
|
- Weekend<CheckStandard> weekendExsit = new Weekend<>(CheckStandard.class);
|
|
|
|
- weekendExsit.weekendCriteria().andEqualTo(CheckStandard::getSbId, model.getSbId()).andEqualTo(CheckStandard::getName, model.getName());
|
|
|
|
- Integer exsitCount = mapper.selectCountByExample(weekendExsit);
|
|
|
|
- if(exsitCount>0){
|
|
|
|
- throw new BusinessException("名称已存在,请重新命名");
|
|
|
|
- }
|
|
|
|
if(model.getType() == null){
|
|
if(model.getType() == null){
|
|
model.setType(CheckStandardTypeEnum.POLLING.getValue());
|
|
model.setType(CheckStandardTypeEnum.POLLING.getValue());
|
|
}
|
|
}
|
|
@@ -179,13 +173,6 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
public void modModelByDTO(CheckStandardDTO model) {
|
|
public void modModelByDTO(CheckStandardDTO model) {
|
|
- Weekend<CheckStandard> weekendExsit = new Weekend<>(CheckStandard.class);
|
|
|
|
- weekendExsit.weekendCriteria().andEqualTo(CheckStandard::getSbId, model.getSbId()).andEqualTo(CheckStandard::getName, model.getName());
|
|
|
|
- CheckStandard exsitCount = mapper.selectOneByExample(weekendExsit);
|
|
|
|
- if(exsitCount != null && !exsitCount.getId().equals(model.getId())){
|
|
|
|
- throw new BusinessException("名称已存在,请重新命名");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
super.modModelByDTO(model);
|
|
super.modModelByDTO(model);
|
|
|
|
|
|
// 先删后插,前端删除的不存在与ids里面,说明被删掉了,需要删除
|
|
// 先删后插,前端删除的不存在与ids里面,说明被删掉了,需要删除
|