yurk vor 2 Jahren
Ursprung
Commit
b699645c9d

+ 16 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -563,10 +563,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             .setProviderNames(providerNames);
                     if(companyId==862){
                         project.setBuId(buId);
-                        Department department = departmentMapper.selectById(buId);
-                        if(department.getManagerId()==null){
-                            httpRespMsg.setError("当前设置BU不存在负责人,请设置");
-                            return httpRespMsg;
+                        if (project.getBuId()!=null&&!project.getBuId().equals("")) {
+                            String[] split = project.getBuId().split(",");
+                            int dpId = Integer.parseInt(split[split.length - 1]);
+                            Department department = departmentMapper.selectById(dpId);
+                            if(department.getManagerId()==null){
+                                httpRespMsg.setError("当前BU["+department.getDepartmentName()+"]不存在负责人,请设置");
+                                return httpRespMsg;
+                            }
                         }
                     }
                     if(timeType.getOutputValueStatus()==1){
@@ -674,10 +678,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         .setProviderNames(providerNames);
                 if(companyId==862){
                     p.setBuId(buId);
-                    Department department = departmentMapper.selectById(buId);
-                    if(department.getManagerId()==null){
-                        httpRespMsg.setError("当前设置BU不存在负责人,请设置");
-                        return httpRespMsg;
+                    if (p.getBuId()!=null&&!p.getBuId().equals("")) {
+                        String[] split = p.getBuId().split(",");
+                        int dpId = Integer.parseInt(split[split.length - 1]);
+                        Department department = departmentMapper.selectById(dpId);
+                        if(department.getManagerId()==null){
+                            httpRespMsg.setError("当前BU["+department.getDepartmentName()+"]不存在负责人,请设置");
+                            return httpRespMsg;
+                        }
                     }
                 }
                 //编辑项目合同修改 添加记录