java110 пре 3 година
родитељ
комит
e1bc1834cb

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

@@ -2270,30 +2270,38 @@
     </select>
 
     <select id="getReceivableInformation" parameterType="Map" resultType="Map">
-        select a.receivableAmount,a.receivedAmount, IF(a.receivableAmount &lt; a.receivedAmount,'0',a.receivableAmount-a.receivedAmount) oweAmount
+        select a.receivableAmount,a.receivedAmount, IF(a.receivableAmount &lt;
+        a.receivedAmount,'0',a.receivableAmount-a.receivedAmount) oweAmount
         from (
         select sum(t.his_owe_amount+t.cur_receivable_amount)
         receivableAmount,sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount
         from report_fee_month_statistics t
         inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
         where 1=1
-            and t.fee_year= #{feeYear}
-            and t.fee_month= #{feeMonth}
+        and t.fee_year= #{feeYear}
+        and t.fee_month= #{feeMonth}
         and t.community_id = #{communityId}
         ) a
     </select>
 
     <select id="getFloorReceivableInformation" parameterType="Map" resultType="Map">
-        select f.floor_num floorNum,f.`name`,sum(t.receivable_amount) receivableAmount,SUM(t.received_amount)
-        receivedAmount,SUM(t.owe_amount) oweAmount
+        select a.floorNum,a.`name`,a.receivableAmount,a.receivedAmount, IF(a.receivableAmount &lt;
+        a.receivedAmount,'0',a.receivableAmount-a.receivedAmount) oweAmount
+        from (
+        select f.floor_num floorNum,f.`name`,sum(t.his_owe_amount+t.cur_receivable_amount)
+        receivableAmount,sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount
         from report_fee_month_statistics t
         inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
         inner join building_room br on br.room_id = t.obj_id and t.obj_type = '3333' and br.community_id =
         t.community_id and br.status_cd = '0'
         inner join building_unit bu on bu.unit_id = br.unit_id and bu.status_cd = '0'
         inner join f_floor f on f.floor_id = bu.floor_id and f.status_cd = '0'
-        where t.community_id = #{communityId}
+        where 1=1
+        and t.fee_year= #{feeYear}
+        and t.fee_month= #{feeMonth}
+        and t.community_id = #{communityId}
         group by f.floor_num ,f.`name`
+        ) a
     </select>
 
     <select id="getFeeConfigReceivableInformation" parameterType="Map" resultType="Map">
@@ -3000,7 +3008,7 @@
 
     <!--清理报表 无效数据-->
     <update id="deleteInvalidFee" parameterType="Map">
-        delete from report_fee_month_statistics where fee_id  in
+        delete from report_fee_month_statistics where fee_id in
         <foreach collection="feeIds" item="item" open="(" close=")" separator=",">
             #{item}
         </foreach>

+ 0 - 16
service-report/src/main/java/com/java110/report/api/ReportFeeMonthStatisticsApi.java

@@ -553,22 +553,6 @@ public class ReportFeeMonthStatisticsApi {
         return getReportFeeMonthStatisticsBMOImpl.queryOwePaymentCount(reportFeeMonthStatisticsDto);
     }
 
-
-    /**
-     * 查询费用分项表
-     *
-     * @param communityId 小区ID
-     * @return
-     * @serviceCode /reportFeeMonthStatistics/queryReportProficient
-     * @path /app/reportFeeMonthStatistics/queryReportProficient
-     */
-    @RequestMapping(value = "/queryReportProficient", method = RequestMethod.GET)
-    public ResponseEntity<String> queryReportProficient(@RequestParam(value = "communityId") String communityId) {
-        ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = new ReportFeeMonthStatisticsDto();
-        reportFeeMonthStatisticsDto.setCommunityId(communityId);
-        return getReportFeeMonthStatisticsBMOImpl.queryReportProficientCount(reportFeeMonthStatisticsDto);
-    }
-
     /**
      * 查询未收费房屋
      * select t.* from building_room t

+ 46 - 0
service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportProficientCmd.java

@@ -0,0 +1,46 @@
+package com.java110.report.cmd.reportFeeMonthStatistics;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto;
+import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 查询报表专家 图
+ */
+@Java110Cmd(serviceCode = "/reportFeeMonthStatistics/queryReportProficient")
+public class QueryReportProficientCmd extends Cmd {
+
+    @Autowired
+    private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        Assert.hasKeyAndValue(reqJson,"communityId","未包含小区");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = new ReportFeeMonthStatisticsDto();
+        reportFeeMonthStatisticsDto.setCommunityId(reqJson.getString("communityId"));
+
+        reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear()+"");
+        reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth()+"");
+        JSONObject result = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportProficientCount(reportFeeMonthStatisticsDto);
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(result.toString(), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}