|
|
@ -385,7 +385,7 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
for (int i = 0; i < sids.size(); i++) { |
|
|
|
FinPaymentrecord finPaymentrecord = fetchBySid(sids.get(i)); |
|
|
|
//到回款返利申请
|
|
|
|
if (finPaymentrecord.getCostTypeValue().equals("厂家车款") && !dto.getPayWayValue().equals("返利抵车款")) { |
|
|
|
if (finPaymentrecord.getIsPushHkfl() == 1) { |
|
|
|
ScmCollectionRebateDto scmCollectionRebateDto = new ScmCollectionRebateDto(); |
|
|
|
List<ScmCollectionRebateVehDto> scmCollectionRebateVehDtos = new ArrayList<>(); |
|
|
|
FinPaymentapply finPaymentapply = finPaymentapplyService.fetchBySid(finPaymentrecord.getApplySid()); |
|
|
@ -775,6 +775,7 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
deptName.append(pname).append("-").append(orgName).append("-").append(deptOrgName).append(" "); |
|
|
|
} |
|
|
|
//获取审批编号
|
|
|
|
FinPaymentapply finPaymentapply = finPaymentapplyService.fetchBySid(finPaymentrecord.getApplySid()); |
|
|
|
BaseOutsourcingApplicationDetailsVo baseOutsourcingApplicationDetailsVo = baseOutsourcingApplicationFeign.fetchBySid(finPaymentrecord.getApplySid()).getData(); |
|
|
|
BusVehicleApplyDetailsVo busVehicleApplyDetailsVo = busVehicleApplyFeign.fetchSid(finPaymentrecord.getApplySid()).getData(); |
|
|
|
BaseVehicleActualPay baseVehicleActualPay = baseVehicleActualPayFeign.fetchBySid(finPaymentrecord.getApplySid()).getData(); |
|
|
@ -782,6 +783,54 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
if (baseVehicleActualPay != null) { |
|
|
|
baseVehicleActualSalesDetailsVo = baseVehicleActualSalesFeign.details(baseVehicleActualPay.getVehicleActualSid()).getData(); |
|
|
|
} |
|
|
|
if (finPaymentapply != null) { |
|
|
|
if (StringUtils.isNotBlank(finPaymentapply.getSid())) { |
|
|
|
dataMap.put("applyCode", finPaymentapply.getBillNo()); |
|
|
|
//获取审批记录
|
|
|
|
List<PCHistTaskListAndCommentList> flowRecordVo = flowableFeign.flowRecordAndComment(finPaymentapply.getProcInstId(), "1").getData(); |
|
|
|
List<FinPaymentrecordSourceLCVo> finPaymentrecordSourceLCVos = new ArrayList<>(); |
|
|
|
for (PCHistTaskListAndCommentList flowTask : flowRecordVo) { |
|
|
|
if (flowTask.getFlowableRecordVo() != null) { |
|
|
|
Map<String, Object> flowableRecordVo = flowTask.getFlowableRecordVo(); |
|
|
|
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo(); |
|
|
|
List<Map<String, Object>> taskUserInfos = ConstantUtils.getListData(flowableRecordVo, "taskUserInfos"); |
|
|
|
Map<String, Object> comment = ConstantUtils.getMap(flowableRecordVo, "comment"); |
|
|
|
String assigneeName = (String) taskUserInfos.get(0).get("assigneeName"); |
|
|
|
String comment1 = (String) comment.get("comment"); |
|
|
|
finPaymentrecordSourceLCVo.setName(assigneeName); |
|
|
|
finPaymentrecordSourceLCVo.setComment(comment1); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(flowableRecordVo.get("finishTime").toString()); |
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
} else { |
|
|
|
Map<String, Object> processCommentVo = flowTask.getProcessCommentVo(); |
|
|
|
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo(); |
|
|
|
finPaymentrecordSourceLCVo.setName(processCommentVo.get("title").toString()); |
|
|
|
finPaymentrecordSourceLCVo.setComment(processCommentVo.get("content").toString()); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(processCommentVo.get("time").toString()); |
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
} |
|
|
|
} |
|
|
|
List<Message> messages = messageFeign.selectByBusinessSid(finPaymentapply.getSid()).getData(); |
|
|
|
if (messages.size() > 0) { |
|
|
|
for (Message message : messages) { |
|
|
|
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo(); |
|
|
|
String receiverNames = ""; |
|
|
|
List<MessageList> messageLists = messageListFeign.fetchByMainSid(message.getSid()).getData(); |
|
|
|
if (messageLists.size() > 0) { |
|
|
|
for (MessageList messageList : messageLists) { |
|
|
|
receiverNames = receiverNames + messageList.getReceiverName() + ","; |
|
|
|
} |
|
|
|
} |
|
|
|
finPaymentrecordSourceLCVo.setName("系统"); |
|
|
|
finPaymentrecordSourceLCVo.setComment("抄送 " + receiverNames.substring(0, receiverNames.lastIndexOf(","))); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(DateUtil.format(message.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); |
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
} |
|
|
|
} |
|
|
|
finPaymentrecordSourceLCVos.sort(comparing(FinPaymentrecordSourceLCVo::getSpsj)); |
|
|
|
dataMap.put("lcList", finPaymentrecordSourceLCVos); |
|
|
|
} |
|
|
|
} |
|
|
|
if (baseOutsourcingApplicationDetailsVo != null) { |
|
|
|
if (StringUtils.isNotBlank(baseOutsourcingApplicationDetailsVo.getApplicationCode())) { |
|
|
|
dataMap.put("applyCode", baseOutsourcingApplicationDetailsVo.getApplicationCode()); |
|
|
@ -933,6 +982,7 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
finPaymentrecordSourceLCVos.sort(comparing(FinPaymentrecordSourceLCVo::getSpsj)); |
|
|
|
dataMap.put("lcList", finPaymentrecordSourceLCVos); |
|
|
|
} |
|
|
|
dataMap.put("payCode", finPaymentrecord.getId()); |
|
|
|
dataMap.put("createTime", DateUtil.format(finPaymentrecord.getCreateTime(), "yyyy-MM-dd")); |
|
|
|
dataMap.put("createByName", createByName); |
|
|
|
dataMap.put("createByDeptName", deptName); |
|
|
@ -961,6 +1011,17 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
vinRemark = vinNo; |
|
|
|
} |
|
|
|
dataMap.put("payRemark", vinRemark); |
|
|
|
} else if (finPaymentapply != null) { |
|
|
|
dataMap.put("remarks", finPaymentapply.getCostTypeValue() + "," + finPaymentrecord.getCostTitleValue() + "," + finPaymentapply.getRemarks()); |
|
|
|
FinPaymentapplyDetails finPaymentapplyDetails = finPaymentapplyDetailsService.fetchBySid(finPaymentrecord.getApplySid()); |
|
|
|
if ("1".equals(finPaymentapply.getIsVeh())){ |
|
|
|
List<FinPaymentapplyVehicleVo> vehicleList = finPaymentapplyVehicleService.getVehicleList(finPaymentapply.getSid()); |
|
|
|
String payRemark = ""; |
|
|
|
for (FinPaymentapplyVehicleVo finPaymentapplyVehicleVo : vehicleList) { |
|
|
|
payRemark = payRemark + finPaymentapplyVehicleVo.getVinNo() + "(" + finPaymentapplyVehicleVo.getMoney() + "元)," + finPaymentapplyDetails.getActualPay() + "," + finPaymentapplyDetails.getRemarks() + ":"; |
|
|
|
} |
|
|
|
dataMap.put("payRemark", payRemark); |
|
|
|
} |
|
|
|
} else { |
|
|
|
dataMap.put("remarks", finPaymentrecord.getRemarks()); |
|
|
|
dataMap.put("payRemark", finPaymentrecord.getPayRemark()); |
|
|
@ -974,6 +1035,10 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
//获取图片路径
|
|
|
|
List<String> photoList = new ArrayList<>(); |
|
|
|
dataMap.put("photoPath64", photoList); |
|
|
|
//下载人
|
|
|
|
dataMap.put("downName", userName); |
|
|
|
//下载时间
|
|
|
|
dataMap.put("downTime", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")); |
|
|
|
//获取模板
|
|
|
|
//模板路径
|
|
|
|
String sourcePath = "D:\\anrui\\upload\\template\\"; |
|
|
@ -1169,6 +1234,44 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
baseManufUpdateDto.setState("2"); |
|
|
|
ResultBean resultBean = baseManufactorSubscriptionFeign.updatePaymentState(baseManufUpdateDto); |
|
|
|
} |
|
|
|
ScmCollectionRebateDto scmCollectionRebateDto = new ScmCollectionRebateDto(); |
|
|
|
List<ScmCollectionRebateVehDto> scmCollectionRebateVehDtos = new ArrayList<>(); |
|
|
|
FinPaymentapplyDetails finPaymentapplyDetails = finPaymentapplyDetailsService.fetchBySid(finPaymentrecord.getBusSid()); |
|
|
|
List<FinPaymentapplyVehicleVo> vehicleList = finPaymentapplyVehicleService.getVehicleList(finPaymentapply.getSid()); |
|
|
|
scmCollectionRebateDto.setBrandSid(finPaymentapply.getCarBrandSid()); |
|
|
|
scmCollectionRebateDto.setBrandName(finPaymentapply.getCarBrandName()); |
|
|
|
scmCollectionRebateDto.setCollectionTypeKey(finPaymentrecord.getPayWayKey()); |
|
|
|
scmCollectionRebateDto.setCollectionTypeValue(finPaymentrecord.getPayWayValue()); |
|
|
|
scmCollectionRebateDto.setManufaSaleChannel(""); |
|
|
|
scmCollectionRebateDto.setManufaSaleChannelValue(finPaymentapplyDetails.getActualPay()); |
|
|
|
scmCollectionRebateDto.setCollectionMoney(finPaymentrecord.getCost()); |
|
|
|
scmCollectionRebateDto.setCollectionDate(DateUtil.formatDate(finPaymentrecord.getPayDate())); |
|
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(finPaymentrecord.getCreateOrgSid()).getData(); |
|
|
|
scmCollectionRebateDto.setCreateOrgSid(finPaymentrecord.getCreateOrgSid()); |
|
|
|
scmCollectionRebateDto.setCreateOrgName(sysOrganizationVo.getName()); |
|
|
|
scmCollectionRebateDto.setUseOrgSid(finPaymentrecord.getUseOrgSid()); |
|
|
|
scmCollectionRebateDto.setUseOrgName(sysOrganizationVo.getName()); |
|
|
|
scmCollectionRebateDto.setOrgPath(finPaymentapply.getOrgSidPath()); |
|
|
|
scmCollectionRebateDto.setCreateBySid(finPaymentrecord.getCreateBySid()); |
|
|
|
if (vehicleList != null && vehicleList.size() > 0) { |
|
|
|
for (FinPaymentapplyVehicleVo finPaymentapplyVehicleVo : vehicleList) { |
|
|
|
ScmCollectionRebateVehDto scmCollectionRebateVehDto = new ScmCollectionRebateVehDto(); |
|
|
|
BaseVehicleSelectVo baseVehicleSelectVo = baseVehicleFeign.details(finPaymentapplyVehicleVo.getVehiSid()).getData(); |
|
|
|
scmCollectionRebateVehDto.setCarModelSid(finPaymentapplyVehicleVo.getModelSid()); |
|
|
|
scmCollectionRebateVehDto.setCarModelName(finPaymentapplyVehicleVo.getModelName()); |
|
|
|
scmCollectionRebateVehDto.setPriceDate(DateUtil.format(baseVehicleSelectVo.getPriceDate(), "yyyy-MM-dd")); |
|
|
|
if (baseVehicleSelectVo.getSalesDate() != null) { |
|
|
|
scmCollectionRebateVehDto.setSalesDate(DateUtil.format(baseVehicleSelectVo.getSalesDate(), "yyyy-MM-dd")); |
|
|
|
} |
|
|
|
scmCollectionRebateVehDto.setVehSid(finPaymentapplyVehicleVo.getVehiSid()); |
|
|
|
scmCollectionRebateVehDto.setVinNo(finPaymentapplyVehicleVo.getVinNo()); |
|
|
|
scmCollectionRebateVehDto.setCostPrice(finPaymentapplyVehicleVo.getMoney()); |
|
|
|
scmCollectionRebateVehDtos.add(scmCollectionRebateVehDto); |
|
|
|
} |
|
|
|
} |
|
|
|
scmCollectionRebateDto.setScmCollectionRebateVehs(scmCollectionRebateVehDtos); |
|
|
|
scmCollectionRebateDto.setIsEnable(1); |
|
|
|
scmCollectionRebateFeign.save(scmCollectionRebateDto); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|