|
|
|
@ -3,6 +3,7 @@ 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.part.vo.InventoryPartUnitCostSumVo; |
|
|
|
import ifs.fnd.ap.APException; |
|
|
|
import ifs.fnd.ap.RecordCollection; |
|
|
|
import ifs.fnd.ap.Server; |
|
|
|
@ -325,4 +326,92 @@ public class BaseSearchApiTest { |
|
|
|
return resultItems; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 根据条件查询库存件的成本价 |
|
|
|
* @author LR |
|
|
|
* @date 2025/1/17 11:36 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public static InventoryValue getInventoryValueByPartNo(Server srv, String contract, String partNo) 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.CONTRACT = : contract AND pcs.PART_NO = :partNo AND pcs.CONFIGURATION_ID = '*'"); |
|
|
|
//设置查询的入参 |
|
|
|
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 { |
|
|
|
//调用通用的处理方法 返回Map |
|
|
|
Map<String, String> resultMap = IfsConverterToMap.ConverterIfsToMap(recordCollection.get(0)); |
|
|
|
InventoryValue resultRow = new InventoryValue(); |
|
|
|
//设置参数 |
|
|
|
resultRow.setIfsRowId(resultMap.get("IFSROWID")); |
|
|
|
resultRow.setIfsRowVersion(resultMap.get("IFSROWVERSION")); |
|
|
|
resultRow.setSite(resultMap.get("SITE")); |
|
|
|
resultRow.setPartNo(resultMap.get("PART_NO")); |
|
|
|
resultRow.setConfigurationId(resultMap.get("CONFIGURATION_ID")); |
|
|
|
resultRow.setLotBatchNo(resultMap.get("LOT_BATCH_NO")); |
|
|
|
resultRow.setSerialNo(resultMap.get("SERIAL_NO")); |
|
|
|
resultRow.setInventoryValue(resultMap.get("INVENTORYVALUE")); |
|
|
|
return resultRow; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 查询技术等级的属性列表 |
|
|
|
* @author LR |
|
|
|
* @date 2025/1/17 14:12 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public static List<TechnicalAttribute> getTechnicalAttributesByCon(Server srv, String technicalSpecNo) throws APException { |
|
|
|
StringBuilder searchSql = new StringBuilder(); |
|
|
|
searchSql.append("SELECT OBJID ifsRowId, OBJVERSION ifsRowVersion, TECHNICAL_SPEC_NO, TECHNICAL_CLASS, ATTRIB_NUMBER, ATTRIBUTE,"); |
|
|
|
searchSql.append(" VALUE_NO, LOWER_LIMIT, UPPER_LIMIT, INFO, ALT_VALUE_NO, ALT_UNIT,"); |
|
|
|
searchSql.append(" CASE WHEN objtype = 'TechnicalSpecNumeric' THEN 'Numeric'"); |
|
|
|
searchSql.append(" WHEN objtype = 'TechnicalSpecAlphanum' THEN 'Alpha' ELSE '' END attributeType"); |
|
|
|
searchSql.append(" FROM ifsapp.TECHNICAL_SPECIFICATION_BOTH"); |
|
|
|
searchSql.append(" WHERE TECHNICAL_SPEC_NO = :technicalSpecNo"); |
|
|
|
|
|
|
|
//设置查询的入参 |
|
|
|
Map<String, String> inParam = new HashMap<>(); |
|
|
|
inParam.put("technicalSpecNo", technicalSpecNo); |
|
|
|
//调用查询的通用方法 |
|
|
|
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam); |
|
|
|
//判断能否返回 |
|
|
|
if (recordCollection == null) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} else { |
|
|
|
List<TechnicalAttribute> technicalAttributes = new ArrayList<>(); |
|
|
|
//处理结果集 |
|
|
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
|
|
|
//获取数据转bean |
|
|
|
for (int i = 0; i < resultList.size(); i++) { |
|
|
|
Map<String, String> tempMap = resultList.get(i); |
|
|
|
TechnicalAttribute tempItem = new TechnicalAttribute(); |
|
|
|
//设置参数 |
|
|
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
|
|
|
tempItem.setTechnicalSpecNo(tempMap.get("TECHNICAL_SPEC_NO")); |
|
|
|
tempItem.setTechnicalClass(tempMap.get("TECHNICAL_CLASS")); |
|
|
|
tempItem.setAttribute(tempMap.get("ATTRIBUTE")); |
|
|
|
tempItem.setValueNo(tempMap.get("VALUE_NO")); |
|
|
|
tempItem.setLowerLimit(tempMap.get("LOWER_LIMIT")); |
|
|
|
tempItem.setUpperLimit(tempMap.get("UPPER_LIMIT")); |
|
|
|
tempItem.setInfo(tempMap.get("INFO")); |
|
|
|
tempItem.setAttributeType(tempMap.get("ATTRIBUTETYPE")); |
|
|
|
//添加对象 |
|
|
|
technicalAttributes.add(tempItem); |
|
|
|
} |
|
|
|
return technicalAttributes; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |