项目状态看板导出-项目进度、项目进度概览内容。
This commit is contained in:
+2
@@ -35,4 +35,6 @@ public interface ParamsCollectManifestEOMapper extends BaseMapper<ParamsCollectM
|
||||
IPage selectpage(@Param("page") IPage page, @Param("sqlJoin") String sqlJoin, @Param("paramsManifestEO")ParamsManifestEO paramsManifestEO);
|
||||
|
||||
List<ParamsCollectManifestEO> queryByProjectId(@Param("projectId") String projectId);
|
||||
|
||||
List<ParamsCollectManifestEO> getList(@Param("params") Map<String, Object> params);
|
||||
}
|
||||
|
||||
+3
@@ -139,5 +139,8 @@
|
||||
<select id="queryByProjectId" resultMap="ParamsCollectManifestEOResultMap">
|
||||
SELECT * from params_collect_manifest pcm LEFT JOIN params_manifest pm ON pm.id = pcm.params_manifest_id WHERE pm.project_id = #{projectId}
|
||||
</select>
|
||||
<select id="getList" resultType="com.jero.modules.cert.collect.entity.ParamsCollectManifestEO">
|
||||
SELECT id,params_manifest_id,state FROM params_collect_manifest
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
+2
@@ -200,4 +200,6 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
|
||||
|
||||
// 认证工程师-批量编辑截止时间
|
||||
Result<?> batchEditDeadline(ParamsCollectManifestVO paramsCollectManifestVO);
|
||||
|
||||
List<ParamsCollectManifestEO> getList(Map<String,Object> params);
|
||||
}
|
||||
|
||||
+6
@@ -7256,4 +7256,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
|
||||
return Result.OK("批量编辑截止时间成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ParamsCollectManifestEO> getList(Map<String,Object> params) {
|
||||
List<ParamsCollectManifestEO> result = this.baseMapper.getList(params);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -12,9 +12,11 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -81,6 +83,11 @@ public class ProjectStatusBoardController {
|
||||
return Result.OK(mapList);
|
||||
}
|
||||
|
||||
// 导出excel文件
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectLibraryBase projectLibraryBase) {
|
||||
this.iProjectStatusBoardService.exportXls(response,request, projectLibraryBase);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+21
@@ -288,4 +288,25 @@ public interface IProjectCertificationInventoryEOService extends IService<Projec
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getPartCertificationProgressStatistics(List<ProjectCertificationInventoryEO> pciEoList);
|
||||
|
||||
/**
|
||||
* 按照认证任务确认状态分组
|
||||
* @param pciEos
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> groupByFGRwqrStatus(List<ProjectCertificationInventoryEO> pciEos);
|
||||
|
||||
/**
|
||||
* 按照preHomo确认状态分组
|
||||
* @param pciEos
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> groupByPreHomoStatus(List<ProjectCertificationInventoryEO> pciEos);
|
||||
|
||||
/**
|
||||
* 根据认证进度分组
|
||||
* @param pciEos
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> groupByCertificationProgress(List<ProjectCertificationInventoryEO> pciEos);
|
||||
}
|
||||
|
||||
+21
@@ -281,4 +281,25 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
|
||||
List<Map<String,Object>> queryNotComplianList(Map<String, Object> params);
|
||||
|
||||
void exportNotComplianList(HttpServletResponse response, HttpServletRequest request, Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 按照法规任务确认状态分组
|
||||
* @param pliEos
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> groupByFGRwqrStatus(List<ProjectLawsInventoryEO> pliEos);
|
||||
|
||||
/**
|
||||
* 按照设计符合性状态分组
|
||||
* @param pliEos
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> groupByDesignStatus(List<ProjectLawsInventoryEO> pliEos);
|
||||
|
||||
/**
|
||||
* 按照验证符合性状态分组
|
||||
* @param pliEos
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> groupByVerifyStatus(List<ProjectLawsInventoryEO> pliEos);
|
||||
}
|
||||
|
||||
+9
@@ -4,6 +4,7 @@ import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.vo.TimeNodeVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -31,4 +32,12 @@ public interface IProjectStatusBoardService {
|
||||
* @param req
|
||||
*/
|
||||
List<Map<String,Object>> scheduleInfoList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 导出excel文件
|
||||
* @param response
|
||||
* @param request
|
||||
* @param projectLibraryBase
|
||||
*/
|
||||
void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectLibraryBase projectLibraryBase);
|
||||
}
|
||||
|
||||
+256
-4
@@ -84,10 +84,7 @@ import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.*;
|
||||
import java.text.Collator;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.text.*;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -112,6 +109,9 @@ import static com.jero.modules.document.service.impl.BussDocumentLibraryEOServic
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<ProjectCertificationInventoryEOMapper, ProjectCertificationInventoryEO> implements IProjectCertificationInventoryEOService {
|
||||
|
||||
private static DecimalFormat df = new DecimalFormat("#.00");
|
||||
private static String percentSign = "%";
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
@@ -5602,4 +5602,256 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
|
||||
return Result.OK("添加配置成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> groupByFGRwqrStatus(List<ProjectCertificationInventoryEO> pciEos) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
Map<String,Object> projectScheduleExportMap = new HashMap<>();
|
||||
|
||||
double toBeReleasedCount = 0;
|
||||
double toBeVerifiedCount = 0;
|
||||
double toBeConfirmedCount = 0;
|
||||
double acceptCount = 0;
|
||||
double refuseCount = 0;
|
||||
double count = 0;
|
||||
// 计算百分比
|
||||
double percentage = 0;
|
||||
String percentageStr = "0";
|
||||
if(CollectionUtils.isNotEmpty(pciEos)){
|
||||
List<ProjectCertificationInventoryEO> toBeReleased = pciEos.stream().filter(pciEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|
||||
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectCertificationInventoryEO> toBeVerified = pciEos.stream().filter(pciEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectCertificationInventoryEO> toBeConfirmed = pciEos.stream().filter(pciEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectCertificationInventoryEO> accept = pciEos.stream().filter(pciEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|
||||
|| StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|
||||
|| StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue())
|
||||
|| StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectCertificationInventoryEO> refuse = pciEos.stream().filter(pciEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
toBeReleasedCount = toBeReleased.size();
|
||||
toBeVerifiedCount = toBeVerified.size();
|
||||
toBeConfirmedCount = toBeConfirmed.size();
|
||||
acceptCount = accept.size();
|
||||
refuseCount = refuse.size();
|
||||
|
||||
count = toBeReleasedCount + toBeVerifiedCount + toBeConfirmedCount + acceptCount + refuseCount;
|
||||
// 计算百分比
|
||||
percentage = acceptCount / count * 100;
|
||||
percentageStr = percentage != 0 ? df.format(percentage) : "0";
|
||||
}
|
||||
|
||||
projectScheduleExportMap.put("toBeReleased",toBeReleasedCount);
|
||||
projectScheduleExportMap.put("toBeVerified",toBeVerifiedCount);
|
||||
projectScheduleExportMap.put("toBeConfirmed",toBeConfirmedCount);
|
||||
projectScheduleExportMap.put("accept",acceptCount);
|
||||
projectScheduleExportMap.put("refuse",refuseCount);
|
||||
projectScheduleExportMap.put("percentage",percentageStr + percentSign);
|
||||
result.put("projectScheduleExportMap",projectScheduleExportMap);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> groupByPreHomoStatus(List<ProjectCertificationInventoryEO> pciEos) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
Map<String,Object> projectScheduleExportMap = new HashMap<>();
|
||||
|
||||
double notStartCount = 0; // 未发起
|
||||
double toBeSubmittedCount = 0; // 待提交
|
||||
double toBeReviewedCount = 0; // 待审查
|
||||
double acceptCount = 0; // 审查通过
|
||||
double refuseCount = 0; // 审查退回
|
||||
double taskTerminationCount = 0; // 任务终止
|
||||
double count = 0;
|
||||
// 计算百分比
|
||||
double percentage = 0;
|
||||
String percentageStr = "0";
|
||||
if(CollectionUtils.isNotEmpty(pciEos)){
|
||||
List<ProjectCertificationInventoryEO> notStart = pciEos.stream().filter(pciEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|
||||
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue())
|
||||
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|
||||
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
|
||||
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectCertificationInventoryEO> toBeSubmitted = pciEos.stream().filter(pciEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectCertificationInventoryEO> toBeReviewed = pciEos.stream().filter(pciEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectCertificationInventoryEO> accept = pciEos.stream().filter(pciEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectCertificationInventoryEO> refuse = pciEos.stream().filter(pciEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
notStartCount = notStart.size();
|
||||
toBeSubmittedCount = toBeSubmitted.size();
|
||||
toBeReviewedCount = toBeReviewed.size();
|
||||
acceptCount = accept.size();
|
||||
refuseCount = refuse.size();
|
||||
|
||||
count = notStartCount + toBeSubmittedCount + toBeReviewedCount + acceptCount + refuseCount;
|
||||
// 计算百分比
|
||||
percentage = acceptCount / count * 100;
|
||||
percentageStr = percentage != 0 ? df.format(percentage) : "0";
|
||||
}
|
||||
|
||||
projectScheduleExportMap.put("notStartCount",notStartCount);
|
||||
projectScheduleExportMap.put("toBeSubmittedCount",toBeSubmittedCount);
|
||||
projectScheduleExportMap.put("toBeReviewedCount",toBeReviewedCount);
|
||||
projectScheduleExportMap.put("accept",acceptCount);
|
||||
projectScheduleExportMap.put("refuse",refuseCount);
|
||||
projectScheduleExportMap.put("percentage",percentageStr + percentSign);
|
||||
result.put("projectScheduleExportMap",projectScheduleExportMap);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> groupByCertificationProgress(List<ProjectCertificationInventoryEO> pciEos) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
Map<String,Object> projectScheduleExportMap = new HashMap<>();
|
||||
|
||||
double notStartCount = 0; // 待开始
|
||||
double inProgressCount = 0; // 进行中
|
||||
double testPassedCount = 0; // 实验通过
|
||||
double testFailedCount = 0; // 实验失败
|
||||
double notSubmitCount = 0; // 部件报告未上传
|
||||
double reportSubmitCount = 0; // 部件报告已上传
|
||||
double storedCount = 0; // 部件报告已入库
|
||||
double count = 0;
|
||||
// 计算百分比
|
||||
double percentage = 0;
|
||||
String percentageStr = "0";
|
||||
|
||||
if(CollectionUtils.isNotEmpty(pciEos)){
|
||||
// 未开始
|
||||
List<ProjectCertificationInventoryEO> notStartPciEoList = pciEos.stream().filter(data -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.NOT_START.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
notStartCount = (double) notStartPciEoList.size();
|
||||
|
||||
// 进行中
|
||||
List<ProjectCertificationInventoryEO> inProgressPciEoList = pciEos.stream().filter(data -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.IN_PROGRESS.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
inProgressCount = (double) inProgressPciEoList.size();
|
||||
|
||||
// 实验通过
|
||||
List<ProjectCertificationInventoryEO> testPassedPciEoList = pciEos.stream().filter(data -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.TEST_PASSED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
testPassedCount = (double) testPassedPciEoList.size();
|
||||
|
||||
// 实验失败
|
||||
List<ProjectCertificationInventoryEO> testFailedPciEoList = pciEos.stream().filter(data -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.TEST_FAILED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
testFailedCount = (double) testFailedPciEoList.size();
|
||||
|
||||
// 部件报告未提交
|
||||
List<ProjectCertificationInventoryEO> notSubmitPciEoList = pciEos.stream().filter(data -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
notSubmitCount = (double) notSubmitPciEoList.size();
|
||||
|
||||
// 部件报告已提交
|
||||
List<ProjectCertificationInventoryEO> reportSubmitPciEoList = pciEos.stream().filter(data -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
reportSubmitCount = (double) reportSubmitPciEoList.size();
|
||||
|
||||
// 部件报告已入库
|
||||
List<ProjectCertificationInventoryEO> storedPciEoList = pciEos.stream().filter(data -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
storedCount = (double) storedPciEoList.size();
|
||||
|
||||
count = notStartCount + inProgressCount + testPassedCount + testFailedCount + testFailedCount + notSubmitCount + reportSubmitCount + storedCount;
|
||||
// 计算百分比
|
||||
percentage = testPassedCount / count * 100;
|
||||
percentageStr = percentage != 0 ? df.format(percentage) : "0";
|
||||
}
|
||||
projectScheduleExportMap.put("notStartCount",notStartCount);
|
||||
projectScheduleExportMap.put("inProgressCount",inProgressCount);
|
||||
projectScheduleExportMap.put("testPassedCount",testPassedCount);
|
||||
projectScheduleExportMap.put("testFailedCount",testFailedCount);
|
||||
projectScheduleExportMap.put("notSubmitCount",notSubmitCount);
|
||||
projectScheduleExportMap.put("reportSubmitCount",reportSubmitCount);
|
||||
projectScheduleExportMap.put("storedCount",storedCount);
|
||||
projectScheduleExportMap.put("count",count);
|
||||
projectScheduleExportMap.put("percentage",percentageStr + percentSign);
|
||||
result.put("projectScheduleExportMap",projectScheduleExportMap);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+352
-4
@@ -124,10 +124,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.Collator;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.text.*;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -147,6 +144,8 @@ import static com.jero.modules.document.service.impl.BussDocumentLibraryEOServic
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsInventoryEOMapper, ProjectLawsInventoryEO> implements IProjectLawsInventoryEOService {
|
||||
|
||||
private static DecimalFormat df = new DecimalFormat("#.00");
|
||||
private static String percentSign = "%";
|
||||
@Autowired
|
||||
private ProjectLibraryBaseMapper projectLibraryBaseMapper;
|
||||
|
||||
@@ -12880,4 +12879,353 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> groupByFGRwqrStatus(List<ProjectLawsInventoryEO> pliEos) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
|
||||
Map<String,Object> projectScheduleExportMap = new HashMap<>();
|
||||
Map<String,Object> toBeReleasedMap = new HashMap<>();
|
||||
Map<String,Object> toBeVerifiedMap = new HashMap<>();
|
||||
Map<String,Object> toBeConfirmedMap = new HashMap<>();
|
||||
Map<String,Object> acceptMap = new HashMap<>();
|
||||
Map<String,Object> refuseMap = new HashMap<>();
|
||||
|
||||
double toBeReleasedCount = 0;
|
||||
double toBeVerifiedCount = 0;
|
||||
double toBeConfirmedCount = 0;
|
||||
double acceptCount = 0;
|
||||
double refuseCount = 0;
|
||||
double count = 0;
|
||||
// 计算百分比
|
||||
double percentage = 0;
|
||||
String percentageStr = "0";
|
||||
if(CollectionUtils.isNotEmpty(pliEos)){
|
||||
List<ProjectLawsInventoryEO> designToBeReleased = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|
||||
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
List<ProjectLawsInventoryEO> verifyToBeReleased = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|
||||
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
toBeReleasedMap.put("designToBeReleased",designToBeReleased);
|
||||
toBeReleasedMap.put("verifyToBeReleased",verifyToBeReleased);
|
||||
|
||||
List<ProjectLawsInventoryEO> designToBeVerified = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
List<ProjectLawsInventoryEO> verifyToBeVerified = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
toBeVerifiedMap.put("designToBeVerified",designToBeVerified);
|
||||
toBeVerifiedMap.put("verifyToBeVerified",verifyToBeVerified);
|
||||
|
||||
List<ProjectLawsInventoryEO> designToBeConfirmed = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
List<ProjectLawsInventoryEO> verifyToBeConfirmed = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
toBeConfirmedMap.put("designToBeConfirmed",designToBeConfirmed);
|
||||
toBeConfirmedMap.put("verifyToBeConfirmed",verifyToBeConfirmed);
|
||||
|
||||
List<ProjectLawsInventoryEO> designAccept = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|
||||
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|
||||
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue())
|
||||
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue())
|
||||
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
|
||||
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
List<ProjectLawsInventoryEO> verifyAccept = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|
||||
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|
||||
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue())
|
||||
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue())
|
||||
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
|
||||
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
acceptMap.put("designAccept",designAccept);
|
||||
acceptMap.put("verifyAccept",verifyAccept);
|
||||
|
||||
List<ProjectLawsInventoryEO> designRefuse = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
List<ProjectLawsInventoryEO> verifyRefuse = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
refuseMap.put("designRefuse",designRefuse);
|
||||
refuseMap.put("verifyRefuse",verifyRefuse);
|
||||
|
||||
toBeReleasedCount = designToBeReleased.size() + verifyToBeReleased.size();
|
||||
toBeVerifiedCount = designToBeVerified.size() + verifyToBeVerified.size();
|
||||
toBeConfirmedCount = designToBeConfirmed.size() + verifyToBeConfirmed.size();
|
||||
acceptCount = designAccept.size() + verifyAccept.size();
|
||||
refuseCount = designRefuse.size() + verifyRefuse.size();
|
||||
count = toBeReleasedCount + toBeVerifiedCount + toBeConfirmedCount + acceptCount + refuseCount;
|
||||
// 计算百分比
|
||||
percentage = acceptCount / count * 100;
|
||||
percentageStr = percentage != 0 ? df.format(percentage) : "0";
|
||||
}
|
||||
result.put(ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue(),toBeReleasedMap);
|
||||
result.put(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue(),toBeVerifiedMap);
|
||||
result.put(ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue(),toBeConfirmedMap);
|
||||
result.put(ComplianceFlowStatusEnum.CONFORMITY.getValue(),acceptMap);
|
||||
result.put(ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue(),refuseMap);
|
||||
|
||||
projectScheduleExportMap.put("toBeReleased",toBeReleasedCount);
|
||||
projectScheduleExportMap.put("toBeVerified",toBeVerifiedCount);
|
||||
projectScheduleExportMap.put("toBeConfirmed",toBeConfirmedCount);
|
||||
projectScheduleExportMap.put("accept",acceptCount);
|
||||
projectScheduleExportMap.put("refuse",refuseCount);
|
||||
projectScheduleExportMap.put("percentage",percentageStr + percentSign);
|
||||
result.put("projectScheduleExportMap",projectScheduleExportMap);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> groupByDesignStatus(List<ProjectLawsInventoryEO> pliEos) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
|
||||
Map<String,Object> projectScheduleExportMap = new HashMap<>();
|
||||
|
||||
double notStartCount = 0; // 未发起
|
||||
double toBeSubmittedCount = 0; // 待提交
|
||||
double toBeReviewedCount = 0; // 待审查
|
||||
double complianceCount = 0; // 符合
|
||||
double nonComplianceCount = 0; // 不符合
|
||||
double toBeTrackedCount = 0; // 待追踪
|
||||
double notInvolvedCount = 0; // 不涉及
|
||||
double taskTerminationCount = 0; // 任务终止
|
||||
double count = 0;
|
||||
// 计算百分比
|
||||
double percentage = 0;
|
||||
String percentageStr = "0";
|
||||
if(CollectionUtils.isNotEmpty(pliEos)){
|
||||
List<ProjectLawsInventoryEO> designNotStart = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|
||||
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|
||||
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
|
||||
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
|
||||
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> designToBeSubmitted = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> designToBeReviewed = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> designCompliance = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> designNonCompliance = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> designToBeTracked = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> designNotInvolved = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> taskTermination = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
notStartCount = designNotStart.size();
|
||||
toBeSubmittedCount = designToBeSubmitted.size();
|
||||
toBeReviewedCount = designToBeReviewed.size();
|
||||
complianceCount = designCompliance.size();
|
||||
nonComplianceCount = designNonCompliance.size();
|
||||
toBeTrackedCount = designToBeTracked.size();
|
||||
notInvolvedCount = designNotInvolved.size();
|
||||
taskTerminationCount = taskTermination.size();
|
||||
count = notStartCount + toBeSubmittedCount + toBeReviewedCount + complianceCount + nonComplianceCount + toBeTrackedCount + notInvolvedCount + taskTerminationCount;
|
||||
// 计算百分比
|
||||
percentage = complianceCount / count * 100;
|
||||
percentageStr = percentage != 0 ? df.format(percentage) : "0";
|
||||
}
|
||||
|
||||
projectScheduleExportMap.put("notStart",notStartCount);
|
||||
projectScheduleExportMap.put("toBeSubmitted",toBeSubmittedCount);
|
||||
projectScheduleExportMap.put("toBeReviewed",toBeReviewedCount);
|
||||
projectScheduleExportMap.put("compliance",complianceCount);
|
||||
projectScheduleExportMap.put("nonCompliance",nonComplianceCount);
|
||||
projectScheduleExportMap.put("toBeTracked",toBeTrackedCount);
|
||||
projectScheduleExportMap.put("notInvolved",notInvolvedCount);
|
||||
projectScheduleExportMap.put("taskTermination",taskTerminationCount);
|
||||
projectScheduleExportMap.put("count",count);
|
||||
projectScheduleExportMap.put("percentage",percentageStr + percentSign);
|
||||
result.put("projectScheduleExportMap",projectScheduleExportMap);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> groupByVerifyStatus(List<ProjectLawsInventoryEO> pliEos) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
|
||||
Map<String,Object> projectScheduleExportMap = new HashMap<>();
|
||||
|
||||
double notStartCount = 0; // 未发起
|
||||
double toBeSubmittedCount = 0; // 待提交
|
||||
double toBeReviewedCount = 0; // 待审查
|
||||
double complianceCount = 0; // 符合
|
||||
double nonComplianceCount = 0; // 不符合
|
||||
double toBeTrackedCount = 0; // 待追踪
|
||||
double notInvolvedCount = 0; // 不涉及
|
||||
double taskTerminationCount = 0; // 任务终止
|
||||
double count = 0;
|
||||
// 计算百分比
|
||||
double percentage = 0;
|
||||
String percentageStr = "0";
|
||||
if(CollectionUtils.isNotEmpty(pliEos)){
|
||||
List<ProjectLawsInventoryEO> verifyNotStart = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|
||||
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|
||||
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
|
||||
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
|
||||
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> verifyToBeSubmitted = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> verifyToBeReviewed = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> verifyCompliance = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> verifyNonCompliance = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> verifyToBeTracked = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> verifyNotInvolved = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<ProjectLawsInventoryEO> taskTermination = pliEos.stream().filter(pliEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
notStartCount = verifyNotStart.size();
|
||||
toBeSubmittedCount = verifyToBeSubmitted.size();
|
||||
toBeReviewedCount = verifyToBeReviewed.size();
|
||||
complianceCount = verifyCompliance.size();
|
||||
nonComplianceCount = verifyNonCompliance.size();
|
||||
toBeTrackedCount = verifyToBeTracked.size();
|
||||
notInvolvedCount = verifyNotInvolved.size();
|
||||
taskTerminationCount = taskTermination.size();
|
||||
count = notStartCount + toBeSubmittedCount + toBeReviewedCount + complianceCount + nonComplianceCount + toBeTrackedCount + notInvolvedCount + taskTerminationCount;
|
||||
// 计算百分比
|
||||
percentage = complianceCount / count * 100;
|
||||
percentageStr = percentage != 0 ? df.format(percentage) : "0";
|
||||
}
|
||||
|
||||
projectScheduleExportMap.put("notStart",notStartCount);
|
||||
projectScheduleExportMap.put("toBeSubmitted",toBeSubmittedCount);
|
||||
projectScheduleExportMap.put("toBeReviewed",toBeReviewedCount);
|
||||
projectScheduleExportMap.put("compliance",complianceCount);
|
||||
projectScheduleExportMap.put("nonCompliance",nonComplianceCount);
|
||||
projectScheduleExportMap.put("toBeTracked",toBeTrackedCount);
|
||||
projectScheduleExportMap.put("notInvolved",notInvolvedCount);
|
||||
projectScheduleExportMap.put("taskTermination",taskTerminationCount);
|
||||
projectScheduleExportMap.put("count",count);
|
||||
projectScheduleExportMap.put("percentage",percentageStr + percentSign);
|
||||
result.put("projectScheduleExportMap",projectScheduleExportMap);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1345,7 +1345,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
// return resultTemp;
|
||||
// }
|
||||
|
||||
private String getMarket(Map<String, Object> params, List<DictModel> targetMarketList, ProjectLibraryBase projectLibraryBase) {
|
||||
public String getMarket(Map<String, Object> params, List<DictModel> targetMarketList, ProjectLibraryBase projectLibraryBase) {
|
||||
List<DictModel> dictModelList = new ArrayList<>();
|
||||
for (String s : projectLibraryBase.getTargetMarket().split(",")) {
|
||||
List<DictModel> dictModelListTemp = targetMarketList.stream()
|
||||
|
||||
+630
-4
@@ -1,33 +1,52 @@
|
||||
package com.jero.modules.project.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.utils.IOUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.project.entity.ConditionAssessmentEO;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
||||
import com.jero.common.util.DateUtils;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
|
||||
import com.jero.modules.cert.collect.entity.ParamsManifestEO;
|
||||
import com.jero.modules.cert.collect.enums.CollectManifestStatisticsStateEnum;
|
||||
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
|
||||
import com.jero.modules.cert.collect.service.IParamsManifestEOService;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.*;
|
||||
import com.jero.modules.project.mapper.ProjectUserPermissionMapper;
|
||||
import com.jero.modules.project.service.IConditionAssessmentEOService;
|
||||
import com.jero.modules.project.service.IProjectCertificationInventoryEOService;
|
||||
import com.jero.modules.project.service.IProjectLibraryStatisticsService;
|
||||
import com.jero.modules.project.service.IProjectStatusBoardService;
|
||||
import com.jero.modules.project.vo.TimeNodeVO;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.enums.DicCodeEnum;
|
||||
import com.jero.modules.system.mapper.SysRoleMapper;
|
||||
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 org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
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.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -39,6 +58,8 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService {
|
||||
private static DecimalFormat df = new DecimalFormat("#.00");
|
||||
private static String percentSign = "%";
|
||||
@Autowired
|
||||
private ProjectTaskPlanningServiceImpl projectTaskPlanningService;
|
||||
@Autowired
|
||||
@@ -59,6 +80,14 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
private IProjectUserBrandService projectUserBrandService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IProjectCertificationInventoryEOService projectCertificationInventoryEOService;
|
||||
@Autowired
|
||||
private IParamsManifestEOService paramsManifestEOService;
|
||||
@Autowired
|
||||
private IParamsCollectManifestEOService paramsCollectManifestEOService;
|
||||
@Autowired
|
||||
private IProjectLibraryStatisticsService projectLibraryStatisticsService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -508,4 +537,601 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void exportXls(HttpServletResponse response, HttpServletRequest request,ProjectLibraryBase projectLibraryBase) {
|
||||
String fileName = "";
|
||||
String cut = projectLibraryBase.getCut();
|
||||
OutputStream ops = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
List<ProjectLibraryBase> plbEoList = this.projectLibraryBaseService.getList(projectLibraryBase);
|
||||
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsByDictCode("region");
|
||||
for (ProjectLibraryBase libraryBase : plbEoList) {
|
||||
targetMarket(projectLibraryBase, dictItemList, libraryBase);
|
||||
}
|
||||
List<ProjectLawsInventoryEO> pliEoList = this.projectLawsInventoryEOService.list();
|
||||
List<ProjectCertificationInventoryEO> pciEoList = this.projectCertificationInventoryEOService.list();
|
||||
List<ProjectTaskPlanning> ptpEoList = this.projectTaskPlanningService.list();
|
||||
List<ParamsManifestEO> pmEoList = this.paramsManifestEOService.list();
|
||||
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);
|
||||
try {
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + fileName);
|
||||
response.setContentType("application/force-download");
|
||||
ops = response.getOutputStream();
|
||||
workbook.write(ops);
|
||||
ops.flush();
|
||||
}catch (IOException ex){
|
||||
ex.printStackTrace();
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
throw new JeroBootException("下载文件失败");
|
||||
}else{
|
||||
throw new JeroBootException("Failed to download file");
|
||||
}
|
||||
}finally {
|
||||
IOUtils.closeQuietly(ops);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出跨项目进度
|
||||
* @param workbook
|
||||
* @param projectLibraryBase
|
||||
* @param plbEoList
|
||||
* @param pliEoList
|
||||
* @param pciEoList
|
||||
* @param pmEoList
|
||||
* @param pcmEoList
|
||||
* @param ptpEoList
|
||||
*/
|
||||
private void exportCrossProjectProgress(HSSFWorkbook workbook,
|
||||
ProjectLibraryBase projectLibraryBase,
|
||||
List<ProjectLibraryBase> plbEoList,
|
||||
List<ProjectLawsInventoryEO> pliEoList,
|
||||
List<ProjectCertificationInventoryEO> pciEoList,
|
||||
List<ParamsManifestEO> pmEoList,
|
||||
List<ParamsCollectManifestEO> pcmEoList,
|
||||
List<ProjectTaskPlanning> ptpEoList) {
|
||||
String cut = projectLibraryBase.getCut();
|
||||
String sheetName = "项目进度";
|
||||
String firstTitle = "项目," +
|
||||
"法规任务确认," +
|
||||
"设计符合性确认," +
|
||||
"验证符合性确认," +
|
||||
"认证任务确认," +
|
||||
"Pre-Homo确认," +
|
||||
"认证进度," +
|
||||
"参数收集";
|
||||
String secondTitle = "待发布,待校核,待确认,接受,拒绝,完成度,责任确认日期," +
|
||||
"未发起,待提交,待审查,符合,不符合,待追踪,不涉及,任务终止,完成度,设计核查日期," +
|
||||
"未发起,待提交,待审查,符合,不符合,待追踪,不涉及,任务终止,完成度,验证核查日期," +
|
||||
"待发布,待校核,待确认,接受,拒绝,完成度,责任确认日期," +
|
||||
"未发起,待提交,待审查,审查通过,审查退回,完成度,认证开始日期," +
|
||||
"待开始,进行中,实验通过,实验失败,部件报告未提交,部件报告已提交,部件报告已入库,完成度,认证提交时间," +
|
||||
"未开始,收集中,已提交,已同步至上报库,完成度,认证提交时间";
|
||||
if(com.jero.modules.system.util.StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
sheetName = "Project Progress";
|
||||
firstTitle = "Project," +
|
||||
"Confirmation of regulatory tasks," +
|
||||
"Confirmation of design compliance," +
|
||||
"Verification of compliance confirmation," +
|
||||
"Certification task confirmation," +
|
||||
"Pre Homo confirmation," +
|
||||
"Certification progress," +
|
||||
"Parameter collection";
|
||||
secondTitle = "To be released,To be verified,To be confirmed,Accept,Refuse,Completion degree,Responsibility confirmation date," +
|
||||
"Not initiated,To be submitted,Pending review,Conform to,Non Conformance,To be tracked,Not involved,Task Termination,Completion degree,Design verification date," +
|
||||
"Not initiated,To be submitted,Pending review,Conform to,Non Conformance,To be tracked,Not involved,Task Termination,Completion degree,Verification verification date," +
|
||||
"To be released,To be verified,To be confirmed,Accept,Refuse,Completion degree,Responsibility confirmation date," +
|
||||
"Not initiated,To be submitted,Pending review,Review passed,Review return,Completion degree,Certification start date," +
|
||||
"To begin,In progress,Experiment passed,Experimental failure,Component report not submitted,Component report submitted,Component report has been stored,Completion degree,Certification submission time," +
|
||||
"Not started,Collecting,Submitted,Synchronized to the upper report library,Completion degree,Certification submission time";
|
||||
}
|
||||
HSSFSheet sheet = workbook.createSheet(sheetName);
|
||||
|
||||
CellRangeAddress region1 = new CellRangeAddress(0, 1, 0, 0);
|
||||
sheet.addMergedRegion(region1);
|
||||
CellRangeAddress region6 = new CellRangeAddress(0, 0, 1, 7);
|
||||
sheet.addMergedRegion(region6);
|
||||
CellRangeAddress region7 = new CellRangeAddress(0, 0, 8, 17);
|
||||
sheet.addMergedRegion(region7);
|
||||
CellRangeAddress region8 = new CellRangeAddress(0, 0, 18, 27);
|
||||
sheet.addMergedRegion(region8);
|
||||
CellRangeAddress region9 = new CellRangeAddress(0, 0, 28, 34);
|
||||
sheet.addMergedRegion(region9);
|
||||
CellRangeAddress region10 = new CellRangeAddress(0, 0, 35, 41);
|
||||
sheet.addMergedRegion(region10);
|
||||
CellRangeAddress region11 = new CellRangeAddress(0, 0, 42, 50);
|
||||
sheet.addMergedRegion(region11);
|
||||
CellRangeAddress region12 = new CellRangeAddress(0, 0, 51, 56);
|
||||
sheet.addMergedRegion(region12);
|
||||
|
||||
String[] firstTitleArr = firstTitle.split(",");
|
||||
String[] secondTitleArr = secondTitle.split(",");
|
||||
Row firstRow = sheet.createRow(0);
|
||||
Row secondRow = sheet.createRow(1);
|
||||
|
||||
CellStyle cellStyleTitle = workbook.createCellStyle();
|
||||
cellStyleTitle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
|
||||
cellStyleTitle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
|
||||
for (int i = 0; i <= 56; i++){
|
||||
sheet.setColumnWidth(i, 4000);
|
||||
Cell firstRowCell = firstRow.createCell(i);
|
||||
firstRowCell.setCellStyle(cellStyleTitle);
|
||||
if(i == 0){
|
||||
firstRowCell.setCellValue(firstTitleArr[0]);
|
||||
}else if(i == 1){
|
||||
firstRowCell.setCellValue(firstTitleArr[1]);
|
||||
}else if(i == 8){
|
||||
firstRowCell.setCellValue(firstTitleArr[2]);
|
||||
}else if(i == 18){
|
||||
firstRowCell.setCellValue(firstTitleArr[3]);
|
||||
}else if(i == 28){
|
||||
firstRowCell.setCellValue(firstTitleArr[4]);
|
||||
}else if(i == 35){
|
||||
firstRowCell.setCellValue(firstTitleArr[5]);
|
||||
}else if(i == 42){
|
||||
firstRowCell.setCellValue(firstTitleArr[6]);
|
||||
}else if(i == 51){
|
||||
firstRowCell.setCellValue(firstTitleArr[7]);
|
||||
}
|
||||
if(i >= 1){
|
||||
Cell secondRowCell = secondRow.createCell(i);
|
||||
secondRowCell.setCellValue(secondTitleArr[i-1]);
|
||||
}
|
||||
}
|
||||
|
||||
this.exportCrossProjectProgressSetData(plbEoList, sheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出跨项目进度-设置数据
|
||||
* @param plbEoList
|
||||
* @param sheet
|
||||
* @param pliEoList
|
||||
* @param pciEoList
|
||||
* @param pmEoList
|
||||
* @param pcmEoList
|
||||
* @param projectLibraryBase
|
||||
* @param ptpEoList
|
||||
*/
|
||||
private void exportCrossProjectProgressSetData(List<ProjectLibraryBase> plbEoList,
|
||||
HSSFSheet sheet,
|
||||
List<ProjectLawsInventoryEO> pliEoList,
|
||||
List<ProjectCertificationInventoryEO> pciEoList,
|
||||
List<ParamsManifestEO> pmEoList,
|
||||
List<ParamsCollectManifestEO> pcmEoList,
|
||||
ProjectLibraryBase projectLibraryBase,
|
||||
List<ProjectTaskPlanning> ptpEoList) {
|
||||
int dataIndex = 2;
|
||||
for (ProjectLibraryBase plbEo : plbEoList) {
|
||||
Row dataRow = sheet.createRow(dataIndex);
|
||||
dataRow.createCell(0).setCellValue(plbEo.getShowName());
|
||||
|
||||
List<ProjectTaskPlanning> ptpEoListTemp = ptpEoList.stream().filter(ptpEo -> StringUtils.equals(ptpEo.getProjectId(), plbEo.getId())).collect(Collectors.toList());
|
||||
String legalTaskConfirmationStr = "";
|
||||
String designDeadlineStr = "";
|
||||
String verifyDeadlineStr = "";
|
||||
String attestationStartTimeStr = "";
|
||||
String certificationSubmissionStr = "";
|
||||
if(CollectionUtils.isNotEmpty(ptpEoListTemp)){
|
||||
Date legalTaskConfirmation = ptpEoListTemp.get(0).getLegalTaskConfirmation();
|
||||
if (ObjectUtils.isNotEmpty(legalTaskConfirmation)) {
|
||||
legalTaskConfirmationStr = DateUtils.formatDate(legalTaskConfirmation);
|
||||
}
|
||||
Date designDeadline = ptpEoListTemp.get(0).getDesignDeadline();
|
||||
if (ObjectUtils.isNotEmpty(designDeadline)) {
|
||||
designDeadlineStr = DateUtils.formatDate(designDeadline);
|
||||
}
|
||||
Date verifyDeadline = ptpEoListTemp.get(0).getVerifyDeadline();
|
||||
if (ObjectUtils.isNotEmpty(verifyDeadline)) {
|
||||
verifyDeadlineStr = DateUtils.formatDate(verifyDeadline);
|
||||
}
|
||||
Date attestationStartTime = ptpEoListTemp.get(0).getAttestationStartTime();
|
||||
if (ObjectUtils.isNotEmpty(attestationStartTime)) {
|
||||
attestationStartTimeStr = DateUtils.formatDate(attestationStartTime);
|
||||
}
|
||||
Date certificationSubmission = ptpEoListTemp.get(0).getCertificationSubmission();
|
||||
if (ObjectUtils.isNotEmpty(certificationSubmission)) {
|
||||
certificationSubmissionStr = DateUtils.formatDate(certificationSubmission);
|
||||
}
|
||||
}
|
||||
List<ProjectLawsInventoryEO> pliEos = pliEoList.stream().filter(pliEo -> StringUtils.equals(pliEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList());
|
||||
Map<String,Object> fgRwqrMap = this.projectLawsInventoryEOService.groupByFGRwqrStatus(pliEos);
|
||||
Map<String,Object> fgRwqrProjectScheduleExportMap = (Map<String, Object>) fgRwqrMap.get("projectScheduleExportMap");
|
||||
double fgrqqrToBeReleased = (double) fgRwqrProjectScheduleExportMap.get("toBeReleased");
|
||||
double fgrqqrToBeVerified = (double) fgRwqrProjectScheduleExportMap.get("toBeVerified");
|
||||
double fgrqqrToBeConfirmed = (double) fgRwqrProjectScheduleExportMap.get("toBeConfirmed");
|
||||
double fgrqqrAccept = (double) fgRwqrProjectScheduleExportMap.get("accept");
|
||||
double fgrqqrRefuse = (double) fgRwqrProjectScheduleExportMap.get("refuse");
|
||||
String fgrqqrPercentage = (String) fgRwqrProjectScheduleExportMap.get("percentage");
|
||||
dataRow.createCell(1).setCellValue(fgrqqrToBeReleased);
|
||||
dataRow.createCell(2).setCellValue(fgrqqrToBeVerified);
|
||||
dataRow.createCell(3).setCellValue(fgrqqrToBeConfirmed);
|
||||
dataRow.createCell(4).setCellValue(fgrqqrAccept);
|
||||
dataRow.createCell(5).setCellValue(fgrqqrRefuse);
|
||||
dataRow.createCell(6).setCellValue(fgrqqrPercentage);
|
||||
dataRow.createCell(7).setCellValue(legalTaskConfirmationStr);
|
||||
|
||||
Map<String,Object> designMap = this.projectLawsInventoryEOService.groupByDesignStatus(pliEos);
|
||||
Map<String,Object> designMapProjectScheduleExportMap = (Map<String, Object>) designMap.get("projectScheduleExportMap");
|
||||
double designNotStart = (double) designMapProjectScheduleExportMap.get("notStart");
|
||||
double designToBeSubmitted = (double) designMapProjectScheduleExportMap.get("toBeSubmitted");
|
||||
double designToBeReviewed = (double) designMapProjectScheduleExportMap.get("toBeReviewed");
|
||||
double designCompliance = (double) designMapProjectScheduleExportMap.get("compliance");
|
||||
double designNonCompliance = (double) designMapProjectScheduleExportMap.get("nonCompliance");
|
||||
double designToBeTracked = (double) designMapProjectScheduleExportMap.get("toBeTracked");
|
||||
double designNotInvolved = (double) designMapProjectScheduleExportMap.get("notInvolved");
|
||||
double designTaskTermination = (double) designMapProjectScheduleExportMap.get("taskTermination");
|
||||
// double designCount = (double) designMapProjectScheduleExportMap.get("count");
|
||||
String designPercentage = (String) designMapProjectScheduleExportMap.get("percentage");
|
||||
dataRow.createCell(8).setCellValue(designNotStart);
|
||||
dataRow.createCell(9).setCellValue(designToBeSubmitted);
|
||||
dataRow.createCell(10).setCellValue(designToBeReviewed);
|
||||
dataRow.createCell(11).setCellValue(designCompliance);
|
||||
dataRow.createCell(12).setCellValue(designNonCompliance);
|
||||
dataRow.createCell(13).setCellValue(designToBeTracked);
|
||||
dataRow.createCell(14).setCellValue(designNotInvolved);
|
||||
dataRow.createCell(15).setCellValue(designTaskTermination);
|
||||
dataRow.createCell(16).setCellValue(designPercentage);
|
||||
dataRow.createCell(17).setCellValue(designDeadlineStr);
|
||||
|
||||
Map<String,Object> verifyMap = this.projectLawsInventoryEOService.groupByVerifyStatus(pliEos);
|
||||
Map<String,Object> verifyMapProjectScheduleExportMap = (Map<String, Object>) verifyMap.get("projectScheduleExportMap");
|
||||
double verifyNotStart = (double) verifyMapProjectScheduleExportMap.get("notStart");
|
||||
double verifyToBeSubmitted = (double) verifyMapProjectScheduleExportMap.get("toBeSubmitted");
|
||||
double verifyToBeReviewed = (double) verifyMapProjectScheduleExportMap.get("toBeReviewed");
|
||||
double verifyCompliance = (double) verifyMapProjectScheduleExportMap.get("compliance");
|
||||
double verifyNonCompliance = (double) verifyMapProjectScheduleExportMap.get("nonCompliance");
|
||||
double verifyToBeTracked = (double) verifyMapProjectScheduleExportMap.get("toBeTracked");
|
||||
double verifyNotInvolved = (double) verifyMapProjectScheduleExportMap.get("notInvolved");
|
||||
double verifyTaskTermination = (double) verifyMapProjectScheduleExportMap.get("taskTermination");
|
||||
double verifyCount = (double) verifyMapProjectScheduleExportMap.get("count");
|
||||
String verifyPercentage = (String) verifyMapProjectScheduleExportMap.get("percentage");
|
||||
dataRow.createCell(18).setCellValue(verifyNotStart);
|
||||
dataRow.createCell(19).setCellValue(verifyToBeSubmitted);
|
||||
dataRow.createCell(20).setCellValue(verifyToBeReviewed);
|
||||
dataRow.createCell(21).setCellValue(verifyCompliance);
|
||||
dataRow.createCell(22).setCellValue(verifyNonCompliance);
|
||||
dataRow.createCell(23).setCellValue(verifyToBeTracked);
|
||||
dataRow.createCell(24).setCellValue(verifyNotInvolved);
|
||||
dataRow.createCell(25).setCellValue(verifyTaskTermination);
|
||||
dataRow.createCell(26).setCellValue(verifyPercentage);
|
||||
dataRow.createCell(27).setCellValue(verifyDeadlineStr);
|
||||
|
||||
List<ProjectCertificationInventoryEO> pciEos = pciEoList.stream().filter(pciEo -> StringUtils.equals(pciEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList());
|
||||
Map<String,Object> rzRwqrMap = this.projectCertificationInventoryEOService.groupByFGRwqrStatus(pciEos);
|
||||
Map<String,Object> rzRwqrProjectScheduleExportMap = (Map<String, Object>) rzRwqrMap.get("projectScheduleExportMap");
|
||||
double rzRqqrToBeReleased = (double) rzRwqrProjectScheduleExportMap.get("toBeReleased");
|
||||
double rzRqqrToBeVerified = (double) rzRwqrProjectScheduleExportMap.get("toBeVerified");
|
||||
double rzRqqrToBeConfirmed = (double) rzRwqrProjectScheduleExportMap.get("toBeConfirmed");
|
||||
double rzRqqrAccept = (double) rzRwqrProjectScheduleExportMap.get("accept");
|
||||
double rzRqqrRefuse = (double) rzRwqrProjectScheduleExportMap.get("refuse");
|
||||
String rzRqqrPercentage = (String) rzRwqrProjectScheduleExportMap.get("percentage");
|
||||
dataRow.createCell(28).setCellValue(rzRqqrToBeReleased);
|
||||
dataRow.createCell(29).setCellValue(rzRqqrToBeVerified);
|
||||
dataRow.createCell(30).setCellValue(rzRqqrToBeConfirmed);
|
||||
dataRow.createCell(31).setCellValue(rzRqqrAccept);
|
||||
dataRow.createCell(32).setCellValue(rzRqqrRefuse);
|
||||
dataRow.createCell(33).setCellValue(rzRqqrPercentage);
|
||||
dataRow.createCell(34).setCellValue(legalTaskConfirmationStr);
|
||||
|
||||
Map<String,Object> preHomoMap = this.projectCertificationInventoryEOService.groupByPreHomoStatus(pciEos);
|
||||
Map<String,Object> preHomoProjectScheduleExportMap = (Map<String, Object>) preHomoMap.get("projectScheduleExportMap");
|
||||
double preHomoNotStartCount = (double) preHomoProjectScheduleExportMap.get("notStartCount");
|
||||
double preHomoToBeSubmittedCount = (double) preHomoProjectScheduleExportMap.get("toBeSubmittedCount");
|
||||
double preHomoToBeReviewedCount = (double) preHomoProjectScheduleExportMap.get("toBeReviewedCount");
|
||||
double preHomoAccept = (double) preHomoProjectScheduleExportMap.get("accept");
|
||||
double preHomoRefuse = (double) preHomoProjectScheduleExportMap.get("refuse");
|
||||
String preHomoPercentage = (String) preHomoProjectScheduleExportMap.get("percentage");
|
||||
dataRow.createCell(35).setCellValue(preHomoNotStartCount);
|
||||
dataRow.createCell(36).setCellValue(preHomoToBeSubmittedCount);
|
||||
dataRow.createCell(37).setCellValue(preHomoToBeReviewedCount);
|
||||
dataRow.createCell(38).setCellValue(preHomoAccept);
|
||||
dataRow.createCell(39).setCellValue(preHomoRefuse);
|
||||
dataRow.createCell(40).setCellValue(preHomoPercentage);
|
||||
dataRow.createCell(41).setCellValue(attestationStartTimeStr);
|
||||
|
||||
Map<String,Object> certificationProgressMap = this.projectCertificationInventoryEOService.groupByCertificationProgress(pciEos);
|
||||
Map<String,Object> certificationProgressMapProjectScheduleExportMap = (Map<String, Object>) certificationProgressMap.get("projectScheduleExportMap");
|
||||
double certificationProgressNotStartCount = (double) certificationProgressMapProjectScheduleExportMap.get("notStartCount");
|
||||
double certificationProgressInProgressCount = (double) certificationProgressMapProjectScheduleExportMap.get("inProgressCount");
|
||||
double certificationProgressTestPassedCount = (double) certificationProgressMapProjectScheduleExportMap.get("testPassedCount");
|
||||
double certificationProgressTestFailedCount = (double) certificationProgressMapProjectScheduleExportMap.get("testFailedCount");
|
||||
double certificationProgressNotSubmitCount = (double) certificationProgressMapProjectScheduleExportMap.get("notSubmitCount");
|
||||
double certificationProgressReportSubmitCount = (double) certificationProgressMapProjectScheduleExportMap.get("reportSubmitCount");
|
||||
double certificationProgressStoredCount = (double) certificationProgressMapProjectScheduleExportMap.get("storedCount");
|
||||
// String certificationProgressCount = (String) certificationProgressMapProjectScheduleExportMap.get("count");
|
||||
String certificationProgressPercentage = (String) certificationProgressMapProjectScheduleExportMap.get("percentage");
|
||||
dataRow.createCell(42).setCellValue(certificationProgressNotStartCount);
|
||||
dataRow.createCell(43).setCellValue(certificationProgressInProgressCount);
|
||||
dataRow.createCell(44).setCellValue(certificationProgressTestPassedCount);
|
||||
dataRow.createCell(45).setCellValue(certificationProgressTestFailedCount);
|
||||
dataRow.createCell(46).setCellValue(certificationProgressNotSubmitCount);
|
||||
dataRow.createCell(47).setCellValue(certificationProgressReportSubmitCount);
|
||||
dataRow.createCell(48).setCellValue(certificationProgressStoredCount);
|
||||
dataRow.createCell(49).setCellValue(certificationProgressPercentage);
|
||||
dataRow.createCell(50).setCellValue(certificationSubmissionStr);
|
||||
|
||||
|
||||
List<ParamsManifestEO> pmEos = pmEoList.stream().filter(pmEo -> {
|
||||
return StringUtils.equals(pmEo.getProjectId(), plbEo.getId());
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
double notStartAmount = 0;
|
||||
double collectingAmount = 0;
|
||||
double submitAmount = 0;
|
||||
double syncReporAmount = 0;
|
||||
String parameterCollectingPercentageStr = "0";
|
||||
if(CollectionUtils.isNotEmpty(pmEos)){
|
||||
List<String> pmEoIdList = pmEos.stream().map(ParamsManifestEO::getId).distinct().collect(Collectors.toList());
|
||||
|
||||
List<ParamsCollectManifestEO> pcmEos = pcmEoList.stream().filter(pcmEo -> {
|
||||
boolean flag = false;
|
||||
for (String pmEoId : pmEoIdList) {
|
||||
if (StringUtils.equals(pmEoId, pcmEo.getParamsManifestId())) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
Map<String, Object> parameterCollectingMap = this.projectLibraryStatisticsService.getParameterCollectingStatisticsGroupByTerritory(pcmEos,null);
|
||||
Map<String, Object> notStartMap = (Map<String, Object>) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.NOT_START.getValue());
|
||||
notStartAmount = (double) notStartMap.get("amount");
|
||||
Map<String, Object> collectingMap = (Map<String, Object>) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.COLLECTING.getValue());
|
||||
collectingAmount = (double) collectingMap.get("amount");
|
||||
Map<String, Object> submitMap = (Map<String, Object>) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SUBMIT.getValue());
|
||||
submitAmount = (double) submitMap.get("amount");
|
||||
Map<String, Object> syncReporMap = (Map<String, Object>) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SYNC_REPORT.getValue());
|
||||
syncReporAmount = (double) syncReporMap.get("amount");
|
||||
|
||||
double parameterCollectingCount = notStartAmount + collectingAmount + submitAmount + syncReporAmount;
|
||||
double parameterCollectingPercentage = (syncReporAmount / parameterCollectingCount) * 100;
|
||||
parameterCollectingPercentageStr = (parameterCollectingPercentage != 0 && (syncReporAmount !=0 )) ? df.format(parameterCollectingPercentage) : "0";
|
||||
}
|
||||
dataRow.createCell(51).setCellValue(notStartAmount);
|
||||
dataRow.createCell(52).setCellValue(collectingAmount);
|
||||
dataRow.createCell(53).setCellValue(submitAmount);
|
||||
dataRow.createCell(54).setCellValue(syncReporAmount);
|
||||
dataRow.createCell(55).setCellValue(parameterCollectingPercentageStr + percentSign);
|
||||
dataRow.createCell(56).setCellValue(certificationSubmissionStr);
|
||||
dataIndex ++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出跨项目进度概览
|
||||
* @param workbook
|
||||
* @param projectLibraryBase
|
||||
* @param plbEoList
|
||||
* @param pliEoList
|
||||
* @param pciEoList
|
||||
* @param pmEoList
|
||||
* @param pcmEoList
|
||||
* @param ptpEoList
|
||||
*/
|
||||
private void exportOverviewCrossProjectProgress(HSSFWorkbook workbook,
|
||||
ProjectLibraryBase projectLibraryBase,
|
||||
List<ProjectLibraryBase> plbEoList,
|
||||
List<ProjectLawsInventoryEO> pliEoList,
|
||||
List<ProjectCertificationInventoryEO> pciEoList,
|
||||
List<ParamsManifestEO> pmEoList,
|
||||
List<ParamsCollectManifestEO> pcmEoList,
|
||||
List<ProjectTaskPlanning> ptpEoList) {
|
||||
String cut = projectLibraryBase.getCut();
|
||||
String sheetName = "项目进度概览";
|
||||
String firstTitle = "项目,R&H Studio,法规符合性管理,认证活动管理";
|
||||
String secondTitle = ",,法规任务确认,设计符合性,验证符合性,认证任务确认,Pre-Homo确认,认证参数收集,认证进度";
|
||||
if(com.jero.modules.system.util.StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
sheetName = "Overview of project progress";
|
||||
firstTitle = "Project,R&H Studio,Regulatory compliance management,Certification Activity Management";
|
||||
secondTitle = ",,Confirmation of regulatory tasks," +
|
||||
"Design compliance," +
|
||||
"Verify compliance," +
|
||||
"Certification task confirmation," +
|
||||
"Pre Homo confirmation," +
|
||||
"Authentication parameter collection," +
|
||||
"Certification progress";
|
||||
}
|
||||
HSSFSheet sheet = workbook.createSheet(sheetName);
|
||||
CellRangeAddress region1 = new CellRangeAddress(0, 1, 0, 0);
|
||||
sheet.addMergedRegion(region1);
|
||||
CellRangeAddress region2 = new CellRangeAddress(0, 1, 1, 1);
|
||||
sheet.addMergedRegion(region2);
|
||||
CellRangeAddress region3 = new CellRangeAddress(0, 0, 2, 4);
|
||||
sheet.addMergedRegion(region3);
|
||||
CellRangeAddress region4 = new CellRangeAddress(0, 0, 5, 8);
|
||||
sheet.addMergedRegion(region4);
|
||||
|
||||
String[] firstTitleArr = firstTitle.split(",");
|
||||
String[] secondTitleArr = secondTitle.split(",");
|
||||
Row firstRow = sheet.createRow(0);
|
||||
Row secondRow = sheet.createRow(1);
|
||||
|
||||
CellStyle cellStyleTitle = workbook.createCellStyle();
|
||||
cellStyleTitle.setAlignment(HorizontalAlignment.CENTER);
|
||||
cellStyleTitle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
for (int i = 0; i <= 8; i++){
|
||||
sheet.setColumnWidth(i, 4000);
|
||||
Cell firstRowCell = firstRow.createCell(i);
|
||||
firstRowCell.setCellStyle(cellStyleTitle);
|
||||
if(i == 0){
|
||||
firstRowCell.setCellValue(firstTitleArr[0]);
|
||||
}else if(i == 1){
|
||||
firstRowCell.setCellValue(firstTitleArr[1]);
|
||||
}else if(i == 2){
|
||||
firstRowCell.setCellValue(firstTitleArr[2]);
|
||||
}else if(i == 5){
|
||||
firstRowCell.setCellValue(firstTitleArr[3]);
|
||||
}
|
||||
|
||||
if(i >= 2){
|
||||
Cell secondRowCell = secondRow.createCell(i);
|
||||
secondRowCell.setCellStyle(cellStyleTitle);
|
||||
secondRowCell.setCellValue(secondTitleArr[i]);
|
||||
}
|
||||
}
|
||||
this.exportOverviewCrossProjectProgressSetData(plbEoList, sheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList,cellStyleTitle);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出跨项目进度概览-设置数据
|
||||
* @param plbEoList
|
||||
* @param sheet
|
||||
* @param pliEoList
|
||||
* @param pciEoList
|
||||
* @param pmEoList
|
||||
* @param pcmEoList
|
||||
* @param projectLibraryBase
|
||||
* @param ptpEoList
|
||||
* @param cellStyleTitle
|
||||
*/
|
||||
private void exportOverviewCrossProjectProgressSetData(List<ProjectLibraryBase> plbEoList,
|
||||
HSSFSheet sheet,
|
||||
List<ProjectLawsInventoryEO> pliEoList,
|
||||
List<ProjectCertificationInventoryEO> pciEoList,
|
||||
List<ParamsManifestEO> pmEoList,
|
||||
List<ParamsCollectManifestEO> pcmEoList,
|
||||
ProjectLibraryBase projectLibraryBase,
|
||||
List<ProjectTaskPlanning> ptpEoList,
|
||||
CellStyle cellStyleTitle) {
|
||||
int dataIndex = 2;
|
||||
for (ProjectLibraryBase plbEo : plbEoList) {
|
||||
List<ProjectTaskPlanning> ptpEoListTemp = ptpEoList.stream().filter(ptpEo -> StringUtils.equals(ptpEo.getProjectId(), plbEo.getId())).collect(Collectors.toList());
|
||||
String legalTaskConfirmationStr = "";
|
||||
String designDeadlineStr = "";
|
||||
String verifyDeadlineStr = "";
|
||||
String attestationStartTimeStr = "";
|
||||
String certificationSubmissionStr = "";
|
||||
if(CollectionUtils.isNotEmpty(ptpEoListTemp)){
|
||||
Date legalTaskConfirmation = ptpEoListTemp.get(0).getLegalTaskConfirmation();
|
||||
if (ObjectUtils.isNotEmpty(legalTaskConfirmation)) {
|
||||
legalTaskConfirmationStr = DateUtils.formatDate(legalTaskConfirmation);
|
||||
}
|
||||
Date designDeadline = ptpEoListTemp.get(0).getDesignDeadline();
|
||||
if (ObjectUtils.isNotEmpty(designDeadline)) {
|
||||
designDeadlineStr = DateUtils.formatDate(designDeadline);
|
||||
}
|
||||
Date verifyDeadline = ptpEoListTemp.get(0).getVerifyDeadline();
|
||||
if (ObjectUtils.isNotEmpty(verifyDeadline)) {
|
||||
verifyDeadlineStr = DateUtils.formatDate(verifyDeadline);
|
||||
}
|
||||
Date attestationStartTime = ptpEoListTemp.get(0).getAttestationStartTime();
|
||||
if (ObjectUtils.isNotEmpty(attestationStartTime)) {
|
||||
attestationStartTimeStr = DateUtils.formatDate(attestationStartTime);
|
||||
}
|
||||
Date certificationSubmission = ptpEoListTemp.get(0).getCertificationSubmission();
|
||||
if (ObjectUtils.isNotEmpty(certificationSubmission)) {
|
||||
certificationSubmissionStr = DateUtils.formatDate(certificationSubmission);
|
||||
}
|
||||
}
|
||||
|
||||
List<ProjectLawsInventoryEO> pliEos = pliEoList.stream().filter(pliEo -> StringUtils.equals(pliEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList());
|
||||
Map<String,Object> fgRwqrMap = this.projectLawsInventoryEOService.groupByFGRwqrStatus(pliEos);
|
||||
Map<String,Object> fgRwqrProjectScheduleExportMap = (Map<String, Object>) fgRwqrMap.get("projectScheduleExportMap");
|
||||
String fgrqqrPercentage = (String) fgRwqrProjectScheduleExportMap.get("percentage");
|
||||
|
||||
Map<String,Object> designMap = this.projectLawsInventoryEOService.groupByDesignStatus(pliEos);
|
||||
Map<String,Object> designMapProjectScheduleExportMap = (Map<String, Object>) designMap.get("projectScheduleExportMap");
|
||||
String designPercentage = (String) designMapProjectScheduleExportMap.get("percentage");
|
||||
|
||||
Map<String,Object> verifyMap = this.projectLawsInventoryEOService.groupByVerifyStatus(pliEos);
|
||||
Map<String,Object> verifyMapProjectScheduleExportMap = (Map<String, Object>) verifyMap.get("projectScheduleExportMap");
|
||||
String verifyPercentage = (String) verifyMapProjectScheduleExportMap.get("percentage");
|
||||
|
||||
List<ProjectCertificationInventoryEO> pciEos = pciEoList.stream().filter(pciEo -> StringUtils.equals(pciEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList());
|
||||
Map<String,Object> rzRwqrMap = this.projectCertificationInventoryEOService.groupByFGRwqrStatus(pciEos);
|
||||
Map<String,Object> rzRwqrProjectScheduleExportMap = (Map<String, Object>) rzRwqrMap.get("projectScheduleExportMap");
|
||||
String rzRqqrPercentage = (String) rzRwqrProjectScheduleExportMap.get("percentage");
|
||||
|
||||
Map<String,Object> preHomoMap = this.projectCertificationInventoryEOService.groupByPreHomoStatus(pciEos);
|
||||
Map<String,Object> preHomoProjectScheduleExportMap = (Map<String, Object>) preHomoMap.get("projectScheduleExportMap");
|
||||
String preHomoPercentage = (String) preHomoProjectScheduleExportMap.get("percentage");
|
||||
|
||||
List<ParamsManifestEO> pmEos = pmEoList.stream().filter(pmEo -> {
|
||||
return StringUtils.equals(pmEo.getProjectId(), plbEo.getId());
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
String parameterCollectingPercentageStr = "0" + percentSign;
|
||||
if(CollectionUtils.isNotEmpty(pmEos)){
|
||||
List<String> pmEoIdList = pmEos.stream().map(ParamsManifestEO::getId).distinct().collect(Collectors.toList());
|
||||
|
||||
List<ParamsCollectManifestEO> pcmEos = pcmEoList.stream().filter(pcmEo -> {
|
||||
boolean flag = false;
|
||||
for (String pmEoId : pmEoIdList) {
|
||||
if (StringUtils.equals(pmEoId, pcmEo.getParamsManifestId())) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
Map<String, Object> parameterCollectingMap = this.projectLibraryStatisticsService.getParameterCollectingStatisticsGroupByTerritory(pcmEos,null);
|
||||
Map<String, Object> notStartMap = (Map<String, Object>) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.NOT_START.getValue());
|
||||
double notStartAmount = (double) notStartMap.get("amount");
|
||||
Map<String, Object> collectingMap = (Map<String, Object>) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.COLLECTING.getValue());
|
||||
double collectingAmount = (double) collectingMap.get("amount");
|
||||
Map<String, Object> submitMap = (Map<String, Object>) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SUBMIT.getValue());
|
||||
double submitAmount = (double) submitMap.get("amount");
|
||||
Map<String, Object> syncReporMap = (Map<String, Object>) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SYNC_REPORT.getValue());
|
||||
double syncReporAmount = (double) syncReporMap.get("amount");
|
||||
|
||||
double parameterCollectingCount = notStartAmount + collectingAmount + submitAmount + syncReporAmount;
|
||||
double parameterCollectingPercentage = (syncReporAmount / parameterCollectingCount) * 100;
|
||||
parameterCollectingPercentageStr = (parameterCollectingPercentage != 0 && (syncReporAmount !=0 )) ? df.format(parameterCollectingPercentage) + percentSign : "0" + percentSign;
|
||||
}
|
||||
|
||||
Map<String,Object> certificationProgressMap = this.projectCertificationInventoryEOService.groupByCertificationProgress(pciEos);
|
||||
Map<String,Object> certificationProgressMapProjectScheduleExportMap = (Map<String, Object>) certificationProgressMap.get("projectScheduleExportMap");
|
||||
String certificationProgressPercentage = (String) certificationProgressMapProjectScheduleExportMap.get("percentage");
|
||||
|
||||
CellRangeAddress regionCell1 = new CellRangeAddress(dataIndex, dataIndex + 1, 0, 0);
|
||||
sheet.addMergedRegion(regionCell1);
|
||||
CellRangeAddress regionCell2 = new CellRangeAddress(dataIndex, dataIndex + 1, 1, 1);
|
||||
sheet.addMergedRegion(regionCell2);
|
||||
Row dataRow = sheet.createRow(dataIndex);
|
||||
Row dataRow2 = sheet.createRow(dataIndex + 1);
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
sheet.setColumnWidth(i, 4000);
|
||||
Cell dataRowCell = dataRow.createCell(i);
|
||||
dataRowCell.setCellStyle(cellStyleTitle);
|
||||
Cell dataRow2Cell = dataRow2.createCell(i);
|
||||
dataRow2Cell.setCellStyle(cellStyleTitle);
|
||||
if(i == 0){
|
||||
dataRowCell.setCellValue(plbEo.getShowName());
|
||||
}else if(i==1){
|
||||
dataRowCell.setCellValue(plbEo.getStudioEngineerName());
|
||||
}else if(i==2){
|
||||
dataRowCell.setCellValue(legalTaskConfirmationStr);
|
||||
dataRow2Cell.setCellValue(fgrqqrPercentage);
|
||||
}else if(i==3){
|
||||
dataRowCell.setCellValue(designDeadlineStr);
|
||||
dataRow2Cell.setCellValue(designPercentage);
|
||||
}else if(i==4){
|
||||
dataRowCell.setCellValue(verifyDeadlineStr);
|
||||
dataRow2Cell.setCellValue(verifyPercentage);
|
||||
}else if(i==5){
|
||||
dataRowCell.setCellValue(legalTaskConfirmationStr);
|
||||
dataRow2Cell.setCellValue(rzRqqrPercentage);
|
||||
}else if(i==6){
|
||||
dataRowCell.setCellValue(attestationStartTimeStr);
|
||||
dataRow2Cell.setCellValue(preHomoPercentage);
|
||||
}else if(i==7){
|
||||
dataRowCell.setCellValue(attestationStartTimeStr);
|
||||
dataRow2Cell.setCellValue(parameterCollectingPercentageStr);
|
||||
}else if(i==8){
|
||||
dataRowCell.setCellValue(certificationSubmissionStr);
|
||||
dataRow2Cell.setCellValue(certificationProgressPercentage);
|
||||
}
|
||||
}
|
||||
dataIndex += 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user