java110 пре 5 година
родитељ
комит
0905112bb7

+ 21 - 0
java110-bean/src/main/java/com/java110/dto/report/ReportCarDto.java

@@ -3,6 +3,7 @@ package com.java110.dto.report;
 import com.java110.dto.PageDto;
 
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * @ClassName ReportRoomDto
@@ -32,6 +33,10 @@ public class ReportCarDto extends PageDto implements Serializable {
     private String areaNum;
     private String communityId;
 
+    private Date startTime;
+
+    private Date endTime;
+
 
     public String getCarId() {
         return carId;
@@ -168,4 +173,20 @@ public class ReportCarDto extends PageDto implements Serializable {
     public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
 }

+ 2 - 0
java110-bean/src/main/java/com/java110/dto/report/ReportFeeDto.java

@@ -91,6 +91,8 @@ public class ReportFeeDto extends PageDto implements Serializable {
     private String storeTypeCd;
 
 
+
+
     public String getAmount() {
         return amount;
     }

+ 12 - 0
java110-bean/src/main/java/com/java110/dto/reportFeeMonthStatistics/ReportFeeMonthStatisticsDto.java

@@ -50,6 +50,8 @@ public class ReportFeeMonthStatisticsDto extends PageDto implements Serializable
     private String statusCd = "0";
 
     private int oweDay;
+    private String deadlineTime;
+
 
 
 
@@ -293,4 +295,14 @@ public class ReportFeeMonthStatisticsDto extends PageDto implements Serializable
     public void setPayerObjType(String payerObjType) {
         this.payerObjType = payerObjType;
     }
+
+    public String getDeadlineTime() {
+        return deadlineTime;
+    }
+
+    public void setDeadlineTime(String deadlineTime) {
+        this.deadlineTime = deadlineTime;
+    }
+
+
 }

+ 7 - 0
java110-bean/src/main/java/com/java110/po/reportFeeMonthStatistics/ReportFeeMonthStatisticsPo.java

@@ -21,6 +21,7 @@ public class ReportFeeMonthStatisticsPo implements Serializable {
     private String communityId;
     private String feeCreateTime;
     private String objType;
+    private String deadlineTime;
 
     public String getReceivableAmount() {
         return receivableAmount;
@@ -158,5 +159,11 @@ public class ReportFeeMonthStatisticsPo implements Serializable {
         this.objType = objType;
     }
 
+    public String getDeadlineTime() {
+        return deadlineTime;
+    }
 
+    public void setDeadlineTime(String deadlineTime) {
+        this.deadlineTime = deadlineTime;
+    }
 }

+ 3 - 0
java110-core/src/main/java/com/java110/core/smo/IComputeFeeSMO.java

@@ -1,6 +1,7 @@
 package com.java110.core.smo;
 
 import com.java110.dto.fee.FeeDto;
+import com.java110.dto.owner.OwnerCarDto;
 import com.java110.dto.report.ReportCarDto;
 import com.java110.dto.report.ReportFeeDto;
 import com.java110.dto.report.ReportRoomDto;
@@ -92,6 +93,8 @@ public interface IComputeFeeSMO {
      */
     double getCycle();
 
+    public Map getTargetEndDateAndOweMonth(FeeDto feeDto, OwnerCarDto ownerCarDto);
+
     /**
      * 获取目标结束时间和欠费月份
      *

+ 14 - 10
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java

@@ -649,8 +649,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
         return feePrice.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
     }
 
-
-    public Map getTargetEndDateAndOweMonth(FeeDto feeDto) {
+    public Map getTargetEndDateAndOweMonth(FeeDto feeDto, OwnerCarDto ownerCarDto) {
         Date targetEndDate = null;
         double oweMonth = 0.0;
 
@@ -681,18 +680,12 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             //到期时间
             Date endDate = feeDto.getEndTime();
             if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {
-                OwnerCarDto ownerCarDto = new OwnerCarDto();
-                ownerCarDto.setCommunityId(feeDto.getCommunityId());
-                ownerCarDto.setCarId(feeDto.getPayerObjId());
-                List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
-
-                if (ownerCarDtos == null || ownerCarDtos.size() != 1) {
+                if (ownerCarDto == null) {
                     targetEndDateAndOweMonth.put("oweMonth", 0);
                     targetEndDateAndOweMonth.put("targetEndDate", "");
                     return targetEndDateAndOweMonth;
                 }
-
-                targetEndDate = ownerCarDtos.get(0).getEndTime();
+                targetEndDate = ownerCarDto.getEndTime();
                 //说明没有欠费
                 if (endDate.getTime() >= targetEndDate.getTime()) {
                     // 目标到期时间 - 到期时间 = 欠费月份
@@ -738,6 +731,17 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
         return targetEndDateAndOweMonth;
     }
 
+    public Map getTargetEndDateAndOweMonth(FeeDto feeDto) {
+        if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {
+            OwnerCarDto ownerCarDto = new OwnerCarDto();
+            ownerCarDto.setCommunityId(feeDto.getCommunityId());
+            ownerCarDto.setCarId(feeDto.getPayerObjId());
+            List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
+            return getTargetEndDateAndOweMonth(feeDto, ownerCarDtos == null || ownerCarDtos.size() < 1 ? null : ownerCarDtos.get(0));
+        }
+        return getTargetEndDateAndOweMonth(feeDto, null);
+    }
+
     @Override
     public double dayCompare(Date fromDate, Date toDate) {
         Calendar from = Calendar.getInstance();

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

@@ -61,7 +61,7 @@
             resultType="com.java110.dto.report.ReportCarDto">
         select t.car_brand carBrand,t.car_color carColor,t.car_id carId,t.car_num carNum,t.car_type carType,
         t.community_id communityId,bo.`name` ownerName,bo.id_card idCard,bo.link,bo.owner_id ownerId,ps.ps_id psId,
-        ps.num,pa.pa_id paId,pa.num areaNum,ps.state
+        ps.num,pa.pa_id paId,pa.num areaNum,ps.state,t.start_time startTime,t.end_time endTime
         from owner_car t
         INNER JOIN building_owner bo on t.owner_id = bo.member_id and t.status_cd = '0'
         left join parking_space ps on t.ps_id = t.ps_id and ps.status_cd = '0'

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

@@ -118,6 +118,9 @@
         <if test="updateTime !=null and updateTime != ''">
             , t.update_time= #{updateTime}
         </if>
+        <if test="deadlineTime !=null ">
+            , t.deadline_time= #{deadlineTime}
+        </if>
         <if test="remark !=null and remark != ''">
             , t.remark= #{remark}
         </if>
@@ -765,7 +768,8 @@
     <select id="queryPrePaymentNewCount" parameterType="Map" resultType="Map">
         select count(1) count
         from (
-        select pfc.fee_name feeName, f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,t.end_time endTime ,oc.car_num carNum
+        select pfc.fee_name feeName, f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,t.end_time endTime
+        ,oc.car_num carNum
         from pay_fee t
         inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
         left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
@@ -829,7 +833,7 @@
         from report_fee_month_statistics t
         where t.community_id = '7020181217000001'
         group by t.config_id,t.fee_name
-        order by  objCount desc
+        order by objCount desc
     </select>
 
 </mapper>

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

@@ -38,12 +38,16 @@
         pfc.payment_cycle paymentCycle,pfc.square_price squarePrice,pfc.fee_flag feeFlag,t.payer_obj_id payerObjId,t.payer_obj_type payerObjType,
         t.amount,t.create_time createTime,t.end_time endTime,t.fee_id feeId,t.income_obj_id incomeObjId,t.start_time startTime,t.state,
         br.room_id roomId,br.room_num roomNum,oc.car_num carNum,ss.store_id storeId,ss.`name` storeName,ss.store_type_cd storeTypeCd,
-        t.community_id communityId
+        t.community_id communityId,pfa.value importFeeName,ifd.end_time importFeeEndTime,mw.cur_degrees curDegrees,mw.pre_degrees preDegrees,
+        mw.pre_reading_time preReadingTime,mw.cur_reading_time curReadingTime
         from pay_fee t
         INNER JOIN pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
         left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
         left join owner_car oc on t.payer_obj_id = oc.car_id and t.payer_obj_type = '6666' and oc.status_cd = '0'
         left join s_store ss on t.income_obj_id = ss.store_id and ss.status_cd = '0'
+        LEFT JOIN pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002' and pfa.status_cd = '0'
+        left join import_fee_detail ifd on t.fee_id = ifd.fee_id and ifd.status_cd = '0' and t.fee_flag = '2006012'
+        LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and mw.community_id = t.community_id
         where t.status_cd = '0'
         <if test="state !=null and state != ''">
             and t.state= #{state}

+ 13 - 0
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.core.smo.IComputeFeeSMO;
 import com.java110.dto.fee.FeeDto;
+import com.java110.dto.owner.OwnerCarDto;
 import com.java110.dto.report.ReportCarDto;
 import com.java110.dto.report.ReportFeeDetailDto;
 import com.java110.dto.report.ReportFeeDto;
@@ -29,6 +30,7 @@ import java.math.BigDecimal;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @ClassName GeneratorFeeMonthStatisticsInnerServiceSMOImpl
@@ -194,8 +196,14 @@ public class GeneratorFeeMonthStatisticsInnerServiceSMOImpl implements IGenerato
         }
         double receivableAmount = getReceivableAmount(tmpReportFeeDto, null, tmpReportCarDto); //应收
         double oweAmount = getOweAmount(tmpReportFeeDto, receivableAmount, receivedAmount); //欠费
+        FeeDto feeDto = BeanConvertUtil.covertBean(tmpReportFeeDto, FeeDto.class);
+        OwnerCarDto ownerCarDto = BeanConvertUtil.covertBean(tmpReportCarDto, OwnerCarDto.class);
+        Map<String, Object> targetEndDateAndOweMonth = computeFeeSMOImpl.getTargetEndDateAndOweMonth(feeDto, ownerCarDto);
+
+        Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate");
 
         ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
+        reportFeeMonthStatisticsPo.setDeadlineTime(DateUtil.getFormatTimeString(targetEndDate, DateUtil.DATE_FORMATE_STRING_A));
         if (!ListUtil.isNull(statistics)) {
             ReportFeeMonthStatisticsDto statistic = statistics.get(0);
             reportFeeMonthStatisticsPo.setStatisticsId(statistic.getStatisticsId());
@@ -288,8 +296,13 @@ public class GeneratorFeeMonthStatisticsInnerServiceSMOImpl implements IGenerato
         }
         double receivableAmount = getReceivableAmount(tmpReportFeeDto, reportRoomDto, null); //应收
         double oweAmount = getOweAmount(tmpReportFeeDto, receivableAmount, receivedAmount); //欠费
+        FeeDto feeDto = BeanConvertUtil.covertBean(tmpReportFeeDto, FeeDto.class);
+        Map<String, Object> targetEndDateAndOweMonth = computeFeeSMOImpl.getTargetEndDateAndOweMonth(feeDto, null);
+
+        Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate");
 
         ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
+        reportFeeMonthStatisticsPo.setDeadlineTime(DateUtil.getFormatTimeString(targetEndDate, DateUtil.DATE_FORMATE_STRING_A));
         if (!ListUtil.isNull(statistics)) {
             ReportFeeMonthStatisticsDto statistic = statistics.get(0);
             reportFeeMonthStatisticsPo.setStatisticsId(statistic.getStatisticsId());