From 04a6cb56b6504a198cfd727742f3667a06f65d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Sat, 11 Oct 2025 17:35:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=88=E6=9D=BF=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/api/entity/NotifyDataToWcs.java | 1 + .../mapper/WcsIntegrationMapper.java | 8 ++++-- .../impl/WcsIntegrationServiceImpl.java | 28 +++++++++++++++++-- .../service/impl/NewIssureServiceImpl.java | 1 + .../modules/warehouse/entity/Pallet.java | 6 +++- .../WcsIntegrationMapper.xml | 8 +++++- 6 files changed, 45 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gaotao/modules/api/entity/NotifyDataToWcs.java b/src/main/java/com/gaotao/modules/api/entity/NotifyDataToWcs.java index da09740..f5fd13a 100644 --- a/src/main/java/com/gaotao/modules/api/entity/NotifyDataToWcs.java +++ b/src/main/java/com/gaotao/modules/api/entity/NotifyDataToWcs.java @@ -10,5 +10,6 @@ public class NotifyDataToWcs { private String site;//工厂编码 private String taskNo;//任务单号 private Integer itemNo; //任务行号 + private String orderNo;//生产订单 private List materialRequisitions; } diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java b/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java index 0cbe2ed..cb06fd1 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java @@ -1,6 +1,7 @@ package com.gaotao.modules.automatedWarehouse.mapper; import com.gaotao.modules.automatedWarehouse.entity.*; +import com.gaotao.modules.base.entity.PalletType; import com.gaotao.modules.warehouse.entity.PalletData; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -367,10 +368,11 @@ public interface WcsIntegrationMapper { com.gaotao.modules.warehouse.entity.PalletData getPalletInfoWithTypeDetails(@Param("site") String site, @Param("palletId") String palletId); /** - * 更新栈板类型和自动分拣标志 - AI制作 + * 更新栈板类型、自动分拣标志和存储类型 - AI制作/rqrq */ void updatePalletTypeAndAutoSort(@Param("site") String site, @Param("palletId") String palletId, - @Param("palletType") String palletType, @Param("autoSort") String autoSort); + @Param("palletType") String palletType, @Param("autoSort") String autoSort, + @Param("soreType") Integer soreType); /** * 获取指定层已占用的位置列表 - rqrq @@ -385,4 +387,6 @@ public interface WcsIntegrationMapper { * @date 2025/10/07 */ void insertCallbackPalletScan(@Param("callback") WcsCallbackPalletScan callback); + + PalletType getPalletType(@Param("site") String site, @Param("palletType") String palletType); } diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java index 336f824..5f2c675 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java @@ -11,6 +11,7 @@ import com.gaotao.common.utils.AgvClientUtil; import java.util.Arrays; import com.gaotao.modules.automatedWarehouse.mapper.WcsIntegrationMapper; import com.gaotao.modules.automatedWarehouse.service.WcsIntegrationService; +import com.gaotao.modules.base.entity.PalletType; import com.gaotao.modules.handlingunit.entity.HandlingUnit; import com.gaotao.modules.sys.entity.SysUserEntity; import com.gaotao.modules.trans.entity.TransNoControl; @@ -1264,12 +1265,13 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { @Override @Transactional public void updatePalletTypeAndAutoSort(Map params) throws Exception { - System.out.println("开始更新栈板类型和自动分拣标志 - AI制作,params=" + params); + System.out.println("开始更新栈板类型、自动分拣标志和存储类型 - AI制作/rqrq,params=" + params); String site = (String) params.get("site"); String palletId = (String) params.get("palletId"); String palletType = (String) params.get("palletType"); String autoSort = (String) params.get("autoSort"); + Boolean forceFullPalletOut = (Boolean) params.get("forceFullPalletOut"); // 是否强制整托出库 - rqrq if (!StringUtils.hasText(site) || !StringUtils.hasText(palletId)) { throw new Exception("工厂编码和栈板编码不能为空"); @@ -1288,9 +1290,29 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { throw new Exception("自动分拣标志只能为Y或N"); } - wcsIntegrationMapper.updatePalletTypeAndAutoSort(site, palletId, palletType, autoSort); + // 确定soreType的值 - rqrq + Integer soreType; + if (forceFullPalletOut != null && forceFullPalletOut) { + // 如果勾选"强制整托出库",则soreType固定为3(直接出库) - rqrq + soreType = 3; + System.out.println("强制整托出库已勾选,soreType设置为3(直接出库) - rqrq"); + } else { + // 否则从pallet_type表查询wcsSoreType - rqrq + + PalletType palletTypeInfo = wcsIntegrationMapper.getPalletType(site,palletType); + if (palletTypeInfo != null && palletTypeInfo.getWcsSoreType() != null) { + soreType = palletTypeInfo.getWcsSoreType(); + System.out.println("从pallet_type表获取wcsSoreType=" + soreType + " - rqrq"); + } else { + // 如果查不到,默认为0(人工/混装) - rqrq + soreType = 0; + System.out.println("未找到pallet_type配置,soreType默认为0(人工/混装) - rqrq"); + } + } + + wcsIntegrationMapper.updatePalletTypeAndAutoSort(site, palletId, palletType, autoSort, soreType); - System.out.println("更新栈板类型和自动分拣标志完成 - AI制作"); + System.out.println("更新栈板类型、自动分拣标志和存储类型完成 - AI制作/rqrq,soreType=" + soreType); } /** diff --git a/src/main/java/com/gaotao/modules/notify/service/impl/NewIssureServiceImpl.java b/src/main/java/com/gaotao/modules/notify/service/impl/NewIssureServiceImpl.java index 56b4cf8..ccf628a 100644 --- a/src/main/java/com/gaotao/modules/notify/service/impl/NewIssureServiceImpl.java +++ b/src/main/java/com/gaotao/modules/notify/service/impl/NewIssureServiceImpl.java @@ -894,6 +894,7 @@ public class NewIssureServiceImpl implements NewIssureService { NotifyDataToWcs wcsData = new NotifyDataToWcs(); wcsData.setSite(site); wcsData.setTaskNo(taskNo); + wcsData.setOrderNo(productionOrderNo); wcsData.setItemNo(orderTask.getItemNo()); // 构建栈板列表 - rqrq diff --git a/src/main/java/com/gaotao/modules/warehouse/entity/Pallet.java b/src/main/java/com/gaotao/modules/warehouse/entity/Pallet.java index cc2bd5d..1d8754b 100644 --- a/src/main/java/com/gaotao/modules/warehouse/entity/Pallet.java +++ b/src/main/java/com/gaotao/modules/warehouse/entity/Pallet.java @@ -68,7 +68,11 @@ public class Pallet { private String palletFamily; // 托盘大分类(关联pallet_family表,固定不可改) - private Integer soreType; // 分拣方式(存储类型) + /** + * 分拣方式(存储类型)- rqrq + * 0=人工/混装, 1=气胀轴自动分拣(每层只能放1个), 2=抱箱自动分拣(每层可以放多个), 3=直接出库(强制整托出库) + */ + private Integer soreType; private String autoSort; // 是否自动分拣 Y=自动分拣, N=手动分拣 diff --git a/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml b/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml index e80de98..c3d30dc 100644 --- a/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml +++ b/src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml @@ -794,11 +794,12 @@ AND p.is_deleted = '0' - + UPDATE pallet SET pallet_type = #{palletType}, auto_sort = #{autoSort}, + sore_type = #{soreType}, updated_time = GETDATE() WHERE site = #{site} AND pallet_id = #{palletId} @@ -830,4 +831,9 @@ ) + + \ No newline at end of file