|
|
@@ -49,49 +49,75 @@ public class GuoRenCrawlerProposalNoSaveRequest implements Serializable {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 从试算响应中提取报价ID,回填到保存请求的bc字段中
|
|
|
+ * 从试算响应中提取报价ID及关键字段,回填到保存请求中
|
|
|
* 解决保司合规规则"报价ID缺失"问题
|
|
|
*/
|
|
|
private void fillProposalNoFromResponse(GuoRenCrawlerCalculationPremiumData response) {
|
|
|
if (response == null) {
|
|
|
return;
|
|
|
}
|
|
|
- // 1. 从响应的BC中回填proposalNo到请求的BC
|
|
|
+ // 1. 从响应的BC中回填关键字段到请求的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);
|
|
|
- }
|
|
|
+ if (responseBc != null && responseBc.getPrpTmain() != null && this.bc.getPrpTmain() != null) {
|
|
|
+ String bcProposalNo = responseBc.getPrpTmain().getProposalNo();
|
|
|
+ String bcDemandNo = responseBc.getPrpTmain().getDemandNo();
|
|
|
+ String bcCertiNo = responseBc.getPrpTmain().getCertiNo();
|
|
|
+ String bcCarsonlyid = responseBc.getPrpTmain().getCarsonlyid();
|
|
|
+ if (StringUtils.hasText(bcProposalNo)) {
|
|
|
+ this.bc.getPrpTmain().setProposalNo(bcProposalNo);
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(bcDemandNo)) {
|
|
|
+ this.bc.getPrpTmain().setDemandNo(bcDemandNo);
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(bcCertiNo)) {
|
|
|
+ this.bc.getPrpTmain().setCertiNo(bcCertiNo);
|
|
|
+ this.bc.getPrpTmain().setCertino1(bcCertiNo);
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(bcCarsonlyid)) {
|
|
|
+ this.bc.getPrpTmain().setCarsonlyid(bcCarsonlyid);
|
|
|
+ }
|
|
|
+ if (this.bc.getPrpTitemCar() != null && StringUtils.hasText(bcProposalNo)) {
|
|
|
+ this.bc.getPrpTitemCar().setProposalNo(bcProposalNo);
|
|
|
}
|
|
|
}
|
|
|
- // 2. 从响应的CI中回填proposalNo到ciInsureDemand
|
|
|
+ // 2. 从响应的CI中回填proposalNo/demandNo,并传播到子对象
|
|
|
GuoRenCrawlerCalculationPremiumData.CiDTO responseCi = response.getCi();
|
|
|
- if (responseCi != null && responseCi.getPrpTmain() != null
|
|
|
- && StringUtils.hasText(responseCi.getPrpTmain().getProposalNo())) {
|
|
|
+ if (responseCi != null && responseCi.getPrpTmain() != null) {
|
|
|
String ciProposalNo = responseCi.getPrpTmain().getProposalNo();
|
|
|
- String demandNo = responseCi.getPrpTmain().getDemandNo();
|
|
|
+ String ciDemandNo = responseCi.getPrpTmain().getDemandNo();
|
|
|
+ // 回填ciInsureDemand
|
|
|
if (this.ci != null && this.ci.getCiInsureDemand() != null) {
|
|
|
- this.ci.getCiInsureDemand().setProposalNo(ciProposalNo);
|
|
|
- this.ci.getCiInsureDemand().setDemandNo(demandNo);
|
|
|
+ if (StringUtils.hasText(ciProposalNo)) {
|
|
|
+ this.ci.getCiInsureDemand().setProposalNo(ciProposalNo);
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(ciDemandNo)) {
|
|
|
+ this.ci.getCiInsureDemand().setDemandNo(ciDemandNo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 传播demandNo到ciCarShipTaxQGDemandSchema
|
|
|
+ if (this.ci != null && this.ci.getCiCarShipTaxQGDemandSchema() != null) {
|
|
|
+ String effectiveDemandNo = StringUtils.hasText(ciDemandNo) ? ciDemandNo
|
|
|
+ : (this.ci.getCiInsureDemand() != null ? this.ci.getCiInsureDemand().getDemandNo() : null);
|
|
|
+ if (StringUtils.hasText(effectiveDemandNo)) {
|
|
|
+ this.ci.getCiCarShipTaxQGDemandSchema().setDemandNo(effectiveDemandNo);
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(ciProposalNo)) {
|
|
|
+ this.ci.getCiCarShipTaxQGDemandSchema().setProposalNo(ciProposalNo);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- // 3. 从响应的BI中回填proposalNo到ciInsureDemand
|
|
|
+ // 3. 从响应的BI中回填proposalNo/demandNo到ciInsureDemand
|
|
|
GuoRenCrawlerCalculationPremiumData.BiDTO responseBi = response.getBi();
|
|
|
- if (responseBi != null && responseBi.getPrpTmain() != null
|
|
|
- && StringUtils.hasText(responseBi.getPrpTmain().getProposalNo())) {
|
|
|
+ if (responseBi != null && responseBi.getPrpTmain() != null) {
|
|
|
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);
|
|
|
+ if (StringUtils.hasText(biProposalNo)) {
|
|
|
+ this.bi.getCiInsureDemand().setProposalNo(biProposalNo);
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(biDemandNo)) {
|
|
|
+ this.bi.getCiInsureDemand().setDemandNo(biDemandNo);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|