From 1c4b0159d5e09b2d753ec2ca18b2619ab3ed54b9 Mon Sep 17 00:00:00 2001 From: Rui_Li <877258667@qq.com> Date: Wed, 22 Apr 2026 10:22:45 +0800 Subject: [PATCH] =?UTF-8?q?IFS=20CommGroup3=20=E5=8F=82=E6=95=B0=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=92=8C=E5=92=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/spring/config/ShiroConfig.java | 1 + .../com/spring/ifs/api/InventoryPartApi.java | 124 ++++-------------- .../spring/ifs/bean/InventoryServiceBean.java | 23 ++++ .../ifs/bean/InventoryServiceBeanTest.java | 23 +++- .../ifs/controller/TestIfsController.java | 62 ++++++--- 5 files changed, 114 insertions(+), 119 deletions(-) diff --git a/src/main/java/com/spring/config/ShiroConfig.java b/src/main/java/com/spring/config/ShiroConfig.java index 2da8ea3f..c6ab393d 100644 --- a/src/main/java/com/spring/config/ShiroConfig.java +++ b/src/main/java/com/spring/config/ShiroConfig.java @@ -60,6 +60,7 @@ public class ShiroConfig { filterMap.put("/login", "anon"); filterMap.put("/collect/record/list/item", "anon"); filterMap.put("/collect/info/base", "anon"); + filterMap.put("/test/ifs/**", "anon"); filterMap.put("/js/**", "anon"); filterMap.put("/css/**", "anon"); filterMap.put("/pda/**", "anon"); diff --git a/src/main/java/com/spring/ifs/api/InventoryPartApi.java b/src/main/java/com/spring/ifs/api/InventoryPartApi.java index c90e5db6..66707c24 100644 --- a/src/main/java/com/spring/ifs/api/InventoryPartApi.java +++ b/src/main/java/com/spring/ifs/api/InventoryPartApi.java @@ -1122,108 +1122,36 @@ public class InventoryPartApi{ } /** - * @description: 同步库存件的时候 同时修改库存件的COMM_GROUP_3 字段 + * @description: 最新的修改 组装请求的参数 * @author LR - * @date 2026-3-9 13:42 + * @date 2026/4/21 17:59 * @version 1.0 */ - public static void modifyInventoryPartCommGroup3(Server srv, PartIfsInventory inData) throws APException { - //公共参数 - String objId = inData.getIfsRowId(); - //String objVersion = inData.getIfsRowVersion(); - //String commGroup3 = inData.getCommGroup3(); - String commGroup3 = "HOOK & LOOP"; - //后添加的参数 - /*String contract = inData.getContract(); - String partNo = inData.getPartNo().toUpperCase(); - String partDesc = inData.getPartDesc(); - String typeCode = inData.getTypeCode(); - String plannerBuyer = inData.getPlannerBuyer(); - String unitMeas = inData.getUnitMeas(); - String primeCommodity = inData.getPrimeCommodity();//主分组 - String secondCommodity = inData.getSecondCommodity();//第二分组 - String assetClass = inData.getAssetClass(); - String partStatus = inData.getPartStatus(); - String hazardCode = inData.getHazardCode(); - String accountingGroup = inData.getAccountingGroup(); - String partProductCode = inData.getPartProductCode(); - String partProductFamily = inData.getPartProductFamily(); - String typeDesignation = inData.getTypeDesignation(); - String dimQuality = inData.getDimQuality(); - String noteText = inData.getNoteText(); - String leadTimeCode = inData.getLeadTimeCode(); - String manufLeadtime = inData.getManufLeadtime(); - String expectedLeadtime = inData.getExpectedLeadtime(); - String durabilityDay = inData.getDurabilityDay(); - String countryOfOrigin = inData.getCountryOfOrigin(); - String regionOfOrigin = inData.getRegionOfOrigin(); - String customsStatNo = inData.getCustomsStatNo(); - String intrastatConvFactor = inData.getIntrastatConvFactor(); - String inventoryValuationMethod = inData.getInventoryValuationMethod();// - String inventoryPartCostLevel = inData.getInventoryPartCostLevel();// - String invoiceConsideration = inData.getInvoiceConsideration();// - String zeroCostFlag = inData.getZeroCostFlag();// - String partCostGroupId = inData.getPartCostGroupId();// - String engAttribute = inData.getEngAttribute(); - String supplyCode = inData.getSupplyCode();*/ - //入参 - Map inParam = new HashMap<>(); + public static Map modifyInventoryPartCommGroup3(Server srv, Map inParam) throws APException { //填充参数 - inParam.put("OBJID", objId); - inParam.put("CF$_CCL_COMM_GROUP_3", commGroup3); - /* inParam.put("OBJVERSION", objVersion); - inParam.put("CONTRACT", contract); // ifs域 - inParam.put("PART_NO", partNo); // 物料编码 - inParam.put("DESCRIPTION", partDesc); // 物料描述 - inParam.put("TYPE_CODE", typeCode); // 物料大类 - inParam.put("PLANNER_BUYER", plannerBuyer); // 计划购买者 - inParam.put("UNIT_MEAS", unitMeas); // 单位 - inParam.put("PRIME_COMMODITY", primeCommodity); // 主分组 - inParam.put("SECOND_COMMODITY", secondCommodity); // 副分组 - inParam.put("ASSET_CLASS", assetClass); // ASSET_CLASS - inParam.put("PART_STATUS", partStatus); // ASSET_CLASS - inParam.put("HAZARD_CODE", hazardCode); // HAZARD_CODE - inParam.put("ACCOUNTING_GROUP", accountingGroup); // 商品属性 半成品 成品 原材料 - inParam.put("PART_PRODUCT_CODE", partProductCode); // 产品代码 - inParam.put("PART_PRODUCT_FAMILY", partProductFamily); // 零部件标识 - inParam.put("TYPE_DESIGNATION", typeDesignation); // 类型标识 - inParam.put("DIM_QUALITY", dimQuality); // DIM_QUALITY - inParam.put("NOTE_TEXT", noteText); // 备注 - inParam.put("LEAD_TIME_CODE", leadTimeCode); // LEAD_TIME_CODE - inParam.put("MANUF_LEADTIME", manufLeadtime); // MANUF_LEADTIME - inParam.put("EXPECTED_LEADTIME", expectedLeadtime); // - inParam.put("DURABILITY_DAY", durabilityDay); // DURABILITY_DAY - inParam.put("COUNTRY_OF_ORIGIN", countryOfOrigin); // 国家 - inParam.put("REGION_OF_ORIGIN", regionOfOrigin); // 区域 - inParam.put("CUSTOMS_STAT_NO", customsStatNo); // CUSTOMS_STAT_NO - inParam.put("INTRASTAT_CONV_FACTOR", intrastatConvFactor); // INTRASTAT_CONV_FACTOR - inParam.put("INVENTORY_VALUATION_METHOD", inventoryValuationMethod); // INVENTORY_VALUATION_METHOD - inParam.put("INVENTORY_PART_COST_LEVEL", inventoryPartCostLevel); // INVENTORY_PART_COST_LEVEL - inParam.put("INVOICE_CONSIDERATION", invoiceConsideration); // INVOICE_CONSIDERATION - inParam.put("ZERO_COST_FLAG", zeroCostFlag); // ZERO_COST_FLAG - inParam.put("PART_COST_GROUP_ID", partCostGroupId); // PART_COST_GROUP_ID - inParam.put("ENG_ATTRIBUTE", engAttribute); // 库存件模版 - // 固定参数 - inParam.put("CATCH_UNIT_MEAS", ""); // 拼接固定值CATCH_UNIT_MEAS - inParam.put("PURCH_LEADTIME", "0"); // 拼接固定值PURCH_LEADTIME - inParam.put("MIN_DURAB_DAYS_CO_DELIV", "0"); // 拼接固定参数 - inParam.put("MIN_DURAB_DAYS_PLANNING", "0"); // 拼接固定参数 - inParam.put("MANDATORY_EXPIRATION_DATE_DB", "FALSE"); // 拼接固定参数 - inParam.put("SUPPLY_CODE", "Inventory Order"); // 拼接固定参数 - inParam.put("DOP_CONNECTION", "Automatic DOP"); // 拼接固定参数 - inParam.put("DOP_NETTING", "No Netting"); // 拼接固定参数 - inParam.put("QTY_CALC_ROUNDING", "16"); // 拼接固定参数 - inParam.put("CYCLE_PERIOD", "0"); // 拼接固定参数 - inParam.put("CYCLE_CODE_DB", "N"); // 拼接固定参数 - inParam.put("STOCK_MANAGEMENT_DB", "SYSTEM MANAGED INVENTORY"); // 固定参数 - inParam.put("SPECIAL_CONSUMPTION_TAX_DB", "FALSE"); // SPECIAL_CONSUMPTION_TAX_DB - inParam.put("CUSTOMS_DECL_NO_LEVEL", "Not Used"); // CUSTOMS_DECL_NO_LEVEL - inParam.put("SUPPLY_CODE", supplyCode); // 2025-12-22 新增IFS字段*/ - logger.info("修改库存件的COMM_GROUP_3字段 入参:{}", JSON.toJSONString(inParam)); - //执行do的操作 - Map resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "INVENTORY_PART_CFP", - "Cf_Modify__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.DO, inParam); - logger.info("修改库存件的COMM_GROUP_3字段 出参:{}", JSON.toJSONString(resultMap)); + List inParams = new ArrayList<>(); + List outParams = new ArrayList<>(); + String prefixStr = ""; + String suffixStr = ""; + StringBuilder requestStr = new StringBuilder(); + requestStr.append("CF$_CCL_COMM_GROUP_3");//commGroup3 参数 + requestStr.append(prefixStr+inParam.get("commGroup3")+suffixStr); + + //设置入参和出参 + inParams.add(new IfsParamBean("INFO", "TEXT", "")); + inParams.add(new IfsParamBean("OBJID", "TEXT", inParam.get("ifsRowId"))); + inParams.add(new IfsParamBean("ATTR_CF", "TEXT", requestStr.toString())); + inParams.add(new IfsParamBean("ATTR", "TEXT", "")); + inParams.add(new IfsParamBean("ACTION", "TEXT", "DO")); + //处理出参 + //outParams.add(new IfsParamBean("OBJID", "TEXT", "")); + + Map resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, + "INVENTORY_PART_CFP", "Cf_Modify__", inParams, outParams); + return resultMap; } + + + } diff --git a/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java b/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java index b1d0559b..4eb24fab 100644 --- a/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java @@ -989,5 +989,28 @@ public class InventoryServiceBean { return returnMap; } + /** + * @description: 测试修改Inventory Part 的CommGroup3参数 + * @author LR + * @date 2026/4/22 09:16 + * @version 1.0 + */ + public Map modifyInventoryPartCommGroup3(Server srv, PartIfsInventory inData) throws APException { + logger.info("Inventory PartCommGroup3 修改开始:"+JSON.toJSONString(inData)); + //公共参数 + String commGroup3 = inData.getCommGroup3(); + String ifsRowId = inData.getIfsRowId(); + //获取参数 + Map inParam = new HashMap<>(); + inParam.put("commGroup3", commGroup3); + inParam.put("ifsRowId", ifsRowId); + //设置ifsobjVersion 信息 + Map resultMap = InventoryPartApi.modifyInventoryPartCommGroup3(srv, inParam); + //打印日志 + logger.info("Inventory Part 修改结束:"+JSON.toJSONString(resultMap)); + //返回结果集 + return resultMap; + } + } diff --git a/src/main/java/com/spring/ifs/bean/InventoryServiceBeanTest.java b/src/main/java/com/spring/ifs/bean/InventoryServiceBeanTest.java index 1a948339..1ef739c0 100644 --- a/src/main/java/com/spring/ifs/bean/InventoryServiceBeanTest.java +++ b/src/main/java/com/spring/ifs/bean/InventoryServiceBeanTest.java @@ -3,6 +3,7 @@ package com.spring.ifs.bean; import com.alibaba.fastjson.JSON; import com.spring.ifs.api.*; import com.spring.ifs.data.*; +import com.spring.modules.part.entity.APIEntity.PartIfsInventory; import ifs.fnd.ap.APException; import ifs.fnd.ap.Server; import org.slf4j.Logger; @@ -824,6 +825,24 @@ public class InventoryServiceBeanTest { } - - + /** + * @description: 测试修改Inventory Part 的CommGroup3参数 + * @author LR + * @date 2026/4/22 09:16 + * @version 1.0 + */ + public Map modifyInventoryPartCommGroup3(Map inParam) throws APException { + logger.info("Inventory PartCommGroup3 修改开始:"+JSON.toJSONString(inParam)); + //查询的参数 + String username = inParam.get("ifsUsername"); + String password = inParam.get("ifsPassword"); + //获取连接 + Server srv = ifsServer.getIfsServer(username, password); + //设置ifsobjVersion 信息 + Map resultMap = InventoryPartApi.modifyInventoryPartCommGroup3(srv, inParam); + //打印日志 + logger.info("Inventory Part 修改结束:"+JSON.toJSONString(resultMap)); + //返回结果集 + return resultMap; + } } diff --git a/src/main/java/com/spring/ifs/controller/TestIfsController.java b/src/main/java/com/spring/ifs/controller/TestIfsController.java index e66da086..d4ac24ae 100644 --- a/src/main/java/com/spring/ifs/controller/TestIfsController.java +++ b/src/main/java/com/spring/ifs/controller/TestIfsController.java @@ -29,7 +29,7 @@ public class TestIfsController { @Autowired private MasterServiceBeanTest masterServiceBeanTest; @Autowired - private InventoryServiceBeanTest inventoryServiceBeanTest; + private InventoryServiceBeanTest inventoryServiceBean; @Autowired private BomServiceBeanTest bomServiceBean; @Autowired @@ -312,7 +312,7 @@ public class TestIfsController { public Object getInventoryPart(@RequestBody InventoryPart inData) throws APException { Map resultMap = new HashMap(); try { - InventoryPart returnRow = inventoryServiceBeanTest.getInventoryPart(inData); + InventoryPart returnRow = inventoryServiceBean.getInventoryPart(inData); resultMap.put("obj", returnRow); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); @@ -333,7 +333,7 @@ public class TestIfsController { public Object syncInventoryPart(@RequestBody InventoryPart inData) throws APException { Map resultMap = new HashMap(); try { - InventoryPart resultRow = inventoryServiceBeanTest.syncInventoryPart(inData); + InventoryPart resultRow = inventoryServiceBean.syncInventoryPart(inData); resultMap.put("obj", resultRow); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); @@ -354,7 +354,7 @@ public class TestIfsController { public Object modifyInventoryPart(@RequestBody InventoryPart inData) throws APException { Map resultMap = new HashMap(); try { - InventoryPart resultRow = inventoryServiceBeanTest.modifyInventoryPart(inData); + InventoryPart resultRow = inventoryServiceBean.modifyInventoryPart(inData); resultMap.put("obj", resultRow); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); @@ -375,7 +375,7 @@ public class TestIfsController { public Object removeInventoryPart(@RequestBody InventoryPart inData) throws APException { Map resultMap = new HashMap(); try { - inventoryServiceBeanTest.removeInventoryPart(inData); + inventoryServiceBean.removeInventoryPart(inData); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); } catch (Exception e) { @@ -395,7 +395,7 @@ public class TestIfsController { public Object modifyInventoryPartCost(@RequestBody InventoryPartConfig inData) throws APException { Map resultMap = new HashMap(); try { - InventoryPartConfig resultRow = inventoryServiceBeanTest.modifyInventoryPartCost(inData); + InventoryPartConfig resultRow = inventoryServiceBean.modifyInventoryPartCost(inData); resultMap.put("obj", resultRow); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); @@ -416,7 +416,7 @@ public class TestIfsController { public Object modifyInventoryPartPlan(@RequestBody InventoryPartPlan inData) throws APException { Map resultMap = new HashMap(); try { - InventoryPartPlan resultRow = inventoryServiceBeanTest.modifyInventoryPartPlan(inData); + InventoryPartPlan resultRow = inventoryServiceBean.modifyInventoryPartPlan(inData); resultMap.put("obj", resultRow); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); @@ -437,7 +437,7 @@ public class TestIfsController { public Object syncInventoryPartLocations(@RequestBody List inDatas) throws APException { Map resultMap = new HashMap(); try { - List returnMap = inventoryServiceBeanTest.syncInventoryPartLocations(inDatas); + List returnMap = inventoryServiceBean.syncInventoryPartLocations(inDatas); resultMap.put("obj", returnMap); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); @@ -458,7 +458,7 @@ public class TestIfsController { public Object removeInventoryPartLocation(@RequestBody InventoryPartLocation inData) throws APException { Map resultMap = new HashMap(); try { - inventoryServiceBeanTest.removeInventoryPartLocation(inData); + inventoryServiceBean.removeInventoryPartLocation(inData); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); } catch (Exception e) { @@ -478,7 +478,7 @@ public class TestIfsController { public Object modifyInventoryPartManufacture(@RequestBody InventoryPartManufacture inData) throws APException { Map resultMap = new HashMap(); try { - InventoryPartManufacture resultRow = inventoryServiceBeanTest.modifyInventoryPartManufacture(inData); + InventoryPartManufacture resultRow = inventoryServiceBean.modifyInventoryPartManufacture(inData); resultMap.put("obj", resultRow); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); @@ -499,7 +499,7 @@ public class TestIfsController { public Object getInventoryPartRevision(@RequestBody InventoryPartRevision inData) throws APException { Map resultMap = new HashMap(); try { - InventoryPartRevision resultRow = inventoryServiceBeanTest.getInventoryPartRevision(inData); + InventoryPartRevision resultRow = inventoryServiceBean.getInventoryPartRevision(inData); resultMap.put("resultRow", resultRow); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); @@ -520,7 +520,7 @@ public class TestIfsController { public Object syncInventoryPartRevision(@RequestBody InventoryPartRevision inData) throws APException { Map resultMap = new HashMap(); try { - InventoryPartRevision resultRow = inventoryServiceBeanTest.syncInventoryPartRevision(inData); + InventoryPartRevision resultRow = inventoryServiceBean.syncInventoryPartRevision(inData); resultMap.put("resultRow", resultRow); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); @@ -542,7 +542,7 @@ public class TestIfsController { public Object modifyInventoryPartRevision(@RequestBody InventoryPartRevision inData) throws APException { Map resultMap = new HashMap(); try { - InventoryPartRevision resultRow = inventoryServiceBeanTest.modifyInventoryPartRevision(inData); + InventoryPartRevision resultRow = inventoryServiceBean.modifyInventoryPartRevision(inData); resultMap.put("resultRow", resultRow); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); @@ -563,7 +563,7 @@ public class TestIfsController { public Object removeInventoryPartRevision(@RequestBody InventoryPartRevision inData) throws APException { Map resultMap = new HashMap(); try { - inventoryServiceBeanTest.removeInventoryPartRevision(inData); + inventoryServiceBean.removeInventoryPartRevision(inData); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); } catch (Exception e) { @@ -583,7 +583,7 @@ public class TestIfsController { public Object syncInventoryPartCharacteristics(@RequestBody List inDatas) throws APException { Map resultMap = new HashMap(); try { - List returnMap = inventoryServiceBeanTest.syncInventoryPartCharacteristics(inDatas); + List returnMap = inventoryServiceBean.syncInventoryPartCharacteristics(inDatas); resultMap.put("code", 200); resultMap.put("returnMap", returnMap); resultMap.put("msg", "操作成功!"); @@ -604,7 +604,7 @@ public class TestIfsController { public Object removeInventoryPartCharacteristicsByPartNo(@RequestBody InventoryPart inData) throws APException { Map resultMap = new HashMap(); try { - inventoryServiceBeanTest.removeInventoryPartCharacteristicsByPartNo(inData); + inventoryServiceBean.removeInventoryPartCharacteristicsByPartNo(inData); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); } catch (Exception e) { @@ -624,7 +624,7 @@ public class TestIfsController { public Object removeInventoryPartRelationInfo(@RequestBody InventoryPart inData) throws APException { Map resultMap = new HashMap(); try { - inventoryServiceBeanTest.removeInventoryPartRelationInfo(inData); + inventoryServiceBean.removeInventoryPartRelationInfo(inData); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); } catch (Exception e) { @@ -644,7 +644,7 @@ public class TestIfsController { public Object removeInventoryPartLocations(@RequestBody List inDatas) throws APException { Map resultMap = new HashMap(); try { - inventoryServiceBeanTest.removeInventoryPartLocations(inDatas); + inventoryServiceBean.removeInventoryPartLocations(inDatas); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); } catch (Exception e) { @@ -664,7 +664,7 @@ public class TestIfsController { public Object syncCopyPartForInventoryPart(@RequestBody CopyPart inData) throws APException { Map resultMap = new HashMap(); try { - inventoryServiceBeanTest.syncCopyPartForInventoryPart(inData); + inventoryServiceBean.syncCopyPartForInventoryPart(inData); resultMap.put("code", 200); resultMap.put("msg", "操作成功!"); } catch (Exception e) { @@ -2300,6 +2300,30 @@ public class TestIfsController { return resultMap; } + /** + * @description: 修改库存件的CommGroup3信息 测试使用 + * @author LR + * @date 2025/5/22 13:19 + * @version 1.0 + */ + @PostMapping(value = "/modifyInventoryPartCommGroup3") + public Object modifyInventoryPartCommGroup3(@RequestBody Map inData) { + Map resultMap = new HashMap(); + try { + Map returnMap = inventoryServiceBean.modifyInventoryPartCommGroup3(inData); + resultMap.put("returnMap", returnMap); + resultMap.put("code", 200); + resultMap.put("msg", "操作成功!"); + } catch (APException e) { + resultMap.put("code", 400); + resultMap.put("msg", e.getMessage()); + } + return resultMap; + } + + + +