diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeposit/AppBusDepositBuscenterDetailVo.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeposit/AppBusDepositBuscenterDetailVo.java index cec748ff11..5e579c61dd 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeposit/AppBusDepositBuscenterDetailVo.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeposit/AppBusDepositBuscenterDetailVo.java @@ -100,6 +100,8 @@ public class AppBusDepositBuscenterDetailVo implements Vo { @ApiModelProperty("采购系统名称") private String purchaseSystemName; + private String orgSidPath; + } diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeposit/BusDepositService.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeposit/BusDepositService.java index b3b9e4b300..6b727df2b6 100644 --- a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeposit/BusDepositService.java +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeposit/BusDepositService.java @@ -186,6 +186,7 @@ public class BusDepositService extends MybatisBaseService list = new ArrayList<>(); if (StringUtils.isNotBlank(vo.getPaymentProof())) { String url = fileUploadComponent.getUrlPrefix() + vo.getPaymentProof(); diff --git a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeign.java b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeign.java index d6e41f52ca..af5595d42f 100644 --- a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeign.java +++ b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeign.java @@ -132,7 +132,7 @@ public interface CrmCustomerTempFeign { @ApiOperation("手机端保存/修改潜在客户信息") @PostMapping("/saveOrUpdateAppCustomerTemp") - public ResultBean saveOrUpdateAppCustomerTemp(@Valid @RequestBody AppCrmCustomerTempDto dto); + public ResultBean saveOrUpdateAppCustomerTemp(@Valid @RequestBody AppCrmCustomerTempDto dto); @ApiOperation("手机端维护客户信息是否完善的状态") @ResponseBody diff --git a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeignFallback.java b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeignFallback.java index 9843960385..941b031c24 100644 --- a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeignFallback.java +++ b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempFeignFallback.java @@ -90,8 +90,8 @@ public class CrmCustomerTempFeignFallback implements CrmCustomerTempFeign { } @Override - public ResultBean saveOrUpdateAppCustomerTemp(AppCrmCustomerTempDto dto) { - ResultBean rb = ResultBean.fireFail(); + public ResultBean saveOrUpdateAppCustomerTemp(AppCrmCustomerTempDto dto) { + ResultBean rb = ResultBean.fireFail(); return rb.setMsg("接口anrui-crm/crmcustomertemp/saveOrUpdateAppCustomerTemp无法访问"); } diff --git a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempRest.java b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempRest.java index 739984727d..7eae6e9415 100644 --- a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempRest.java +++ b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempRest.java @@ -173,7 +173,7 @@ public class CrmCustomerTempRest implements CrmCustomerTempFeign { * @return */ @Override - public ResultBean saveOrUpdateAppCustomerTemp(AppCrmCustomerTempDto dto) { + public ResultBean saveOrUpdateAppCustomerTemp(AppCrmCustomerTempDto dto) { return crmCustomerTempService.saveOrUpdateAppCustomerTemp(dto); } diff --git a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java index 43de630f3e..2d992babe7 100644 --- a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java +++ b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java @@ -274,8 +274,8 @@ public class CrmCustomerTempService extends MybatisBaseService saveOrUpdateAppCustomerTemp(AppCrmCustomerTempDto dto) { + ResultBean rb = ResultBean.fireFail(); /** * 2023-02-10: * 先查询客户编码是否存在: @@ -309,7 +309,7 @@ public class CrmCustomerTempService extends MybatisBaseService 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 pagging = finSelectedReceivablesDetailedService.getPaymentDetailsList(page, qw, params.getName()); - /* List 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 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 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 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 voList = finSelectedReceivablesDetailedService.selectListByVin(v.getContractNo(), finUncollectedReceivablesDetailed.getBusVinSid(), 3); - BigDecimal bigDecimalVinAll = voList.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); - //查询该合同编号下的销售订单的单车成交价 - ResultBean commonContractResultBean = commonContractFeign.selectByNo(v.getContractNo()); - if (commonContractResultBean.getSuccess()) { - CommonContract commonContract = commonContractResultBean.getData(); - if (commonContract != null) { - ResultBean 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 voList = finSelectedReceivablesDetailedService.selectListByVin(v.getContractNo(), finUncollectedReceivablesDetailed.getBusVinSid(), 3); + BigDecimal bigDecimalVinAll = voList.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); + //查询该合同编号下的销售订单的单车成交价 + ResultBean commonContractResultBean = commonContractFeign.selectByNo(v.getContractNo()); + if (commonContractResultBean.getSuccess()) { + CommonContract commonContract = commonContractResultBean.getData(); + if (commonContract != null) { + ResultBean 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 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 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 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 sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(confirmation.getUseOrgSid()); - if (sysOrganizationVoResultBean.getData() != null) { - busDeliveredDto.setUseOrgName(sysOrganizationVoResultBean.getData().getName()); + //根据busVinSid查询待出库中是否存在该数据 + ResultBean 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 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 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 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> billNoList() { ResultBean> rb = ResultBean.fireFail(); List stringList = baseMapper.billNoList(); diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml index 666ec94ff1..e9c89a42bb 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml @@ -284,9 +284,10 @@ diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailed/FinUncollectedReceivablesDetailedMapper.xml b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailed/FinUncollectedReceivablesDetailedMapper.xml index 75833c0b22..e1c3bff4d6 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailed/FinUncollectedReceivablesDetailedMapper.xml +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailed/FinUncollectedReceivablesDetailedMapper.xml @@ -59,7 +59,7 @@ furd.customerName AS `customerName`, furd.customerSid, furd.useOrgSid, - (furd.`reveivableMoney` - COALESCE(df.dbalance, 0)) AS currentReceivableMoney, + cast((furd.`reveivableMoney` - COALESCE(df.dbalance, 0)) AS DECIMAL (10, 2) ) AS currentReceivableMoney, furd.reveivableMoney, furd.contractSid, if(bv.linkNo is null or LENGTH(trim(bv.linkNo)) < 1, @@ -76,12 +76,10 @@ SELECT d.sid, d.receivablesSid, d.`collSid`, - ( - sum(d.`subscriptionMoney`) - COALESCE(SUM(f.`thisUseMoney`), 0)) AS dbalance + cast((sum(d.`subscriptionMoney`) - COALESCE(SUM(f.`thisUseMoney`), 0)) AS DECIMAL (10, 2)) AS dbalance FROM fin_selected_receivables_detailed d LEFT JOIN `fin_funds_carried_forward_veh` f ON f.`busSid` = d.`sid` - where d.auditState = 1 - or d.auditState = 3 + where (d.auditState = 1 or d.auditState = 3) GROUP BY d.`receivablesSid` ) df ON df.receivablesSid = furd.`sid`