java110 пре 5 година
родитељ
комит
288e72b8bc

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

@@ -1538,4 +1538,28 @@
         </if>
     </select>
 
+    <select id="getReceivableInformation" parameterType="Map" resultType="Map">
+        select sum(t.receivable_amount) receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount)
+        oweAmount
+        from report_fee_month_statistics t
+        where t.community_id = #{communityId}
+    </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
+        from report_fee_month_statistics t
+        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}
+        group by f.floor_num ,f.`name`
+    </select>
+
+    <select id="getFeeConfigReceivableInformation" parameterType="Map" resultType="Map">
+        select t.fee_name feeName,sum(t.receivable_amount) receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
+        from report_fee_month_statistics t
+        where t.community_id =  #{communityId}
+        group by t.fee_name
+    </select>
+
 </mapper>

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

@@ -261,6 +261,8 @@ public interface IReportFeeMonthStatisticsInnerServiceSMO {
     @RequestMapping(value = "/queryAllPaymentCount", method = RequestMethod.POST)
     List<ReportFeeMonthStatisticsDto> queryAllPaymentCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
 
+    @RequestMapping(value = "/queryReportProficientCount", method = RequestMethod.POST)
+    JSONObject queryReportProficientCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
     /**
      * <p>查询小区楼信息</p>
      *

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

@@ -492,4 +492,20 @@ public class ReportFeeMonthStatisticsApi {
         return getReportFeeMonthStatisticsBMOImpl.queryOwePaymentCount(reportFeeMonthStatisticsDto);
     }
 
+
+    /**
+     * 查询费用分项表
+     *
+     * @param communityId 小区ID
+     * @return
+     * @serviceCode /reportFeeMonthStatistics/queryReportProficientCount
+     * @path /app/reportFeeMonthStatistics/queryReportProficientCount
+     */
+    @RequestMapping(value = "/queryReportProficientCount", method = RequestMethod.GET)
+    public ResponseEntity<String> queryReportProficientCount(@RequestParam(value = "communityId") String communityId) {
+        ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = new ReportFeeMonthStatisticsDto();
+        reportFeeMonthStatisticsDto.setCommunityId(communityId);
+        return getReportFeeMonthStatisticsBMOImpl.queryReportProficientCount(reportFeeMonthStatisticsDto);
+    }
+
 }

+ 7 - 0
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/IGetReportFeeMonthStatisticsBMO.java

@@ -46,6 +46,13 @@ public interface IGetReportFeeMonthStatisticsBMO {
 
     ResponseEntity<String> queryOwePaymentCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
 
+    /**
+     * 查询报表专家
+     * @param reportFeeMonthStatisticsDto
+     * @return
+     */
+    ResponseEntity<String> queryReportProficientCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
+
     /**
      * 查询报修信息
      *

+ 13 - 0
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java

@@ -459,6 +459,19 @@ public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthSta
         return responseEntity;
     }
 
+    /**
+     * 查询报表专家 统计信息
+     * @param reportFeeMonthStatisticsDto
+     * @return
+     */
+    @Override
+    public ResponseEntity<String> queryReportProficientCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
+        JSONObject result = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportProficientCount(reportFeeMonthStatisticsDto);
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(result.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
     /**
      * 查询报修信息
      *

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

@@ -273,4 +273,25 @@ public interface IReportFeeMonthStatisticsServiceDao {
      * @return
      */
     List<Map> getRepairStaff(Map info);
+
+    /**
+     * 计算应收 信息
+     * @param beanCovertMap
+     * @return
+     */
+    Map getReceivableInformation(Map beanCovertMap);
+
+    /**
+     * 计算应收 信息
+     * @param beanCovertMap
+     * @return
+     */
+    List<Map> getFloorReceivableInformation(Map beanCovertMap);
+
+    /**
+     * 计算应收 信息
+     * @param beanCovertMap
+     * @return
+     */
+    List<Map> getFeeConfigReceivableInformation(Map beanCovertMap);
 }

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

@@ -380,4 +380,27 @@ public class ReportFeeMonthStatisticsServiceDaoImpl extends BaseServiceDao imple
         return businessRepairUserInfos;
     }
 
+    @Override
+    public Map getReceivableInformation(Map beanCovertMap) {
+        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.getReceivableInformation", beanCovertMap);
+        if (businessReportFeeMonthStatisticsInfos.size() < 1) {
+            return null;
+        }
+
+        return businessReportFeeMonthStatisticsInfos.get(0);
+    }
+
+    @Override
+    public List<Map> getFloorReceivableInformation(Map beanCovertMap) {
+        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.getFloorReceivableInformation", beanCovertMap);
+        return businessReportFeeMonthStatisticsInfos;
+    }
+
+    @Override
+    public List<Map> getFeeConfigReceivableInformation(Map beanCovertMap) {
+        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.getFeeConfigReceivableInformation", beanCovertMap);
+        return businessReportFeeMonthStatisticsInfos;
+    }
+
+
 }

+ 12 - 10
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java

@@ -238,10 +238,10 @@ public class GeneratorFeeMonthStatisticsInnerServiceSMOImpl implements IGenerato
 
         Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate");
         tmpReportFeeDto.setDeadlineTime(targetEndDate);
-        double receivableAmount = getReceivableAmountByCar(tmpReportFeeDto, null, tmpReportCarDto); //应收
+        double oweAmount = getOweAmountByCar(tmpReportFeeDto, null, tmpReportCarDto); //应收
 
         dealBeforeUploadCarFee(tmpReportFeeDto, tmpReportCarDto);
-        double oweAmount = getOweAmount(tmpReportFeeDto, receivableAmount, receivedAmount); //欠费
+        double receivableAmount = getReceivableAmount(tmpReportFeeDto,receivedAmount); //欠费
 
 
         ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
@@ -418,12 +418,12 @@ public class GeneratorFeeMonthStatisticsInnerServiceSMOImpl implements IGenerato
 
         Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate");
         tmpReportFeeDto.setDeadlineTime(targetEndDate);
-        double receivableAmount = getReceivableAmount(tmpReportFeeDto, reportRoomDto, null); //应收
+        double oweAmount = getOweAmount(tmpReportFeeDto, reportRoomDto, null); //欠费
 
+        double receivableAmount = getReceivableAmount(tmpReportFeeDto, receivedAmount); //应收
         //解决上线时 之前欠费没有刷入导致费用金额对不上问题处理
         dealBeforeUploadRoomFee(reportRoomDto, tmpReportFeeDto, receivableAmount);
 
-        double oweAmount = getOweAmount(tmpReportFeeDto, receivableAmount, receivedAmount); //欠费
 
 
         ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
@@ -567,14 +567,16 @@ public class GeneratorFeeMonthStatisticsInnerServiceSMOImpl implements IGenerato
      * 当月欠费
      *
      * @param tmpReportFeeDto
-     * @param receivableAmount
      * @param receivedAmount
      * @return
      */
