|
@@ -190,27 +190,50 @@ public class MaterialProgressController extends BladeController {
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
@ApiOperation(value = "声像媒体资料统计")
|
|
|
public R<MaterialProgressVO> queryImageClassification(@RequestParam String contractId){
|
|
|
- List<Integer> fileTypes = this.imageClassificationFileService.queryCurrentContractImageFileType(contractId);
|
|
|
- if(fileTypes != null && fileTypes.size() > 0){
|
|
|
- //判断数量
|
|
|
- AtomicInteger imageAmount = new AtomicInteger();
|
|
|
- AtomicInteger videoAmount = new AtomicInteger();
|
|
|
- fileTypes.forEach(type -> {
|
|
|
- switch (type) {
|
|
|
- case 1:
|
|
|
- videoAmount.getAndIncrement();
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- imageAmount.getAndIncrement();
|
|
|
- break;
|
|
|
+ //设置返回参数
|
|
|
+ MaterialProgressVO reVO = new MaterialProgressVO();
|
|
|
+
|
|
|
+ //获取合同段信息
|
|
|
+ ContractInfo contract = this.contractClient.getContractById(Long.parseLong(contractId));
|
|
|
+ if(contract != null && new Integer("2").equals(contract.getContractType())){
|
|
|
+ //监理合同段
|
|
|
+ List<String> sgContractIds = this.contractClient.getProcessContractByJLContractId(contractId);
|
|
|
+ if(sgContractIds != null && sgContractIds.size() > 0){
|
|
|
+ //汇总
|
|
|
+ List<Integer> countTypeList = new ArrayList<>();
|
|
|
+ for(String sgContractId : sgContractIds){
|
|
|
+ List<Integer> fileTypes = this.imageClassificationFileService.queryCurrentContractImageFileType(sgContractId);
|
|
|
+ if(fileTypes != null && fileTypes.size() > 0){
|
|
|
+ countTypeList.addAll(fileTypes);
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
- //设置返回参数
|
|
|
- MaterialProgressVO reVO = new MaterialProgressVO();
|
|
|
- reVO.setContractImageClassificationList(fileTypes.size(), imageAmount.get(), videoAmount.get());
|
|
|
+ if(countTypeList.size() > 0){
|
|
|
|
|
|
- return R.data(reVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ List<Integer> fileTypes = this.imageClassificationFileService.queryCurrentContractImageFileType(contractId);
|
|
|
+ if(fileTypes != null && fileTypes.size() > 0){
|
|
|
+ //判断数量
|
|
|
+ AtomicInteger imageAmount = new AtomicInteger();
|
|
|
+ AtomicInteger videoAmount = new AtomicInteger();
|
|
|
+ fileTypes.forEach(type -> {
|
|
|
+ switch (type) {
|
|
|
+ case 1:
|
|
|
+ videoAmount.getAndIncrement();
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ imageAmount.getAndIncrement();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ reVO.setContractImageClassificationList(fileTypes.size(), imageAmount.get(), videoAmount.get());
|
|
|
+
|
|
|
+ return R.data(reVO);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
return R.data(300, null, "未找到数据");
|
|
|
}
|
|
|
|
|
@@ -221,66 +244,93 @@ public class MaterialProgressController extends BladeController {
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation(value = "报表资料审批统计")
|
|
|
public R<MaterialProgressVO> queryMaterialProgressStatus(@RequestParam String contractId){
|
|
|
- //找到可填写的
|
|
|
- List<WbsTreeContract> submitNodeList = this.wbsTreeContractClient.queryContractSubmitWbsTreeByContractId(contractId);
|
|
|
- if(submitNodeList != null && submitNodeList.size() > 0){
|
|
|
- //汇总四个填报类型的总数
|
|
|
- List<String> process = new ArrayList<>(), workStartReports = new ArrayList<>(), evaluation = new ArrayList<>(), completion = new ArrayList<>();
|
|
|
- //类型分组
|
|
|
- this.checkType(submitNodeList, process, workStartReports, evaluation, completion);
|
|
|
+ //设置参数返回
|
|
|
+ MaterialProgressVO reVO = new MaterialProgressVO();
|
|
|
|
|
|
- //工序资料
|
|
|
- List<InformationQuery> processSubmitList = null;
|
|
|
- if(process.size() > 0){
|
|
|
- processSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, process));
|
|
|
- }
|
|
|
- //开工报告
|
|
|
- List<InformationQuery> workStartReportsSubmitList = null;
|
|
|
- if(workStartReports.size() > 0){
|
|
|
- workStartReportsSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, workStartReports));
|
|
|
- }
|
|
|
- //质量评定
|
|
|
- List<InformationQuery> evaluationSubmitList = null;
|
|
|
- if(evaluation.size() > 0){
|
|
|
- evaluationSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, evaluation));
|
|
|
+ //获取合同段信息
|
|
|
+ ContractInfo contract = this.contractClient.getContractById(Long.parseLong(contractId));
|
|
|
+ if(contract != null && new Integer("2").equals(contract.getContractType())){
|
|
|
+ //监理合同段
|
|
|
+ List<String> sgContractIds = this.contractClient.getProcessContractByJLContractId(contractId);
|
|
|
+ if(sgContractIds != null && sgContractIds.size() > 0){
|
|
|
+ //汇总集合
|
|
|
+ List<WbsTreeContract> countList = new ArrayList<>();
|
|
|
+ for(String sgContractId : sgContractIds){
|
|
|
+ //找到可填写的
|
|
|
+ List<WbsTreeContract> submitNodeList = this.wbsTreeContractClient.queryContractSubmitWbsTreeByContractId(sgContractId);
|
|
|
+ if(submitNodeList != null && submitNodeList.size() > 0){
|
|
|
+ countList.addAll(submitNodeList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(countList.size() > 0){
|
|
|
+ //设置参数
|
|
|
+ this.setTaskParameter(reVO, countList);
|
|
|
+ return R.data(reVO);
|
|
|
+ }
|
|
|
}
|
|
|
- //中间交工
|
|
|
- List<InformationQuery> completionSubmitList = null;
|
|
|
- if(completion.size() > 0){
|
|
|
- completionSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, completion));
|
|
|
+ } else {
|
|
|
+ //找到可填写的
|
|
|
+ List<WbsTreeContract> submitNodeList = this.wbsTreeContractClient.queryContractSubmitWbsTreeByContractId(contractId);
|
|
|
+ if(submitNodeList != null && submitNodeList.size() > 0){
|
|
|
+ this.setTaskParameter(reVO, submitNodeList);
|
|
|
+ return R.data(reVO);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- //设置参数返回
|
|
|
- MaterialProgressVO reVO = new MaterialProgressVO();
|
|
|
+ return R.data(300, null, "未找到数据");
|
|
|
+ }
|
|
|
|
|
|
- //处理工序资料
|
|
|
- if(processSubmitList != null && processSubmitList.size() > 0){
|
|
|
- this.setParameter(reVO, processSubmitList);
|
|
|
- } else {
|
|
|
- reVO.setProcessMaterialStatusList("工序资料", 0, 0 ,0);
|
|
|
- }
|
|
|
- //处理开工报告
|
|
|
- if(workStartReportsSubmitList != null && workStartReportsSubmitList.size() > 0){
|
|
|
- this.setParameter(reVO, workStartReportsSubmitList);
|
|
|
- } else {
|
|
|
- reVO.setProcessMaterialStatusList("开工报告", 0, 0 ,0);
|
|
|
- }
|
|
|
- //处理评定资料
|
|
|
- if(evaluationSubmitList != null && evaluationSubmitList.size() > 0){
|
|
|
- this.setParameter(reVO, evaluationSubmitList);
|
|
|
- } else {
|
|
|
- reVO.setProcessMaterialStatusList("评定资料", 0, 0 ,0);
|
|
|
- }
|
|
|
- //处理中间交工
|
|
|
- if(completionSubmitList != null && completionSubmitList.size() > 0){
|
|
|
- this.setParameter(reVO, completionSubmitList);
|
|
|
- } else {
|
|
|
- reVO.setProcessMaterialStatusList("中间交工", 0, 0 ,0);
|
|
|
- }
|
|
|
+ private void setTaskParameter(MaterialProgressVO reVO, List<WbsTreeContract> submitNodeList){
|
|
|
+ //汇总四个填报类型的总数
|
|
|
+ List<String> process = new ArrayList<>(), workStartReports = new ArrayList<>(), evaluation = new ArrayList<>(), completion = new ArrayList<>();
|
|
|
+ //类型分组
|
|
|
+ this.checkType(submitNodeList, process, workStartReports, evaluation, completion);
|
|
|
|
|
|
- return R.data(reVO);
|
|
|
+ //工序资料
|
|
|
+ List<InformationQuery> processSubmitList = null;
|
|
|
+ if(process.size() > 0){
|
|
|
+ processSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, process));
|
|
|
+ }
|
|
|
+ //开工报告
|
|
|
+ List<InformationQuery> workStartReportsSubmitList = null;
|
|
|
+ if(workStartReports.size() > 0){
|
|
|
+ workStartReportsSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, workStartReports));
|
|
|
+ }
|
|
|
+ //质量评定
|
|
|
+ List<InformationQuery> evaluationSubmitList = null;
|
|
|
+ if(evaluation.size() > 0){
|
|
|
+ evaluationSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, evaluation));
|
|
|
+ }
|
|
|
+ //中间交工
|
|
|
+ List<InformationQuery> completionSubmitList = null;
|
|
|
+ if(completion.size() > 0){
|
|
|
+ completionSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, completion));
|
|
|
+ }
|
|
|
+
|
|
|
+ //处理工序资料
|
|
|
+ if(processSubmitList != null && processSubmitList.size() > 0){
|
|
|
+ this.setParameter(reVO, processSubmitList);
|
|
|
+ } else {
|
|
|
+ reVO.setProcessMaterialStatusList("工序资料", 0, 0 ,0);
|
|
|
+ }
|
|
|
+ //处理开工报告
|
|
|
+ if(workStartReportsSubmitList != null && workStartReportsSubmitList.size() > 0){
|
|
|
+ this.setParameter(reVO, workStartReportsSubmitList);
|
|
|
+ } else {
|
|
|
+ reVO.setProcessMaterialStatusList("开工报告", 0, 0 ,0);
|
|
|
+ }
|
|
|
+ //处理评定资料
|
|
|
+ if(evaluationSubmitList != null && evaluationSubmitList.size() > 0){
|
|
|
+ this.setParameter(reVO, evaluationSubmitList);
|
|
|
+ } else {
|
|
|
+ reVO.setProcessMaterialStatusList("评定资料", 0, 0 ,0);
|
|
|
+ }
|
|
|
+ //处理中间交工
|
|
|
+ if(completionSubmitList != null && completionSubmitList.size() > 0){
|
|
|
+ this.setParameter(reVO, completionSubmitList);
|
|
|
+ } else {
|
|
|
+ reVO.setProcessMaterialStatusList("中间交工", 0, 0 ,0);
|
|
|
}
|
|
|
- return R.data(300, null, "未找到数据");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -290,47 +340,79 @@ public class MaterialProgressController extends BladeController {
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation(value = "查询内业资料进度")
|
|
|
public R<MaterialProgressVO> queryMaterialProgress(@RequestParam String contractId){
|
|
|
- //找到可填写的
|
|
|
- List<WbsTreeContract> submitNodeList = this.wbsTreeContractClient.queryContractSubmitWbsTreeByContractId(contractId);
|
|
|
- if(submitNodeList != null && submitNodeList.size() > 0){
|
|
|
- //汇总四个填报类型的总数
|
|
|
- List<String> process = new ArrayList<>(), workStartReports = new ArrayList<>(), evaluation = new ArrayList<>(), completion = new ArrayList<>();
|
|
|
- //类型分组
|
|
|
- this.checkType(submitNodeList, process, workStartReports, evaluation, completion);
|
|
|
-
|
|
|
- //根据四个集合获取对应的资料
|
|
|
- //工序资料
|
|
|
- long processAmount = 0L;
|
|
|
- if(process.size() > 0){
|
|
|
- processAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, process));
|
|
|
- }
|
|
|
- //开工报告
|
|
|
- long workStartReportsAmount = 0L;
|
|
|
- if(workStartReports.size() > 0){
|
|
|
- workStartReportsAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, workStartReports));
|
|
|
- }
|
|
|
- //质量评定
|
|
|
- long evaluationAmount = 0L;
|
|
|
- if(evaluation.size() > 0){
|
|
|
- evaluationAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, evaluation));
|
|
|
+ //设置返回
|
|
|
+ MaterialProgressVO reVO = new MaterialProgressVO();
|
|
|
+
|
|
|
+ //获取合同段信息
|
|
|
+ ContractInfo contract = this.contractClient.getContractById(Long.parseLong(contractId));
|
|
|
+ if(contract != null && new Integer("2").equals(contract.getContractType())){
|
|
|
+ //监理合同段
|
|
|
+ List<String> sgContractIds = this.contractClient.getProcessContractByJLContractId(contractId);
|
|
|
+ if(sgContractIds != null && sgContractIds.size() > 0){
|
|
|
+ //汇总集合
|
|
|
+ List<WbsTreeContract> countList = new ArrayList<>();
|
|
|
+ for(String sgContractId : sgContractIds){
|
|
|
+ //找到可填写的
|
|
|
+ List<WbsTreeContract> submitNodeList = this.wbsTreeContractClient.queryContractSubmitWbsTreeByContractId(sgContractId);
|
|
|
+ if(submitNodeList != null && submitNodeList.size() > 0){
|
|
|
+ countList.addAll(submitNodeList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(countList.size() > 0){
|
|
|
+ //设置参数
|
|
|
+ this.setParameter(countList, reVO);
|
|
|
+ }
|
|
|
+ return R.data(reVO);
|
|
|
}
|
|
|
- //中间交工
|
|
|
- long completionAmount = 0L;
|
|
|
- if(completion.size() > 0){
|
|
|
- completionAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, completion));
|
|
|
+ } else {
|
|
|
+ //施工合同段
|
|
|
+ //找到可填写的
|
|
|
+ List<WbsTreeContract> submitNodeList = this.wbsTreeContractClient.queryContractSubmitWbsTreeByContractId(contractId);
|
|
|
+ if(submitNodeList != null && submitNodeList.size() > 0){
|
|
|
+ //设置参数
|
|
|
+ this.setParameter(submitNodeList, reVO);
|
|
|
+ return R.data(reVO);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- //设置返回
|
|
|
- MaterialProgressVO reVO = new MaterialProgressVO();
|
|
|
- reVO.setProcessMaterialList("开工报告", workStartReports.size(), workStartReportsAmount);
|
|
|
- reVO.setProcessMaterialList("工序资料", process.size(), processAmount);
|
|
|
- reVO.setProcessMaterialList("评定资料", evaluation.size(), evaluationAmount);
|
|
|
- reVO.setProcessMaterialList("中间交工", completion.size(), completionAmount);
|
|
|
+ return R.data(300, null, "未找到数据");
|
|
|
+ }
|
|
|
|
|
|
- return R.data(reVO);
|
|
|
+ /**
|
|
|
+ * 设置参数
|
|
|
+ */
|
|
|
+ private void setParameter(List<WbsTreeContract> submitNodeList, MaterialProgressVO reVO){
|
|
|
+ //汇总四个填报类型的总数
|
|
|
+ List<String> process = new ArrayList<>(), workStartReports = new ArrayList<>(), evaluation = new ArrayList<>(), completion = new ArrayList<>();
|
|
|
+ //类型分组
|
|
|
+ this.checkType(submitNodeList, process, workStartReports, evaluation, completion);
|
|
|
+
|
|
|
+ //根据四个集合获取对应的资料
|
|
|
+ //工序资料
|
|
|
+ long processAmount = 0L;
|
|
|
+ if(process.size() > 0){
|
|
|
+ processAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, process));
|
|
|
+ }
|
|
|
+ //开工报告
|
|
|
+ long workStartReportsAmount = 0L;
|
|
|
+ if(workStartReports.size() > 0){
|
|
|
+ workStartReportsAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, workStartReports));
|
|
|
+ }
|
|
|
+ //质量评定
|
|
|
+ long evaluationAmount = 0L;
|
|
|
+ if(evaluation.size() > 0){
|
|
|
+ evaluationAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, evaluation));
|
|
|
+ }
|
|
|
+ //中间交工
|
|
|
+ long completionAmount = 0L;
|
|
|
+ if(completion.size() > 0){
|
|
|
+ completionAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, completion));
|
|
|
}
|
|
|
|
|
|
- return R.data(300, null, "未找到数据");
|
|
|
+ reVO.setProcessMaterialList("开工报告", workStartReports.size(), workStartReportsAmount);
|
|
|
+ reVO.setProcessMaterialList("工序资料", process.size(), processAmount);
|
|
|
+ reVO.setProcessMaterialList("评定资料", evaluation.size(), evaluationAmount);
|
|
|
+ reVO.setProcessMaterialList("中间交工", completion.size(), completionAmount);
|
|
|
}
|
|
|
|
|
|
/**
|