|
@@ -17,6 +17,7 @@ import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
|
import com.ydtech.modules.order.entity.TaxArrears;
|
|
import com.ydtech.modules.order.entity.TaxArrears;
|
|
|
import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequestHead;
|
|
import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequestHead;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.huatai.constants.HuaTaiSubmitCommon;
|
|
|
import com.ydtech.modules.order.entity.api.huatai.request.*;
|
|
import com.ydtech.modules.order.entity.api.huatai.request.*;
|
|
|
import com.ydtech.modules.order.entity.api.huatai.response.*;
|
|
import com.ydtech.modules.order.entity.api.huatai.response.*;
|
|
|
import com.ydtech.modules.order.entity.config.HuaTaiConfigureParameters;
|
|
import com.ydtech.modules.order.entity.config.HuaTaiConfigureParameters;
|
|
@@ -230,24 +231,24 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
|
|
if ("4".equals(totalStatus)) {
|
|
if ("4".equals(totalStatus)) {
|
|
|
//再调用缴费接口获取缴费链接
|
|
//再调用缴费接口获取缴费链接
|
|
|
- String payUrl = getPaymentUrl(insAreaCompany, huaTaiConfigureParameters);
|
|
|
|
|
- if (StringUtils.isNotEmpty(payUrl)) {
|
|
|
|
|
- insAreaCompany.setPaymentLink(payUrl);
|
|
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
- return HttpResult.ok("核保成功");
|
|
|
|
|
- } else {
|
|
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
- return HttpResult.error("获取支付链接失败");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return getPayURL(insAreaCompany,huaTaiConfigureParameters);
|
|
|
} else if ("1".equals(totalStatus)) {
|
|
} else if ("1".equals(totalStatus)) {
|
|
|
- //再次调用提交核保接口
|
|
|
|
|
|
|
+ //调用提交核保接口
|
|
|
HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = submitStatus(insAreaCompany, huaTaiConfigureParameters, "1");
|
|
HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = submitStatus(insAreaCompany, huaTaiConfigureParameters, "1");
|
|
|
|
|
+ HuaTaiSubmitCommon huaTaiSubmitCommon = getSubmitStatus(insAreaCompany,submitStatusQueryResponse);
|
|
|
//根据核保返回信息进行更新
|
|
//根据核保返回信息进行更新
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
- return HttpResult.error("已转人工核保");
|
|
|
|
|
|
|
+ if ("8".equals(huaTaiSubmitCommon.getTotalUnderWriteInd())) {//已通过核保未实收
|
|
|
|
|
+ //再调用缴费接口获取缴费链接
|
|
|
|
|
+ return getPayURL(insAreaCompany,huaTaiConfigureParameters);
|
|
|
|
|
+ } else if ("9".equals(huaTaiSubmitCommon.getTotalUnderWriteInd())) {//待核保
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.ok("已转人工核保");
|
|
|
|
|
+ } else{//当状态为核保不通过时,调整保单状态为报价中
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.error("核保不通过:" + huaTaiSubmitCommon.getNotion());//需要处理放入核保原因
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
String notion = jqNotion.toString() + syNotion.toString();
|
|
String notion = jqNotion.toString() + syNotion.toString();
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
|
|
@@ -256,6 +257,19 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private HttpResult<Object> getPayURL(InsAreaCompany insAreaCompany,HuaTaiConfigureParameters huaTaiConfigureParameters){
|
|
|
|
|
+ String payUrl = getPaymentUrl(insAreaCompany, huaTaiConfigureParameters);
|
|
|
|
|
+ if (StringUtils.isNotEmpty(payUrl)) {
|
|
|
|
|
+ insAreaCompany.setPaymentLink(payUrl);
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.ok("核保成功");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.error("获取支付链接失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult<Object> submitImage(String companyId) {
|
|
public HttpResult<Object> submitImage(String companyId) {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
|
|
@@ -407,18 +421,19 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 调用转投保接口
|
|
|
* @param yaQuoteInfoVo
|
|
* @param yaQuoteInfoVo
|
|
|
* @param insAreaCompany
|
|
* @param insAreaCompany
|
|
|
* @param huaTaiConfigureParameters
|
|
* @param huaTaiConfigureParameters
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public HuaTaiSubmitResponse submitForUnderwriting(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters) {
|
|
|
|
|
|
|
+ private HuaTaiSubmitResponse submitForUnderwriting(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters) {
|
|
|
HuaTaiSubmitRequest submitRequest = new HuaTaiSubmitRequest(yaQuoteInfoVo, insAreaCompany, huaTaiConfigureParameters);
|
|
HuaTaiSubmitRequest submitRequest = new HuaTaiSubmitRequest(yaQuoteInfoVo, insAreaCompany, huaTaiConfigureParameters);
|
|
|
submitRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
submitRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
|
|
|
return huaTaiRequestApiComponents.submit(submitRequest, HuaTaiSubmitResponse.class);
|
|
return huaTaiRequestApiComponents.submit(submitRequest, HuaTaiSubmitResponse.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public QuoteRespVo getQuoteRespVo(HuaTaiQuotedPriceResponse quotedPriceResponse, BaseQuoteInfoVo yaQuoteInfoVo) {
|
|
|
|
|
|
|
+ private QuoteRespVo getQuoteRespVo(HuaTaiQuotedPriceResponse quotedPriceResponse, BaseQuoteInfoVo yaQuoteInfoVo) {
|
|
|
double jqPremium = 0;
|
|
double jqPremium = 0;
|
|
|
double syPremium = 0;
|
|
double syPremium = 0;
|
|
|
double jqDiscount = 0;
|
|
double jqDiscount = 0;
|
|
@@ -498,7 +513,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
return quoteRespVo;
|
|
return quoteRespVo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public HttpResult<QuoteRespVo> responseOrder(HuaTaiQuotedPriceResponse quotedPriceResponse, QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
|
|
|
|
|
|
|
+ private HttpResult<QuoteRespVo> responseOrder(HuaTaiQuotedPriceResponse quotedPriceResponse, QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
|
|
|
//保存订单信息
|
|
//保存订单信息
|
|
|
InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
|
|
InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
|
|
|
//华泰没有总订单号,使用自定义订单号
|
|
//华泰没有总订单号,使用自定义订单号
|
|
@@ -533,7 +548,6 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 提交核保及查询核保状态接口
|
|
* 提交核保及查询核保状态接口
|
|
|
- *
|
|
|
|
|
* @param companyId
|
|
* @param companyId
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -548,13 +562,35 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 2. 组装请求体
|
|
// 2. 组装请求体
|
|
|
|
|
+ HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = submitStatus(insAreaCompany, huaTaiConfigureParameters, "2");
|
|
|
|
|
+
|
|
|
|
|
+ HuaTaiSubmitCommon huaTaiSubmitCommon = getSubmitStatus(insAreaCompany,submitStatusQueryResponse);
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 通过返回核保状态修改状态
|
|
|
|
|
+ if ("8".equals(huaTaiSubmitCommon.getTotalUnderWriteInd())) {//已通过核保未实收
|
|
|
|
|
+ //再调用缴费接口获取缴费链接
|
|
|
|
|
+ return getPayURL(insAreaCompany,huaTaiConfigureParameters);
|
|
|
|
|
+ } else if ("6".equals(huaTaiSubmitCommon.getTotalUnderWriteInd())) {//当状态为核保不通过时,调整保单状态为报价中
|
|
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
+ return HttpResult.error("核保不通过:" + huaTaiSubmitCommon.getNotion());//需要处理放入核保原因
|
|
|
|
|
+ } else if ("9".equals(huaTaiSubmitCommon.getTotalUnderWriteInd())) {//待核保
|
|
|
|
|
+ return HttpResult.ok("正在核保中");//需要处理放入核保原因
|
|
|
|
|
+ } else if ("1".equals(huaTaiSubmitCommon.getTotalUnderWriteInd())) {//已通过核保已实收
|
|
|
|
|
+ return HttpResult.ok("已经核保通过且生成保单,若实际状态为待缴费,请点击缴费状态查询进行更新!");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return HttpResult.error("未知错误,当前核保状态为"+huaTaiSubmitCommon.getTotalUnderWriteInd());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private HuaTaiSubmitCommon getSubmitStatus(InsAreaCompany insAreaCompany ,HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse){
|
|
|
|
|
+ HuaTaiSubmitCommon huaTaiSubmitCommon = new HuaTaiSubmitCommon();
|
|
|
boolean haveJQFlag = false;
|
|
boolean haveJQFlag = false;
|
|
|
boolean haveSYFlag = false;
|
|
boolean haveSYFlag = false;
|
|
|
String jqStatus = "";
|
|
String jqStatus = "";
|
|
|
String syStatus = "";
|
|
String syStatus = "";
|
|
|
StringBuffer jqNotion = new StringBuffer();
|
|
StringBuffer jqNotion = new StringBuffer();
|
|
|
StringBuffer syNotion = new StringBuffer();
|
|
StringBuffer syNotion = new StringBuffer();
|
|
|
- HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = submitStatus(insAreaCompany, huaTaiConfigureParameters, "2");
|
|
|
|
|
for (HuaTaiSubmitStatusQueryResponse.AppliResult appliResult : submitStatusQueryResponse.getAppliResult()) {
|
|
for (HuaTaiSubmitStatusQueryResponse.AppliResult appliResult : submitStatusQueryResponse.getAppliResult()) {
|
|
|
if (StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())) {
|
|
if (StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())) {
|
|
|
haveJQFlag = true;
|
|
haveJQFlag = true;
|
|
@@ -612,33 +648,10 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
|
|
|
totalUnderWriteInd = "6";
|
|
totalUnderWriteInd = "6";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- String underWriteInd = "";
|
|
|
|
|
- // 3. 通过返回核保状态修改状态
|
|
|
|
|
- if ("8".equals(totalUnderWriteInd)) {
|
|
|
|
|
- //再调用缴费接口获取缴费链接
|
|
|
|
|
- String payUrl = getPaymentUrl(insAreaCompany, huaTaiConfigureParameters);
|
|
|
|
|
- if (StringUtils.isNotEmpty(payUrl)) {
|
|
|
|
|
- insAreaCompany.setPaymentLink(payUrl);
|
|
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
- return HttpResult.ok("核保成功");
|
|
|
|
|
- } else {
|
|
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
- return HttpResult.error("获取支付链接失败");
|
|
|
|
|
- }
|
|
|
|
|
- } else if ("6".equals(underWriteInd)) {//当状态为核保不通过时,调整保单状态为报价中
|
|
|
|
|
- String notion = jqNotion.toString() + syNotion.toString();
|
|
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
|
|
- return HttpResult.error("核保不通过:" + notion);//需要处理放入核保原因
|
|
|
|
|
- } else if ("9".equals(underWriteInd)) {//当状态为核保不通过时,调整保单状态为报价中
|
|
|
|
|
- return HttpResult.ok("正在核保中");//需要处理放入核保原因
|
|
|
|
|
- } else {
|
|
|
|
|
- return HttpResult.ok(underWriteInd);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ huaTaiSubmitCommon.setTotalUnderWriteInd(totalUnderWriteInd);
|
|
|
|
|
+ huaTaiSubmitCommon.setNotion(jqNotion.toString()+syNotion.toString());
|
|
|
|
|
+ return huaTaiSubmitCommon;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 提交核保或核保查询接口
|
|
* 提交核保或核保查询接口
|
|
|
*
|
|
*
|