|
@ -1464,43 +1464,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//推送订金
|
|
|
/* List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1, "车款"); |
|
|
|
|
|
finSelectedReceivablesDetailedVos1.removeAll(Collections.singleton(null)); |
|
|
|
|
|
if (!finSelectedReceivablesDetailedVos1.isEmpty()) { |
|
|
|
|
|
for (FinSelectedReceivablesDetailedVo finSelectedReceivablesDetailedVo : finSelectedReceivablesDetailedVos1) { |
|
|
|
|
|
//先推送客户
|
|
|
|
|
|
BdCustomer bdCustomer = createBdCustomer(confirmation.getUseOrgSid(), finSelectedReceivablesDetailedVo.getCustomerName(), finSelectedReceivablesDetailedVo.getCustomerPhone()); |
|
|
|
|
|
ResultBean resultBeanMiddle = bdCustomerService.draftBdCustomer(bdCustomer); |
|
|
|
|
|
//往来单位
|
|
|
|
|
|
arReceivebill.setFCONTACTUNIT(bdCustomer.getFNumber()); |
|
|
|
|
|
//结算方式
|
|
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
|
|
freceivebillentry.setFSETTLETYPEIDType("customerPayType"); |
|
|
|
|
|
//收款金额
|
|
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(finSelectedReceivablesDetailedVo.getSumAll()); |
|
|
|
|
|
//登记日期
|
|
|
|
|
|
freceivebillentry.setFPOSTDATE(confirmation.getCollectionDate()); |
|
|
|
|
|
//收款用途
|
|
|
|
|
|
freceivebillentry.setFPURPOSEIDKey("001"); |
|
|
|
|
|
freceivebillentry.setFPURPOSEIDType("cw_skyt"); |
|
|
|
|
|
freceivebillentry.setFACCOUNTID(confirmation.getCollectionBankNum()); |
|
|
|
|
|
fEntityList.add(freceivebillentry); |
|
|
|
|
|
//项目类别key、value
|
|
|
|
|
|
arReceivebill.setF_PAEZ_AssistantType("cw_sklb"); |
|
|
|
|
|
FinUncollectedReceivablesDetailed finUncollectedReceivablesDetailed = finUncollectedReceivablesDetailedService.fetchBySid(finSelectedReceivablesDetailedVos1.get(0).getReceivablesSid()); |
|
|
|
|
|
if ("1".equals(finUncollectedReceivablesDetailed.getPayTypeKey())) { |
|
|
|
|
|
arReceivebill.setF_PAEZ_AssistantKey("001"); |
|
|
|
|
|
} else if ("2".equals(finUncollectedReceivablesDetailed.getPayTypeKey())) { |
|
|
|
|
|
arReceivebill.setF_PAEZ_AssistantKey("002"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
arReceivebill.setFRECEIVEBILLENTRY(fEntityList); |
|
|
|
|
|
ResultBean resultBean1 = arReceivebillService.draftArReceivebill(arReceivebill); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
if (finSelectedReceivablesDetailedVos2.size() > 0) { |
|
|
if (finSelectedReceivablesDetailedVos2.size() > 0) { |
|
|
voListv = finSelectedReceivablesDetailedService.selectDetailsList(sid, 1, "订金"); |
|
|
voListv = finSelectedReceivablesDetailedService.selectDetailsList(sid, 1, "订金"); |
|
|
//查询是否含有车架号
|
|
|
//查询是否含有车架号
|
|
@ -1617,38 +1581,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//推送订金
|
|
|
|
|
|
/*List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos2 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1, "订金"); |
|
|
|
|
|
fEntityList = new ArrayList<>(); |
|
|
|
|
|
freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
|
|
finSelectedReceivablesDetailedVos2.removeAll(Collections.singleton(null)); |
|
|
|
|
|
if (!finSelectedReceivablesDetailedVos2.isEmpty()) { |
|
|
|
|
|
for (FinSelectedReceivablesDetailedVo finSelectedReceivablesDetailedVo : finSelectedReceivablesDetailedVos2) { |
|
|
|
|
|
//先推送客户
|
|
|
|
|
|
BdCustomer bdCustomer = createBdCustomer(confirmation.getUseOrgSid(), finSelectedReceivablesDetailedVo.getCustomerName(), finSelectedReceivablesDetailedVo.getCustomerPhone()); |
|
|
|
|
|
ResultBean resultBeanMiddle = bdCustomerService.draftBdCustomer(bdCustomer); |
|
|
|
|
|
//往来单位
|
|
|
|
|
|
arReceivebill.setFCONTACTUNIT(bdCustomer.getFNumber()); |
|
|
|
|
|
//结算方式
|
|
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
|
|
freceivebillentry.setFSETTLETYPEIDType("customerPayType"); |
|
|
|
|
|
//收款金额
|
|
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(finSelectedReceivablesDetailedVo.getSumAll()); |
|
|
|
|
|
//登记日期
|
|
|
|
|
|
freceivebillentry.setFPOSTDATE(confirmation.getCollectionDate()); |
|
|
|
|
|
//收款用途
|
|
|
|
|
|
freceivebillentry.setFPURPOSEIDKey("002"); |
|
|
|
|
|
freceivebillentry.setFPURPOSEIDType("cw_skyt"); |
|
|
|
|
|
freceivebillentry.setFACCOUNTID(confirmation.getCollectionBankNum()); |
|
|
|
|
|
fEntityList.add(freceivebillentry); |
|
|
|
|
|
arReceivebill.setFRECEIVEBILLENTRY(fEntityList); |
|
|
|
|
|
//项目类别key、value
|
|
|
|
|
|
arReceivebill.setF_PAEZ_AssistantType("cw_sklb"); |
|
|
|
|
|
arReceivebill.setF_PAEZ_AssistantKey("006"); |
|
|
|
|
|
ResultBean resultBean2 = arReceivebillService.draftArReceivebill(arReceivebill); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
//简易订单-订金收取
|
|
|
//简易订单-订金收取
|
|
|
if (finSelectedReceivablesDetailedVos1.isEmpty() && finSelectedReceivablesDetailedVos2.isEmpty()) { |
|
|
if (finSelectedReceivablesDetailedVos1.isEmpty() && finSelectedReceivablesDetailedVos2.isEmpty()) { |
|
|
//先推送客户
|
|
|
//先推送客户
|
|
@ -1769,56 +1702,6 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
baseMapper.updateById(confirmation); |
|
|
baseMapper.updateById(confirmation); |
|
|
//删除临时表的数据
|
|
|
//删除临时表的数据
|
|
|
ResultBean deleteResult = baseVehicleTempstateFeign.delByBusSid(sid); |
|
|
ResultBean deleteResult = baseVehicleTempstateFeign.delByBusSid(sid); |
|
|
//已作废以下代码
|
|
|
|
|
|
/* baseMapper.cashierConfirm(sid); |
|
|
|
|
|
int auditState = 1; |
|
|
|
|
|
//总共认款金额
|
|
|
|
|
|
BigDecimal totalSubscriptionMoney = new BigDecimal(0); |
|
|
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos = finSelectedReceivablesDetailedService.fetchByAuditState(sid, auditState); |
|
|
|
|
|
for (FinSelectedReceivablesDetailedVo finSelectedReceivablesDetailedVo : finSelectedReceivablesDetailedVos) { |
|
|
|
|
|
String sid1 = finSelectedReceivablesDetailedVo.getSid(); |
|
|
|
|
|
// finSelectedReceivablesDetailedService.cashierConfirm(sid1);
|
|
|
|
|
|
//更新审核时间
|
|
|
|
|
|
finSelectedReceivablesDetailedService.updateAuditDateBySid(sid1, "3"); |
|
|
|
|
|
//认款金额
|
|
|
|
|
|
BigDecimal subscriptionMoney = new BigDecimal(finSelectedReceivablesDetailedVo.getSubscriptionMoney()); |
|
|
|
|
|
totalSubscriptionMoney = totalSubscriptionMoney.add(subscriptionMoney); |
|
|
|
|
|
String vin = finSelectedReceivablesDetailedVo.getVIN(); |
|
|
|
|
|
String receivablesName = finSelectedReceivablesDetailedVo.getReceivablesName(); |
|
|
|
|
|
String useOrgSid = finSelectedReceivablesDetailedVo.getUseOrgSid(); |
|
|
|
|
|
FinUncollectedReceivablesDetailedVo finUncollectedReceivablesDetailedVo = finUncollectedReceivablesDetailedService.fetchByVinAndRecName(vin, receivablesName); |
|
|
|
|
|
String sid2 = finUncollectedReceivablesDetailedVo.getSid(); |
|
|
|
|
|
//应收未收款项-当前应收金额
|
|
|
|
|
|
BigDecimal currentReceivableMoney = new BigDecimal(finSelectedReceivablesDetailedVo.getCurrentReceivableMoney()); |
|
|
|
|
|
//已选应收款项-认款金额
|
|
|
|
|
|
BigDecimal subtract = currentReceivableMoney.subtract(subscriptionMoney); |
|
|
|
|
|
finUncollectedReceivablesDetailedVo.setCurrentReceivableMoney(String.format("%.0f", subtract)); |
|
|
|
|
|
FinUncollectedReceivablesDetailedDto finUncollectedReceivablesDetailedDto = new FinUncollectedReceivablesDetailedDto(); |
|
|
|
|
|
BeanUtil.copyProperties(finUncollectedReceivablesDetailedVo, finUncollectedReceivablesDetailedDto); |
|
|
|
|
|
finUncollectedReceivablesDetailedService.updateBySid(finUncollectedReceivablesDetailedDto, finUncollectedReceivablesDetailedDto.getSid()); |
|
|
|
|
|
if (subtract.compareTo(BigDecimal.ZERO) == 0) { |
|
|
|
|
|
int subscriptionState = 3; |
|
|
|
|
|
finUncollectedReceivablesDetailedService.updateSubscriptionStateBySid(sid2, subscriptionState); |
|
|
|
|
|
} else { |
|
|
|
|
|
int subscriptionState = 2; |
|
|
|
|
|
finUncollectedReceivablesDetailedService.updateSubscriptionStateBySid(sid2, subscriptionState); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
FinCollectionConfirmation finCollectionConfirmation = fetchBySid(sid); |
|
|
|
|
|
BigDecimal collectionMoney = finCollectionConfirmation.getCollectionMoney(); |
|
|
|
|
|
BigDecimal subtract = collectionMoney.subtract(totalSubscriptionMoney); |
|
|
|
|
|
if (subtract.compareTo(BigDecimal.ZERO) == 0) { |
|
|
|
|
|
int paymentState = 3; |
|
|
|
|
|
baseMapper.updatePaymentStateBySid(sid, paymentState); |
|
|
|
|
|
} else { |
|
|
|
|
|
int paymentState = 2; |
|
|
|
|
|
baseMapper.updatePaymentStateBySid(sid, paymentState); |
|
|
|
|
|
} |
|
|
|
|
|
//更新余额
|
|
|
|
|
|
BigDecimal balanceBigDecimal = confirmation.getBalance().subtract(totalSubscriptionMoney); |
|
|
|
|
|
baseMapper.updateBalanceBySid(sid, balanceBigDecimal); |
|
|
|
|
|
//删除临时表的数据
|
|
|
|
|
|
ResultBean deleteResult = baseVehicleTempstateFeign.delByBusSid(sid);*/ |
|
|
|
|
|
return rb.success().setMsg("款项确认成功"); |
|
|
return rb.success().setMsg("款项确认成功"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|