|
|
@ -17,6 +17,7 @@ import ifs.fnd.ap.Server; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
import java.time.LocalDateTime; |
|
|
@ -34,6 +35,8 @@ public class BaseSearchBean { |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private IfsServer ifsServer; |
|
|
private IfsServer ifsServer; |
|
|
|
|
|
@Value("${ifs-api.max_Hours}") |
|
|
|
|
|
private long maxHours; |
|
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(BaseSearchBean.class); |
|
|
private static final Logger logger = LoggerFactory.getLogger(BaseSearchBean.class); |
|
|
|
|
|
|
|
|
@ -285,20 +288,23 @@ public class BaseSearchBean { |
|
|
logger.info("库存件查询的请求参数:"+ifsRowVersion); |
|
|
logger.info("库存件查询的请求参数:"+ifsRowVersion); |
|
|
LocalDateTime ifsTimeRevision = LocalDateTime.parse(ifsRowVersion, formatter); |
|
|
LocalDateTime ifsTimeRevision = LocalDateTime.parse(ifsRowVersion, formatter); |
|
|
//获取一天前的时间 |
|
|
//获取一天前的时间 |
|
|
LocalDateTime localDateTime = LocalDateTime.now().minusDays(1); |
|
|
|
|
|
|
|
|
//LocalDateTime localDateTime = LocalDateTime.now().minusDays(1); |
|
|
|
|
|
LocalDateTime localDateTime = LocalDateTime.now().minusHours(maxHours); |
|
|
LocalDateTime minTime = localDateTime.isBefore(ifsTimeRevision) ? localDateTime : ifsTimeRevision; |
|
|
LocalDateTime minTime = localDateTime.isBefore(ifsTimeRevision) ? localDateTime : ifsTimeRevision; |
|
|
String ifsRowVersionSearch = minTime.format(formatter); |
|
|
String ifsRowVersionSearch = minTime.format(formatter); |
|
|
logger.info("库存件查询的请求参数:"+ifsRowVersionSearch); |
|
|
logger.info("库存件查询的请求参数:"+ifsRowVersionSearch); |
|
|
List<PartIfsInventory> resultList = new ArrayList<>(); |
|
|
List<PartIfsInventory> resultList = new ArrayList<>(); |
|
|
int pageSize = 200; |
|
|
int pageSize = 200; |
|
|
//迭代查询 |
|
|
//迭代查询 |
|
|
for(int i = 0; i < 10; i++){ |
|
|
|
|
|
|
|
|
for(int i = 0; ; i++){ //不再限制返回的数量 |
|
|
int startIndex = i * pageSize; |
|
|
int startIndex = i * pageSize; |
|
|
List<PartIfsInventory> tempList = BaseSearchApi.getInventoryParts(srv, ifsRowVersionSearch, startIndex, pageSize); |
|
|
List<PartIfsInventory> tempList = BaseSearchApi.getInventoryParts(srv, ifsRowVersionSearch, startIndex, pageSize); |
|
|
//判断查询是否结束 |
|
|
//判断查询是否结束 |
|
|
if(tempList.size() > 0) { |
|
|
if(tempList.size() > 0) { |
|
|
|
|
|
logger.info("Inventory Part Page Search Nums: {},Search List Size: {}", i+1,tempList.size()); |
|
|
resultList.addAll(tempList); |
|
|
resultList.addAll(tempList); |
|
|
}else { |
|
|
}else { |
|
|
|
|
|
logger.info("Inventory Part Page Search End Nums: {}", i+1); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -315,6 +321,7 @@ public class BaseSearchBean { |
|
|
checkMap.put(key, returnList.size() - 1); |
|
|
checkMap.put(key, returnList.size() - 1); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
logger.info("Inventory Part Page Search Count Nums: {}", returnList.size()); |
|
|
logger.info("返回集合大小:"+returnList.size()); |
|
|
logger.info("返回集合大小:"+returnList.size()); |
|
|
return returnList; |
|
|
return returnList; |
|
|
} |
|
|
} |
|
|
|