Browse Source

IFS copy part 查询接口

master
Rui_Li 8 months ago
parent
commit
04624b3511
  1. 170
      src/main/java/com/spring/ifs/api/RoutingApi.java
  2. 92
      src/main/java/com/spring/ifs/bean/RoutingServiceBean.java

170
src/main/java/com/spring/ifs/api/RoutingApi.java

@ -529,6 +529,70 @@ public class RoutingApi {
} }
} }
/**
* @description: 仅仅copy part 赋值使用
* @author LR
* @date 2025/5/21 15:56
* @version 1.0
*/
public static List<RoutingIfsItem> getRoutingItemsWithCopyPart(Server srv, String contract, String partNo) throws APException {
StringBuilder searchSql = new StringBuilder();
searchSql.append("SELECT CONTRACT, PART_NO, ROUTING_REVISION, BOM_TYPE, ALTERNATIVE_NO,");
searchSql.append(" OPERATION_NO, OPERATION_DESCRIPTION operationDesc, WORK_CENTER_NO, EFFICIENCY_FACTOR, MACH_SETUP_TIME,");
searchSql.append(" MACH_RUN_FACTOR, RUN_TIME_CODE, LABOR_RUN_FACTOR, LABOR_SETUP_TIME, CREW_SIZE, SETUP_CREW_SIZE,");
searchSql.append(" OPERATION_ID, MACHINE_NO, OUTSIDE_OP_ITEM, LABOR_CLASS_NO, SETUP_LABOR_CLASS_NO,");
searchSql.append(" OVERLAP, NOTE_TEXT, objid ifsRowId, objversion ifsRowVersion");
searchSql.append(" FROM ifsapp.ROUTING_OPERATION");
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 new ArrayList<>();
} else {
List<RoutingIfsItem> 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);
RoutingIfsItem tempItem = new RoutingIfsItem();
//设置参数
tempItem.setIfsRowId(tempMap.get("IFSROWID"));
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION"));
tempItem.setRoutingRevision(tempMap.get("ROUTING_REVISION"));
tempItem.setRoutingType(tempMap.get("BOM_TYPE"));
tempItem.setAlternativeNo(tempMap.get("ALTERNATIVE_NO"));
tempItem.setOperationNo(tempMap.get("OPERATION_NO"));
tempItem.setOperationDesc(tempMap.get("OPERATION_DESCRIPTION"));
tempItem.setWorkCenterNo(tempMap.get("WORK_CENTER_NO"));
tempItem.setEfficiencyFactor(tempMap.get("EFFICIENCY_FACTOR"));
tempItem.setMachSetupTime(tempMap.get("MACH_SETUP_TIME"));
tempItem.setMachRunFactor(tempMap.get("MACH_RUN_FACTOR"));
tempItem.setRunTimeCode(tempMap.get("RUN_TIME_CODE"));
tempItem.setLaborRunFactor(tempMap.get("LABOR_RUN_FACTOR"));
tempItem.setLaborSetupTime(tempMap.get("LABOR_SETUP_TIME"));
tempItem.setCrewSize(tempMap.get("CREW_SIZE"));
tempItem.setSetupCrewSize(tempMap.get("SETUP_CREW_SIZE"));
tempItem.setOperationId(tempMap.get("OPERATION_ID"));
tempItem.setMachineNo(tempMap.get("MACHINE_NO"));
tempItem.setOutsideOpItem(tempMap.get("OUTSIDE_OP_ITEM"));
tempItem.setLaborClassNo(tempMap.get("LABOR_CLASS_NO"));
tempItem.setSetupLaborClassNo(tempMap.get("SETUP_LABOR_CLASS_NO"));
tempItem.setOverlap(tempMap.get("OVERLAP"));
tempItem.setNoteText(tempMap.get("NOTE_TEXT"));
//添加对象
resultItems.add(tempItem);
}
return resultItems;
}
}
/** /**
* @description: 插入Routing Item * @description: 插入Routing Item
* @author LR * @author LR
@ -724,7 +788,7 @@ public class RoutingApi {
inParam.put("alternativeNo", alternativeNo); inParam.put("alternativeNo", alternativeNo);
//添加判断的查询条件 //添加判断的查询条件
if(!(null == toolId || "".equals(toolId))) { if(!(null == toolId || "".equals(toolId))) {
searchSql.append(" AND OPERATION_NO = :toolId");
searchSql.append(" AND TOOL_ID = :toolId");
inParam.put("toolId", toolId); inParam.put("toolId", toolId);
} }
//调用查询的通用方法 //调用查询的通用方法
@ -739,6 +803,57 @@ public class RoutingApi {
} }
} }
/**
* @description: copy part 使用的查询方法
* @author LR
* @date 2025/5/21 16:02
* @version 1.0
*/
public static List<RoutingIfsTool> getRoutingToolsWithCopyPart(Server srv, String contract, String partNo) throws APException {
StringBuilder searchSql = new StringBuilder();
searchSql.append("SELECT CONTRACT, PART_NO, ROUTING_REVISION, BOM_TYPE, ALTERNATIVE_NO, OPERATION_NO,");
searchSql.append(" TOOL_ID, TOOL_QUANTITY, OBJID ifsRowId, OBJVERSION ifsRowVersion, NOTE_TEXT");
searchSql.append(" FROM IFSAPP.ROUTING_OPERATION_TOOL");
searchSql.append(" WHERE CONTRACT = :contract AND PART_NO = :partNo AND ROUTING_REVISION = :routingRevision AND BOM_TYPE = :routingType AND ALTERNATIVE_NO = :alternativeNo");
//设置查询的入参
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 new ArrayList<>();
} else {
List<RoutingIfsTool> 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);
RoutingIfsTool tempItem = new RoutingIfsTool();
//设置参数
tempItem.setIfsRowId(tempMap.get("IFSROWID"));
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION"));
tempItem.setContract(tempMap.get("CONTRACT"));
tempItem.setPartNo(tempMap.get("PART_NO"));
tempItem.setRoutingType(tempMap.get("BOM_TYPE"));
tempItem.setRoutingRevision(tempMap.get("ROUTING_REVISION"));
tempItem.setAlternativeNo(tempMap.get("ALTERNATIVE_NO"));
tempItem.setOperationNo(tempMap.get("OPERATION_NO")); //
tempItem.setNoteText(tempMap.get("NOTE_TEXT"));
//添加对象
resultItems.add(tempItem);
}
return resultItems;
}
}
/** /**
* @description: 查询Routing Tool的所有信息 * @description: 查询Routing Tool的所有信息
* @author LR * @author LR
@ -942,6 +1057,59 @@ public class RoutingApi {
} }
} }
/**
* @description: 查询RoutingIfsGuideLine 集合
* @author LR
* @date 2025/5/21 15:42
* @version 1.0
*/
public static List<RoutingIfsGuideLine> getRoutingGuideLinesWithCopyPart(Server srv, String contract, String partNo) throws APException {
StringBuilder searchSql = new StringBuilder();
searchSql.append("SELECT rog.CONTRACT, rog.PART_NO, rog.ROUTING_REVISION, rog.BOM_TYPE, rog.ALTERNATIVE_NO, rot.OPERATION_NO, rog.GUIDELINE_NO,");
searchSql.append(" rog.GUIDELINE_SEQ, rog.OBJID ifsRowId, rog.OBJVERSION ifsRowVersion");
searchSql.append(" FROM IFSAPP.ROUTING_OPER_WORK_GUIDE rog");
searchSql.append(" LEFT JOIN IFSAPP.ROUTING_OPERATION_TOOL rot");
searchSql.append(" ON rot.CONTRACT = rog.CONTRACT AND rot.PART_NO = rog.PART_NO AND rot.ROUTING_REVISION = rog.ROUTING_REVISION ");
searchSql.append(" AND rot.BOM_TYPE = rog.BOM_TYPE AND rot.ALTERNATIVE_NO = rog.ALTERNATIVE_NO AND rot.OPERATION_ID = rog.OPERATION_ID");
searchSql.append(" WHERE rog.CONTRACT = :contract AND rog.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 new ArrayList<>();
} else {
List<RoutingIfsGuideLine> 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);
RoutingIfsGuideLine tempItem = new RoutingIfsGuideLine();
//设置参数
tempItem.setIfsRowId(tempMap.get("IFSROWID"));
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION"));
tempItem.setContract(tempMap.get("CONTRACT"));
tempItem.setPartNo(tempMap.get("PART_NO"));
tempItem.setRoutingType(tempMap.get("BOM_TYPE"));
tempItem.setRoutingRevision(tempMap.get("ROUTING_REVISION"));
tempItem.setAlternativeNo(tempMap.get("ALTERNATIVE_NO"));
tempItem.setOperationNo(tempMap.get("OPERATION_NO")); //
tempItem.setNoteText(tempMap.get("NOTE_TEXT"));
//添加对象
resultItems.add(tempItem);
}
return resultItems;
}
}
/** /**
* @description: 新增 Routing Guide Line * @description: 新增 Routing Guide Line
* @author LR * @author LR

92
src/main/java/com/spring/ifs/bean/RoutingServiceBean.java

@ -472,6 +472,39 @@ public class RoutingServiceBean {
return returnMap; return returnMap;
} }
/**
* @description: 查询工艺路线的组件信息
* @author LR
* @date 2025/5/21 15:59
* @version 1.0
*/
public Map<String, String> getRoutingItemsWithCopyPart(Server srv, RoutingIfsItem inData) {
//公共参数
Map<String, String> returnMap = new HashMap<>();
String contract = inData.getContract();
String partNo = inData.getPartNo();
try{
//查询结果集
List<RoutingIfsItem> resultList = RoutingApi.getRoutingItemsWithCopyPart(srv, contract, partNo);
//判断是否查询数据
if(resultList.isEmpty()) {
throw new APException("不存在此Routing组件信息!");
}
returnMap.put("resultCode", "200");
//打印日志
logger.info("Routing 明细查询数据:"+JSON.toJSONString(inData));
returnMap.put("obj", JSON.toJSONString(resultList));
} catch(APException e){
returnMap.put("resultCode", "400");
returnMap.put("resultMsg", e.getMessage());
logger.info("异常信息:"+e.getMessage());
}
//打印日志
logger.info("Routing替代明细集合结束:"+JSON.toJSONString(inData));
//返回结果集
return returnMap;
}
/** /**
* @description: 批量新增Routing Item * @description: 批量新增Routing Item
* @author LR * @author LR
@ -636,6 +669,65 @@ public class RoutingServiceBean {
return returnMap; return returnMap;
} }
/**
* @description: copy part 使用的方法
* @author LR
* @date 2025/5/21 16:01
* @version 1.0
*/
public Map<String, String> getRoutingToolsWithCopyPart(Server srv, RoutingIfsTool inData) {
logger.info("Routing Tools查询开始:"+JSON.toJSONString(inData));
//公共参数
Map<String, String> returnMap = new HashMap<>();
String contract = inData.getContract();
String partNo = inData.getPartNo();
try{
//循环处理
List<RoutingIfsTool> resultList = RoutingApi.getRoutingToolsWithCopyPart(srv, contract, partNo);
returnMap.put("resultCode", "200");
logger.info("Routing Tools查询到数据:"+JSON.toJSONString(inData));
returnMap.put("obj", JSON.toJSONString(resultList));
} catch(APException e){
returnMap.put("resultCode", "400");
returnMap.put("resultMsg", e.getMessage());
logger.info("异常信息:"+e.getMessage());
}
//打印日志
logger.info("Routing Tools查询结束:"+JSON.toJSONString(inData));
//返回结果集
return returnMap;
}
/**
* @description: copy part 使用的方法
* @author LR
* @date 2025/5/21 16:05
* @version 1.0
*/
public Map<String, String> getRoutingGuideLinesWithCopyPart(Server srv, RoutingIfsGuideLine inData) {
logger.info("Routing GuideLines查询开始:"+JSON.toJSONString(inData));
//公共参数
Map<String, String> returnMap = new HashMap<>();
String contract = inData.getContract();
String partNo = inData.getPartNo();
try{
//循环处理
List<RoutingIfsGuideLine> resultList = RoutingApi.getRoutingGuideLinesWithCopyPart(srv, contract, partNo);
returnMap.put("resultCode", "200");
logger.info("Routing GuideLines查询到数据:"+JSON.toJSONString(inData));
returnMap.put("obj", JSON.toJSONString(resultList));
} catch(APException e){
returnMap.put("resultCode", "400");
returnMap.put("resultMsg", e.getMessage());
logger.info("异常信息:"+e.getMessage());
}
//打印日志
logger.info("Routing GuideLines查询结束:"+JSON.toJSONString(inData));
//返回结果集
return returnMap;
}
/** /**
* @description: 批量新增 Routing Tool * @description: 批量新增 Routing Tool
* @author LR * @author LR

Loading…
Cancel
Save