|
@@ -244,6 +244,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
List<ProviderInfo> providerInfoList = providerInfoMapper.selectList(new QueryWrapper<ProviderInfo>().eq("company_id", companyId));
|
|
|
List<ProviderCategory> providerCategoryList = providerCategoryMapper.selectList(new QueryWrapper<ProviderCategory>().eq("company_id", companyId));
|
|
|
+ List<ProjectMain> projectMainList = projectMainMapper.selectList(new QueryWrapper<ProjectMain>().eq("company_id", companyId));
|
|
|
List<ProjectVO> list = new ArrayList<>();
|
|
|
for (Project project : projectList) {
|
|
|
ProjectVO projectVO = new ProjectVO();
|
|
@@ -255,6 +256,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
projectVO.setInchargerName(incharger.getName());
|
|
|
projectVO.setInchargerPhone(incharger.getPhone());
|
|
|
}
|
|
|
+ Optional<ProjectMain> projectMain = projectMainList.stream().filter(pm -> pm.getId().equals(project.getProjectMainId())).findFirst();
|
|
|
+ if(projectMain.isPresent()){
|
|
|
+ projectVO.setProjectMainName(projectMain.get().getName());
|
|
|
+ }
|
|
|
List<Map<String,Object>> mapList=new ArrayList<>();
|
|
|
if(!StringUtils.isEmpty(project.getProviderIds())){
|
|
|
String[] providerIdString = project.getProviderIds().split(",");
|
|
@@ -1399,7 +1404,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg exportProjectTask(HttpServletRequest request) {
|
|
|
+ public HttpRespMsg exportProjectTask(HttpServletRequest request,Integer taskType) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
|
|
|
User user = userMapper.selectById(request.getHeader("Token"));
|
|
@@ -1407,7 +1412,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
QueryWrapper<Project> queryWrapper = new QueryWrapper<Project>().eq("company_id", companyId);
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- List<Map> projectList = taskMapper.getProjectTask(companyId, null, null, null,null);
|
|
|
+ List<Map> projectList = taskMapper.getProjectTask(companyId, null, null, null,taskType);
|
|
|
List<ProjectVO> list = new ArrayList<>();
|
|
|
String[] statusNames = {"进行中","已完成","已撤销"};
|
|
|
String[] typeList = {"任务","里程碑","风险"};
|
|
@@ -2460,39 +2465,68 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
continue;
|
|
|
}
|
|
|
//项目编号 项目名称 参与人 负责人 级别 开始日期 截止日期 合同金额
|
|
|
- HSSFCell codeCell = row.getCell(0);
|
|
|
- HSSFCell categoryCell = row.getCell(1);
|
|
|
- HSSFCell isPublicCell = row.getCell(2);
|
|
|
- HSSFCell nameCell = row.getCell(3);
|
|
|
HSSFCell subNameCell=null;
|
|
|
HSSFCell mainNameCell=null;
|
|
|
- if(timeType.getMainProjectState()==1){
|
|
|
- mainNameCell = row.getCell(4);
|
|
|
- }else {
|
|
|
- subNameCell = row.getCell(4);
|
|
|
- }
|
|
|
- HSSFCell participatorCell = row.getCell(5);
|
|
|
- HSSFCell inchargerCell = row.getCell(6);
|
|
|
- HSSFCell levelCell = row.getCell(7);
|
|
|
+ HSSFCell codeCell=null;
|
|
|
+ HSSFCell isPublicCell=null;
|
|
|
+ HSSFCell nameCell=null;
|
|
|
+ HSSFCell participatorCell=null;
|
|
|
+ HSSFCell inchargerCell=null;
|
|
|
+ HSSFCell levelCell=null;
|
|
|
HSSFCell customerCell=null;
|
|
|
+ HSSFCell startDateCell=null;
|
|
|
+ HSSFCell endDateCell=null;
|
|
|
+ HSSFCell amountCell=null;
|
|
|
+ HSSFCell categoryCell=null;
|
|
|
int i=0;
|
|
|
int k=0;
|
|
|
- if(company.getPackageCustomer()==1){
|
|
|
- customerCell=row.getCell(8);
|
|
|
- i++;
|
|
|
- }
|
|
|
- if(company.getPackageProvider()==1){
|
|
|
- for (int j = 0; j < providerCategoryList.size(); j++) {
|
|
|
- if(company.getPackageProvider()==1){
|
|
|
- k++;
|
|
|
+ if(timeType.getMainProjectState()==1){
|
|
|
+ mainNameCell = row.getCell(0);
|
|
|
+ codeCell = row.getCell(1);
|
|
|
+ isPublicCell = row.getCell(2);
|
|
|
+ nameCell = row.getCell(3);
|
|
|
+ participatorCell = row.getCell(4);
|
|
|
+ inchargerCell = row.getCell(5);
|
|
|
+ levelCell = row.getCell(6);
|
|
|
+ if(company.getPackageCustomer()==1){
|
|
|
+ customerCell=row.getCell(7);
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ if(company.getPackageProvider()==1){
|
|
|
+ for (int j = 0; j < providerCategoryList.size(); j++) {
|
|
|
+ if(company.getPackageProvider()==1){
|
|
|
+ k++;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ startDateCell = row.getCell(7+i+k);
|
|
|
+ endDateCell = row.getCell(8+i+k);
|
|
|
+ amountCell = row.getCell(9+i+k);
|
|
|
+ }else {
|
|
|
+ codeCell = row.getCell(0);
|
|
|
+ categoryCell = row.getCell(1);
|
|
|
+ isPublicCell = row.getCell(2);
|
|
|
+ nameCell = row.getCell(3);
|
|
|
+ subNameCell = row.getCell(4);
|
|
|
+ participatorCell = row.getCell(5);
|
|
|
+ inchargerCell = row.getCell(6);
|
|
|
+ levelCell = row.getCell(7);
|
|
|
+ customerCell=null;
|
|
|
+ if(company.getPackageCustomer()==1){
|
|
|
+ customerCell=row.getCell(8);
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ if(company.getPackageProvider()==1){
|
|
|
+ for (int j = 0; j < providerCategoryList.size(); j++) {
|
|
|
+ if(company.getPackageProvider()==1){
|
|
|
+ k++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ startDateCell = row.getCell(8+i+k);
|
|
|
+ endDateCell = row.getCell(9+i+k);
|
|
|
+ amountCell = row.getCell(10+i+k);
|
|
|
}
|
|
|
- HSSFCell startDateCell = row.getCell(8+i+k);
|
|
|
- HSSFCell endDateCell = row.getCell(9+i+k);
|
|
|
- HSSFCell amountCell = row.getCell(10+i+k);
|
|
|
-
|
|
|
-
|
|
|
if (codeCell != null)codeCell.setCellType(CellType.STRING);
|
|
|
if (nameCell != null)nameCell.setCellType(CellType.STRING);
|
|
|
if (categoryCell != null)categoryCell.setCellType(CellType.STRING);
|
|
@@ -2527,7 +2561,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//检查项目是否存在
|
|
|
List<ProjectCategory> projectCategoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id", user.getCompanyId()));
|
|
|
if (categoryCell != null && !StringUtils.isEmpty(categoryCell.getStringCellValue())) {
|
|
|
- Optional<ProjectCategory> category = projectCategoryList.stream().filter(pc -> pc.getName().equals(categoryCell.getStringCellValue())).findFirst();
|
|
|
+ HSSFCell finalCategoryCell = categoryCell;
|
|
|
+ Optional<ProjectCategory> category = projectCategoryList.stream().filter(pc -> pc.getName().equals(finalCategoryCell.getStringCellValue())).findFirst();
|
|
|
if(!category.isPresent()){
|
|
|
throw new Exception("项目分类["+categoryCell.getStringCellValue()+"]不存在");
|
|
|
}
|
|
@@ -2593,8 +2628,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
for (int j = 0; j < providerCategoryList.size(); j++) {
|
|
|
String nameSb = "";
|
|
|
String idSb = "";
|
|
|
- providerCell=row.getCell(8+i);
|
|
|
- HSSFCell cell = row.getCell(10);
|
|
|
+ if(timeType.getMainProjectState()==1){
|
|
|
+ providerCell=row.getCell(7+i);
|
|
|
+ HSSFCell cell = row.getCell(9);
|
|
|
+ }else {
|
|
|
+ providerCell=row.getCell(8+i);
|
|
|
+ HSSFCell cell = row.getCell(10);
|
|
|
+ }
|
|
|
System.out.println("当前分类:"+providerCategoryList.get(j).getProviderCategoryName()+", categoryId="+providerCategoryList.get(j).getId());
|
|
|
String categoryName = providerCategoryList.get(j).getProviderCategoryName();
|
|
|
Integer categoryId = providerCategoryList.get(j).getId();
|