|
|
@ -53,10 +53,7 @@ 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; |
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.app.FinSelectDto; |
|
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.AppFinSelectedReceivablesDetailedDto; |
|
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectedReceivablesDetailed; |
|
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectedReceivablesDetailedDto; |
|
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectedReceivablesDetailedVo; |
|
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.*; |
|
|
|
import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed.AppFinUncollectedReceivablesDetailedVo; |
|
|
|
import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed.FinUncollectedReceivablesDetailed; |
|
|
|
import com.yxt.anrui.fin.api.kingdee.arreceivebill.ARReceivebill; |
|
|
@ -1290,8 +1287,69 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
List<ARReceivebill.FRECEIVEBILLENTRY> fEntityList = new ArrayList<>(); |
|
|
|
ARReceivebill.FRECEIVEBILLENTRY freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
//推送车款
|
|
|
|
|
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1, "车款"); |
|
|
|
List<FinSelectedReceivablesDetailedVo> voListv = finSelectedReceivablesDetailedService.selectDetailsList(sid, 1, "车款"); |
|
|
|
//查询是否含有车架号
|
|
|
|
List<String> stringsVin = voListv.stream().filter(v->StringUtils.isNotBlank(v.getVIN())).map(v->v.getVIN()).collect(Collectors.toList()); |
|
|
|
stringsVin.removeAll(Collections.singleton(null)); |
|
|
|
if(finSelectedReceivablesDetailedVos1.size()>0){ |
|
|
|
if (!stringsVin.isEmpty()) { |
|
|
|
//查询根据客户名称和手机号有哪些客户
|
|
|
|
List<SelectCustomerVo> customerList = finSelectedReceivablesDetailedService.selectCustomerList(sid, 1, "车款"); |
|
|
|
for (SelectCustomerVo vo : customerList) { |
|
|
|
BdCustomer bdCustomer = createBdCustomer(confirmation.getUseOrgSid(), vo.getCustomerName(), vo.getCustomerPhone()); |
|
|
|
ResultBean resultBeanMiddle = bdCustomerService.draftBdCustomer(bdCustomer); |
|
|
|
//往来单位
|
|
|
|
arReceivebill.setFCONTACTUNIT(bdCustomer.getFNumber()); |
|
|
|
fEntityList = new ArrayList<>(); |
|
|
|
//查询该客户的车架号不为空的情况
|
|
|
|
List<FinSelectedReceivablesDetailedVo> vinListVo = finSelectedReceivablesDetailedService.selectVinListVo(sid, 1, "车款", vo.getCustomerName(), vo.getCustomerPhone()); |
|
|
|
for (FinSelectedReceivablesDetailedVo vvvv : vinListVo) { |
|
|
|
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); |
|
|
|
} |
|
|
|
//查询该客户的车架号为空的情况
|
|
|
|
FinSelectedReceivablesDetailedVo vvVo = finSelectedReceivablesDetailedService.fetchByAuditStateV(sid, 1, "车款", vo.getCustomerName(), vo.getCustomerPhone()); |
|
|
|
freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
//结算方式
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
freceivebillentry.setFSETTLETYPEIDType("customerPayType"); |
|
|
|
//收款金额
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(vvVo.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(vvVo.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); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
fEntityList = new ArrayList<>(); |
|
|
|
freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
finSelectedReceivablesDetailedVos1.removeAll(Collections.singleton(null)); |
|
|
|
if (!finSelectedReceivablesDetailedVos1.isEmpty()) { |
|
|
|
for (FinSelectedReceivablesDetailedVo finSelectedReceivablesDetailedVo : finSelectedReceivablesDetailedVos1) { |
|
|
@ -1303,7 +1361,6 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
//结算方式
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
freceivebillentry.setFSETTLETYPEIDType("customerPayType"); |
|
|
|
// BigDecimal bigAll = finSelectedReceivablesDetailedVos1.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
//收款金额
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(finSelectedReceivablesDetailedVo.getSumAll()); |
|
|
|
//登记日期
|
|
|
@ -1321,16 +1378,108 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
} else if ("2".equals(finUncollectedReceivablesDetailed.getPayTypeKey())) { |
|
|
|
arReceivebill.setF_PAEZ_AssistantKey("002"); |
|
|
|
} |
|
|
|
|
|
|
|
arReceivebill.setFRECEIVEBILLENTRY(fEntityList); |
|
|
|
ResultBean resultBean1 = arReceivebillService.draftArReceivebill(arReceivebill); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* 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); |
|
|
|
|
|
|
|
} |
|
|
|
}*/ |
|
|
|
//推送订金
|
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos2 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1, "订金"); |
|
|
|
if(finSelectedReceivablesDetailedVos2.size()>0){ |
|
|
|
voListv = finSelectedReceivablesDetailedService.selectDetailsList(sid, 1, "订金"); |
|
|
|
//查询是否含有车架号
|
|
|
|
stringsVin = voListv.stream().filter(v->StringUtils.isNotBlank(v.getVIN())).map(v->v.getVIN()).collect(Collectors.toList()); |
|
|
|
stringsVin.removeAll(Collections.singleton(null)); |
|
|
|
if (!stringsVin.isEmpty()) { |
|
|
|
//查询根据客户名称和手机号有哪些客户
|
|
|
|
List<SelectCustomerVo> customerList = finSelectedReceivablesDetailedService.selectCustomerList(sid, 1, "订金"); |
|
|
|
for (SelectCustomerVo vo : customerList) { |
|
|
|
//先推送客户
|
|
|
|
BdCustomer bdCustomer = createBdCustomer(confirmation.getUseOrgSid(), vo.getCustomerName(), vo.getCustomerPhone()); |
|
|
|
ResultBean resultBeanMiddle = bdCustomerService.draftBdCustomer(bdCustomer); |
|
|
|
//往来单位
|
|
|
|
arReceivebill.setFCONTACTUNIT(bdCustomer.getFNumber()); |
|
|
|
fEntityList = new ArrayList<>(); |
|
|
|
//查询该客户的车架号不为空的情况
|
|
|
|
List<FinSelectedReceivablesDetailedVo> vinListVo = finSelectedReceivablesDetailedService.selectVinListVo(sid, 1, "订金", vo.getCustomerName(), vo.getCustomerPhone()); |
|
|
|
for (FinSelectedReceivablesDetailedVo vvvv : vinListVo) { |
|
|
|
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); |
|
|
|
} |
|
|
|
//查询该客户的车架号为空的情况
|
|
|
|
FinSelectedReceivablesDetailedVo vvVo = finSelectedReceivablesDetailedService.fetchByAuditStateV(sid, 1, "订金", vo.getCustomerName(), vo.getCustomerPhone()); |
|
|
|
freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
//结算方式
|
|
|
|
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey()); |
|
|
|
freceivebillentry.setFSETTLETYPEIDType("customerPayType"); |
|
|
|
//收款金额
|
|
|
|
freceivebillentry.setFRECTOTALAMOUNTFOR(vvVo.getSumAll()); |
|
|
|
//登记日期
|
|
|
|
freceivebillentry.setFPOSTDATE(confirmation.getCollectionDate()); |
|
|
|
//收款用途
|
|
|
|
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); |
|
|
|
ResultBean resultBean1 = arReceivebillService.draftArReceivebill(arReceivebill); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
fEntityList = new ArrayList<>(); |
|
|
|
freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY(); |
|
|
|
finSelectedReceivablesDetailedVos2.removeAll(Collections.singleton(null)); |
|
|
@ -1360,8 +1509,43 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
arReceivebill.setF_PAEZ_AssistantKey("006"); |
|
|
|
ResultBean resultBean2 = arReceivebillService.draftArReceivebill(arReceivebill); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//推送订金
|
|
|
|
/*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()) { |
|
|
|
//先推送客户
|
|
|
@ -1526,6 +1710,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
ResultBean deleteResult = baseVehicleTempstateFeign.delByBusSid(sid);*/ |
|
|
|
return rb.success().setMsg("款项确认成功"); |
|
|
|
} |
|
|
|
|
|
|
|
//组装客户推送
|
|
|
|
private BdCustomer createBdCustomer(String useOrgSid, String name, String mobile) { |
|
|
|
BdCustomer bdCustomer = new BdCustomer(); |
|
|
|