|
@@ -252,8 +252,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (projectId != null) {
|
|
|
queryWrapper.eq("id", projectId);
|
|
|
}
|
|
|
+ List<Integer> branchDepartment=null;
|
|
|
if(deptId!=null){
|
|
|
- queryWrapper.eq("dept_id",deptId);
|
|
|
+ branchDepartment= getBranchDepartment(deptId, allDepartmentList);
|
|
|
+ if(branchDepartment.size()>0){
|
|
|
+ queryWrapper.in("dept_id",branchDepartment);
|
|
|
+ }
|
|
|
}
|
|
|
if (StringUtils.isEmpty(sortProp)) {
|
|
|
queryWrapper.orderByDesc("is_public").orderByAsc("id");
|
|
@@ -282,12 +286,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
List<Integer> projectIds = projectList.stream().distinct().map(pl -> pl.getId()).collect(Collectors.toList());
|
|
|
List<ProjectSeparate> projectSeparateList=new ArrayList<>();
|
|
|
- if(companyId==936||companyId==428){
|
|
|
+ if(companyId==936){
|
|
|
if (projectIds.size() > 0) {
|
|
|
projectSeparateList = projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", projectIds));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
List<ProjectVO> list = new ArrayList<>();
|
|
|
for (Project project : projectList) {
|
|
|
ProjectVO projectVO = new ProjectVO();
|
|
@@ -347,7 +350,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
projectVO.setProviderInfoList(mapList);
|
|
|
}
|
|
|
- if(companyId==936||companyId==428){
|
|
|
+ if(companyId==936){
|
|
|
Optional<ProjectSeparate> first1 = projectSeparateList.stream().filter(ps -> ps.getId().equals(project.getId())).findFirst();
|
|
|
if(first1.isPresent()){
|
|
|
projectVO.setProjectSeparate(first1.get());
|
|
@@ -362,6 +365,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
map.put("records", list);
|
|
|
map.put("total", total);
|
|
|
map.put("nameList",stringList);
|
|
|
+ if(timeType.getIsCro()==1){
|
|
|
+ map.put("degrees",timeType.getCustomDegreeName());
|
|
|
+ }
|
|
|
httpRespMsg.data = map;
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
@@ -379,6 +385,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
String planEndDate,
|
|
|
Integer level,
|
|
|
Double contractAmount,
|
|
|
+ String changeContractReason,
|
|
|
String projectBaseCostData,
|
|
|
Double budget,
|
|
|
Integer customerId,
|
|
@@ -506,7 +513,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
id = project.getId();
|
|
|
- if(companyId==936||companyId==428){
|
|
|
+ if(companyId==936){
|
|
|
projectSeparate.setId(id);
|
|
|
projectSeparateMapper.insert(projectSeparate);
|
|
|
}
|
|
@@ -523,6 +530,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (count > 0) {
|
|
|
httpRespMsg.setError("提交失败:项目编号已存在");
|
|
|
} else {
|
|
|
+ Project project = projectMapper.selectById(id);
|
|
|
Project p = new Project();
|
|
|
p.setProjectName(name).setId(id).setCompanyId(companyId).setProjectCode(code).setInchargerId(inchargerId)
|
|
|
.setLevel(level)
|
|
@@ -541,6 +549,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
convertDepartmentIdToCascade(0) :
|
|
|
convertDepartmentIdToCascade(deptId))
|
|
|
.setProviderNames(providerNames);
|
|
|
+ //编辑项目合同修改 添加记录
|
|
|
+ if(project.getContractAmount().doubleValue()!=contractAmount){
|
|
|
+ ContractModifyRecord contractModifyRecord=new ContractModifyRecord();
|
|
|
+ contractModifyRecord.setEditUserId(user.getId());
|
|
|
+ contractModifyRecord.setOldContractAmount(project.getContractAmount());
|
|
|
+ contractModifyRecord.setNewContractAmount(contractAmount);
|
|
|
+ contractModifyRecord.setProjectId(id);
|
|
|
+ contractModifyRecord.setReason(changeContractReason);
|
|
|
+ contractModifyRecord.setUpdateDate(LocalDateTime.now());
|
|
|
+ contractModifyRecordMapper.insert(contractModifyRecord);
|
|
|
+ }
|
|
|
if(timeType.getOutputValueStatus()==1){
|
|
|
p.setOutputValue(outputValue==null?0.00:outputValue);
|
|
|
}
|
|
@@ -551,7 +570,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
p.setCategoryName(projectCategory.getName());
|
|
|
}
|
|
|
}
|
|
|
- if(companyId==936||companyId==428){
|
|
|
+ if(companyId==936){
|
|
|
//编辑之前的项目是否存在子表数据
|
|
|
ProjectSeparate separate = projectSeparateMapper.selectById(id);
|
|
|
projectSeparate.setId(id);
|
|
@@ -1242,7 +1261,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<ProjectAuditor> auditorList = projectAuditorMapper.selectList(new QueryWrapper<ProjectAuditor>().eq("project_id", id));
|
|
|
project.setAuditorList(auditorList);
|
|
|
project.setAuditUserIds(auditorList.stream().map(ProjectAuditor::getAuditorId).collect(Collectors.toList()));
|
|
|
- if(project.getCompanyId()==936||project.getCompanyId()==428){
|
|
|
+ if(project.getCompanyId()==936){
|
|
|
ProjectSeparate projectSeparate = projectSeparateMapper.selectById(id);
|
|
|
project.setProjectSeparate(projectSeparate);
|
|
|
}
|
|
@@ -2835,25 +2854,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
int i=0;
|
|
|
int k=0;
|
|
|
int c=0;
|
|
|
- int d=0;
|
|
|
if(timeType.getMainProjectState()==1){
|
|
|
mainNameCell = row.getCell(0);
|
|
|
- if(company.getId()==428){
|
|
|
- projectCategorySubCell=row.getCell(1);
|
|
|
- d++;
|
|
|
- }
|
|
|
- codeCell = row.getCell(1+d);
|
|
|
+ codeCell = row.getCell(1);
|
|
|
if(company.getId()==936){
|
|
|
- contractCell=row.getCell(2+d);
|
|
|
+ contractCell=row.getCell(2);
|
|
|
c++;
|
|
|
}
|
|
|
- isPublicCell = row.getCell(2+c+d);
|
|
|
- nameCell = row.getCell(3+c+d);
|
|
|
- participatorCell = row.getCell(4+c+d);
|
|
|
- inchargerCell = row.getCell(5+c+d);
|
|
|
- levelCell = row.getCell(6+c+d);
|
|
|
+ isPublicCell = row.getCell(2+c);
|
|
|
+ nameCell = row.getCell(3+c);
|
|
|
+ participatorCell = row.getCell(4+c);
|
|
|
+ inchargerCell = row.getCell(5+c);
|
|
|
+ levelCell = row.getCell(6+c);
|
|
|
if(company.getPackageCustomer()==1){
|
|
|
- customerCell=row.getCell(7+c+d);
|
|
|
+ customerCell=row.getCell(7+c);
|
|
|
i++;
|
|
|
}
|
|
|
if(company.getPackageProvider()==1){
|
|
@@ -2863,17 +2877,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- startDateCell = row.getCell(7+i+k+c+d);
|
|
|
- endDateCell = row.getCell(8+i+k+c+d);
|
|
|
- amountCell = row.getCell(9+i+k+c+d);
|
|
|
+ startDateCell = row.getCell(7+i+k+c);
|
|
|
+ endDateCell = row.getCell(8+i+k+c);
|
|
|
+ amountCell = row.getCell(9+i+k+c);
|
|
|
if(company.getId()==936){
|
|
|
- warrantyEndDateCell=row.getCell(10+i+k+c+d);
|
|
|
- warrantyStartDateCell=row.getCell(11+i+k+c+d);
|
|
|
- projectCategorySubCell=row.getCell(12+i+k+c+d);
|
|
|
- regionCell=row.getCell(13+i+k+c+d);
|
|
|
- buCell=row.getCell(14+i+k+c+d);
|
|
|
- stateCell=row.getCell(15+i+k+c+d);
|
|
|
- stageCell=row.getCell(16+i+k+c+d);
|
|
|
+ warrantyEndDateCell=row.getCell(10+i+k+c);
|
|
|
+ warrantyStartDateCell=row.getCell(11+i+k+c);
|
|
|
+ projectCategorySubCell=row.getCell(12+i+k+c);
|
|
|
+ regionCell=row.getCell(13+i+k+c);
|
|
|
+ buCell=row.getCell(14+i+k+c);
|
|
|
+ stateCell=row.getCell(15+i+k+c);
|
|
|
+ stageCell=row.getCell(16+i+k+c);
|
|
|
}
|
|
|
}else {
|
|
|
codeCell = row.getCell(0);
|
|
@@ -2881,19 +2895,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
contractCell=row.getCell(1);
|
|
|
c++;
|
|
|
}
|
|
|
- if(company.getId()==428){
|
|
|
- projectCategorySubCell=row.getCell(1+c);
|
|
|
- d++;
|
|
|
- }
|
|
|
- categoryCell = row.getCell(1+c+d);
|
|
|
- isPublicCell = row.getCell(2+c+d);
|
|
|
- nameCell = row.getCell(3+c+d);
|
|
|
- subNameCell = row.getCell(4+c+d);
|
|
|
- participatorCell = row.getCell(5+c+d);
|
|
|
- inchargerCell = row.getCell(6+c+d);
|
|
|
- levelCell = row.getCell(7+c+d);
|
|
|
+ categoryCell = row.getCell(1+c);
|
|
|
+ isPublicCell = row.getCell(2+c);
|
|
|
+ nameCell = row.getCell(3+c);
|
|
|
+ subNameCell = row.getCell(4+c);
|
|
|
+ participatorCell = row.getCell(5+c);
|
|
|
+ inchargerCell = row.getCell(6+c);
|
|
|
+ levelCell = row.getCell(7+c);
|
|
|
if(company.getPackageCustomer()==1){
|
|
|
- customerCell=row.getCell(8+c+d);
|
|
|
+ customerCell=row.getCell(8+c);
|
|
|
i++;
|
|
|
}
|
|
|
if(company.getPackageProvider()==1){
|
|
@@ -2903,17 +2913,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- startDateCell = row.getCell(8+i+k+c+d);
|
|
|
- endDateCell = row.getCell(9+i+k+c+d);
|
|
|
- amountCell = row.getCell(10+i+k+c+d);
|
|
|
+ startDateCell = row.getCell(8+i+k+c);
|
|
|
+ endDateCell = row.getCell(9+i+k+c);
|
|
|
+ amountCell = row.getCell(10+i+k+c);
|
|
|
if(company.getId()==936){
|
|
|
- warrantyEndDateCell=row.getCell(11+i+k+c+d);
|
|
|
- warrantyStartDateCell=row.getCell(12+i+k+c+d);
|
|
|
- projectCategorySubCell=row.getCell(13+i+k+c+d);
|
|
|
- regionCell=row.getCell(14+i+k+c+d);
|
|
|
- buCell=row.getCell(15+i+k+c+d);
|
|
|
- stateCell=row.getCell(16+i+k+c+d);
|
|
|
- stageCell=row.getCell(17+i+k+c+d);
|
|
|
+ warrantyEndDateCell=row.getCell(11+i+k+c);
|
|
|
+ warrantyStartDateCell=row.getCell(12+i+k+c);
|
|
|
+ projectCategorySubCell=row.getCell(13+i+k+c);
|
|
|
+ regionCell=row.getCell(14+i+k+c);
|
|
|
+ buCell=row.getCell(15+i+k+c);
|
|
|
+ stateCell=row.getCell(16+i+k+c);
|
|
|
+ stageCell=row.getCell(17+i+k+c);
|
|
|
}
|
|
|
}
|
|
|
if (codeCell != null)codeCell.setCellType(CellType.STRING);
|
|
@@ -3187,14 +3197,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
projectSeparateMapper.insert(projectSeparate);
|
|
|
}
|
|
|
- if(company.getId()==428){
|
|
|
- ProjectSeparate projectSeparate=new ProjectSeparate();
|
|
|
- projectSeparate.setId(id);
|
|
|
- if (projectCategorySubCell != null && !StringUtils.isEmpty(projectCategorySubCell.getStringCellValue())) {
|
|
|
- projectSeparate.setProjectCategorySub(projectCategorySubCell.getStringCellValue());
|
|
|
- }
|
|
|
- projectSeparateMapper.insert(projectSeparate);
|
|
|
- }
|
|
|
importCount++;
|
|
|
//参与人
|
|
|
if(inchargerCell!=null){
|
|
@@ -3370,9 +3372,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
headList.add("项目状态");
|
|
|
headList.add("项目阶段");
|
|
|
}
|
|
|
- if(company.getId()==428){
|
|
|
- headList.add("项目分组");
|
|
|
- }
|
|
|
List<List<String>> allList = new ArrayList<List<String>>();
|
|
|
allList.add(headList);
|
|
|
String[] levelArray = new String[]{"正常","紧急","重要","重要且紧急","低风险","中风险","高风险"};
|
|
@@ -3473,15 +3472,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
rowData.add(projectVO.getCurrentStageName()==null?"":projectVO.getCurrentStageName());
|
|
|
}
|
|
|
- if(company.getId()==428){
|
|
|
- Optional<ProjectSeparate> first = projectSeparateList.stream().filter(ps -> ps.getId().equals(projectVO.getId())).findFirst();
|
|
|
- if(first.isPresent()){
|
|
|
- ProjectSeparate projectSeparate = first.get();
|
|
|
- rowData.add(projectSeparate.getProjectCategorySub()==null?"":projectSeparate.getProjectCategorySub());
|
|
|
- }else {
|
|
|
- rowData.add("");
|
|
|
- }
|
|
|
- }
|
|
|
allList.add(rowData);
|
|
|
}
|
|
|
|