|
@ -1546,17 +1546,88 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
finSelectedReceivablesDetailedVos1_1.removeAll(Collections.singleton(null)); |
|
|
finSelectedReceivablesDetailedVos1_1.removeAll(Collections.singleton(null)); |
|
|
if (finSelectedReceivablesDetailedVos1_1.size() > 0) { |
|
|
if (finSelectedReceivablesDetailedVos1_1.size() > 0) { |
|
|
for (int i = 0; i < finSelectedReceivablesDetailedVos1_1.size(); i++) { |
|
|
for (int i = 0; i < finSelectedReceivablesDetailedVos1_1.size(); i++) { |
|
|
|
|
|
FinSelectedReceivablesDetailedVo vvvv = finSelectedReceivablesDetailedVos1_1.get(i); |
|
|
|
|
|
BdCustomer bdCustomer = createBdCustomer1(confirmation.getUseOrgSid(), vvvv.getCustomerName(), vvvv.getVIN(), sid); |
|
|
|
|
|
ResultBean resultBeanMiddle = bdCustomerService.draftBdCustomer(bdCustomer); |
|
|
|
|
|
//往来单位
|
|
|
|
|
|
arReceivebill.setFCONTACTUNIT(bdCustomer.getFNumber()); |
|
|
|
|
|
fEntityList = new ArrayList<>(); |
|
|
|
|
|
String uncollSid = ""; |
|
|
|
|
|
freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
|
|
//结算方式
|
|
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
|
|
freceivebillentry.setFSETTLETYPEIDType("customerPayType"); |
|
|
|
|
|
//收款金额
|
|
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(vvvv.getSubscriptionMoney()); |
|
|
|
|
|
//登记日期
|
|
|
|
|
|
freceivebillentry.setFPOSTDATE(confirmation.getCollectionDate()); |
|
|
|
|
|
freceivebillentry.setF_PAEZ_Base1(vvvv.getVIN().substring(vvvv.getVIN().length() - 8)); |
|
|
|
|
|
//收款用途
|
|
|
|
|
|
freceivebillentry.setFPURPOSEIDKey("001"); |
|
|
|
|
|
freceivebillentry.setFPURPOSEIDType("cw_skyt"); |
|
|
|
|
|
freceivebillentry.setFACCOUNTID(confirmation.getCollectionBankNum()); |
|
|
|
|
|
fEntityList.add(freceivebillentry); |
|
|
|
|
|
uncollSid = vvvv.getReceivablesSid(); |
|
|
|
|
|
|
|
|
|
|
|
//项目类别key、value
|
|
|
|
|
|
arReceivebill.setF_PAEZ_AssistantType("cw_sklb"); |
|
|
|
|
|
FinUncollectedReceivablesDetailed finUncollectedReceivablesDetailed = finUncollectedReceivablesDetailedService.fetchBySid(uncollSid); |
|
|
|
|
|
if ("1".equals(finUncollectedReceivablesDetailed.getPayTypeKey())) { |
|
|
|
|
|
arReceivebill.setF_PAEZ_AssistantKey("001"); |
|
|
|
|
|
} else if ("2".equals(finUncollectedReceivablesDetailed.getPayTypeKey())) { |
|
|
|
|
|
arReceivebill.setF_PAEZ_AssistantKey("002"); |
|
|
} |
|
|
} |
|
|
|
|
|
arReceivebill.setFRECEIVEBILLENTRY(fEntityList); |
|
|
|
|
|
if (finSelectedReceivablesDetailedVos1_1.size() == 1 && finSelectedReceivablesDetailedVos1.size() == 0 && finSelectedReceivablesDetailedVos2.size() == 0) { |
|
|
|
|
|
arReceivebill.setFBillNo(confirmation.getBillNo()); |
|
|
|
|
|
} else { |
|
|
|
|
|
//单据编号
|
|
|
|
|
|
carSize = carSize + 1; |
|
|
|
|
|
arReceivebill.setFBillNo(confirmation.getBillNo() + "-" + carSize); |
|
|
|
|
|
} |
|
|
|
|
|
ResultBean resultBean1 = arReceivebillService.draftArReceivebill(arReceivebill); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
//贷款推送订金
|
|
|
//贷款推送订金
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos2_1 = finSelectedReceivablesDetailedService.fetchByAuditState1_1(sid, 1, "订金", "2"); |
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos2_1 = finSelectedReceivablesDetailedService.fetchByAuditState1_1(sid, 1, "订金", "2"); |
|
|
finSelectedReceivablesDetailedVos2_1.removeAll(Collections.singleton(null)); |
|
|
finSelectedReceivablesDetailedVos2_1.removeAll(Collections.singleton(null)); |
|
|
if (finSelectedReceivablesDetailedVos2_1.size() > 0) { |
|
|
if (finSelectedReceivablesDetailedVos2_1.size() > 0) { |
|
|
for (int i = 0; i < finSelectedReceivablesDetailedVos2_1.size(); i++) { |
|
|
for (int i = 0; i < finSelectedReceivablesDetailedVos2_1.size(); i++) { |
|
|
|
|
|
FinSelectedReceivablesDetailedVo vvvv = finSelectedReceivablesDetailedVos2_1.get(i); |
|
|
|
|
|
//先推送客户
|
|
|
|
|
|
BdCustomer bdCustomer = createBdCustomer1(confirmation.getUseOrgSid(), vvvv.getCustomerName(), vvvv.getVIN(), sid); |
|
|
|
|
|
ResultBean resultBeanMiddle = bdCustomerService.draftBdCustomer(bdCustomer); |
|
|
|
|
|
//往来单位
|
|
|
|
|
|
arReceivebill.setFCONTACTUNIT(bdCustomer.getFNumber()); |
|
|
|
|
|
fEntityList = new ArrayList<>(); |
|
|
|
|
|
freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
|
|
//结算方式
|
|
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
|
|
freceivebillentry.setFSETTLETYPEIDType("customerPayType"); |
|
|
|
|
|
//收款金额
|
|
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(vvvv.getSubscriptionMoney()); |
|
|
|
|
|
//登记日期
|
|
|
|
|
|
freceivebillentry.setFPOSTDATE(confirmation.getCollectionDate()); |
|
|
|
|
|
freceivebillentry.setF_PAEZ_Base1(vvvv.getVIN().substring(vvvv.getVIN().length() - 8)); |
|
|
|
|
|
//收款用途
|
|
|
|
|
|
freceivebillentry.setFPURPOSEIDKey("002"); |
|
|
|
|
|
freceivebillentry.setFPURPOSEIDType("cw_skyt"); |
|
|
|
|
|
freceivebillentry.setFACCOUNTID(confirmation.getCollectionBankNum()); |
|
|
|
|
|
fEntityList.add(freceivebillentry); |
|
|
|
|
|
//项目类别key、value
|
|
|
|
|
|
arReceivebill.setF_PAEZ_AssistantType("cw_sklb"); |
|
|
|
|
|
arReceivebill.setF_PAEZ_AssistantKey("006"); |
|
|
|
|
|
arReceivebill.setFRECEIVEBILLENTRY(fEntityList); |
|
|
|
|
|
if (finSelectedReceivablesDetailedVos1.size() == 0 && finSelectedReceivablesDetailedVos2_1.size() == 1 && |
|
|
|
|
|
finSelectedReceivablesDetailedVos2.size() == 0 && finSelectedReceivablesDetailedVos2_1.size() == 0) { |
|
|
|
|
|
arReceivebill.setFBillNo(confirmation.getBillNo()); |
|
|
|
|
|
} else { |
|
|
|
|
|
//单据编号
|
|
|
|
|
|
carSize = carSize + 1; |
|
|
|
|
|
arReceivebill.setFBillNo(confirmation.getBillNo() + "-" + carSize); |
|
|
|
|
|
} |
|
|
|
|
|
ResultBean resultBean1 = arReceivebillService.draftArReceivebill(arReceivebill); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1711,6 +1782,22 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
return bdCustomer; |
|
|
return bdCustomer; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private BdCustomer createBdCustomer1(String useOrgSid, String name, String vin, String collSid) { |
|
|
|
|
|
BdCustomer bdCustomer = new BdCustomer(); |
|
|
|
|
|
ResultBean<SysOrganizationVo> resultBean = sysOrganizationFeign.fetchBySid(useOrgSid); |
|
|
|
|
|
if (resultBean.getSuccess()) { |
|
|
|
|
|
SysOrganizationVo vo = resultBean.getData(); |
|
|
|
|
|
if (vo != null) { |
|
|
|
|
|
bdCustomer.setTOrgIds(vo.getOrgCode()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
String fname = name + vin; |
|
|
|
|
|
bdCustomer.setFName(fname); |
|
|
|
|
|
String code = name + vin; |
|
|
|
|
|
bdCustomer.setFNumber(code); |
|
|
|
|
|
return bdCustomer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public String getPrefix(String collSid, String name, String mobile) { |
|
|
public String getPrefix(String collSid, String name, String mobile) { |
|
|
String customerNoPrefix = ""; |
|
|
String customerNoPrefix = ""; |
|
|
FinCollectionConfirmation finCollectionConfirmation = fetchBySid(collSid); |
|
|
FinCollectionConfirmation finCollectionConfirmation = fetchBySid(collSid); |
|
|