Kaynağa Gözat

Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

java110 3 yıl önce
ebeveyn
işleme
0e0e1f080d

+ 13 - 1
java110-bean/src/main/java/com/java110/dto/report/QueryStatisticsDto.java

@@ -1,8 +1,10 @@
 package com.java110.dto.report;
 
+import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 
-public class QueryStatisticsDto implements Serializable {
+public class QueryStatisticsDto extends PageDto implements Serializable {
 
     private String communityId;
     private String startDate;
@@ -26,6 +28,8 @@ public class QueryStatisticsDto implements Serializable {
 
     private String feeTypeCd;
 
+    private String[] unitIds;
+
 
     public String getCommunityId() {
         return communityId;
@@ -107,4 +111,12 @@ public class QueryStatisticsDto implements Serializable {
     public void setFeeTypeCd(String feeTypeCd) {
         this.feeTypeCd = feeTypeCd;
     }
+
+    public String[] getUnitIds() {
+        return unitIds;
+    }
+
+    public void setUnitIds(String[] unitIds) {
+        this.unitIds = unitIds;
+    }
 }

+ 5 - 5
java110-core/src/main/java/com/java110/core/cache/JedisClientTemplate.java

@@ -42,7 +42,7 @@ public class JedisClientTemplate implements Jedis {
 //        return "";
         return redisTemplate.execute(new RedisCallback() {
             public String doInRedis(RedisConnection connection) {
-                redis.clients.jedis.Jedis jedis = (redis.clients.jedis.Jedis) connection.getNativeConnection();
+                //redis.clients.jedis.Jedis jedis = (redis.clients.jedis.Jedis) connection.getNativeConnection();
                 Object nativeConnection = connection.getNativeConnection();
                 // 集群
                 if (nativeConnection instanceof JedisCluster) {
@@ -50,8 +50,8 @@ public class JedisClientTemplate implements Jedis {
                 }
 
                 // 单机
-                if (nativeConnection instanceof Jedis) {
-                    return ((Jedis) nativeConnection).set(key, value, nxxx, expx, time);
+                if (nativeConnection instanceof redis.clients.jedis.Jedis) {
+                    return ((redis.clients.jedis.Jedis) nativeConnection).set(key, value, nxxx, expx, time);
                 }
                 return "";
             }
@@ -159,8 +159,8 @@ public class JedisClientTemplate implements Jedis {
             }
 
             // 单机
-            if (nativeConnection instanceof Jedis) {
-                return ((Jedis) nativeConnection).eval(script, keys, args);
+            if (nativeConnection instanceof redis.clients.jedis.Jedis) {
+                return ((redis.clients.jedis.Jedis) nativeConnection).eval(script, keys, args);
             }
 
             return null;

+ 171 - 85
java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml

@@ -254,17 +254,17 @@
 
     <!-- 查询欠费户数 -->
     <select id="getOweRoomCount" parameterType="Map" resultType="Map">
+
         select count(1) oweRoomCount
-        from
-        (
-        select t.obj_id from pay_fee_detail_month t
+        from (
+        select a.room_id
+        from building_room a
+        left join pay_fee_detail_month t on t.obj_id = a.room_id
         INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
         <if test="floorId != null and floorId != ''">
-            LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
-            left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
+            left join building_unit bu on a.unit_id = bu.unit_id and bu.status_cd = '0'
         </if>
-        where
-        1=1
+        where 1=1
         <if test="floorId != null and floorId != ''">
             and bu.floor_id = #{floorId}
         </if>
@@ -289,28 +289,27 @@
         <if test="feeTypeCd != null and feeTypeCd != ''">
             and pf.fee_type_cd = #{feeTypeCd}
         </if>
-        and t.status_cd = '0'
+        and a.status_cd = '0'
         and pf.payer_obj_type = '3333'
         and t.community_id= #{communityId}
         and t.cur_month_time &lt; #{endDate}
         and (t.receivable_amount - t.received_amount - t.discount_amount) > 0
-        group by t.obj_id
+        group by a.room_id
         ) a
     </select>
 
     <!-- 查询收费户数 -->
     <select id="getFeeRoomCount" parameterType="Map" resultType="Map">
         select count(1) feeRoomCount
-        from
-        (
-        select t.obj_id from pay_fee_detail_month t
+        from (
+        select a.room_id
+        from building_room a
+        left join pay_fee_detail_month t on t.obj_id = a.room_id
         INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
         <if test="floorId != null and floorId != ''">
-            LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
-            left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
+            left join building_unit bu on a.unit_id = bu.unit_id and bu.status_cd = '0'
         </if>
-        where
-        1=1
+        where 1=1
         <if test="floorId != null and floorId != ''">
             and bu.floor_id = #{floorId}
         </if>
@@ -335,11 +334,11 @@
         <if test="feeTypeCd != null and feeTypeCd != ''">
             and pf.fee_type_cd = #{feeTypeCd}
         </if>
-        and t.status_cd = '0'
+        and a.status_cd = '0'
         and pf.payer_obj_type = '3333'
         and t.community_id= #{communityId}
         and t.cur_month_time &lt; #{endDate}
-        group by t.obj_id
+        group by a.room_id
         ) a
     </select>
 
@@ -348,41 +347,42 @@
 
         select a.floor_id floorId,a.floor_num floorNum,a.name floorName,
         (
-        select count(1) from (
-        select t.obj_id from pay_fee_detail_month t
-        INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
-        LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
-        left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
-        where
-        1=1
-        and bu.floor_id = a.floor_id
-        and t.status_cd = '0'
-        and pf.payer_obj_type = '3333'
-        and t.community_id= a.community_id
-        and t.cur_month_time &lt; #{endDate}
-        and (t.receivable_amount - t.received_amount - t.discount_amount) > 0
-        <if test="configIds !=null ">
-            and t.config_id in
-            <foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="feeTypeCd != null and feeTypeCd != ''">
-            and pf.fee_type_cd = #{feeTypeCd}
-        </if>
-        group by t.obj_id) b
-        ) oweRoomCount,-- 欠费户
+            select count(1) from (
+            select bu.floor_id,a.room_id
+            from building_room a
+            left join pay_fee_detail_month t on t.obj_id = a.room_id
+            INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+            left join building_unit bu on a.unit_id = bu.unit_id and bu.status_cd = '0'
+            where
+            1=1
+            and a.status_cd = '0'
+            and pf.payer_obj_type = '3333'
+            and t.community_id= a.community_id
+            and t.cur_month_time &lt; #{endDate}
+            and (t.receivable_amount - t.received_amount - t.discount_amount) > 0
+            <if test="configIds !=null ">
+                and t.config_id in
+                <foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="feeTypeCd != null and feeTypeCd != ''">
+                and pf.fee_type_cd = #{feeTypeCd}
+            </if>
+            group by bu.floor_id,t.obj_id
+        ) b
+        where b.floor_id = a.floor_id
+        ) oweRoomCount,
         (
         select count(1) from (
-        select t.obj_id
-        from pay_fee_detail_month t
+        select bu.floor_id,a.room_id
+        from building_room a
+        left join pay_fee_detail_month t on t.obj_id = a.room_id
         INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
-        LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
-        left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
+        left join building_unit bu on a.unit_id = bu.unit_id and bu.status_cd = '0'
         where
         1=1
-        and bu.floor_id = a.floor_id
-        and t.status_cd = '0'
+        and a.status_cd = '0'
         and pf.payer_obj_type = '3333'
         and t.community_id= a.community_id
         and t.cur_month_time &lt; #{endDate}
@@ -395,8 +395,10 @@
         <if test="feeTypeCd != null and feeTypeCd != ''">
             and pf.fee_type_cd = #{feeTypeCd}
         </if>
-        group by t.obj_id) b
-        ) feeRoomCount, -- 收费户
+        group by bu.floor_id,t.obj_id
+        ) b
+        where b.floor_id = a.floor_id
+        ) feeRoomCount,
         (
         select ifnull(sum(t.received_amount),0.0) receivedFee
         from pay_fee_detail_month t
@@ -419,7 +421,7 @@
         <if test="feeTypeCd != null and feeTypeCd != ''">
             and pf.fee_type_cd = #{feeTypeCd}
         </if>
-        ) receivedFee, -- 实收
+        ) receivedFee,
         (
         select ifnull(sum(t.received_amount),0.0) preReceivedFee
         from pay_fee_detail_month t
@@ -443,7 +445,7 @@
         <if test="feeTypeCd != null and feeTypeCd != ''">
             and pf.fee_type_cd = #{feeTypeCd}
         </if>
-        ) preReceivedFee, -- 预收
+        ) preReceivedFee,
         (
         select ifnull(sum(t.receivable_amount - t.received_amount - t.discount_amount),0.0) hisOweFee
         from pay_fee_detail_month t
@@ -465,7 +467,7 @@
         <if test="feeTypeCd != null and feeTypeCd != ''">
             and pf.fee_type_cd = #{feeTypeCd}
         </if>
-        ) hisOweFee, -- 历史欠费
+        ) hisOweFee,
         (
         select ifnull(sum(t.receivable_amount),0.0) curReceivableFee
         from pay_fee_detail_month t
@@ -488,7 +490,7 @@
         <if test="feeTypeCd != null and feeTypeCd != ''">
             and pf.fee_type_cd = #{feeTypeCd}
         </if>
-        ) curReceivableFee -- 当期应收
+        ) curReceivableFee
         from f_floor a
         where 1=1
         and a.status_cd = '0'
@@ -500,20 +502,16 @@
         select a.name,
         (
         select count(1) from (
-        select t.obj_id from pay_fee_detail_month t
+        select pf.fee_type_cd,a.room_id
+        from building_room a
+        left join pay_fee_detail_month t on t.obj_id = a.room_id
         INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
-        <if test="floorId != null and floorId != ''">
-            LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
-            left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
-        </if>
+        left join building_unit bu on a.unit_id = bu.unit_id and bu.status_cd = '0'
         where
         1=1
-        <if test="floorId != null and floorId != ''">
-            and bu.floor_id = a.floor_id
-        </if>
-        and t.status_cd = '0'
+        and a.status_cd = '0'
         and pf.payer_obj_type = '3333'
-        and t.community_id=  #{communityId}
+        and t.community_id= a.community_id
         and t.cur_month_time &lt; #{endDate}
         and (t.receivable_amount - t.received_amount - t.discount_amount) > 0
         <if test="configIds !=null ">
@@ -522,26 +520,25 @@
                 #{item}
             </foreach>
         </if>
-        and pf.fee_type_cd = a.status_cd
-        group by t.obj_id) b
-        ) oweRoomCount,-- 欠费户
+        <if test="feeTypeCd != null and feeTypeCd != ''">
+            and pf.fee_type_cd = #{feeTypeCd}
+        </if>
+        group by pf.fee_type_cd,t.obj_id
+        ) b
+        where b.fee_type_cd = a.status_cd
+        ) oweRoomCount,
         (
         select count(1) from (
-        select t.obj_id
-        from pay_fee_detail_month t
+        select pf.fee_type_cd,a.room_id
+        from building_room a
+        left join pay_fee_detail_month t on t.obj_id = a.room_id
         INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
-        <if test="floorId != null and floorId != ''">
-            LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
-            left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
-        </if>
+        left join building_unit bu on a.unit_id = bu.unit_id and bu.status_cd = '0'
         where
         1=1
-        <if test="floorId != null and floorId != ''">
-            and bu.floor_id = a.floor_id
-        </if>
-        and t.status_cd = '0'
+        and a.status_cd = '0'
         and pf.payer_obj_type = '3333'
-        and t.community_id=  #{communityId}
+        and t.community_id= a.community_id
         and t.cur_month_time &lt; #{endDate}
         <if test="configIds !=null ">
             and t.config_id in
@@ -549,9 +546,13 @@
                 #{item}
             </foreach>
         </if>
-        and pf.fee_type_cd = a.status_cd
-        group by t.obj_id) b
-        ) feeRoomCount, -- 收费户
+        <if test="feeTypeCd != null and feeTypeCd != ''">
+            and pf.fee_type_cd = #{feeTypeCd}
+        </if>
+        group by pf.fee_type_cd,t.obj_id
+        ) b
+        where b.fee_type_cd = a.status_cd
+        ) feeRoomCount,
         (
         select ifnull(sum(t.received_amount),0.0) receivedFee
         from pay_fee_detail_month t
@@ -576,7 +577,7 @@
             </foreach>
         </if>
         and pf.fee_type_cd = a.status_cd
-        ) receivedFee, -- 实收
+        ) receivedFee,
         (
         select ifnull(sum(t.received_amount),0.0) preReceivedFee
         from pay_fee_detail_month t
@@ -602,7 +603,7 @@
             </foreach>
         </if>
         and pf.fee_type_cd = a.status_cd
-        ) preReceivedFee, -- 预收
+        ) preReceivedFee,
         (
         select ifnull(sum(t.receivable_amount - t.received_amount - t.discount_amount),0.0) hisOweFee
         from pay_fee_detail_month t
@@ -626,7 +627,7 @@
             </foreach>
         </if>
         and pf.fee_type_cd = a.status_cd
-        ) hisOweFee, -- 历史欠费
+        ) hisOweFee,
         (
         select ifnull(sum(t.receivable_amount),0.0) curReceivableFee
         from pay_fee_detail_month t
@@ -651,12 +652,97 @@
             </foreach>
         </if>
         and pf.fee_type_cd = a.status_cd
-        ) curReceivableFee -- 当期应收
+        ) curReceivableFee
         from t_dict a
         where 1=1
         and a.table_name = 'pay_fee_config'
         and a.table_columns = 'fee_type_cd'
     </select>
 
