|
|
|
@ -857,6 +857,69 @@ public class RoutingApi { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 同步数据查询routing 工具 |
|
|
|
* @author LR |
|
|
|
* @date 2025/7/4 16:34 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public static List<RoutingIfsTool> getRoutingToolsForSync(Server srv, String contract, String partNo, String routingRevision, |
|
|
|
String routingType, String alternativeNo, String operationNo) 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"); |
|
|
|
searchSql.append(" AND BOM_TYPE = :routingType AND ALTERNATIVE_NO = :alternativeNo"); |
|
|
|
|
|
|
|
//设置查询的入参 |
|
|
|
Map<String, String> inParam = new HashMap<>(); |
|
|
|
inParam.put("contract", contract); |
|
|
|
inParam.put("partNo", partNo); |
|
|
|
inParam.put("routingRevision", routingRevision); |
|
|
|
inParam.put("routingType", routingType); |
|
|
|
inParam.put("alternativeNo", alternativeNo); |
|
|
|
|
|
|
|
//添加判断的查询条件 |
|
|
|
if(!(null == operationNo || "".equals(operationNo))) { |
|
|
|
searchSql.append(" AND OPERATION_NO = :operationNo"); |
|
|
|
inParam.put("operationNo", operationNo); |
|
|
|
} |
|
|
|
//调用查询的通用方法 |
|
|
|
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.setToolId(tempMap.get("TOOL_ID")); // |
|
|
|
tempItem.setNoteText(tempMap.get("NOTE_TEXT")); |
|
|
|
//添加对象 |
|
|
|
resultItems.add(tempItem); |
|
|
|
} |
|
|
|
return resultItems; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 查询Routing Tool的所有信息 |
|
|
|
* @author LR |
|
|
|
@ -1114,6 +1177,66 @@ public class RoutingApi { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static List<RoutingIfsGuideLine> getRoutingGuideLinesForSync(Server srv, String contract, String partNo, String routingRevision, String routingType, String alternativeNo, String operationNo) 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 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 AND rog.ROUTING_REVISION = :routingRevision"); |
|
|
|
searchSql.append(" AND rog.BOM_TYPE = :routingType AND rog.ALTERNATIVE_NO = :alternativeNo"); |
|
|
|
|
|
|
|
//设置查询的入参 |
|
|
|
Map<String, String> inParam = new HashMap<>(); |
|
|
|
inParam.put("contract", contract); |
|
|
|
inParam.put("partNo", partNo); |
|
|
|
inParam.put("routingRevision", routingRevision); |
|
|
|
inParam.put("routingType", routingType); |
|
|
|
inParam.put("alternativeNo", alternativeNo); |
|
|
|
|
|
|
|
//添加判断的查询条件 |
|
|
|
if(!(null == operationNo || "".equals(operationNo))) { |
|
|
|
searchSql.append(" AND rog.OPERATION_NO = :operationNo"); |
|
|
|
inParam.put("operationNo", operationNo); |
|
|
|
} |
|
|
|
//调用查询的通用方法 |
|
|
|
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.setGuidelineSeq(tempMap.get("GUIDELINE_SEQ")); |
|
|
|
tempItem.setNoteText(tempMap.get("NOTE_TEXT")); |
|
|
|
//添加对象 |
|
|
|
resultItems.add(tempItem); |
|
|
|
} |
|
|
|
return resultItems; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 新增 Routing Guide Line |
|
|
|
* @author LR |
|
|
|
|