|
|
@@ -1,11 +1,15 @@
|
|
|
package com.ydtech.modules.order.aop.aspect;
|
|
|
|
|
|
|
|
|
+import com.ydtech.constants.enums.InsuranceRisk;
|
|
|
+import com.ydtech.constants.enums.dict.agreement.ProductsType;
|
|
|
import com.ydtech.constants.sys.SystemConstant;
|
|
|
import com.ydtech.modules.admin.model.SysUserRole;
|
|
|
import com.ydtech.modules.admin.service.SysUserRoleService;
|
|
|
import com.ydtech.modules.admin.service.SysUserService;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
+import com.ydtech.modules.ins.model.vo.KindInfoVo;
|
|
|
+import com.ydtech.modules.ins.model.vo.RiskInfoVo;
|
|
|
import com.ydtech.modules.order.components.InsOrdersComponents;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
|
|
|
@@ -20,6 +24,7 @@ import org.aspectj.lang.annotation.Before;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Slf4j
|
|
|
@Aspect
|
|
|
@@ -54,7 +59,34 @@ public class QuoteVerificationAspect {
|
|
|
|
|
|
//税源查询
|
|
|
BaseQuoteInfoVo quoteInfo = insOrdersComponents.getQuoteInfo(orderno, agreementId);
|
|
|
- String productid = quoteInfo.getProductid();
|
|
|
+ String productid ;
|
|
|
+ List<KindInfoVo> kinds = quoteInfo.getKindList();
|
|
|
+ List<RiskInfoVo> risks = quoteInfo.getRiskList();
|
|
|
+
|
|
|
+ ProductsType productsType;
|
|
|
+ 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();//交商
|
|
|
+ }
|
|
|
String taxAgreementId = taxSourceService.getAgreementId(deptId, userId, companyId, quoteInfo.getCarInfo().getLicenseNo(), quoteInfo.getCarInfo().getEnginedesc(), productid);
|
|
|
if(!"".equals(taxAgreementId)){
|
|
|
((BaseQuoteVo<?>) arg).setAgreementId(taxAgreementId);
|