|
@@ -518,6 +518,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
projectSeparate.setId(id);
|
|
|
projectSeparateMapper.insert(projectSeparate);
|
|
|
}
|
|
|
+ OperationRecord operationRecord=new OperationRecord();
|
|
|
+ operationRecord.setProjectName(project.getProjectName());
|
|
|
+ operationRecord.setOperationTime(LocalDateTime.now());
|
|
|
+ operationRecord.setOperatorName(user.getName());
|
|
|
+ operationRecord.setModuleName("项目管理");
|
|
|
+ operationRecord.setContent("创建了项目");
|
|
|
+ operationRecord.setCompanyId(user.getCompanyId());
|
|
|
+ operationRecordService.save(operationRecord);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -572,6 +580,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
p.setCategoryName(projectCategory.getName());
|
|
|
}
|
|
|
}
|
|
|
+ ProjectSeparate oldSeparate = projectSeparateMapper.selectById(id);
|
|
|
if(companyId==936){
|
|
|
//编辑之前的项目是否存在子表数据
|
|
|
ProjectSeparate separate = projectSeparateMapper.selectById(id);
|
|
@@ -670,20 +679,29 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
fp.setProjectCode(p.getProjectCode());
|
|
|
financeProjectsMapper.update(fp, new QueryWrapper<FinanceProjects>().eq("project_id", p.getId()));
|
|
|
}
|
|
|
- }
|
|
|
- Project newProject = projectMapper.selectById(id);
|
|
|
- String path = Project.class.getClassLoader().getResource("/").getPath();
|
|
|
- BeanChangeUtil<Project> beanChangeUtil=new BeanChangeUtil();
|
|
|
- String content = beanChangeUtil.contrastObj(oldProject, newProject);
|
|
|
- OperationRecord operationRecord =new OperationRecord();
|
|
|
- operationRecord.setOperatorName(user.getName());
|
|
|
- operationRecord.setOperationTime(LocalDateTime.now());
|
|
|
- operationRecord.setCompanyId(companyId);
|
|
|
- operationRecord.setContent(content);
|
|
|
- operationRecord.setModuleName("项目管理");
|
|
|
- if(!StringUtils.isEmpty(content.trim())){
|
|
|
- System.out.println(operationRecord);
|
|
|
- operationRecordService.save(operationRecord);
|
|
|
+ Project newProject = projectMapper.selectById(id);
|
|
|
+ String path = Project.class.getClassLoader().getResource("/").getPath();
|
|
|
+ BeanChangeUtil<Project> beanChangeUtil=new BeanChangeUtil();
|
|
|
+ String content = beanChangeUtil.contrastObj(oldProject, newProject);
|
|
|
+ OperationRecord operationRecord =new OperationRecord();
|
|
|
+ operationRecord.setOperatorName(user.getName());
|
|
|
+ operationRecord.setOperationTime(LocalDateTime.now());
|
|
|
+ operationRecord.setCompanyId(companyId);
|
|
|
+ if(companyId==936){
|
|
|
+ projectSeparate.setId(id);
|
|
|
+ if(oldSeparate!=null){
|
|
|
+ if(!onlyChangeParticipate){
|
|
|
+ String s = beanChangeUtil.contrastObj(oldSeparate, projectSeparate);
|
|
|
+ content+="\n"+s;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ operationRecord.setContent(content);
|
|
|
+ operationRecord.setModuleName("项目管理");
|
|
|
+ operationRecord.setProjectName(newProject.getProjectName());
|
|
|
+ if(!StringUtils.isEmpty(content.trim())){
|
|
|
+ operationRecordService.save(operationRecord);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (httpRespMsg.code.equals("ok")) {
|
|
@@ -2854,6 +2872,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
String collect = existCodeList.stream().collect(Collectors.joining(","));
|
|
|
msg.data += "自动跳过"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
}
|
|
|
+ OperationRecord operationRecord=new OperationRecord();
|
|
|
+ operationRecord.setCompanyId(user.getCompanyId());
|
|
|
+ operationRecord.setModuleName("项目管理");
|
|
|
+ operationRecord.setOperatorName(user.getName());
|
|
|
+ operationRecord.setOperationTime(LocalDateTime.now());
|
|
|
+ operationRecord.setContent("导入了"+importCount+"条项目数据");
|
|
|
+ operationRecordService.save(operationRecord);
|
|
|
}else if(fileName.endsWith(".xls")){
|
|
|
//然后解析表格
|
|
|
HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(file));
|
|
@@ -3319,6 +3344,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
String collect = existCodeList.stream().collect(Collectors.joining(","));
|
|
|
msg.data += "自动跳过"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
}
|
|
|
+ OperationRecord operationRecord=new OperationRecord();
|
|
|
+ operationRecord.setCompanyId(user.getCompanyId());
|
|
|
+ operationRecord.setModuleName("项目管理");
|
|
|
+ operationRecord.setOperatorName(user.getName());
|
|
|
+ operationRecord.setOperationTime(LocalDateTime.now());
|
|
|
+ operationRecord.setContent("导入了"+importCount+"条项目数据");
|
|
|
+ operationRecordService.save(operationRecord);
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
@@ -5595,6 +5627,27 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg batchExchangeIncharger(String projectIds, String inchargerId, HttpServletRequest request) {
|
|
|
+ HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
|
+ User user = userMapper.selectById(request.getHeader("token"));
|
|
|
+ String[] split = projectIds.split(",");
|
|
|
+ List<String> stringlist = Arrays.asList(split);
|
|
|
+ List<Integer> list=new ArrayList<>();
|
|
|
+ for (String s : stringlist) {
|
|
|
+ list.add(Integer.valueOf(s));
|
|
|
+ }
|
|
|
+ List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", list));
|
|
|
+ for (Project project : projectList) {
|
|
|
+ project.setInchargerId(inchargerId);
|
|
|
+ if(projectMapper.updateById(project)<=0){
|
|
|
+ httpRespMsg.setError("操作失败");
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private List<Department> getSubDepts(Department dp, List<Department> list) {
|
|
|
List<Department> collect = list.stream().filter(l -> dp.getDepartmentId().equals(l.getSuperiorId())).collect(Collectors.toList());
|