|
|
@ -8,6 +8,7 @@ import com.yxt.anrui.buscenter.api.bussalesorder.OrderSolutionVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderPriceInfoVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordermodel.BusSalesOrderModel; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderprice.BusSalesOrderPrice; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinotherPolicy.LoanFinOtherPolicy; |
|
|
@ -1208,6 +1209,18 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
if (StringUtils.isBlank(policySid)) { |
|
|
|
return rb.setMsg("请先选择产品政策"); |
|
|
|
} |
|
|
|
String busSid = query.getSalesOrderSid(); |
|
|
|
LoanSolutions loanSolutions = baseMapper.selectByBusSid(busSid); |
|
|
|
boolean isOrder = false; |
|
|
|
BigDecimal orderPrice = BigDecimal.ZERO; |
|
|
|
if(loanSolutions != null && loanSolutions.getSaleOrderState() == 0){//销售订单
|
|
|
|
isOrder = true; |
|
|
|
BusSalesOrderPrice busSalesOrderPrice = baseMapper.selectByPriceSid(busSid); |
|
|
|
if(busSalesOrderPrice == null){ |
|
|
|
return rb.setMsg("请先录入价格信息"); |
|
|
|
} |
|
|
|
orderPrice = busSalesOrderPrice.getSingleFinalPrice(); |
|
|
|
} |
|
|
|
CalculateVo calculateVo = new CalculateVo(); |
|
|
|
//计算的初始化
|
|
|
|
BigDecimal loanTotal = BigDecimal.ZERO;//融资项目总额
|
|
|
@ -1222,6 +1235,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
BigDecimal interstAll = BigDecimal.ZERO; |
|
|
|
BigDecimal yueAll = BigDecimal.ZERO; |
|
|
|
/***************相关计算及字段*****************/ |
|
|
|
BigDecimal AmountAll = BigDecimal.ZERO; |
|
|
|
|
|
|
|
//主车发票价
|
|
|
|
String mainVehicleAmount = query.getMainVehicleAmount(); |
|
|
@ -1250,10 +1264,18 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
if (StringUtils.isNotBlank(mainVehicleAmount)) { |
|
|
|
//主车发票价
|
|
|
|
loanTotal = loanTotal.add(new BigDecimal(mainVehicleAmount)); |
|
|
|
AmountAll = AmountAll.add(new BigDecimal(mainVehicleAmount)); |
|
|
|
} |
|
|
|
if (accessoriesAmountCb) {//包含配件
|
|
|
|
if (StringUtils.isNotBlank(accessoriesAmount)) { |
|
|
|
loanTotal = loanTotal.add(new BigDecimal(accessoriesAmount)); |
|
|
|
AmountAll = AmountAll.add(new BigDecimal(accessoriesAmount)); |
|
|
|
} |
|
|
|
} |
|
|
|
if(isOrder){ |
|
|
|
//判断成交价与主车发票价和配件之和
|
|
|
|
if(AmountAll.compareTo(orderPrice)<0){ |
|
|
|
return rb.setMsg("主车发票价与配件之和不能小于订单成交价"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (trailerAmountCb) {//包含挂车
|
|
|
@ -2431,6 +2453,7 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
} |
|
|
|
CalculateQuery calculateQuery = new CalculateQuery(); |
|
|
|
BeanUtil.copyProperties(query, calculateQuery); |
|
|
|
calculateQuery.setSalesOrderSid(query.getSaleOrderSid()); |
|
|
|
ResultBean<CalculateVo> resultBean = calculate(calculateQuery); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|