|
|
@ -1366,24 +1366,25 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
} |
|
|
|
} |
|
|
|
//销售部门
|
|
|
|
resultBean = sysOrganizationFeign.fetchBySid(confirmation.getCreateDeptSid()); |
|
|
|
if (resultBean.getSuccess()) { |
|
|
|
SysOrganizationVo vo = resultBean.getData(); |
|
|
|
if (vo != null) { |
|
|
|
arReceivebill.setFSALEDEPTID(vo.getOrgCode()); |
|
|
|
if (StringUtils.isNotBlank(confirmation.getCreateDeptSid())) { |
|
|
|
resultBean = sysOrganizationFeign.fetchBySid(confirmation.getCreateDeptSid()); |
|
|
|
if (resultBean.getSuccess()) { |
|
|
|
SysOrganizationVo vo = resultBean.getData(); |
|
|
|
if (vo != null) { |
|
|
|
arReceivebill.setFSALEDEPTID(vo.getOrgCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//应付类别key、value
|
|
|
|
|
|
|
|
//物料列表
|
|
|
|
List<ARReceivebill.FRECEIVEBILLENTRY> fEntityList = new ArrayList<>(); |
|
|
|
ARReceivebill.FRECEIVEBILLENTRY freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1,"车款"); |
|
|
|
//推送车款
|
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1, "车款"); |
|
|
|
finSelectedReceivablesDetailedVos1.removeAll(Collections.singleton(null)); |
|
|
|
if(!finSelectedReceivablesDetailedVos1.isEmpty()){ |
|
|
|
if (!finSelectedReceivablesDetailedVos1.isEmpty()) { |
|
|
|
//结算方式
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
freceivebillentry.setFSETTLETYPEIDType("paymentType"); |
|
|
|
freceivebillentry.setFSETTLETYPEIDType("customerPayType"); |
|
|
|
BigDecimal bigAll = finSelectedReceivablesDetailedVos1.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
//收款金额
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(bigAll.toString()); |
|
|
@ -1393,19 +1394,23 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
freceivebillentry.setFPURPOSEIDKey("001"); |
|
|
|
freceivebillentry.setFPURPOSEIDType("cw_skyt"); |
|
|
|
fEntityList.add(freceivebillentry); |
|
|
|
//项目类别key、value
|
|
|
|
arReceivebill.setF_PAEZ_AssistantType("payType"); |
|
|
|
FinUncollectedReceivablesDetailed finUncollectedReceivablesDetailed = finUncollectedReceivablesDetailedService.fetchBySid(finSelectedReceivablesDetailedVos1.get(0).getReceivablesSid()); |
|
|
|
arReceivebill.setF_PAEZ_AssistantKey(finUncollectedReceivablesDetailed.getPayTypeKey()); |
|
|
|
arReceivebill.setFRECEIVEBILLENTRY(fEntityList); |
|
|
|
ResultBean resultBean1 = arReceivebillService.draftArReceivebill(arReceivebill); |
|
|
|
} |
|
|
|
|
|
|
|
//推送订金
|
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos2 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1,"订金"); |
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos2 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1, "订金"); |
|
|
|
fEntityList = new ArrayList<>(); |
|
|
|
freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
finSelectedReceivablesDetailedVos2.removeAll(Collections.singleton(null)); |
|
|
|
if(!finSelectedReceivablesDetailedVos2.isEmpty()){ |
|
|
|
if (!finSelectedReceivablesDetailedVos2.isEmpty()) { |
|
|
|
//结算方式
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
freceivebillentry.setFSETTLETYPEIDType("paymentType"); |
|
|
|
freceivebillentry.setFSETTLETYPEIDType("customerPayType"); |
|
|
|
BigDecimal bigAll = finSelectedReceivablesDetailedVos2.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
//收款金额
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(bigAll.toString()); |
|
|
@ -1416,28 +1421,32 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
freceivebillentry.setFPURPOSEIDType("cw_skyt"); |
|
|
|
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()) { |
|
|
|
fEntityList = new ArrayList<>(); |
|
|
|
freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
finSelectedReceivablesDetailedVos2.removeAll(Collections.singleton(null)); |
|
|
|
if(!finSelectedReceivablesDetailedVos2.isEmpty()){ |
|
|
|
//结算方式
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
freceivebillentry.setFSETTLETYPEIDType("paymentType"); |
|
|
|
BigDecimal bigAll = confirmation.getCollectionMoney(); |
|
|
|
//收款金额
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(bigAll.toString()); |
|
|
|
//登记日期
|
|
|
|
freceivebillentry.setFPOSTDATE(confirmation.getCollectionDate()); |
|
|
|
//收款用途
|
|
|
|
freceivebillentry.setFPURPOSEIDKey("002"); |
|
|
|
freceivebillentry.setFPURPOSEIDType("cw_skyt"); |
|
|
|
fEntityList.add(freceivebillentry); |
|
|
|
arReceivebill.setFRECEIVEBILLENTRY(fEntityList); |
|
|
|
ResultBean resultBean2 = arReceivebillService.draftArReceivebill(arReceivebill); |
|
|
|
} |
|
|
|
//结算方式
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
freceivebillentry.setFSETTLETYPEIDType("customerPayType"); |
|
|
|
BigDecimal bigAll = confirmation.getCollectionMoney(); |
|
|
|
//收款金额
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(bigAll.toString()); |
|
|
|
//登记日期
|
|
|
|
freceivebillentry.setFPOSTDATE(confirmation.getCollectionDate()); |
|
|
|
//收款用途:订金
|
|
|
|
freceivebillentry.setFPURPOSEIDKey("002"); |
|
|
|
freceivebillentry.setFPURPOSEIDType("cw_skyt"); |
|
|
|
fEntityList.add(freceivebillentry); |
|
|
|
arReceivebill.setFRECEIVEBILLENTRY(fEntityList); |
|
|
|
//项目类别key、value
|
|
|
|
arReceivebill.setF_PAEZ_AssistantType("cw_sklb"); |
|
|
|
arReceivebill.setF_PAEZ_AssistantKey("006"); |
|
|
|
ResultBean resultBean2 = arReceivebillService.draftArReceivebill(arReceivebill); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|