From e80b5e3ffaa3cfb45d55c8301499ec3542aeb5ab Mon Sep 17 00:00:00 2001 From: DouDou <877258667@qq.com> Date: Thu, 3 Apr 2025 10:11:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E4=BB=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/spring/ifs/api/BaseSearchApi.java | 16 ++++++---------- .../com/spring/ifs/api/BaseSearchApiTest.java | 16 ++++++---------- .../spring/ifs/bean/InventoryServiceBean.java | 18 ++++++++++++++++-- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/spring/ifs/api/BaseSearchApi.java b/src/main/java/com/spring/ifs/api/BaseSearchApi.java index 1533b253..bf7cb42a 100644 --- a/src/main/java/com/spring/ifs/api/BaseSearchApi.java +++ b/src/main/java/com/spring/ifs/api/BaseSearchApi.java @@ -114,22 +114,18 @@ public class BaseSearchApi { */ public static List getWarehouseLocations(Server srv, String siteCon, String ifsRowVersion, int startIndex, int pageSize) throws APException { StringBuilder searchSql = new StringBuilder(); - searchSql.append("SELECT wbb.contract site, wbb.location_no location_id, wbb.description location_name, wbb.warehouse_id, 'Y' active, NULL create_date, 'admin' create_by,"); - searchSql.append(" NULL update_date, NULL update_by, ilt.inventory_location_type location_type, wbb.objid ifsRowId, wbb.OBJVERSION ifsRowVersion"); - searchSql.append(" FROM ifsapp.WAREHOUSE_BAY_BIN wbb, ifsapp.INVENTORY_LOCATION_GROUP ilt"); - searchSql.append(" WHERE wbb.location_group = ilt.LOCATION_GROUP"); + searchSql.append("SELECT contract site, location_no location_id, location_name, warehouse warehouse_id, 'Y' active, NULL create_date, 'admin' create_by,"); + searchSql.append(" '' update_date, '' update_by, location_type location_type"); + searchSql.append(" FROM ifsapp.INVENTORY_LOCATION14"); + searchSql.append(" WHERE 1 = 1"); //添加判断的查询条件 if(!(null == siteCon || "".equals(siteCon))) { - searchSql.append(" AND wbb.contract IN "+siteCon); + searchSql.append(" AND contract IN "+siteCon); } //设置查询的入参 Map inParam = new HashMap<>(); - if(!(null == ifsRowVersion || "".equals(ifsRowVersion))) { - searchSql.append(" AND wbb.OBJVERSION >= :ifsRowVersion"); - inParam.put("ifsRowVersion", ifsRowVersion); - } //添加排序语句 - searchSql.append(" ORDER BY wbb.OBJVERSION, wbb.contract, wbb.location_no"); + searchSql.append(" ORDER BY contract, location_no"); //添加分页的查询语句 searchSql.append(" OFFSET "+startIndex+" ROWS FETCH NEXT "+pageSize+" ROWS ONLY"); //调用查询的通用方法 diff --git a/src/main/java/com/spring/ifs/api/BaseSearchApiTest.java b/src/main/java/com/spring/ifs/api/BaseSearchApiTest.java index 3cbe7d7d..5cb5e92f 100644 --- a/src/main/java/com/spring/ifs/api/BaseSearchApiTest.java +++ b/src/main/java/com/spring/ifs/api/BaseSearchApiTest.java @@ -105,22 +105,18 @@ public class BaseSearchApiTest { */ public static List getWarehouseLocations(Server srv, String siteCon, String ifsRowVersion, int startIndex, int pageSize) throws APException { StringBuilder searchSql = new StringBuilder(); - searchSql.append("SELECT wbb.contract site, wbb.location_no location_id, wbb.description location_name, wbb.warehouse_id, 'Y' active, NULL create_date, 'admin' create_by,"); - searchSql.append(" NULL update_date, NULL update_by, ilt.inventory_location_type location_type, wbb.objid ifsRowId, wbb.OBJVERSION ifsRowVersion"); - searchSql.append(" FROM ifsapp.WAREHOUSE_BAY_BIN wbb, ifsapp.INVENTORY_LOCATION_GROUP ilt"); - searchSql.append(" WHERE wbb.location_group = ilt.LOCATION_GROUP"); + searchSql.append("SELECT contract site, location_no location_id, location_name, warehouse warehouse_id, 'Y' active, NULL create_date, 'admin' create_by,"); + searchSql.append(" '' update_date, '' update_by, location_type location_type"); + searchSql.append(" FROM ifsapp.INVENTORY_LOCATION14"); + searchSql.append(" WHERE 1 = 1"); //添加判断的查询条件 if(!(null == siteCon || "".equals(siteCon))) { - searchSql.append(" AND wbb.contract IN "+siteCon); + searchSql.append(" AND contract IN "+siteCon); } //设置查询的入参 Map inParam = new HashMap<>(); - if(!(null == ifsRowVersion || "".equals(ifsRowVersion))) { - searchSql.append(" AND wbb.OBJVERSION >= :ifsRowVersion"); - inParam.put("ifsRowVersion", ifsRowVersion); - } //添加排序语句 - searchSql.append(" ORDER BY wbb.OBJVERSION, wbb.contract, wbb.location_no"); + searchSql.append(" ORDER BY contract, location_no"); //添加分页的查询语句 searchSql.append(" OFFSET "+startIndex+" ROWS FETCH NEXT "+pageSize+" ROWS ONLY"); //调用查询的通用方法 diff --git a/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java b/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java index 2026b3e6..31131441 100644 --- a/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java @@ -713,7 +713,7 @@ public class InventoryServiceBean { * @date 2024/12/9 15:51 * @version 1.0 */ - public Map syncCopyPartForInventoryPart(Server srv, CopyPart inData) { + public Map syncCopyPartForInventoryPart(Server srv, CopyPart inData) throws APException { //公共参数 Map returnMap = new HashMap<>(); String oriContract = inData.getOriContract(); @@ -734,6 +734,15 @@ public class InventoryServiceBean { String copySPCharacteristics = inData.getCopySPCharacteristics();//对应Sales Part, Characteristics String copySPDocumentTexts = inData.getCopySPDocumentTexts();//对应Sales Part, Document Texts String copySPLanguageDescription = inData.getCopySPLanguageDescription();//对应Sales Part, Language Description + boolean masterPartFlag = false; + //查询Master Part的信息 + Map masterPartMap = MasterPartApi.getMasterPart(srv, partNo); + if (masterPartMap == null || masterPartMap.size() == 0) { + masterPartFlag = true; + }else { + masterPartFlag = false; + + } try{ //调用api方法获取事件的编码 Map resultMap = InventoryPartApi.getCopyPartEventNo(srv); @@ -758,7 +767,12 @@ public class InventoryServiceBean { //处理master Part数据都要传 if(copyDesc.indexOf("Part Catalog,") == 0 || copyDesc.indexOf("Part,") == 0) { //调用api设置成 必传 重复不添加 - InventoryPartApi.modifyIfsCopyPartItem(srv, ifsRowId, ifsRowVersion, "TRUE", "TRUE"); + //如果maste 需要插入数据 + if (masterPartFlag) { + InventoryPartApi.modifyIfsCopyPartItem(srv, ifsRowId, ifsRowVersion, "TRUE", "TRUE"); + }else { + InventoryPartApi.modifyIfsCopyPartItem(srv, ifsRowId, ifsRowVersion, "FALSE", "TRUE"); + } } //针对Connected Objects 特殊设置 不确定页面和页签 //库存件