2 Commits 2646a17b43 ... 3209852655

Author SHA1 Message Date
  zhangc 3209852655 Merge remote-tracking branch 'origin/dev1.0' into dev1.0 6 months ago
  zhangc 49f7147c71 展示 业务负责人 字段 6 months ago

+ 10 - 0
src/main/java/com/sunxung/factoring/entity/sys/vo/ClientUserVO.java

@@ -35,6 +35,11 @@ public class ClientUserVO {
    */
   private boolean useMoney;
 
+  /**
+   * 业务经理id
+   */
+  private Long projectManagerId;
+
   /**
    * 业务经理
    */
@@ -45,6 +50,11 @@ public class ClientUserVO {
    */
   private String  riskManager;
 
+  /**
+   * 项目负责人名字
+   */
+  private String  projectHead;
+
   /**
    * 分配的组id
    */

+ 20 - 0
src/main/java/com/sunxung/factoring/service/sys/impl/ClientUserServiceImpl.java

@@ -173,6 +173,26 @@ public class ClientUserServiceImpl extends ServiceImpl<ClientUserMapper, ClientU
     List<ClientUserVO> clientUserVOS = this.baseMapper.pageList(clientUserQueryRequest);
     if (!CollectionUtils.isEmpty(clientUserVOS)) {
       for (ClientUserVO vo : clientUserVOS) {
+        if(vo.getProjectManagerId() !=null){
+            //如果项目经理id 不是空 则 项目负责人 就是 项目经理所在组的 负责人
+          List<UserOrgRel> orgRelByUserId = userService.findOrgRelByUserId(
+              vo.getProjectManagerId());
+          //根据贸理通的设计 一个人 只能在一个组织里面  有特殊情况,但是项目经理 一定都在一个部门里
+          if(CollectionUtil.isNotEmpty(orgRelByUserId)){
+            List<User> detailSuperior = userService.findDetailSuperiorByOrgId(
+                orgRelByUserId.get(0).getOrgId());
+            if(CollectionUtil.isNotEmpty(detailSuperior)){
+              vo.setProjectHead(detailSuperior.get(0).getName());
+            }
+          }
+        }else if(vo.getOrgId()!=null){
+            //根据贸理通的设计 一个人 只能在一个组织里面  有特殊情况,但是项目经理 一定都在一个部门里
+            List<User> detailSuperior = userService.findDetailSuperiorByOrgId(vo.getOrgId());
+            if(CollectionUtil.isNotEmpty(detailSuperior)){
+              vo.setProjectHead(detailSuperior.get(0).getName());
+            }
+        }
+
         vo.setList(this.baseMapper.getCompanyByClientUserId(vo.getId()));
       }
     }

+ 3 - 1
src/main/resources/mapper/sys/ClientUserMapper.xml

@@ -14,8 +14,10 @@
 			e.name "cityName",
 		  a.enterprise_address,
 			a.gmt_create,
+		  a.project_manager  "projectManagerId",
 			b.`name` "project_manager",
-			c.`name` "risk_manager"
+			c.`name` "risk_manager",
+		  a.org_id "orgId"
 		from  c_sys_user a
 		LEFT JOIN sys_user b on a.project_manager = b.id
 		LEFT JOIN sys_user c on  a.risk_manager = c.id