瀏覽代碼

Merge remote-tracking branch 'origin/master'

jzh 1 年之前
父節點
當前提交
df44406438

+ 8 - 7
zjugis-business/src/main/java/com/zjugis/business/flow/contract/event/ContractEvent.java

@@ -334,11 +334,11 @@ public class ContractEvent extends BaseController {
                 Project project = projectService.selectById(entity.getProjectId());
                 List<Map<String, String>> userMaps = new ArrayList<>();
                 if(StringUtils.isNotBlank(project.getXsryId())){
-                    CommonResult<AdminUserRespDTO> userRes = adminUserApi.getUserLeader(project.getXsryId());
-                    AdminUserRespDTO userLeader = userRes.getCheckedData();
-                    if(userLeader != null){
+                    CommonResult<List<DeptRespDTO>> deptsRes  = deptApi.getDeptByUserId(project.getXsryId());
+                    List<DeptRespDTO> depts = deptsRes.getCheckedData();
+                    if(!depts.isEmpty()){
                         HashMap<String,String> leaderMap = new HashMap<>();
-                        leaderMap.put("id",userLeader.getId());
+                        leaderMap.put("id",depts.get(0).getLeaderUserId());
                         userMaps.add(leaderMap);
                     }
                 }
@@ -361,9 +361,10 @@ public class ContractEvent extends BaseController {
                 Project project = projectService.selectById(entity.getProjectId());
                 List<Map<String, String>> userMaps = new ArrayList<>();
                 if(StringUtils.isNotBlank(project.getXsryId())){
-                    CommonResult<AdminUserRespDTO> res = adminUserApi.getUserLeader(project.getXsryId());
-                    if(res.getCheckedData()!= null) {
-                        CommonResult<AdminUserRespDTO> userRes = adminUserApi.getUserLeader(res.getCheckedData().getId());
+                    CommonResult<List<DeptRespDTO>> deptsRes  = deptApi.getDeptByUserId(project.getXsryId());
+                    List<DeptRespDTO> depts = deptsRes.getCheckedData();
+                    if(!depts.isEmpty()){
+                        CommonResult<AdminUserRespDTO> userRes = adminUserApi.getUserLeader(depts.get(0).getLeaderUserId());
                         AdminUserRespDTO userLeader = userRes.getCheckedData();
                         if (userLeader != null) {
                             HashMap<String, String> leaderMap = new HashMap<>();