diff --git a/src/main/java/com/glxp/udi/admin/controller/product/StackOrderController.java b/src/main/java/com/glxp/udi/admin/controller/product/StackOrderController.java index cc6cfb2..a17970e 100644 --- a/src/main/java/com/glxp/udi/admin/controller/product/StackOrderController.java +++ b/src/main/java/com/glxp/udi/admin/controller/product/StackOrderController.java @@ -278,5 +278,4 @@ public class StackOrderController { } } - } 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 92e4f30..340197d 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 @@ -32,4 +32,5 @@ public interface StackOrderDao extends BaseMapper { * @return */ Integer selectId(@Param("orderId") String orderId, @Param("customerId") Long customerId); + } diff --git a/src/main/java/com/glxp/udi/admin/entity/product/StackOrder.java b/src/main/java/com/glxp/udi/admin/entity/product/StackOrder.java index e27e56f..e797fc5 100644 --- a/src/main/java/com/glxp/udi/admin/entity/product/StackOrder.java +++ b/src/main/java/com/glxp/udi/admin/entity/product/StackOrder.java @@ -16,7 +16,7 @@ import java.util.Date; @TableName("stack_order") public class StackOrder { - @TableId(type = IdType.AUTO) + @TableId(value = "id", type = IdType.AUTO) private Integer id; /** 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 36b3a3a..b6eccf6 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 @@ -51,6 +51,7 @@ public class StackCodeService { stackCodeEntityList.forEach(stackCodeEntity -> { UdiEntity udi = FilterUdiUtils.getUdi(stackCodeEntity.getCode()); BeanUtil.copyProperties(udi, stackCodeEntity); + stackCodeEntity.setId(null); mapper.insert(stackCodeEntity); }); batchSession.commit(); diff --git a/src/main/java/com/glxp/udi/admin/service/product/StackOrderService.java b/src/main/java/com/glxp/udi/admin/service/product/StackOrderService.java index 6ab254d..8194b29 100644 --- a/src/main/java/com/glxp/udi/admin/service/product/StackOrderService.java +++ b/src/main/java/com/glxp/udi/admin/service/product/StackOrderService.java @@ -80,13 +80,12 @@ public class StackOrderService { if (null == stackOrderEntity.getCreateTime()) { stackOrderEntity.setCreateTime(new Date()); } + stackOrderEntity.setId(null); stackOrderDao.insert(stackOrderEntity); return stackOrderEntity; } public void deleteById(Integer id) { - //查询此垛的垛号 - String orderId = stackOrderDao.selectOrderIdById(id); //删除垛数据 stackOrderDao.deleteById(id); //删除关联的条码数据 @@ -219,4 +218,5 @@ public class StackOrderService { Integer id = stackOrderDao.selectId(orderId, customerId); return stackCodeDao.selectListByOrderIdFk(id); } + } diff --git a/src/main/resources/mybatis/mapper/product/StackOrderDao.xml b/src/main/resources/mybatis/mapper/product/StackOrderDao.xml index 0694159..ef91ec0 100644 --- a/src/main/resources/mybatis/mapper/product/StackOrderDao.xml +++ b/src/main/resources/mybatis/mapper/product/StackOrderDao.xml @@ -19,4 +19,5 @@ where orderId = #{orderId} and customerId = #{customerId} + \ No newline at end of file