@ -769,6 +769,77 @@ public class BomApi {
}
}
}
}
/ * *
* @description : 查询使用的方法
* @author LR
* @date 2025 / 7 / 4 09 : 38
* @version 1 . 0
* /
public static List < BomIfsManufStructCostDistrib > getBomDistributionsForSync ( 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) componentPartNo," ) ;
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 new ArrayList < > ( ) ;
} else {
List < BomIfsManufStructCostDistrib > 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 ) ;
BomIfsManufStructCostDistrib tempItem = new BomIfsManufStructCostDistrib ( ) ;
/ / 设置参数
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" ) ) ;
BigDecimal itemValue = new BigDecimal ( tempMap . get ( "BYPRODLINEITEMNO" ) ) ;
itemValue = itemValue . setScale ( 0 , BigDecimal . ROUND_HALF_UP ) ;
itemValue = itemValue . stripTrailingZeros ( ) ;
String formatterValue = itemValue . toPlainString ( ) ;
tempItem . setByProdLineItemNo ( formatterValue ) ;
BigDecimal componentValue = new BigDecimal ( tempMap . get ( "COMPONENTLINEITEMNO" ) ) ;
componentValue = componentValue . setScale ( 0 , BigDecimal . ROUND_HALF_UP ) ;
componentValue = componentValue . stripTrailingZeros ( ) ;
String formatterComponentValue = componentValue . toPlainString ( ) ;
tempItem . setByProdLineItemNo ( formatterComponentValue ) ;
tempItem . setComponentPartNo ( tempMap . get ( "COMPONENTPARTNO" ) ) ;
tempItem . setItemCostDistribution ( tempMap . get ( "ITEMCOSTDISTRIBUTION" ) ) ;
/ / 添加对象
resultItems . add ( tempItem ) ;
}
return resultItems ;
}
}
/ * *
/ * *
* @description : 修改 Bom的副产品信息
* @description : 修改 Bom的副产品信息
* @author LR
* @author LR