|
@@ -2,6 +2,8 @@ package com.ydtech.modules.fnc.controller;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.ydtech.aop.request.RequestSingleParam;
|
|
import com.ydtech.aop.request.RequestSingleParam;
|
|
|
|
|
+import com.ydtech.constants.enums.dict.FeeAuditAuditstatus;
|
|
|
|
|
+import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
import com.ydtech.modules.fee.service.FeeRuleSchemeService;
|
|
import com.ydtech.modules.fee.service.FeeRuleSchemeService;
|
|
@@ -9,8 +11,12 @@ import com.ydtech.modules.fnc.entity.InsFeeAudit;
|
|
|
import com.ydtech.modules.fnc.entity.InsFeeAuditHistory;
|
|
import com.ydtech.modules.fnc.entity.InsFeeAuditHistory;
|
|
|
import com.ydtech.modules.fnc.service.InsFeeAuditHistoryService;
|
|
import com.ydtech.modules.fnc.service.InsFeeAuditHistoryService;
|
|
|
import com.ydtech.modules.fnc.service.InsFeeAuditService;
|
|
import com.ydtech.modules.fnc.service.InsFeeAuditService;
|
|
|
-import com.ydtech.modules.order.entity.*;
|
|
|
|
|
-import com.ydtech.modules.order.entity.vo.*;
|
|
|
|
|
|
|
+import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
|
|
+import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
|
|
|
+import com.ydtech.modules.order.entity.InsOrders;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.AuditOrderFeeVo;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.OrderQueryVo;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.OrderVo;
|
|
|
import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -35,7 +41,9 @@ public class CarSettleController extends BaseController {
|
|
|
private final InsFeeAuditHistoryService insFeeAuditHistoryService;
|
|
private final InsFeeAuditHistoryService insFeeAuditHistoryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
- public CarSettleController(InsAreaCompanyService insAreaCompanyService, InsOrdersService insOrdersService, InsFeeAuditService insFeeAuditService, FeeRuleSchemeService feeRuleSchemeService, InsFeeAuditHistoryService insFeeAuditHistoryService) {
|
|
|
|
|
|
|
+ public CarSettleController(InsAreaCompanyService insAreaCompanyService, InsOrdersService insOrdersService,
|
|
|
|
|
+ InsFeeAuditService insFeeAuditService, FeeRuleSchemeService feeRuleSchemeService,
|
|
|
|
|
+ InsFeeAuditHistoryService insFeeAuditHistoryService) {
|
|
|
|
|
|
|
|
this.insAreaCompanyService = insAreaCompanyService;
|
|
this.insAreaCompanyService = insAreaCompanyService;
|
|
|
this.insOrdersService = insOrdersService;
|
|
this.insOrdersService = insOrdersService;
|
|
@@ -47,6 +55,7 @@ public class CarSettleController extends BaseController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 根据费用审核状态查询订单 auditStatus
|
|
* 根据费用审核状态查询订单 auditStatus
|
|
|
|
|
+ *
|
|
|
* @param orderQueryVo
|
|
* @param orderQueryVo
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -57,8 +66,10 @@ public class CarSettleController extends BaseController {
|
|
|
BasePageResult<InsOrders> quoteResult = this.insOrdersService.queryPageOrder(orderQueryVo);
|
|
BasePageResult<InsOrders> quoteResult = this.insOrdersService.queryPageOrder(orderQueryVo);
|
|
|
return HttpResult.ok("success", quoteResult);
|
|
return HttpResult.ok("success", quoteResult);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 根据订单号查询费用明细
|
|
* 根据订单号查询费用明细
|
|
|
|
|
+ *
|
|
|
* @param orderNo
|
|
* @param orderNo
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -66,18 +77,20 @@ public class CarSettleController extends BaseController {
|
|
|
@ApiOperation(value = "[2]根据订单号查询费用明细")
|
|
@ApiOperation(value = "[2]根据订单号查询费用明细")
|
|
|
public HttpResult<OrderVo> queryFeeDetail(@RequestSingleParam(value = "orderNo") @Valid String orderNo) {
|
|
public HttpResult<OrderVo> queryFeeDetail(@RequestSingleParam(value = "orderNo") @Valid String orderNo) {
|
|
|
//查询已承保的子订单号
|
|
//查询已承保的子订单号
|
|
|
- List<InsAreaCompany> areaList =insAreaCompanyService.query()
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(orderNo),"orderno",orderNo)
|
|
|
|
|
- .eq("orderstatus","3").list();//3已承保
|
|
|
|
|
|
|
+ List<InsAreaCompany> areaList = insAreaCompanyService.query()
|
|
|
|
|
+ .eq(StringUtils.isNotEmpty(orderNo), "orderno", orderNo)
|
|
|
|
|
+ .eq("orderstatus", "3").list();//3已承保
|
|
|
|
|
|
|
|
- if(areaList!=null && !areaList.isEmpty()){
|
|
|
|
|
- return insOrdersService.getByCompanyId(areaList.get(0).getId(),"accountingUser");
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ if (areaList != null && !areaList.isEmpty()) {
|
|
|
|
|
+ return insOrdersService.getByCompanyId(areaList.get(0).getId(), "accountingUser");
|
|
|
|
|
+ } else {
|
|
|
return HttpResult.error("订单号有误-未承保");
|
|
return HttpResult.error("订单号有误-未承保");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 费用审核
|
|
* 费用审核
|
|
|
|
|
+ *
|
|
|
* @param
|
|
* @param
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -86,29 +99,38 @@ public class CarSettleController extends BaseController {
|
|
|
public HttpResult auditFee(@RequestBody @Valid AuditOrderFeeVo auditOrderFeeVo) {
|
|
public HttpResult auditFee(@RequestBody @Valid AuditOrderFeeVo auditOrderFeeVo) {
|
|
|
// 订单号
|
|
// 订单号
|
|
|
String orderNo = auditOrderFeeVo.getOrderNo();
|
|
String orderNo = auditOrderFeeVo.getOrderNo();
|
|
|
|
|
+
|
|
|
//查询改订单是已审核
|
|
//查询改订单是已审核
|
|
|
- List<InsFeeAudit> feeList =insFeeAuditService.query().eq("orderno",orderNo).list();
|
|
|
|
|
- if(feeList!=null &&feeList.size()>0){
|
|
|
|
|
|
|
+ List<InsFeeAudit> feeList = insFeeAuditService.lambdaQuery()
|
|
|
|
|
+ .eq(InsFeeAudit::getOrderno, orderNo)
|
|
|
|
|
+ .eq(InsFeeAudit::getAuditstatus, FeeAuditAuditstatus.PASSED.getCode())
|
|
|
|
|
+ .list();
|
|
|
|
|
+
|
|
|
|
|
+ if (feeList != null && !feeList.isEmpty()) {
|
|
|
return HttpResult.error("该订单已审核");
|
|
return HttpResult.error("该订单已审核");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//查询已承保的子订单号
|
|
//查询已承保的子订单号
|
|
|
- List<InsAreaCompany> areaList =insAreaCompanyService.query()
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(orderNo),"orderno",orderNo)
|
|
|
|
|
- .eq("orderstatus","3").list();//3已承保
|
|
|
|
|
- if(areaList!=null && areaList.size()>0){
|
|
|
|
|
- try{
|
|
|
|
|
- if("1".equals(auditOrderFeeVo.getUpdateFlag())){
|
|
|
|
|
|
|
+ List<InsAreaCompany> areaList = insAreaCompanyService.lambdaQuery()
|
|
|
|
|
+ .eq(StringUtils.isNotEmpty(orderNo), InsAreaCompany::getOrderno, orderNo)
|
|
|
|
|
+ .eq(InsAreaCompany::getOrderstatus, InsOrderStatusEnum.ACCEPT_INSURANCE.getCode())
|
|
|
|
|
+ .list();//3已承保
|
|
|
|
|
+
|
|
|
|
|
+ if (areaList != null && !areaList.isEmpty()) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ if ("1".equals(auditOrderFeeVo.getUpdateFlag())) {
|
|
|
String userId = getUserId();
|
|
String userId = getUserId();
|
|
|
- feeRuleSchemeService.compareAndUpdateFeeOrderInfo( areaList.get(0).getId(),auditOrderFeeVo.getJqCostsProportionStr(),auditOrderFeeVo.getSyCostsProportionStr(),userId);
|
|
|
|
|
|
|
+ feeRuleSchemeService.compareAndUpdateFeeOrderInfo(areaList.get(0).getId(), auditOrderFeeVo.getJqCostsProportionStr(),
|
|
|
|
|
+ auditOrderFeeVo.getSyCostsProportionStr(), userId);
|
|
|
}
|
|
}
|
|
|
- insFeeAuditService.feeAudit( orderNo, areaList.get(0).getId(),false);
|
|
|
|
|
- }catch (Exception e){
|
|
|
|
|
|
|
+ insFeeAuditService.feeAudit(orderNo, areaList.get(0).getId(), false);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
return HttpResult.error("系统异常");
|
|
return HttpResult.error("系统异常");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
return HttpResult.error("订单号有误-未承保");
|
|
return HttpResult.error("订单号有误-未承保");
|
|
|
}
|
|
}
|
|
|
|
|
|