|
|
@ -54,9 +54,7 @@ import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderPriceInfoVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordersubmit.SubmitVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempVo; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CustomerQuery; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.*; |
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.*; |
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.app.AppBusArrearsCarryMoneyVo; |
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.app.FinConfirmDto; |
|
|
@ -1160,7 +1158,6 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
if (params.getSidList().size() > 0) { |
|
|
|
qw.notIn("furd.sid", params.getSidList()); |
|
|
|
} |
|
|
|
/* qw.gt("furd.currentReceivableMoney", 0);//应收金额*/ |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getParams().getPurchaseSystemSid())) { |
|
|
|
qw.eq("furd.purchaseSystemSid", pagerQuery.getParams().getPurchaseSystemSid()); |
|
|
|
} else { |
|
|
@ -1168,28 +1165,6 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
} |
|
|
|
} |
|
|
|
IPage<AppFinUncollectedReceivablesDetailedVo> pagging = finSelectedReceivablesDetailedService.getPaymentDetailsList(page, qw, params.getName()); |
|
|
|
/* List<AppFinUncollectedReceivablesDetailedVo> records = pagging.getRecords(); |
|
|
|
records.removeAll(Collections.singleton(null)); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
for (int i = 0; i < records.size(); i++) { |
|
|
|
AppFinUncollectedReceivablesDetailedVo vo = records.get(i); |
|
|
|
//查询当前应收:应收金额-所有认款的余额=剩余应收金额 (所有认款的余额 = 认款金额-结转之和)
|
|
|
|
String receivablesSid = vo.getReceivablesSid(); |
|
|
|
//查询所有的该应收未收的已提交和已审核的认款
|
|
|
|
List<FinSelectedReceivablesDetailed> stringList = finSelectedReceivablesDetailedService.selectListByReceivableSid(receivablesSid); |
|
|
|
stringList.removeAll(Collections.singleton(null)); |
|
|
|
if (!stringList.isEmpty()) { |
|
|
|
//所有已提交和已审核的认款
|
|
|
|
BigDecimal bigDecimalVinAll = stringList.stream().map(FinSelectedReceivablesDetailed::getSubscriptionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
List<String> sidsList = stringList.stream().map(v -> v.getSid()).collect(Collectors.toList()); |
|
|
|
//查询所有已提交和已审核的认款是否包含结转的
|
|
|
|
String forwardMoneyAll = finFundsCarriedForwardVehService.selectByBusSid(sidsList); |
|
|
|
BigDecimal reveivableMoney = bigDecimalVinAll.subtract(new BigDecimal(forwardMoneyAll)); |
|
|
|
BigDecimal receivable = new BigDecimal(vo.getReceivable()).subtract(reveivableMoney); |
|
|
|
vo.setReceivable(receivable.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
return pagging; |
|
|
|
} |
|
|
|
|
|
|
@ -1270,7 +1245,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
* @param userSid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean cashierConfirm(String sid, String userSid) { |
|
|
|
public ResultBean cashierConfirmOld(String sid, String userSid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinCollectionConfirmation confirmation = fetchBySid(sid); |
|
|
|
if (confirmation == null) { |
|
|
@ -1616,7 +1591,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean cashierConfirm11111(String sid, String userSid) { |
|
|
|
public ResultBean cashierConfirm(String sid, String userSid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinCollectionConfirmation confirmation = fetchBySid(sid); |
|
|
|
if (confirmation == null) { |
|
|
@ -1806,137 +1781,150 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
BigDecimal subscriptionMoneyAll = new BigDecimal("0"); |
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos = finSelectedReceivablesDetailedService.fetchByAuditState(sid, 1); |
|
|
|
if (finSelectedReceivablesDetailedVos.size() > 0) { |
|
|
|
finSelectedReceivablesDetailedVos.stream().forEach(v -> { |
|
|
|
//已选款项明细sid
|
|
|
|
String selectSid = v.getSid(); |
|
|
|
//应收未收款项明细sid
|
|
|
|
String receivablesSid = v.getReceivablesSid(); |
|
|
|
FinUncollectedReceivablesDetailed finUncollectedReceivablesDetailed = finUncollectedReceivablesDetailedService.fetchBySid(receivablesSid); |
|
|
|
if (v.getSubscribedOf() == 0) { |
|
|
|
//更新认款状态
|
|
|
|
finUncollectedReceivablesDetailed.setSubscriptionState(finUncollectedReceivablesDetailed.getCurrentReceivableMoney().compareTo(BigDecimal.ZERO) == 0 ? 3 : 2); |
|
|
|
finUncollectedReceivablesDetailedService.updateById(finUncollectedReceivablesDetailed); |
|
|
|
} |
|
|
|
FinSelectedReceivablesDetailed finSelectedReceivablesDetailed = finSelectedReceivablesDetailedService.fetchBySid(selectSid); |
|
|
|
//更新已选款项明细的审核状态1待审核/2已驳回/3已审核
|
|
|
|
finSelectedReceivablesDetailed.setAuditState(3); |
|
|
|
//更新审核时间
|
|
|
|
finSelectedReceivablesDetailed.setAuditDate(DateUtil.today()); |
|
|
|
finSelectedReceivablesDetailedService.updateById(finSelectedReceivablesDetailed); |
|
|
|
/*//ToDo:查询是否符合待出库的条件
|
|
|
|
//该合同编号下的该车架号的所有认款金额
|
|
|
|
List<FinSelectedReceivablesDetailedVo> voList = finSelectedReceivablesDetailedService.selectListByVin(v.getContractNo(), finUncollectedReceivablesDetailed.getBusVinSid(), 3); |
|
|
|
BigDecimal bigDecimalVinAll = voList.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
//查询该合同编号下的销售订单的单车成交价
|
|
|
|
ResultBean<CommonContract> commonContractResultBean = commonContractFeign.selectByNo(v.getContractNo()); |
|
|
|
if (commonContractResultBean.getSuccess()) { |
|
|
|
CommonContract commonContract = commonContractResultBean.getData(); |
|
|
|
if (commonContract != null) { |
|
|
|
ResultBean<AppOrderDetailsVo> orderDetails = busSalesOrderFeign.getSaleOrderDetails(commonContract.getBusSid()); |
|
|
|
AppOrderDetailsVo vo = orderDetails.getData(); |
|
|
|
if (vo != null) { |
|
|
|
AppOrderPriceInfoVo priceInfoVo = vo.getPriceInfo(); |
|
|
|
AppOrderDepositInfoVo depositInfo = vo.getDepositInfo(); |
|
|
|
if (depositInfo != null) { |
|
|
|
if ("02".equals(depositInfo.getDepositTypeKey())) {//订金结转
|
|
|
|
BigDecimal decimalDeposit = BigDecimal.ZERO; |
|
|
|
if (StringUtils.isNotBlank(depositInfo.getDepositTotal())) { |
|
|
|
decimalDeposit = new BigDecimal(depositInfo.getDepositTotal()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(depositInfo.getMakeUpDeposit())) { |
|
|
|
decimalDeposit = decimalDeposit.subtract(new BigDecimal(depositInfo.getMakeUpDeposit())); |
|
|
|
if (confirmation.getPushMessgae() == 1) {//简易订单定金
|
|
|
|
finSelectedReceivablesDetailedVos.stream().forEach(v -> { |
|
|
|
//已选款项明细sid
|
|
|
|
String selectSid = v.getSid(); |
|
|
|
FinSelectedReceivablesDetailed finSelectedReceivablesDetailed = finSelectedReceivablesDetailedService.fetchBySid(selectSid); |
|
|
|
//更新已选款项明细的审核状态1待审核/2已驳回/3已审核
|
|
|
|
finSelectedReceivablesDetailed.setAuditState(3); |
|
|
|
//更新审核时间
|
|
|
|
finSelectedReceivablesDetailed.setAuditDate(DateUtil.today()); |
|
|
|
finSelectedReceivablesDetailedService.updateById(finSelectedReceivablesDetailed); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
finSelectedReceivablesDetailedVos.stream().forEach(v -> { |
|
|
|
//已选款项明细sid
|
|
|
|
String selectSid = v.getSid(); |
|
|
|
//应收未收款项明细sid
|
|
|
|
String receivablesSid = v.getReceivablesSid(); |
|
|
|
FinUncollectedReceivablesDetailed finUncollectedReceivablesDetailed = finUncollectedReceivablesDetailedService.fetchBySid(receivablesSid); |
|
|
|
if (v.getSubscribedOf() == 0) { |
|
|
|
//更新认款状态
|
|
|
|
finUncollectedReceivablesDetailed.setSubscriptionState(finUncollectedReceivablesDetailed.getCurrentReceivableMoney().compareTo(BigDecimal.ZERO) == 0 ? 3 : 2); |
|
|
|
finUncollectedReceivablesDetailedService.updateById(finUncollectedReceivablesDetailed); |
|
|
|
} |
|
|
|
FinSelectedReceivablesDetailed finSelectedReceivablesDetailed = finSelectedReceivablesDetailedService.fetchBySid(selectSid); |
|
|
|
//更新已选款项明细的审核状态1待审核/2已驳回/3已审核
|
|
|
|
finSelectedReceivablesDetailed.setAuditState(3); |
|
|
|
//更新审核时间
|
|
|
|
finSelectedReceivablesDetailed.setAuditDate(DateUtil.today()); |
|
|
|
finSelectedReceivablesDetailedService.updateById(finSelectedReceivablesDetailed); |
|
|
|
//ToDo:查询是否符合待出库的条件
|
|
|
|
//该合同编号下的该车架号的所有认款金额
|
|
|
|
List<FinSelectedReceivablesDetailedVo> voList = finSelectedReceivablesDetailedService.selectListByVin(v.getContractNo(), finUncollectedReceivablesDetailed.getBusVinSid(), 3); |
|
|
|
BigDecimal bigDecimalVinAll = voList.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
//查询该合同编号下的销售订单的单车成交价
|
|
|
|
ResultBean<CommonContract> commonContractResultBean = commonContractFeign.selectByNo(v.getContractNo()); |
|
|
|
if (commonContractResultBean.getSuccess()) { |
|
|
|
CommonContract commonContract = commonContractResultBean.getData(); |
|
|
|
if (commonContract != null) { |
|
|
|
ResultBean<AppOrderDetailsVo> orderDetails = busSalesOrderFeign.getSaleOrderDetails(commonContract.getBusSid()); |
|
|
|
AppOrderDetailsVo vo = orderDetails.getData(); |
|
|
|
if (vo != null) { |
|
|
|
AppOrderPriceInfoVo priceInfoVo = vo.getPriceInfo(); |
|
|
|
AppOrderDepositInfoVo depositInfo = vo.getDepositInfo(); |
|
|
|
if (depositInfo != null) { |
|
|
|
if ("02".equals(depositInfo.getDepositTypeKey())) {//订金结转
|
|
|
|
BigDecimal decimalDeposit = BigDecimal.ZERO; |
|
|
|
if (StringUtils.isNotBlank(depositInfo.getDepositTotal())) { |
|
|
|
decimalDeposit = new BigDecimal(depositInfo.getDepositTotal()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(depositInfo.getMakeUpDeposit())) { |
|
|
|
decimalDeposit = decimalDeposit.subtract(new BigDecimal(depositInfo.getMakeUpDeposit())); |
|
|
|
} |
|
|
|
decimalDeposit = decimalDeposit.divide(new BigDecimal(priceInfoVo.getNumber()), BigDecimal.ROUND_CEILING); |
|
|
|
bigDecimalVinAll = bigDecimalVinAll.add(decimalDeposit); |
|
|
|
} |
|
|
|
decimalDeposit = decimalDeposit.divide(new BigDecimal(priceInfoVo.getNumber()), BigDecimal.ROUND_CEILING); |
|
|
|
bigDecimalVinAll = bigDecimalVinAll.add(decimalDeposit); |
|
|
|
} |
|
|
|
} |
|
|
|
//单台整体成交价
|
|
|
|
BigDecimal singleFinalPrice = new BigDecimal(priceInfoVo.getSingleFinalPrice()); |
|
|
|
BigDecimal leftAll = BigDecimal.ZERO; |
|
|
|
BigDecimal rightAll = BigDecimal.ZERO; |
|
|
|
if ("2".equals(vo.getFinancePlan()) || "2".equals(vo.getPayTypeKey())) { |
|
|
|
//根据销售订单sid查询金融方案
|
|
|
|
ResultBean<SolutionsDetailsVo> solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetailss(commonContract.getBusSid()); |
|
|
|
SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData(); |
|
|
|
if (solutionsDetailsVo != null) { |
|
|
|
if (StringUtils.isNotBlank(solutionsDetailsVo.getTypeKey())) { |
|
|
|
if ("02".equals(solutionsDetailsVo.getTypeKey())) { |
|
|
|
//外部金融:成交价 = 订金+车款+厂家贴息-服务费
|
|
|
|
leftAll = leftAll.add(singleFinalPrice); |
|
|
|
if (StringUtils.isNotBlank(solutionsDetailsVo.getFactoryDiscount())) { |
|
|
|
leftAll = leftAll.subtract(new BigDecimal(solutionsDetailsVo.getFactoryDiscount())); |
|
|
|
//单台整体成交价
|
|
|
|
BigDecimal singleFinalPrice = new BigDecimal(priceInfoVo.getSingleFinalPrice()); |
|
|
|
BigDecimal leftAll = BigDecimal.ZERO; |
|
|
|
BigDecimal rightAll = BigDecimal.ZERO; |
|
|
|
if ("2".equals(vo.getFinancePlan()) || "2".equals(vo.getPayTypeKey())) { |
|
|
|
//根据销售订单sid查询金融方案
|
|
|
|
ResultBean<SolutionsDetailsVo> solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetailss(commonContract.getBusSid()); |
|
|
|
SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData(); |
|
|
|
if (solutionsDetailsVo != null) { |
|
|
|
if (StringUtils.isNotBlank(solutionsDetailsVo.getTypeKey())) { |
|
|
|
if ("02".equals(solutionsDetailsVo.getTypeKey())) { |
|
|
|
//外部金融:成交价 = 订金+车款+厂家贴息-服务费
|
|
|
|
leftAll = leftAll.add(singleFinalPrice); |
|
|
|
if (StringUtils.isNotBlank(solutionsDetailsVo.getFactoryDiscount())) { |
|
|
|
leftAll = leftAll.subtract(new BigDecimal(solutionsDetailsVo.getFactoryDiscount())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(solutionsDetailsVo.getServiceAmount())) { |
|
|
|
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getServiceAmount())); |
|
|
|
} |
|
|
|
rightAll = rightAll.add(bigDecimalVinAll); |
|
|
|
} else { |
|
|
|
//自营非担保: 实收订金 = 首付款及费用+订金
|
|
|
|
if (StringUtils.isNotBlank(solutionsDetailsVo.getRealTotal())) { |
|
|
|
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getRealTotal())); |
|
|
|
} |
|
|
|
rightAll = rightAll.add(bigDecimalVinAll); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(solutionsDetailsVo.getServiceAmount())) { |
|
|
|
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getServiceAmount())); |
|
|
|
} |
|
|
|
rightAll = rightAll.add(bigDecimalVinAll); |
|
|
|
} else { |
|
|
|
//自营非担保: 实收订金 = 首付款及费用+订金
|
|
|
|
} else {//担保贷款: 实收订金 = 首付款及费用+订金
|
|
|
|
if (StringUtils.isNotBlank(solutionsDetailsVo.getRealTotal())) { |
|
|
|
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getRealTotal())); |
|
|
|
} |
|
|
|
rightAll = rightAll.add(bigDecimalVinAll); |
|
|
|
} |
|
|
|
} else {//担保贷款: 实收订金 = 首付款及费用+订金
|
|
|
|
if (StringUtils.isNotBlank(solutionsDetailsVo.getRealTotal())) { |
|
|
|
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getRealTotal())); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 成交价 = 车款+订金
|
|
|
|
leftAll = leftAll.add(singleFinalPrice); |
|
|
|
rightAll = rightAll.add(bigDecimalVinAll); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 成交价 = 车款+订金
|
|
|
|
// 成交价 = 车款+订金
|
|
|
|
leftAll = leftAll.add(singleFinalPrice); |
|
|
|
rightAll = rightAll.add(bigDecimalVinAll); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 成交价 = 车款+订金
|
|
|
|
leftAll = leftAll.add(singleFinalPrice); |
|
|
|
rightAll = rightAll.add(bigDecimalVinAll); |
|
|
|
} |
|
|
|
//根据busVinSid查询待出库中是否存在该数据
|
|
|
|
ResultBean<BusDelivered> busDeliveredResultBean = busDeliveredFeign.selectByBusVinSid(finUncollectedReceivablesDetailed.getBusVinSid()); |
|
|
|
if (busDeliveredResultBean.getData() == null) { |
|
|
|
if (leftAll.compareTo(rightAll) <= 0) {//推送待出库
|
|
|
|
BusDeliveredDto busDeliveredDto = new BusDeliveredDto(); |
|
|
|
busDeliveredDto.setSubscriptionKey(VehicleStateTempOrLast.PaymentEnum.PAY_MODELS.getCode()); |
|
|
|
busDeliveredDto.setSubscription(VehicleStateTempOrLast.PaymentEnum.PAY_MODELS.getRemarks()); |
|
|
|
busDeliveredDto.setPaymentMethodKey(vo.getPayTypeKey()); |
|
|
|
busDeliveredDto.setPaymentMethod(vo.getPayType()); |
|
|
|
busDeliveredDto.setContractNo(v.getContractNo()); |
|
|
|
busDeliveredDto.setName(v.getCustomerName()); |
|
|
|
busDeliveredDto.setVinNo(v.getVIN()); |
|
|
|
busDeliveredDto.setMobile(v.getCustomerPhone()); |
|
|
|
busDeliveredDto.setPrice(priceInfoVo.getSingleFinalPrice()); |
|
|
|
busDeliveredDto.setCreateBySid(confirmation.getStaffUserSid()); |
|
|
|
SubmitVo intermediary1 = vo.getIntermediary1(); |
|
|
|
if (intermediary1 != null) { |
|
|
|
busDeliveredDto.setDistributorName(intermediary1.getIntermediaryName()); |
|
|
|
busDeliveredDto.setDistributorPrice(intermediary1.getAgencyFee()); |
|
|
|
} |
|
|
|
SubmitVo intermediary2 = vo.getIntermediary2(); |
|
|
|
if (intermediary2 != null) { |
|
|
|
busDeliveredDto.setDistributorNameTwo(intermediary2.getIntermediaryName()); |
|
|
|
busDeliveredDto.setDistributorPriceTwo(intermediary2.getAgencyFee()); |
|
|
|
} |
|
|
|
busDeliveredDto.setSingleCarDiscountPrice(priceInfoVo.getSingleCarDiscountPrice()); |
|
|
|
//根据客户sid查询客户的身份证号
|
|
|
|
AppOrderModelInfoVo appOrderModelInfoVo = vo.getModelInfo(); |
|
|
|
busDeliveredDto.setModelName(appOrderModelInfoVo.getModelName()); |
|
|
|
busDeliveredDto.setUseOrgSid(confirmation.getUseOrgSid()); |
|
|
|
ResultBean<SysOrganizationVo> sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(confirmation.getUseOrgSid()); |
|
|
|
if (sysOrganizationVoResultBean.getData() != null) { |
|
|
|
busDeliveredDto.setUseOrgName(sysOrganizationVoResultBean.getData().getName()); |
|
|
|
//根据busVinSid查询待出库中是否存在该数据
|
|
|
|
ResultBean<BusDelivered> busDeliveredResultBean = busDeliveredFeign.selectByBusVinSid(finUncollectedReceivablesDetailed.getBusVinSid()); |
|
|
|
if (busDeliveredResultBean.getData() == null) { |
|
|
|
if (leftAll.compareTo(rightAll) <= 0) {//推送待出库
|
|
|
|
BusDeliveredDto busDeliveredDto = new BusDeliveredDto(); |
|
|
|
busDeliveredDto.setSubscriptionKey(VehicleStateTempOrLast.PaymentEnum.PAY_MODELS.getCode()); |
|
|
|
busDeliveredDto.setSubscription(VehicleStateTempOrLast.PaymentEnum.PAY_MODELS.getRemarks()); |
|
|
|
busDeliveredDto.setPaymentMethodKey(vo.getPayTypeKey()); |
|
|
|
busDeliveredDto.setPaymentMethod(vo.getPayType()); |
|
|
|
busDeliveredDto.setContractNo(v.getContractNo()); |
|
|
|
busDeliveredDto.setName(v.getCustomerName()); |
|
|
|
busDeliveredDto.setVinNo(v.getVIN()); |
|
|
|
busDeliveredDto.setMobile(v.getCustomerPhone()); |
|
|
|
busDeliveredDto.setPrice(priceInfoVo.getSingleFinalPrice()); |
|
|
|
busDeliveredDto.setCreateBySid(confirmation.getStaffUserSid()); |
|
|
|
SubmitVo intermediary1 = vo.getIntermediary1(); |
|
|
|
if (intermediary1 != null) { |
|
|
|
busDeliveredDto.setDistributorName(intermediary1.getIntermediaryName()); |
|
|
|
busDeliveredDto.setDistributorPrice(intermediary1.getAgencyFee()); |
|
|
|
} |
|
|
|
SubmitVo intermediary2 = vo.getIntermediary2(); |
|
|
|
if (intermediary2 != null) { |
|
|
|
busDeliveredDto.setDistributorNameTwo(intermediary2.getIntermediaryName()); |
|
|
|
busDeliveredDto.setDistributorPriceTwo(intermediary2.getAgencyFee()); |
|
|
|
} |
|
|
|
busDeliveredDto.setSingleCarDiscountPrice(priceInfoVo.getSingleCarDiscountPrice()); |
|
|
|
//根据客户sid查询客户的身份证号
|
|
|
|
AppOrderModelInfoVo appOrderModelInfoVo = vo.getModelInfo(); |
|
|
|
busDeliveredDto.setModelName(appOrderModelInfoVo.getModelName()); |
|
|
|
busDeliveredDto.setUseOrgSid(confirmation.getUseOrgSid()); |
|
|
|
ResultBean<SysOrganizationVo> sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(confirmation.getUseOrgSid()); |
|
|
|
if (sysOrganizationVoResultBean.getData() != null) { |
|
|
|
busDeliveredDto.setUseOrgName(sysOrganizationVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
busDeliveredDto.setBusVinSid(finUncollectedReceivablesDetailed.getBusVinSid()); |
|
|
|
ResultBean resultBean1 = busDeliveredFeign.save(busDeliveredDto); |
|
|
|
} |
|
|
|
busDeliveredDto.setBusVinSid(finUncollectedReceivablesDetailed.getBusVinSid()); |
|
|
|
ResultBean resultBean1 = busDeliveredFeign.save(busDeliveredDto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
//查询该申请已认款金额总数
|
|
|
|
subscriptionMoneyAll = finSelectedReceivablesDetailedVos.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
} |
|
|
@ -2480,7 +2468,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean saveFinConfirm(FinConfirmDto dto) { |
|
|
|
public ResultBean saveFinConfirmOld(FinConfirmDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinCollectionConfirmation confirmation = new FinCollectionConfirmation(); |
|
|
|
BeanUtil.copyProperties(dto, confirmation, "sid"); |
|
|
@ -2510,6 +2498,60 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean saveFinConfirm(FinConfirmDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinCollectionConfirmation confirmation = new FinCollectionConfirmation(); |
|
|
|
BeanUtil.copyProperties(dto, confirmation, "sid"); |
|
|
|
confirmation.setBalance(BigDecimal.ZERO); |
|
|
|
baseMapper.insert(confirmation); |
|
|
|
AppBusDepositBuscenterDetailVo busDeposit = busDepositFeign.getDepositInfoDetails(confirmation.getBusSid()).getData(); |
|
|
|
//根据简易订单的付款人创建客户
|
|
|
|
AppCrmCustomerTempDto crmCustomerTemp = new AppCrmCustomerTempDto(); |
|
|
|
//付款人
|
|
|
|
crmCustomerTemp.setName(busDeposit.getPayName()); |
|
|
|
crmCustomerTemp.setMobile(busDeposit.getPhone()); |
|
|
|
crmCustomerTemp.setUserSid(confirmation.getCreateBySid()); |
|
|
|
crmCustomerTemp.setOrgPath(busDeposit.getOrgSidPath()); |
|
|
|
crmCustomerTemp.setCustomerType("个人"); |
|
|
|
crmCustomerTemp.setCustomerTypeKey("1"); |
|
|
|
String mobile = busDeposit.getPhone(); |
|
|
|
String name = busDeposit.getPayName(); |
|
|
|
crmCustomerTemp.setMobile(mobile); |
|
|
|
crmCustomerTemp.setName(name); |
|
|
|
crmCustomerTemp.setIsOnRemindkey("0"); |
|
|
|
crmCustomerTemp.setIsOnRemind("否"); |
|
|
|
ResultBean<String> crmResultBean = crmCustomerTempFeign.saveOrUpdateAppCustomerTemp(crmCustomerTemp); |
|
|
|
FinSelectedReceivablesDetailed finSelectedReceivablesDetailed = new FinSelectedReceivablesDetailed(); |
|
|
|
finSelectedReceivablesDetailed.setCollSid(confirmation.getSid()); |
|
|
|
finSelectedReceivablesDetailed.setReceivablesName("订金"); |
|
|
|
finSelectedReceivablesDetailed.setSubscribedOf(1); |
|
|
|
finSelectedReceivablesDetailed.setAuditState(1); |
|
|
|
finSelectedReceivablesDetailed.setCustomerName(crmCustomerTemp.getName()); |
|
|
|
finSelectedReceivablesDetailed.setCustomerPhone(crmCustomerTemp.getMobile()); |
|
|
|
finSelectedReceivablesDetailed.setCustomerSid(crmResultBean.getData()); |
|
|
|
finSelectedReceivablesDetailed.setCreateByName(busDeposit.getStaffName()); |
|
|
|
finSelectedReceivablesDetailed.setCurrentReceivableMoney(confirmation.getCollectionMoney()); |
|
|
|
finSelectedReceivablesDetailed.setSubscriptionMoney(confirmation.getCollectionMoney()); |
|
|
|
finSelectedReceivablesDetailed.setUseOrgSid(confirmation.getUseOrgSid()); |
|
|
|
finSelectedReceivablesDetailed.setSubscriptionDate(DateUtil.today()); |
|
|
|
finSelectedReceivablesDetailedService.insert(finSelectedReceivablesDetailed); |
|
|
|
if (StringUtils.isNotBlank(confirmation.getPaymentVoucherUrl())) { |
|
|
|
//添加进附件表
|
|
|
|
List<String> stringList = Arrays.asList(confirmation.getPaymentVoucherUrl().split(",")); |
|
|
|
//附件保存:打款凭证附件
|
|
|
|
stringList.stream().forEach(v -> { |
|
|
|
CommonAppendixDto commonAppendixDto = new CommonAppendixDto(); |
|
|
|
commonAppendixDto.setFilePath(v); |
|
|
|
commonAppendixDto.setFileName(CommonAttachTypeEnum.PAYMENT_VOUCHER.getMark()); |
|
|
|
commonAppendixDto.setLinkSid(confirmation.getSid()); |
|
|
|
commonAppendixDto.setCreateBySid(confirmation.getCreateBySid()); |
|
|
|
commonAppendixDto.setAttachType(CommonAttachTypeEnum.PAYMENT_VOUCHER.getAttachType()); |
|
|
|
commonAppendixFeign.save(commonAppendixDto); |
|
|
|
}); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<String>> billNoList() { |
|
|
|
ResultBean<List<String>> rb = ResultBean.fireFail(); |
|
|
|
List<String> stringList = baseMapper.billNoList(); |
|
|
|