yurk 2 anni fa
parent
commit
025c9b62fb

+ 17 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -419,6 +419,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             .setTaskGpIncharge(taskGpIncharge)
                             .setProviderIds(providerIds)
                             .setProviderNames(providerNames);
+                    ProjectMain projectMain = projectMainMapper.selectById(projectMainId);
+                    if(projectMain!=null){
+                        project.setCategory(projectMain.getCategoryId());
+                        project.setCategoryName(projectMain.getCategoryName());
+                    }
                     if (category != null) {
                         ProjectCategory projectCategory = projectCategoryMapper.selectById(category);
                         if (projectCategory != null) {
@@ -2573,6 +2578,18 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                 throw new Exception("项目负责人["+inchargerName+"]不存在");
                             }
                         }
+                        if(participatorCell==null){
+                            String value = inchargerCell.getStringCellValue();
+                            Participation p = new Participation();
+                            Optional<User> first = userList.stream().filter(u -> u.getName().equals(value)).findFirst();
+                            if (first.isPresent()) {
+                                p.setUserId(first.get().getId());
+                                p.setProjectId(project.getId());
+                                participationMapper.insert(p);
+                            } else {
+                                throw new Exception("参与人["+value+"]不存在");
+                            }
+                        }
                     }