java110 лет назад: 5
Родитель
Сommit
bc44cd3661

+ 57 - 0
java110-bean/src/main/java/com/java110/vo/FeeDetailResultVo.java

@@ -0,0 +1,57 @@
+package com.java110.vo;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName ResultVo
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/5/28 18:41
+ * @Version 1.0
+ * add by wuxw 2020/5/28
+ **/
+public class FeeDetailResultVo extends ResultVo implements Serializable {
+
+    private double totalReceivedAmount;
+    private double totalReceivableAmount;
+
+    public FeeDetailResultVo() {
+
+    }
+
+    public FeeDetailResultVo(double totalReceivableAmount, double totalReceivedAmount, int records, int total, Object data) {
+        this.totalReceivableAmount = totalReceivableAmount;
+        this.totalReceivedAmount = totalReceivedAmount;
+        this.setCode(CODE_OK);
+        this.setMsg(MSG_OK);
+        this.setRecords(records);
+        this.setTotal(total);
+        this.setData(data);
+
+    }
+
+    public double getTotalReceivedAmount() {
+        return totalReceivedAmount;
+    }
+
+    public void setTotalReceivedAmount(double totalReceivedAmount) {
+        this.totalReceivedAmount = totalReceivedAmount;
+    }
+
+    public double getTotalReceivableAmount() {
+        return totalReceivableAmount;
+    }
+
+    public void setTotalReceivableAmount(double totalReceivableAmount) {
+        this.totalReceivableAmount = totalReceivableAmount;
+    }
+
+    @Override
+    public String toString() {
+        return JSONObject.toJSONString(this, SerializerFeature.DisableCircularReferenceDetect, SerializerFeature.WriteDateUseDateFormat);
+    }
+
+}

+ 1 - 1
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml

@@ -768,7 +768,7 @@
         </if>
     </select>
     <select id="queryPayFeeDetailCount" parameterType="Map" resultType="Map">
-        select count(1) count
+        select count(1) count,SUM(receivedAmount) totalReceivedAmount,SUM(receivableAmount) totalReceivableAmount
         from (
         select pfc.fee_name feeName,f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,oc.car_num carNum,
         pf.payer_obj_type payerObjType,t.start_time startTime,t.end_time endTime,t.create_time createTime,

+ 2 - 1
java110-interface/src/main/java/com/java110/intf/report/IReportFeeMonthStatisticsInnerServiceSMO.java

@@ -1,5 +1,6 @@
 package com.java110.intf.report;
 
+import com.alibaba.fastjson.JSONObject;
 import com.java110.config.feign.FeignConfiguration;
 import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto;
 import com.java110.po.reportFeeMonthStatistics.ReportFeeMonthStatisticsPo;
@@ -164,7 +165,7 @@ public interface IReportFeeMonthStatisticsInnerServiceSMO {
      * @return
      */
     @RequestMapping(value = "/queryPayFeeDetailCount", method = RequestMethod.POST)
-    int queryPayFeeDetailCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
+    JSONObject queryPayFeeDetailCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
 
     /**
      * 查询费用汇总表

+ 7 - 2
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java

@@ -1,11 +1,13 @@
 package com.java110.report.bmo.reportFeeMonthStatistics.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.java110.dto.fee.FeeDto;
 import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto;
 import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO;
 import com.java110.report.bmo.reportFeeMonthStatistics.IGetReportFeeMonthStatisticsBMO;
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.StringUtil;
+import com.java110.vo.FeeDetailResultVo;
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -144,7 +146,9 @@ public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthSta
 
     @Override
     public ResponseEntity<String> queryPayFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
-        int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPayFeeDetailCount(reportFeeMonthStatisticsDto);
+        JSONObject countInfo = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPayFeeDetailCount(reportFeeMonthStatisticsDto);
+
+        int count = Integer.parseInt(countInfo.get("count").toString());
 
         List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
         if (count > 0) {
@@ -167,7 +171,8 @@ public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthSta
             reportFeeMonthStatisticsDtos = new ArrayList<>();
         }
 
-        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportFeeMonthStatisticsDtos);
+        FeeDetailResultVo resultVo = new FeeDetailResultVo(countInfo.getDouble("totalReceivableAmount"), countInfo.getDouble("totalReceivedAmount"),
+                (int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportFeeMonthStatisticsDtos);
 
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
 

+ 1 - 1
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java

@@ -147,7 +147,7 @@ public interface IReportFeeMonthStatisticsServiceDao {
      * @return 费用月统计数量
      */
     int queryOweFeeDetailCount(Map info);
-    int queryPayFeeDetailCount(Map info);
+    Map queryPayFeeDetailCount(Map info);
     int queryDeadlineFeeCount(Map info);
     /**
      * 查询费用月统计信息(instance过程)

+ 6 - 4
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java

@@ -212,16 +212,17 @@ public class ReportFeeMonthStatisticsServiceDaoImpl extends BaseServiceDao imple
 
         return businessReportFeeMonthStatisticsInfos;
     }
+
     @Override
-    public int queryPayFeeDetailCount(Map info) {
+    public Map queryPayFeeDetailCount(Map info) {
         logger.debug("查询费用月统计数据 入参 info : {}", info);
 
         List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.queryPayFeeDetailCount", info);
         if (businessReportFeeMonthStatisticsInfos.size() < 1) {
-            return 0;
+            return null;
         }
 
-        return Integer.parseInt(businessReportFeeMonthStatisticsInfos.get(0).get("count").toString());
+        return businessReportFeeMonthStatisticsInfos.get(0);
     }
 
     @Override
@@ -309,7 +310,8 @@ public class ReportFeeMonthStatisticsServiceDaoImpl extends BaseServiceDao imple
 
         List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.queryFinishOweFee", info);
 
-        return businessReportFeeMonthStatisticsInfos;    }
+        return businessReportFeeMonthStatisticsInfos;
+    }
 
 
 }

+ 8 - 2
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeMonthStatisticsInnerServiceSMOImpl.java

@@ -1,6 +1,7 @@
 package com.java110.report.smo.impl;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.dto.PageDto;
 import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto;
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @ClassName FloorInnerServiceSMOImpl
@@ -152,6 +154,7 @@ public class ReportFeeMonthStatisticsInnerServiceSMOImpl extends BaseServiceSMO
 
         return reportFeeMonthStatisticss;
     }
+
     @Override
     public int queryPrePaymentNewCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
         return reportFeeMonthStatisticsServiceDaoImpl.queryPrePaymentNewCount(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
@@ -193,8 +196,10 @@ public class ReportFeeMonthStatisticsInnerServiceSMOImpl extends BaseServiceSMO
     }
 
     @Override
-    public int queryPayFeeDetailCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
-        return reportFeeMonthStatisticsServiceDaoImpl.queryPayFeeDetailCount(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
+    public JSONObject queryPayFeeDetailCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
+        Map info = reportFeeMonthStatisticsServiceDaoImpl.queryPayFeeDetailCount(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
+
+        return JSONObject.parseObject(JSONObject.toJSONString(info));
     }
 
     @Override
@@ -211,6 +216,7 @@ public class ReportFeeMonthStatisticsInnerServiceSMOImpl extends BaseServiceSMO
 
         return reportFeeMonthStatisticss;
     }
+
     @Override
     public int queryDeadlineFeeCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
         return reportFeeMonthStatisticsServiceDaoImpl.queryDeadlineFeeCount(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));