联络人管理部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
This commit is contained in:
+22
@@ -116,6 +116,17 @@ 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::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<LawsContactManageM
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsContactManage lawsContactManage) {
|
||||
// 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
|
||||
LambdaQueryWrapper<LawsContactManage> 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);
|
||||
|
||||
Reference in New Issue
Block a user