From 0f4d098f83e54086047638a569619a36d845c7ea Mon Sep 17 00:00:00 2001 From: x_z Date: Sun, 23 Oct 2022 13:12:10 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E5=BB=BA=E5=9E=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/udi/admin/dao/product/StackOrderDao.java | 8 -------- .../glxp/udi/admin/service/info/PlatformService.java | 3 --- .../udi/admin/service/product/StackCodeService.java | 10 +++++++--- .../resources/mybatis/mapper/product/StackOrderDao.xml | 5 ----- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/glxp/udi/admin/dao/product/StackOrderDao.java b/src/main/java/com/glxp/udi/admin/dao/product/StackOrderDao.java index 340197d..1a8fcd7 100644 --- a/src/main/java/com/glxp/udi/admin/dao/product/StackOrderDao.java +++ b/src/main/java/com/glxp/udi/admin/dao/product/StackOrderDao.java @@ -8,14 +8,6 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface StackOrderDao extends BaseMapper { - /** - * 根据ID查询此垛的订单号 - * - * @param id - * @return - */ - String selectOrderIdById(@Param("id") Integer id); - /** * 更新导出状态 * diff --git a/src/main/java/com/glxp/udi/admin/service/info/PlatformService.java b/src/main/java/com/glxp/udi/admin/service/info/PlatformService.java index 1812833..ab0c95a 100644 --- a/src/main/java/com/glxp/udi/admin/service/info/PlatformService.java +++ b/src/main/java/com/glxp/udi/admin/service/info/PlatformService.java @@ -13,7 +13,6 @@ import com.glxp.udi.admin.common.enums.ResultEnum; import com.glxp.udi.admin.common.res.BaseResponse; import com.glxp.udi.admin.common.util.ResultVOUtils; import com.glxp.udi.admin.dao.info.PlatformDao; -import com.glxp.udi.admin.dao.inout.UnitMaintainDao; import com.glxp.udi.admin.dao.inout.UnitMaintainPlatformDao; import com.glxp.udi.admin.entity.info.PlatformEntity; import com.glxp.udi.admin.entity.inout.UnitMaintainPlatform; @@ -38,8 +37,6 @@ public class PlatformService { @Resource private PlatformDao platformDao; @Resource - private UnitMaintainDao unitMaintainDao; - @Resource private UnitMaintainPlatformDao unitMaintainPlatformDao; public int save(PlatformEntity platformEntity) { diff --git a/src/main/java/com/glxp/udi/admin/service/product/StackCodeService.java b/src/main/java/com/glxp/udi/admin/service/product/StackCodeService.java index b6eccf6..dbefd94 100644 --- a/src/main/java/com/glxp/udi/admin/service/product/StackCodeService.java +++ b/src/main/java/com/glxp/udi/admin/service/product/StackCodeService.java @@ -90,9 +90,11 @@ public class StackCodeService { public StackCodeResponse addCode(AddStackCodeRequest addStackCodeRequest) { StackCode stackCode = new StackCode(); stackCode.setCode(addStackCodeRequest.getCode()); + + String stackId = addStackCodeRequest.getOrderId(); if (StrUtil.isBlank(addStackCodeRequest.getOrderId())) { //垛号为空,此条码为这个垛的第一个条码数据,先生垛号和垛数据,再添加条码 - String stackId = idUtil.getStackId(addStackCodeRequest.getCustomerId()); + stackId = idUtil.getStackId(addStackCodeRequest.getCustomerId()); //创建垛数据 StackOrder stackOrder = new StackOrder(); //垛码 @@ -104,7 +106,9 @@ public class StackCodeService { stackOrderDao.insert(stackOrder); stackCode.setOrderIdFk(String.valueOf(stackOrder.getId())); } else { - stackCode.setOrderIdFk(addStackCodeRequest.getOrderId()); + //查询此垛号的id + Integer orderIdFk = stackOrderDao.selectId(stackId, Long.valueOf(addStackCodeRequest.getCustomerId())); + stackCode.setOrderIdFk(String.valueOf(orderIdFk)); } UdiEntity udi = FilterUdiUtils.getUdi(stackCode.getCode()); BeanUtil.copyProperties(udi, stackCode); @@ -113,7 +117,7 @@ public class StackCodeService { StackCodeResponse response = new StackCodeResponse(); BeanUtil.copyProperties(stackCode, response); - response.setStackId(stackOrderDao.selectOrderIdById(Integer.valueOf(stackCode.getOrderIdFk()))); + response.setStackId(stackId); return response; } diff --git a/src/main/resources/mybatis/mapper/product/StackOrderDao.xml b/src/main/resources/mybatis/mapper/product/StackOrderDao.xml index ef91ec0..820a619 100644 --- a/src/main/resources/mybatis/mapper/product/StackOrderDao.xml +++ b/src/main/resources/mybatis/mapper/product/StackOrderDao.xml @@ -1,11 +1,6 @@ - update stack_order