|
@@ -6,7 +6,6 @@ import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.constants.enums.dict.agreement.ProductsType;
|
|
import com.ydtech.constants.enums.dict.agreement.ProductsType;
|
|
|
import com.ydtech.constants.sys.SystemConstant;
|
|
import com.ydtech.constants.sys.SystemConstant;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
-import com.ydtech.exception.SystemException;
|
|
|
|
|
import com.ydtech.modules.admin.model.SysUser;
|
|
import com.ydtech.modules.admin.model.SysUser;
|
|
|
import com.ydtech.modules.admin.model.SysUserRole;
|
|
import com.ydtech.modules.admin.model.SysUserRole;
|
|
|
import com.ydtech.modules.admin.service.SysUserRoleService;
|
|
import com.ydtech.modules.admin.service.SysUserRoleService;
|
|
@@ -80,11 +79,12 @@ public class QuoteVerificationAspect {
|
|
|
private final SysUserService sysUserService;
|
|
private final SysUserService sysUserService;
|
|
|
|
|
|
|
|
@AfterReturning(pointcut = "@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning = "result")
|
|
@AfterReturning(pointcut = "@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning = "result")
|
|
|
- public void doAfter(HttpResult<QuoteRespVo> result){
|
|
|
|
|
|
|
+ public void doAfter(HttpResult<QuoteRespVo> result) {
|
|
|
//计算费用因子
|
|
//计算费用因子
|
|
|
- if(result.getCode() == 200) {
|
|
|
|
|
|
|
+ if (result.getCode() == 200) {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(result.getData().getCompanyId());
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(result.getData().getCompanyId());
|
|
|
- InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving = insAreaCompanyAccidentalDrivingService.getByCompanyId(insAreaCompany.getId());
|
|
|
|
|
|
|
+ InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving =
|
|
|
|
|
+ insAreaCompanyAccidentalDrivingService.getByCompanyId(insAreaCompany.getId());
|
|
|
insAreaCompany.setAccidentalDriving(insAreaCompanyAccidentalDriving);
|
|
insAreaCompany.setAccidentalDriving(insAreaCompanyAccidentalDriving);
|
|
|
InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
|
|
@@ -108,7 +108,7 @@ public class QuoteVerificationAspect {
|
|
|
log.debug("费用因子异常消息:" + ignored.toString());
|
|
log.debug("费用因子异常消息:" + ignored.toString());
|
|
|
log.debug("费用因子异常消息:" + ignored.getMessage());
|
|
log.debug("费用因子异常消息:" + ignored.getMessage());
|
|
|
//打印异常堆栈信息
|
|
//打印异常堆栈信息
|
|
|
- for(StackTraceElement stackTraceElement : ignored.getStackTrace()){
|
|
|
|
|
|
|
+ for (StackTraceElement stackTraceElement : ignored.getStackTrace()) {
|
|
|
log.debug(stackTraceElement.toString());
|
|
log.debug(stackTraceElement.toString());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -126,49 +126,28 @@ public class QuoteVerificationAspect {
|
|
|
String deptId = ((BaseQuoteVo<?>) arg).getDeptId();
|
|
String deptId = ((BaseQuoteVo<?>) arg).getDeptId();
|
|
|
String userId = ((BaseQuoteVo<?>) arg).getUserId();
|
|
String userId = ((BaseQuoteVo<?>) arg).getUserId();
|
|
|
//待客录单传入userId
|
|
//待客录单传入userId
|
|
|
- if(StringUtils.isNotEmpty(userId)){
|
|
|
|
|
- //通过用户id查询所在的机构
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(userId)) {
|
|
|
|
|
+ //通过用户id查询所在的机构
|
|
|
SysUser user = sysUserService.getById(userId);
|
|
SysUser user = sysUserService.getById(userId);
|
|
|
- deptId=user.getDeptId();
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ deptId = user.getDeptId();
|
|
|
|
|
+ } else {
|
|
|
// 判断协议是否可以报价(代客录单时,机构需要传过来 没传为空时,为车险录单进来的 直接取登录用户机构即可)
|
|
// 判断协议是否可以报价(代客录单时,机构需要传过来 没传为空时,为车险录单进来的 直接取登录用户机构即可)
|
|
|
//if (StringUtils.isEmpty(deptId)) {
|
|
//if (StringUtils.isEmpty(deptId)) {
|
|
|
- deptId = new BaseController().getDeptId();
|
|
|
|
|
|
|
+ deptId = new BaseController().getDeptId();
|
|
|
//}
|
|
//}
|
|
|
userId = new BaseController().getUserId();
|
|
userId = new BaseController().getUserId();
|
|
|
}
|
|
}
|
|
|
//税源查询
|
|
//税源查询
|
|
|
BaseQuoteInfoVo quoteInfo = insOrdersComponents.getQuoteInfo(orderno, agreementId);
|
|
BaseQuoteInfoVo quoteInfo = insOrdersComponents.getQuoteInfo(orderno, agreementId);
|
|
|
- String productid ;
|
|
|
|
|
|
|
+
|
|
|
List<KindInfoVo> kinds = quoteInfo.getKindList();
|
|
List<KindInfoVo> kinds = quoteInfo.getKindList();
|
|
|
List<RiskInfoVo> risks = quoteInfo.getRiskList();
|
|
List<RiskInfoVo> risks = quoteInfo.getRiskList();
|
|
|
|
|
|
|
|
- boolean haveCarDamageKind = false;//是否含车损
|
|
|
|
|
- boolean haveBusiKind = false;//是否含车损外的商业险种
|
|
|
|
|
- for (KindInfoVo kindInfoVo : kinds) {
|
|
|
|
|
- String code = kindInfoVo.getKindCode();
|
|
|
|
|
- // 车损
|
|
|
|
|
- if ("A".equalsIgnoreCase(code)) {
|
|
|
|
|
- haveCarDamageKind = true;
|
|
|
|
|
- }
|
|
|
|
|
- if ("B,D3,D4,".contains(code + ",")) {
|
|
|
|
|
- haveBusiKind = true;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (risks.size() == 1 && InsuranceRisk.TRAFFIC.getCode().equals(risks.get(0).getRiskCode())) {
|
|
|
|
|
- productid = ProductsType.PT_0330.getCode();//单交
|
|
|
|
|
- } else if (risks.size() == 1 && !haveCarDamageKind && haveBusiKind) {
|
|
|
|
|
- productid = ProductsType.PT_034002.getCode();//单三
|
|
|
|
|
- } else if (risks.size() == 1) {
|
|
|
|
|
- productid = ProductsType.PT_034001.getCode();//单商
|
|
|
|
|
- } else if (risks.size() == 2 && !haveCarDamageKind && haveBusiKind) {
|
|
|
|
|
- productid = ProductsType.PT_0330034002.getCode();//交三
|
|
|
|
|
- } else {
|
|
|
|
|
- productid = ProductsType.PT_0330034001.getCode();//交商
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ProductsType insuranceRisk = InsuranceRisk.determineInsuranceInformation(kinds, risks);
|
|
|
|
|
|
|
|
- String taxAgreementId = taxSourceService.getAgreementId(deptId, userId, companyId, quoteInfo.getCarInfo().getLicenseNo(), quoteInfo.getCarInfo().getEnginedesc(), productid);
|
|
|
|
|
- if(!"".equals(taxAgreementId)){
|
|
|
|
|
|
|
+ String taxAgreementId = taxSourceService.getAgreementId(deptId, userId, companyId, quoteInfo.getCarInfo().getLicenseNo(),
|
|
|
|
|
+ quoteInfo.getCarInfo().getEnginedesc(), insuranceRisk.getCode());
|
|
|
|
|
+ if (!"".equals(taxAgreementId)) {
|
|
|
((BaseQuoteVo<?>) arg).setAgreementId(taxAgreementId);
|
|
((BaseQuoteVo<?>) arg).setAgreementId(taxAgreementId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -184,12 +163,12 @@ public class QuoteVerificationAspect {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @version
|
|
|
|
|
- * @author: hxl
|
|
|
|
|
- * @Date: 2024/4/27 15:18
|
|
|
|
|
- * @Description: 添加报价接口的报价失败状态的后置通知
|
|
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/4/27 15:18
|
|
|
|
|
+ * @Description: 添加报价接口的报价失败状态的后置通知
|
|
|
*/
|
|
*/
|
|
|
- // @AfterReturning(value="@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning="response")
|
|
|
|
|
|
|
+ // @AfterReturning(value="@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning="response")
|
|
|
public void after(JoinPoint point, HttpResult response) {
|
|
public void after(JoinPoint point, HttpResult response) {
|
|
|
Object[] args = point.getArgs();
|
|
Object[] args = point.getArgs();
|
|
|
if (response.getCode() != 200) {
|
|
if (response.getCode() != 200) {
|
|
@@ -204,11 +183,12 @@ public class QuoteVerificationAspect {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
- * @version
|
|
|
|
|
- * @author: hxl
|
|
|
|
|
- * @Date: 2024/4/27 16:54
|
|
|
|
|
- * @Description: 添加报价接口的报价失败状态的异常通知
|
|
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/4/27 16:54
|
|
|
|
|
+ * @Description: 添加报价接口的报价失败状态的异常通知
|
|
|
*/
|
|
*/
|
|
|
//@AfterThrowing(pointcut="@annotation(com.ydtech.modules.order.aop.QuoteVerification)", throwing="ex")
|
|
//@AfterThrowing(pointcut="@annotation(com.ydtech.modules.order.aop.QuoteVerification)", throwing="ex")
|
|
|
public void handleException(JoinPoint point, Exception ex) {
|
|
public void handleException(JoinPoint point, Exception ex) {
|
|
@@ -224,6 +204,7 @@ public class QuoteVerificationAspect {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
public void insertInsAreaCompany(String companyId, String orderno, String agreementId) {
|
|
public void insertInsAreaCompany(String companyId, String orderno, String agreementId) {
|
|
|
EsmInsCompany esmInsCompany = esmInsCompanyService.getById(companyId);
|
|
EsmInsCompany esmInsCompany = esmInsCompanyService.getById(companyId);
|
|
|
//保存订单信息
|
|
//保存订单信息
|
|
@@ -239,29 +220,29 @@ public class QuoteVerificationAspect {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * @version
|
|
|
|
|
- * @author: hxl
|
|
|
|
|
- * @Date: 2024/5/10 15:38
|
|
|
|
|
- * @Description: 后置处理器更新子订单的险种类型
|
|
|
|
|
- */
|
|
|
|
|
- @AfterReturning(pointcut = "@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning = "result")
|
|
|
|
|
- public void afterUpdatePruduct(HttpResult<QuoteRespVo> result) {
|
|
|
|
|
- //计算费用因子
|
|
|
|
|
- if(result.getCode() == 200) {
|
|
|
|
|
- InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(result.getData().getCompanyId());
|
|
|
|
|
- InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
- //通过主订单的信息判断
|
|
|
|
|
- List<RiskInfoVo> risks = insOrders.getRisk().toJavaList(RiskInfoVo.class);
|
|
|
|
|
- List<KindInfoVo> kinds = insOrders.getKing().toJavaList(KindInfoVo.class);
|
|
|
|
|
- //获取订单的险种信息
|
|
|
|
|
- insOrders.productInformation(risks, kinds);
|
|
|
|
|
- String product = insOrders.getProduct();
|
|
|
|
|
- String productid = insOrders.getProductid();
|
|
|
|
|
- insAreaCompany.setProduct(product);
|
|
|
|
|
- insAreaCompany.setProductid(productid);
|
|
|
|
|
- //更新子订单的险种信息
|
|
|
|
|
- insAreaCompanyService.updateById(insAreaCompany);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/5/10 15:38
|
|
|
|
|
+ * @Description: 后置处理器更新子订单的险种类型
|
|
|
|
|
+ */
|
|
|
|
|
+ @AfterReturning(pointcut = "@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning = "result")
|
|
|
|
|
+ public void afterUpdatePruduct(HttpResult<QuoteRespVo> result) {
|
|
|
|
|
+ //计算费用因子
|
|
|
|
|
+ if (result.getCode() == 200) {
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(result.getData().getCompanyId());
|
|
|
|
|
+ InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
+ //通过主订单的信息判断
|
|
|
|
|
+ List<RiskInfoVo> risks = insOrders.getRisk().toJavaList(RiskInfoVo.class);
|
|
|
|
|
+ List<KindInfoVo> kinds = insOrders.getKing().toJavaList(KindInfoVo.class);
|
|
|
|
|
+ //获取订单的险种信息
|
|
|
|
|
+ insOrders.productInformation(risks, kinds);
|
|
|
|
|
+ String product = insOrders.getProduct();
|
|
|
|
|
+ String productid = insOrders.getProductid();
|
|
|
|
|
+ insAreaCompany.setProduct(product);
|
|
|
|
|
+ insAreaCompany.setProductid(productid);
|
|
|
|
|
+ //更新子订单的险种信息
|
|
|
|
|
+ insAreaCompanyService.updateById(insAreaCompany);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|