|
|
@ -3,9 +3,7 @@ package com.yxt.anrui.riskcenter.biz.loansolution; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.buscenter.api.busorder.BusOrderFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.busordermodel.AppModelInSolutionVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busordermodel.BusOrderModelFeign; |
|
|
|
import com.yxt.anrui.crm.api.finborrower.FinBorrower; |
|
|
|
import com.yxt.anrui.crm.api.finborrower.FinBorrowerFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanloadprice.LoanLoadprice; |
|
|
@ -43,7 +41,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -74,8 +71,8 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
private LoanSolutionTrailerService loanSolutionTrailerService; |
|
|
|
@Autowired |
|
|
|
private LoanSolutionsTrailerService loanSolutionsTrailerService; |
|
|
|
@Autowired |
|
|
|
private BusOrderFeign busOrderFeign; |
|
|
|
/* @Autowired |
|
|
|
private BusOrderFeign busOrderFeign;*/ |
|
|
|
@Autowired |
|
|
|
private LoanSolutionInciexplainService loanSolutionInciexplainService; |
|
|
|
@Autowired |
|
|
@ -84,8 +81,8 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
private LoanSolutionDetailService loanSolutionDetailService; |
|
|
|
@Autowired |
|
|
|
private LoanSolutionsDetailService loanSolutionsDetailService; |
|
|
|
@Autowired |
|
|
|
private BusOrderModelFeign busOrderModelFeign; |
|
|
|
/* @Autowired |
|
|
|
private BusOrderModelFeign busOrderModelFeign;*/ |
|
|
|
@Autowired |
|
|
|
private LoanLoadpriceService loanLoadpriceService; |
|
|
|
|
|
|
@ -122,7 +119,7 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
if(StringUtils.isNotBlank(loanPriceSid)){ |
|
|
|
LoanLoadprice loanLoadprice = loanLoadpriceService.fetchBySid(loanPriceSid); |
|
|
|
orderSid= loanLoadprice.getOrderSid(); |
|
|
|
appModelInSolutionVoResultBean=busOrderModelFeign.getAppModelInSolutionVoByOrderSid(orderSid); |
|
|
|
/* appModelInSolutionVoResultBean=busOrderModelFeign.getAppModelInSolutionVoByOrderSid(orderSid);*/ |
|
|
|
if(appModelInSolutionVoResultBean.getSuccess()){ |
|
|
|
String quantity= appModelInSolutionVoResultBean.getData().getQuantity(); |
|
|
|
num=Integer.parseInt(quantity); |
|
|
@ -338,10 +335,10 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
vo.setFinanceState(1); |
|
|
|
} |
|
|
|
// 主车价款信息
|
|
|
|
ResultBean<AppModelInSolutionVo> resultBean = busOrderModelFeign.getAppModelInSolutionVoByOrderSid(orderSid); |
|
|
|
/* ResultBean<AppModelInSolutionVo> resultBean = busOrderModelFeign.getAppModelInSolutionVoByOrderSid(orderSid); |
|
|
|
if (resultBean.getSuccess() && resultBean.getData() != null) { |
|
|
|
vo.setMainVehicleState(1); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
// 是否展示挂车价款信息
|
|
|
|
if (financeProjectVo != null && financeProjectVo.getPackingProject().contains("挂车")) { |
|
|
@ -447,7 +444,7 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
LoanSolutions loanSolutions = new LoanSolutions(); |
|
|
|
dto.fillEntity(loanSolutions); |
|
|
|
loanSolutions.setSid(UUID.randomUUID().toString()); |
|
|
|
BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
/* BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
loanSolutions.setMainVehicleAmount(loanSolutions.getMainVehicleAmount().multiply(num)); |
|
|
|
BigDecimal trailerAmount = StringUtils.toBigDecimal(dto.getTrailerAmount()); |
|
|
|
loanSolutions.setTrailerAmount(trailerAmount == null ? null : trailerAmount.multiply(num)); |
|
|
@ -462,7 +459,7 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
BigDecimal financingAmount = StringUtils.toBigDecimal(dto.getFinancingAmount()); |
|
|
|
loanSolutions.setFinancingAmount(financingAmount == null ? null : financingAmount.multiply(num)); |
|
|
|
BigDecimal otherAmount = StringUtils.toBigDecimal(dto.getOtherAmount()); |
|
|
|
loanSolutions.setOtherAmount(otherAmount == null ? null : otherAmount.multiply(num)); |
|
|
|
loanSolutions.setOtherAmount(otherAmount == null ? null : otherAmount.multiply(num));*/ |
|
|
|
boolean saveBoolean = loanSolutionsService.save(loanSolutions); |
|
|
|
if (saveBoolean) { |
|
|
|
return new ResultBean().success().setMsg("保存成功").setData(loanSolution.getSid()); |
|
|
@ -476,7 +473,7 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
mapSum.put("packingProjectKey", dto.getPackingProjectKey()); |
|
|
|
map.put("packingProject", dto.getPackingProject()); |
|
|
|
mapSum.put("packingProject", dto.getPackingProject()); |
|
|
|
BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
/* BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
map.put("mainVehicleAmount", StringUtils.toBigDecimal(dto.getMainVehicleAmount())); |
|
|
|
mapSum.put("mainVehicleAmount", StringUtils.toBigDecimal(dto.getMainVehicleAmount())); |
|
|
|
BigDecimal trailerAmount = StringUtils.toBigDecimal(dto.getTrailerAmount()); |
|
|
@ -501,8 +498,7 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
mapSum.put("financingAmount", StringUtils.toBigDecimal(dto.getFinancingAmount()).multiply(num)); |
|
|
|
map.put("financingRemarks", dto.getFinancingRemarks()); |
|
|
|
mapSum.put("financingRemarks", dto.getFinancingRemarks()); |
|
|
|
map.put("sid", loanSolution.getSid()); |
|
|
|
// updateBySid(map, loanSolution.getSid());
|
|
|
|
map.put("sid", loanSolution.getSid());*/ |
|
|
|
baseMapper.updateAppFinanceProject(map); |
|
|
|
// 总表
|
|
|
|
LoanSolutions loanSolutions = loanSolutionsService.selectByLoanPriceSid(dto.getLoanPriceSid()); |
|
|
@ -543,20 +539,18 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
LoanSolution loanSolution = baseMapper.selectByLoanPriceSid(loanLoadpriceVo.getSid()); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> mapSum = new HashMap<>(); |
|
|
|
BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
/* BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
BigDecimal trailerAdvance = StringUtils.toBigDecimal(dto.getTrailerAdvance()); |
|
|
|
map.put("trailerAdvance", trailerAdvance); |
|
|
|
mapSum.put("trailerAdvance", trailerAdvance == null ? null : trailerAdvance.multiply(num)); |
|
|
|
BigDecimal topcoatAdvance = StringUtils.toBigDecimal(dto.getTopcoatAdvance()); |
|
|
|
map.put("topcoatAdvance", topcoatAdvance); |
|
|
|
mapSum.put("topcoatAdvance", topcoatAdvance == null ? null : topcoatAdvance.multiply(num)); |
|
|
|
map.put("sid", loanSolution.getSid()); |
|
|
|
// int i = updateBySid(map, loanSolution.getSid());
|
|
|
|
map.put("sid", loanSolution.getSid());*/ |
|
|
|
baseMapper.updateAppAdvance(map); |
|
|
|
// 总表
|
|
|
|
LoanSolutions loanSolutions = loanSolutionsService.selectByLoanPriceSid(loanLoadpriceVo.getSid()); |
|
|
|
mapSum.put("sid", loanSolutions.getSid()); |
|
|
|
// loanSolutionsService.updateBySid(map, loanSolutions.getSid());
|
|
|
|
int i = loanSolutionsService.updateAppAdvance(mapSum); |
|
|
|
if (i == 1) { |
|
|
|
return new ResultBean().success().setMsg("操作成功").setData(loanSolution.getSid()); |
|
|
@ -593,9 +587,10 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
public ResultBean saveOrUpdateAppFinBack(AppFinBackDto dto) { |
|
|
|
LoanLoadpriceVo loanLoadpriceVo = loanLoadpriceService.selectByOrderSid(dto.getOrderSid()); |
|
|
|
LoanSolution loanSolution = baseMapper.selectByLoanPriceSid(loanLoadpriceVo.getSid()); |
|
|
|
BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
/*BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData();*/ |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> mapSum = new HashMap<>(); |
|
|
|
/* |
|
|
|
map.put("bankAccess", dto.getBankAccess()); |
|
|
|
mapSum.put("bankAccess", dto.getBankAccess()); |
|
|
|
map.put("productPolicy", dto.getProductPolicy()); |
|
|
@ -638,8 +633,7 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
mapSum.put("loanInterest", dto.getLoanInterest()); |
|
|
|
map.put("solutionsRemarks", dto.getSolutionsRemarks()); |
|
|
|
mapSum.put("solutionsRemarks", dto.getSolutionsRemarks()); |
|
|
|
map.put("sid", loanSolution.getSid()); |
|
|
|
// updateById(loanSolution);
|
|
|
|
map.put("sid", loanSolution.getSid());*/ |
|
|
|
baseMapper.updateAppFinBack(map); |
|
|
|
// 总表
|
|
|
|
LoanSolutions loanSolutions = loanSolutionsService.selectByLoanPriceSid(loanLoadpriceVo.getSid()); |
|
|
@ -678,7 +672,7 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
LoanSolution loanSolution = baseMapper.selectByLoanPriceSid(loanLoadpriceVo.getSid()); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> mapSum = new HashMap<>(); |
|
|
|
BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
/* BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
BigDecimal downPay = StringUtils.toBigDecimal(dto.getDownPay()); |
|
|
|
map.put("downPay", downPay); |
|
|
|
mapSum.put("downPay", downPay == null ? null : downPay.multiply(num)); |
|
|
@ -693,13 +687,11 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
mapSum.put("downPayFinancier", dto.getDownPayFinancier()); |
|
|
|
map.put("downPayRemarks", dto.getDownPayRemarks()); |
|
|
|
mapSum.put("downPayRemarks", dto.getDownPayRemarks()); |
|
|
|
map.put("sid", loanSolution.getSid()); |
|
|
|
// updateBySid(map, loanSolution.getSid());
|
|
|
|
map.put("sid", loanSolution.getSid());*/ |
|
|
|
baseMapper.updateAppDownPay(map); |
|
|
|
// 总表
|
|
|
|
LoanSolutions loanSolutionsVo = loanSolutionsService.selectByLoanPriceSid(loanLoadpriceVo.getSid()); |
|
|
|
mapSum.put("sid", loanSolutionsVo.getSid()); |
|
|
|
// int i = loanSolutionsService.updateBySid(mapSum, loanSolutionsVo.getSid());
|
|
|
|
int i = loanSolutionsService.updateAppDownPay(mapSum); |
|
|
|
if (i == 1) { |
|
|
|
return new ResultBean().success().setMsg("操作成功").setData(loanSolution.getSid()); |
|
|
@ -734,7 +726,7 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
LoanSolution loanSolution = baseMapper.selectByLoanPriceSid(loanLoadpriceVo.getSid()); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> mapSum = new HashMap<>(); |
|
|
|
BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
/* BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
BigDecimal advanceAmount = StringUtils.toBigDecimal(dto.getAdvanceAmount()); |
|
|
|
map.put("advanceAmount", advanceAmount); |
|
|
|
mapSum.put("advanceAmount", advanceAmount == null ? null : advanceAmount.multiply(num)); |
|
|
@ -748,13 +740,11 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
mapSum.put("c_repayMoney", c_repayMoney == null ? null : c_repayMoney.multiply(num)); |
|
|
|
map.put("c_repayRemarks", dto.getC_repayRemarks()); |
|
|
|
mapSum.put("c_repayRemarks", dto.getC_repayRemarks()); |
|
|
|
map.put("sid", loanSolution.getSid()); |
|
|
|
// updateBySid(map, loanSolution.getSid());
|
|
|
|
map.put("sid", loanSolution.getSid());*/ |
|
|
|
baseMapper.updateAppCorpAdvance(map); |
|
|
|
// 总表
|
|
|
|
LoanSolutions loanSolutionsVo = loanSolutionsService.selectByLoanPriceSid(loanLoadpriceVo.getSid()); |
|
|
|
mapSum.put("sid", loanSolutionsVo.getSid()); |
|
|
|
// int i = loanSolutionsService.updateBySid(mapSum, loanSolutionsVo.getSid());
|
|
|
|
int i = loanSolutionsService.updateAppCorpAdvance(mapSum); |
|
|
|
if (i == 1) { |
|
|
|
return new ResultBean().success().setMsg("操作成功").setData(loanSolution.getSid()); |
|
|
@ -789,7 +779,7 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
LoanSolution loanSolution = baseMapper.selectByLoanPriceSid(loanLoadpriceVo.getSid()); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> mapSum = new HashMap<>(); |
|
|
|
BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
/*BigDecimal num = busOrderModelFeign.getModelQuantityByOrderSid(dto.getOrderSid()).getData(); |
|
|
|
map.put("prophase", StringUtils.isBlank(dto.getProphase()) ? null : dto.getProphase()); |
|
|
|
mapSum.put("prophase", StringUtils.isBlank(dto.getProphase()) ? null : dto.getProphase()); |
|
|
|
BigDecimal prophasePayMonkey = StringUtils.toBigDecimal(dto.getProphasePayMoney()); |
|
|
@ -801,14 +791,12 @@ public class LoanSolutionService extends MybatisBaseService<LoanSolutionMapper, |
|
|
|
map.put("modeOfRePayKey", dto.getModeOfRePayKey()); |
|
|
|
mapSum.put("modeOfRePayKey", dto.getModeOfRePayKey()); |
|
|
|
map.put("modeOfRePay", dto.getModeOfRePay()); |
|
|
|
mapSum.put("modeOfRePay", dto.getModeOfRePay()); |
|
|
|
// updateBySid(map, loanSolution.getSid());
|
|
|
|
mapSum.put("modeOfRePay", dto.getModeOfRePay());*/ |
|
|
|
map.put("sid", loanSolution.getSid()); |
|
|
|
baseMapper.updateAppRePayByMap(map); |
|
|
|
// 总表
|
|
|
|
LoanSolutions loanSolutionsVo = loanSolutionsService.selectByLoanPriceSid(loanLoadpriceVo.getSid()); |
|
|
|
mapSum.put("sid", loanSolutionsVo.getSid()); |
|
|
|
// int i = loanSolutionsService.updateBySid(mapSum, loanSolutionsVo.getSid());
|
|
|
|
int i = loanSolutionsService.updateAppRePayByMap(mapSum); |
|
|
|
if (i == 1) { |
|
|
|
return new ResultBean().success().setMsg("操作成功").setData(loanSolution.getSid()); |
|
|
|