From 8920ab4bbff2f98ce2957e213f5e1a506ce0f87b Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 18 Sep 2023 14:28:04 +0800 Subject: [PATCH 01/12] =?UTF-8?q?1.=E9=85=8D=E9=80=81=E5=8D=95=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PrintTemplateStatusConstant.java | 5 ++- .../DistributionDeliveryListController.java | 4 +- .../IDistributionDeliveryListService.java | 2 +- .../DistributionDeliveryListServiceImpl.java | 44 +++++++++++++++---- 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java index d09956628..2527ae6ad 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java @@ -8,7 +8,7 @@ package org.springblade.common.constant.printTemplate; */ public enum PrintTemplateStatusConstant { - daiqueren_1("配送任务打印模板","1"), + daiqueren_1("配送任务打印模板-市配","1"), daiqueren_2("配载计划打印模板","2"), daiqueren_3("运单票据打印模板","3"), daiqueren_4("托运单模板","4"), @@ -18,7 +18,8 @@ public enum PrintTemplateStatusConstant { daiqueren_8("货位码模板","8"), daiqueren_9("货架码模板","9"), daiqueren_10("包件模板","10"), - daiqueren_11("库存品包件模板","11"); + daiqueren_11("库存品包件模板","11"), + daiqueren_12("配送任务打印模板-商配","12"); /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java index 5729c4878..41d37e9a9 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java @@ -346,10 +346,10 @@ public class DistributionDeliveryListController extends BladeController { @PostMapping("/printBatch") @ApiOperationSupport(order = 2) @ApiOperation(value = "批量打印", notes = "ids") - public R printBatch(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + public R printBatch(@ApiParam(value = "主键集合", required = true) @RequestParam String ids ,@ApiParam(value = "打印类型", required = true) @RequestParam Integer type) { try { - PrintPreviewVO printPreviewVOS = distributionDeliveryListService.printBatch(ids); + PrintPreviewVO printPreviewVOS = distributionDeliveryListService.printBatch(ids,type); return R.data(printPreviewVOS); } catch (Exception e) { throw new RuntimeException(e); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index 0f0910523..1993325b8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -225,5 +225,5 @@ public interface IDistributionDeliveryListService extends BaseService 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 data = new ArrayList<>(); for (String id : idArray) { @@ -3220,11 +3235,24 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Date: Mon, 18 Sep 2023 15:08:58 +0800 Subject: [PATCH 02/12] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DistributionDeliveryListController.java | 2 +- .../service/impl/DistributionDeliveryListServiceImpl.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java index 41d37e9a9..34d453ec5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java @@ -345,7 +345,7 @@ public class DistributionDeliveryListController extends BladeController { @PostMapping("/printBatch") @ApiOperationSupport(order = 2) - @ApiOperation(value = "批量打印", notes = "ids") + @ApiOperation(value = "批量打印") public R printBatch(@ApiParam(value = "主键集合", required = true) @RequestParam String ids ,@ApiParam(value = "打印类型", required = true) @RequestParam Integer type) { try { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index c32ea65f3..e4462b8e7 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -3165,7 +3165,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(byId.getId()); + + if(distributionReservationEntityList.isEmpty()){ + throw new ServiceException("为找到相关数据"); + } + for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) { map.put("配送单号", distributionReservationEntity.getReservationCode()); @@ -3286,6 +3290,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Date: Mon, 18 Sep 2023 15:17:04 +0800 Subject: [PATCH 03/12] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionDeliveryListServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index e4462b8e7..e2933c89f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -3196,13 +3196,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(byId.getId()); - if(distributionReservationEntityList.isEmpty()){ - throw new ServiceException("为找到相关数据"); + throw new ServiceException("未找到相关数据"); } for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) { From de606e7b84c0803173751746c33be66662e437a4 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" <123456> Date: Mon, 18 Sep 2023 15:28:39 +0800 Subject: [PATCH 04/12] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionDeliveryListServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index e2933c89f..6986e03e8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -3187,7 +3187,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl data = new ArrayList<>(); - for (String id : idArray) { // 获取需要的数据 @@ -3240,6 +3239,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Date: Mon, 18 Sep 2023 16:16:52 +0800 Subject: [PATCH 05/12] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/utils/TemplateUtil.java | 40 +++++++-- .../DistributionDeliveryListController.java | 4 +- .../IDistributionDeliveryListService.java | 2 +- .../DistributionDeliveryListServiceImpl.java | 88 +++++++++++-------- 4 files changed, 87 insertions(+), 47 deletions(-) diff --git a/blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java b/blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java index 702cf1183..aee484626 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java +++ b/blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java @@ -28,24 +28,52 @@ public class TemplateUtil { * 通过远程URL地址获取模板 * 此方法可以通过URL加载存储在远程服务器上的模板 * - * @param template - * @param map - * @param url + * @param name 模板名称 + * @param map 填充内容 + * @param url 模板地址 * @return * @throws Exception */ - public static String getTemplateByUrl(String template, Map map, String url) throws Exception { + public static String getTemplateByUrl(String name, Map map, String url) throws Exception { Configuration cfg = new Configuration(Configuration.VERSION_2_3_30); ByteArrayTemplateLoader byteArrayTemplateLoader = new ByteArrayTemplateLoader(); InputStream initialStream = getInputStreamByGet(url); - byteArrayTemplateLoader.putTemplate(template, + byteArrayTemplateLoader.putTemplate(name, IOUtils.toByteArray(initialStream)); cfg.setTemplateLoader(byteArrayTemplateLoader); cfg.setDefaultEncoding("UTF-8"); cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); cfg.setLogTemplateExceptions(false); cfg.setClassicCompatible(true); - Template temp = cfg.getTemplate(template); + Template temp = cfg.getTemplate(name); + StringWriter stringWriter = new StringWriter(); + temp.process(map, stringWriter); + stringWriter.flush(); + stringWriter.close(); + String result = stringWriter.getBuffer().toString(); + return result; + } + + + /** + * 根据模板填充模板内容 + * @param name 模板名称 + * @param map 填充内容 + * @param temlate + * @return + * @throws Exception + */ + public static String popTemplate(String name, Map map, String temlate) throws Exception { + Configuration cfg = new Configuration(Configuration.VERSION_2_3_30); + ByteArrayTemplateLoader byteArrayTemplateLoader = new ByteArrayTemplateLoader(); + byteArrayTemplateLoader.putTemplate(name, + temlate.getBytes()); + cfg.setTemplateLoader(byteArrayTemplateLoader); + cfg.setDefaultEncoding("UTF-8"); + cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); + cfg.setLogTemplateExceptions(false); + cfg.setClassicCompatible(true); + Template temp = cfg.getTemplate(name); StringWriter stringWriter = new StringWriter(); temp.process(map, stringWriter); stringWriter.flush(); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java index 34d453ec5..fb7bb4076 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java @@ -346,10 +346,10 @@ public class DistributionDeliveryListController extends BladeController { @PostMapping("/printBatch") @ApiOperationSupport(order = 2) @ApiOperation(value = "批量打印") - public R printBatch(@ApiParam(value = "主键集合", required = true) @RequestParam String ids ,@ApiParam(value = "打印类型", required = true) @RequestParam Integer type) { + public R> printBatch(@ApiParam(value = "主键集合", required = true) @RequestParam String ids ,@ApiParam(value = "打印类型", required = true) @RequestParam Integer type) { try { - PrintPreviewVO printPreviewVOS = distributionDeliveryListService.printBatch(ids,type); + List printPreviewVOS = distributionDeliveryListService.printBatch(ids,type); return R.data(printPreviewVOS); } catch (Exception e) { throw new RuntimeException(e); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index 1993325b8..683050b89 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -225,5 +225,5 @@ public interface IDistributionDeliveryListService extends BaseService printBatch(String ids,Integer type) throws Exception; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 6986e03e8..3ba31c052 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -2674,7 +2674,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl printBatch(String ids, Integer type) throws Exception { PrintPreviewVO printPreviewVO = new PrintPreviewVO(); @@ -3163,21 +3163,24 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl handleShiPeiData(BasicPrintTemplateEntity template, String[] idArray,String html) throws Exception { + + List result = new ArrayList<>(); List data = new ArrayList<>(); for (String id : idArray) { @@ -3195,20 +3208,20 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(byId.getId()); - if(distributionReservationEntityList.isEmpty()){ + if (distributionReservationEntityList.isEmpty()) { throw new ServiceException("未找到相关数据"); } for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) { map.put("配送单号", distributionReservationEntity.getReservationCode()); - // todo 商场电话是否需要查询商场信息得到电话 + // todo 查询运单的收货人电话 map.put("商场电话", distributionReservationEntity.getReservationCode()); map.put("送货日期", DateUtil.format(distributionReservationEntity.getReservationDate(), "yyyy-MM-dd") + " 全天"); @@ -3220,34 +3233,34 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl> spaclOrderList = buildSpaclOrders(distributionReservationEntity, 1); - + List> spaclOrderList = buildSpaclOrders(distributionReservationEntity, 1); map.put("定制品集合", spaclOrderList); - map.put("备注", distributionReservationEntity.getRemarks()); - } - - - map.put("送货司机", byId.getTrainNumber() + "/" + byId.getDriverName()); - - + map.put("送货司机", byId.getVehicleName() + "/" + byId.getDriverName()); 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; + } - private BasicPrintTemplateEntity getPrintTemplate(Integer type){ + private BasicPrintTemplateEntity getPrintTemplate(Integer type) { BasicPrintTemplateEntity template = null; - if(1 == type){ + if (1 == type) { template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_1.getValue()); - }else if(2 == type){ + } else if (2 == type) { template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_12.getValue()); } if (ObjectUtil.isEmpty(template)) { @@ -3257,7 +3270,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl> buildSpaclOrders(DistributionReservationEntity distributionReservationEntity, int i) { + private List> buildSpaclOrders(DistributionReservationEntity distributionReservationEntity, int i) { List distributionReservationStocklistEntities; List distributionReservationStockarticleEntityList; - List> result = new ArrayList<>(); + List> result = new ArrayList<>(); switch (i) { case 1: // 订单 @@ -3280,18 +3292,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl temp = new HashMap<>(); + Map temp = new HashMap<>(); DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(distributionReservationStockarticleEntity.getStockArticleId()); - temp.put("合同号",distributionStockArticleEntity.getOrderCode()); - temp.put("产品名称",distributionStockArticleEntity.getDescriptionGoods()); + temp.put("合同号", distributionStockArticleEntity.getOrderCode()); + temp.put("产品名称", distributionStockArticleEntity.getDescriptionGoods()); //todo 单位是否需要查询物料表 - temp.put("单位","件"); - temp.put("数量",distributionReservationStockarticleEntity.getReservationNum()); - temp.put("备货区",null); + temp.put("单位", "件"); + temp.put("数量", distributionReservationStockarticleEntity.getReservationNum()); + temp.put("备货区", null); //todo 这里还没完成 - temp.put("货位",null); + temp.put("货位", null); result.add(temp); From 473e91e1d7f11fd7211bf71381eaae3f36ab6224 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" <123456> Date: Mon, 18 Sep 2023 17:10:19 +0800 Subject: [PATCH 06/12] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=94=9F=E6=88=90=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DistributionDeliveryListServiceImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 3ba31c052..1598f8d20 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.logpm.basic.entity.BasicPrintTemplateEntity; import com.logpm.basic.feign.IBasicPrintTemplateClient; import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; @@ -67,6 +68,7 @@ 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.QRCodeUtil; import org.springblade.common.utils.TemplateUtil; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; @@ -3220,8 +3222,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl>>> distributionReservationEntity {}",distributionReservationEntity); map.put("配送单号", distributionReservationEntity.getReservationCode()); + String fileTypeName = QRCodeUtil.createCodeToFile(distributionReservationEntity.getReservationCode()); + map.put("配送单二维码",QRCodeUtil.getEmpAutograph(fileTypeName)); + // todo 查询运单的收货人电话 + map.put("商场名称", distributionReservationEntity.getMallName()); map.put("商场电话", distributionReservationEntity.getReservationCode()); map.put("送货日期", DateUtil.format(distributionReservationEntity.getReservationDate(), "yyyy-MM-dd") + " 全天"); @@ -3273,7 +3280,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Date: Mon, 18 Sep 2023 17:18:22 +0800 Subject: [PATCH 07/12] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=94=9F=E6=88=90=20debug1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionDeliveryListServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 1598f8d20..ab18f028c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -3171,12 +3171,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Date: Mon, 18 Sep 2023 17:25:35 +0800 Subject: [PATCH 08/12] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=94=9F=E6=88=90=20debug3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionDeliveryListServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index ab18f028c..000aa47b4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -3265,9 +3265,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Date: Mon, 18 Sep 2023 19:33:52 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E5=A2=9E=E5=80=BC=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/DistributionAddvalueVO.java | 2 + .../vo/DistributionReservationVO.java | 21 +++ .../DistributionAddvalueAppController.java | 22 +-- .../DistributionReservationController.java | 6 +- .../dto/app/DistributionAppAddvalueDTO.java | 22 +++ .../mapper/DistributionAddvalueMapper.xml | 4 +- .../DistributionAddvaluePackageMapper.xml | 4 +- .../mapper/DistributionReservationMapper.java | 4 +- .../mapper/DistributionReservationMapper.xml | 11 +- .../IDistributionReservationService.java | 22 ++- .../impl/DistributionAddvalueServiceImpl.java | 115 ++++++++------ .../DistributionDeliveryListServiceImpl.java | 41 +++-- .../DistributionReservationServiceImpl.java | 141 ++++++++++++++---- 13 files changed, 309 insertions(+), 106 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java index 497bc719f..b8fe2ea6f 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java @@ -51,5 +51,7 @@ public class DistributionAddvalueVO extends DistributionAddvalueEntity { private Double distance; + private Long addvalueDetailId; + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java index 42878c3f3..d2da34338 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import java.math.BigDecimal; import java.util.List; /** @@ -83,6 +84,26 @@ public class DistributionReservationVO extends DistributionReservationEntity { private String signingStatusName; + /** + * 仓库地址 + */ + @ApiModelProperty(value = "签收状态") + private String warehouseAddress; + + + /** + * 仓库经度 + */ + @ApiModelProperty(value = "签收状态") + private BigDecimal jingdu; + + /** + * 仓库纬度 + */ + @ApiModelProperty(value = "签收状态") + private BigDecimal weidu; + + /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java index 65eadaccd..b7992e159 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java @@ -38,7 +38,7 @@ import java.util.Map; @RestController @AllArgsConstructor @RequestMapping("/app/addvalue") -@Api(value = "签收管理", tags = "签收管理App接口") +@Api(value = "配送管理", tags = "增值服务App接口") public class DistributionAddvalueAppController { private final DistributionAddvalueServiceImpl distributionAddvalueService; @@ -63,8 +63,8 @@ public class DistributionAddvalueAppController { * 扫描接口 */ @PostMapping("/scanAddvaluePackage") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "增值服务扫描、输入包件码", notes = "DistributionAppDeliveryListDTO") public R scanAddvaluePackage(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) { R r =distributionAddvalueService.scanAddvaluePackage(distributionAppAddvalueDTO); return r; @@ -76,8 +76,8 @@ public class DistributionAddvalueAppController { * 全部包件 */ @PostMapping("/getAllPackageList") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "查询该客户下的所有配送包件信息", notes = "DistributionAppDeliveryListDTO") public List getAllPackageList(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) { List allPackageList = distributionAddvalueService.getAllPackageList(distributionAppAddvalueDTO); return allPackageList; @@ -87,8 +87,8 @@ public class DistributionAddvalueAppController { * 保存增值服务 */ @PostMapping("/saveAddvalueInfo") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "保存增值服务项", notes = "DistributionAppDeliveryListDTO") public R saveAddvalueInfo(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) { R r =distributionAddvalueService.saveAddvalueInfo(distributionAppAddvalueDTO); return r; @@ -99,8 +99,8 @@ public class DistributionAddvalueAppController { * 编辑保存 */ @PostMapping("/updateAddvalueInfo") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改增值服务项保存", notes = "DistributionAppDeliveryListDTO") public R updateAddvalueInfo(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) { R r =distributionAddvalueService.updateAddvalueInfo(distributionAppAddvalueDTO); return r; @@ -112,8 +112,8 @@ public class DistributionAddvalueAppController { * 查询编辑增值服务数据 */ @PostMapping("/editAddvalueInfo") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "查询编辑增值服务列表数据", notes = "DistributionAppDeliveryListDTO") public R editAddvalueInfo(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) { R r =distributionAddvalueService.editAddvalueInfo(distributionAppAddvalueDTO); return r; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java index a454e65be..e90cf42ef 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java @@ -221,9 +221,9 @@ public class DistributionReservationController extends BladeController { @GetMapping("/getReservationAddr") @ApiOperationSupport(order = 7) @ApiOperation(value = "查询指定预约信息地址") - public R> getReservationAddr(@ApiParam(value = "主键集合", required = true)@RequestParam String ids) { - IPage result = reservationService.getReservationAddr(ids); - return R.data(DistributionReservationWrapper.build().pageVO(result)); + public R> getReservationAddr(@ApiParam(value = "主键集合", required = true)@RequestParam String ids) { + List result = reservationService.getReservationAddr(ids); + return R.data(result); } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppAddvalueDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppAddvalueDTO.java index b5f844071..00edfdee3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppAddvalueDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppAddvalueDTO.java @@ -46,6 +46,20 @@ public class DistributionAppAddvalueDTO extends TenantEntity { private String barcode; + /** + * 扫描码 + */ + @ApiModelProperty(value = "扫描码") + private List packageListIds; + + + /** + * 是否手动 1 - 否 2-是 + */ + @ApiModelProperty(value = "是否手动") + private Integer isManual; + + /** * 配送任务Id */ @@ -121,6 +135,14 @@ public class DistributionAppAddvalueDTO extends TenantEntity { private BigDecimal fee; + /** + * 公里数 + */ + @ApiModelProperty(value = "公里数") +// @NotEmpty(message = "客户Id不能为空") + private Long addvalueDetailId; + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml index 5e98bc8ed..7ab373283 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml @@ -29,6 +29,7 @@ lda.addvalue_id, group_concat(DISTINCT ldad.fee) AS fee, group_concat(DISTINCT ldad.num) AS num, + group_concat(DISTINCT ldad.id) AS addvalueDetailId, group_concat(DISTINCT ldad.flool_num) AS floolNum, group_concat(DISTINCT ldad.distance) AS distance, group_concat( ldap.id SEPARATOR ',' ) AS packageListIds @@ -60,6 +61,7 @@ ldad.num AS num, ldad.flool_num AS floolNum, ldad.distance AS distance, + ldad.id AS addvalueDetailId, GROUP_CONCAT(ldap.package_id) AS packageListIds FROM logpm_distribution_addvalue AS lda @@ -67,7 +69,7 @@ INNER JOIN logpm_distribution_addvalue_package AS ldap ON ldad.id = ldap.addvalue_detail_id WHERE lda.ref_id = #{reservationId} and lda.addvalue_id = #{addvalueType} - GROUP BY ldad.fee,ldad.num,ldad.flool_num,ldad.distance + GROUP BY ldad.fee,ldad.num,ldad.flool_num,ldad.distance,ldad.id diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml index d77e49548..a051f1bf8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml @@ -32,10 +32,10 @@ - DELETE FROM logpm_diatribution_addvalue_package WHERE reservation_id = #{reservationId} and addvalue_detail_id = #{addvalueDetailId} + DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and addvalue_detail_id = #{addvalueDetailId} - DELETE FROM logpm_diatribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId} + DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId} + + + + + + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index 683050b89..23c790824 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -226,4 +226,6 @@ public interface IDistributionDeliveryListService extends BaseService printBatch(String ids,Integer type) throws Exception; + + void testData(String s) throws Exception; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index e3a1c2263..da02acd8c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -17,6 +17,8 @@ package com.logpm.distribution.service.impl; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -24,12 +26,13 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.logpm.basic.entity.BasicPrintTemplateEntity; import com.logpm.basic.feign.IBasicPrintTemplateClient; import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataCarrierClient; import com.logpm.basicdata.feign.IBasicdataDriverArteryClient; +import com.logpm.basicdata.feign.IBasicdataVehicleClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.bean.Resp; import com.logpm.distribution.dto.*; @@ -88,6 +91,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; @@ -141,6 +145,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDistributionDeliveryListPage(IPage page, DistributionDeliveryListDTO distributionDeliveryList) { @@ -3196,17 +3202,168 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl handleShangPeiData(Long templateId, String[] idArray,String html) throws Exception { + List result = new ArrayList<>(); + List> test = new ArrayList<>(); + for (String id : idArray) { + + //查询对应配送单 + DistributionDeliveryListEntity deliveryListEntity = baseMapper.selectById(id);//配送单 + if(Objects.isNull(deliveryListEntity)){ + log.warn("#########handleShangPeiData: 配送单信息不存在 deliveryListEntityId={}",id); + throw new CustomerException(403,"配送单信息不存在"); + } + Long deliveryListEntityId = deliveryListEntity.getId(); + String taskTime = deliveryListEntity.getTaskTime();//配送时间 + String kind = deliveryListEntity.getKind(); + String dirverName = ""; + String dirverPhone = ""; + String carNumber = ""; + + if("1".equals(kind)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("delivery_id",deliveryListEntityId); + DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliverySelfService.getOne(queryWrapper); + dirverName = deliverySelfEntity.getDriverName(); + dirverPhone = deliverySelfEntity.getDriverPhone(); + carNumber = deliverySelfEntity.getVehicleNub(); + }else if("2".equals(kind)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("delivery_id",deliveryListEntityId); + DistributionDeliveryTripartiteEntity deliveryTripartiteEntity = distributionDeliveryTripartiteService.getOne(queryWrapper); + dirverName = deliveryTripartiteEntity.getDriverName(); + dirverPhone = deliveryTripartiteEntity.getDriverPhone(); + carNumber = deliveryTripartiteEntity.getVehicleNum(); + } + + List distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(deliveryListEntityId); + //循环查询出来的预约单 + for (DistributionReservationEntity reservationEntity:distributionReservationEntityList){ + Map map = new HashMap<>(); + map.put("配送单号", reservationEntity.getReservationCode()); + String fileTypeName = QRCodeUtil.createCodeToFile(reservationEntity.getReservationCode()); + map.put("配送单二维码",QRCodeUtil.getEmpAutograph(fileTypeName)); + map.put("收货单单位",reservationEntity.getReceivingUnit());//收货单单位 + map.put("商场名称",reservationEntity.getStoreName());//商场名称 + map.put("收货人",reservationEntity.getConsignee());//收货人 + map.put("收货人电话",reservationEntity.getDeliveryPhone());//收货人电话 + map.put("收货人地址",reservationEntity.getDeliveryAddress());//收货人地址 + map.put("配送时间",taskTime);//配送时间 + map.put("承运商",deliveryListEntity.getDistributionCompany()); + map.put("配送仓库",deliveryListEntity.getWarehouseName()); + map.put("出库时间",deliveryListEntity.getWarehouseName()); + map.put("送货司机",dirverName+"/"+dirverPhone); + map.put("车牌号",carNumber); + + Long reservationId = reservationEntity.getId();//预约id + //通过预约id查询所有包件并按三级品类分组 + List> categoryList = distributionReservationMapper.findAllCategoryNum(reservationId); + //计算一个总计 + Map total = new HashMap<>(); + Integer totalNum = 0; + for (Map m:categoryList){ + Set set = m.keySet(); + String categoryName = ""; + Long num = 0L; + for (String s:set){ + if("num".equals(s)){ + num = (Long)m.get(s); + totalNum = totalNum + num.intValue(); + }else{ + categoryName = (String)m.get(s); + } + } + total.put(categoryName,num); + } + total.put("合计件数",totalNum); + + + + //先查询预约单对应有哪些订单 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("reservation_id",reservationId); + List reservationStockarticleList = distributionReservationStockarticleService.list(queryWrapper); + List> ls = new ArrayList<>(); + BigDecimal totalPrice = BigDecimal.ZERO; + for (int i = 0; i < reservationStockarticleList.size(); i++) { + DistributionReservationStockarticleEntity reservationStockarticleEntity = reservationStockarticleList.get(i); + Long stockArticleId = reservationStockarticleEntity.getStockArticleId();//订单id + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(stockArticleId); + if(Objects.isNull(stockArticleEntity)){ + log.warn("#########handleShangPeiData: 订单信息不存在 stockArticleId={}",stockArticleId); + throw new CustomerException(403,"订单信息不存在"); + } + Map orderMap = new HashMap<>(); + orderMap.put("序号",i+1); + orderMap.put("运单号",stockArticleEntity.getWaybillNumber()); + orderMap.put("合同号",stockArticleEntity.getOrderCode()); + + //通过订单id和预约id查询对应包件的库位信息 + List allocationStrList = distributionReservationMapper.getAllocationByStockArticleIdAndReservationId(stockArticleId,reservationId); + String allocationStr = StringUtils.join(allocationStrList, ","); + orderMap.put("货位",allocationStr); + //通过订单id和预约id查询对应包件的备货区信息 + List stockupAreaStrList = distributionReservationMapper.getStockupAreaByStockArticleIdAndReservationId(stockArticleId,reservationId); + String stockupAreaStr = StringUtils.join(stockupAreaStrList, ","); + orderMap.put("备货区",stockupAreaStr); + + //查询当前订单的品类数量 + List> mapList = distributionReservationMapper.getCategoryByStockArticleIdAndReservationId(stockArticleId,reservationId); + Map numObj = new HashMap<>(); + Integer tn = 0; + Set set = total.keySet(); + for (String key:set){ + if(!"合计件数".equals(key)){ + numObj.put(key,0); + for (Map m:mapList){ + String thirdProduct = (String)m.get("thirdProduct"); + Long num = (Long)m.get("num"); + if(thirdProduct.equals(key)){ + numObj.put(key,num); + tn = tn + num.intValue(); + } + } + } + } + numObj.put("合计数量",tn); + orderMap.put("产品明细",numObj); + + //通过订单id和预约id查询对应包件的物料信息 + List materialNameStrList = distributionReservationMapper.getMaterialNameByStockArticleIdAndReservationId(stockArticleId,reservationId); + String materialNameStr = StringUtils.join(materialNameStrList, ","); + orderMap.put("物料名称",materialNameStr); + orderMap.put("到付运费",0);//todo 需要累加到totalPrice上 + ls.add(orderMap); + } + total.put("到付费用",totalPrice); + map.put("明细",ls); + map.put("合计",total); + test.add(map); + String popHtml =TemplateUtil.popTemplate("商配配配送单",map,html); + PrintPreviewVO printPreviewVO = new PrintPreviewVO(); + printPreviewVO.setTemplateId(templateId); + printPreviewVO.setTemplateHtml(popHtml); + result.add(printPreviewVO); + } + } + log.info("#############test: test={}",test); + String s = JSON.toJSONString(test); + JSONArray array= JSONArray.parseArray(JSON.toJSONString(test)); + return result; } /** @@ -3225,8 +3382,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl map = new HashMap<>(); - DistributionDeliveryListEntity byId = this.getById(id); if (ObjectUtils.isNull(byId)) { @@ -3240,7 +3395,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl map = new HashMap<>(); log.debug(">>>> distributionReservationEntity {}",distributionReservationEntity); map.put("配送单号", distributionReservationEntity.getReservationCode()); String fileTypeName = QRCodeUtil.createCodeToFile(distributionReservationEntity.getReservationCode()); @@ -3264,21 +3419,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl params = new HashMap<>(); - params.put("ids","1686560469635727362"); - try { - OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params); - System.out.println(orderPackgeCodeDataVO); - } catch (Exception e) { - e.printStackTrace(); - } +// Map params = new HashMap<>(); +// params.put("ids","1686560469635727362"); +// try { +// OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params); +// System.out.println(orderPackgeCodeDataVO); +// } catch (Exception e) { +// e.printStackTrace(); +// } + List printPreviewVOS = distributionDeliveryListService.printBatch(ids,type); + } } diff --git a/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java b/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java new file mode 100644 index 000000000..d750cd869 --- /dev/null +++ b/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java @@ -0,0 +1,30 @@ +package com.logpm.distribution; + +import com.logpm.distribution.service.IDistributionDeliveryListService; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springblade.core.test.BladeBootTest; +import org.springblade.core.test.BladeSpringExtension; +import org.springframework.beans.factory.annotation.Autowired; + +@ExtendWith(BladeSpringExtension.class) +@BladeBootTest(appName = "logpm-distribution", enableLoader = true) +public class TestService { + + @Autowired + private IDistributionDeliveryListService distributionDeliveryListService; + + @Test + public void test2() throws Exception { + +// List printPreviewVOS = distributionDeliveryListService.printBatch("1703958397055135745", 1); + + + distributionDeliveryListService.testData("1703958397055135745"); + + System.out.println(111111); + + } + +} +