|
|
|
@ -1,12 +1,18 @@ |
|
|
|
package com.spring.ifs.api; |
|
|
|
|
|
|
|
import com.spring.common.utils.DateUtils; |
|
|
|
import com.spring.ifs.data.*; |
|
|
|
import com.spring.ifs.utils.IfsConverterToMap; |
|
|
|
import com.spring.ifs.utils.IfsPlsqlUtils; |
|
|
|
import com.spring.modules.base.vo.PersonnelLevelVo; |
|
|
|
import com.spring.modules.part.vo.InventoryPartUnitCostSumVo; |
|
|
|
import com.spring.modules.part.vo.LocationInformationVo; |
|
|
|
import com.spring.modules.part.vo.WorkCenterVo; |
|
|
|
import ifs.fnd.ap.APException; |
|
|
|
import ifs.fnd.ap.RecordCollection; |
|
|
|
import ifs.fnd.ap.Server; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
@ -26,7 +32,7 @@ public class BaseSearchApi { |
|
|
|
* @date 2024/12/12 11:02 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public static List<WorkCenter> getWorkCenterNos(Server srv, String siteCon, String ifsRowVersion) throws APException { |
|
|
|
public static List<WorkCenterVo> getWorkCenterNos(Server srv, String siteCon, String ifsRowVersion) throws APException { |
|
|
|
StringBuilder searchSql = new StringBuilder(); |
|
|
|
searchSql.append("SELECT wc.contract site, wc.work_center_no, wc.description work_center_desc, wc.work_center_code_db,"); |
|
|
|
searchSql.append(" (CASE WHEN work_center_code_db='I' THEN '内部' ELSE '外部' END) work_center_type, 100 efficiency,"); |
|
|
|
@ -55,7 +61,7 @@ public class BaseSearchApi { |
|
|
|
if (recordCollection == null) { |
|
|
|
return null; |
|
|
|
} else { |
|
|
|
List<WorkCenter> resultItems = new ArrayList<>(); |
|
|
|
List<WorkCenterVo> resultItems = new ArrayList<>(); |
|
|
|
//调用通用的处理方法 返回Map |
|
|
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
|
|
|
//判断是否存在数据 |
|
|
|
@ -65,24 +71,24 @@ public class BaseSearchApi { |
|
|
|
//获取数据转bean |
|
|
|
for (int i = 0; i < resultList.size(); i++) { |
|
|
|
Map<String, String> tempMap = resultList.get(i); |
|
|
|
WorkCenter tempItem = new WorkCenter(); |
|
|
|
WorkCenterVo tempItem = new WorkCenterVo(); |
|
|
|
//设置参数 |
|
|
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
//tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
|
|
|
tempItem.setSite(tempMap.get("SITE")); |
|
|
|
tempItem.setWorkCenterNo(tempMap.get("WORK_CENTER_NO")); |
|
|
|
tempItem.setWorkCenterDesc(tempMap.get("WORK_CENTER_DESC")); |
|
|
|
tempItem.setWorkCenterTypeDb(tempMap.get("WORK_CENTER_CODE_DB")); |
|
|
|
tempItem.setWorkCenterTypeDB(tempMap.get("WORK_CENTER_CODE_DB")); |
|
|
|
tempItem.setWorkCenterType(tempMap.get("WORK_CENTER_TYPE")); |
|
|
|
tempItem.setAverageCapacity(tempMap.get("AVERAGECAPACITY")); |
|
|
|
tempItem.setEfficiency(tempMap.get("EFFICIENCY")); |
|
|
|
tempItem.setUtilization(tempMap.get("UTILIZATION")); |
|
|
|
tempItem.setCapacityTypeDb(tempMap.get("CAPACITY_TYPE_DB")); |
|
|
|
tempItem.setAverageCapacity(new BigDecimal(tempMap.get("AVERAGECAPACITY"))); |
|
|
|
tempItem.setEfficiency(new BigDecimal(tempMap.get("EFFICIENCY"))); |
|
|
|
tempItem.setUtilization(new BigDecimal(tempMap.get("UTILIZATION"))); |
|
|
|
tempItem.setCapacityTypeDB(tempMap.get("CAPACITY_TYPE_DB")); |
|
|
|
tempItem.setCapacityType(tempMap.get("CAPACITY_TYPE")); |
|
|
|
tempItem.setUmId(tempMap.get("UM_ID")); |
|
|
|
tempItem.setActive(tempMap.get("ACTIVE")); |
|
|
|
tempItem.setRemark(tempMap.get("REMARK")); |
|
|
|
tempItem.setCreatedDate(tempMap.get("CREATED_DATE")); |
|
|
|
tempItem.setCreatedDate(DateUtils.getStringToDate(tempMap.get("CREATED_DATE"), "yyyy-MM-dd HH:mm:ss")); |
|
|
|
tempItem.setProLineNo(tempMap.get("PRO_LINE_NO")); |
|
|
|
tempItem.setCanCreateNewRollFlag(tempMap.get("CAN_CREATE_NEW_ROLL_FLAG")); |
|
|
|
tempItem.setNeedSetupFlag(tempMap.get("NEED_SETUP_FLAG")); |
|
|
|
@ -99,7 +105,7 @@ public class BaseSearchApi { |
|
|
|
* @date 2024/12/12 11:23 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public static List<WarehouseLocation> getWarehouseLocations(Server srv, String siteCon, String ifsRowVersion, int startIndex, int pageSize) throws APException { |
|
|
|
public static List<LocationInformationVo> getWarehouseLocations(Server srv, String siteCon, String ifsRowVersion, int startIndex, int pageSize) throws APException { |
|
|
|
StringBuilder searchSql = new StringBuilder(); |
|
|
|
searchSql.append("SELECT wbb.contract site, wbb.location_no location_id, wbb.description location_name, wbb.warehouse_id, 'Y' active, NULL create_date, 'admin' create_by,"); |
|
|
|
searchSql.append(" NULL update_date, NULL update_by, ilt.inventory_location_type location_type, wbb.objid ifsRowId, wbb.OBJVERSION ifsRowVersion"); |
|
|
|
@ -125,7 +131,7 @@ public class BaseSearchApi { |
|
|
|
if (recordCollection == null) { |
|
|
|
return null; |
|
|
|
} else { |
|
|
|
List<WarehouseLocation> resultItems = new ArrayList<>(); |
|
|
|
List<LocationInformationVo> resultItems = new ArrayList<>(); |
|
|
|
//调用通用的处理方法 返回Map |
|
|
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
|
|
|
//判断是否存在数据 |
|
|
|
@ -135,19 +141,19 @@ public class BaseSearchApi { |
|
|
|
//获取数据转bean |
|
|
|
for (int i = 0; i < resultList.size(); i++) { |
|
|
|
Map<String, String> tempMap = resultList.get(i); |
|
|
|
WarehouseLocation tempItem = new WarehouseLocation(); |
|
|
|
LocationInformationVo tempItem = new LocationInformationVo(); |
|
|
|
//设置参数 |
|
|
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
//tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
|
|
|
tempItem.setSite(tempMap.get("SITE")); |
|
|
|
tempItem.setLocationId(tempMap.get("LOCATION_ID")); |
|
|
|
tempItem.setLocationName(tempMap.get("LOCATION_NAME")); |
|
|
|
tempItem.setWarehouseId(tempMap.get("WAREHOUSE_ID")); |
|
|
|
tempItem.setActive(tempMap.get("ACTIVE")); |
|
|
|
tempItem.setCreateDate(tempMap.get("CREATE_DATE")); // 从tempMap获取值,不再直接设为null |
|
|
|
tempItem.setCreateBy(tempMap.get("CREATE_BY")); // 注意:字段名也改为大写 |
|
|
|
tempItem.setUpdateDate(tempMap.get("UPDATE_DATE")); // 从tempMap获取值,不再直接设为null |
|
|
|
tempItem.setUpdateBy(tempMap.get("UPDATE_BY"));//直接设为null,因为SQL中对应字段是NULL |
|
|
|
tempItem.setCreateDate(null); // 从tempMap获取值,不再直接设为null |
|
|
|
tempItem.setCreateBy("admin"); // 注意:字段名也改为大写 |
|
|
|
tempItem.setUpdateDate(null); // 从tempMap获取值,不再直接设为null |
|
|
|
tempItem.setUpdateBy(null);//直接设为null,因为SQL中对应字段是NULL |
|
|
|
tempItem.setLocationType(tempMap.get("LOCATION_TYPE")); |
|
|
|
//添加对象 |
|
|
|
resultItems.add(tempItem); |
|
|
|
@ -162,7 +168,7 @@ public class BaseSearchApi { |
|
|
|
* @date 2024/12/12 11:27 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public static List<LaborClass> getIfsLaborClasss(Server srv, String siteCon, String ifsRowVersion) throws APException { |
|
|
|
public static List<PersonnelLevelVo> getIfsLaborClasss(Server srv, String siteCon, String ifsRowVersion) throws APException { |
|
|
|
StringBuilder searchSql = new StringBuilder(); |
|
|
|
searchSql.append("SELECT lc.contract site, lc.labor_class_no level_id, lc.labor_class_description level_desc,"); |
|
|
|
searchSql.append(" (CASE WHEN lc.objstate = 'Active' THEN 'Y' ELSE 'N' END) active, sysdate create_date, 'Admin' create_by,"); |
|
|
|
@ -186,7 +192,7 @@ public class BaseSearchApi { |
|
|
|
if (recordCollection == null) { |
|
|
|
return null; |
|
|
|
} else { |
|
|
|
List<LaborClass> resultItems = new ArrayList<>(); |
|
|
|
List<PersonnelLevelVo> resultItems = new ArrayList<>(); |
|
|
|
//调用通用的处理方法 返回Map |
|
|
|
List<Map<String, String>> resultList = IfsConverterToMap.ConverterIfsToList(recordCollection); |
|
|
|
//判断是否存在数据 |
|
|
|
@ -196,19 +202,19 @@ public class BaseSearchApi { |
|
|
|
//获取数据转bean |
|
|
|
for (int i = 0; i < resultList.size(); i++) { |
|
|
|
Map<String, String> tempMap = resultList.get(i); |
|
|
|
LaborClass tempItem = new LaborClass(); |
|
|
|
PersonnelLevelVo tempItem = new PersonnelLevelVo(); |
|
|
|
//设置参数 |
|
|
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
//tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
|
|
|
tempItem.setSite(tempMap.get("SITE")); |
|
|
|
tempItem.setLevelId(tempMap.get("LEVEL_ID")); |
|
|
|
tempItem.setLevelDesc(tempMap.get("LEVEL_DESC")); |
|
|
|
tempItem.setActive(tempMap.get("ACTIVE")); |
|
|
|
tempItem.setCreateDate(tempMap.get("CREATE_DATE")); // 从tempMap获取值 |
|
|
|
tempItem.setCreateDate(DateUtils.getStringToDate(tempMap.get("CREATE_DATE"), "yyyy-MM-dd HH:mm:ss")); // 从tempMap获取值 |
|
|
|
tempItem.setCreateBy(tempMap.get("CREATE_BY")); // 注意:字段名也改为大写 |
|
|
|
tempItem.setUpdateDate(tempMap.get("UPDATE_DATE")); // 从tempMap获取值 |
|
|
|
tempItem.setUpdateDate(null); // 从tempMap获取值 |
|
|
|
tempItem.setUpdateBy(tempMap.get("UPDATE_BY")); // 从tempMap获取值 |
|
|
|
tempItem.setLevelCost(tempMap.get("LEVEL_COST")); // 获取成本值 |
|
|
|
tempItem.setLevelCost(new BigDecimal(tempMap.get("LEVEL_COST"))); // 获取成本值 |
|
|
|
//添加对象 |
|
|
|
resultItems.add(tempItem); |
|
|
|
} |
|
|
|
@ -277,7 +283,7 @@ public class BaseSearchApi { |
|
|
|
* @date 2024/12/12 11:38 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public static List<InventoryValue> getInventoryValues(Server srv, String siteCon, String ifsRowVersion, int startIndex, int pageSize) throws APException { |
|
|
|
public static List<InventoryPartUnitCostSumVo> getInventoryValues(Server srv, String siteCon, String ifsRowVersion, int startIndex, int pageSize) 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"); |
|
|
|
@ -303,15 +309,15 @@ public class BaseSearchApi { |
|
|
|
if (recordCollection == null) { |
|
|
|
return null; |
|
|
|
} else { |
|
|
|
List<InventoryValue> resultItems = new ArrayList<>(); |
|
|
|
List<InventoryPartUnitCostSumVo> 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); |
|
|
|
InventoryValue tempItem = new InventoryValue(); |
|
|
|
InventoryPartUnitCostSumVo tempItem = new InventoryPartUnitCostSumVo(); |
|
|
|
//设置参数 |
|
|
|
tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
//tempItem.setIfsRowId(tempMap.get("IFSROWID")); |
|
|
|
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION")); |
|
|
|
tempItem.setSite(tempMap.get("SITE")); |
|
|
|
tempItem.setPartNo(tempMap.get("PART_NO")); |
|
|
|
|