Explorar el Código

feat(contract): 添加电费字段并修复租金计算逻辑

- 在 AReceiptInfo 实体中新增电费字段 electricityBill
- 在 ReceiptDto 中新增电费字段 df
- 在 RentalTempBo 中新增字段 d16 用于电费显示
- 修复租金计算中错误使用押金(yj)为租金(zj)的问题
- 更新数据库映射文件支持电费字段的读写
- 完善收据信息保存时电费数据的设置逻辑
林仔 hace 6 meses
padre
commit
e8cadea574

+ 6 - 0
src/main/java/com/zksy/property/domain/AReceiptInfo.java

@@ -81,6 +81,12 @@ public class AReceiptInfo implements Serializable {
     @ApiModelProperty(value = "水费")
     private BigDecimal waterFee;
 
+    /**
+     * 电费
+     */
+    @ApiModelProperty(value = "电费")
+    private BigDecimal electricityBill;
+
     /**
      * 收款事由
      */

+ 1 - 0
src/main/java/com/zksy/property/domain/bo/RentalTempBo.java

@@ -119,6 +119,7 @@ public class RentalTempBo {
     private String d13;
     private String d14;
     private String d15;
+    private String d16;
 
     private String e1;
     private String e2;

+ 1 - 0
src/main/java/com/zksy/property/domain/dto/ReceiptDto.java

@@ -18,6 +18,7 @@ public class ReceiptDto {
     private BigDecimal zj;
     private BigDecimal wyf;
     private BigDecimal sf;
+    private BigDecimal df;
     private String paymentReason;
     private String rzrq;
     private String startDate;

+ 3 - 1
src/main/java/com/zksy/property/service/impl/AContractInfoServiceImpl.java

@@ -135,6 +135,7 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
             LocalDate endDate = LocalDate.parse(dto.getEndDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
             bo.setD15(endDate.format(DateTimeFormatter.ofPattern("yyyy年M月d日")));
         }
+        bo.setD16(String.valueOf(dto.getDf()));
         String attachmentUrl = aRentalContractService.generatorRental("4", bo, true);
         AReceiptInfo receiptInfo = new AReceiptInfo();
         receiptInfo.setContractId(contractId);
@@ -146,6 +147,7 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
         receiptInfo.setPropertyFee(dto.getWyf());
         receiptInfo.setDeposit(dto.getYj());
         receiptInfo.setWaterFee(dto.getSf());
+        receiptInfo.setElectricityBill(dto.getDf());
         if (StringUtils.isNotBlank(dto.getRzrq())){
             receiptInfo.setAccountingDate(LocalDate.parse(dto.getRzrq()));
         }
@@ -219,7 +221,7 @@ public class AContractInfoServiceImpl extends ServiceImpl<AContractInfoMapper, A
         bo.setE1(dto.getDw());
         bo.setE2(dto.getZh());
         bo.setE3(String.valueOf(dto.getYj()));
-        bo.setE4(String.valueOf(dto.getYj()));
+        bo.setE4(String.valueOf(dto.getZj()));
         bo.setE5(String.valueOf(dto.getWyf()));
         bo.setE6(convertToUppercase(dto.getRmb()));
         bo.setE7(String.valueOf(dto.getRmb()));

+ 4 - 1
src/main/resources/mapper/property/AReceiptInfoMapper.xml

@@ -15,6 +15,7 @@
             <result property="propertyFee" column="property_fee" jdbcType="DECIMAL"/>
             <result property="deposit" column="deposit" jdbcType="DECIMAL"/>
             <result property="waterFee" column="water_fee" jdbcType="DECIMAL"/>
+            <result property="electricityBill" column="electricity_bill" jdbcType="DECIMAL"/>
             <result property="attachmentUrl" column="attachment_url" jdbcType="VARCHAR"/>
             <result property="receiptReason" column="receipt_reason" jdbcType="VARCHAR"/>
             <result property="generationDate" column="generation_date" javaType="DATE"/>
@@ -36,6 +37,7 @@
         <result property="propertyFee" column="property_fee" jdbcType="DECIMAL"/>
         <result property="deposit" column="deposit" jdbcType="DECIMAL"/>
         <result property="waterFee" column="water_fee" jdbcType="DECIMAL"/>
+        <result property="electricityBill" column="electricity_bill" jdbcType="DECIMAL"/>
         <result property="attachmentUrl" column="attachment_url" jdbcType="VARCHAR"/>
         <result property="receiptReason" column="receipt_reason" jdbcType="VARCHAR"/>
         <result property="generationDate" column="generation_date" jdbcType="DATE" javaType="java.time.LocalDate"/>
@@ -50,7 +52,7 @@
     <sql id="Base_Column_List">
         id,contract_id,receipt_number,payer,
         payment_method,total_amount,rent,
-        property_fee,deposit,water_fee,
+        property_fee,deposit,water_fee,electricity bill,
         receipt_reason,attachment_url,accounting_date,
         generation_date,start_date,end_date,create_time,update_time
     </sql>
@@ -66,6 +68,7 @@
         r.property_fee,
         r.deposit,
         r.water_fee,
+        r.electricity_bill,
         r.receipt_reason,
         r.attachment_url,
         r.accounting_date,

BIN
src/main/resources/templates/4.docx