|
|
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
|
import com.jzg.quotation.guoren.crawler.entity.dto.GuoRenBcDTO;
|
|
|
import com.jzg.quotation.guoren.crawler.entity.response.GuoRenCrawlerCalculationPremiumData;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
import lombok.Data;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
|
|
|
@@ -43,6 +44,56 @@ public class GuoRenCrawlerProposalNoSaveRequest implements Serializable {
|
|
|
}
|
|
|
this.bi = biDto;
|
|
|
this.ci = guoRenCrawlerCalculationPremiumData.getCi();
|
|
|
+ // 将试算响应中的报价ID回填到bc中
|
|
|
+ fillProposalNoFromResponse(guoRenCrawlerCalculationPremiumData);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 从试算响应中提取报价ID,回填到保存请求的bc字段中
|
|
|
+ * 解决保司合规规则"报价ID缺失"问题
|
|
|
+ */
|
|
|
+ private void fillProposalNoFromResponse(GuoRenCrawlerCalculationPremiumData response) {
|
|
|
+ if (response == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 1. 从响应的BC中回填proposalNo到请求的BC
|
|
|
+ GuoRenCrawlerCalculationPremiumData.BcDTO responseBc = response.getBc();
|
|
|
+ if (responseBc != null) {
|
|
|
+ // 回填BC.prpTmain.proposalNo
|
|
|
+ if (responseBc.getPrpTmain() != null && StringUtils.hasText(responseBc.getPrpTmain().getProposalNo())) {
|
|
|
+ String bcProposalNo = responseBc.getPrpTmain().getProposalNo();
|
|
|
+ String bcDemandNo = responseBc.getPrpTmain().getDemandNo();
|
|
|
+ if (this.bc.getPrpTmain() != null) {
|
|
|
+ this.bc.getPrpTmain().setProposalNo(bcProposalNo);
|
|
|
+ this.bc.getPrpTmain().setDemandNo(bcDemandNo);
|
|
|
+ }
|
|
|
+ if (this.bc.getPrpTitemCar() != null) {
|
|
|
+ this.bc.getPrpTitemCar().setProposalNo(bcProposalNo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 2. 从响应的CI中回填proposalNo到ciInsureDemand
|
|
|
+ GuoRenCrawlerCalculationPremiumData.CiDTO responseCi = response.getCi();
|
|
|
+ if (responseCi != null && responseCi.getPrpTmain() != null
|
|
|
+ && StringUtils.hasText(responseCi.getPrpTmain().getProposalNo())) {
|
|
|
+ String ciProposalNo = responseCi.getPrpTmain().getProposalNo();
|
|
|
+ String demandNo = responseCi.getPrpTmain().getDemandNo();
|
|
|
+ if (this.ci != null && this.ci.getCiInsureDemand() != null) {
|
|
|
+ this.ci.getCiInsureDemand().setProposalNo(ciProposalNo);
|
|
|
+ this.ci.getCiInsureDemand().setDemandNo(demandNo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 3. 从响应的BI中回填proposalNo到ciInsureDemand
|
|
|
+ GuoRenCrawlerCalculationPremiumData.BiDTO responseBi = response.getBi();
|
|
|
+ if (responseBi != null && responseBi.getPrpTmain() != null
|
|
|
+ && StringUtils.hasText(responseBi.getPrpTmain().getProposalNo())) {
|
|
|
+ String biProposalNo = responseBi.getPrpTmain().getProposalNo();
|
|
|
+ String biDemandNo = responseBi.getPrpTmain().getDemandNo();
|
|
|
+ if (this.bi != null && this.bi.getCiInsureDemand() != null) {
|
|
|
+ this.bi.getCiInsureDemand().setProposalNo(biProposalNo);
|
|
|
+ this.bi.getCiInsureDemand().setDemandNo(biDemandNo);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|