|
|
@@ -0,0 +1,73 @@
|
|
|
+package com.jzg.quotation.huanong.crawler.entity.request;
|
|
|
+
|
|
|
+import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
+import lombok.Data;
|
|
|
+import lombok.NoArgsConstructor;
|
|
|
+
|
|
|
+import java.io.Serial;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.LinkedHashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 华农财险核保意见查询请求
|
|
|
+ */
|
|
|
+@NoArgsConstructor
|
|
|
+@Data
|
|
|
+public class HuaNongCrawlerQueryReviveOpinionRequest implements HuaNongHeadRequest {
|
|
|
+
|
|
|
+ @Serial
|
|
|
+ private static final long serialVersionUID = 8309830212240733031L;
|
|
|
+
|
|
|
+ @JsonProperty("head")
|
|
|
+ private HuaNongCrawlerRequestBaseHead head;
|
|
|
+
|
|
|
+ @JsonProperty("operateType")
|
|
|
+ private String operateType;
|
|
|
+
|
|
|
+ @JsonProperty("contractMain")
|
|
|
+ private List<ContractMainDTO> contractMain;
|
|
|
+
|
|
|
+ @JsonProperty("loginCom")
|
|
|
+ private String loginCom;
|
|
|
+
|
|
|
+ public HuaNongCrawlerQueryReviveOpinionRequest(String token, String loginCom,
|
|
|
+ String ciPolicyNumber, String biPolicyNumber) {
|
|
|
+ this.head = new HuaNongCrawlerRequestBaseHead(token);
|
|
|
+ this.operateType = "-2";
|
|
|
+ this.loginCom = loginCom;
|
|
|
+ this.contractMain = new ArrayList<>();
|
|
|
+
|
|
|
+ Set<String> contractNumbers = new LinkedHashSet<>();
|
|
|
+ addContractNumber(contractNumbers, ciPolicyNumber);
|
|
|
+ addContractNumber(contractNumbers, biPolicyNumber);
|
|
|
+ contractNumbers.forEach(contractNo -> this.contractMain.add(new ContractMainDTO(contractNo)));
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void addContractNumber(Set<String> contractNumbers, String contractNo) {
|
|
|
+ if (contractNo != null && !contractNo.trim().isEmpty()) {
|
|
|
+ contractNumbers.add(contractNo.trim());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class ContractMainDTO {
|
|
|
+
|
|
|
+ @JsonProperty("businessType")
|
|
|
+ private String businessType;
|
|
|
+
|
|
|
+ @JsonProperty("contractNo")
|
|
|
+ private String contractNo;
|
|
|
+
|
|
|
+ @JsonProperty("remark")
|
|
|
+ private String remark;
|
|
|
+
|
|
|
+ public ContractMainDTO(String contractNo) {
|
|
|
+ this.businessType = "2";
|
|
|
+ this.contractNo = contractNo;
|
|
|
+ this.remark = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|