10 changed files with 2380 additions and 0 deletions
-
328src/main/java/com/spring/ifs/api/BaseSearchApi.java
-
775src/main/java/com/spring/ifs/api/BomApi.java
-
145src/main/java/com/spring/ifs/bean/BaseSearchBean.java
-
651src/main/java/com/spring/ifs/bean/BomServiceBean.java
-
85src/main/java/com/spring/ifs/data/BaseIfsData.java
-
121src/main/java/com/spring/ifs/data/BaseSearchData.java
-
42src/main/java/com/spring/ifs/data/BomAlternative.java
-
54src/main/java/com/spring/ifs/data/BomDistribution.java
-
72src/main/java/com/spring/ifs/data/BomHeader.java
-
107src/main/java/com/spring/ifs/data/BomItem.java
@ -0,0 +1,328 @@ |
|||||
|
package com.spring.ifs.api; |
||||
|
|
||||
|
import com.spring.ifs.data.*; |
||||
|
import com.spring.ifs.utils.IfsConverterToMap; |
||||
|
import com.spring.ifs.utils.IfsPlsqlUtils; |
||||
|
import ifs.fnd.ap.APException; |
||||
|
import ifs.fnd.ap.RecordCollection; |
||||
|
import ifs.fnd.ap.Server; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @description: 基础查询的api |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 10:44 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public class BaseSearchApi { |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询IFS的加工中心 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 11:02 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static List<WorkCenter> getWorkCenterNos(Server srv, String siteCon, String ifsRowVersion) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT wc.contract site, wc.work_center_no, wc.description work_center_desc, wc.work_center_code_db,"); |
||||
|
searchSql.append(" (CASE WHEN work_center_code_db='I' THEN '内部' ELSE '外部' END) work_center_type, 100 efficiency,"); |
||||
|
searchSql.append(" TO_CHAR(NVL(wc.average_capacity, 0), 'FM99999999999999999999999999999999999999.999999') averageCapacity,"); |
||||
|
searchSql.append(" NVL(wc.utilization, 0) utilization, wc.sched_capacity_db capacity_type_db,"); |
||||
|
searchSql.append(" (CASE WHEN sched_capacity_db = 'I' THEN '无限产能' ELSE '有限产能' END) capacity_type, wc.uom um_id,"); |
||||
|
searchSql.append(" (CASE WHEN wc.objstate = 'Active' THEN 'Y' ELSE 'N' END) active, wc.note_text remark, wc.create_date created_date,"); |
||||
|
searchSql.append(" wc.PRODUCTION_LINE pro_line_no, 'N' can_create_new_roll_flag, 'N' need_setup_flag, wc.objid ifsRowId, wc.OBJVERSION ifsRowVersion"); |
||||
|
searchSql.append(" FROM ifsapp.WORK_CENTER wc"); |
||||
|
searchSql.append(" WHERE wc.work_center_code_db IN ('I','O')"); |
||||
|
//添加判断的查询条件 |
||||
|
if(!(null == siteCon || "".equals(siteCon))) { |
||||
|
searchSql.append(" AND wc.contract IN "+siteCon); |
||||
|
} |
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
if(!(null == ifsRowVersion || "".equals(ifsRowVersion))) { |
||||
|
searchSql.append(" AND wc.OBJVERSION >= :ifsRowVersion"); |
||||
|
inParam.put("ifsRowVersion", ifsRowVersion); |
||||
|
} |
||||
|
//添加排序语句 |
||||
|
searchSql.append(" ORDER BY wc.OBJVERSION, wc.contract, wc.work_center_no"); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
List<WorkCenter> resultItems = new ArrayList<>(); |
||||
|
//调用通用的处理方法 返回Map |
||||
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
||||
|
//判断是否存在数据 |
||||
|
if(resultList == null) { |
||||
|
return resultItems; |
||||
|
} |
||||
|
//获取数据转bean |
||||
|
for (int i = 0; i < resultList.size(); i++) { |
||||
|
Map<String, String> tempMap = resultList.get(i); |
||||
|
WorkCenter tempItem = new WorkCenter(); |
||||
|
//设置参数 |
||||
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
||||
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
||||
|
tempItem.setSite(tempMap.get("SITE")); |
||||
|
tempItem.setWorkCenterNo(tempMap.get("WORK_CENTER_NO")); |
||||
|
tempItem.setWorkCenterDesc(tempMap.get("WORK_CENTER_DESC")); |
||||
|
tempItem.setWorkCenterTypeDb(tempMap.get("WORK_CENTER_CODE_DB")); |
||||
|
tempItem.setWorkCenterType(tempMap.get("WORK_CENTER_TYPE")); |
||||
|
tempItem.setAverageCapacity(tempMap.get("AVERAGECAPACITY")); |
||||
|
tempItem.setEfficiency(tempMap.get("EFFICIENCY")); |
||||
|
tempItem.setUtilization(tempMap.get("UTILIZATION")); |
||||
|
tempItem.setCapacityTypeDb(tempMap.get("CAPACITY_TYPE_DB")); |
||||
|
tempItem.setCapacityType(tempMap.get("CAPACITY_TYPE")); |
||||
|
tempItem.setUmId(tempMap.get("UM_ID")); |
||||
|
tempItem.setActive(tempMap.get("ACTIVE")); |
||||
|
tempItem.setRemark(tempMap.get("REMARK")); |
||||
|
tempItem.setCreatedDate(tempMap.get("CREATED_DATE")); |
||||
|
tempItem.setProLineNo(tempMap.get("PRO_LINE_NO")); |
||||
|
tempItem.setCanCreateNewRollFlag(tempMap.get("CAN_CREATE_NEW_ROLL_FLAG")); |
||||
|
tempItem.setNeedSetupFlag(tempMap.get("NEED_SETUP_FLAG")); |
||||
|
//添加对象 |
||||
|
resultItems.add(tempItem); |
||||
|
} |
||||
|
return resultItems; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询机台的信息 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 11:23 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static List<WarehouseLocation> 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"); |
||||
|
//添加判断的查询条件 |
||||
|
if(!(null == siteCon || "".equals(siteCon))) { |
||||
|
searchSql.append(" AND wbb.contract IN "+siteCon); |
||||
|
} |
||||
|
//设置查询的入参 |
||||
|
Map<String, String> 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(" OFFSET "+startIndex+" ROWS FETCH NEXT "+pageSize+" ROWS ONLY"); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
List<WarehouseLocation> resultItems = new ArrayList<>(); |
||||
|
//调用通用的处理方法 返回Map |
||||
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
||||
|
//判断是否存在数据 |
||||
|
if(resultList == null) { |
||||
|
return resultItems; |
||||
|
} |
||||
|
//获取数据转bean |
||||
|
for (int i = 0; i < resultList.size(); i++) { |
||||
|
Map<String, String> tempMap = resultList.get(i); |
||||
|
WarehouseLocation tempItem = new WarehouseLocation(); |
||||
|
//设置参数 |
||||
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
||||
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
||||
|
tempItem.setSite(tempMap.get("SITE")); |
||||
|
tempItem.setLocationId(tempMap.get("LOCATION_ID")); |
||||
|
tempItem.setLocationName(tempMap.get("LOCATION_NAME")); |
||||
|
tempItem.setWarehouseId(tempMap.get("WAREHOUSE_ID")); |
||||
|
tempItem.setActive(tempMap.get("ACTIVE")); |
||||
|
tempItem.setCreateDate(tempMap.get("CREATE_DATE")); // 从tempMap获取值,不再直接设为null |
||||
|
tempItem.setCreateBy(tempMap.get("CREATE_BY")); // 注意:字段名也改为大写 |
||||
|
tempItem.setUpdateDate(tempMap.get("UPDATE_DATE")); // 从tempMap获取值,不再直接设为null |
||||
|
tempItem.setUpdateBy(tempMap.get("UPDATE_BY"));//直接设为null,因为SQL中对应字段是NULL |
||||
|
tempItem.setLocationType(tempMap.get("LOCATION_TYPE")); |
||||
|
//添加对象 |
||||
|
resultItems.add(tempItem); |
||||
|
} |
||||
|
return resultItems; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询人员等级 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 11:27 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static List<LaborClass> getIfsLaborClasss(Server srv, String siteCon, String ifsRowVersion) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT lc.contract site, lc.labor_class_no level_id, lc.labor_class_description level_desc,"); |
||||
|
searchSql.append(" (CASE WHEN lc.objstate = 'Active' THEN 'Y' ELSE 'N' END) active, sysdate create_date, 'Admin' create_by,"); |
||||
|
searchSql.append(" NULL update_date, NULL update_by, 100 level_cost, lc.objid ifsRowId, lc.OBJVERSION ifsRowVersion"); |
||||
|
searchSql.append(" FROM ifsapp.labor_class lc"); |
||||
|
//添加判断的查询条件 |
||||
|
if(!(null == siteCon || "".equals(siteCon))) { |
||||
|
searchSql.append(" WHERE lc.contract IN "+siteCon); |
||||
|
} |
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
if(!(null == ifsRowVersion || "".equals(ifsRowVersion))) { |
||||
|
searchSql.append(" AND lc.OBJVERSION >= :ifsRowVersion"); |
||||
|
inParam.put("ifsRowVersion", ifsRowVersion); |
||||
|
} |
||||
|
//添加排序语句 |
||||
|
searchSql.append(" ORDER BY lc.OBJVERSION, lc.contract, lc.labor_class_no"); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
List<LaborClass> resultItems = new ArrayList<>(); |
||||
|
//调用通用的处理方法 返回Map |
||||
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
||||
|
//判断是否存在数据 |
||||
|
if(resultList == null) { |
||||
|
return resultItems; |
||||
|
} |
||||
|
//获取数据转bean |
||||
|
for (int i = 0; i < resultList.size(); i++) { |
||||
|
Map<String, String> tempMap = resultList.get(i); |
||||
|
LaborClass tempItem = new LaborClass(); |
||||
|
//设置参数 |
||||
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
||||
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
||||
|
tempItem.setSite(tempMap.get("SITE")); |
||||
|
tempItem.setLevelId(tempMap.get("LEVEL_ID")); |
||||
|
tempItem.setLevelDesc(tempMap.get("LEVEL_DESC")); |
||||
|
tempItem.setActive(tempMap.get("ACTIVE")); |
||||
|
tempItem.setCreateDate(tempMap.get("CREATE_DATE")); // 从tempMap获取值 |
||||
|
tempItem.setCreateBy(tempMap.get("CREATE_BY")); // 注意:字段名也改为大写 |
||||
|
tempItem.setUpdateDate(tempMap.get("UPDATE_DATE")); // 从tempMap获取值 |
||||
|
tempItem.setUpdateBy(tempMap.get("UPDATE_BY")); // 从tempMap获取值 |
||||
|
tempItem.setLevelCost(tempMap.get("LEVEL_COST")); // 获取成本值 |
||||
|
//添加对象 |
||||
|
resultItems.add(tempItem); |
||||
|
} |
||||
|
return resultItems; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 获取物料件的数据 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 11:34 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static List<PartCatalog> getPartCatalogs(Server srv, String ifsRowVersion, int startIndex, int pageSize) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT PART_NO, DESCRIPTION partDesc, INFO_TEXT, STD_NAME_ID, UNIT_CODE,"); |
||||
|
searchSql.append(" LOT_TRACKING_CODE, WEIGHT_NET, UOM_FOR_WEIGHT_NET, VOLUME_NET, UOM_FOR_VOLUME_NET,"); |
||||
|
searchSql.append(" OBJID ifsRowId, OBJVERSION ifsRowVersion"); |
||||
|
searchSql.append(" FROM IFSAPP.PART_CATALOG pc"); |
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
if(!(null == ifsRowVersion || "".equals(ifsRowVersion))) { |
||||
|
searchSql.append(" AND pc.OBJVERSION >= :ifsRowVersion"); |
||||
|
inParam.put("ifsRowVersion", ifsRowVersion); |
||||
|
} |
||||
|
//添加排序语句 |
||||
|
searchSql.append(" ORDER BY pc.OBJVERSION, pc.PART_NO, pc.DESCRIPTION"); |
||||
|
//添加分页的查询语句 |
||||
|
searchSql.append(" OFFSET "+startIndex+" ROWS FETCH NEXT "+pageSize+" ROWS ONLY"); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
List<PartCatalog> resultItems = new ArrayList<>(); |
||||
|
//调用通用的处理方法 返回Map |
||||
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
||||
|
//获取数据转bean |
||||
|
for (int i = 0; i < resultList.size(); i++) { |
||||
|
Map<String, String> tempMap = resultList.get(i); |
||||
|
PartCatalog tempItem = new PartCatalog(); |
||||
|
//设置参数 |
||||
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
||||
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
||||
|
tempItem.setPartNo(tempMap.get("PART_NO")); |
||||
|
tempItem.setPartDesc(tempMap.get("PARTDESC")); // 注意:使用小写的partDesc以匹配属性名 |
||||
|
tempItem.setInfoText(tempMap.get("INFO_TEXT")); |
||||
|
tempItem.setStdNameId(tempMap.get("STD_NAME_ID")); |
||||
|
tempItem.setUnitCode(tempMap.get("UNIT_CODE")); |
||||
|
tempItem.setLotTrackingCode(tempMap.get("LOT_TRACKING_CODE")); |
||||
|
tempItem.setWeightNet(tempMap.get("WEIGHT_NET")); |
||||
|
tempItem.setUomForWeightNet(tempMap.get("UOM_FOR_WEIGHT_NET")); |
||||
|
tempItem.setVolumeNet(tempMap.get("VOLUME_NET")); |
||||
|
tempItem.setUomForVolumeNet(tempMap.get("UOM_FOR_VOLUME_NET")); |
||||
|
//添加对象 |
||||
|
resultItems.add(tempItem); |
||||
|
} |
||||
|
return resultItems; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询库存件的属性值 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 11:38 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static List<InventoryValue> getInventoryValues(Server srv, String siteCon, String ifsRowVersion, int startIndex, int pageSize) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion, CONTRACT site, PART_NO, CONFIGURATION_ID, LOT_BATCH_NO, SERIAL_NO,"); |
||||
|
searchSql.append(" ifsapp.Inventory_Part_Unit_Cost_API.Get_Inventory_Value_By_Method(CONTRACT,PART_NO,CONFIGURATION_ID,LOT_BATCH_NO,SERIAL_NO) inventoryValue"); |
||||
|
searchSql.append(" FROM ifsapp.INVENTORY_PART_UNIT_COST_SUM pcs"); |
||||
|
searchSql.append(" WHERE pcs.CONFIGURATION_ID = '*'"); |
||||
|
//添加判断的查询条件 |
||||
|
if(!(null == siteCon || "".equals(siteCon))) { |
||||
|
searchSql.append(" AND pcs.contract IN "+siteCon); |
||||
|
} |
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
if(!(null == ifsRowVersion || "".equals(ifsRowVersion))) { |
||||
|
searchSql.append(" AND pcs.OBJVERSION >= :ifsRowVersion"); |
||||
|
inParam.put("ifsRowVersion", ifsRowVersion); |
||||
|
} |
||||
|
//添加排序语句 |
||||
|
searchSql.append(" ORDER BY pcs.OBJVERSION, pcs.contract, pcs.PART_NO"); |
||||
|
//添加分页的查询语句 |
||||
|
searchSql.append(" OFFSET "+startIndex+" ROWS FETCH NEXT "+pageSize+" ROWS ONLY"); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
List<InventoryValue> resultItems = new ArrayList<>(); |
||||
|
//调用通用的处理方法 返回Map |
||||
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
||||
|
//获取数据转bean |
||||
|
for (int i = 0; i < resultList.size(); i++) { |
||||
|
Map<String, String> tempMap = resultList.get(i); |
||||
|
InventoryValue tempItem = new InventoryValue(); |
||||
|
//设置参数 |
||||
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
||||
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
||||
|
tempItem.setSite(tempMap.get("SITE")); |
||||
|
tempItem.setPartNo(tempMap.get("PART_NO")); |
||||
|
tempItem.setConfigurationId(tempMap.get("CONFIGURATION_ID")); |
||||
|
tempItem.setLotBatchNo(tempMap.get("LOT_BATCH_NO")); |
||||
|
tempItem.setSerialNo(tempMap.get("SERIAL_NO")); |
||||
|
tempItem.setInventoryValue(tempMap.get("INVENTORYVALUE")); |
||||
|
//添加对象 |
||||
|
resultItems.add(tempItem); |
||||
|
} |
||||
|
return resultItems; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,775 @@ |
|||||
|
package com.spring.ifs.api; |
||||
|
|
||||
|
import com.spring.ifs.data.*; |
||||
|
import com.spring.ifs.utils.IfsConverterToMap; |
||||
|
import com.spring.ifs.utils.IfsPlsqlUtils; |
||||
|
import com.spring.modules.base.utils.DateUtils; |
||||
|
import ifs.fnd.ap.*; |
||||
|
|
||||
|
import java.util.*; |
||||
|
|
||||
|
/** |
||||
|
* @description: Bom的api |
||||
|
* @author LR |
||||
|
* @date 2024/12/9 10:56 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public class BomApi { |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询Bom Header |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 14:45 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> getBomHeader(Server srv, String contract, String partNo, String engChgLevel, String bomType) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion,"); |
||||
|
searchSql.append(" CONTRACT, PART_NO, BOM_TYPE, ENG_CHG_LEVEL, NOTE_TEXT"); |
||||
|
searchSql.append(" FROM IFSAPP.PROD_STRUCTURE_HEAD"); |
||||
|
searchSql.append(" WHERE CONTRACT = :contract AND PART_NO = :partNo AND ENG_CHG_LEVEL = :engChgLevel AND BOM_TYPE = :bomType"); |
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
inParam.put("contract", contract); |
||||
|
inParam.put("partNo", partNo); |
||||
|
inParam.put("engChgLevel", engChgLevel); |
||||
|
inParam.put("bomType", bomType); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
Record recordData = recordCollection.get(0); |
||||
|
Map<String, String> resultMap = IfsConverterToMap.ConverterIfsToMap(recordData); |
||||
|
return resultMap; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 按照料号查询Bom Header的集合 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 17:40 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static List<BomHeader> getBomHeadersByPartNo(Server srv, String contract, String partNo) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion,"); |
||||
|
searchSql.append(" CONTRACT, PART_NO, BOM_TYPE, ENG_CHG_LEVEL, NOTE_TEXT"); |
||||
|
searchSql.append(" FROM IFSAPP.PROD_STRUCTURE_HEAD"); |
||||
|
searchSql.append(" WHERE CONTRACT = :contract AND PART_NO = :partNo"); |
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
inParam.put("contract", contract); |
||||
|
inParam.put("partNo", partNo); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
List<BomHeader> resultItems = new ArrayList<>(); |
||||
|
//调用通用的处理方法 返回Map |
||||
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
||||
|
//判断是否存在数据 |
||||
|
if(resultList == null) { |
||||
|
return resultItems; |
||||
|
} |
||||
|
//获取数据转bean |
||||
|
for (int i = 0; i < resultList.size(); i++) { |
||||
|
Map<String, String> tempMap = resultList.get(i); |
||||
|
BomHeader tempItem = new BomHeader(); |
||||
|
//设置参数 |
||||
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
||||
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
||||
|
tempItem.setContract((String) tempMap.get("CONTRACT")); |
||||
|
tempItem.setPartNo((String) tempMap.get("PART_NO")); |
||||
|
tempItem.setBomType((String) tempMap.get("BOM_TYPE")); |
||||
|
tempItem.setEngChgLevel((String) tempMap.get("ENG_CHG_LEVEL")); |
||||
|
tempItem.setNoteText((String) tempMap.get("NOTE_TEXT")); |
||||
|
//添加对象 |
||||
|
resultItems.add(tempItem); |
||||
|
} |
||||
|
return resultItems; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 插入Bom Header的主表 |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 15:08 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> insertBomHeader(Server srv, BomHeader inData) throws APException { |
||||
|
//公共参数 |
||||
|
String contract = inData.getContract();// 域 |
||||
|
String partNo = inData.getPartNo();// 物料编码 |
||||
|
String engChgLevel = inData.getEngChgLevel();// 版本 |
||||
|
String bomType = inData.getBomType();// 分类 |
||||
|
String effPhaseInDate = inData.getEffPhaseInDate().substring(0, 10)+"-00.00.00";// 启用时间-年月日 |
||||
|
String effPhaseOutDate = inData.getEffPhaseOutDate();// 结束时间-年月日 |
||||
|
if(effPhaseOutDate == null || effPhaseOutDate.equals("")) { |
||||
|
effPhaseOutDate = ""; |
||||
|
}else { |
||||
|
effPhaseOutDate = effPhaseOutDate+"-00.00.00"; |
||||
|
} |
||||
|
//判断是否存在问题 |
||||
|
String noteText = inData.getNoteText();// 备注 |
||||
|
String createDate = DateUtils.getStringDate(new Date(), "yyyy-MM-dd")+"-00.00.00";//创建的时间 |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ""); |
||||
|
inParam.put("OBJVERSION", ""); |
||||
|
inParam.put("PART_NO", partNo); // 物料编码 |
||||
|
inParam.put("CONTRACT", contract); // 域 |
||||
|
inParam.put("ENG_CHG_LEVEL", engChgLevel); // 物料的版本 |
||||
|
inParam.put("BOM_TYPE", bomType); // BOM类型 |
||||
|
inParam.put("EFF_PHASE_IN_DATE", effPhaseInDate); // 启用日期 |
||||
|
inParam.put("EFF_PHASE_OUT_DATE", effPhaseOutDate); // 到期时间 |
||||
|
inParam.put("NOTE_TEXT", noteText); // 备注 |
||||
|
inParam.put("CREATE_DATE", createDate); // 创建日期 |
||||
|
|
||||
|
//执行存储过程 获取结果集 |
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_HEAD_API", |
||||
|
"NEW__", PlsqlBaseMethodType.NEW, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_HEAD_API", |
||||
|
"NEW__", PlsqlBaseMethodType.NEW, PlsqlBaseMethodAction.DO, inParam); |
||||
|
//返回结果集 |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 修改Bom Header的主表信息 |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 15:32 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> modifyBomHeader(Server srv, BomHeader inData) throws APException { |
||||
|
//公共参数 |
||||
|
String ifsRowId = inData.getIfsRowId(); |
||||
|
String ifsRowVersion = inData.getIfsRowVersion(); |
||||
|
String effPhaseInDate = inData.getEffPhaseInDate().substring(0, 10)+"-00.00.00";// 启用时间-年月日 |
||||
|
String effPhaseOutDate = inData.getEffPhaseOutDate();// 结束时间-年月日 |
||||
|
if(effPhaseOutDate == null || effPhaseOutDate.equals("")) { |
||||
|
effPhaseOutDate = ""; |
||||
|
}else { |
||||
|
effPhaseOutDate = effPhaseOutDate+"-00.00.00"; |
||||
|
} |
||||
|
//判断是否存在问题 |
||||
|
String noteText = inData.getNoteText();// 备注 |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ifsRowId); |
||||
|
inParam.put("OBJVERSION", ifsRowVersion); |
||||
|
inParam.put("EFF_PHASE_IN_DATE", effPhaseInDate); // 启用日期 |
||||
|
inParam.put("EFF_PHASE_OUT_DATE", effPhaseOutDate); // 到期时间 |
||||
|
inParam.put("NOTE_TEXT", noteText); // 备注 |
||||
|
|
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_HEAD_API", |
||||
|
"MODIFY__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_HEAD_API", |
||||
|
"MODIFY__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.DO, inParam); |
||||
|
//返回结果集 |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 删除Bom的主表信息 |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 15:33 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> removeBomHeader(Server srv, BomHeader inData) throws APException { |
||||
|
//公共参数 |
||||
|
String ifsRowId = inData.getIfsRowId(); |
||||
|
String ifsRowVersion = inData.getIfsRowVersion(); |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ifsRowId); |
||||
|
inParam.put("OBJVERSION", ifsRowVersion); |
||||
|
|
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_HEAD_API", |
||||
|
"REMOVE__", PlsqlBaseMethodType.REMOVE, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_HEAD_API", |
||||
|
"REMOVE__", PlsqlBaseMethodType.REMOVE, PlsqlBaseMethodAction.DO, inParam); |
||||
|
//返回结果集 |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询Bom的替代 |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 14:48 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> getBomAlternative(Server srv, String contract, String partNo, String engChgLevel, String bomType, String alternativeNo) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion,"); |
||||
|
searchSql.append(" CONTRACT, PART_NO, BOM_TYPE, ENG_CHG_LEVEL, ALTERNATIVE_NO, NOTE_TEXT"); |
||||
|
searchSql.append(" FROM IFSAPP.PROD_STRUCT_ALTERNATE"); |
||||
|
searchSql.append(" WHERE CONTRACT = :contract AND PART_NO = :partNo AND ENG_CHG_LEVEL = :engChgLevel AND BOM_TYPE = :bomType AND ALTERNATIVE_NO = :alternativeNo"); |
||||
|
|
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
inParam.put("contract", contract); |
||||
|
inParam.put("partNo", partNo); |
||||
|
inParam.put("engChgLevel", engChgLevel); |
||||
|
inParam.put("bomType", bomType); |
||||
|
inParam.put("alternativeNo", alternativeNo); |
||||
|
|
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
Record recordData = recordCollection.get(0); |
||||
|
Map<String, String> resultMap = IfsConverterToMap.ConverterIfsToMap(recordData); |
||||
|
return resultMap; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 插入Bom Alternative |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 15:45 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> insertBomAlternative(Server srv, BomAlternative inData) throws APException { |
||||
|
//公共参数 |
||||
|
String contract = inData.getContract();// 域 |
||||
|
String partNo = inData.getPartNo();// 物料编码 |
||||
|
String engChgLevel = inData.getEngChgLevel();// 版本 |
||||
|
String bomType = inData.getBomType();// 分类 |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
String alternativeDesc = inData.getAlternativeDesc(); |
||||
|
//判断是否存在问题 |
||||
|
String noteText = inData.getNoteText();// 备注 |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ""); |
||||
|
inParam.put("OBJVERSION", ""); |
||||
|
inParam.put("PART_NO", partNo); // 物料编码 |
||||
|
inParam.put("CONTRACT", contract); // 域 |
||||
|
inParam.put("ENG_CHG_LEVEL", engChgLevel); // 物料的版本 |
||||
|
inParam.put("BOM_TYPE", bomType); // BOM类型 |
||||
|
inParam.put("ALTERNATIVE_NO", alternativeNo); // 替代编码 |
||||
|
inParam.put("ALTERNATIVE_DESCRIPTION", alternativeDesc); // 替代编码描述 |
||||
|
inParam.put("USE_COST_DISTRIBUTION_DB", "STANDARD"); // 固定值 |
||||
|
inParam.put("NOTE_TEXT", noteText); // 备注 |
||||
|
|
||||
|
|
||||
|
//执行存储过程 获取结果集 |
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCT_ALTERNATE_API", |
||||
|
"NEW__", PlsqlBaseMethodType.NEW, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCT_ALTERNATE_API", |
||||
|
"NEW__", PlsqlBaseMethodType.NEW, PlsqlBaseMethodAction.DO, inParam); |
||||
|
//返回结果集 |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 修改Bom 的替代信息 |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 15:47 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> modifyBomAlternative(Server srv, BomAlternative inData) throws APException { |
||||
|
//公共参数 |
||||
|
String ifsRowId = inData.getIfsRowId();// 域 |
||||
|
String ifsRowVersion = inData.getIfsRowVersion();// 物料编码 |
||||
|
String alternativeDesc = inData.getAlternativeDesc(); |
||||
|
String noteText = inData.getNoteText();// 备注 |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ifsRowId); |
||||
|
inParam.put("OBJVERSION", ifsRowVersion); |
||||
|
inParam.put("ALTERNATIVE_DESCRIPTION", alternativeDesc); // 替代编码描述 |
||||
|
inParam.put("NOTE_TEXT", noteText); // 备注 |
||||
|
|
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCT_ALTERNATE_API", |
||||
|
"MODIFY__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCT_ALTERNATE_API", |
||||
|
"MODIFY__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.DO, inParam); |
||||
|
//返回结果集 |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 删除Bom Alternative |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 15:51 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static void removeBomAlternative(Server srv, BomAlternative inData) throws APException { |
||||
|
//公共参数 |
||||
|
String ifsRowId = inData.getIfsRowId();// 域 |
||||
|
String ifsRowVersion = inData.getIfsRowVersion();// 物料编码 |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ifsRowId); |
||||
|
inParam.put("OBJVERSION", ifsRowVersion); |
||||
|
|
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCT_ALTERNATE_API", |
||||
|
"REMOVE__", PlsqlBaseMethodType.REMOVE, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCT_ALTERNATE_API", |
||||
|
"REMOVE__", PlsqlBaseMethodType.REMOVE, PlsqlBaseMethodAction.DO, inParam); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: Build Bom的信息 |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 15:53 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> buildBomAlternative(Server srv, BomAlternative inData) throws APException { |
||||
|
//公共参数 |
||||
|
String ifsRowId = inData.getIfsRowId();// 域 |
||||
|
String ifsRowVersion = inData.getIfsRowVersion();// 物料编码 |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ifsRowId); |
||||
|
inParam.put("OBJVERSION", ifsRowVersion); |
||||
|
|
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCT_ALTERNATE_API", |
||||
|
"PLAN__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCT_ALTERNATE_API", |
||||
|
"PLAN__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.DO, inParam); |
||||
|
//返回结果集 |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: retire Bom Alternative |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 15:55 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> retireBomAlternative(Server srv, BomAlternative inData) throws APException { |
||||
|
//公共参数 |
||||
|
String ifsRowId = inData.getIfsRowId();// 域 |
||||
|
String ifsRowVersion = inData.getIfsRowVersion();// 物料编码 |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ifsRowId); |
||||
|
inParam.put("OBJVERSION", ifsRowVersion); |
||||
|
|
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCT_ALTERNATE_API", |
||||
|
"RETIRE__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCT_ALTERNATE_API", |
||||
|
"RETIRE__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.DO, inParam); |
||||
|
//返回结果集 |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 获取Bom Item |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 16:12 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> getBomItem(Server srv, String contract, String partNo, String engChgLevel, String bomType, String alternativeNo, String lineItemNo) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion, PART_NO, CONTRACT, ENG_CHG_LEVEL, BOM_TYPE, ALTERNATIVE_NO,"); |
||||
|
searchSql.append(" LINE_ITEM_NO, LINE_SEQUENCE, COMPONENT_PART, QTY_PER_ASSEMBLY, ISSUE_TYPE, OPERATION_NO,"); |
||||
|
searchSql.append(" COMPONENT_SCRAP, SHRINKAGE_FACTOR"); |
||||
|
searchSql.append(" FROM IFSAPP.PROD_STRUCTURE"); |
||||
|
searchSql.append(" WHERE CONTRACT = :contract AND PART_NO = :partNo AND ENG_CHG_LEVEL = :engChgLevel AND BOM_TYPE = :bomType"); |
||||
|
searchSql.append(" AND ALTERNATIVE_NO = :alternativeNo AND LINE_ITEM_NO = :lineItemNo"); |
||||
|
|
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
inParam.put("contract", contract); |
||||
|
inParam.put("partNo", partNo); |
||||
|
inParam.put("engChgLevel", engChgLevel); |
||||
|
inParam.put("bomType", bomType); |
||||
|
inParam.put("alternativeNo", alternativeNo); |
||||
|
inParam.put("lineItemNo", lineItemNo); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
Record recordData = recordCollection.get(0); |
||||
|
Map<String, String> resultMap = IfsConverterToMap.ConverterIfsToMap(recordData); |
||||
|
return resultMap; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 获取Bom Items |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 16:16 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static List<Map<String, String>> getBomItems(Server srv, String contract, String partNo, String engChgLevel, String bomType, String alternativeNo) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion, PART_NO, CONTRACT, ENG_CHG_LEVEL, BOM_TYPE, ALTERNATIVE_NO,"); |
||||
|
searchSql.append(" LINE_ITEM_NO, LINE_SEQUENCE, COMPONENT_PART, QTY_PER_ASSEMBLY, ISSUE_TYPE, OPERATION_NO,"); |
||||
|
searchSql.append(" COMPONENT_SCRAP, SHRINKAGE_FACTOR"); |
||||
|
searchSql.append(" FROM IFSAPP.PROD_STRUCTURE"); |
||||
|
searchSql.append(" WHERE CONTRACT = :contract AND PART_NO = :partNo AND ENG_CHG_LEVEL = :engChgLevel AND BOM_TYPE = :bomType"); |
||||
|
searchSql.append(" AND ALTERNATIVE_NO = :alternativeNo"); |
||||
|
|
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
inParam.put("contract", contract); |
||||
|
inParam.put("partNo", partNo); |
||||
|
inParam.put("engChgLevel", engChgLevel); |
||||
|
inParam.put("bomType", bomType); |
||||
|
inParam.put("alternativeNo", alternativeNo); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
||||
|
return resultList; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询 Bom Item集合 |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 9:48 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static List<BomItem> getBomItems(Server srv, String contract, String partNo, String engChgLevel, String bomType, |
||||
|
String alternativeNo, String lineItemNo) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion, PART_NO, CONTRACT, ENG_CHG_LEVEL, BOM_TYPE, ALTERNATIVE_NO,"); |
||||
|
searchSql.append(" LINE_ITEM_NO, LINE_SEQUENCE, COMPONENT_PART, QTY_PER_ASSEMBLY, ISSUE_TYPE, OPERATION_NO,"); |
||||
|
searchSql.append(" COMPONENT_SCRAP, SHRINKAGE_FACTOR"); |
||||
|
searchSql.append(" FROM IFSAPP.PROD_STRUCTURE"); |
||||
|
searchSql.append(" WHERE CONTRACT = :contract AND PART_NO = :partNo AND ENG_CHG_LEVEL = :engChgLevel AND BOM_TYPE = :bomType"); |
||||
|
searchSql.append(" AND ALTERNATIVE_NO = :alternativeNo"); |
||||
|
|
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
inParam.put("contract", contract); |
||||
|
inParam.put("partNo", partNo); |
||||
|
inParam.put("engChgLevel", engChgLevel); |
||||
|
inParam.put("bomType", bomType); |
||||
|
inParam.put("alternativeNo", alternativeNo); |
||||
|
//判断是否需要添加查询的条件 |
||||
|
if(!(lineItemNo == null || "".equals(lineItemNo))) { |
||||
|
inParam.put("lineItemNo", lineItemNo); |
||||
|
searchSql.append(" AND LINE_ITEM_NO = :lineItemNo"); |
||||
|
} |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
List<BomItem> resultItems = new ArrayList<>(); |
||||
|
//调用通用的处理方法 返回Map |
||||
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
||||
|
//判断是否存在数据 |
||||
|
if(resultList == null) { |
||||
|
return resultItems; |
||||
|
} |
||||
|
//获取数据转bean |
||||
|
for (int i = 0; i < resultList.size(); i++) { |
||||
|
Map<String, String> tempMap = resultList.get(i); |
||||
|
BomItem tempItem = new BomItem(); |
||||
|
//设置参数 |
||||
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
||||
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
||||
|
tempItem.setPartNo(tempMap.get("PART_NO")); |
||||
|
tempItem.setContract(tempMap.get("CONTRACT")); |
||||
|
tempItem.setEngChgLevel(tempMap.get("ENG_CHG_LEVEL")); |
||||
|
tempItem.setBomType(tempMap.get("BOM_TYPE")); |
||||
|
tempItem.setAlternativeNo(tempMap.get("ALTERNATIVE_NO")); |
||||
|
tempItem.setLineItemNo(tempMap.get("LINE_ITEM_NO")); |
||||
|
tempItem.setLineSequence(tempMap.get("LINE_SEQUENCE")); |
||||
|
tempItem.setComponentPart(tempMap.get("COMPONENT_PART")); |
||||
|
tempItem.setQtyPerAssembly(tempMap.get("QTY_PER_ASSEMBLY")); |
||||
|
tempItem.setIssueType(tempMap.get("ISSUE_TYPE")); |
||||
|
tempItem.setOperationNo(tempMap.get("OPERATION_NO")); |
||||
|
tempItem.setComponentScrap(tempMap.get("COMPONENT_SCRAP")); |
||||
|
tempItem.setShrinkageFactor(tempMap.get("SHRINKAGE_FACTOR")); |
||||
|
//添加对象 |
||||
|
resultItems.add(tempItem); |
||||
|
} |
||||
|
return resultItems; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 插入Bom Item |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 16:17 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> insertBomItem(Server srv, BomItem inData) throws APException { |
||||
|
//公共参数 |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo();// 物料编码 |
||||
|
String engChgLevel = inData.getEngChgLevel();// 版本 |
||||
|
String bomType = inData.getBomType();// 分类 |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
String operationNo = inData.getOperationNo(); |
||||
|
String lineItemNo = inData.getLineItemNo(); |
||||
|
String sequenceNo = inData.getLineSequence(); |
||||
|
//判断是否存在问题 |
||||
|
String componentPart = inData.getComponentPart();// |
||||
|
String qtyPerAssembly = inData.getQtyPerAssembly(); |
||||
|
String issueType = inData.getIssueType(); |
||||
|
String componentScrap = inData.getComponentScrap(); |
||||
|
String shrinkageFactor = inData.getShrinkageFactor(); |
||||
|
String noteText = inData.getNoteText(); |
||||
|
String consumptionItem = inData.getConsumptionItem(); |
||||
|
String createDate = DateUtils.getStringDate(new Date(), "yyyy-MM-dd")+"-00.00.00"; |
||||
|
String lastActivityDate = DateUtils.getStringDate(new Date(), "yyyy-MM-dd")+"-00.00.00"; |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ""); |
||||
|
inParam.put("OBJVERSION", ""); |
||||
|
inParam.put("PART_NO", partNo); // 物料编码 |
||||
|
inParam.put("CONTRACT", contract); // 域 |
||||
|
inParam.put("ENG_CHG_LEVEL", engChgLevel); // 物料的版本 |
||||
|
inParam.put("BOM_TYPE", bomType); // BOM类型 |
||||
|
inParam.put("ALTERNATIVE_NO", alternativeNo); // 替代编码 |
||||
|
inParam.put("LINE_ITEM_NO", lineItemNo); // 行号 |
||||
|
inParam.put("LINE_SEQUENCE", sequenceNo); // 序号 |
||||
|
inParam.put("COMPONENT_PART", componentPart); // 子零件 |
||||
|
inParam.put("QTY_PER_ASSEMBLY", qtyPerAssembly); // 单位用量 |
||||
|
inParam.put("ISSUE_TYPE", issueType); // 域 |
||||
|
inParam.put("COMPONENT_SCRAP", componentScrap); // 报废 |
||||
|
inParam.put("SHRINKAGE_FACTOR", shrinkageFactor); // 损耗率 |
||||
|
inParam.put("NOTE_TEXT", noteText); // 备注 |
||||
|
inParam.put("OPERATION_NO", operationNo); // 工序 |
||||
|
inParam.put("ISSUE_PLANNED_SCRAP_DB", "TRUE"); // 固定值 |
||||
|
inParam.put("ISSUE_OVERREPORTED_QTY_DB", "FALSE"); // 固定值 |
||||
|
inParam.put("CONSUMPTION_ITEM", consumptionItem); // 消耗项目 |
||||
|
inParam.put("LEADTIME_OFFSET", "0"); // 固定值 |
||||
|
inParam.put("PROMISE_PLANNED", "Promised"); // 固定值 |
||||
|
inParam.put("PHANTOM_CONSUME", "Not Phantom Consume"); // 固定值 |
||||
|
inParam.put("CHARGED_ITEM", "Item not charged"); // 固定值 |
||||
|
inParam.put("CREATE_DATE", createDate); // 创建时间 |
||||
|
inParam.put("LAST_ACTIVITY_DATE", lastActivityDate); // 最近更新时间 |
||||
|
inParam.put("PURCHASE_COMP_BACKFLUSH_DB", "FALSE"); // 固定值 |
||||
|
inParam.put("STD_PLANNED_ITEM", "1"); // 固定值 |
||||
|
inParam.put("OPER_COST_DISTRIBUTION", "0"); // 固定值 |
||||
|
inParam.put("GEN_OH_COST_DISTRIBUTION", "0"); // 固定值 |
||||
|
inParam.put("EXCLUDE_FROM_AS_BUILT_DB", "FALSE"); // 固定值 |
||||
|
inParam.put("BY_PROD_AS_SUPPLY_IN_MRP_DB", "FALSE"); // 固定值 |
||||
|
inParam.put("STOP_BOM_EXPLOSION_DB", "FALSE"); // 固定值 |
||||
|
inParam.put("LOT_BATCH_ORIGIN_DB", "FALSE"); // 固定值 |
||||
|
|
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_API", |
||||
|
"NEW__", PlsqlBaseMethodType.NEW, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_API", |
||||
|
"NEW__", PlsqlBaseMethodType.NEW, PlsqlBaseMethodAction.DO, inParam); |
||||
|
//返回结果集 |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 修改 Bom Item |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 16:22 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> modifyBomItem(Server srv, BomItem inData) throws APException { |
||||
|
//公共参数 |
||||
|
String ifsRowId = inData.getIfsRowId();// |
||||
|
String ifsRowVersion = inData.getIfsRowVersion();// |
||||
|
String sequenceNo = inData.getLineSequence(); |
||||
|
String operationNo = inData.getOperationNo(); |
||||
|
//判断是否存在问题 |
||||
|
String componentPart = inData.getComponentPart();// |
||||
|
String qtyPerAssembly = inData.getQtyPerAssembly(); |
||||
|
String issueType = inData.getIssueType(); |
||||
|
String componentScrap = inData.getComponentScrap(); |
||||
|
String shrinkageFactor = inData.getShrinkageFactor(); |
||||
|
String noteText = inData.getNoteText(); |
||||
|
String consumptionItem = inData.getConsumptionItem(); |
||||
|
String createDate = DateUtils.getStringDate(new Date(), "yyyy-MM-dd")+"-00.00.00"; |
||||
|
String lastActivityDate = DateUtils.getStringDate(new Date(), "yyyy-MM-dd")+"-00.00.00"; |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ifsRowId); |
||||
|
inParam.put("OBJVERSION", ifsRowVersion); |
||||
|
inParam.put("LINE_SEQUENCE", sequenceNo); // 序号 |
||||
|
inParam.put("COMPONENT_PART", componentPart); // 子零件 |
||||
|
inParam.put("QTY_PER_ASSEMBLY", qtyPerAssembly); // 单位用量 |
||||
|
inParam.put("ISSUE_TYPE", issueType); // 域 |
||||
|
inParam.put("COMPONENT_SCRAP", componentScrap); // 报废 |
||||
|
inParam.put("SHRINKAGE_FACTOR", shrinkageFactor); // 损耗率 |
||||
|
inParam.put("NOTE_TEXT", noteText); // 备注 |
||||
|
inParam.put("CONSUMPTION_ITEM", consumptionItem); // 消耗项目 |
||||
|
inParam.put("CREATE_DATE", createDate); // 创建时间 |
||||
|
inParam.put("OPERATION_NO", operationNo); // 工序 |
||||
|
inParam.put("LAST_ACTIVITY_DATE", lastActivityDate); // 最近更新时间 |
||||
|
|
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_API", |
||||
|
"MODIFY__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_API", |
||||
|
"MODIFY__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.DO, inParam); |
||||
|
//返回结果集 |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 删除 Bom Item |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 16:24 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static void removeBomItem(Server srv, BomItem inData) throws APException { |
||||
|
//公共参数 |
||||
|
//公共参数 |
||||
|
String ifsRowId = inData.getIfsRowId();// |
||||
|
String ifsRowVersion = inData.getIfsRowVersion();// |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ifsRowId); |
||||
|
inParam.put("OBJVERSION", ifsRowVersion); |
||||
|
|
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_API", |
||||
|
"REMOVE__", PlsqlBaseMethodType.REMOVE, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "PROD_STRUCTURE_API", |
||||
|
"REMOVE__", PlsqlBaseMethodType.REMOVE, PlsqlBaseMethodAction.DO, inParam); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询副产品的信息 |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 16:27 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> getBomDistribution(Server srv, String contract, String partNo, String engChgLevel, String bomType, String alternativeNo, |
||||
|
String componentLineItemNo, String byProdLineItemNo) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion, CONTRACT contract, PART_NO partNo, ENG_CHG_LEVEL engChgLevel,"); |
||||
|
searchSql.append(" BOM_TYPE bomType, ALTERNATIVE_NO alternativeNo, BYPROD_LINE_ITEM_NO byProdLineItemNo,"); |
||||
|
searchSql.append(" IFSAPP.MANUF_STRUCTURE_API.Get_Component_Part(contract,part_no,eng_chg_level,bom_type,alternative_no,BYPROD_LINE_ITEM_NO) byProductPartNo,"); |
||||
|
searchSql.append(" COMPONENT_LINE_ITEM_NO componentLineItemNo,"); |
||||
|
searchSql.append(" IFSAPP.MANUF_STRUCTURE_API.Get_Component_Part(contract,part_no,eng_chg_level,bom_type,alternative_no,COMPONENT_LINE_ITEM_NO) componentPart,"); |
||||
|
searchSql.append(" ITEM_COST_DISTRIBUTION itemCostDistribution"); |
||||
|
searchSql.append(" FROM IFSAPP.MANUF_STRUCT_COST_DISTRIB"); |
||||
|
searchSql.append(" WHERE CONTRACT = :contract AND PART_NO = :partNo AND ENG_CHG_LEVEL = :engChgLevel AND BOM_TYPE = :bomType AND ALTERNATIVE_NO = :alternativeNo"); |
||||
|
searchSql.append(" AND COMPONENT_LINE_ITEM_NO = :componentLineItemNo AND BYPROD_LINE_ITEM_NO = :byProdLineItemNo"); |
||||
|
|
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
inParam.put("contract", contract); |
||||
|
inParam.put("partNo", partNo); |
||||
|
inParam.put("engChgLevel", engChgLevel); |
||||
|
inParam.put("bomType", bomType); |
||||
|
inParam.put("alternativeNo", alternativeNo); |
||||
|
inParam.put("componentLineItemNo", componentLineItemNo); |
||||
|
inParam.put("byProdLineItemNo", byProdLineItemNo); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
Record record = recordCollection.get(0); |
||||
|
Map<String, String> resultMap = IfsConverterToMap.ConverterIfsToMap(record); |
||||
|
return resultMap; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询Bom 副产品的所有信息 |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 16:30 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static List<Map<String, String>> getBomDistributions(Server srv, String contract, String partNo, String engChgLevel, String bomType, String alternativeNo) throws APException { |
||||
|
StringBuilder searchSql = new StringBuilder(); |
||||
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion, CONTRACT contract, PART_NO partNo, ENG_CHG_LEVEL engChgLevel,"); |
||||
|
searchSql.append(" BOM_TYPE bomType, ALTERNATIVE_NO alternativeNo, BYPROD_LINE_ITEM_NO byProdLineItemNo,"); |
||||
|
searchSql.append(" IFSAPP.MANUF_STRUCTURE_API.Get_Component_Part(contract,part_no,eng_chg_level,bom_type,alternative_no,BYPROD_LINE_ITEM_NO) byProductPartNo,"); |
||||
|
searchSql.append(" COMPONENT_LINE_ITEM_NO componentLineItemNo,"); |
||||
|
searchSql.append(" IFSAPP.MANUF_STRUCTURE_API.Get_Component_Part(contract,part_no,eng_chg_level,bom_type,alternative_no,COMPONENT_LINE_ITEM_NO) componentPart,"); |
||||
|
searchSql.append(" ITEM_COST_DISTRIBUTION itemCostDistribution"); |
||||
|
searchSql.append(" FROM IFSAPP.MANUF_STRUCT_COST_DISTRIB"); |
||||
|
searchSql.append(" WHERE CONTRACT = :contract AND PART_NO = :partNo AND ENG_CHG_LEVEL = :engChgLevel AND BOM_TYPE = :bomType AND ALTERNATIVE_NO = :alternativeNo"); |
||||
|
|
||||
|
//设置查询的入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
inParam.put("contract", contract); |
||||
|
inParam.put("partNo", partNo); |
||||
|
inParam.put("engChgLevel", engChgLevel); |
||||
|
inParam.put("bomType", bomType); |
||||
|
inParam.put("alternativeNo", alternativeNo); |
||||
|
//调用查询的通用方法 |
||||
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
||||
|
//判断能否返回 |
||||
|
if (recordCollection == null) { |
||||
|
return null; |
||||
|
} else { |
||||
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
||||
|
return resultList; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 修改 Bom的副产品信息 |
||||
|
* @author LR |
||||
|
* @date 2024/12/11 16:47 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public static Map<String, String> modifyBomDistribution(Server srv, BomDistribution inData) throws APException { |
||||
|
//公共参数 |
||||
|
String ifsRowId = inData.getIfsRowId();// |
||||
|
String ifsRowVersion = inData.getIfsRowVersion();// |
||||
|
String itemCostDistribution = inData.getItemCostDistribution(); |
||||
|
//入参 |
||||
|
Map<String, String> inParam = new HashMap<>(); |
||||
|
//填充参数 |
||||
|
inParam.put("OBJID", ifsRowId); |
||||
|
inParam.put("OBJVERSION", ifsRowVersion); |
||||
|
inParam.put("ITEM_COST_DISTRIBUTION", itemCostDistribution); // 序号 |
||||
|
|
||||
|
//执行check的操作 |
||||
|
Map<String, String> checkMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "MANUF_STRUCT_COST_DISTRIB_API", |
||||
|
"MODIFY__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.CHECK, inParam); |
||||
|
//执行do的操作 |
||||
|
Map<String, String> resultMap = IfsPlsqlUtils.execProcedureGetRecord(srv, "MANUF_STRUCT_COST_DISTRIB_API", |
||||
|
"MODIFY__", PlsqlBaseMethodType.MODIFY, PlsqlBaseMethodAction.DO, inParam); |
||||
|
//返回结果集 |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,145 @@ |
|||||
|
package com.spring.ifs.bean; |
||||
|
|
||||
|
import com.spring.ifs.api.BaseSearchApi; |
||||
|
import com.spring.ifs.api.IfsServer; |
||||
|
import com.spring.ifs.data.*; |
||||
|
import ifs.fnd.ap.APException; |
||||
|
import ifs.fnd.ap.Server; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: 基础查询的实现类 |
||||
|
* @author LR |
||||
|
* @date 2024/12/9 11:49 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class BaseSearchBean { |
||||
|
|
||||
|
@Autowired |
||||
|
private IfsServer ifsServer; |
||||
|
|
||||
|
private static final Logger logger = LoggerFactory.getLogger(BaseSearchBean.class); |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询加工中心 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 13:23 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public List<WorkCenter> getWorkCenterNos(Server srv, BaseSearchData inData) throws APException { |
||||
|
//查询的参数 |
||||
|
String siteCon = inData.getSiteCon(); |
||||
|
String ifsRowVersion = inData.getIfsRowVersion(); |
||||
|
logger.info("请求参数:"+siteCon); |
||||
|
List<WorkCenter> resultList = BaseSearchApi.getWorkCenterNos(srv, siteCon, ifsRowVersion);; |
||||
|
logger.info("返回集合大小:"+resultList.size()); |
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @description: 查询 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 13:24 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public List<WarehouseLocation> getWarehouseLocations(Server srv, BaseSearchData inData) throws APException { |
||||
|
//查询的参数 |
||||
|
String siteCon = inData.getSiteCon(); |
||||
|
String ifsRowVersion = inData.getIfsRowVersion(); |
||||
|
logger.info("请求参数:"+siteCon); |
||||
|
List<WarehouseLocation> resultList = new ArrayList<>(); |
||||
|
int pageSize = 200; |
||||
|
//迭代查询 |
||||
|
for(int i = 0; i < 10; i++){ |
||||
|
int startIndex = i * pageSize; |
||||
|
List<WarehouseLocation> tempList = BaseSearchApi.getWarehouseLocations(srv, siteCon, ifsRowVersion, startIndex, pageSize); |
||||
|
//判断查询是否结束 |
||||
|
if(tempList != null && tempList.size() > 0) { |
||||
|
resultList.addAll(tempList); |
||||
|
}else { |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
logger.info("返回集合大小:"+resultList.size()); |
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 获取人员等级的信息 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 13:29 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public List<LaborClass> getIfsLaborClasss(Server srv, BaseSearchData inData) throws APException { |
||||
|
//查询的参数 |
||||
|
String siteCon = inData.getSiteCon(); |
||||
|
String ifsRowVersion = inData.getIfsRowVersion(); |
||||
|
return BaseSearchApi.getIfsLaborClasss(srv, siteCon, ifsRowVersion); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询物料件的信息 |
||||
|
* @author LR |
||||
|
* @date 2024/12/9 13:28 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public List<PartCatalog> getMasterParts(Server srv, BaseSearchData inData) throws APException { |
||||
|
//公共参数 |
||||
|
String ifsRowVersion = inData.getIfsRowVersion(); |
||||
|
//获取连接 |
||||
|
List<PartCatalog> resultList = new ArrayList<>(); |
||||
|
int pageSize = 200; |
||||
|
//迭代查询 |
||||
|
for(int i = 0; i < 10; i++){ |
||||
|
int startIndex = i * pageSize; |
||||
|
List<PartCatalog> tempList = BaseSearchApi.getPartCatalogs(srv, ifsRowVersion, startIndex, pageSize); |
||||
|
//判断查询是否结束 |
||||
|
if(tempList.size() > 0) { |
||||
|
resultList.addAll(tempList); |
||||
|
}else { |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
logger.info("返回集合大小:"+resultList.size()); |
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询库存件的属性值 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 13:33 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public List<InventoryValue> getInventoryValues(Server srv, BaseSearchData inData) throws APException { |
||||
|
//查询的参数 |
||||
|
String siteCon = inData.getSiteCon(); |
||||
|
String ifsRowVersion = inData.getIfsRowVersion(); |
||||
|
logger.info("库存件cost value请求参数:"+siteCon); |
||||
|
List<InventoryValue> resultList = new ArrayList<>(); |
||||
|
int pageSize = 200; |
||||
|
//迭代查询 |
||||
|
for(int i = 0; i < 10; i++){ |
||||
|
int startIndex = i * pageSize; |
||||
|
List<InventoryValue> tempList = BaseSearchApi.getInventoryValues(srv, siteCon, ifsRowVersion, startIndex, pageSize); |
||||
|
//判断查询是否结束 |
||||
|
if(tempList.size() > 0) { |
||||
|
resultList.addAll(tempList); |
||||
|
}else { |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
logger.info("返回集合大小:"+resultList.size()); |
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,651 @@ |
|||||
|
package com.spring.ifs.bean; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.spring.ifs.api.BomApi; |
||||
|
import com.spring.ifs.api.IfsServer; |
||||
|
import com.spring.ifs.api.InventoryPartApi; |
||||
|
import com.spring.ifs.api.RoutingApi; |
||||
|
import com.spring.ifs.data.*; |
||||
|
import ifs.fnd.ap.APException; |
||||
|
import ifs.fnd.ap.Server; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.function.Function; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @description: 处理Bom的 |
||||
|
* @author LR |
||||
|
* @date 2024/12/9 15:44 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class BomServiceBean { |
||||
|
|
||||
|
@Autowired |
||||
|
private IfsServer ifsServer; |
||||
|
|
||||
|
private static final Logger logger = LoggerFactory.getLogger(BomServiceBean.class); |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询Bom Header |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 15:49 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public BomHeader getBomHeader(BomHeader inData) throws APException { |
||||
|
logger.info("Bom查询参数:"+JSON.toJSONString(inData)); |
||||
|
//查询的参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
Map<String, String> bomMap = BomApi.getBomHeader(srv, contract, partNo, engChgLevel, bomType); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(bomMap == null || bomMap.size() == 0) { |
||||
|
throw new RuntimeException("Bom不存在!"); |
||||
|
} |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowId(bomMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(bomMap.get("IFSROWVERSION")); |
||||
|
//打印日志 |
||||
|
logger.info("Bom查询:"+JSON.toJSONString(inData)); |
||||
|
return inData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: Bom Header新增 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 15:52 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public BomHeader syncBomHeader(BomHeader inData) throws APException { |
||||
|
logger.info("Bom新增开始:"+JSON.toJSONString(inData)); |
||||
|
//查询的参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
Map<String, String> bomMap = BomApi.getBomHeader(srv, contract, partNo, engChgLevel, bomType); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(bomMap != null && bomMap.size() > 0) { |
||||
|
throw new RuntimeException("Bom已存在!"); |
||||
|
} |
||||
|
|
||||
|
//调用api |
||||
|
Map<String, String> resultMap = BomApi.insertBomHeader(srv, inData); |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowId(resultMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(resultMap.get("IFSROWVERSION")); |
||||
|
//打印日志 |
||||
|
logger.info("Bom新增结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return inData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: Bom Header修改 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 15:55 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public BomHeader modifyBomHeader(BomHeader inData) throws APException { |
||||
|
logger.info("Bom修改开始:"+JSON.toJSONString(inData)); |
||||
|
//查询的参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
Map<String, String> bomMap = BomApi.getBomHeader(srv, contract, partNo, engChgLevel, bomType); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(bomMap == null || bomMap.size() == 0) { |
||||
|
throw new RuntimeException("Bom不存在!"); |
||||
|
} |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowId(bomMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(bomMap.get("IFSROWVERSION")); |
||||
|
Map<String, String> resultMap = BomApi.modifyBomHeader(srv, inData); |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowVersion(resultMap.get("IFSROWVERSION")); |
||||
|
//打印日志 |
||||
|
logger.info("Bom修改结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果 |
||||
|
return inData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: Bom Header删除 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 15:58 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public void removeBomHeader(BomHeader inData) throws APException { |
||||
|
logger.info("Bom Header删除开始:"+JSON.toJSONString(inData)); |
||||
|
//查询的参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
Map<String, String> bomMap = BomApi.getBomHeader(srv, contract, partNo, engChgLevel, bomType); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(bomMap == null && bomMap.size() == 0) { |
||||
|
throw new RuntimeException("Bom不存在!"); |
||||
|
} |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowId(bomMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(bomMap.get("IFSROWVERSION")); |
||||
|
BomApi.removeBomHeader(srv, inData); |
||||
|
//打印日志 |
||||
|
logger.info("Bom Header 删除结束:"+JSON.toJSONString(inData)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询Bom Alternative |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 16:59 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public BomAlternative getBomAlternative(BomAlternative inData) throws APException { |
||||
|
logger.info("Bom Alternative 查询开始:"+JSON.toJSONString(inData)); |
||||
|
//公共参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
//查询制造商信息 |
||||
|
Map<String, String> alternativeMap = BomApi.getBomAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(alternativeMap == null) { |
||||
|
throw new RuntimeException("Bom Alternative 不存在!"); |
||||
|
} |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowId(alternativeMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(alternativeMap.get("IFSROWVERSION")); |
||||
|
//打印日志 |
||||
|
logger.info("Bom Alternative 查询结束:"+JSON.toJSONString(inData)); |
||||
|
return inData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 插入Bom Alternative |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 17:03 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public BomAlternative syncBomAlternative(BomAlternative inData) throws APException { |
||||
|
logger.info("Bom Alternative 新增开始:"+JSON.toJSONString(inData)); |
||||
|
//公共参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
//查询制造商信息 |
||||
|
Map<String, String> alternativeMap = BomApi.getBomAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(alternativeMap != null && alternativeMap.size() > 0) { |
||||
|
throw new RuntimeException("Bom Alternative 已存在!"); |
||||
|
} |
||||
|
|
||||
|
//调用新增api |
||||
|
Map<String, String> resultMap = BomApi.insertBomAlternative(srv, inData); |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowId(resultMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(resultMap.get("IFSROWVERSION")); |
||||
|
//打印日志 |
||||
|
logger.info("Bom Alternative 新增结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果 |
||||
|
return inData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 修改Bom Alternative |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 17:06 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public BomAlternative modifyBomAlternative(BomAlternative inData) throws APException { |
||||
|
logger.info("Bom Alternative 修改开始:"+JSON.toJSONString(inData)); |
||||
|
//公共参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
//查询制造商信息 |
||||
|
Map<String, String> alternativeMap = BomApi.getBomAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(alternativeMap == null || alternativeMap.size() == 0) { |
||||
|
throw new RuntimeException("Bom Alternative不存在!"); |
||||
|
} |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowId(alternativeMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(alternativeMap.get("IFSROWVERSION")); |
||||
|
//调用api |
||||
|
Map<String, String> resultMap = BomApi.modifyBomAlternative(srv, inData); |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowVersion(resultMap.get("IFSROWVERSION")); |
||||
|
//打印日志 |
||||
|
logger.info("Bom Alternative 修改结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果 |
||||
|
return inData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 删除Bom Alternative |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 17:07 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public void removeBomAlternative(BomAlternative inData) throws APException { |
||||
|
logger.info("Bom Alternative 删除开始:"+JSON.toJSONString(inData)); |
||||
|
//公共参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
//查询制造商信息 |
||||
|
Map<String, String> alternativeMap = BomApi.getBomAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(alternativeMap == null || alternativeMap.size() == 0) { |
||||
|
throw new RuntimeException("Bom Alternative不存在!"); |
||||
|
} |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowId(alternativeMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(alternativeMap.get("IFSROWVERSION")); |
||||
|
//调用api |
||||
|
BomApi.removeBomAlternative(srv, inData); |
||||
|
//打印日志 |
||||
|
logger.info("Bom Alternative 删除结束:"+JSON.toJSONString(inData)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: Build Bom Alternative |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 9:37 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public BomAlternative buildBomAlternative(BomAlternative inData) throws APException { |
||||
|
logger.info("Bom替代Build开始:"+JSON.toJSONString(inData)); |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
//查询制造商信息 |
||||
|
Map<String, String> alternativeMap = BomApi.getBomAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(alternativeMap == null || alternativeMap.size() == 0) { |
||||
|
throw new RuntimeException("Bom Alternative不存在!"); |
||||
|
} |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowId(alternativeMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(alternativeMap.get("IFSROWVERSION")); |
||||
|
//调用删除方法 |
||||
|
Map<String, String> resultMap = BomApi.buildBomAlternative(srv, inData); |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowVersion(resultMap.get("IFSROWVERSION")); |
||||
|
//打印日志 |
||||
|
logger.info("Bom替代Build结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return inData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: Retire Bom Alternative |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 9:40 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public BomAlternative retireBomAlternative(BomAlternative inData) throws APException { |
||||
|
logger.info("Bom替代Build开始:"+JSON.toJSONString(inData)); |
||||
|
//公共参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
//查询制造商信息 |
||||
|
Map<String, String> alternativeMap = BomApi.getBomAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(alternativeMap == null || alternativeMap.size() == 0) { |
||||
|
throw new RuntimeException("Bom Alternative不存在!"); |
||||
|
} |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowId(alternativeMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(alternativeMap.get("IFSROWVERSION")); |
||||
|
//调用删除方法 |
||||
|
Map<String, String> resultMap = BomApi.retireBomAlternative(srv, inData); |
||||
|
//设置ifs 信息 |
||||
|
inData.setIfsRowVersion(resultMap.get("IFSROWVERSION")); |
||||
|
//打印日志 |
||||
|
logger.info("Bom替代Retire结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return inData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 获取Bom 的明细 |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 9:53 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public List<BomItem> getBomItems(BomItem inData) throws APException { |
||||
|
//公共参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
String lineItemNo = inData.getLineItemNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
//查询制造商信息 |
||||
|
Map<String, String> alternativeMap = BomApi.getBomAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(alternativeMap == null || alternativeMap.size() == 0) { |
||||
|
throw new RuntimeException("Bom Alternative不存在!"); |
||||
|
} |
||||
|
//查询结果集 |
||||
|
List<BomItem> resultList = BomApi.getBomItems(srv, contract, partNo, engChgLevel, bomType, alternativeNo, lineItemNo); |
||||
|
//判断是否查询数据 |
||||
|
if(resultList.size() == 0 || resultList.isEmpty()) { |
||||
|
throw new RuntimeException("不存在此bom组件信息!"); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Bom替代明细集合结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 批量新增Bom Item |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 17:23 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public List<BomItem> syncBomItems(List<BomItem> inDatas) throws APException { |
||||
|
logger.info("Bom替代明细集合新增开始:"+JSON.toJSONString(inDatas)); |
||||
|
//公共参数 |
||||
|
String username = inDatas.get(0).getIfsUsername(); |
||||
|
String password = inDatas.get(0).getIfsPassword(); |
||||
|
String contract = inDatas.get(0).getContract(); |
||||
|
String partNo = inDatas.get(0).getPartNo(); |
||||
|
String engChgLevel = inDatas.get(0).getEngChgLevel(); |
||||
|
String bomType = inDatas.get(0).getBomType(); |
||||
|
String alternativeNo = inDatas.get(0).getAlternativeNo(); |
||||
|
String lineItemNo = inDatas.get(0).getLineItemNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
//查询制造商信息 |
||||
|
Map<String, String> alternativeMap = BomApi.getBomAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(alternativeMap == null || alternativeMap.size() == 0) { |
||||
|
throw new RuntimeException("Bom Alternative不存在!"); |
||||
|
} |
||||
|
//查询结果集 |
||||
|
List<BomItem> itemList = BomApi.getBomItems(srv, contract, partNo, engChgLevel, bomType, alternativeNo, null); |
||||
|
//转Map |
||||
|
Map<String, String> itemMap = itemList.stream().collect(Collectors.toMap(BomItem::getLineItemNo, BomItem::getLineItemNo)); |
||||
|
//打印日志 |
||||
|
logger.info("Bom替代明细集合 批量新增结束:"+JSON.toJSONString(inDatas)); |
||||
|
//循环判断的方法 |
||||
|
for(BomItem bomItem : inDatas) { |
||||
|
//判断是否已经存在 |
||||
|
String tempLineItemNo = bomItem.getLineItemNo(); |
||||
|
if(itemMap.containsKey(tempLineItemNo)) { |
||||
|
throw new RuntimeException("已存在此bom组件信息!LineItemNo:"+tempLineItemNo); |
||||
|
} |
||||
|
} |
||||
|
// 校验通过 循环调用新增的方法 |
||||
|
for(BomItem bomItem : inDatas) { |
||||
|
//调用api |
||||
|
Map<String, String> tempMap = BomApi.insertBomItem(srv, bomItem); |
||||
|
//设置ifs 信息 |
||||
|
bomItem.setIfsRowId(tempMap.get("IFSROWID")); |
||||
|
bomItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Bom替代明细集合新增开始:"+JSON.toJSONString(inDatas)); |
||||
|
//返回结果集 |
||||
|
return inDatas; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 修改Bom的明细 |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 10:24 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public BomItem modifyBomItem(BomItem inData) throws APException { |
||||
|
logger.info("Bom替代明细新增开始:"+JSON.toJSONString(inData)); |
||||
|
// 公共参数 |
||||
|
//公共参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
String lineItemNo = inData.getLineItemNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
//查询制造商信息 |
||||
|
Map<String, String> alternativeMap = BomApi.getBomAlternative(srv, contract, partNo, engChgLevel, bomType, alternativeNo); |
||||
|
//判断是否需要插入到ifs |
||||
|
if(alternativeMap == null || alternativeMap.size() == 0) { |
||||
|
throw new RuntimeException("Bom Alternative不存在!"); |
||||
|
} |
||||
|
//查询结果集 |
||||
|
List<BomItem> resultList = BomApi.getBomItems(srv, contract, partNo, engChgLevel, bomType, alternativeNo, lineItemNo); |
||||
|
//判断是否查询数据 |
||||
|
if(resultList.size() == 0 || resultList.isEmpty()) { |
||||
|
throw new RuntimeException("不存在此bom组件信息!"); |
||||
|
} |
||||
|
|
||||
|
BomItem bomItem = resultList.get(0); |
||||
|
//设置版本信息 |
||||
|
inData.setIfsRowId(bomItem.getIfsRowId()); |
||||
|
inData.setIfsRowVersion(bomItem.getIfsRowVersion()); |
||||
|
//调用修改的方法 |
||||
|
Map<String, String> resultMap = BomApi.modifyBomItem(srv, inData); |
||||
|
//设置ifs 信息 |
||||
|
bomItem.setIfsRowId(resultMap.get("IFSROWID")); |
||||
|
bomItem.setIfsRowVersion(resultMap.get("IFSROWVERSION")); |
||||
|
//打印日志 |
||||
|
logger.info("Bom替代明细新增结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return bomItem; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 批量删除 |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 10:26 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public void removeBomItems(List<BomItem> inDatas) throws APException { |
||||
|
logger.info("Bom 明细集合删除开始:"+JSON.toJSONString(inDatas)); |
||||
|
//公共参数 |
||||
|
String username = inDatas.get(0).getIfsUsername(); |
||||
|
String password = inDatas.get(0).getIfsPassword(); |
||||
|
String contract = inDatas.get(0).getContract(); |
||||
|
String partNo = inDatas.get(0).getPartNo(); |
||||
|
String engChgLevel = inDatas.get(0).getEngChgLevel(); |
||||
|
String bomType = inDatas.get(0).getBomType(); |
||||
|
String alternativeNo = inDatas.get(0).getAlternativeNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
|
||||
|
//查询结果集 |
||||
|
List<BomItem> itemList = BomApi.getBomItems(srv, contract, partNo, engChgLevel, bomType, alternativeNo, null); |
||||
|
//转Map |
||||
|
Map<String, BomItem> itemMap = itemList.stream().collect(Collectors.toMap(BomItem::getLineItemNo, Function.identity())); |
||||
|
//打印日志 |
||||
|
logger.info("Bom替代明细集合 批量新增结束:"+JSON.toJSONString(inDatas)); |
||||
|
//循环判断的方法 |
||||
|
for(BomItem bomItem : inDatas) { |
||||
|
//判断是否已经存在 |
||||
|
String tempLineItemNo = bomItem.getLineItemNo(); |
||||
|
if(!itemMap.containsKey(tempLineItemNo)) { |
||||
|
throw new RuntimeException("不存在此bom组件信息!LineItemNo:"+tempLineItemNo); |
||||
|
} |
||||
|
} |
||||
|
// 校验通过 循环调用新增的方法 |
||||
|
for(BomItem bomItem : inDatas) { |
||||
|
//设置版本的信息 |
||||
|
String key = bomItem.getLineItemNo(); |
||||
|
BomItem oriItem = itemMap.get(key); |
||||
|
bomItem.setIfsRowId(oriItem.getIfsRowId()); |
||||
|
bomItem.setIfsRowVersion(oriItem.getIfsRowVersion()); |
||||
|
//调用api |
||||
|
BomApi.removeBomItem(srv, bomItem); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Bom 明细集合删除开始:"+JSON.toJSONString(inDatas)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 修改单个 Bom 副产品 |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 10:51 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public BomDistribution modifyBomDistribution(BomDistribution inData) throws APException { |
||||
|
logger.info("Bom Distribution查询开始:"+JSON.toJSONString(inData)); |
||||
|
//公共参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
String componentLineItemNo = inData.getComponentLineItemNo(); |
||||
|
String byProductLineItemNo = inData.getByProdLineItemNo();// 副产品的序号 |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
//查询数据 |
||||
|
Map<String, String> searchMap = BomApi.getBomDistribution(srv, contract, partNo, engChgLevel, bomType, alternativeNo, |
||||
|
componentLineItemNo, byProductLineItemNo); |
||||
|
//判断是否存在 |
||||
|
if(searchMap == null) { |
||||
|
throw new RuntimeException("查无此副产品分配信息!"); |
||||
|
} |
||||
|
//设置RowId和Rowversion |
||||
|
inData.setIfsRowId(searchMap.get("IFSROWID")); |
||||
|
inData.setIfsRowVersion(searchMap.get("IFSROWVERSION")); |
||||
|
//不存在 则调用当前修改的副产品成本分配的方法 |
||||
|
Map<String, String> resultMap = BomApi.modifyBomDistribution(srv, inData); |
||||
|
//设置IFS信息 |
||||
|
inData.setIfsRowVersion(resultMap.get("ifsRowVersion")); |
||||
|
//打印日志 |
||||
|
logger.info("Bom Distribution查询结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果 |
||||
|
return inData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 批量修改 |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 10:57 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
public List<BomDistribution> modifyBomDistributions(List<BomDistribution> inDatas) throws APException { |
||||
|
logger.info("Bom Distribution批量修改开始:"+JSON.toJSONString(inDatas)); |
||||
|
BomDistribution inData = inDatas.get(0); |
||||
|
//公共参数 |
||||
|
String username = inData.getIfsUsername(); |
||||
|
String password = inData.getIfsPassword(); |
||||
|
String contract = inData.getContract(); |
||||
|
String partNo = inData.getPartNo(); |
||||
|
String engChgLevel = inData.getEngChgLevel(); |
||||
|
String bomType = inData.getBomType(); |
||||
|
String alternativeNo = inData.getAlternativeNo(); |
||||
|
//获取连接 |
||||
|
Server srv = ifsServer.getIfsServer(username, password); |
||||
|
|
||||
|
//迭代循环调用 验证 |
||||
|
for(BomDistribution bomDistribution : inDatas) { |
||||
|
String componentLineItemNo = bomDistribution.getComponentLineItemNo(); |
||||
|
String byProductLineItemNo = bomDistribution.getByProdLineItemNo();// 副产品的序号 |
||||
|
Map<String, String> searchMap = BomApi.getBomDistribution(srv, contract, partNo, engChgLevel, bomType, alternativeNo, |
||||
|
componentLineItemNo, byProductLineItemNo); |
||||
|
//判断是否存在 |
||||
|
if(searchMap == null) { |
||||
|
throw new RuntimeException("查无此副产品分配信息!"); |
||||
|
} |
||||
|
} |
||||
|
//迭代循环调用 |
||||
|
for(BomDistribution bomDistribution : inDatas) { |
||||
|
String componentLineItemNo = bomDistribution.getComponentLineItemNo(); |
||||
|
String byProductLineItemNo = bomDistribution.getByProdLineItemNo();// 副产品的序号 |
||||
|
Map<String, String> searchMap = BomApi.getBomDistribution(srv, contract, partNo, engChgLevel, bomType, alternativeNo, |
||||
|
componentLineItemNo, byProductLineItemNo); |
||||
|
//设置RowId和Rowversion |
||||
|
bomDistribution.setIfsRowId(searchMap.get("IFSROWID")); |
||||
|
bomDistribution.setIfsRowVersion(searchMap.get("IFSROWVERSION")); |
||||
|
//不存在 则调用当前修改的副产品成本分配的方法 |
||||
|
Map<String, String> resultMap = BomApi.modifyBomDistribution(srv, bomDistribution); |
||||
|
//设置版本信息 |
||||
|
bomDistribution.setIfsRowVersion(resultMap.get("IFSROWVERSION")); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Bom Distribution批量修改结束:"+JSON.toJSONString(inDatas)); |
||||
|
//返回结果 |
||||
|
return inDatas; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,85 @@ |
|||||
|
package com.spring.ifs.data; |
||||
|
|
||||
|
/** |
||||
|
* @author LR |
||||
|
* @version 1.0 |
||||
|
* @description: IFS基础业务数据 |
||||
|
* @date 2024/12/9 11:50 |
||||
|
*/ |
||||
|
public class BaseIfsData { |
||||
|
private int id;// |
||||
|
private String contract;// |
||||
|
private String partNo;// |
||||
|
private String partDesc;// |
||||
|
private String ifsRowId; |
||||
|
private String ifsRowVersion; |
||||
|
private String ifsUsername;// |
||||
|
private String ifsPassword;// |
||||
|
|
||||
|
public BaseIfsData() { |
||||
|
} |
||||
|
|
||||
|
public String getContract() { |
||||
|
return contract; |
||||
|
} |
||||
|
|
||||
|
public int getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(int id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public void setContract(String contract) { |
||||
|
this.contract = contract; |
||||
|
} |
||||
|
|
||||
|
public String getPartNo() { |
||||
|
return partNo; |
||||
|
} |
||||
|
|
||||
|
public void setPartNo(String partNo) { |
||||
|
this.partNo = partNo; |
||||
|
} |
||||
|
|
||||
|
public String getPartDesc() { |
||||
|
return partDesc; |
||||
|
} |
||||
|
|
||||
|
public void setPartDesc(String partDesc) { |
||||
|
this.partDesc = partDesc; |
||||
|
} |
||||
|
|
||||
|
public String getIfsRowId() { |
||||
|
return ifsRowId; |
||||
|
} |
||||
|
|
||||
|
public void setIfsRowId(String ifsRowId) { |
||||
|
this.ifsRowId = ifsRowId; |
||||
|
} |
||||
|
|
||||
|
public String getIfsRowVersion() { |
||||
|
return ifsRowVersion; |
||||
|
} |
||||
|
|
||||
|
public void setIfsRowVersion(String ifsRowVersion) { |
||||
|
this.ifsRowVersion = ifsRowVersion; |
||||
|
} |
||||
|
|
||||
|
public String getIfsUsername() { |
||||
|
return ifsUsername; |
||||
|
} |
||||
|
|
||||
|
public void setIfsUsername(String ifsUsername) { |
||||
|
this.ifsUsername = ifsUsername; |
||||
|
} |
||||
|
|
||||
|
public String getIfsPassword() { |
||||
|
return ifsPassword; |
||||
|
} |
||||
|
|
||||
|
public void setIfsPassword(String ifsPassword) { |
||||
|
this.ifsPassword = ifsPassword; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,121 @@ |
|||||
|
package com.spring.ifs.data; |
||||
|
|
||||
|
/** |
||||
|
* @author mumu |
||||
|
* @ClassName: ProcessOutData |
||||
|
* @Description: 工艺输出类 |
||||
|
* @date 2018年12月22日 |
||||
|
*/ |
||||
|
public class BaseSearchData { |
||||
|
private int id;// 工艺 |
||||
|
private String site;// 工厂编号 |
||||
|
private String firstType;// 类型 |
||||
|
private String secondType;// 类型 |
||||
|
private String baseData;// 工艺 |
||||
|
private String baseDesc;// 工艺描述 |
||||
|
private Integer status;// 状态 |
||||
|
private String remark;// 备注 |
||||
|
private String siteCon;// 工厂查询条件 |
||||
|
private String ifsRowVersion;// 查询 |
||||
|
private String ifsUsername;// |
||||
|
private String ifsPassword;// |
||||
|
|
||||
|
public BaseSearchData() { |
||||
|
} |
||||
|
|
||||
|
public int getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(int id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getSite() { |
||||
|
return site; |
||||
|
} |
||||
|
|
||||
|
public void setSite(String site) { |
||||
|
this.site = site; |
||||
|
} |
||||
|
|
||||
|
public String getFirstType() { |
||||
|
return firstType; |
||||
|
} |
||||
|
|
||||
|
public void setFirstType(String firstType) { |
||||
|
this.firstType = firstType; |
||||
|
} |
||||
|
|
||||
|
public String getSecondType() { |
||||
|
return secondType; |
||||
|
} |
||||
|
|
||||
|
public void setSecondType(String secondType) { |
||||
|
this.secondType = secondType; |
||||
|
} |
||||
|
|
||||
|
public String getBaseData() { |
||||
|
return baseData; |
||||
|
} |
||||
|
|
||||
|
public void setBaseData(String baseData) { |
||||
|
this.baseData = baseData; |
||||
|
} |
||||
|
|
||||
|
public String getBaseDesc() { |
||||
|
return baseDesc; |
||||
|
} |
||||
|
|
||||
|
public void setBaseDesc(String baseDesc) { |
||||
|
this.baseDesc = baseDesc; |
||||
|
} |
||||
|
|
||||
|
public Integer getStatus() { |
||||
|
return status; |
||||
|
} |
||||
|
|
||||
|
public void setStatus(Integer status) { |
||||
|
this.status = status; |
||||
|
} |
||||
|
|
||||
|
public String getRemark() { |
||||
|
return remark; |
||||
|
} |
||||
|
|
||||
|
public void setRemark(String remark) { |
||||
|
this.remark = remark; |
||||
|
} |
||||
|
|
||||
|
public String getSiteCon() { |
||||
|
return siteCon; |
||||
|
} |
||||
|
|
||||
|
public void setSiteCon(String siteCon) { |
||||
|
this.siteCon = siteCon; |
||||
|
} |
||||
|
|
||||
|
public String getIfsRowVersion() { |
||||
|
return ifsRowVersion; |
||||
|
} |
||||
|
|
||||
|
public void setIfsRowVersion(String ifsRowVersion) { |
||||
|
this.ifsRowVersion = ifsRowVersion; |
||||
|
} |
||||
|
|
||||
|
public String getIfsUsername() { |
||||
|
return ifsUsername; |
||||
|
} |
||||
|
|
||||
|
public void setIfsUsername(String ifsUsername) { |
||||
|
this.ifsUsername = ifsUsername; |
||||
|
} |
||||
|
|
||||
|
public String getIfsPassword() { |
||||
|
return ifsPassword; |
||||
|
} |
||||
|
|
||||
|
public void setIfsPassword(String ifsPassword) { |
||||
|
this.ifsPassword = ifsPassword; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
package com.spring.ifs.data; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: CustomerOrderData |
||||
|
* @Description:客户订单的信息 |
||||
|
* @author: LR |
||||
|
* @date: 2022年12月9日 下午1:59:55 |
||||
|
* @Copyright: |
||||
|
*/ |
||||
|
public class BomAlternative extends BomHeader { |
||||
|
private String alternativeNo;// 替代编码 |
||||
|
private String alternativeDesc;// 替代描述 |
||||
|
private String state;//状态 |
||||
|
|
||||
|
public BomAlternative() { |
||||
|
super(); |
||||
|
} |
||||
|
|
||||
|
public String getAlternativeNo() { |
||||
|
return alternativeNo; |
||||
|
} |
||||
|
|
||||
|
public void setAlternativeNo(String alternativeNo) { |
||||
|
this.alternativeNo = alternativeNo; |
||||
|
} |
||||
|
|
||||
|
public String getAlternativeDesc() { |
||||
|
return alternativeDesc; |
||||
|
} |
||||
|
|
||||
|
public void setAlternativeDesc(String alternativeDesc) { |
||||
|
this.alternativeDesc = alternativeDesc; |
||||
|
} |
||||
|
|
||||
|
public String getState() { |
||||
|
return state; |
||||
|
} |
||||
|
|
||||
|
public void setState(String state) { |
||||
|
this.state = state; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,54 @@ |
|||||
|
package com.spring.ifs.data; |
||||
|
|
||||
|
public class BomDistribution extends BomAlternative { |
||||
|
private String componentLineItemNo;// 子件序号 |
||||
|
private String byProdLineItemNo;// 副产品的序号 |
||||
|
private String componentPart;// 收件信息-区 |
||||
|
private String byProductPartNo;// 副产品的料号 |
||||
|
private String itemCostDistribution;// 成本分配 |
||||
|
|
||||
|
public BomDistribution() { |
||||
|
super(); |
||||
|
} |
||||
|
|
||||
|
public String getComponentLineItemNo() { |
||||
|
return componentLineItemNo; |
||||
|
} |
||||
|
|
||||
|
public void setComponentLineItemNo(String componentLineItemNo) { |
||||
|
this.componentLineItemNo = componentLineItemNo; |
||||
|
} |
||||
|
|
||||
|
public String getByProdLineItemNo() { |
||||
|
return byProdLineItemNo; |
||||
|
} |
||||
|
|
||||
|
public void setByProdLineItemNo(String byProdLineItemNo) { |
||||
|
this.byProdLineItemNo = byProdLineItemNo; |
||||
|
} |
||||
|
|
||||
|
public String getComponentPart() { |
||||
|
return componentPart; |
||||
|
} |
||||
|
|
||||
|
public void setComponentPart(String componentPart) { |
||||
|
this.componentPart = componentPart; |
||||
|
} |
||||
|
|
||||
|
public String getByProductPartNo() { |
||||
|
return byProductPartNo; |
||||
|
} |
||||
|
|
||||
|
public void setByProductPartNo(String byProductPartNo) { |
||||
|
this.byProductPartNo = byProductPartNo; |
||||
|
} |
||||
|
|
||||
|
public String getItemCostDistribution() { |
||||
|
return itemCostDistribution; |
||||
|
} |
||||
|
|
||||
|
public void setItemCostDistribution(String itemCostDistribution) { |
||||
|
this.itemCostDistribution = itemCostDistribution; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,72 @@ |
|||||
|
package com.spring.ifs.data; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @ClassName: InventoryPart |
||||
|
* @Description:物料目录 |
||||
|
* @author: LR |
||||
|
* @date: 2023年12月22日 上午10:14:06 |
||||
|
* @Copyright: |
||||
|
*/ |
||||
|
public class BomHeader extends PartCatalog { |
||||
|
private String engChgLevel; |
||||
|
private String bomType; |
||||
|
private String effPhaseInDate; |
||||
|
private String effPhaseOutDate; |
||||
|
private String noteText; |
||||
|
private String engRevision; |
||||
|
|
||||
|
public BomHeader() { |
||||
|
super(); |
||||
|
// TODO Auto-generated constructor stub |
||||
|
} |
||||
|
|
||||
|
public String getEngChgLevel() { |
||||
|
return engChgLevel; |
||||
|
} |
||||
|
|
||||
|
public void setEngChgLevel(String engChgLevel) { |
||||
|
this.engChgLevel = engChgLevel; |
||||
|
} |
||||
|
|
||||
|
public String getBomType() { |
||||
|
return bomType; |
||||
|
} |
||||
|
|
||||
|
public void setBomType(String bomType) { |
||||
|
this.bomType = bomType; |
||||
|
} |
||||
|
|
||||
|
public String getEffPhaseInDate() { |
||||
|
return effPhaseInDate; |
||||
|
} |
||||
|
|
||||
|
public void setEffPhaseInDate(String effPhaseInDate) { |
||||
|
this.effPhaseInDate = effPhaseInDate; |
||||
|
} |
||||
|
|
||||
|
public String getEffPhaseOutDate() { |
||||
|
return effPhaseOutDate; |
||||
|
} |
||||
|
|
||||
|
public void setEffPhaseOutDate(String effPhaseOutDate) { |
||||
|
this.effPhaseOutDate = effPhaseOutDate; |
||||
|
} |
||||
|
|
||||
|
public String getNoteText() { |
||||
|
return noteText; |
||||
|
} |
||||
|
|
||||
|
public void setNoteText(String noteText) { |
||||
|
this.noteText = noteText; |
||||
|
} |
||||
|
|
||||
|
public String getEngRevision() { |
||||
|
return engRevision; |
||||
|
} |
||||
|
|
||||
|
public void setEngRevision(String engRevision) { |
||||
|
this.engRevision = engRevision; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,107 @@ |
|||||
|
package com.spring.ifs.data; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @ClassName: CustomerOrderData |
||||
|
* @Description:客户订单的信息 |
||||
|
* @author: LR |
||||
|
* @date: 2022年12月9日 下午1:59:55 |
||||
|
* @Copyright: |
||||
|
*/ |
||||
|
public class BomItem extends BomAlternative { |
||||
|
private String lineItemNo;// |
||||
|
private String lineSequence;// |
||||
|
private String componentPart;// 收件信息-区 |
||||
|
private String qtyPerAssembly;// 单位用量 |
||||
|
private String issueType;// 生产属性 |
||||
|
private String componentScrap;// 报废 |
||||
|
private String shrinkageFactor;// 损耗率 |
||||
|
private String consumptionItem;// 消耗项目 |
||||
|
private String operationNo;// 工序 |
||||
|
private String histType;// 类型 |
||||
|
|
||||
|
public BomItem() { |
||||
|
super(); |
||||
|
} |
||||
|
|
||||
|
public String getLineItemNo() { |
||||
|
return lineItemNo; |
||||
|
} |
||||
|
|
||||
|
public void setLineItemNo(String lineItemNo) { |
||||
|
this.lineItemNo = lineItemNo; |
||||
|
} |
||||
|
|
||||
|
public String getLineSequence() { |
||||
|
return lineSequence; |
||||
|
} |
||||
|
|
||||
|
public void setLineSequence(String lineSequence) { |
||||
|
this.lineSequence = lineSequence; |
||||
|
} |
||||
|
|
||||
|
public String getComponentPart() { |
||||
|
return componentPart; |
||||
|
} |
||||
|
|
||||
|
public void setComponentPart(String componentPart) { |
||||
|
this.componentPart = componentPart; |
||||
|
} |
||||
|
|
||||
|
public String getQtyPerAssembly() { |
||||
|
return qtyPerAssembly; |
||||
|
} |
||||
|
|
||||
|
public void setQtyPerAssembly(String qtyPerAssembly) { |
||||
|
this.qtyPerAssembly = qtyPerAssembly; |
||||
|
} |
||||
|
|
||||
|
public String getIssueType() { |
||||
|
return issueType; |
||||
|
} |
||||
|
|
||||
|
public void setIssueType(String issueType) { |
||||
|
this.issueType = issueType; |
||||
|
} |
||||
|
|
||||
|
public String getComponentScrap() { |
||||
|
return componentScrap; |
||||
|
} |
||||
|
|
||||
|
public void setComponentScrap(String componentScrap) { |
||||
|
this.componentScrap = componentScrap; |
||||
|
} |
||||
|
|
||||
|
public String getShrinkageFactor() { |
||||
|
return shrinkageFactor; |
||||
|
} |
||||
|
|
||||
|
public void setShrinkageFactor(String shrinkageFactor) { |
||||
|
this.shrinkageFactor = shrinkageFactor; |
||||
|
} |
||||
|
|
||||
|
public String getConsumptionItem() { |
||||
|
return consumptionItem; |
||||
|
} |
||||
|
|
||||
|
public void setConsumptionItem(String consumptionItem) { |
||||
|
this.consumptionItem = consumptionItem; |
||||
|
} |
||||
|
|
||||
|
public String getOperationNo() { |
||||
|
return operationNo; |
||||
|
} |
||||
|
|
||||
|
public void setOperationNo(String operationNo) { |
||||
|
this.operationNo = operationNo; |
||||
|
} |
||||
|
|
||||
|
public String getHistType() { |
||||
|
return histType; |
||||
|
} |
||||
|
|
||||
|
public void setHistType(String histType) { |
||||
|
this.histType = histType; |
||||
|
} |
||||
|
|
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue