|
@@ -74,30 +74,32 @@ public class QuoteVerificationAspect {
|
|
|
@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){
|
|
|
//计算费用因子
|
|
//计算费用因子
|
|
|
- InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(result.getData().getCompanyId());
|
|
|
|
|
- InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving = insAreaCompanyAccidentalDrivingService.getByCompanyId(insAreaCompany.getId());
|
|
|
|
|
- insAreaCompany.setAccidentalDriving(insAreaCompanyAccidentalDriving);
|
|
|
|
|
- InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
-
|
|
|
|
|
- //再进行费用因子判断
|
|
|
|
|
- try {
|
|
|
|
|
- feeRuleSchemeNewService.verificationCostFactor(insAreaCompany, insOrders);
|
|
|
|
|
- InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getInsFeeOrderNewByCompanyId(insAreaCompany.getId());
|
|
|
|
|
- if(insFeeOrderNew == null){
|
|
|
|
|
- throw new RuntimeException("费用因子匹配失败");
|
|
|
|
|
|
|
+ if(result.getCode() == 200) {
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(result.getData().getCompanyId());
|
|
|
|
|
+ InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving = insAreaCompanyAccidentalDrivingService.getByCompanyId(insAreaCompany.getId());
|
|
|
|
|
+ insAreaCompany.setAccidentalDriving(insAreaCompanyAccidentalDriving);
|
|
|
|
|
+ InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
|
|
|
|
|
+
|
|
|
|
|
+ //再进行费用因子判断
|
|
|
|
|
+ try {
|
|
|
|
|
+ feeRuleSchemeNewService.verificationCostFactor(insAreaCompany, insOrders);
|
|
|
|
|
+ InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getInsFeeOrderNewByCompanyId(insAreaCompany.getId());
|
|
|
|
|
+ if (insFeeOrderNew == null) {
|
|
|
|
|
+ throw new RuntimeException("费用因子匹配失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ //出口
|
|
|
|
|
+ SubOrderExportFeeVo subOrderExportFeeVo = costsCalcService.getExportFee(insFeeOrderNew);
|
|
|
|
|
+
|
|
|
|
|
+ result.getData().setJqExportFee(subOrderExportFeeVo.getJqExportCosts());
|
|
|
|
|
+ result.getData().setSyExportFee(subOrderExportFeeVo.getSyExportCosts());
|
|
|
|
|
+ result.getData().setNoExportFee(subOrderExportFeeVo.getNoExportCosts());
|
|
|
|
|
+ result.getData().setSumExportFee(subOrderExportFeeVo.getJqExportCosts()
|
|
|
|
|
+ .add(subOrderExportFeeVo.getSyExportCosts())
|
|
|
|
|
+ .add(subOrderExportFeeVo.getNoExportCosts()));
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception ignored) {
|
|
|
|
|
+ System.out.printf("费用因子匹配失败:" + ignored.getMessage());
|
|
|
}
|
|
}
|
|
|
- //出口
|
|
|
|
|
- SubOrderExportFeeVo subOrderExportFeeVo = costsCalcService.getExportFee(insFeeOrderNew);
|
|
|
|
|
-
|
|
|
|
|
- result.getData().setJqExportFee(subOrderExportFeeVo.getJqExportCosts());
|
|
|
|
|
- result.getData().setSyExportFee(subOrderExportFeeVo.getSyExportCosts());
|
|
|
|
|
- result.getData().setNoExportFee(subOrderExportFeeVo.getNoExportCosts());
|
|
|
|
|
- result.getData().setSumExportFee(subOrderExportFeeVo.getJqExportCosts()
|
|
|
|
|
- .add(subOrderExportFeeVo.getSyExportCosts())
|
|
|
|
|
- .add(subOrderExportFeeVo.getNoExportCosts()));
|
|
|
|
|
-
|
|
|
|
|
- } catch (Exception ignored) {
|
|
|
|
|
- System.out.printf("费用因子匹配失败:" + ignored.getMessage());
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|