java110 лет назад: 2
Родитель
Сommit
9005d833c8

+ 27 - 0
java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml

@@ -55,6 +55,33 @@
         and t.cur_month_time < #{endDate}
     </select>
 
+
+    <!-- 查询当月应收 -->
+    <select id="getCurReceivableFee" parameterType="Map" resultType="Map">
+        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'
+        <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>
+        where
+        1=1
+        <if test="floorId != null and floorId != ''">
+            and bu.floor_id = #{floorId}
+        </if>
+        <if test="configId != null and configId != ''">
+            and t.config_id = #{configId}
+        </if>
+        <if test="objName != null and objName != ''">
+            and t.obj_name like concat('%',#{objName},'%')
+        </if>
+        and t.status_cd = '0'
+        and t.community_id= #{communityId}
+        and t.cur_month_time &gt; #{startDate}
+        and t.cur_month_time &lt; #{endDate}
+    </select>
+
     <!-- 查询欠费追回 -->
     <select id="getHisReceivedFee" parameterType="Map" resultType="Map">
         select ifnull(sum(t.received_amount),0.0) hisReceivedFee

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

@@ -42,6 +42,15 @@ public interface IReportFeeStatisticsInnerServiceSMO {
     @RequestMapping(value = "/getCurMonthOweFee", method = RequestMethod.POST)
     double getCurMonthOweFee(@RequestBody QueryStatisticsDto queryFeeStatisticsDto);
 
+
+    /**
+     * 查询当月应收
+     * @param queryStatisticsDto
+     * @return
+     */
+    @RequestMapping(value = "/getCurMonthOweFee", method = RequestMethod.POST)
+    double getCurReceivableFee(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
     @RequestMapping(value = "/getHisReceivedFee", method = RequestMethod.POST)
     double getHisReceivedFee(@RequestBody QueryStatisticsDto queryFeeStatisticsDto);
 
@@ -58,4 +67,5 @@ public interface IReportFeeStatisticsInnerServiceSMO {
      */
     @RequestMapping(value = "/getOweRoomCount", method = RequestMethod.POST)
     int getOweRoomCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
 }

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

@@ -85,6 +85,9 @@ public class QueryReportFeeSummaryCmd extends Cmd {
         //todo 查询 单月欠费
         double curOweFee = feeStatisticsImpl.getCurMonthOweFee(queryStatisticsDto);
 
+        //todo 查询当月应收
+        double curReceivableFee = feeStatisticsImpl.getCurReceivableFee(queryStatisticsDto);
+
         //todo 查询 欠费追回
         double hisReceivedFee = feeStatisticsImpl.getHisReceivedFee(queryStatisticsDto);
 
@@ -112,6 +115,8 @@ public class QueryReportFeeSummaryCmd extends Cmd {
         data.put("roomCount", roomCount);
         data.put("freeRoomCount", freeRoomCount);
         data.put("oweRoomCount", oweRoomCount);
+        data.put("curReceivableFee", curReceivableFee);
+
         JSONArray datas = new JSONArray();
         datas.add(data);
         context.setResponseEntity(ResultVo.createResponseEntity(datas));

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

@@ -52,4 +52,11 @@ public interface IReportFeeStatisticsServiceDao {
      * @return
      */
     int getOweRoomCount(Map info);
+
+    /**
+     * 查询当月应收费用
+     * @param info
+     * @return
+     */
+    double getCurReceivableFee(Map info);
 }

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

@@ -52,6 +52,19 @@ public class ReportFeeStatisticsServiceDaoImpl extends BaseServiceDao implements
         return Double.parseDouble(infos.get(0).get("curOweFee").toString());
     }
 
+    @Override
+    public double getCurReceivableFee(Map info) {
+        logger.debug("查询单月欠费 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportFeeStatisticsServiceDaoImpl.getCurReceivableFee", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Double.parseDouble(infos.get(0).get("curReceivableFee").toString());
+    }
+
     /**
      * 查询欠费追回
      * @param info
@@ -119,4 +132,6 @@ public class ReportFeeStatisticsServiceDaoImpl extends BaseServiceDao implements
         return Integer.parseInt(infos.get(0).get("oweRoomCount").toString());
     }
 
+
+
 }

+ 11 - 0
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeStatisticsInnerServiceSMOImpl.java

@@ -44,6 +44,17 @@ public class ReportFeeStatisticsInnerServiceSMOImpl extends BaseServiceSMO imple
         return info;
     }
 
+    /**
+     * 查询当月应收
+     * @param queryStatisticsDto
+     * @return
+     */
+    @Override
+    public double getCurReceivableFee(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        double info = reportFeeStatisticsServiceDaoImpl.getCurReceivableFee(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
+
     @Override
     public double getHisReceivedFee(@RequestBody QueryStatisticsDto queryFeeStatisticsDto) {
         double info = reportFeeStatisticsServiceDaoImpl.getHisReceivedFee(BeanConvertUtil.beanCovertMap(queryFeeStatisticsDto));

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

@@ -55,4 +55,6 @@ public interface IFeeStatistics {
      * @return
      */
     int getOweRoomCount(QueryStatisticsDto queryStatisticsDto);
+
+    double getCurReceivableFee(QueryStatisticsDto queryStatisticsDto);
 }

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

@@ -37,6 +37,17 @@ public class FeeStatisticsImpl implements IFeeStatistics {
     }
 
 
+    /**
+     * 查询当月应收
+     * @param queryStatisticsDto
+     * @return
+     */
+    @Override
+    public double getCurReceivableFee(QueryStatisticsDto queryStatisticsDto) {
+        return reportFeeStatisticsInnerServiceSMOImpl.getCurReceivableFee(queryStatisticsDto);
+    }
+
+
     /**
      * 查询 欠费追回
      * @param queryFeeStatisticsDto
@@ -71,4 +82,5 @@ public class FeeStatisticsImpl implements IFeeStatistics {
     public int getOweRoomCount(QueryStatisticsDto queryStatisticsDto) {
         return reportFeeStatisticsInnerServiceSMOImpl.getOweRoomCount(queryStatisticsDto);
     }
+
 }