From e870a8d88dbc8f4de8a3fdaa4c82085d0cfc834f Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 27 Mar 2024 18:43:29 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8B=86=E5=8D=95-=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=A4=87=E6=B3=A8=E5=AD=98=E5=85=A5=202.=E8=AE=A2=E5=8D=95-?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=A0=81=E7=94=9F=E6=88=90=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PrintTemplateStatusConstant.java | 1 + .../DistributionStockArticleEntity.java | 3 + .../distribution/vo/OrderCodeDataVO.java | 23 +++++++ .../DistributionStockArticleController.java | 19 ++++-- .../DistributionStockArticleMapper.java | 2 + .../mapper/DistributionStockArticleMapper.xml | 19 ++++++ .../IDistributionStockArticleService.java | 1 + .../DistributionStockArticleServiceImpl.java | 61 ++++++++++++++++++- .../impl/WarehouseWaybillServiceImpl.java | 1 + 9 files changed, 124 insertions(+), 6 deletions(-) create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/OrderCodeDataVO.java 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 21408f174..c3c1c3ab7 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 @@ -21,6 +21,7 @@ public enum PrintTemplateStatusConstant { daiqueren_11("库存品包件模板","11"), daiqueren_12("配送任务打印模板-商配","12"), peisongtask_ziti("配送任务打印模板-自提","13"), + daiqueren_14("订单模版","15"), daiqueren_1("配送任务打印模板-市配","1"); /** * 状态 diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java index 44266d556..cd4c213fa 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java @@ -450,6 +450,9 @@ public class DistributionStockArticleEntity extends TenantEntity { @ApiModelProperty(value = "配载件数") private Integer carsLoadNum; + + @ApiModelProperty(value = "备注") + private String remark; /** /* * 未入库数量 *//* diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/OrderCodeDataVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/OrderCodeDataVO.java new file mode 100644 index 000000000..3410ca6c4 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/OrderCodeDataVO.java @@ -0,0 +1,23 @@ +package com.logpm.distribution.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 返回订单码页面 内容 + */ +@Data +public class OrderCodeDataVO { + + @ApiModelProperty(value = "模板ID") + private Long templateId; + @ApiModelProperty(value = "模板内容") + private String templateHtml; + + @ApiModelProperty(value = "模板填充内容") + private List> dataList; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java index 6795a0ad5..b177ac64b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java @@ -26,10 +26,7 @@ import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.excel.DistributionStockArticleExcel; import com.logpm.distribution.excel.DistributionStockArticleImporter; import com.logpm.distribution.service.IDistributionStockArticleService; -import com.logpm.distribution.vo.DistributionParcelListVO; -import com.logpm.distribution.vo.DistributionParcelNumberVO; -import com.logpm.distribution.vo.DistributionStockArticleVO; -import com.logpm.distribution.vo.OrderPackgeCodeDataVO; +import com.logpm.distribution.vo.*; import com.logpm.distribution.wrapper.DistributionStockArticleWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -485,6 +482,20 @@ public class DistributionStockArticleController extends BladeController { + @GetMapping("/showOrderCode") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "展示订单码") + public R showOrderCode(@ApiIgnore @RequestParam Map params){ + + OrderCodeDataVO orderCodeDataVO= null; + try { + orderCodeDataVO = distributionStockArticleService.showOrderCode(params); + } catch (Exception e) { + return R.fail(e.getMessage()); + } + return R.data(orderCodeDataVO); + + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java index 41c29358c..10d707bd9 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java @@ -181,4 +181,6 @@ public interface DistributionStockArticleMapper extends BaseMapper findListByOrderCodeLike(@Param("orderCode") String orderCode); void submitHandleNumAndTotalNumberByOrderId(@Param("subNum") Integer subNum, @Param("articleId") Long articleId); + + JSONObject findShowOrderCodeData(@Param("orderId") Long orderId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index b56bf8f37..e2c1bc3cf 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -522,6 +522,9 @@ and ldsa.customer_name like concat('%',#{param.customerName},'%') + + and ldsa.is_zero = #{param.isZero} + and ldsa.customer_telephone like concat('%',#{param.customerTelephone},'%') @@ -1081,4 +1084,20 @@ where id = #{articleId} + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java index cf5a5c5e9..e0e8969d3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java @@ -240,4 +240,5 @@ public interface IDistributionStockArticleService extends BaseService params) throws Exception; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 05c9670b7..a2dd65cbe 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -19,7 +19,6 @@ package com.logpm.distribution.service.impl; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -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.StringUtils; @@ -88,7 +87,6 @@ import java.io.IOException; import java.util.*; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import java.util.function.Function; import java.util.stream.Collectors; /** @@ -1828,6 +1826,65 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl params) throws Exception { + OrderCodeDataVO orderCodeDataVO = new OrderCodeDataVO(); + List> data = new ArrayList<>(); + BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_14.getValue()); + if (ObjectUtil.isEmpty(template)) { + throw new ServiceException("模板内容未找到"); + } + + String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl()); + orderCodeDataVO.setTemplateHtml(html); + orderCodeDataVO.setTemplateId(template.getId()); + String ids = (String) params.get("ids"); + + String[] idArray = ids.split(","); + if (ObjectUtils.isNull(idArray)) { + throw new ServiceException("参数错误"); + + } + for (String orderId : idArray) { + JSONObject jsonObject = baseMapper.findShowOrderCodeData(Long.parseLong(orderId)); + String orderCode = jsonObject.getString("orderCode"); + String waybillNo = jsonObject.getString("waybillNo"); + String descriptionGoods = jsonObject.getString("descriptionGoods"); + Integer totalNumber = jsonObject.getInteger("totalNumber"); + + Map map = jsonObject.getInnerMap(); + map.put("id", orderId); + String filename = QRCodeUtil.createCodeToFile(orderCode); + map.put("orderCodeImage", QRCodeUtil.getEmpAutograph(filename)); + // 订单号 生成二维码 + String fileTypeName = QRCodeUtil.createCodeToFile(orderCode); + map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName)); + if(orderCode.equals(waybillNo)){ + map.put("product",descriptionGoods+"("+totalNumber+")"); + }else{ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("stock_article_id",Long.parseLong(orderId)); + List list = distributionParcelListService.list(queryWrapper); + StringBuilder product = new StringBuilder(); + for (DistributionParcelListEntity parcelListEntity : list) { + String firsts = parcelListEntity.getFirsts(); + Integer quantity = parcelListEntity.getQuantity(); + if(StringUtils.isBlank(product)){ + product.append(firsts).append("(").append(quantity).append(")"); + }else{ + product.append(",").append(firsts).append("(").append(quantity).append(")"); + } + } + map.put("product",product.toString()); + } + + data.add(map); + } + orderCodeDataVO.setDataList(data); + + return orderCodeDataVO; + } + @Override public DistributionStockArticleEntity findZeroByOrderCodeAndWarehouseId(String orderCode, Long warehouseId) { diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java index ecf69e780..052369ba1 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java @@ -430,6 +430,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl products = splitOrderDTO.getProducts(); StringBuffer stringBuffer = new StringBuffer(); Integer allNum = 0;