Browse Source

技术等级成本查询 添加site的作为查询条件

master
Rui_Li 8 months ago
parent
commit
904d979abc
  1. 12
      src/main/java/com/spring/ifs/api/BaseSearchApi.java
  2. 6
      src/main/java/com/spring/ifs/api/BaseSearchApiTest.java
  3. 4
      src/main/java/com/spring/ifs/bean/BaseSearchBean.java
  4. 6
      src/main/java/com/spring/ifs/bean/BaseSearchBeanTest.java

12
src/main/java/com/spring/ifs/api/BaseSearchApi.java

@ -112,13 +112,13 @@ public class BaseSearchApi {
* @date 2024/12/12 11:23
* @version 1.0
*/
public static List<LocationInformationVo> getWarehouseLocations(Server srv, String siteCon, String ifsRowVersion, int startIndex, int pageSize) throws APException {
public static List<LocationInformationVo> getWarehouseLocations(Server srv, String siteCon, int startIndex, int pageSize) throws APException {
StringBuilder searchSql = new StringBuilder();
searchSql.append("SELECT contract site, location_no location_id, location_name, warehouse warehouse_id, 'Y' active, NULL create_date, 'admin' create_by,");
searchSql.append(" '' update_date, '' update_by, location_type location_type");
searchSql.append(" FROM ifsapp.INVENTORY_LOCATION14");
searchSql.append(" WHERE 1 = 1");
//添加判断的查询条
searchSql.append(" WHERE location_type = 'Picking'");
//添加判断的查询条
if(!(null == siteCon || "".equals(siteCon))) {
searchSql.append(" AND contract IN "+siteCon);
}
@ -128,6 +128,8 @@ public class BaseSearchApi {
searchSql.append(" ORDER BY contract, location_no");
//添加分页的查询语句
searchSql.append(" OFFSET "+startIndex+" ROWS FETCH NEXT "+pageSize+" ROWS ONLY");
//打印sql日志
logger.info("查询sql:"+searchSql.toString());
//调用查询的通用方法
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam);
//判断能否返回
@ -147,7 +149,7 @@ public class BaseSearchApi {
LocationInformationVo tempItem = new LocationInformationVo();
//设置参数
//tempItem.setIfsRowId(tempMap.get("IFSROWID"));
tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION"));
//tempItem.setIfsRowVersion(tempMap.get("IFSROWVERSION"));
tempItem.setSite(tempMap.get("SITE"));
tempItem.setLocationId(tempMap.get("LOCATION_ID"));
tempItem.setLocationName(tempMap.get("LOCATION_NAME"));
@ -550,7 +552,7 @@ public class BaseSearchApi {
searchSql.append(" NOTE_TEXT, LEAD_TIME_CODE, PURCH_LEADTIME, MANUF_LEADTIME, EXPECTED_LEADTIME, DURABILITY_DAY, COUNTRY_OF_ORIGIN, REGION_OF_ORIGIN,");
searchSql.append(" SUPPLY_CODE, INVENTORY_VALUATION_METHOD, INVENTORY_PART_COST_LEVEL, INVOICE_CONSIDERATION, ZERO_COST_FLAG, PART_COST_GROUP_ID,");
searchSql.append(" STD_NAME_ID, ENG_ATTRIBUTE");
searchSql.append(" FROM ifsapp.INVENTORY_PART");
searchSql.append(" FROM ifsapp.ƒ");
searchSql.append(" WHERE OBJVERSION >:ifsRowVersion");
//设置查询的入参

6
src/main/java/com/spring/ifs/api/BaseSearchApiTest.java

@ -111,12 +111,12 @@ public class BaseSearchApiTest {
* @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<WarehouseLocation> getWarehouseLocations(Server srv, String siteCon, int startIndex, int pageSize) throws APException {
StringBuilder searchSql = new StringBuilder();
searchSql.append("SELECT contract site, location_no location_id, location_name, warehouse warehouse_id, 'Y' active, NULL create_date, 'admin' create_by,");
searchSql.append(" '' update_date, '' update_by, location_type location_type");
searchSql.append(" FROM ifsapp.INVENTORY_LOCATION14");
searchSql.append(" WHERE 1 = 1");
searchSql.append(" WHERE location_type = 'Picking'");
//添加判断的查询条件
if(!(null == siteCon || "".equals(siteCon))) {
searchSql.append(" AND contract IN "+siteCon);
@ -127,6 +127,8 @@ public class BaseSearchApiTest {
searchSql.append(" ORDER BY contract, location_no");
//添加分页的查询语句
searchSql.append(" OFFSET "+startIndex+" ROWS FETCH NEXT "+pageSize+" ROWS ONLY");
//打印sql日志
logger.info("查询sql:"+searchSql.toString());
//调用查询的通用方法
RecordCollection recordCollection = IfsPlsqlUtils.execSqlSearchGetRecordCollection(srv, searchSql, inParam);
//判断能否返回

4
src/main/java/com/spring/ifs/bean/BaseSearchBean.java

@ -69,9 +69,9 @@ public class BaseSearchBean {
List<LocationInformationVo> resultList = new ArrayList<>();
int pageSize = 200;
//迭代查询
for(int i = 0; i < 10; i++){
for(int i = 0; i < 150; i++){
int startIndex = i * pageSize;
List<LocationInformationVo> tempList = BaseSearchApi.getWarehouseLocations(srv, siteCon, ifsRowVersion, startIndex, pageSize);
List<LocationInformationVo> tempList = BaseSearchApi.getWarehouseLocations(srv, siteCon, startIndex, pageSize);
//判断查询是否结束
if(tempList.size() > 0) {
resultList.addAll(tempList);

6
src/main/java/com/spring/ifs/bean/BaseSearchBeanTest.java

@ -79,9 +79,9 @@ public class BaseSearchBeanTest {
List<WarehouseLocation> resultList = new ArrayList<>();
int pageSize = 200;
//迭代查询
for(int i = 0; i < 10; i++){
for(int i = 0; i < 150; i++){
int startIndex = i * pageSize;
List<WarehouseLocation> tempList = BaseSearchApiTest.getWarehouseLocations(srv, siteCon, ifsRowVersion, startIndex, pageSize);
List<WarehouseLocation> tempList = BaseSearchApiTest.getWarehouseLocations(srv, siteCon, startIndex, pageSize);
//判断查询是否结束
if(tempList.size() > 0) {
resultList.addAll(tempList);
@ -298,7 +298,7 @@ public class BaseSearchBeanTest {
try {
Server srv = ifsServer.getIfsServer(username, password);
//迭代查询
for(int i = 0; i < 100; i++){
for(int i = 0; i < 150; i++){
int startIndex = i * pageSize;
List<PersonnelLevelVo> tempList = BaseSearchApi.getLaborClassCosts(srv, siteCon, startIndex, pageSize);
//判断查询是否结束

Loading…
Cancel
Save