Bläddra i källkod

Merge remote-tracking branch 'origin/dev_1.1.0' into dev_1.1.0

wangliang 1 år sedan
förälder
incheckning
6e08877057

+ 22 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/dto/UserArchivesDto.java

@@ -28,12 +28,18 @@ public class UserArchivesDto {
     @ApiModelProperty("城市")
     private String city;
 
+    @ApiModelProperty("电话号码")
+    private String mobileNumber;
+
     @ApiModelProperty("供应商")
     private String supplierName;
 
     @ApiModelProperty("创建时间")
     private Long createTime;
 
+    @ApiModelProperty("档案角色")
+    private String archivesRoleName;
+
     public Long getUserId() {
         return userId;
     }
@@ -74,6 +80,14 @@ public class UserArchivesDto {
         this.city = city;
     }
 
+    public String getMobileNumber() {
+        return mobileNumber;
+    }
+
+    public void setMobileNumber(String mobileNumber) {
+        this.mobileNumber = mobileNumber;
+    }
+
     public String getSupplierName() {
         return supplierName;
     }
@@ -89,4 +103,12 @@ public class UserArchivesDto {
     public void setCreateTime(Long createTime) {
         this.createTime = createTime;
     }
+
+    public String getArchivesRoleName() {
+        return archivesRoleName;
+    }
+
+    public void setArchivesRoleName(String archivesRoleName) {
+        this.archivesRoleName = archivesRoleName;
+    }
 }

+ 5 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBUserArchivesAllocationServiceImpl.java

@@ -552,6 +552,11 @@ public class TBUserArchivesAllocationServiceImpl
                 cell.setProvince(tbUserArchivesResult.getProvince());
                 cell.setCity(tbUserArchivesResult.getCity());
                 cell.setSupplierName(tbUserArchivesResult.getSupplierName());
+                cell.setMobileNumber(tbUserArchivesResult.getMobileNumber());
+                List<RoleResult> roleInfoList = tbUserArchivesResult.getRoleInfoList();
+                if (CollectionUtils.isNotEmpty(roleInfoList)){
+                    cell.setArchivesRoleName(roleInfoList.stream().map(RoleResult::getRoleName).collect(Collectors.joining(",")));
+                }
                 result.add(cell);
             }
         }

+ 20 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBUserArchivesServiceImpl.java

@@ -482,6 +482,26 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
                 throw ExceptionResultEnum.ERROR.exception("档案数据异常");
             }
             result = userArchivesResultList.get(0);
+            List<RoleResult> roleResultList = new ArrayList<>();
+            userId = result.getUserId();
+
+            // 认证的角色枚举
+            List<RoleTypeEnum> authRole = new ArrayList<>();
+            authRole.add(RoleTypeEnum.EFFECT_ENGINEER);
+            authRole.add(RoleTypeEnum.REGION_COORDINATOR);
+            authRole.add(RoleTypeEnum.ASSISTANT_ENGINEER);
+            if (userId != null && userId > 0) {
+                for (RoleTypeEnum roleTypeEnum : authRole) {
+                    // TODO: 2023/8/14 可优化查询
+                    if (sysUserRoleService.userContainsRoles(userId, roleTypeEnum)) {
+                        RoleResult roleResult = sysRoleService.findRoleInfoByArchivesType(roleTypeEnum);
+                        if (Objects.nonNull(roleResult)) {
+                            roleResultList.add(roleResult);
+                        }
+                    }
+                }
+            }
+            result.setRoleInfoList(roleResultList);
         }
         return result;
     }