From 0e0e1f080d4a986ca75cde7cf5d23b2f8539fb10 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 17 五月 2023 12:25:35 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

---
 service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryDetailCmd.java |   47 +++++++++++++++++++++++++++++------------------
 1 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryDetailCmd.java b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryDetailCmd.java
index 73a5ac6..d0d4249 100644
--- a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryDetailCmd.java
+++ b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryDetailCmd.java
@@ -6,9 +6,11 @@
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.dto.data.DataPrivilegeStaffDto;
+import com.java110.dto.report.QueryStatisticsDto;
 import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto;
 import com.java110.intf.community.IDataPrivilegeUnitV1InnerServiceSMO;
 import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO;
+import com.java110.report.statistics.IFeeStatistics;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
@@ -20,57 +22,66 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 璐圭敤姹囨�绘槑缁�
  */
-@Java110Cmd(serviceCode = "/reportFeeMonthStatistics/queryReportFeeSummaryDetail")
+@Java110Cmd(serviceCode = "/reportFeeMonthStatistics.queryReportFeeSummaryDetail")
 public class QueryReportFeeSummaryDetailCmd extends Cmd {
 
     @Autowired
-    private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl;
+    private IFeeStatistics feeStatisticsImpl;
 
     @Autowired
     private IDataPrivilegeUnitV1InnerServiceSMO dataPrivilegeUnitV1InnerServiceSMOImpl;
 
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
-        Assert.hasKeyAndValue(reqJson, "communityId", "鏈紶鍏ュ皬鍖轰俊鎭�");
-        Assert.hasKeyAndValue(reqJson, "feeYear", "鏈紶鍏ュ勾浠�");
-        Assert.hasKeyAndValue(reqJson, "feeMonth", "鏈紶鍏ユ湀浠�");
         super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "startDate", "鏈寘鍚紑濮嬫棩鏈�");
+        Assert.hasKeyAndValue(reqJson, "endDate", "鏈寘鍚粨鏉熸棩鏈�");
+        Assert.hasKeyAndValue(reqJson, "communityId", "鏈寘鍚皬鍖轰俊鎭�");
     }
 
     @Override
     public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
-        String[] configIds = null;
-        if (reqJson.containsKey("configIds") && !StringUtil.isEmpty(reqJson.getString("configIds"))) {
-            configIds = reqJson.getString("configIds").split(",");
-            reqJson.remove("configIds");
+        QueryStatisticsDto queryStatisticsDto = new QueryStatisticsDto();
+        queryStatisticsDto.setCommunityId(reqJson.getString("communityId"));
+        queryStatisticsDto.setStartDate(reqJson.getString("startDate"));
+        queryStatisticsDto.setEndDate(reqJson.getString("endDate"));
+        queryStatisticsDto.setConfigId(reqJson.getString("configId"));
+        queryStatisticsDto.setFloorId(reqJson.getString("floorId"));
+        queryStatisticsDto.setObjName(reqJson.getString("objName"));
+        queryStatisticsDto.setFeeTypeCd(reqJson.getString("feeTypeCd"));
+        queryStatisticsDto.setOwnerName(reqJson.getString("ownerName"));
+        queryStatisticsDto.setLink(reqJson.getString("link"));
+        queryStatisticsDto.setPage(reqJson.getIntValue("page"));
+        queryStatisticsDto.setRow(reqJson.getIntValue("row"));
+        if (reqJson.containsKey("configIds")) {
+            queryStatisticsDto.setConfigIds(reqJson.getString("configIds").split(","));
         }
-        ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = BeanConvertUtil.covertBean(reqJson, ReportFeeMonthStatisticsDto.class);
-        reportFeeMonthStatisticsDto.setConfigIds(configIds);
 
         String staffId = context.getReqHeaders().get("user-id");
         DataPrivilegeStaffDto dataPrivilegeStaffDto = new DataPrivilegeStaffDto();
         dataPrivilegeStaffDto.setStaffId(staffId);
         String[] unitIds = dataPrivilegeUnitV1InnerServiceSMOImpl.queryDataPrivilegeUnitsByStaff(dataPrivilegeStaffDto);
 
-        if(unitIds != null && unitIds.length>0){
-            reportFeeMonthStatisticsDto.setUnitIds(unitIds);
+        if (unitIds != null && unitIds.length > 0) {
+            queryStatisticsDto.setUnitIds(unitIds);
         }
 
 
-        int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFeeSummaryDetailCount(reportFeeMonthStatisticsDto);
+        int count = feeStatisticsImpl.getObjFeeSummaryCount(queryStatisticsDto);
 
-        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
+        List<Map> datas = null;
         if (count > 0) {
-            reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFeeSummaryDetail(reportFeeMonthStatisticsDto);
+            datas = feeStatisticsImpl.getObjFeeSummary(queryStatisticsDto);
         } else {
-            reportFeeMonthStatisticsDtos = new ArrayList<>();
+            datas = new ArrayList<>();
         }
 
-        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportFeeMonthStatisticsDtos);
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) queryStatisticsDto.getRow()), count, datas);
 
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
 

--
Gitblit v1.8.0