|
@@ -118,14 +118,20 @@ public class IprPersonService extends ServiceImpl<IprPersonMapper, IprPerson> {
|
|
|
return iprPerson;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ // 删除ipr人员
|
|
|
public List<Integer> delete(List<Integer> ids) {
|
|
|
if (ids == null || ids.size() == 0) {
|
|
|
throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "请选择至少一条数据进行删除");
|
|
|
}
|
|
|
- this.removeBatchByIds(ids);
|
|
|
- assoIprReportTypeService.deleteAssos(ids);
|
|
|
- matchCasePersonService.deleteByIprIds(ids);
|
|
|
+ LambdaQueryWrapper<IprPerson> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.in(IprPerson::getId, ids);
|
|
|
+ List<IprPerson> iprPersonList = this.list(queryWrapper);
|
|
|
+ if (iprPersonList != null && !iprPersonList.isEmpty()) {
|
|
|
+ for (IprPerson iprPerson : iprPersonList) {
|
|
|
+ iprPerson.setIsDelete(true);
|
|
|
+ }
|
|
|
+ this.updateBatchById(iprPersonList);
|
|
|
+ }
|
|
|
return ids;
|
|
|
}
|
|
|
|
|
@@ -135,7 +141,9 @@ public class IprPersonService extends ServiceImpl<IprPersonMapper, IprPerson> {
|
|
|
List<IprPerson> iprPersonList = new ArrayList<>();
|
|
|
String name = queryIprPersonDTO.getName();
|
|
|
String email = queryIprPersonDTO.getEmail();
|
|
|
+ // 代理所、ipr
|
|
|
Integer type = queryIprPersonDTO.getType();
|
|
|
+
|
|
|
Boolean ifDefault = queryIprPersonDTO.getIfDefault();
|
|
|
Long current = queryIprPersonDTO.getCurrent();
|
|
|
Long size = queryIprPersonDTO.getSize();
|
|
@@ -143,9 +151,14 @@ public class IprPersonService extends ServiceImpl<IprPersonMapper, IprPerson> {
|
|
|
records.setSize(size);
|
|
|
|
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
+ if (personnelVO == null) {
|
|
|
+ throw new XiaoShiException(ExceptionEnum.LOGIN_NO_LOGIN, "未登录");
|
|
|
+ }
|
|
|
Integer tenantId = personnelVO.getTenantId();
|
|
|
LambdaQueryWrapper<IprPerson> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(IprPerson::getTenantId, tenantId);
|
|
|
+ queryWrapper.eq(IprPerson::getTenantId, tenantId)
|
|
|
+ .eq(IprPerson::getIsDelete, false);
|
|
|
+
|
|
|
if (name != null && !name.trim().equals("")) {
|
|
|
queryWrapper.like(IprPerson::getName, name);
|
|
|
}
|
|
@@ -230,8 +243,8 @@ public class IprPersonService extends ServiceImpl<IprPersonMapper, IprPerson> {
|
|
|
.findFirst()
|
|
|
.orElse(null);
|
|
|
if (assoAccount != null) {
|
|
|
- queryIprPersonVO.setAccountName(personnel.getPersonnelName());
|
|
|
- queryIprPersonVO.setAccountUserName(personnel.getPersonnelUserName());
|
|
|
+ queryIprPersonVO.setAccountName(assoAccount.getPersonnelName());
|
|
|
+ queryIprPersonVO.setAccountUserName(assoAccount.getPersonnelUserName());
|
|
|
}
|
|
|
queryIprPersonVOS.add(queryIprPersonVO);
|
|
|
}
|
|
@@ -245,6 +258,7 @@ public class IprPersonService extends ServiceImpl<IprPersonMapper, IprPerson> {
|
|
|
|
|
|
LambdaQueryWrapper<IprPerson> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(IprPerson::getEmail, email);
|
|
|
+ queryWrapper.eq(IprPerson::getIsDelete, false);
|
|
|
// 编辑的情况排除自身
|
|
|
if (id != null) {
|
|
|
queryWrapper.ne(IprPerson::getId, id);
|