|
|
|
@ -16,6 +16,8 @@ import ifs.fnd.ap.Server; |
|
|
|
import org.slf4j.Logger; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.MathContext; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
@ -237,6 +239,9 @@ public class BaseSearchApi { |
|
|
|
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,"); |
|
|
|
//2025-03-21 新增字段 |
|
|
|
searchSql.append(" PART_MAIN_GROUP, CONDITION_CODE_USAGE_DB, MULTILEVEL_TRACKING_DB, ALLOW_AS_NOT_CONSUMED_DB,"); |
|
|
|
searchSql.append(" LOT_QUANTITY_RULE, SUB_LOT_RULE, COMPONENT_LOT_RULE,"); |
|
|
|
searchSql.append(" OBJID ifsRowId, OBJVERSION ifsRowVersion"); |
|
|
|
searchSql.append(" FROM IFSAPP.PART_CATALOG pc"); |
|
|
|
//设置查询的入参 |
|
|
|
@ -265,16 +270,56 @@ public class BaseSearchApi { |
|
|
|
//设置参数 |
|
|
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
|
|
|
tempItem.setPartNo(tempMap.get("PART_NO")); |
|
|
|
tempItem.setPartNo(tempMap.get("PART_NO").trim()); |
|
|
|
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")); |
|
|
|
String weightNet = tempMap.get("WEIGHT_NET"); |
|
|
|
if (null == weightNet || "".equals(weightNet) ||"NULL".equalsIgnoreCase(weightNet)) { |
|
|
|
tempItem.setWeightNet(null); |
|
|
|
}else { |
|
|
|
BigDecimal weightNetNum = new BigDecimal(weightNet); |
|
|
|
MathContext mc = new MathContext(6, RoundingMode.HALF_UP); |
|
|
|
BigDecimal result = weightNetNum.round(mc); |
|
|
|
tempItem.setWeightNetNum(result); |
|
|
|
} |
|
|
|
|
|
|
|
tempItem.setUomForWeightNet(tempMap.get("UOM_FOR_WEIGHT_NET")); |
|
|
|
tempItem.setVolumeNet(tempMap.get("VOLUME_NET")); |
|
|
|
String volumeNet = tempMap.get("VOLUME_NET"); |
|
|
|
if (null == volumeNet || "".equals(volumeNet) ||"NULL".equalsIgnoreCase(volumeNet)) { |
|
|
|
tempItem.setVolumeNet(null); |
|
|
|
}else { |
|
|
|
BigDecimal volumeNetNum = new BigDecimal(volumeNet); |
|
|
|
MathContext mc = new MathContext(6, RoundingMode.HALF_UP); |
|
|
|
BigDecimal result = volumeNetNum.round(mc); |
|
|
|
tempItem.setVolumeNetNum(result); |
|
|
|
} |
|
|
|
tempItem.setUomForVolumeNet(tempMap.get("UOM_FOR_VOLUME_NET")); |
|
|
|
//新增字段 |
|
|
|
tempItem.setPartMainGroup(tempMap.get("PART_MAIN_GROUP")); |
|
|
|
String conditionCodeUsageDb = tempMap.get("CONDITION_CODE_USAGE_DB"); |
|
|
|
if ("ALLOW_COND_CODE".equalsIgnoreCase(conditionCodeUsageDb)) { |
|
|
|
tempItem.setConditionCodeUsageDb("Y"); |
|
|
|
}else { |
|
|
|
tempItem.setConditionCodeUsageDb("N"); |
|
|
|
} |
|
|
|
String multilevelTrackingDb = tempMap.get("MULTILEVEL_TRACKING_DB"); |
|
|
|
if ("TRACKING_ON".equalsIgnoreCase(multilevelTrackingDb)) { |
|
|
|
tempItem.setMultilevelTrackingDb("Y"); |
|
|
|
}else { |
|
|
|
tempItem.setMultilevelTrackingDb("N"); |
|
|
|
} |
|
|
|
String allowAsNotConsumedDb = tempMap.get("ALLOW_AS_NOT_CONSUMED_DB"); |
|
|
|
if ("TRUE".equalsIgnoreCase(allowAsNotConsumedDb)) { |
|
|
|
tempItem.setAllowAsNotConsumedDb("Y"); |
|
|
|
}else { |
|
|
|
tempItem.setAllowAsNotConsumedDb("N"); |
|
|
|
} |
|
|
|
|
|
|
|
tempItem.setLotQuantityRule(tempMap.get("LOT_QUANTITY_RULE")); |
|
|
|
tempItem.setSubLotRule(tempMap.get("SUB_LOT_RULE")); |
|
|
|
tempItem.setComponentLotRule(tempMap.get("COMPONENT_LOT_RULE")); |
|
|
|
//添加对象 |
|
|
|
resultItems.add(tempItem); |
|
|
|
} |
|
|
|
|