diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java index e29402d..ec3c94d 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java @@ -277,4 +277,32 @@ public class HuzhouProjectController { IPage infoPageList =projectinfoService.getUnitedTechnicalReviewList(projectinfo, pageNo, pageSize); return Result.OK(infoPageList); } + + @GetMapping("/getTotalNumber") + public Result getTotalNumber(){ + CountNumberOV result = projectinfoService.countTotalNumber(); + return Result.ok(result); + } + @GetMapping("/getStoragedNumber") + public Result getStoragedNumber(){ + CountNumberOV result = projectinfoService.countStoragedNumber(); + return Result.ok(result); + } + @GetMapping("/getSupportingNumber") + public Result getSupportingNumber(){ + CountNumberOV result = projectinfoService.countSupportingNumber(); + return Result.ok(result); + } + @GetMapping("/getStoragedFound") + public Result getStoragedFound(){ + FoundByTypeOV result = projectinfoService.countStoragedFound(); + return Result.ok(result); + } + @GetMapping("/getSupportingFound") + public Result getSupportingFound(){ + FoundByTypeOV result = projectinfoService.countSupportingFound(); + return Result.ok(result); + } + + } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java index 07f946a..25f6ce4 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java @@ -182,5 +182,15 @@ public interface IHuzhouProjectinfoService extends IService { IPage getUnitedTechnicalReviewList(HuzhouProjectinfoOV projectinfo, Integer pageNo, Integer pageSize); + CountNumberOV countTotalNumber(); + + CountNumberOV countStoragedNumber(); + + CountNumberOV countSupportingNumber(); + + FoundByTypeOV countStoragedFound(); + + FoundByTypeOV countSupportingFound(); + } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java index a6a346e..16299a6 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java @@ -1235,5 +1235,96 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl projectinfoOVList = projectinfoMapper.getProjectAndChildInfoPageList(projectInfoAuthSelect); + if(projectinfoOVList.size()>0){ + total=projectinfoOVList.size(); + cityNum=projectinfoOVList.stream().filter(x->x.getAdminDivision().equals("市本级")).collect(Collectors.toList()).size(); + countryNum=total-cityNum; + } + CountNumberOV result=new CountNumberOV(); + result.setTotal(total); + result.setCityNum(cityNum); + result.setCountyNum(countryNum); + return result; + } + public CountNumberOV countStoragedNumber(){ + CountNumberOV result = countNumber("1"); + return result; + } + public CountNumberOV countSupportingNumber(){ + CountNumberOV result = countNumber("2"); + return result; + } + public CountNumberOV countNumber(String type){ + int total=0; + int cityNum=0; + int countryNum=0; + HuzhouProjectinfo projectInfo = new HuzhouProjectinfo(); + //入库项目:1,配套项目:2 + projectInfo.setType(type); + ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); + List projectinfoOVList = projectinfoMapper.getProjectAndChildInfoPageList(projectInfoAuthSelect); + if(projectinfoOVList.size()>0){ + total=projectinfoOVList.size(); + cityNum=projectinfoOVList.stream().filter(x->x.getAdminDivision().equals("市本级")).collect(Collectors.toList()).size(); + countryNum=total-cityNum; + } + CountNumberOV result=new CountNumberOV(); + result.setTotal(total); + result.setCityNum(cityNum); + result.setCountyNum(countryNum); + return result; + } + + public FoundByTypeOV countStoragedFound(){ + FoundByTypeOV result = countFoundByType("1"); + return result; + + } + public FoundByTypeOV countSupportingFound(){ + FoundByTypeOV result = countFoundByType("2"); + return result; + + } + public FoundByTypeOV countFoundByType(String type){ + BigDecimal defVal = new BigDecimal("0.00"); + BigDecimal totalAmount = new BigDecimal("0.00"); + BigDecimal totalCentral = new BigDecimal("0.00"); + BigDecimal totalProvincial = new BigDecimal("0.00"); + //补充区级资金、市级资金、自筹资金 + BigDecimal totalCity = new BigDecimal("0.00"); + BigDecimal totalCounty = new BigDecimal("0.00"); + BigDecimal totalSelf = new BigDecimal("0.00"); + HuzhouProjectinfo projectInfo = new HuzhouProjectinfo(); + //入库项目:1,配套项目:2 + projectInfo.setType(type); + ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); + List projectinfoOVList = projectinfoMapper.getProjectAndChildInfoPageList(projectInfoAuthSelect); + if (projectinfoOVList.size() > 0) { + List projectIds = projectinfoOVList.stream().map(x -> x.getId()).collect(Collectors.toList()); + Map totalMap = projectinfoMapper.getTotalByProjectIds(projectIds); + totalAmount = totalMap != null ? totalMap.get("totalAcount") : defVal; + totalCentral = totalMap != null ? totalMap.get("centralAcount") : defVal; + totalProvincial = totalMap != null ? totalMap.get("provincialAcount") : defVal; + //补充区级资金、市级资金、自筹资金 + totalCity = totalMap != null ? totalMap.get("cityAcount") : defVal; + totalCounty = totalMap != null ? totalMap.get("countyAcount") : defVal; + totalSelf = totalMap != null ? totalMap.get("selfAcount") : defVal; + } + FoundByTypeOV result=new FoundByTypeOV(); + result.setTotalMoney(totalAmount); + result.setTotalCentral(totalCentral); + result.setTotalProvincial(totalProvincial); + result.setTotalCity(totalCity); + result.setTotalCounty(totalCounty); + result.setTotalSelf(totalSelf); + return result; + } } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/CountNumberOV.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/CountNumberOV.java new file mode 100644 index 0000000..edc320a --- /dev/null +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/CountNumberOV.java @@ -0,0 +1,16 @@ +package com.easy.admin.modules.huzhou.vo; + + +import lombok.Data; + +@Data +public class CountNumberOV { + + private Integer total; + + private Integer countyNum; + + private Integer cityNum; + + +} diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/FoundByTypeOV.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/FoundByTypeOV.java new file mode 100644 index 0000000..48ca416 --- /dev/null +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/FoundByTypeOV.java @@ -0,0 +1,19 @@ +package com.easy.admin.modules.huzhou.vo; + + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class FoundByTypeOV { + + private BigDecimal totalMoney; + private BigDecimal totalCentral; + private BigDecimal totalProvincial; + + private BigDecimal totalCity; + private BigDecimal totalCounty; + private BigDecimal totalSelf; +} +