|
@ -1092,75 +1092,6 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu |
|
|
String path = targetPath + pdfName; |
|
|
String path = targetPath + pdfName; |
|
|
return path; |
|
|
return path; |
|
|
} |
|
|
} |
|
|
/** |
|
|
|
|
|
* 出门证 |
|
|
|
|
|
* |
|
|
|
|
|
* @param sid |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
// public ResultBean<String> exitPermit(String sid) {
|
|
|
|
|
|
// ResultBean rb = ResultBean.fireFail();
|
|
|
|
|
|
// BusHandover busHandover = fetchBySid(sid);
|
|
|
|
|
|
// BusExitPermitVo permitVo = new BusExitPermitVo();
|
|
|
|
|
|
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
// if (StringUtils.isNotBlank(busHandover.getUseOrgName())) {
|
|
|
|
|
|
// permitVo.setOrgName(busHandover.getUseOrgName());
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (StringUtils.isNotBlank(sdf.format(busHandover.getDeliverDate()))) {
|
|
|
|
|
|
// permitVo.setDate(sdf.format(busHandover.getDeliverDate()));
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (StringUtils.isNotBlank(busHandover.getCreateBySid())) {
|
|
|
|
|
|
// SysUser sysUser = sysUserFeign.selectBySid(busHandover.getCreateBySid()).getData();
|
|
|
|
|
|
// SysStaffinfoDetailsVo staffinfoDetailsVo = sysStaffinfoFeign.fetchBySid(sysUser.getStaffSid()).getData();
|
|
|
|
|
|
// permitVo.setApply(staffinfoDetailsVo.getName());
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (StringUtils.isNotBlank(busHandover.getContractNo())) {
|
|
|
|
|
|
// permitVo.setContract(busHandover.getContractNo());
|
|
|
|
|
|
// List<FinVehicleInvoice> invoices = finVehicleInvoiceFeign.selectByContractNo(busHandover.getContractNo()).getData();
|
|
|
|
|
|
// if (!invoices.isEmpty()) {
|
|
|
|
|
|
// for (FinVehicleInvoice invoice : invoices) {
|
|
|
|
|
|
// permitVo.setFinOperator(invoice.getDrawer());
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (StringUtils.isNotBlank(busHandover.getCustomerName())) {
|
|
|
|
|
|
// permitVo.setName(busHandover.getCustomerName());
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (StringUtils.isNotBlank(busHandover.getCarNum())) {
|
|
|
|
|
|
// permitVo.setNumber(busHandover.getCarNum());
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (StringUtils.isNotBlank(busHandover.getStaffSid())) {
|
|
|
|
|
|
// SysStaffinfoDetailsVo staffinfoDetailsVo = sysStaffinfoFeign.fetchBySid(busHandover.getStaffSid()).getData();
|
|
|
|
|
|
// permitVo.setOperator(staffinfoDetailsVo.getName());
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (StringUtils.isNotBlank(busHandover.getPayTypeValue())) {
|
|
|
|
|
|
// if ("全款".equals(busHandover.getPayTypeValue())) {
|
|
|
|
|
|
// permitVo.setReason("全款交车");
|
|
|
|
|
|
// } else if ("贷款".equals(busHandover.getPayTypeValue())) {
|
|
|
|
|
|
// permitVo.setReason("消贷交车");
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// StringBuffer sbVin = new StringBuffer();
|
|
|
|
|
|
// StringBuffer sbModel = new StringBuffer();
|
|
|
|
|
|
// List<BusHandoverItems> items = busHandoverItemsService.getItemsListByMainSid(sid).getData();
|
|
|
|
|
|
// if (!items.isEmpty()) {
|
|
|
|
|
|
// for (BusHandoverItems item : items) {
|
|
|
|
|
|
// String vinNo = item.getVinNo();
|
|
|
|
|
|
// sbVin.append(vinNo).append(",");
|
|
|
|
|
|
// String modelName = item.getModelName();
|
|
|
|
|
|
// BaseVehicleSelectVo vehicle = baseVehicleFeign.details(item.getVinSid()).getData();
|
|
|
|
|
|
// BaseModelConfigSelectVo configSelectVo = baseModelConfigFeign.details(vehicle.getModelConfigSid()).getData();
|
|
|
|
|
|
// String carColor = configSelectVo.getCarColor();
|
|
|
|
|
|
// sbModel.append(modelName + carColor).append(",");
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// sbVin.delete(sbVin.length() - 1, sbVin.length());
|
|
|
|
|
|
// sbModel.delete(sbModel.length() - 1, sbModel.length());
|
|
|
|
|
|
// permitVo.setVinNo(sbVin.toString());
|
|
|
|
|
|
// permitVo.setModelName(sbModel.toString());
|
|
|
|
|
|
// String s = exitPermitCreatePdf(permitVo);
|
|
|
|
|
|
// return rb.success().setData(s);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 打印《出门证》 |
|
|
* 打印《出门证》 |
|
@ -1243,6 +1174,128 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu |
|
|
return rb.success().setData(p); |
|
|
return rb.success().setData(p); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 交车确认查看编辑回显 |
|
|
|
|
|
* |
|
|
|
|
|
* @param sid |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public ResultBean<BusHandoverDetailVo> fetchDetailsBySid(String sid) { |
|
|
|
|
|
ResultBean<BusHandoverDetailVo> rb = ResultBean.fireFail(); |
|
|
|
|
|
BusHandover busHandover = fetchBySid(sid); |
|
|
|
|
|
BusHandoverDetailVo vo = new BusHandoverDetailVo(); |
|
|
|
|
|
BeanUtil.copyProperties(busHandover, vo); |
|
|
|
|
|
List<BusHandoverItemListDetailsVo> items = new ArrayList<>(); |
|
|
|
|
|
//查询车辆
|
|
|
|
|
|
List<BusHandoverItems> itemsList = busHandoverItemsService.getItemsListByMainSid(sid).getData(); |
|
|
|
|
|
itemsList.removeAll(Collections.singleton(null)); |
|
|
|
|
|
for (BusHandoverItems v : itemsList) { |
|
|
|
|
|
BusHandoverItemListDetailsVo detailsVo = new BusHandoverItemListDetailsVo(); |
|
|
|
|
|
String handoverPhoto = v.getHandoverPhoto(); |
|
|
|
|
|
String policyPhoto = v.getPolicyPhoto(); |
|
|
|
|
|
BeanUtil.copyProperties(v, detailsVo); |
|
|
|
|
|
if (StringUtils.isNotBlank(handoverPhoto)) { |
|
|
|
|
|
List<String> stringList = Arrays.asList(handoverPhoto.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|
|
|
|
|
detailsVo.setHandoverPhoto(stringList); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(policyPhoto)) { |
|
|
|
|
|
List<String> policyPhotoList = Arrays.asList(policyPhoto.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|
|
|
|
|
detailsVo.setPolicyPhoto(policyPhotoList); |
|
|
|
|
|
} |
|
|
|
|
|
items.add(detailsVo); |
|
|
|
|
|
} |
|
|
|
|
|
vo.setItems(items); |
|
|
|
|
|
//接收车辆确认书照片
|
|
|
|
|
|
List<BuscenterFile> fileList = buscenterFileService.selectByLinkSid(sid, BuscenterFileEnum.RECEIVE_CAR_IMAGES.getAttachType()); |
|
|
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
|
|
List<String> receiveCarImages = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()). |
|
|
|
|
|
collect(Collectors.toList()); |
|
|
|
|
|
vo.setReceiveCarImages(receiveCarImages); |
|
|
|
|
|
} |
|
|
|
|
|
//委托提车授权书、委托人身份证(正反面)
|
|
|
|
|
|
fileList = buscenterFileService.selectByLinkSid(sid, BuscenterFileEnum.ENTRUST_IDCARD_IMAGES.getAttachType()); |
|
|
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
|
|
List<String> entrustImages = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()).collect(Collectors.toList()); |
|
|
|
|
|
vo.setEntrustImages(entrustImages); |
|
|
|
|
|
} |
|
|
|
|
|
//交车资料确认单
|
|
|
|
|
|
fileList = buscenterFileService.selectByLinkSid(sid, BuscenterFileEnum.ENTRUST_CONFIRM_IMAGES.getAttachType()); |
|
|
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
|
|
List<String> entrustConfirmImages = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()).collect(Collectors.toList()); |
|
|
|
|
|
vo.setEntrustConfirmImages(entrustConfirmImages); |
|
|
|
|
|
} |
|
|
|
|
|
//出门证照片
|
|
|
|
|
|
fileList = buscenterFileService.selectByLinkSid(sid, BuscenterFileEnum.EXIT_TICKET_IMAGES.getAttachType()); |
|
|
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
|
|
List<String> exitTicketImages = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()).collect(Collectors.toList()); |
|
|
|
|
|
vo.setExitTicketImages(exitTicketImages); |
|
|
|
|
|
} |
|
|
|
|
|
return rb.success().setData(vo); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 上传照片修改备注 |
|
|
|
|
|
* |
|
|
|
|
|
* @param dto |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public ResultBean<String> uploadPicture(BusHandoverDetailDto dto) { |
|
|
|
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
|
|
|
String sid = dto.getSid(); |
|
|
|
|
|
BusHandover entity = fetchBySid(sid); |
|
|
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
|
|
baseMapper.updateById(entity); |
|
|
|
|
|
//保存交车照片、保单
|
|
|
|
|
|
if (null != dto.getItems() && dto.getItems().size() > 0) { |
|
|
|
|
|
StringBuffer sbHandoverPhoto = new StringBuffer(); |
|
|
|
|
|
StringBuffer sbPolicyPhoto = new StringBuffer(); |
|
|
|
|
|
for (BusHandoverItemListDetailsDto itemDto : dto.getItems()) { |
|
|
|
|
|
BusHandoverItems items = busHandoverItemsService.fetchBySid(itemDto.getSid()); |
|
|
|
|
|
if (!itemDto.getHandoverPhoto().isEmpty()) { |
|
|
|
|
|
for (String path : itemDto.getHandoverPhoto()) { |
|
|
|
|
|
String filePath = path.substring(urlPrefix.length()); |
|
|
|
|
|
sbHandoverPhoto.append(filePath).append(","); |
|
|
|
|
|
} |
|
|
|
|
|
sbHandoverPhoto.delete(sbHandoverPhoto.length() - 1, sbHandoverPhoto.length()); |
|
|
|
|
|
items.setHandoverPhoto(sbHandoverPhoto.toString()); |
|
|
|
|
|
} |
|
|
|
|
|
if (!itemDto.getPolicyPhoto().isEmpty()) { |
|
|
|
|
|
for (String path : itemDto.getPolicyPhoto()) { |
|
|
|
|
|
String filePath = path.substring(urlPrefix.length()); |
|
|
|
|
|
sbPolicyPhoto.append(filePath).append(","); |
|
|
|
|
|
} |
|
|
|
|
|
sbPolicyPhoto.delete(sbPolicyPhoto.length() - 1, sbPolicyPhoto.length()); |
|
|
|
|
|
items.setPolicyPhoto(sbPolicyPhoto.toString()); |
|
|
|
|
|
} |
|
|
|
|
|
busHandoverItemsService.updateById(items); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//删除附件表中关于该linkSid的文件
|
|
|
|
|
|
buscenterFileService.deleteByLinkSid(sid); |
|
|
|
|
|
List<String> entrustConfirmImages = dto.getEntrustConfirmImages(); |
|
|
|
|
|
if (!entrustConfirmImages.isEmpty()) { |
|
|
|
|
|
buscenterFileService.saveAll(dto.getSid(), entrustConfirmImages, BuscenterFileEnum.ENTRUST_CONFIRM_IMAGES.getAttachType()); |
|
|
|
|
|
} |
|
|
|
|
|
List<String> receiveCarImages = dto.getReceiveCarImages(); |
|
|
|
|
|
if (!receiveCarImages.isEmpty()) { |
|
|
|
|
|
buscenterFileService.saveAll(dto.getSid(), receiveCarImages, BuscenterFileEnum.RECEIVE_CAR_IMAGES.getAttachType()); |
|
|
|
|
|
} |
|
|
|
|
|
List<String> entrustImages = dto.getEntrustImages(); |
|
|
|
|
|
if (!entrustImages.isEmpty()) { |
|
|
|
|
|
buscenterFileService.saveAll(dto.getSid(), entrustImages, BuscenterFileEnum.ENTRUST_IDCARD_IMAGES.getAttachType()); |
|
|
|
|
|
} |
|
|
|
|
|
List<String> exitTicketImages = dto.getExitTicketImages(); |
|
|
|
|
|
if (!exitTicketImages.isEmpty()) { |
|
|
|
|
|
buscenterFileService.saveAll(dto.getSid(), exitTicketImages, BuscenterFileEnum.EXIT_TICKET_IMAGES.getAttachType()); |
|
|
|
|
|
} |
|
|
|
|
|
return rb.success().setData(dto.getSid()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|