Преглед изворни кода

python 调取保单获取支付时间

wks пре 2 година
родитељ
комит
fff65c5f38

+ 6 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerPolicyPrintResponse.java

@@ -42,6 +42,12 @@ public class CrawlerPolicyPrintResponse extends CrawlerBaseResponse {
     @JsonProperty("jyx_info_list")
     private List<JyxInfoListDTO> jyxInfoList;
 
+    /**
+     * 支付时间
+     */
+    @JsonProperty("paytime")
+    private String paytime;
+
     @NoArgsConstructor
     @Data
     public static class JyxInfoListDTO implements Serializable {

+ 8 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java

@@ -40,6 +40,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 
 import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -223,6 +225,12 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             throw new SystemException(response.getMessage());
         }
 
+        // 支付时间
+        if (StringUtils.isNotEmpty(response.getPaytime())) {
+            insAreaCompany.setPayDate(LocalDateTime.parse(response.getPaytime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+            insAreaCompanyService.updateById(insAreaCompany);
+        }
+
         CrawlerPolicyPrintVo crawlerPolicyPrintVo = new CrawlerPolicyPrintVo();
         crawlerPolicyPrintVo.setJqxFlagUrl(gainCarInsPolicy(response.getJqxFlagUrl(), licensePlate + "-交强险标志.pdf", licensePlate));
         crawlerPolicyPrintVo.setJqxPolicyUrl(gainCarInsPolicy(response.getJqxPolicyUrl(), licensePlate + "-交强险保单.pdf", licensePlate));