项目状态看板导出优化、UAT问题清单修改。
This commit is contained in:
+4
-4
@@ -45,8 +45,8 @@ public class ProjectStatusBoardController {
|
||||
@ApiOperation(value="时间轴列表", notes="时间轴列表")
|
||||
@GetMapping(value = "/timelineList")
|
||||
@RequiresPermissions("ProjectStatusBoard:info")
|
||||
public Result<?> timelineList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req) {
|
||||
List<Map<String,Object>> result = iProjectStatusBoardService.timelineList(projectLibraryBase, req);
|
||||
public Result<?> timelineList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req,@RequestParam("queryAllProject") boolean queryAllProject) {
|
||||
List<Map<String,Object>> result = iProjectStatusBoardService.timelineList(projectLibraryBase, req,queryAllProject);
|
||||
if(result==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
@@ -85,8 +85,8 @@ public class ProjectStatusBoardController {
|
||||
|
||||
// 导出excel文件
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectLibraryBase projectLibraryBase) {
|
||||
this.iProjectStatusBoardService.exportXls(response,request, projectLibraryBase);
|
||||
public void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectLibraryBase projectLibraryBase,@RequestParam("queryAllProject") boolean queryAllProject) {
|
||||
this.iProjectStatusBoardService.exportXls(response,request, projectLibraryBase,queryAllProject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
@@ -254,4 +254,8 @@ public class ProjectCertificationInventoryEO implements Serializable {
|
||||
/**认证类型*/
|
||||
@ApiModelProperty(value = "认证类型")
|
||||
private String attestationType;
|
||||
|
||||
/**一级责任领域**/
|
||||
@TableField(exist = false)
|
||||
private String firstLevelDutyTerritory;
|
||||
}
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ public interface IProjectStatusBoardService {
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> timelineList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req);
|
||||
List<Map<String,Object>> timelineList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req,boolean queryAllProject);
|
||||
|
||||
List<String> timeline(String startTime, String endTime);
|
||||
|
||||
@@ -39,5 +39,5 @@ public interface IProjectStatusBoardService {
|
||||
* @param request
|
||||
* @param projectLibraryBase
|
||||
*/
|
||||
void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectLibraryBase projectLibraryBase);
|
||||
void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectLibraryBase projectLibraryBase,boolean queryAllProject);
|
||||
}
|
||||
|
||||
+31
@@ -30,6 +30,7 @@ import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.dummy.enums.OrderEnum;
|
||||
import com.jero.modules.enums.DictCodeEnum;
|
||||
import com.jero.modules.feishu.enums.TemplateInfoEnum2;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
@@ -1415,6 +1416,36 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
String roleCode = projectCertificationInventoryEO.getRoleCode();
|
||||
// 创建查询权限
|
||||
this.createQueryPermission(queryWrapper,roleCode);
|
||||
// 根据一级责任领域(统计节点),查询该一级责任领域下所有子责任领域的法规清单数据。
|
||||
String dutyTerritoryStr = "";
|
||||
if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getFirstLevelDutyTerritory())){
|
||||
List<SysDictItem> sysDictItems = this.sysDictItemServiceImpl.selectItemsAll();
|
||||
List<SysDictItem> dutyTerritorys = new ArrayList<>();
|
||||
Map<String, List<SysDictItem>> firstLevelDTMap = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(), sysDictItems);
|
||||
String[] firstLevelDTArr = projectCertificationInventoryEO.getFirstLevelDutyTerritory().split(",");
|
||||
for (String firstLevelDT : firstLevelDTArr){
|
||||
if(CollectionUtils.isNotEmpty(firstLevelDTMap.get(firstLevelDT))){
|
||||
dutyTerritorys.addAll(firstLevelDTMap.get(firstLevelDT));
|
||||
}
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(dutyTerritorys)){
|
||||
dutyTerritoryStr = dutyTerritorys.stream().map(SysDictItem::getItemValue).distinct().collect(Collectors.joining(","));
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(dutyTerritoryStr)) {
|
||||
String finalDutyTerritoryStr = dutyTerritoryStr.replaceAll("\\*","");
|
||||
queryWrapper.and(query -> {
|
||||
query.lambda().like(ProjectCertificationInventoryEO::getDutyTerritory, finalDutyTerritoryStr);
|
||||
if(StringUtils.contains(finalDutyTerritoryStr,",")){
|
||||
String[] dutyTerritoryArr = finalDutyTerritoryStr.split(",");
|
||||
for (String duty : dutyTerritoryArr) {
|
||||
query.or(q -> {
|
||||
q.like("duty_territory",duty);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
IPage<ProjectCertificationInventoryEO> pageList = this.page(page, queryWrapper);
|
||||
this.disposeData(pageList.getRecords(),cut);
|
||||
List<ProjectCertificationInventoryEO> records = this.hearSort(projectCertificationInventoryEO, pageList.getRecords());
|
||||
|
||||
+88
-10
@@ -30,6 +30,7 @@ import com.jero.modules.system.service.IProjectUserBrandService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -38,6 +39,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -49,6 +51,7 @@ import java.io.OutputStream;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -56,6 +59,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2022/5/13 9:59
|
||||
* @auth zhn
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService {
|
||||
private static DecimalFormat df = new DecimalFormat("#.00");
|
||||
@@ -98,7 +102,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public List<Map<String,Object>> timelineList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req) {
|
||||
public List<Map<String,Object>> timelineList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req,boolean queryAllProject) {
|
||||
if(StringUtils.isNotBlank(projectLibraryBase.getProjectName())){
|
||||
String s = projectLibraryBase.getProjectName().replaceAll("\\*", "");
|
||||
projectLibraryBase.setProjectName(s);
|
||||
@@ -107,6 +111,13 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//项目库信息
|
||||
List<ProjectLibraryBase> projectLibraryBaseList = projectLibraryBaseService.getList(projectLibraryBase);
|
||||
if(!queryAllProject){
|
||||
// 如果不是查询所有项目,只查询主项目
|
||||
projectLibraryBaseList = projectLibraryBaseList.stream().filter(plbEo -> {
|
||||
boolean flag = (StringUtils.isEmpty(plbEo.getParentId()) || StringUtils.equals(plbEo.getProjectVersion(),"00"));
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
List<List<TimeNodeVO>> list = new ArrayList<>();
|
||||
List<Map<String,Object>> result = new ArrayList<>();
|
||||
|
||||
@@ -538,12 +549,25 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
|
||||
|
||||
@Override
|
||||
public void exportXls(HttpServletResponse response, HttpServletRequest request,ProjectLibraryBase projectLibraryBase) {
|
||||
public void exportXls(HttpServletResponse response, HttpServletRequest request,ProjectLibraryBase projectLibraryBase,boolean queryAllProject) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
String fileName = "";
|
||||
String cut = projectLibraryBase.getCut();
|
||||
OutputStream ops = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
|
||||
if(StringUtils.isNotBlank(projectLibraryBase.getProjectName())){
|
||||
String s = projectLibraryBase.getProjectName().replaceAll("\\*", "");
|
||||
projectLibraryBase.setProjectName(s);
|
||||
}
|
||||
List<ProjectLibraryBase> plbEoList = this.projectLibraryBaseService.getList(projectLibraryBase);
|
||||
if(!queryAllProject){
|
||||
// 如果不是查询所有项目,只查询主项目
|
||||
plbEoList = plbEoList.stream().filter(plbEo -> {
|
||||
boolean flag = (StringUtils.isEmpty(plbEo.getParentId()) || StringUtils.equals(plbEo.getProjectVersion(),"00"));
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsByDictCode("region");
|
||||
for (ProjectLibraryBase libraryBase : plbEoList) {
|
||||
targetMarket(projectLibraryBase, dictItemList, libraryBase);
|
||||
@@ -552,10 +576,49 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
List<ProjectCertificationInventoryEO> pciEoList = this.projectCertificationInventoryEOService.list();
|
||||
List<ProjectTaskPlanning> ptpEoList = this.projectTaskPlanningService.list();
|
||||
List<ParamsManifestEO> pmEoList = this.paramsManifestEOService.list();
|
||||
log.info("一阶段消耗时间:" + (System.currentTimeMillis() - startTime));
|
||||
List<ParamsCollectManifestEO> pcmEoList = this.paramsCollectManifestEOService.getList(null);
|
||||
|
||||
this.exportCrossProjectProgress(workbook,projectLibraryBase,plbEoList,pliEoList,pciEoList,pmEoList,pcmEoList,ptpEoList);
|
||||
this.exportOverviewCrossProjectProgress(workbook,projectLibraryBase,plbEoList,pliEoList,pciEoList,pmEoList,pcmEoList,ptpEoList);
|
||||
log.info("二阶段消耗时间:" + (System.currentTimeMillis() - startTime));
|
||||
|
||||
// this.exportCrossProjectProgress(workbook,projectLibraryBase,plbEoList,pliEoList,pciEoList,pmEoList,pcmEoList,ptpEoList);
|
||||
// this.exportOverviewCrossProjectProgress(workbook,projectLibraryBase,plbEoList,pliEoList,pciEoList,pmEoList,pcmEoList,ptpEoList);
|
||||
|
||||
HSSFSheet corssProjectProgressSheet = createCorssProjectProgressSheet(workbook, projectLibraryBase);
|
||||
HSSFSheet overviewCrossProjectProgressSheet = this.createOverviewCrossProjectProgressSheet(workbook, projectLibraryBase);
|
||||
CellStyle cellStyleTitle = workbook.createCellStyle();
|
||||
cellStyleTitle.setAlignment(HorizontalAlignment.CENTER);
|
||||
cellStyleTitle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
|
||||
// 多线程代码
|
||||
// 创建线程一
|
||||
List<ProjectLibraryBase> finalPlbEoList = plbEoList;
|
||||
Thread thread1 = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
exportCrossProjectProgressSetData(finalPlbEoList, corssProjectProgressSheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList);
|
||||
}
|
||||
});
|
||||
|
||||
// 创建线程二
|
||||
Thread thread2 = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
exportOverviewCrossProjectProgressSetData(finalPlbEoList, overviewCrossProjectProgressSheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList,cellStyleTitle);
|
||||
}
|
||||
});
|
||||
|
||||
// 启动线程一和线程二
|
||||
thread1.start();
|
||||
thread2.start();
|
||||
|
||||
// 等待线程一和线程二执行完毕
|
||||
try {
|
||||
thread1.join();
|
||||
thread2.join();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + fileName);
|
||||
@@ -573,6 +636,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
}finally {
|
||||
IOUtils.closeQuietly(ops);
|
||||
}
|
||||
log.info("总消耗时间:" + (System.currentTimeMillis() - startTime));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -586,7 +650,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
* @param pcmEoList
|
||||
* @param ptpEoList
|
||||
*/
|
||||
private void exportCrossProjectProgress(HSSFWorkbook workbook,
|
||||
private void exportCrossProjectProgress(HSSFSheet sheet,
|
||||
ProjectLibraryBase projectLibraryBase,
|
||||
List<ProjectLibraryBase> plbEoList,
|
||||
List<ProjectLawsInventoryEO> pliEoList,
|
||||
@@ -594,6 +658,11 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
List<ParamsManifestEO> pmEoList,
|
||||
List<ParamsCollectManifestEO> pcmEoList,
|
||||
List<ProjectTaskPlanning> ptpEoList) {
|
||||
this.exportCrossProjectProgressSetData(plbEoList, sheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private HSSFSheet createCorssProjectProgressSheet(HSSFWorkbook workbook, ProjectLibraryBase projectLibraryBase) {
|
||||
String cut = projectLibraryBase.getCut();
|
||||
String sheetName = "项目进度";
|
||||
String firstTitle = "项目," +
|
||||
@@ -682,8 +751,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
secondRowCell.setCellValue(secondTitleArr[i-1]);
|
||||
}
|
||||
}
|
||||
|
||||
this.exportCrossProjectProgressSetData(plbEoList, sheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList);
|
||||
return sheet;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -707,6 +775,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
List<ProjectTaskPlanning> ptpEoList) {
|
||||
int dataIndex = 2;
|
||||
for (ProjectLibraryBase plbEo : plbEoList) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
Row dataRow = sheet.createRow(dataIndex);
|
||||
dataRow.createCell(0).setCellValue(plbEo.getShowName());
|
||||
|
||||
@@ -900,6 +969,8 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
dataRow.createCell(55).setCellValue(parameterCollectingPercentageStr + percentSign);
|
||||
dataRow.createCell(56).setCellValue(certificationSubmissionStr);
|
||||
dataIndex ++;
|
||||
|
||||
log.info("11111处理"+ dataIndex +"个项目消耗时间:" + (System.currentTimeMillis() - startTime));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -914,14 +985,19 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
* @param pcmEoList
|
||||
* @param ptpEoList
|
||||
*/
|
||||
private void exportOverviewCrossProjectProgress(HSSFWorkbook workbook,
|
||||
private void exportOverviewCrossProjectProgress(HSSFSheet sheet,
|
||||
ProjectLibraryBase projectLibraryBase,
|
||||
List<ProjectLibraryBase> plbEoList,
|
||||
List<ProjectLawsInventoryEO> pliEoList,
|
||||
List<ProjectCertificationInventoryEO> pciEoList,
|
||||
List<ParamsManifestEO> pmEoList,
|
||||
List<ParamsCollectManifestEO> pcmEoList,
|
||||
List<ProjectTaskPlanning> ptpEoList) {
|
||||
List<ProjectTaskPlanning> ptpEoList,
|
||||
CellStyle cellStyleTitle) {
|
||||
this.exportOverviewCrossProjectProgressSetData(plbEoList, sheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList,cellStyleTitle);
|
||||
}
|
||||
|
||||
public HSSFSheet createOverviewCrossProjectProgressSheet(HSSFWorkbook workbook, ProjectLibraryBase projectLibraryBase){
|
||||
String cut = projectLibraryBase.getCut();
|
||||
String sheetName = "项目进度概览";
|
||||
String firstTitle = "项目,R&H Studio,法规符合性管理,认证活动管理";
|
||||
@@ -975,7 +1051,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
secondRowCell.setCellValue(secondTitleArr[i]);
|
||||
}
|
||||
}
|
||||
this.exportOverviewCrossProjectProgressSetData(plbEoList, sheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList,cellStyleTitle);
|
||||
return sheet;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1001,6 +1077,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
CellStyle cellStyleTitle) {
|
||||
int dataIndex = 2;
|
||||
for (ProjectLibraryBase plbEo : plbEoList) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
List<ProjectTaskPlanning> ptpEoListTemp = ptpEoList.stream().filter(ptpEo -> StringUtils.equals(ptpEo.getProjectId(), plbEo.getId())).collect(Collectors.toList());
|
||||
String legalTaskConfirmationStr = "";
|
||||
String designDeadlineStr = "";
|
||||
@@ -1131,6 +1208,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
}
|
||||
}
|
||||
dataIndex += 2;
|
||||
log.info("22222处理"+ dataIndex +"个项目消耗时间:" + (System.currentTimeMillis() - startTime));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user