diff --git a/jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java b/jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java index c1edca55..c3613e4d 100644 --- a/jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java +++ b/jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java @@ -382,14 +382,14 @@ public class BsSgcjsjdBuiProInfoService extends BaseService sp){ + public StageStatistics getStageStatistics(SearchParam sp) { - StageStatistics stageStatistics=new StageStatistics(); + StageStatistics stageStatistics = new StageStatistics(); BsSgcJsjdBuiConstrMeas bsSgcJsjdBuiConstrMeas = bsSgcJsjdBuiConstrMeasMapper.selectOne(new QueryWrapper() - .eq("proNo", sp.getData().getProNo()).eq("proCode", sp.getData().getProCode())); - if (!ObjectUtil.isEmpty(bsSgcJsjdBuiConstrMeas)){ - if (!ObjectUtil.isEmpty(bsSgcJsjdBuiConstrMeas.getReportTime1())){ + .eq("pro_no", sp.getData().getProNo()).eq("pro_code", sp.getData().getProCode())); + if (!ObjectUtil.isEmpty(bsSgcJsjdBuiConstrMeas)) { + if (!ObjectUtil.isEmpty(bsSgcJsjdBuiConstrMeas.getReportTime1())) { stageStatistics.setPreliminaryApprovalDate(bsSgcJsjdBuiConstrMeas.getReportTime1()); stageStatistics.setCurrentStage("0"); } @@ -397,42 +397,75 @@ public class BsSgcjsjdBuiProInfoService extends BaseService() - .eq("proNo", sp.getData().getProNo()).eq("proCode", sp.getData().getProCode())); - if (!ObjectUtil.isEmpty(bsSgcjsjdBuiProInfo)){ - if (!ObjectUtil.isEmpty(bsSgcjsjdBuiProInfo.getCommencementDate())){ - stageStatistics.setProjectStartedDate(bsSgcjsjdBuiProInfo.getCommencementDate()); - if (!bsSgcjsjdBuiProInfo.getCommencementDate().before(new Date())){ - stageStatistics.setCurrentStage("1"); - } + .eq("pro_no", sp.getData().getProNo()).eq("pro_code", sp.getData().getProCode())); + if (!ObjectUtil.isEmpty(bsSgcjsjdBuiProInfo)) { + if (!ObjectUtil.isEmpty(bsSgcjsjdBuiProInfo.getCommencementDate())) { + stageStatistics.setProjectStartedDate(bsSgcjsjdBuiProInfo.getCommencementDate()); + if (!bsSgcjsjdBuiProInfo.getCommencementDate().before(new Date())) { + stageStatistics.setCurrentStage("1"); + } } } BsSgcJsjdBuiComAcc bsSgcJsjdBuiComAcc = bsSgcJsjdBuiComAccMapper.selectOne(new QueryWrapper() - .eq("proNo", sp.getData().getProNo()).eq("proCode", sp.getData().getProCode())); - if (!ObjectUtil.isEmpty(bsSgcJsjdBuiComAcc)){ - if (!ObjectUtil.isEmpty(bsSgcJsjdBuiComAcc.getContractAcceptTime())){ + .eq("pro_no", sp.getData().getProNo()).eq("pro_code", sp.getData().getProCode())); + if (!ObjectUtil.isEmpty(bsSgcJsjdBuiComAcc)) { + if (!ObjectUtil.isEmpty(bsSgcJsjdBuiComAcc.getContractAcceptTime())) { stageStatistics.setProjectCompletedDate(bsSgcJsjdBuiComAcc.getContractAcceptTime()); stageStatistics.setCurrentStage("2"); } - if (!ObjectUtil.isEmpty(bsSgcJsjdBuiComAcc.getContractAcceptTime())){ + if (!ObjectUtil.isEmpty(bsSgcJsjdBuiComAcc.getContractAcceptTime())) { stageStatistics.setCompletionAcceptanceDate(bsSgcJsjdBuiComAcc.getContractAcceptTime()); stageStatistics.setCurrentStage("3"); } } - - String mm = String.format(DateUtil.formatBetween(bsSgcjsjdBuiProInfo.getCommencementDate(), bsSgcjsjdBuiProInfo.getPlannedCompletionDate()), "MM"); - stageStatistics.setTotalConstructionPeriod(mm); - - String mmn = String.format(DateUtil.formatBetween(bsSgcjsjdBuiProInfo.getCommencementDate(), new Date()), "MM"); + if (!ObjectUtil.isEmpty(bsSgcjsjdBuiProInfo.getCommencementDate()) && !ObjectUtil.isEmpty(bsSgcjsjdBuiProInfo.getPlannedCompletionDate())) { + String mm = String.valueOf(Math.round(DateUtil.betweenMonth(bsSgcjsjdBuiProInfo.getCommencementDate(), bsSgcjsjdBuiProInfo.getPlannedCompletionDate(),true))); stageStatistics.setTotalConstructionPeriod(mm); + String mmn = String.valueOf(Math.round(DateUtil.betweenMonth(bsSgcjsjdBuiProInfo.getCommencementDate(), new Date(),true))); stageStatistics.setElapseConstructionPeriod(mmn); - + } BsSgcJsjdBuiProgressPlan bp = bsSgcJsjdBuiProgressPlanMapper.selectOne(new QueryWrapper() - .eq("proNo", sp.getData().getProNo()).eq("proCode", sp.getData().getProCode())); - BigDecimal total=bp.getV1().add(bp.getV2()).add(bp.getV3()).add(bp.getV4()) - .add(bp.getV5()).add(bp.getV6()).add(bp.getV7()).add(bp.getV8()) - .add(bp.getV9()).add(bp.getV10()).add(bp.getV11()).add(bp.getV12()); + .eq("pro_no", sp.getData().getProNo()).eq("pro_code", sp.getData().getProCode())); + + BigDecimal total=BigDecimal.ZERO; + if (bp.getV1() != null) { + total = total.add(bp.getV1()); + } + if (bp.getV2() != null) { + total = total.add(bp.getV2()); + } + if (bp.getV3() != null) { + total = total.add(bp.getV2()); + } + if (bp.getV4() != null) { + total = total.add(bp.getV2()); + } + if (bp.getV5() != null) { + total = total.add(bp.getV2()); + } + if (bp.getV6() != null) { + total = total.add(bp.getV2()); + } + if (bp.getV7() != null) { + total = total.add(bp.getV2()); + } + if (bp.getV8() != null) { + total = total.add(bp.getV2()); + } + if (bp.getV9() != null) { + total = total.add(bp.getV2()); + } + if (bp.getV10() != null) { + total = total.add(bp.getV2()); + } + if (bp.getV11() != null) { + total = total.add(bp.getV2()); + } + if (bp.getV12() != null) { + total = total.add(bp.getV2()); + } stageStatistics.setCompleteInvestmentAmount(total); stageStatistics.setPlanInvestmentAmount(bsSgcjsjdBuiProInfo.getCentralArrangedFunds() diff --git a/jwtech-system/src/main/java/com/kms/warn/controller/ProjectManageController.java b/jwtech-system/src/main/java/com/kms/warn/controller/ProjectManageController.java index 00653120..8e701a18 100644 --- a/jwtech-system/src/main/java/com/kms/warn/controller/ProjectManageController.java +++ b/jwtech-system/src/main/java/com/kms/warn/controller/ProjectManageController.java @@ -43,7 +43,7 @@ public class ProjectManageController { } - @PostMapping("/get/stage/statistics") + @PostMapping("/statistics") @ApiOperation("预警项目信息统计") public AjaxResult getStageStatistics(@RequestBody SearchParam sp){ return AjaxResult.success(bsSgcjsjdBuiProInfoService.getStageStatistics(sp));