|
|
@ -3155,7 +3155,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public PrintPreviewVO printBatch(String ids,Integer type) throws Exception { |
|
|
|
public List<PrintPreviewVO> printBatch(String ids, Integer type) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintPreviewVO printPreviewVO = new PrintPreviewVO(); |
|
|
|
PrintPreviewVO printPreviewVO = new PrintPreviewVO(); |
|
|
@ -3163,21 +3163,24 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
BasicPrintTemplateEntity template = getPrintTemplate(type); |
|
|
|
BasicPrintTemplateEntity template = getPrintTemplate(type); |
|
|
|
|
|
|
|
|
|
|
|
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl()); |
|
|
|
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl()); |
|
|
|
printPreviewVO.setTemplateHtml(html); |
|
|
|
// printPreviewVO.setTemplateHtml(html);
|
|
|
|
printPreviewVO.setTemplateId(template.getId()); |
|
|
|
// printPreviewVO.setTemplateId(template.getId());
|
|
|
|
String[] idArray = ids.split(","); |
|
|
|
String[] idArray = ids.split(","); |
|
|
|
if (ObjectUtils.isNull(idArray)) { |
|
|
|
if (ObjectUtils.isNull(idArray)) { |
|
|
|
throw new ServiceException("参数错误"); |
|
|
|
throw new ServiceException("参数错误"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (1 == type) { |
|
|
|
if (1 == type) { |
|
|
|
handleShiPeiData(printPreviewVO,idArray); |
|
|
|
|
|
|
|
|
|
|
|
return handleShiPeiData(template, idArray,html); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (2 == type) { |
|
|
|
} else if (2 == type) { |
|
|
|
handleShangPeiData(printPreviewVO, idArray); |
|
|
|
handleShangPeiData(printPreviewVO, idArray); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
log.warn("###########printBatch: 未知的打印类型"); |
|
|
|
log.warn("###########printBatch: 未知的打印类型"); |
|
|
|
throw new CustomerException(403, "未知的打印类型"); |
|
|
|
throw new CustomerException(403, "未知的打印类型"); |
|
|
|
} |
|
|
|
} |
|
|
|
return printPreviewVO; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void handleShangPeiData(PrintPreviewVO printPreviewVO, String[] idArray) { |
|
|
|
private void handleShangPeiData(PrintPreviewVO printPreviewVO, String[] idArray) { |
|
|
@ -3185,7 +3188,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void handleShiPeiData(PrintPreviewVO printPreviewVO,String[] idArray){ |
|
|
|
/** |
|
|
|
|
|
|
|
* 得到填充内容 |
|
|
|
|
|
|
|
* @param template |
|
|
|
|
|
|
|
* @param idArray |
|
|
|
|
|
|
|
* @param html |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
* @throws Exception |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private List<PrintPreviewVO> handleShiPeiData(BasicPrintTemplateEntity template, String[] idArray,String html) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<PrintPreviewVO> result = new ArrayList<>(); |
|
|
|
List<Map> data = new ArrayList<>(); |
|
|
|
List<Map> data = new ArrayList<>(); |
|
|
|
for (String id : idArray) { |
|
|
|
for (String id : idArray) { |
|
|
|
|
|
|
|
|
|
|
@ -3208,7 +3221,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) { |
|
|
|
for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) { |
|
|
|
|
|
|
|
|
|
|
|
map.put("配送单号", distributionReservationEntity.getReservationCode()); |
|
|
|
map.put("配送单号", distributionReservationEntity.getReservationCode()); |
|
|
|
// todo 商场电话是否需要查询商场信息得到电话
|
|
|
|
// todo 查询运单的收货人电话
|
|
|
|
map.put("商场电话", distributionReservationEntity.getReservationCode()); |
|
|
|
map.put("商场电话", distributionReservationEntity.getReservationCode()); |
|
|
|
|
|
|
|
|
|
|
|
map.put("送货日期", DateUtil.format(distributionReservationEntity.getReservationDate(), "yyyy-MM-dd") + " 全天"); |
|
|
|
map.put("送货日期", DateUtil.format(distributionReservationEntity.getReservationDate(), "yyyy-MM-dd") + " 全天"); |
|
|
@ -3222,24 +3235,24 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
// 通过预约单查询预约下面的订单 --1 或者 库存品 --2
|
|
|
|
// 通过预约单查询预约下面的订单 --1 或者 库存品 --2
|
|
|
|
List<Map<String, Object>> spaclOrderList = buildSpaclOrders(distributionReservationEntity, 1); |
|
|
|
List<Map<String, Object>> spaclOrderList = buildSpaclOrders(distributionReservationEntity, 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
map.put("定制品集合", spaclOrderList); |
|
|
|
map.put("定制品集合", spaclOrderList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
map.put("备注", distributionReservationEntity.getRemarks()); |
|
|
|
map.put("备注", distributionReservationEntity.getRemarks()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
map.put("送货司机", byId.getVehicleName() + "/" + byId.getDriverName()); |
|
|
|
|
|
|
|
|
|
|
|
map.put("送货司机", byId.getTrainNumber() + "/" + byId.getDriverName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.add(map); |
|
|
|
data.add(map); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String popHtml =TemplateUtil.popTemplate("市配配送单",map,html); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintPreviewVO printPreviewVO = new PrintPreviewVO(); |
|
|
|
|
|
|
|
printPreviewVO.setTemplateId(template.getId()); |
|
|
|
|
|
|
|
printPreviewVO.setTemplateHtml(popHtml); |
|
|
|
|
|
|
|
result.add(printPreviewVO); |
|
|
|
} |
|
|
|
} |
|
|
|
printPreviewVO.setDataList(data); |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3257,7 +3270,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 构建预约单下面的订单信息 |
|
|
|
* 构建预约单下面的订单信息 |
|
|
|
* |
|
|
|
* |
|
|
|