Przeglądaj źródła

营销户表信息,增加开户时间和装表时间

欧阳劲驰 3 tygodni temu
rodzic
commit
98fc393605

+ 12 - 2
bespoke-gateway-core/src/main/java/com/shkpr/service/bespokegateway/core/domain/po/CustomerInfo.java

@@ -80,13 +80,11 @@ public class CustomerInfo {
     /**
      * 开户时间
      */
-    @ExcelMapping("开户时间")
     private LocalDateTime createdAt;
 
     /**
      * 换表时间
      */
-    @ExcelMapping("换表时间")
     private LocalDateTime updatedAt;
 
     /**
@@ -165,4 +163,16 @@ public class CustomerInfo {
      */
     @ExcelMapping(value = "是否计量", enumClass = CustomerMeteringType.class)
     private Short meteringType;
+
+    /**
+     * 开户时间
+     */
+    @ExcelMapping("开户时间")
+    private LocalDateTime openTime;
+
+    /**
+     * 装表时间
+     */
+    @ExcelMapping("装表时间")
+    private LocalDateTime installTime;
 }

+ 6 - 0
bespoke-gateway-core/src/main/resources/mapper/CustomerInfoMapper.xml

@@ -27,6 +27,8 @@
             <if test="publicServType != null">public_serv_type,</if>
             <if test="billingType != null">billing_type,</if>
             <if test="meteringType != null">metering_type,</if>
+            <if test="openTime != null">open_time,</if>
+            <if test="installTime != null">install_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             #{code,jdbcType=VARCHAR},
@@ -54,6 +56,8 @@
             <if test="publicServType != null">#{publicServType,jdbcType=SMALLINT},</if>
             <if test="billingType != null">#{billingType,jdbcType=SMALLINT},</if>
             <if test="meteringType != null">#{meteringType,jdbcType=SMALLINT},</if>
+            <if test="openTime != null">#{openTime,jdbcType=TIMESTAMP},</if>
+            <if test="installTime != null">#{installTime,jdbcType=TIMESTAMP},</if>
         </trim>
         on conflict (code) do update set
         <trim suffixOverrides=",">
@@ -79,6 +83,8 @@
             <if test="publicServType != null">public_serv_type = excluded.public_serv_type,</if>
             <if test="billingType != null">billing_type = excluded.billing_type,</if>
             <if test="meteringType != null">metering_type = excluded.metering_type,</if>
+            <if test="openTime != null">open_time = excluded.open_time,</if>
+            <if test="installTime != null">install_time = excluded.install_time,</if>
         </trim>
     </insert>
 </mapper>

+ 3 - 1
bespoke-gateway-zydma/src/main/java/com/shkpr/service/bespokegateway/zydma/controller/CustomerController.java

@@ -13,6 +13,7 @@ import com.shkpr.service.bespokegateway.core.utils.CommTool;
 import com.shkpr.service.bespokegateway.core.utils.ExcelUtil;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -108,7 +109,8 @@ public class CustomerController {
             List<CustomerInfo> dates = dataEntry.getValue().stream()
                     .peek(info -> {
                         //抄表周期
-                        info.setReadCycle(CustomerReadType.getCode(info.getReadCycleName()));
+                        if (StringUtils.isNotBlank(info.getReadCycleName()))
+                            info.setReadCycle(CustomerReadType.getCode(info.getReadCycleName()));
                         //表状态
                         info.setStatusCode(CustomerInfoStatus.NORMAL.getCode());
                         info.setStatusName(CustomerInfoStatus.NORMAL.getName());