-    private double getOweAmount(ReportFeeDto tmpReportFeeDto, double receivableAmount, double receivedAmount) {
+    private double getReceivableAmount(ReportFeeDto tmpReportFeeDto, double receivedAmount) {
 
-
-        return receivableAmount;
+        //一次性费用 除以月份 平均
+        if (FeeDto.FEE_FLAG_ONCE.equals(tmpReportFeeDto.getFeeFlag())) {
+            return computeOnceFee(tmpReportFeeDto);
+        }
+        return tmpReportFeeDto.getFeePrice();
 
     }
 
@@ -600,7 +602,7 @@ public class GeneratorFeeMonthStatisticsInnerServiceSMOImpl implements IGenerato
      * @param tmpReportFeeDto
      * @return
      */
-    private double getReceivableAmountByCar(ReportFeeDto tmpReportFeeDto, ReportRoomDto reportRoomDto, ReportCarDto reportCarDto) {
+    private double getOweAmountByCar(ReportFeeDto tmpReportFeeDto, ReportRoomDto reportRoomDto, ReportCarDto reportCarDto) {
 
         double feePrice = computeFeeSMOImpl.getReportFeePrice(tmpReportFeeDto, reportRoomDto, reportCarDto);
         tmpReportFeeDto.setFeePrice(feePrice);
@@ -668,7 +670,7 @@ public class GeneratorFeeMonthStatisticsInnerServiceSMOImpl implements IGenerato
      * @param tmpReportFeeDto
      * @return
      */
-    private double getReceivableAmount(ReportFeeDto tmpReportFeeDto, ReportRoomDto reportRoomDto, ReportCarDto reportCarDto) {
+    private double getOweAmount(ReportFeeDto tmpReportFeeDto, ReportRoomDto reportRoomDto, ReportCarDto reportCarDto) {
 
         double feePrice = computeFeeSMOImpl.getReportFeePrice(tmpReportFeeDto, reportRoomDto, reportCarDto);
         tmpReportFeeDto.setFeePrice(feePrice);

+ 35 - 0
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.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.dto.PageDto;
@@ -11,10 +12,12 @@ import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO;
 import com.java110.po.reportFeeMonthStatistics.ReportFeeMonthStatisticsPo;
 import com.java110.report.dao.IReportFeeMonthStatisticsServiceDao;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Calendar;
 import java.util.List;
 import java.util.Map;
 
@@ -295,6 +298,38 @@ public class ReportFeeMonthStatisticsInnerServiceSMOImpl extends BaseServiceSMO
         return reportFeeMonthStatisticss;
     }
 
+    @Override
+    public JSONObject queryReportProficientCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
+
+        JSONObject result = new JSONObject();
+        Map info = reportFeeMonthStatisticsServiceDaoImpl.getReceivableInformation(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
+        result.put("receivableInformation", info);
+
+        List<Map> infos = reportFeeMonthStatisticsServiceDaoImpl.getFloorReceivableInformation(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
+        result.put("floorReceivableInformations", JSONArray.parseArray(JSONArray.toJSONString(infos)));
+
+        List<Map> tempInfos = reportFeeMonthStatisticsServiceDaoImpl.getFeeConfigReceivableInformation(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
+        result.put("feeConfigReceivableInformations", JSONArray.parseArray(JSONArray.toJSONString(tempInfos)));
+
+
+        reportFeeMonthStatisticsDto.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
+        Calendar calendar = Calendar.getInstance();
+        calendar.add(Calendar.DAY_OF_MONTH, 7);
+        reportFeeMonthStatisticsDto.setEndTime(DateUtil.getFormatTimeString(calendar.getTime(), DateUtil.DATE_FORMATE_STRING_A));
+
+        int deadlineFeeCount = reportFeeMonthStatisticsServiceDaoImpl.queryDeadlineFeeCount(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
+        int  prePaymentCount = reportFeeMonthStatisticsServiceDaoImpl.queryPrePaymentNewCount(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
+
+
+        JSONObject remindInfomation = new JSONObject();
+        remindInfomation.put("deadlineFeeCount", deadlineFeeCount);
+        remindInfomation.put("prePaymentCount", prePaymentCount);
+
+        result.put("remindInfomation", remindInfomation);
+
+        return result;
+    }
+
     @Override
     public List<FeeConfigDto> queryFeeConfigs(FeeConfigDto feeConfigDto) {
         List<FeeConfigDto> feeConfigs = BeanConvertUtil.covertBeanList(reportFeeMonthStatisticsServiceDaoImpl.getFeeConfigInfo(BeanConvertUtil.beanCovertMap(feeConfigDto)), FeeConfigDto.class);