Kaynağa Gözat

refactor(info):优化合同日期处理逻辑并统一字段命名- 在AContractInfoServiceImpl中增加对startDate和endDate空值判断
- 将电、气、水客户类中的近3月/6月字段名规范化为完整数字表述
- 更新相关XML映射文件中的列名以匹配新的属性名称
- 移动mapper XML文件到info目录下进行结构优化

林仔 6 ay önce
ebeveyn
işleme
c3a362f5a0

+ 2 - 2
src/main/java/com/zksy/info/domain/EElectricityCustomer.java

@@ -104,14 +104,14 @@ public class EElectricityCustomer implements Serializable {
      */
     @ApiModelProperty(value = "近3月均用电金额")
     @ExcelProperty(value = "近3月均用电金额")
-    private BigDecimal avgElectricityAmountLast3Months;
+    private BigDecimal avgElectricityAmountLastThreeMonths;
 
     /**
      * 近6月均用电金额
      */
     @ApiModelProperty(value = "近6月均用电金额")
     @ExcelProperty(value = "近6月均用电金额")
-    private BigDecimal avgElectricityAmountLast6Months;
+    private BigDecimal avgElectricityAmountLastSixMonths;
 
     /**
      * 近一年均用电金额

+ 2 - 2
src/main/java/com/zksy/info/domain/EGasCustomer.java

@@ -104,14 +104,14 @@ public class EGasCustomer implements Serializable {
      */
     @ApiModelProperty(value = "近3个月月均燃气用量")
     @ExcelProperty(value = "近3个月月均燃气用量")
-    private BigDecimal avgGasUsageLast3Months;
+    private BigDecimal avgGasUsageLastThreeMonths;
 
     /**
      * 近6个月月均燃气用量
      */
     @ApiModelProperty(value = "近6个月月均燃气用量")
     @ExcelProperty(value = "近6个月月均燃气用量")
-    private BigDecimal avgGasUsageLast6Months;
+    private BigDecimal avgGasUsageLastSixMonths;
 
     /**
      * 当前是否欠费

+ 2 - 2
src/main/java/com/zksy/info/domain/EWaterCustomer.java

@@ -97,14 +97,14 @@ public class EWaterCustomer implements Serializable {
      */
     @ApiModelProperty(value = "近3个月月均用水量")
     @ExcelProperty(value = "近3个月月均用水量")
-    private BigDecimal avgWaterUsageLast3Months;
+    private BigDecimal avgWaterUsageLastThreeMonths;
 
     /**
      * 近6个月月均用水量
      */
     @ApiModelProperty(value = "近6个月月均用水量")
     @ExcelProperty(value = "近6个月月均用水量")
-    private BigDecimal avgWaterUsageLast6Months;
+    private BigDecimal avgWaterUsageLastSixMonths;
 
     /**
      * 当前是否欠费

+ 8 - 5
src/main/java/com/zksy/property/service/impl/AContractInfoServiceImpl.java

@@ -127,11 +127,14 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
         DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy年M月d日");
         LocalDate rzrqDate = LocalDate.parse(dto.getRzrq(), inputFormatter);
         bo.setD13(rzrqDate.format(outputFormatter));
-        LocalDate startDate = LocalDate.parse(dto.getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-        bo.setD14(startDate.format(DateTimeFormatter.ofPattern("yyyy年M月d日")));
-        LocalDate endDate = LocalDate.parse(dto.getEndDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-        bo.setD15(endDate.format(DateTimeFormatter.ofPattern("yyyy年M月d日")));
-
+        if(StringUtils.isNotBlank(dto.getStartDate())){
+            LocalDate startDate = LocalDate.parse(dto.getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+            bo.setD14(startDate.format(DateTimeFormatter.ofPattern("yyyy年M月d日")));
+        }
+        if(StringUtils.isNotBlank(dto.getEndDate())){
+            LocalDate endDate = LocalDate.parse(dto.getEndDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+            bo.setD15(endDate.format(DateTimeFormatter.ofPattern("yyyy年M月d日")));
+        }
         String attachmentUrl = aRentalContractService.generatorRental("4", bo, true);
         AReceiptInfo receiptInfo = new AReceiptInfo();
         receiptInfo.setContractId(contractId);

+ 4 - 4
src/main/resources/mapper/EElectricityCustomerMapper.xml → src/main/resources/mapper/info/EElectricityCustomerMapper.xml

@@ -16,8 +16,8 @@
             <result property="city" column="city" jdbcType="VARCHAR"/>
             <result property="valueLevel" column="value_level" jdbcType="VARCHAR"/>
             <result property="riskLevel" column="risk_level" jdbcType="VARCHAR"/>
-            <result property="avgElectricityAmountLast3Months" column="avg_electricity_amount_last_3_months" jdbcType="DECIMAL"/>
-            <result property="avgElectricityAmountLast6Months" column="avg_electricity_amount_last_6_months" jdbcType="DECIMAL"/>
+            <result property="avgElectricityAmountLastThreeMonths" column="avg_electricity_amount_last_three_months" jdbcType="DECIMAL"/>
+            <result property="avgElectricityAmountLastSixMonths" column="avg_electricity_amount_last_six_months" jdbcType="DECIMAL"/>
             <result property="avgElectricityAmountLastYear" column="avg_electricity_amount_last_year" jdbcType="DECIMAL"/>
             <result property="isArrearsNow" column="is_arrears_now" jdbcType="VARCHAR"/>
             <result property="statisticsTime" column="statistics_time" jdbcType="DATE"/>
@@ -31,8 +31,8 @@
         id,contract_capacity,first_power_time,
         electricity_account_status,arrears_amount,default_times_in_two_years,
         electricity_type,province,city,
-        value_level,risk_level,avg_electricity_amount_last_3_months,
-        avg_electricity_amount_last_6_months,avg_electricity_amount_last_year,is_arrears_now,
+        value_level,risk_level,avg_electricity_amount_last_three_months,
+        avg_electricity_amount_last_six_months,avg_electricity_amount_last_year,is_arrears_now,
         statistics_time,statistics_baseline_date,remarks,
         administrative_region_code,create_time
     </sql>

+ 4 - 4
src/main/resources/mapper/EGasCustomerMapper.xml → src/main/resources/mapper/info/EGasCustomerMapper.xml

@@ -16,8 +16,8 @@
             <result property="isOneHouseholdTable" column="is_one_household_table" jdbcType="VARCHAR"/>
             <result property="gasFeeDetails" column="gas_fee_details" jdbcType="VARCHAR"/>
             <result property="paymentDeadline" column="payment_deadline" jdbcType="DATE"/>
-            <result property="avgGasUsageLast3Months" column="avg_gas_usage_last_3_months" jdbcType="DECIMAL"/>
-            <result property="avgGasUsageLast6Months" column="avg_gas_usage_last_6_months" jdbcType="DECIMAL"/>
+            <result property="avgGasUsageLastThreeMonths" column="avg_gas_usage_last_three_months" jdbcType="DECIMAL"/>
+            <result property="avgGasUsageLastSixMonths" column="avg_gas_usage_last_six_months" jdbcType="DECIMAL"/>
             <result property="isArrearsNow" column="is_arrears_now" jdbcType="VARCHAR"/>
             <result property="statisticsDate" column="statistics_date" jdbcType="DATE"/>
             <result property="statisticsBaselineDate" column="statistics_baseline_date" jdbcType="DATE"/>
@@ -31,8 +31,8 @@
         id,enterprise_name,unified_social_credit_code,
         gas_user_info,opening_date,user_address,
         prepaid_amount,arrears_amount,is_one_household_table,
-        gas_fee_details,payment_deadline,avg_gas_usage_last_3_months,
-        avg_gas_usage_last_6_months,is_arrears_now,statistics_date,
+        gas_fee_details,payment_deadline,avg_gas_usage_last_three_months,
+        avg_gas_usage_last_six_months,is_arrears_now,statistics_date,
         statistics_baseline_date,remarks,administrative_region_code,
         town,create_time
     </sql>

+ 3 - 3
src/main/resources/mapper/EWaterCustomerMapper.xml → src/main/resources/mapper/info/EWaterCustomerMapper.xml

@@ -15,8 +15,8 @@
             <result property="arrearsAmount" column="arrears_amount" jdbcType="DECIMAL"/>
             <result property="isOneHouseholdTable" column="is_one_household_table" jdbcType="VARCHAR"/>
             <result property="waterFeeDetails" column="water_fee_details" jdbcType="VARCHAR"/>
-            <result property="avgWaterUsageLast3Months" column="avg_water_usage_last_3_months" jdbcType="DECIMAL"/>
-            <result property="avgWaterUsageLast6Months" column="avg_water_usage_last_6_months" jdbcType="DECIMAL"/>
+            <result property="avgWaterUsageLastThreeMonths" column="avg_water_usage_last_three_months" jdbcType="DECIMAL"/>
+            <result property="avgWaterUsageLastSixMonths" column="avg_water_usage_last_six_months" jdbcType="DECIMAL"/>
             <result property="isArrearsNow" column="is_arrears_now" jdbcType="VARCHAR"/>
             <result property="paymentPeriod" column="payment_period" jdbcType="VARCHAR"/>
             <result property="statisticsDate" column="statistics_date" jdbcType="DATE"/>
@@ -30,7 +30,7 @@
         id,enterprise_name,unified_social_credit_code,
         water_user_info,opening_date,user_address,
         prepaid_amount,arrears_amount,is_one_household_table,
-        water_fee_details,avg_water_usage_last_3_months,avg_water_usage_last_6_months,
+        water_fee_details,avg_water_usage_last_three_months,avg_water_usage_last_six_months,
         is_arrears_now,payment_period,statistics_date,
         statistics_baseline_date,remarks,administrative_region_code,
         create_time