|
@@ -72,7 +72,9 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
// 1内部ipr 2代理所
|
|
|
Integer type = updateMatchCasePersonDTO.getType();
|
|
|
Integer iprPersonId = null;
|
|
|
-
|
|
|
+ PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
+ String personId = personnelVO.getId();
|
|
|
+ Integer tenantId = personnelVO.getTenantId();
|
|
|
// 邮箱传入 即先添加ipr人员 再与报告关联
|
|
|
// 判断邮箱是否存在
|
|
|
// 邮箱不为空 则去新增ipr人员 并判断邮箱是否存在
|
|
@@ -81,11 +83,13 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
if (!isValid) {
|
|
|
throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "邮箱格式不正确");
|
|
|
}
|
|
|
+
|
|
|
LambdaQueryWrapper<IprPerson> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(IprPerson::getEmail, email);
|
|
|
+ queryWrapper.eq(IprPerson::getTenantId, tenantId);
|
|
|
IprPerson iprPerson = iprPersonService.getOne(queryWrapper, false);
|
|
|
if (iprPerson != null) {
|
|
|
- if (!name.trim().equals(iprPerson.getName().trim()) || assoAccountId != iprPerson.getAssoAccountId()) {
|
|
|
+ if (!name.trim().equals(iprPerson.getName().trim()) || !assoAccountId.equals(iprPerson.getAssoAccountId())) {
|
|
|
throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "禁止修改已存在邮箱的相关信息!请前往联系邮箱处");
|
|
|
}
|
|
|
//邮箱存在
|
|
@@ -93,10 +97,6 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
assoId = iprPerson.getAssoAccountId();
|
|
|
|
|
|
} else {
|
|
|
- PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
- String personId = personnelVO.getId();
|
|
|
- Integer tenantId = personnelVO.getTenantId();
|
|
|
-
|
|
|
IprPerson newIprPerson = new IprPerson();
|
|
|
newIprPerson.setName(updateMatchCasePersonDTO.getName());
|
|
|
newIprPerson.setEmail(email);
|