+    <select id="getObjFeeSummaryCount" parameterType="Map" resultType="Map">
+        select count(1) feeRoomCount
+        from
+        (
+        select a.obj_name objName,a.obj_id objId,a.owner_name ownerName,a.link
+        from pay_fee_detail_month a
+        where a.status_cd = '0'
+        and a.community_id = '2023013154290059'
+        group by a.obj_name,a.obj_id,a.owner_name,a.link
+        ) b
+    </select>
+
+    <select id="getObjFeeSummary" parameterType="Map" resultType="Map">
+        select a.obj_name objName,a.obj_id objId,a.owner_name ownerName,a.link,
+        (
+        select ifnull(sum(t.receivable_amount - t.received_amount - t.discount_amount),0.0) hisOweFee
+        from pay_fee_detail_month t
+        INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        where t.obj_id = a.obj_id
+        and t.status_cd = '0'
+        and t.community_id= a.community_id
+        and t.cur_month_time &lt; #{startDate}
+        ) hisOweFee,
+        (
+        select ifnull(sum(t.receivable_amount - t.received_amount - t.discount_amount),0.0) curOweFee
+        from pay_fee_detail_month t
+        INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        where t.obj_id = a.obj_id
+        and t.status_cd = '0'
+        and t.community_id= a.community_id
+        and t.cur_month_time &gt; #{startDate}
+        and t.cur_month_time &lt; #{endDate}
+        ) curOweFee,
+        (
+        select ifnull(sum(t.receivable_amount),0.0) curReceivableFee
+        from pay_fee_detail_month t
+        INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        where t.obj_id = a.obj_id
+        and t.status_cd = '0'
+        and t.community_id= a.community_id
+        and t.cur_month_time &gt; #{startDate}
+        and t.cur_month_time &lt; #{endDate}
+        ) curReceivableFee,
+        (
+        select ifnull(sum(t.received_amount),0.0) hisReceivedFee
+        from pay_fee_detail_month t
+        INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        where t.obj_id = a.obj_id
+        and t.status_cd = '0'
+        and t.community_id= a.community_id
+        and t.pay_fee_time &gt; #{startDate}
+        and t.pay_fee_time &lt; #{endDate}
+        and t.cur_month_time &lt; #{startDate}
+        ) hisReceivedFee,
+        (
+        select ifnull(sum(t.received_amount),0.0) preReceivedFee
+        from pay_fee_detail_month t
+        INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        where t.obj_id = a.obj_id
+        and t.status_cd = '0'
+        and t.community_id= a.community_id
+        and t.pay_fee_time &gt; #{startDate}
+        and t.pay_fee_time &lt; #{endDate}
+        and t.cur_month_time &gt; #{endDate}
+        ) preReceivedFee,
+        (
+        select ifnull(sum(t.received_amount),0.0) receivedFee
+        from pay_fee_detail_month t
+        INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        where t.obj_id = a.obj_id
+        and t.status_cd = '0'
+        and t.community_id= a.community_id
+        and t.pay_fee_time &gt; #{startDate}
+        and t.pay_fee_time &lt; #{endDate}
+        ) receivedFee
+        from pay_fee_detail_month a
+        where a.status_cd = '0'
+        and a.community_id = #{communityId}
+        group by a.obj_name,a.obj_id,a.owner_name,a.link
+        order by  a.obj_name
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+    </select>
+
 
 </mapper>

