diff --git a/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java index e8c5b1c8..0f9148ef 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java @@ -116,6 +116,17 @@ public class LawsContactManageServiceImpl extends ServiceImpl queryLawsContactManage = new LambdaQueryWrapper<>(); + queryLawsContactManage.eq(LawsContactManage::getDepartId,lawsContactManage.getDepartId()); + queryLawsContactManage.eq(LawsContactManage::getEngineerId,lawsContactManage.getEngineerId()); + queryLawsContactManage.eq(LawsContactManage::getContactId,lawsContactManage.getContactId()); + queryLawsContactManage.eq(LawsContactManage::getLeaderId,lawsContactManage.getLeaderId()); + long l = count(queryLawsContactManage); + if(l > 0){ + throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在"); + } + Date now = new Date(); lawsContactManage.setCreateTime(now); lawsContactManage.setUpdateTime(now); @@ -130,6 +141,17 @@ public class LawsContactManageServiceImpl extends ServiceImpl queryLawsContactManage = new LambdaQueryWrapper<>(); + queryLawsContactManage.eq(LawsContactManage::getDepartId,lawsContactManage.getDepartId()); + queryLawsContactManage.eq(LawsContactManage::getEngineerId,lawsContactManage.getEngineerId()); + queryLawsContactManage.eq(LawsContactManage::getContactId,lawsContactManage.getContactId()); + queryLawsContactManage.eq(LawsContactManage::getLeaderId,lawsContactManage.getLeaderId()); + queryLawsContactManage.ne(LawsContactManage::getId,lawsContactManage.getId()); + long l = count(queryLawsContactManage); + if(l > 0){ + throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在"); + } Date now = new Date(); lawsContactManage.setUpdateTime(now); saveOrUpdate(lawsContactManage);