|
|
|
@ -64,6 +64,7 @@ import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant
|
|
|
|
|
import org.springblade.common.constant.reservation.*; |
|
|
|
|
import org.springblade.common.constant.stockup.StockAssignStatusConstant; |
|
|
|
|
import org.springblade.common.constant.stockup.StockupStatusConstant; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
|
import org.springblade.common.serviceConstant.ServiceConstant; |
|
|
|
|
import org.springblade.common.utils.CommonUtil; |
|
|
|
|
import org.springblade.common.utils.TemplateUtil; |
|
|
|
@ -3154,15 +3155,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public PrintPreviewVO printBatch(String ids) throws Exception { |
|
|
|
|
public PrintPreviewVO printBatch(String ids,Integer type) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintPreviewVO printPreviewVO = new PrintPreviewVO(); |
|
|
|
|
List<Map> data = new ArrayList<>(); |
|
|
|
|
BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_1.getValue()); |
|
|
|
|
if (ObjectUtil.isEmpty(template)) { |
|
|
|
|
throw new ServiceException("模板内容未找到"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BasicPrintTemplateEntity template = getPrintTemplate(type); |
|
|
|
|
|
|
|
|
|
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl()); |
|
|
|
|
printPreviewVO.setTemplateHtml(html); |
|
|
|
@ -3171,8 +3169,25 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
String[] idArray = ids.split(","); |
|
|
|
|
if (ObjectUtils.isNull(idArray)) { |
|
|
|
|
throw new ServiceException("参数错误"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if(1 == type){ |
|
|
|
|
handleShiPeiData(printPreviewVO,idArray); |
|
|
|
|
}else if(2 == type){ |
|
|
|
|
handleShangPeiData(printPreviewVO,idArray); |
|
|
|
|
}else{ |
|
|
|
|
log.warn("###########printBatch: 未知的打印类型"); |
|
|
|
|
throw new CustomerException(403,"未知的打印类型"); |
|
|
|
|
} |
|
|
|
|
return printPreviewVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleShangPeiData(PrintPreviewVO printPreviewVO, String[] idArray) { |
|
|
|
|
//TODO 商配配送单数据组装
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleShiPeiData(PrintPreviewVO printPreviewVO,String[] idArray){ |
|
|
|
|
List<Map> data = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
for (String id : idArray) { |
|
|
|
|
|
|
|
|
@ -3220,11 +3235,24 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return printPreviewVO; |
|
|
|
|
private BasicPrintTemplateEntity getPrintTemplate(Integer type){ |
|
|
|
|
BasicPrintTemplateEntity template = null; |
|
|
|
|
if(1 == type){ |
|
|
|
|
template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_1.getValue()); |
|
|
|
|
}else if(2 == type){ |
|
|
|
|
template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_12.getValue()); |
|
|
|
|
} |
|
|
|
|
if (ObjectUtil.isEmpty(template)) { |
|
|
|
|
throw new ServiceException("模板内容未找到"); |
|
|
|
|
} |
|
|
|
|
return template; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建预约单下面的订单信息 |
|
|
|
|
* |
|
|
|
|