feat: 联络人管理增加重复联络人限制

This commit is contained in:
2024-02-01 17:40:17 +08:00
parent b682979d0d
commit 004b7aa5fa
@@ -119,12 +119,18 @@ public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageM
// 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一 // 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>(); LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>();
queryLawsContactManage.eq(LawsContactManage::getDepartId, lawsContactManage.getDepartId()); queryLawsContactManage.eq(LawsContactManage::getDepartId, lawsContactManage.getDepartId());
queryLawsContactManage.eq(LawsContactManage::getEngineerId,lawsContactManage.getEngineerId());
queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId()); queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId());
queryLawsContactManage.eq(LawsContactManage::getLeaderId, lawsContactManage.getLeaderId()); queryLawsContactManage.eq(LawsContactManage::getLeaderId, lawsContactManage.getLeaderId());
long l = count(queryLawsContactManage); long l = count(queryLawsContactManage);
if (l > 0) { if (l > 0) {
throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在"); throw new JeroBootException("部门和联络人匹配关系已存在,请重新选择");
}
queryLawsContactManage.clear();
queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId());
long n = count(queryLawsContactManage);
if (n > 0) {
throw new JeroBootException("已存在相同的联络人");
} }
Date now = new Date(); Date now = new Date();