Browse Source

恒邦报价的提交

dongxin 1 year ago
parent
commit
b4f08e062a
20 changed files with 503 additions and 112 deletions
  1. 32 0
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/utils/DateUtil.java
  2. 8 2
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/build/HbCrawlerQuoteResultVoBuild.java
  3. 109 14
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/component/HengBangCrawlerRequestComponent.java
  4. 3 0
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/constant/enums/RequestUrl.java
  5. 4 0
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/HengBangCrawlerConfigureParameters.java
  6. 28 7
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerCalculationRequest.java
  7. 49 4
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerDepreciationRequest.java
  8. 28 0
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerQueryCarInfoRequest.java
  9. 18 9
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerQueryCarRequest.java
  10. 90 24
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerQuoteimmediatelyRequest.java
  11. 0 18
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/response/HbCrawlerDepreciationResponse.java
  12. 62 0
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/response/HbCrawlerQueryCarResponse.java
  13. 25 0
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/response/HbCrawlerQueryUserInfoResponse.java
  14. 30 21
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/service/Impl/HengBangCrawlerRequestImpl.java
  15. 0 0
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/utils/HengBangAESUtil.java
  16. 5 3
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java
  17. 1 1
      tenant/organization/src/main/java/com/jzg/organization/state/AuditState.java
  18. 8 7
      tenant/organization/src/main/java/com/jzg/organization/state/listener/AuditStateListener.java
  19. 1 0
      tenant/organization/src/main/resources/application.yml
  20. 2 2
      tenant/organization/src/main/resources/mapper/SysUserAccountMapper.xml

+ 32 - 0
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/utils/DateUtil.java

@@ -402,7 +402,39 @@ public class DateUtil {
         return newDateStr;
         return newDateStr;
     }
     }
 
 
+    private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+    private static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+    private static final DateTimeFormatter OUTPUT_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX");
 
 
+    /**
+     * 将 yyyy-MM-dd 转换为 UTC 时间字符串 (带毫秒 + Z)
+     * @param dateStr yyyy-MM-dd 格式字符串
+     * @param hour 小时
+     * @param minute 分钟
+     * @return UTC 时间字符串,例如:2025-08-20T16:00:00.000Z
+     */
+    public static String toUtc(String dateStr, int hour, int minute) {
+        LocalDate localDate = LocalDate.parse(dateStr, DATE_FORMATTER);
+        LocalDateTime localDateTime = localDate.atTime(hour, minute, 0);
+        Instant instant = localDateTime.toInstant(ZoneOffset.UTC);
+        return OUTPUT_FORMATTER.format(instant.atOffset(ZoneOffset.UTC));
+    }
+
+    /** 默认 00:00:00 */
+    public static String toUtc(String dateStr) {
+        return toUtc(dateStr, 0, 0);
+    }
+
+    /**
+     * 将 yyyy-MM-dd HH:mm:ss 转换为 UTC 时间字符串 (带毫秒 + Z)
+     * @param datetimeStr yyyy-MM-dd HH:mm:ss 格式字符串
+     * @return UTC 时间字符串,例如:2025-08-20T16:00:00.000Z
+     */
+    public static String toUtcDateTime(String datetimeStr) {
+        LocalDateTime localDateTime = LocalDateTime.parse(datetimeStr, DATETIME_FORMATTER);
+        Instant instant = localDateTime.toInstant(ZoneOffset.UTC);
+        return OUTPUT_FORMATTER.format(instant.atOffset(ZoneOffset.UTC));
+    }
 
 
     public static void main(String[] args) throws ParseException {
     public static void main(String[] args) throws ParseException {
 
 

+ 8 - 2
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/build/HbCrawlerQuoteResultVoBuild.java

@@ -1,5 +1,6 @@
 package com.jzg.quotation.hengbang.crawler.build;
 package com.jzg.quotation.hengbang.crawler.build;
 
 
+import com.jzg.commons.constants.dict.InsOrderStatusEnum;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.entity.quote.vo.RiskInfoVo;
 import com.jzg.commons.entity.quote.vo.RiskInfoVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
@@ -18,9 +19,15 @@ import java.util.stream.Collectors;
 public final class HbCrawlerQuoteResultVoBuild {
 public final class HbCrawlerQuoteResultVoBuild {
     private HbCrawlerQuoteResultVoBuild() {throw new IllegalStateException("Utility class");}
     private HbCrawlerQuoteResultVoBuild() {throw new IllegalStateException("Utility class");}
 
 
-    public static QuoteResultsVo build(QuoteVo quoteVo, HbCrawlerProposalResponse proposalResponse) {
+    public static QuoteResultsVo build(QuoteVo quoteVo, HbCrawlerProposalResponse proposalResponse, String calculationResult) {
         QuoteResultsVo quoteResultsVo = new QuoteResultsVo();
         QuoteResultsVo quoteResultsVo = new QuoteResultsVo();
         quoteResultsVo.setOrdersNo(quoteVo.getOrder().getOrdersNo());
         quoteResultsVo.setOrdersNo(quoteVo.getOrder().getOrdersNo());
+        quoteResultsVo.setQuoteStatusEnum(InsOrderStatusEnum.WAIT_AUDIT);
+        if(!calculationResult.equals("成功")){
+            quoteResultsVo.setQuoteStatusEnum(InsOrderStatusEnum.QUOTE_FAIL);
+            quoteResultsVo.setErrorMessage(calculationResult);
+            return quoteResultsVo;
+        }
         //交强险
         //交强险
         quoteResultsVo.setCiRiskInfoVo(buildCiInfo(proposalResponse));
         quoteResultsVo.setCiRiskInfoVo(buildCiInfo(proposalResponse));
         //商业险
         //商业险
@@ -37,7 +44,6 @@ public final class HbCrawlerQuoteResultVoBuild {
         ciRiskInfoVo.setRiskCode(forceCarInsureRisk.getRiskcode());
         ciRiskInfoVo.setRiskCode(forceCarInsureRisk.getRiskcode());
         ciRiskInfoVo.setStartDate(forceCarInsureRisk.getBegintime());
         ciRiskInfoVo.setStartDate(forceCarInsureRisk.getBegintime());
         ciRiskInfoVo.setEndDate(forceCarInsureRisk.getEndtime());
         ciRiskInfoVo.setEndDate(forceCarInsureRisk.getEndtime());
-
         return ciRiskInfoVo;
         return ciRiskInfoVo;
     }
     }
 
 

+ 109 - 14
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/component/HengBangCrawlerRequestComponent.java

@@ -1,6 +1,10 @@
 package com.jzg.quotation.hengbang.crawler.component;
 package com.jzg.quotation.hengbang.crawler.component;
 
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.quotation.commons.component.RequestComponent;
 import com.jzg.quotation.commons.component.RequestComponent;
@@ -24,11 +28,11 @@ import org.springframework.stereotype.Component;
 import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
 import org.springframework.util.MultiValueMap;
 
 
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
 import java.time.Duration;
 import java.time.Duration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
 
 
 /**
 /**
  * @description: 恒邦财险
  * @description: 恒邦财险
@@ -126,6 +130,46 @@ public class HengBangCrawlerRequestComponent {
                 .get(RequestConstant.PHONE_NUMBER);
                 .get(RequestConstant.PHONE_NUMBER);
     }
     }
 
 
+    /**
+     * 获取用户信息
+     *
+     * @param username
+     */
+    public HbCrawlerQueryUserInfoResponse queryUserInfo(String username) {
+        MultiValueMap<String, String> param = new LinkedMultiValueMap<>();
+        param.set("sysCategory", "2");
+        param.set("resourceType", "HBXSH");
+        HttpHeaders headers = new HttpHeaders();
+        headers.set(HttpHeaders.ACCEPT,"*/*");
+        headers.set(HttpHeaders.CONTENT_TYPE,"application/x-www-form-urlencode;charset=utf-8");
+        headers.set(HttpHeaders.USER_AGENT,"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36");
+        headers.set(HttpHeaders.AUTHORIZATION,getAuthorization(username));
+        HbCrawlerQueryUserInfoResponse response = requestComponent.get(RequestUrl.QUERY_USER_INFO.getRequestUrl(hbCrawlerProperties.getBaseUrl()) + "/" + username,param,RequestUrl.QUERY_USER_INFO.getRequestDescription(),HbCrawlerQueryUserInfoResponse.class,headers);
+        return response;
+    }
+
+    /**
+     * 获取行业车型信息
+     * @param queryCarInfoRequest
+     * @param headers
+     */
+    public HbCrawlerQueryCarRequest.CbitDataDTO queryCarInfo(HbCrawlerQueryCarInfoRequest queryCarInfoRequest, HttpHeaders headers) {
+        MultiValueMap<String, String> param = RequestObjectConversion.convertMultiValueStringMap(queryCarInfoRequest);
+        String response = requestComponent.get(RequestUrl.QUERY_CAR_INFO.getRequestUrl(hbCrawlerProperties.getBaseUrl()) ,param,RequestUrl.QUERY_CAR_INFO.getRequestDescription(),String.class,headers);
+        JSONObject res = JSONObject.parseObject(response);
+        String ciphertextB64 = res.getString("hb_enc_d");
+        String plaintext = null;
+        try{
+            plaintext = HengBangAESUtil.decryptStr(ciphertextB64);
+        } catch (Exception e) {
+            throw new SystemException("解密失败");
+        }
+        HbCrawlerQueryCarRequest.CbitDataDTO cbitDataDTO = JSONObject.parseObject(plaintext).getJSONObject("carMappings")
+                .getJSONArray("cbitData")
+                .getJSONObject(0).toJavaObject(HbCrawlerQueryCarRequest.CbitDataDTO.class);
+        return cbitDataDTO;
+    }
+
     /**
     /**
      * 获取请求头
      * 获取请求头
      *
      *
@@ -141,6 +185,38 @@ public class HengBangCrawlerRequestComponent {
         return headers;
         return headers;
     }
     }
 
 
+    /**
+     * AES-256-CBC 解密
+     * @param ciphertextB64 Base64 编码的密文(前16字节是IV)
+     * @param key 32字节密钥(256位)
+     * @return 解密后的明文
+     * @throws Exception
+     */
+    public static String aes256CbcDecrypt(String ciphertextB64, byte[] key) throws Exception {
+        if (key.length != 32) {
+            throw new IllegalArgumentException("Key must be 32 bytes (256 bits)");
+        }
+
+        byte[] raw = Base64.getDecoder().decode(ciphertextB64);
+
+        // 前16字节是 IV
+        byte[] iv = new byte[16];
+        System.arraycopy(raw, 0, iv, 0, 16);
+
+        // 剩余部分是实际密文
+        byte[] ciphertext = new byte[raw.length - 16];
+        System.arraycopy(raw, 16, ciphertext, 0, ciphertext.length);
+
+        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+        SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
+        IvParameterSpec ivSpec = new IvParameterSpec(iv);
+
+        cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
+        byte[] decrypted = cipher.doFinal(ciphertext);
+
+        return new String(decrypted, "UTF-8");
+    }
+
     /**
     /**
      * 查询车型
      * 查询车型
      *
      *
@@ -149,8 +225,7 @@ public class HengBangCrawlerRequestComponent {
      * @return
      * @return
      */
      */
     public List<HbCrawlerQueryCarResponse.ContentDTO> queryCar(HbCrawlerQueryCarRequest queryCarRequest, HttpHeaders headers) {
     public List<HbCrawlerQueryCarResponse.ContentDTO> queryCar(HbCrawlerQueryCarRequest queryCarRequest, HttpHeaders headers) {
-        HbCrawlerQueryCarResponse queryCarResponse = requestComponent.objectPost(RequestUrl.QUERY_CAR.getRequestUrl(hbCrawlerProperties.getBaseUrl()), queryCarRequest, HbCrawlerQueryCarResponse.class, headers)
-                .getBody();
+        HbCrawlerQueryCarResponse queryCarResponse = requestComponent.toStringPost(RequestUrl.QUERY_CAR.getRequestUrl(hbCrawlerProperties.getBaseUrl()), queryCarRequest,RequestUrl.QUERY_CAR.getRequestDescription(), HbCrawlerQueryCarResponse.class, headers);
         return queryCarResponse.getContent();
         return queryCarResponse.getContent();
     }
     }
 
 
@@ -180,8 +255,8 @@ public class HengBangCrawlerRequestComponent {
      */
      */
     public String getDepreciationPrice(HbCrawlerDepreciationRequest depreciationRequest, HttpHeaders headers) {
     public String getDepreciationPrice(HbCrawlerDepreciationRequest depreciationRequest, HttpHeaders headers) {
         MultiValueMap<String, String> params = RequestObjectConversion.convertMultiValueStringMap(depreciationRequest);
         MultiValueMap<String, String> params = RequestObjectConversion.convertMultiValueStringMap(depreciationRequest);
-        HbCrawlerDepreciationResponse depreciationResponse = requestComponent.get(RequestUrl.DEPRECIATIONRATE.getRequestUrl(hbCrawlerProperties.getBaseUrl()), params, "", HbCrawlerDepreciationResponse.class, headers);
-        return String.valueOf(depreciationResponse.getDepreciationRate());
+        String depreciationResponse = requestComponent.get(RequestUrl.DEPRECIATIONRATE.getRequestUrl(hbCrawlerProperties.getBaseUrl()), params, "", String.class, headers);
+        return depreciationResponse;
     }
     }
 
 
     /**
     /**
@@ -192,6 +267,7 @@ public class HengBangCrawlerRequestComponent {
      * @return
      * @return
      */
      */
     public String quoteImmediately(HbCrawlerQuoteimmediatelyRequest quoteimmediatelyRequest, HttpHeaders headers) {
     public String quoteImmediately(HbCrawlerQuoteimmediatelyRequest quoteimmediatelyRequest, HttpHeaders headers) {
+        System.out.println(JSON.toJSON(quoteimmediatelyRequest));
         ResponseEntity<String> stringResponseEntity = requestComponent.objectPost(RequestUrl.QUOTEIMMEDIATELY.getRequestUrl(hbCrawlerProperties.getBaseUrl()), quoteimmediatelyRequest, String.class, headers);
         ResponseEntity<String> stringResponseEntity = requestComponent.objectPost(RequestUrl.QUOTEIMMEDIATELY.getRequestUrl(hbCrawlerProperties.getBaseUrl()), quoteimmediatelyRequest, String.class, headers);
         return stringResponseEntity.getBody();
         return stringResponseEntity.getBody();
     }
     }
@@ -203,10 +279,22 @@ public class HengBangCrawlerRequestComponent {
      * @param headers
      * @param headers
      * @return
      * @return
      */
      */
-    public Map<String, Object> getCalculationResult(HbCrawlerCalculationRequest calculationRequest, HttpHeaders headers) {
-        ResponseEntity<HbCrawlerCalculationResponse> calculationResponseResponseEntity = requestComponent.objectPost(RequestUrl.CALCULATION.getRequestUrl(hbCrawlerProperties.getBaseUrl()), calculationRequest, HbCrawlerCalculationResponse.class, headers);
-        HbCrawlerCalculationResponse calculationResponse = calculationResponseResponseEntity.getBody();
-        return calculationResponse.getData();
+    public String getCalculationResult(HbCrawlerCalculationRequest calculationRequest, HttpHeaders headers) {
+        HbCrawlerSaleInfoResponse req = new HbCrawlerSaleInfoResponse();
+        req.setHbEncV("1");
+        try {
+            ObjectMapper mapper = new ObjectMapper();
+            mapper.setSerializationInclusion(JsonInclude.Include.ALWAYS);
+            String json = mapper.writeValueAsString(calculationRequest);
+            req.setHbEncD(HengBangAESUtil.encryptStr(json));
+            HbCrawlerSaleInfoResponse response = requestComponent.toStringPost(RequestUrl.CALCULATION.getRequestUrl(hbCrawlerProperties.getBaseUrl()), req, RequestUrl.CALCULATION.getRequestDescription(),HbCrawlerSaleInfoResponse.class, headers);
+            System.out.println(HengBangAESUtil.decryptStr(response.getHbEncD()));
+            String resJson = HengBangAESUtil.decryptStr(response.getHbEncD());
+            return JSONObject.parseObject(resJson).getString("message");
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new SystemException("加密解密异常!");
+        }
     }
     }
 
 
     /**
     /**
@@ -226,8 +314,14 @@ public class HengBangCrawlerRequestComponent {
             throw new SystemException(e.getMessage());
             throw new SystemException(e.getMessage());
         }
         }
         params.add("plyappno", encryptPlyappno);
         params.add("plyappno", encryptPlyappno);
-        HbCrawlerProposalResponse proposalResponse = requestComponent.get(RequestUrl.PROPOSAL.getRequestUrl(hbCrawlerProperties.getBaseUrl()), params, "", HbCrawlerProposalResponse.class, headers);
-        return proposalResponse;
+        HbCrawlerSaleInfoResponse response = requestComponent.get(RequestUrl.PROPOSAL.getRequestUrl(hbCrawlerProperties.getBaseUrl()), params, RequestUrl.PROPOSAL.getRequestDescription(), HbCrawlerSaleInfoResponse.class, headers);
+        try {
+            String resJson = HengBangAESUtil.decryptStr(response.getHbEncD());
+            HbCrawlerProposalResponse proposalResponse = JSONObject.parseObject(resJson).toJavaObject(HbCrawlerProposalResponse.class);
+            return proposalResponse;
+        } catch (Exception e) {
+            throw new SystemException("加密解密异常!");
+        }
     }
     }
 
 
     /**
     /**
@@ -329,4 +423,5 @@ public class HengBangCrawlerRequestComponent {
         return requestComponent.objectPost(RequestUrl.PAY_URL.getRequestUrl(hbCrawlerProperties.getBaseUrl())
         return requestComponent.objectPost(RequestUrl.PAY_URL.getRequestUrl(hbCrawlerProperties.getBaseUrl())
                 .concat(plyappno), null, HbCrawlerPayUrlResponse.class, headers).getBody();
                 .concat(plyappno), null, HbCrawlerPayUrlResponse.class, headers).getBody();
     }
     }
+
 }
 }

+ 3 - 0
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/constant/enums/RequestUrl.java

@@ -15,6 +15,9 @@ public enum RequestUrl implements CrawlerRequestUrlStandard {
     VERIFY_CODE("/api/refreshVerifyCode", "获取验证码"),
     VERIFY_CODE("/api/refreshVerifyCode", "获取验证码"),
     AUTHENTICATE("/api/authenticateNew", "登录"),
     AUTHENTICATE("/api/authenticateNew", "登录"),
 
 
+    QUERY_USER_INFO("/intermarket/api/userinfo", "获取用户信息"),
+    QUERY_CAR_INFO("/new-insure/api/carinsurenew/renewinsurance", "获取车辆信息"),
+
     QUERY_CAR("/backstage/api/car-model/queryByCarMapping", "查询车型"),
     QUERY_CAR("/backstage/api/car-model/queryByCarMapping", "查询车型"),
     FIND_SALE_INFO("/backstage/api/findSaleInformationNew", "查询归属信息"),
     FIND_SALE_INFO("/backstage/api/findSaleInformationNew", "查询归属信息"),
     DEPRECIATIONRATE("/backstage/api/coredblink/depreciationrate", "获取折旧价"),
     DEPRECIATIONRATE("/backstage/api/coredblink/depreciationrate", "获取折旧价"),

+ 4 - 0
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/HengBangCrawlerConfigureParameters.java

@@ -15,6 +15,9 @@ public class HengBangCrawlerConfigureParameters implements ConfigureParameters {
     @Serial
     @Serial
     private static final long serialVersionUID = 7212934480389963171L;
     private static final long serialVersionUID = 7212934480389963171L;
 
 
+
+    private String companyCode;
+
     /**
     /**
      * 银保信车型唯一id
      * 银保信车型唯一id
      */
      */
@@ -34,4 +37,5 @@ public class HengBangCrawlerConfigureParameters implements ConfigureParameters {
      * 投保单创建时间
      * 投保单创建时间
      */
      */
     private String appTime;
     private String appTime;
+
 }
 }

+ 28 - 7
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerCalculationRequest.java

@@ -1,13 +1,19 @@
 package com.jzg.quotation.hengbang.crawler.entity.request;
 package com.jzg.quotation.hengbang.crawler.entity.request;
 
 
+import cn.hutool.core.collection.CollUtil;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.quotation.commons.utils.DateUtil;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serial;
 import java.io.Serial;
 import java.io.Serializable;
 import java.io.Serializable;
+import java.time.Instant;
+import java.time.ZoneOffset;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
+import java.util.Objects;
 
 
 /**
 /**
  * @description: 恒邦财险 报价第二步 请求参数
  * @description: 恒邦财险 报价第二步 请求参数
@@ -69,20 +75,35 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest{
     private static final long serialVersionUID = -6130320344004620564L;
     private static final long serialVersionUID = -6130320344004620564L;
 
 
     public HbCrawlerCalculationRequest(QuoteVo quoteVo, String plyappno) {
     public HbCrawlerCalculationRequest(QuoteVo quoteVo, String plyappno) {
-        this.outofwarrantytype = "N";
         this.clauseType = "2";
         this.clauseType = "2";
-        this.epersonliabilityList = getEpersonliabilityList(quoteVo);
-        this.begintimeBi = quoteVo.getBiRiskInfoVo().getStartDate();
-        this.begintimeCi = quoteVo.getCiRiskInfoVo().getStartDate();
+        List<KindInfoVo> kindInfoVoList = quoteVo.getKindInfoVo();
+        this.risktype = "0";
+        if(CollUtil.isNotEmpty(kindInfoVoList)){
+            this.epersonliabilityList = getEpersonliabilityList(kindInfoVoList);
+            this.begintimeBi = DateUtil.toUtcDateTime(quoteVo.getBiRiskInfoVo().getStartDate());
+            this.risktype = "2";
+        }else{
+            this.epersonliabilityList = new ArrayList<>();
+        }
+        if(Objects.nonNull(quoteVo.getCiRiskInfoVo())){
+            this.begintimeCi = DateUtil.toUtcDateTime(quoteVo.getCiRiskInfoVo().getStartDate());
+            this.risktype = "1";
+        }
         this.plyappno = plyappno;
         this.plyappno = plyappno;
-        this.risktype = "2";
         this.ecarshiptaxPart = "投保人";
         this.ecarshiptaxPart = "投保人";
         this.taxonomyCode = "02";
         this.taxonomyCode = "02";
         this.epolicyFlag = "Y";
         this.epolicyFlag = "Y";
+        this.endtimeBi = "";
+        this.endtimeCi = "";
+        this.expdisc = "";
+        this.accidentEpolicyFlag = "";
+        this.effectfLag = null;
+        this.ecarChargingPosts = new ArrayList<>();
+        this.carInsureDevices = new ArrayList<>();
+        this.accidentInsuranceList = new ArrayList<>();
     }
     }
 
 
-    public List<EpersonliabilityDTO> getEpersonliabilityList(QuoteVo quoteVo) {
-        List<KindInfoVo> kindInfoVoList = quoteVo.getKindInfoVo();
+    public List<EpersonliabilityDTO> getEpersonliabilityList(List<KindInfoVo> kindInfoVoList) {
         List<EpersonliabilityDTO> epersonliabilityDTOList = new ArrayList<>();
         List<EpersonliabilityDTO> epersonliabilityDTOList = new ArrayList<>();
         for (KindInfoVo kindInfoVo : kindInfoVoList) {
         for (KindInfoVo kindInfoVo : kindInfoVoList) {
             EpersonliabilityDTO epersonliabilityDTO = new EpersonliabilityDTO();
             EpersonliabilityDTO epersonliabilityDTO = new EpersonliabilityDTO();

+ 49 - 4
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerDepreciationRequest.java

@@ -1,10 +1,17 @@
 package com.jzg.quotation.hengbang.crawler.entity.request;
 package com.jzg.quotation.hengbang.crawler.entity.request;
 
 
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.entity.quote.vo.RiskInfoVo;
 import com.jzg.quotation.hengbang.crawler.entity.response.HbCrawlerQueryCarResponse;
 import com.jzg.quotation.hengbang.crawler.entity.response.HbCrawlerQueryCarResponse;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serial;
 import java.io.Serial;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
 
 
 /**
 /**
  * @description: 恒邦财险 获取折旧价 请求参数
  * @description: 恒邦财险 获取折旧价 请求参数
@@ -17,11 +24,23 @@ public class HbCrawlerDepreciationRequest extends HbBaseRequest{
     @Serial
     @Serial
     private static final long serialVersionUID = 8016121918793424743L;
     private static final long serialVersionUID = 8016121918793424743L;
 
 
-    public HbCrawlerDepreciationRequest(CarInfoVo carInfoVo, String beginDate, String riskCode, HbCrawlerQueryCarResponse.ContentDTO contentDTO) {
-        this.beginDate = beginDate;
-        this.riskCode = riskCode;
+    public HbCrawlerDepreciationRequest(QuoteVo quoteVo, HbCrawlerQueryCarResponse.ContentDTO contentDTO) {
+        CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
+        RiskInfoVo ci = quoteVo.getCiRiskInfoVo();
+        RiskInfoVo bi = quoteVo.getBiRiskInfoVo();
+        String beginDate = null;
+        String riskCode = null;
+        if (ci != null) {
+            beginDate = ci.getStartDate();
+            riskCode = ci.getRiskCode();
+        }else{
+            beginDate = bi.getStartDate();
+            riskCode = bi.getRiskCode();
+        }
+        this.beginDate = dateFormat(beginDate);
+        this.riskCode = "0808";
         this.carKindCode = carInfoVo.getCarKindCode();
         this.carKindCode = carInfoVo.getCarKindCode();
-        this.enrollDate = carInfoVo.getIssueDate();
+        this.enrollDate = dateFormat(carInfoVo.getRegisterDate());
         this.purchasePrice = contentDTO.getPurchasePriceNotTax();
         this.purchasePrice = contentDTO.getPurchasePriceNotTax();
         this.carUseType = carInfoVo.getVehicleUseCode();
         this.carUseType = carInfoVo.getVehicleUseCode();
         this.seatCount = contentDTO.getSeatCount();
         this.seatCount = contentDTO.getSeatCount();
@@ -30,6 +49,30 @@ public class HbCrawlerDepreciationRequest extends HbBaseRequest{
         this.energyType = carInfoVo.getEnergyTypeCode();
         this.energyType = carInfoVo.getEnergyTypeCode();
     }
     }
 
 
+    private String dateFormat(String date){
+        // 1. 解析为 LocalDateTime
+        ZonedDateTime zdt = null;
+        if (date.length() == 10){
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            LocalDate ld = LocalDate.parse(date, formatter);
+            // 2. 补上 00:00:00,变成 LocalDateTime
+            LocalDateTime ldt = ld.atStartOfDay(); // 等价于 "2025-08-19T00:00:00"
+
+            // 3. 设置时区为 +08:00(北京/上海)
+            ZoneId zone = ZoneId.of("Asia/Shanghai");
+            zdt = ldt.atZone(zone);
+        }else{
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            LocalDateTime ldt = LocalDateTime.parse(date, formatter);
+            // 2. 指定时区(这里用 +08:00)
+            ZoneId zone = ZoneId.of("Asia/Shanghai"); // 等价于 +08:00
+            zdt = ldt.atZone(zone);
+        }
+        // 3. 格式化为 ISO-8601 带时区偏移的字符串
+        String result = zdt.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
+        return result;
+    }
+
     /**
     /**
      * 商业险起保日期
      * 商业险起保日期
      */
      */
@@ -46,4 +89,6 @@ public class HbCrawlerDepreciationRequest extends HbBaseRequest{
     private String tonCount;
     private String tonCount;
     private String useNatureCode;
     private String useNatureCode;
     private String energyType;
     private String energyType;
+
+
 }
 }

+ 28 - 0
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerQueryCarInfoRequest.java

@@ -0,0 +1,28 @@
+package com.jzg.quotation.hengbang.crawler.entity.request;
+
+import com.jzg.commons.entity.quote.vo.CarInfoVo;
+import com.jzg.quotation.hengbang.crawler.entity.response.HbCrawlerQueryUserInfoResponse;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serial;
+
+@Data
+@NoArgsConstructor
+public class HbCrawlerQueryCarInfoRequest extends HbBaseRequest{
+
+    @Serial
+    private static final long serialVersionUID = 0216655622031141673577L;
+
+    private String licenseNo;
+    private String frameno;
+    private String brandName;
+    private String companyCode;
+
+    public HbCrawlerQueryCarInfoRequest(CarInfoVo carInfoVo, HbCrawlerQueryUserInfoResponse userInfoResponse){
+        this.licenseNo = carInfoVo.getLicenseNo();
+        this.frameno = carInfoVo.getVinNo();
+        this.brandName = carInfoVo.getBrandName();
+        this.companyCode = userInfoResponse.getUserInfo().get(0).getCompanyCode();
+    }
+}

+ 18 - 9
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerQueryCarRequest.java

@@ -1,11 +1,14 @@
 package com.jzg.quotation.hengbang.crawler.entity.request;
 package com.jzg.quotation.hengbang.crawler.entity.request;
 
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NoArgsConstructor;
 
 
 import java.io.Serial;
 import java.io.Serial;
 import java.io.Serializable;
 import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
 
 
 /**
 /**
  * @description: 恒邦财险 车型查询 请求参数
  * @description: 恒邦财险 车型查询 请求参数
@@ -29,16 +32,18 @@ public class HbCrawlerQueryCarRequest extends HbBaseRequest {
     @Serial
     @Serial
     private static final long serialVersionUID = 2573166312583296895L;
     private static final long serialVersionUID = 2573166312583296895L;
 
 
-    public HbCrawlerQueryCarRequest(String brand, String modelCode, Integer VehicleStyleUniqueId) {
-        this.cbitData = new CbitDataDTO(brand, modelCode, VehicleStyleUniqueId);
+    public HbCrawlerQueryCarRequest(CbitDataDTO cbitDataDTO) {
+        List<CbitDataDTO> cbitData = new ArrayList<CbitDataDTO>();
+        cbitData.add(cbitDataDTO);
+        this.cbitData = cbitData;
         this.pageNo = 0;
         this.pageNo = 0;
         this.pageSize = 5;
         this.pageSize = 5;
     }
     }
-
-    private CbitDataDTO cbitData;
-
+    @JsonProperty("cbitData")
+    private List<CbitDataDTO>  cbitData;
+    @JsonProperty("pageNo")
     private Integer pageNo;
     private Integer pageNo;
-
+    @JsonProperty("pageSize")
     private Integer pageSize;
     private Integer pageSize;
 
 
     @Data
     @Data
@@ -47,8 +52,12 @@ public class HbCrawlerQueryCarRequest extends HbBaseRequest {
     public static class CbitDataDTO implements Serializable {
     public static class CbitDataDTO implements Serializable {
         @Serial
         @Serial
         private static final long serialVersionUID = 5943174137237635474L;
         private static final long serialVersionUID = 5943174137237635474L;
-        private String Brand;
-        private String ModelCode;
-        private Integer VehicleStyleUniqueId;
+
+        @JsonProperty("Brand")
+        private String brand;
+        @JsonProperty("ModelCode")
+        private String modelCode;
+        @JsonProperty("VehicleStyleUniqueId")
+        private Integer vehicleStyleUniqueId;
     }
     }
 }
 }

+ 90 - 24
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerQuoteimmediatelyRequest.java

@@ -1,5 +1,6 @@
 package com.jzg.quotation.hengbang.crawler.entity.request;
 package com.jzg.quotation.hengbang.crawler.entity.request;
 
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
 import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
 import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
@@ -7,9 +8,15 @@ import com.jzg.quotation.hengbang.crawler.entity.HengBangCrawlerConfigureParamet
 import com.jzg.quotation.hengbang.crawler.entity.dto.HbEncDTO;
 import com.jzg.quotation.hengbang.crawler.entity.dto.HbEncDTO;
 import com.jzg.quotation.hengbang.crawler.entity.response.HbCrawlerQueryCarResponse;
 import com.jzg.quotation.hengbang.crawler.entity.response.HbCrawlerQueryCarResponse;
 import lombok.Data;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 
 import java.io.Serial;
 import java.io.Serial;
 import java.io.Serializable;
 import java.io.Serializable;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
 
 
 /**
 /**
  * @description: 恒邦财险 报价第一步 提交基础数据,返回投保单号
  * @description: 恒邦财险 报价第一步 提交基础数据,返回投保单号
@@ -17,6 +24,7 @@ import java.io.Serializable;
  * @date: 2025/4/9 09:56
  * @date: 2025/4/9 09:56
  **/
  **/
 @Data
 @Data
+@NoArgsConstructor
 public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
 public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
     @Serial
     @Serial
     private static final long serialVersionUID = -4097447719083993314L;
     private static final long serialVersionUID = -4097447719083993314L;
@@ -36,8 +44,8 @@ public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
         //设置车辆信息
         //设置车辆信息
         carInsureItemDTO.setEnergyType(carInfoVo.getEnergyTypeCode());
         carInsureItemDTO.setEnergyType(carInfoVo.getEnergyTypeCode());
         carInsureItemDTO.setLicenseNo(carInfoVo.getLicenseNo());
         carInsureItemDTO.setLicenseNo(carInfoVo.getLicenseNo());
-        carInsureItemDTO.setEnrollDate(carInfoVo.getRegisterDate());
-        carInsureItemDTO.setIssueDate(carInfoVo.getIssueDate());
+        carInsureItemDTO.setEnrollDate(dateFormat(carInfoVo.getRegisterDate()));
+        carInsureItemDTO.setIssueDate(dateFormat(carInfoVo.getIssueDate()));
         carInsureItemDTO.setFrameNo(carInfoVo.getVinNo());
         carInsureItemDTO.setFrameNo(carInfoVo.getVinNo());
         carInsureItemDTO.setEngineNo(carInfoVo.getEngineNo());
         carInsureItemDTO.setEngineNo(carInfoVo.getEngineNo());
         carInsureItemDTO.setPrintBrandName(contentDTO.getModelCName());
         carInsureItemDTO.setPrintBrandName(contentDTO.getModelCName());
@@ -45,19 +53,31 @@ public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
         carInsureItemDTO.setCarKindCode(carInfoVo.getCarKindCode());
         carInsureItemDTO.setCarKindCode(carInfoVo.getCarKindCode());
         carInsureItemDTO.setUsenatureCode(carInfoVo.getCarNatureCode());
         carInsureItemDTO.setUsenatureCode(carInfoVo.getCarNatureCode());
         carInsureItemDTO.setCarUseType(carInfoVo.getVehicleUseCode());
         carInsureItemDTO.setCarUseType(carInfoVo.getVehicleUseCode());
-        carInsureItemDTO.setNegotiationValue(Integer.parseInt(depreciationPrice));
+        carInsureItemDTO.setNegotiationValue(Double.parseDouble(depreciationPrice));
         carInsureItemDTO.setLicenseKindCode(carInfoVo.getLicenseKindCode());
         carInsureItemDTO.setLicenseKindCode(carInfoVo.getLicenseKindCode());
         carInsureItemDTO.setVehicleType(carInfoVo.getCarTypeCode());
         carInsureItemDTO.setVehicleType(carInfoVo.getCarTypeCode());
         carInsureItemDTO.setTransferDate(carInfoVo.getTransferDate());
         carInsureItemDTO.setTransferDate(carInfoVo.getTransferDate());
         carInsureItemDTO.setSeatCount(contentDTO.getSeatCount());
         carInsureItemDTO.setSeatCount(contentDTO.getSeatCount());
-        carInsureItemDTO.setPurchasePrice(Integer.parseInt(contentDTO.getPurchasePriceNotTax()));
-        carInsureItemDTO.setExhaustscale(String.valueOf(contentDTO.getExhaustScale()));
+        carInsureItemDTO.setPurchasePrice(Double.parseDouble(contentDTO.getPurchasePriceNotTax()));
         carInsureItemDTO.setExhaustscale(String.valueOf(contentDTO.getExhaustScale()));
         carInsureItemDTO.setExhaustscale(String.valueOf(contentDTO.getExhaustScale()));
+        carInsureItemDTO.setExhaustScale1(String.valueOf(contentDTO.getExhaustScale()));
         carInsureItemDTO.setPower(contentDTO.getPower());
         carInsureItemDTO.setPower(contentDTO.getPower());
         carInsureItemDTO.setTonCount(carInfoVo.getTonCount());
         carInsureItemDTO.setTonCount(carInfoVo.getTonCount());
         carInsureItemDTO.setCompleteKerbMass(String.valueOf(contentDTO.getCompleteKerbMass()));
         carInsureItemDTO.setCompleteKerbMass(String.valueOf(contentDTO.getCompleteKerbMass()));
-        carInsureItemDTO.setActualValue(Integer.parseInt(depreciationPrice));
-
+        carInsureItemDTO.setActualValue(Double.parseDouble(depreciationPrice));
+        carInsureItemDTO.setModelCode(contentDTO.getModelCode());
+        carInsureItemDTO.setFamilyName(contentDTO.getFamilyName());
+        carInsureItemDTO.setAttachNature(carInfoVo.getPropertyCode());
+        carInsureItemDTO.setCiModelCode(contentDTO.getCimodelCode());
+        carInsureItemDTO.setPurchasePriceNotTax(Double.parseDouble(contentDTO.getPurchasePriceNotTax()));
+        carInsureItemDTO.setStyleUniqueId(contentDTO.getVehicleStyleUniqueId());
+        carInsureItemDTO.setCountyCode(ownersInfo.getCountyCode());
+        carInsureItemDTO.setCountyNameArray(new StringBuilder(ownersInfo.getProvince()).append(",").append(ownersInfo.getCity()).append(",").append(ownersInfo.getCounty()).toString());
+        carInsureItemDTO.setCountyCodeArray(new StringBuilder(ownersInfo.getProvinceCode()).append(",").append(ownersInfo.getCityCode()).append(",").append(ownersInfo.getCountyCode()).toString());
+        carInsureItemDTO.setPostCode(ownersInfo.getCountyCode());
+        carInsureItemDTO.setChgownerFlag(carInfoVo.isTransfer()? "1" : "0");
+        carInsureItemDTO.setSpecialCarFlag("1");
+        this.carInsureItem = carInsureItemDTO;
         //设置被保人
         //设置被保人
         CarInsureRiskRelatedPartyDTO riskRelatedPartyDTO = new CarInsureRiskRelatedPartyDTO();
         CarInsureRiskRelatedPartyDTO riskRelatedPartyDTO = new CarInsureRiskRelatedPartyDTO();
         riskRelatedPartyDTO.setName(insuredPersonInfo.getName());
         riskRelatedPartyDTO.setName(insuredPersonInfo.getName());
@@ -67,13 +87,20 @@ public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
         riskRelatedPartyDTO.setBirthday(insuredPersonInfo.getBirthday());
         riskRelatedPartyDTO.setBirthday(insuredPersonInfo.getBirthday());
         riskRelatedPartyDTO.setEmail(insuredPersonInfo.getEmail());
         riskRelatedPartyDTO.setEmail(insuredPersonInfo.getEmail());
         riskRelatedPartyDTO.setCountyCode(insuredPersonInfo.getCountyCode());
         riskRelatedPartyDTO.setCountyCode(insuredPersonInfo.getCountyCode());
-        riskRelatedPartyDTO.setCountyNameArray(new StringBuilder(insuredPersonInfo.getProvince()).append(",").append(insuredPersonInfo.getCity()).append(",").append(insuredPersonInfo.getCounty()).toString());
-        riskRelatedPartyDTO.setCountyCodeArray(new StringBuilder(insuredPersonInfo.getProvinceCode()).append(",").append(insuredPersonInfo.getCityCode()).append(",").append(insuredPersonInfo.getCountyCode()).toString());
+        riskRelatedPartyDTO.setPostCode(insuredPersonInfo.getCountyCode());
+        riskRelatedPartyDTO.setCountyNameArray(new StringBuilder(insuredPersonInfo.getProvince()).append(",").append(insuredPersonInfo.getCity()).append(",").append(insuredPersonInfo.getCounty()).toString());
+        riskRelatedPartyDTO.setCountyCodeArray(new StringBuilder(insuredPersonInfo.getProvinceCode()).append(",").append(insuredPersonInfo.getCityCode()).append(",").append(insuredPersonInfo.getCountyCode()).toString());
         riskRelatedPartyDTO.setSex(insuredPersonInfo.getGender());
         riskRelatedPartyDTO.setSex(insuredPersonInfo.getGender());
         riskRelatedPartyDTO.setAddress(insuredPersonInfo.getAddr());
         riskRelatedPartyDTO.setAddress(insuredPersonInfo.getAddr());
-        riskRelatedPartyDTO.setValidityBegintime(insuredPersonInfo.getIdentifyValidDate());
-        riskRelatedPartyDTO.setValidityEndTime(insuredPersonInfo.getIdentifyValidEndDate());
-
+        riskRelatedPartyDTO.setValidityBegintime(dateFormat(insuredPersonInfo.getIdentifyValidDate()));
+        riskRelatedPartyDTO.setValidityEndTime(dateFormat(insuredPersonInfo.getIdentifyValidEndDate()));
+        riskRelatedPartyDTO.setInsuredType("1");
+        riskRelatedPartyDTO.setCompany("00");
+        riskRelatedPartyDTO.setPosition("60");
+        riskRelatedPartyDTO.setCustomerType("00");
+        riskRelatedPartyDTO.setVipInd("0");
+        riskRelatedPartyDTO.setRelationshipToInsrnt(policyHolderInfo.getName().equals(insuredPersonInfo.getName())? "6" : "0");
+        this.carInsureRiskRelatedParty = riskRelatedPartyDTO;
         //设置投保人数据
         //设置投保人数据
         CarInsureRelatedPartyDTO carInsureRelatedPartyDTO = new CarInsureRelatedPartyDTO();
         CarInsureRelatedPartyDTO carInsureRelatedPartyDTO = new CarInsureRelatedPartyDTO();
         carInsureRelatedPartyDTO.setName(policyHolderInfo.getName());
         carInsureRelatedPartyDTO.setName(policyHolderInfo.getName());
@@ -83,14 +110,20 @@ public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
         carInsureRelatedPartyDTO.setBirthday(policyHolderInfo.getBirthday());
         carInsureRelatedPartyDTO.setBirthday(policyHolderInfo.getBirthday());
         carInsureRelatedPartyDTO.setEmail(policyHolderInfo.getEmail());
         carInsureRelatedPartyDTO.setEmail(policyHolderInfo.getEmail());
         carInsureRelatedPartyDTO.setCountyCode(policyHolderInfo.getCountyCode());
         carInsureRelatedPartyDTO.setCountyCode(policyHolderInfo.getCountyCode());
-        carInsureRelatedPartyDTO.setCountyNameArray(new StringBuilder(policyHolderInfo.getProvince()).append(",").append(policyHolderInfo.getCity()).append(",").append(policyHolderInfo.getCounty()).toString());
-        carInsureRelatedPartyDTO.setCountyCodeArray(new StringBuilder(policyHolderInfo.getProvinceCode()).append(",").append(policyHolderInfo.getCityCode()).append(",").append(policyHolderInfo.getCountyCode()).toString());
+        carInsureRelatedPartyDTO.setPostCode(policyHolderInfo.getCountyCode());
+        carInsureRelatedPartyDTO.setCountyNameArray(new StringBuilder(policyHolderInfo.getProvince()).append(",").append(policyHolderInfo.getCity()).append(",").append(policyHolderInfo.getCounty()).toString());
+        carInsureRelatedPartyDTO.setCountyCodeArray(new StringBuilder(policyHolderInfo.getProvinceCode()).append(",").append(policyHolderInfo.getCityCode()).append(",").append(policyHolderInfo.getCountyCode()).toString());
         carInsureRelatedPartyDTO.setSex(policyHolderInfo.getGender());
         carInsureRelatedPartyDTO.setSex(policyHolderInfo.getGender());
         carInsureRelatedPartyDTO.setAddress(policyHolderInfo.getAddr());
         carInsureRelatedPartyDTO.setAddress(policyHolderInfo.getAddr());
-        carInsureRelatedPartyDTO.setValidityBegintime(policyHolderInfo.getIdentifyValidDate());
-        carInsureRelatedPartyDTO.setValidityEndTime(insuredPersonInfo.getIdentifyValidEndDate());
-        carInsureRelatedPartyDTO.setInsuredType(parameters.getInvoiceType());
-
+        carInsureRelatedPartyDTO.setValidityBegintime(dateFormat(policyHolderInfo.getIdentifyValidDate()));
+        carInsureRelatedPartyDTO.setValidityEndTime(dateFormat(insuredPersonInfo.getIdentifyValidEndDate()));
+        carInsureRelatedPartyDTO.setInsuredType("1");
+        carInsureRelatedPartyDTO.setCompany("00");
+        carInsureRelatedPartyDTO.setPosition("60");
+        carInsureRelatedPartyDTO.setCustomerType("00");
+        carInsureRelatedPartyDTO.setVipInd("0");
+        carInsureRelatedPartyDTO.setInvoiceRequest("05");
+        this.carInsureRelatedParty = carInsureRelatedPartyDTO;
         //设置归属数据
         //设置归属数据
         CarInsureMainDTO carInsureMainDTO = new CarInsureMainDTO();
         CarInsureMainDTO carInsureMainDTO = new CarInsureMainDTO();
         HbEncDTO.SalesManDTO salesMan = saleInfo.getSalesMan();
         HbEncDTO.SalesManDTO salesMan = saleInfo.getSalesMan();
@@ -110,9 +143,38 @@ public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
         carInsureMainDTO.setMobile(salesMan.getMobile());
         carInsureMainDTO.setMobile(salesMan.getMobile());
         carInsureMainDTO.setSalesmanname(salesMan.getSalesmanname());
         carInsureMainDTO.setSalesmanname(salesMan.getSalesmanname());
         carInsureMainDTO.setUsertype(salesMan.getUsertype());
         carInsureMainDTO.setUsertype(salesMan.getUsertype());
-        carInsureMainDTO.setInvoiceRequest(parameters.getInvoiceType());
+        carInsureMainDTO.setInvoiceRequest("05");
         carInsureMainDTO.setOperatorCode(quoteVo.getOrder().getAttributionInformationVo().getUsername());
         carInsureMainDTO.setOperatorCode(quoteVo.getOrder().getAttributionInformationVo().getUsername());
         carInsureMainDTO.setCreator(quoteVo.getOrder().getAttributionInformationVo().getUsername());
         carInsureMainDTO.setCreator(quoteVo.getOrder().getAttributionInformationVo().getUsername());
+        carInsureMainDTO.setBusinessMode("2");
+        carInsureMainDTO.setBusinessModeName("代理");
+        carInsureMainDTO.setResourceType("HBXSH");
+        carInsureMainDTO.setAccountPeriod("账期");
+        this.carInsureMain = carInsureMainDTO;
+    }
+
+    private String dateFormat(String date){
+        // 1. 解析为 LocalDateTime
+        ZonedDateTime zdt = null;
+        if (date.length() == 10){
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            LocalDate ld = LocalDate.parse(date, formatter);
+            // 2. 补上 00:00:00,变成 LocalDateTime
+            LocalDateTime ldt = ld.atStartOfDay(); // 等价于 "2025-08-19T00:00:00"
+
+            // 3. 设置时区为 +08:00(北京/上海)
+            ZoneId zone = ZoneId.of("Asia/Shanghai");
+            zdt = ldt.atZone(zone);
+        }else{
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            LocalDateTime ldt = LocalDateTime.parse(date, formatter);
+            // 2. 指定时区(这里用 +08:00)
+            ZoneId zone = ZoneId.of("Asia/Shanghai"); // 等价于 +08:00
+            zdt = ldt.atZone(zone);
+        }
+        // 3. 格式化为 ISO-8601 带时区偏移的字符串
+        String result = zdt.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
+        return result;
     }
     }
 
 
     /**
     /**
@@ -214,7 +276,7 @@ public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
         /**
         /**
          * 协商价格
          * 协商价格
          */
          */
-        private Integer negotiationValue;
+        private Double negotiationValue;
         /**
         /**
          * 车牌种类
          * 车牌种类
          */
          */
@@ -242,15 +304,17 @@ public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
         /**
         /**
          * 新车购置价
          * 新车购置价
          */
          */
-        private Integer purchasePrice;
+        private Double purchasePrice;
         /**
         /**
          * 排量(cc)
          * 排量(cc)
          */
          */
+        @JsonProperty("exhaustscale")
         private String exhaustscale;
         private String exhaustscale;
         /**
         /**
          * 排量
          * 排量
          */
          */
-        private String exhaustScale;
+        @JsonProperty("exhaustScale")
+        private String exhaustScale1;
         /**
         /**
          * 功率(KW)
          * 功率(KW)
          */
          */
@@ -286,11 +350,11 @@ public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
         /**
         /**
          * 折旧价
          * 折旧价
          */
          */
-        private Integer actualValue;
+        private Double actualValue;
         /**
         /**
          *
          *
          */
          */
-        private Integer purchasePriceNotTax;
+        private Double purchasePriceNotTax;
         /**
         /**
          *
          *
          */
          */
@@ -323,6 +387,8 @@ public class HbCrawlerQuoteimmediatelyRequest extends HbBaseRequest {
          *
          *
          */
          */
         private String countyNameArray;
         private String countyNameArray;
+
+        private String postCode;
     }
     }
 
 
     @Data
     @Data

+ 0 - 18
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/response/HbCrawlerDepreciationResponse.java

@@ -1,18 +0,0 @@
-package com.jzg.quotation.hengbang.crawler.entity.response;
-
-import lombok.Data;
-
-import java.io.Serial;
-
-/**
- * @description: 恒邦财险 获取折旧价 返回参数
- * @author: shenwd
- * @date: 2025/4/8 16:02
- **/
-@Data
-public class HbCrawlerDepreciationResponse extends HbBaseResponse{
-    @Serial
-    private static final long serialVersionUID = 8099798304263496357L;
-
-    private Double depreciationRate;
-}

+ 62 - 0
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/response/HbCrawlerQueryCarResponse.java

@@ -1,5 +1,6 @@
 package com.jzg.quotation.hengbang.crawler.entity.response;
 package com.jzg.quotation.hengbang.crawler.entity.response;
 
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.quotation.commons.filter.CarModelsFilter;
 import com.jzg.quotation.commons.filter.CarModelsFilter;
 import lombok.Data;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NoArgsConstructor;
@@ -126,14 +127,28 @@ public class HbCrawlerQueryCarResponse extends HbBaseResponse {
     @Serial
     @Serial
     private static final long serialVersionUID = -8624231841629870165L;
     private static final long serialVersionUID = -8624231841629870165L;
 
 
+    @JsonProperty("totalElements")
     private Integer totalElements;
     private Integer totalElements;
+
+    @JsonProperty("totalPages")
     private Integer totalPages;
     private Integer totalPages;
+
+    @JsonProperty("last")
     private Boolean last;
     private Boolean last;
+
+    @JsonProperty("first")
     private Boolean first;
     private Boolean first;
+
+    @JsonProperty("numberOfElements")
     private Integer numberOfElements;
     private Integer numberOfElements;
+
+    @JsonProperty("size")
     private Integer size;
     private Integer size;
+
+    @JsonProperty("number")
     private Integer number;
     private Integer number;
 
 
+    @JsonProperty("content")
     private List<ContentDTO> content;
     private List<ContentDTO> content;
 
 
     @Data
     @Data
@@ -141,29 +156,76 @@ public class HbCrawlerQueryCarResponse extends HbBaseResponse {
         @Serial
         @Serial
         private static final long serialVersionUID = 2286931992313421081L;
         private static final long serialVersionUID = 2286931992313421081L;
 
 
+        @JsonProperty("modelCode")
         private String modelCode;
         private String modelCode;
+
+        @JsonProperty("modelCName")
         private String modelCName;
         private String modelCName;
+
+        @JsonProperty("carBrand")
         private String carBrand;
         private String carBrand;
+
+        @JsonProperty("familyName")
         private String familyName;
         private String familyName;
+
+        @JsonProperty("vehicleClass")
         private String vehicleClass;
         private String vehicleClass;
+
+        @JsonProperty("carStyle")
         private String carStyle;
         private String carStyle;
+
+        @JsonProperty("exhaustScale")
         private Double exhaustScale;
         private Double exhaustScale;
+
+        @JsonProperty("power")
         private String power;
         private String power;
+
+        @JsonProperty("seatCount")
         private String seatCount;
         private String seatCount;
+
+        @JsonProperty("carYear")
         private String carYear;
         private String carYear;
+
+        @JsonProperty("purchasePrice")
         private String purchasePrice;
         private String purchasePrice;
+
+        @JsonProperty("transmissiontType")
         private String transmissiontType;
         private String transmissiontType;
+
+        @JsonProperty("remark")
         private String remark;
         private String remark;
+
+        @JsonProperty("completeKerbMass")
         private Double completeKerbMass;
         private Double completeKerbMass;
+
+        @JsonProperty("carKind")
         private String carKind;
         private String carKind;
+
+        @JsonProperty("purchasePriceNotTax")
         private String purchasePriceNotTax;
         private String purchasePriceNotTax;
+
+        @JsonProperty("cimodelCode")
         private String cimodelCode;
         private String cimodelCode;
+
+        @JsonProperty("cimodelName")
         private String cimodelName;
         private String cimodelName;
+
+        @JsonProperty("cimodelCodeC")
         private String cimodelCodeC;
         private String cimodelCodeC;
+
+        @JsonProperty("ciModelNameC")
         private String ciModelNameC;
         private String ciModelNameC;
+
+        @JsonProperty("energyType")
         private String energyType;
         private String energyType;
+
+        @JsonProperty("noticeType")
         private String noticeType;
         private String noticeType;
+
+        @JsonProperty("vehicleStyleUniqueId")
         private String vehicleStyleUniqueId;
         private String vehicleStyleUniqueId;
+
+        @JsonProperty("dataType")
         private String dataType;
         private String dataType;
     }
     }
 
 

+ 25 - 0
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/response/HbCrawlerQueryUserInfoResponse.java

@@ -0,0 +1,25 @@
+package com.jzg.quotation.hengbang.crawler.entity.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@NoArgsConstructor
+public class HbCrawlerQueryUserInfoResponse {
+
+    @JsonProperty("userInfo")
+    private List<UserInfo> userInfo;
+
+    @Data
+    public static class UserInfo{
+
+        @JsonProperty("COMPANYCODE")
+        private String companyCode;
+
+    }
+
+
+}

+ 30 - 21
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/service/Impl/HengBangCrawlerRequestImpl.java

@@ -30,6 +30,7 @@ import com.jzg.quotation.hengbang.crawler.service.HengBangCrawlerRequest;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpHeaders;
 
 
+
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -65,19 +66,25 @@ public class HengBangCrawlerRequestImpl implements HengBangCrawlerRequest {
      */
      */
     @Override
     @Override
     public QuoteResultsVo quote(QuoteVo quoteVo) throws JsonProcessingException {
     public QuoteResultsVo quote(QuoteVo quoteVo) throws JsonProcessingException {
-        // 1.0获取token的请求头
+        // 1.0 获取token的请求头
         AttributionInformationVo attributionInformationVo = quoteVo.getOrder().getAttributionInformationVo();
         AttributionInformationVo attributionInformationVo = quoteVo.getOrder().getAttributionInformationVo();
         HttpHeaders headers = hbCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
         HttpHeaders headers = hbCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
-        //获取配置信息
+        // 1.1获取配置信息
         HengBangCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HengBangCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
         HengBangCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HengBangCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
 
 
-        //获取车型
+        // 2.0 获取车型
+        // 2.1 获取系统用户信息
+        HbCrawlerQueryUserInfoResponse userInfoResponse = hbCrawlerRequestComponent.queryUserInfo(attributionInformationVo.getUsername());
         CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
         CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
-        HbCrawlerQueryCarRequest hbCrawlerQueryCarRequest = new HbCrawlerQueryCarRequest(carInfoVo.getBrandName(), carInfoVo.getVinNo(), parameters.getVehicleStyleUniqueId());
+        // 2.2 获取行业车型信息
+        HbCrawlerQueryCarInfoRequest queryCarInfoRequest = new HbCrawlerQueryCarInfoRequest(carInfoVo, userInfoResponse);
+        HbCrawlerQueryCarRequest.CbitDataDTO cbitDataDTO = hbCrawlerRequestComponent.queryCarInfo(queryCarInfoRequest,headers);
+        // 2.3 车型查询
+        HbCrawlerQueryCarRequest hbCrawlerQueryCarRequest = new HbCrawlerQueryCarRequest(cbitDataDTO);
         List<HbCrawlerQueryCarResponse.ContentDTO> contentDTOS = hbCrawlerRequestComponent.queryCar(hbCrawlerQueryCarRequest, headers);
         List<HbCrawlerQueryCarResponse.ContentDTO> contentDTOS = hbCrawlerRequestComponent.queryCar(hbCrawlerQueryCarRequest, headers);
-        //过滤车型
+        // 2.4 过滤车型
         HbCrawlerQueryCarResponse.ContentDTO contentDTO = CarModelsFilterUtils.to(contentDTOS, carInfoVo);
         HbCrawlerQueryCarResponse.ContentDTO contentDTO = CarModelsFilterUtils.to(contentDTOS, carInfoVo);
-        //查询归属信息
+        // 3.0 查询归属信息
         String phoneNumber = hbCrawlerRequestComponent.getPhoneNumber(attributionInformationVo.getUsername());
         String phoneNumber = hbCrawlerRequestComponent.getPhoneNumber(attributionInformationVo.getUsername());
         HbCrawlerSaleInfoRequest saleInfoRequest = new HbCrawlerSaleInfoRequest(phoneNumber);
         HbCrawlerSaleInfoRequest saleInfoRequest = new HbCrawlerSaleInfoRequest(phoneNumber);
         HbEncDTO salesInfo;
         HbEncDTO salesInfo;
@@ -86,26 +93,26 @@ public class HengBangCrawlerRequestImpl implements HengBangCrawlerRequest {
         } catch (Exception e) {
         } catch (Exception e) {
             throw new SystemException(e.getMessage());
             throw new SystemException(e.getMessage());
         }
         }
-        //获取折旧价
-        RiskInfoVo biRiskInfoVo = quoteVo.getBiRiskInfoVo();
-        HbCrawlerDepreciationRequest depreciationRequest = new HbCrawlerDepreciationRequest(carInfoVo, biRiskInfoVo.getStartDate(), biRiskInfoVo.getRiskCode(), contentDTO);
+        // 4.0 获取折旧价
+        HbCrawlerDepreciationRequest depreciationRequest = new HbCrawlerDepreciationRequest(quoteVo,contentDTO);
         String depreciationPrice = hbCrawlerRequestComponent.getDepreciationPrice(depreciationRequest, headers);
         String depreciationPrice = hbCrawlerRequestComponent.getDepreciationPrice(depreciationRequest, headers);
 
 
-        //报价第一步,提交基础数据,返回订单号
+        // 5.0 报价第一步,提交基础数据,返回订单号
         HbCrawlerQuoteimmediatelyRequest quoteimmediatelyRequest = new HbCrawlerQuoteimmediatelyRequest(quoteVo, salesInfo, depreciationPrice, parameters, contentDTO);
         HbCrawlerQuoteimmediatelyRequest quoteimmediatelyRequest = new HbCrawlerQuoteimmediatelyRequest(quoteVo, salesInfo, depreciationPrice, parameters, contentDTO);
         String plyappno = hbCrawlerRequestComponent.quoteImmediately(quoteimmediatelyRequest, headers);
         String plyappno = hbCrawlerRequestComponent.quoteImmediately(quoteimmediatelyRequest, headers);
-        //报价第二步,提交报价数据,返回是否重复投保,脱保等提示信息,用于页面展示
+        // 5.1 报价第二步,提交报价数据,返回是否重复投保,脱保等提示信息,用于页面展示
         HbCrawlerCalculationRequest calculationRequest = new HbCrawlerCalculationRequest(quoteVo, plyappno);
         HbCrawlerCalculationRequest calculationRequest = new HbCrawlerCalculationRequest(quoteVo, plyappno);
-        Map<String, Object> calculationResult = hbCrawlerRequestComponent.getCalculationResult(calculationRequest, headers);
-        //报价第三步,获取报价数据
-        HbCrawlerProposalResponse proposalResponse = hbCrawlerRequestComponent.proposal(plyappno, headers);
-
-        HbCrawlerOrder hbCrawlerOrder = new HbCrawlerOrder();
-        hbCrawlerOrder.setOrdersNo(quoteVo.getOrder().getOrdersNo());
-        hbCrawlerOrder.setPlyappno(plyappno);
-        hbCrawlerOrderService.save(hbCrawlerOrder);
-
-        return HbCrawlerQuoteResultVoBuild.build(quoteVo, proposalResponse);
+        String calculationResult = hbCrawlerRequestComponent.getCalculationResult(calculationRequest, headers);
+        HbCrawlerProposalResponse proposalResponse = null;
+        if(calculationResult.equals("成功")){
+            // 5.2 报价第三步,获取报价数据
+            proposalResponse = hbCrawlerRequestComponent.proposal(plyappno, headers);
+            HbCrawlerOrder hbCrawlerOrder = new HbCrawlerOrder();
+            hbCrawlerOrder.setOrdersNo(quoteVo.getOrder().getOrdersNo());
+            hbCrawlerOrder.setPlyappno(plyappno);
+            hbCrawlerOrderService.save(hbCrawlerOrder);
+        }
+        return HbCrawlerQuoteResultVoBuild.build(quoteVo, proposalResponse, calculationResult);
     }
     }
 
 
     /**
     /**
@@ -251,4 +258,6 @@ public class HengBangCrawlerRequestImpl implements HengBangCrawlerRequest {
         HbCrawlerOrderStateResponse orderStateResponse = hbCrawlerRequestComponent.orderState(parameters.getLicenseNo(), parameters.getAppTime(), attributionInformationVo.getUsername(), headers);
         HbCrawlerOrderStateResponse orderStateResponse = hbCrawlerRequestComponent.orderState(parameters.getLicenseNo(), parameters.getAppTime(), attributionInformationVo.getUsername(), headers);
         return null;
         return null;
     }
     }
+
+
 }
 }

File diff suppressed because it is too large
+ 0 - 0
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/utils/HengBangAESUtil.java


+ 5 - 3
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java

@@ -25,6 +25,7 @@ import org.redisson.api.RBucket;
 import org.redisson.api.RedissonClient;
 import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.Objects;
 import java.util.Objects;
@@ -125,6 +126,7 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
     }
     }
 
 
     @Override
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void verifyAmount(AmountAuditEditParam param) {
     public void verifyAmount(AmountAuditEditParam param) {
         SysAmountAuditing audit = this.getById(param.getId());
         SysAmountAuditing audit = this.getById(param.getId());
         if(audit.getAuditingStatus() > 0){
         if(audit.getAuditingStatus() > 0){
@@ -152,9 +154,9 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
                 // 更新用户账户
                 // 更新用户账户
                 SysUserAccount userAccount = userAccountService.queryByUserId(audit.getUserId());
                 SysUserAccount userAccount = userAccountService.queryByUserId(audit.getUserId());
                 AssertionUtils.isFail(Objects.isNull(userAccount), "用户账户数据异常!");
                 AssertionUtils.isFail(Objects.isNull(userAccount), "用户账户数据异常!");
-                AssertionUtils.isFail(audit.getAmount().compareTo(userAccount.getSumAmountUnpaid()) > 0, "提现金额大于账户余额!");
-                userAccount.setSumAmountPaid(audit.getAmount());
-                userAccount.setSumAmountUnpaid(userAccount.getSumAmountUnpaid().add(audit.getAmount()));
+                AssertionUtils.isFail(audit.getAmount().compareTo(audit.getBalanceAmount()) > 0, "提现金额大于账户余额!");
+                userAccount.setSumAmountPaid(userAccount.getSumAmountPaid().add(audit.getAmount()));
+                userAccount.setSumAmountUnpaid(userAccount.getSumAmountUnpaid().subtract(audit.getAmount()));
                 userAccountService.saveOrUpdate(userAccount);
                 userAccountService.saveOrUpdate(userAccount);
             }else{
             }else{
                 AssertionUtils.isFail(true, "提现申请已被" + audit.getReceiveUser() + "领取!");
                 AssertionUtils.isFail(true, "提现申请已被" + audit.getReceiveUser() + "领取!");

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/state/AuditState.java

@@ -8,7 +8,7 @@ public class AuditState {
         // 审核通过
         // 审核通过
         SUCCESS_AUDIT(1),
         SUCCESS_AUDIT(1),
         // 审核失败
         // 审核失败
-        FAIL_AUDIT(1);
+        FAIL_AUDIT(2);
 
 
         private final int value;
         private final int value;
 
 

+ 8 - 7
tenant/organization/src/main/java/com/jzg/organization/state/listener/AuditStateListener.java

@@ -4,6 +4,7 @@ import com.jzg.commons.core.base.StateResult;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.organization.state.AuditState;
 import com.jzg.organization.state.AuditState;
 import jakarta.annotation.Resource;
 import jakarta.annotation.Resource;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.messaging.Message;
 import org.springframework.messaging.Message;
 import org.springframework.messaging.support.MessageBuilder;
 import org.springframework.messaging.support.MessageBuilder;
 import org.springframework.statemachine.StateMachine;
 import org.springframework.statemachine.StateMachine;
@@ -19,15 +20,15 @@ import java.util.concurrent.atomic.AtomicBoolean;
 public class AuditStateListener {
 public class AuditStateListener {
 
 
     @Resource
     @Resource
-    private StateMachine<AuditState.AuditStateEnum, AuditState.AuditStateEvent> costStateMachine;
+    private StateMachine<AuditState.AuditStateEnum, AuditState.AuditStateEvent> auditStateMachine;
 
 
     private synchronized boolean sendEvent(Mono<Message<AuditState.AuditStateEvent>> message) {
     private synchronized boolean sendEvent(Mono<Message<AuditState.AuditStateEvent>> message) {
         AtomicBoolean result = new AtomicBoolean(false);
         AtomicBoolean result = new AtomicBoolean(false);
         try {
         try {
-            costStateMachine.stop(); // 停止状态机
+            auditStateMachine.stop(); // 停止状态机
             Message<AuditState.AuditStateEvent> block = message.block();
             Message<AuditState.AuditStateEvent> block = message.block();
             String orderStatus = (String) block.getHeaders().get("entity");
             String orderStatus = (String) block.getHeaders().get("entity");
-            costStateMachine.getStateMachineAccessor().doWithAllRegions(accessor -> {
+            auditStateMachine.getStateMachineAccessor().doWithAllRegions(accessor -> {
                 accessor.resetStateMachineReactively(new DefaultStateMachineContext<>(
                 accessor.resetStateMachineReactively(new DefaultStateMachineContext<>(
                         // 目标状态
                         // 目标状态
                         AuditState.AuditStateEnum.fromValue(Integer.parseInt(orderStatus)),
                         AuditState.AuditStateEnum.fromValue(Integer.parseInt(orderStatus)),
@@ -36,10 +37,10 @@ public class AuditStateListener {
                         null  // 转换历史(通常为 null)
                         null  // 转换历史(通常为 null)
                 )).block();
                 )).block();
             });
             });
-            Mono<Void> startMono = costStateMachine.startReactively(); //启用状态机
+            Mono<Void> startMono = auditStateMachine.startReactively(); //启用状态机
             startMono.block();
             startMono.block();
 
 
-            Flux<StateMachineEventResult<AuditState.AuditStateEnum, AuditState.AuditStateEvent>> stateMachineEventResultFlux = costStateMachine.sendEvent(message);
+            Flux<StateMachineEventResult<AuditState.AuditStateEnum, AuditState.AuditStateEvent>> stateMachineEventResultFlux = auditStateMachine.sendEvent(message);
             StateMachineEventResult<AuditState.AuditStateEnum, AuditState.AuditStateEvent> eventResult = stateMachineEventResultFlux.blockFirst();
             StateMachineEventResult<AuditState.AuditStateEnum, AuditState.AuditStateEvent> eventResult = stateMachineEventResultFlux.blockFirst();
 
 
             if (eventResult != null && eventResult.getResultType() == StateMachineEventResult.ResultType.ACCEPTED) {
             if (eventResult != null && eventResult.getResultType() == StateMachineEventResult.ResultType.ACCEPTED) {
@@ -48,7 +49,7 @@ public class AuditStateListener {
         } catch (Exception e) {
         } catch (Exception e) {
 
 
         } finally {
         } finally {
-            costStateMachine.stopReactively();
+            auditStateMachine.stopReactively();
             return result.get();
             return result.get();
         }
         }
     }
     }
@@ -57,7 +58,7 @@ public class AuditStateListener {
         StateResult stateResult = new StateResult();
         StateResult stateResult = new StateResult();
         Mono<Message<AuditState.AuditStateEvent>> message = Mono.just(MessageBuilder.withPayload(event).setHeader("entity",auditStatus).build());
         Mono<Message<AuditState.AuditStateEvent>> message = Mono.just(MessageBuilder.withPayload(event).setHeader("entity",auditStatus).build());
         stateResult.setResult(sendEvent(message));
         stateResult.setResult(sendEvent(message));
-        stateResult.setCurrentState(costStateMachine.getState().getId().getValue());
+        stateResult.setCurrentState(auditStateMachine.getState().getId().getValue());
         return stateResult;
         return stateResult;
     }
     }
 
 

+ 1 - 0
tenant/organization/src/main/resources/application.yml

@@ -71,6 +71,7 @@ tenant:
     - ins_orders_car_info
     - ins_orders_car_info
     - ins_orders_policy
     - ins_orders_policy
     - sys_relation_person
     - sys_relation_person
+    - sys_user_account
 
 
 
 
   ignoreLoginNames:
   ignoreLoginNames:

+ 2 - 2
tenant/organization/src/main/resources/mapper/SysUserAccountMapper.xml

@@ -54,7 +54,7 @@
         sys_user_account sua
         sys_user_account sua
         LEFT JOIN sys_user_jzg_info suji on suji.user_id = sua.user_id
         LEFT JOIN sys_user_jzg_info suji on suji.user_id = sua.user_id
         LEFT JOIN sys_user su on su.id = suji.user_id
         LEFT JOIN sys_user su on su.id = suji.user_id
-        LEFT JOIN sys_dept sd on sd.id = shji.dept_id
+        LEFT JOIN sys_dept sd on sd.id = suji.dept_id
         LEFT JOIN sys_organization_user_link soul on soul.user_id = suji.user_id
         LEFT JOIN sys_organization_user_link soul on soul.user_id = suji.user_id
         LEFT JOIN sys_organization so on soul.organization_id = so.id
         LEFT JOIN sys_organization so on soul.organization_id = so.id
         <where>
         <where>
@@ -68,6 +68,6 @@
                 and DATE_FORMAT(sua.create_time, '%Y-%m-%d') between #{param.createTimeStart} AND #{param.createTimeEnd}
                 and DATE_FORMAT(sua.create_time, '%Y-%m-%d') between #{param.createTimeStart} AND #{param.createTimeEnd}
             </if>
             </if>
         </where>
         </where>
-        ORDER BY sua create_time desc
+        ORDER BY sua.create_time desc
     </select>
     </select>
 </mapper>
 </mapper>

Some files were not shown because too many files changed in this diff