+ 6 - 0
java110-interface/src/main/java/com/java110/intf/report/IReportFeeStatisticsInnerServiceSMO.java

@@ -97,4 +97,10 @@ public interface IReportFeeStatisticsInnerServiceSMO {
      */
     @RequestMapping(value = "/getConfigFeeSummary", method = RequestMethod.POST)
     List<Map> getConfigFeeSummary(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
+    @RequestMapping(value = "/getObjFeeSummaryCount", method = RequestMethod.POST)
+    int getObjFeeSummaryCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
+    @RequestMapping(value = "/getObjFeeSummary", method = RequestMethod.POST)
+    List<Map> getObjFeeSummary(@RequestBody QueryStatisticsDto queryStatisticsDto);
 }

+ 8 - 2
service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java

@@ -125,6 +125,7 @@ public class PayFeeMonthImpl implements IPayFeeMonth {
         //todo 生成 月离散数据
         PayFeeDetailMonthPo tmpPayFeeDetailMonthPo;
         List<PayFeeDetailMonthPo> payFeeDetailMonthPos = new ArrayList<>();
+        double receivableAmount = 0.0;
         for (int month = 0; month < maxMonth; month++) {
             Calendar calendar = Calendar.getInstance();
             calendar.setTime(startTime);
@@ -136,7 +137,12 @@ public class PayFeeMonthImpl implements IPayFeeMonth {
             tmpPayFeeDetailMonthPo.setDetailId(payFeeMonthHelp.getFeeDetailId(feeDetailDtos, calendar.getTime()));
             tmpPayFeeDetailMonthPo.setDetailYear(calendar.get(Calendar.YEAR) + "");
             tmpPayFeeDetailMonthPo.setDetailMonth((calendar.get(Calendar.MONTH) + 1) + "");
-            tmpPayFeeDetailMonthPo.setReceivableAmount(payFeeMonthHelp.getReceivableAmount(feeDetailDtos, feePrice, calendar.getTime(), feeDto) + "");
+            receivableAmount = payFeeMonthHelp.getReceivableAmount(feeDetailDtos, feePrice, calendar.getTime(), feeDto);
+            //todo 应收小于等于0 不统计
+            if(receivableAmount <=0){
+                continue;
+            }
+            tmpPayFeeDetailMonthPo.setReceivableAmount( receivableAmount + "");
             tmpPayFeeDetailMonthPo.setReceivedAmount(payFeeMonthHelp.getReceivedAmount(feeDetailDtos, feePrice, calendar.getTime(), feeDto) + "");
             tmpPayFeeDetailMonthPo.setDiscountAmount(
                     payFeeMonthHelp.getDiscountAmount(Double.parseDouble(tmpPayFeeDetailMonthPo.getReceivableAmount()),
@@ -185,7 +191,7 @@ public class PayFeeMonthImpl implements IPayFeeMonth {
 
         //todo  每次按200条处理
         for (int pageIndex = 0; pageIndex < page; pageIndex++) {
-            feeDto.setPage(pageIndex * max + 1);
+            feeDto.setPage(pageIndex + 1);
             feeDto.setRow(max);
             List<FeeDto> tmpFeeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);
             // 离散费用

+ 2 - 1
service-job/src/main/java/com/java110/job/task/fee/CorrectionDataTemplate.java

@@ -139,7 +139,8 @@ public class CorrectionDataTemplate extends TaskSystemQuartz {
         //先查询总数
         int count = feeInnerServiceSMOImpl.queryFeesCount(feeDto);
 
-        double record = Math.ceil(count / DEFAULT_ROW);
+       // double record = Math.ceil(count / DEFAULT_ROW);
+        int record = (int) Math.ceil((double) count / (double) DEFAULT_ROW);
 
         for (int page = 1; page <= record; page++) {
             try {

+ 3 - 0
service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryCmd.java

@@ -79,6 +79,9 @@ public class QueryReportFeeSummaryCmd extends Cmd {
         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"));
+
         if(reqJson.containsKey("configIds")){
             queryStatisticsDto.setConfigIds(reqJson.getString("configIds").split(","));
         }

+ 29 - 18
service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeSummaryDetailCmd.java

@@ -6,9 +6,11 @@ import com.java110.core.context.ICmdDataFlowContext;
 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 org.springframework.http.ResponseEntity;
 
 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);
 

+ 14 - 0
service-report/src/main/java/com/java110/report/dao/IReportFeeStatisticsServiceDao.java

@@ -81,4 +81,18 @@ public interface IReportFeeStatisticsServiceDao {
      * @return
      */
     List<Map> getConfigFeeSummary(Map info);
+
+    /**
+     * 查询费用明细表(总数)
+     * @param info
+     * @return
+     */
+    int getObjFeeSummaryCount(Map info);
+
+    /**
+     * 查询费用明细表
+     * @param info
+     * @return
+     */
+    List<Map> getObjFeeSummary(Map info);
 }

+ 23 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeStatisticsServiceDaoImpl.java

@@ -167,5 +167,28 @@ public class ReportFeeStatisticsServiceDaoImpl extends BaseServiceDao implements
         return infos;
     }
 
+    @Override
+    public int getObjFeeSummaryCount(Map info) {
+        logger.debug("查询 收费户数 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportFeeStatisticsServiceDaoImpl.getObjFeeSummaryCount", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(infos.get(0).get("total").toString());
+    }
+
+    @Override
+    public List<Map> getObjFeeSummary(Map info) {
+        logger.debug("查询 费用项收费率 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportFeeStatisticsServiceDaoImpl.getObjFeeSummary", info);
+
+
+        return infos;
+    }
+
 
 }

+ 23 - 2
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeStatisticsInnerServiceSMOImpl.java

@@ -2,6 +2,7 @@ package com.java110.report.smo.impl;
 
 
 import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
 import com.java110.dto.report.QueryStatisticsDto;
 import com.java110.intf.report.IReportFeeStatisticsInnerServiceSMO;
 import com.java110.report.dao.IReportFeeStatisticsServiceDao;
@@ -106,7 +107,7 @@ public class ReportFeeStatisticsInnerServiceSMOImpl extends BaseServiceSMO imple
      * @return
      */
     @Override
-    public List<Map> getFloorFeeSummary(QueryStatisticsDto queryStatisticsDto) {
+    public List<Map> getFloorFeeSummary(@RequestBody QueryStatisticsDto queryStatisticsDto) {
 
         List<Map> info = reportFeeStatisticsServiceDaoImpl.getFloorFeeSummary(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
         return info;
@@ -119,9 +120,29 @@ public class ReportFeeStatisticsInnerServiceSMOImpl extends BaseServiceSMO imple
      * @return
      */
     @Override
-    public List<Map> getConfigFeeSummary(QueryStatisticsDto queryStatisticsDto) {
+    public List<Map> getConfigFeeSummary(@RequestBody QueryStatisticsDto queryStatisticsDto) {
 
         List<Map> info = reportFeeStatisticsServiceDaoImpl.getConfigFeeSummary(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
         return info;
     }
+
+    @Override
+    public int getObjFeeSummaryCount(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        int info = reportFeeStatisticsServiceDaoImpl.getObjFeeSummaryCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
+
+    @Override
+    public List<Map> getObjFeeSummary(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        //校验是否传了 分页信息
+
+        int page = queryStatisticsDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            queryStatisticsDto.setPage((page - 1) * queryStatisticsDto.getRow());
+        }
+
+        List<Map> info = reportFeeStatisticsServiceDaoImpl.getObjFeeSummary(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
 }

+ 14 - 0
service-report/src/main/java/com/java110/report/statistics/IFeeStatistics.java

@@ -81,4 +81,18 @@ public interface IFeeStatistics {
      * @return
      */
     List<Map> getConfigFeeSummary(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 查询对象明细表(数量)
+     * @param queryStatisticsDto
+     * @return
+     */
+    int getObjFeeSummaryCount(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 查询对象明细表
+     * @param queryStatisticsDto
+     * @return
+     */
+    List<Map> getObjFeeSummary(QueryStatisticsDto queryStatisticsDto);
 }

+ 10 - 0
service-report/src/main/java/com/java110/report/statistics/impl/FeeStatisticsImpl.java

@@ -113,4 +113,14 @@ public class FeeStatisticsImpl implements IFeeStatistics {
         return reportFeeStatisticsInnerServiceSMOImpl.getConfigFeeSummary(queryStatisticsDto);
     }
 
+    @Override
+    public int getObjFeeSummaryCount(QueryStatisticsDto queryStatisticsDto) {
+        return reportFeeStatisticsInnerServiceSMOImpl.getObjFeeSummaryCount(queryStatisticsDto);
+    }
+
+    @Override
+    public List<Map> getObjFeeSummary(QueryStatisticsDto queryStatisticsDto) {
+        return reportFeeStatisticsInnerServiceSMOImpl.getObjFeeSummary(queryStatisticsDto);
+    }
+
 }

+ 3 - 3
springboot/src/main/java/com/java110/boot/BootApplicationStart.java

@@ -159,9 +159,9 @@ public class BootApplicationStart {
 
         //设置超时时间
         HttpComponentsClientHttpRequestFactory httpRequestFactory = new HttpComponentsClientHttpRequestFactory();
-        httpRequestFactory.setConnectionRequestTimeout(5000);
-        httpRequestFactory.setConnectTimeout(5000);
-        httpRequestFactory.setReadTimeout(5000);
+        httpRequestFactory.setConnectionRequestTimeout(10000);
+        httpRequestFactory.setConnectTimeout(10000);
+        httpRequestFactory.setReadTimeout(10000);
         restTemplate.setRequestFactory(httpRequestFactory);
         return restTemplate;
     }