feat: 去除联络人管理唯一性限制

This commit is contained in:
2024-07-02 11:28:47 +08:00
parent d268017fe3
commit 35f2482765
2 changed files with 17 additions and 17 deletions
@@ -371,7 +371,7 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
advicesWrapper.eq(EsRevisionAdvice::getExecutionId, executionId);
contactWrapper.eq(LawsContactManage::getContactId, userId);
List<LawsContactManage> list = contactManageService.list(contactWrapper);
if (list != null && !list.isEmpty()) {
if (list != null && list.size() == 1) {
data.setContactUserLeader(list.get(0).getLeaderId());
}
case CONTACT_USER_LEADER_APPROVAL:
@@ -117,22 +117,22 @@ public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageM
*/
@Override
public void add(LawsContactManage lawsContactManage) {
// 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>();
queryLawsContactManage.eq(LawsContactManage::getDepartId, lawsContactManage.getDepartId());
queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId());
queryLawsContactManage.eq(LawsContactManage::getLeaderId, lawsContactManage.getLeaderId());
long l = count(queryLawsContactManage);
if (l > 0) {
throw new JeroBootException("部门和联络人匹配关系已存在,请重新选择");
}
queryLawsContactManage.clear();
queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId());
long n = count(queryLawsContactManage);
if (n > 0) {
throw new JeroBootException("已存在相同的联络人");
}
// // 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
// LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>();
// queryLawsContactManage.eq(LawsContactManage::getDepartId, lawsContactManage.getDepartId());
// queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId());
// queryLawsContactManage.eq(LawsContactManage::getLeaderId, lawsContactManage.getLeaderId());
// long l = count(queryLawsContactManage);
// if (l > 0) {
// 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();
lawsContactManage.setCreateTime(now);