|
|
@@ -1,5 +1,6 @@
|
|
|
package com.ydtech.modules.order.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
@@ -31,6 +32,7 @@ import com.ydtech.modules.admin.model.dto.SysUserLinkPtlAgreementDto;
|
|
|
import com.ydtech.modules.admin.model.po.SysUserIsDial;
|
|
|
import com.ydtech.modules.admin.service.*;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
+import com.ydtech.modules.esm.model.EsmInsCompany;
|
|
|
import com.ydtech.modules.esm.model.EsmUserReferrer;
|
|
|
import com.ydtech.modules.esm.service.EsmUserReferrerService;
|
|
|
import com.ydtech.modules.fee.service.CostsCalcService;
|
|
|
@@ -66,6 +68,7 @@ import com.ydtech.modules.order.service.*;
|
|
|
import com.ydtech.modules.protocol.entity.constants.PtlApiType;
|
|
|
import com.ydtech.modules.protocol.entity.dto.PtlAgreementInsCompanyDto;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreement;
|
|
|
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementService;
|
|
|
import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
|
|
|
import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNew;
|
|
|
@@ -2030,6 +2033,44 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
return baseMapper.queryInsured(queryInsuredInOrderVo, userId);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean responseFailedOrder(BaseQuoteVo quoteVo, PtlAgreementAttribution ptlAgreementAttribution, InsOrders insOrder, String errorMessage, InsOrderStatusEnum statusEnum) {
|
|
|
+
|
|
|
+ //保存订单信息
|
|
|
+ InsAreaCompany insAreaCompany = new InsAreaCompany();
|
|
|
+ insAreaCompany.setEntryStatus(insOrder.getEntryStatus());
|
|
|
+ insAreaCompany.setOrderno(insOrder.getOrderno());
|
|
|
+ insAreaCompany.setApiType(PtlApiType.PTL_API_1.getCode());
|
|
|
+ insAreaCompany.setOrderstatus(statusEnum.getCode());
|
|
|
+ insAreaCompany.setCreatetime(LocalDateTime.now());
|
|
|
+ insAreaCompany.setCompanyId(quoteVo.getCompanyId());
|
|
|
+ insAreaCompany.setInscompany(ptlAgreementAttribution.getInsCompanyName());
|
|
|
+ insAreaCompany.setAgreementId(quoteVo.getAgreementId());
|
|
|
+
|
|
|
+ insAreaCompany.setJqStartDate(insOrder.getJqstartdate());
|
|
|
+ insAreaCompany.setJqEndDate(insOrder.getJqenddate());
|
|
|
+ insAreaCompany.setSyStartDate(insOrder.getSystartdate());
|
|
|
+ insAreaCompany.setSyEndDate(insOrder.getSyenddate());
|
|
|
+
|
|
|
+ if (CollUtil.isEmpty(quoteVo.getRisks())) {
|
|
|
+ insAreaCompany.setRiskinfo(new JSONArray());
|
|
|
+ } else {
|
|
|
+ insAreaCompany.setRiskinfo(JSON.parseArray(JSON.toJSONString(quoteVo.getRisks())));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (CollUtil.isEmpty(quoteVo.getKinds())) {
|
|
|
+ insAreaCompany.setKindinfo(new JSONArray());
|
|
|
+ } else {
|
|
|
+ insAreaCompany.setKindinfo(JSON.parseArray(JSON.toJSONString(quoteVo.getKinds())));
|
|
|
+ }
|
|
|
+
|
|
|
+ insAreaCompany.setQuoteErrMsg(errorMessage);
|
|
|
+
|
|
|
+ InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving = new InsAreaCompanyAccidentalDriving();
|
|
|
+ insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDriving);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 更新订单的起保与终保时间
|
|
|
*/
|