|
|
@ -179,10 +179,10 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
|
|
|
|
public PagerVo<FinCollectionConfirmationVo> listPageVo(PagerQuery<FinCollectionConfirmationQuery> pq) { |
|
|
|
FinCollectionConfirmationQuery query = pq.getParams(); |
|
|
|
if(StringUtils.isNotBlank(query.getOrgPath())){ |
|
|
|
if (StringUtils.isNotBlank(query.getOrgPath())) { |
|
|
|
String userOrgSid = sysStaffOrgFeign.getOrgSidByPath(query.getOrgPath()).getData(); |
|
|
|
query.setUseOrgSid(userOrgSid); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
//根据用户sid查询分公司sid
|
|
|
|
String createBySid = query.getCreateBySid(); |
|
|
|
String userOrgSid = sysStaffOrgFeign.getPathSidByUserSid(createBySid).getData(); |
|
|
@ -284,10 +284,10 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
sid = finCollectionConfirmation.getSid(); |
|
|
|
//根据用户sid查询分公司sid
|
|
|
|
String useOrgSid = ""; |
|
|
|
if(StringUtils.isNotBlank(dto.getOrgPath())){ |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgPath())) { |
|
|
|
useOrgSid = sysStaffOrgFeign.getOrgSidByPath(dto.getOrgPath()).getData(); |
|
|
|
|
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(dto.getUserSid()).getData(); |
|
|
|
} |
|
|
|
finCollectionConfirmation.setCreateBySid(dto.getUserSid()); |
|
|
@ -1224,7 +1224,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
//更新驳回原因
|
|
|
|
confirmation.setReason(reason); |
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(userSid); |
|
|
|
if(userVoResultBean.getData() != null){ |
|
|
|
if (userVoResultBean.getData() != null) { |
|
|
|
confirmation.setConfirmName(userVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
confirmation.setConfirmDate(DateUtil.today()); |
|
|
@ -1259,7 +1259,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
return rb.success().setMsg("驳回成功"); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean cashierConfirm(String sid,String userSid) { |
|
|
|
public ResultBean cashierConfirm(String sid, String userSid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinCollectionConfirmation confirmation = fetchBySid(sid); |
|
|
|
if (confirmation == null) { |
|
|
@ -1294,9 +1294,9 @@ 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, "车款","1"); |
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1, "车款", "1"); |
|
|
|
//推送全款订金
|
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos2 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1, "订金","1"); |
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos2 = finSelectedReceivablesDetailedService.fetchByAuditState1(sid, 1, "订金", "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()); |
|
|
@ -1486,10 +1486,10 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
arReceivebill.setF_PAEZ_AssistantType("cw_sklb"); |
|
|
|
arReceivebill.setF_PAEZ_AssistantKey("006"); |
|
|
|
arReceivebill.setFRECEIVEBILLENTRY(fEntityList); |
|
|
|
if(finSelectedReceivablesDetailedVos1.size() == 0 && customerList.size() == 1){ |
|
|
|
if (finSelectedReceivablesDetailedVos1.size() == 0 && customerList.size() == 1) { |
|
|
|
arReceivebill.setFBillNo(confirmation.getBillNo()); |
|
|
|
|
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
//单据编号
|
|
|
|
carSize = carSize + 1; |
|
|
|
arReceivebill.setFBillNo(confirmation.getBillNo() + "-" + carSize); |
|
|
@ -1542,21 +1542,92 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
} |
|
|
|
|
|
|
|
//贷款推送车款
|
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1_1 = finSelectedReceivablesDetailedService.fetchByAuditState1_1(sid, 1, "车款","2"); |
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1_1 = finSelectedReceivablesDetailedService.fetchByAuditState1_1(sid, 1, "车款", "2"); |
|
|
|
finSelectedReceivablesDetailedVos1_1.removeAll(Collections.singleton(null)); |
|
|
|
if(finSelectedReceivablesDetailedVos1_1.size()>0){ |
|
|
|
for(int i = 0;i<finSelectedReceivablesDetailedVos1_1.size();i++){ |
|
|
|
|
|
|
|
if (finSelectedReceivablesDetailedVos1_1.size() > 0) { |
|
|
|
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)); |
|
|
|
if(finSelectedReceivablesDetailedVos2_1.size()>0){ |
|
|
|
if (finSelectedReceivablesDetailedVos2_1.size() > 0) { |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -1673,7 +1744,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
confirmation.setAuditState(3); |
|
|
|
//查询当前登录人信息并更新审核人和审核时间
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(userSid); |
|
|
|
if(userVoResultBean.getData() != null){ |
|
|
|
if (userVoResultBean.getData() != null) { |
|
|
|
confirmation.setConfirmName(userVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
confirmation.setConfirmDate(DateUtil.today()); |
|
|
@ -1711,6 +1782,22 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl |
|
|
|
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) { |
|
|
|
String customerNoPrefix = ""; |
|
|
|
FinCollectionConfirmation finCollectionConfirmation = fetchBySid(collSid); |
|
|
|