|
|
|
@ -402,17 +402,13 @@ public class DepositoryController { |
|
|
|
Map<String, Object> depository_data = new HashMap<>(); |
|
|
|
|
|
|
|
depository_data.put("week", show_weekday); |
|
|
|
|
|
|
|
int threadSize = depositoryAllNameAndId.size(); |
|
|
|
ExecutorService exs = new ThreadPoolExecutor(threadSize, threadSize, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(threadSize)); |
|
|
|
// 结果集
|
|
|
|
List<Future<Object>> futureList = new ArrayList<Future<Object>>(); |
|
|
|
// 1.定义CompletionService
|
|
|
|
CompletionService<Object> completionService = new ExecutorCompletionService<Object>(exs); |
|
|
|
if ("0".equals(type)) { |
|
|
|
int threadSize = depositoryAllNameAndId.size(); |
|
|
|
ExecutorService exs = new ThreadPoolExecutor(threadSize, threadSize, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(threadSize)); |
|
|
|
|
|
|
|
// 结果集
|
|
|
|
List<Future<Object>> futureList = new ArrayList<Future<Object>>(); |
|
|
|
// 1.定义CompletionService
|
|
|
|
CompletionService<Object> completionService = new ExecutorCompletionService<Object>(exs); |
|
|
|
|
|
|
|
|
|
|
|
// 获取当前各仓库的库存数
|
|
|
|
List<InventoryByDname> toDayInventoryByDName = depositoryService.getToDayInventoryByDName(); |
|
|
|
while (it.hasNext()) { |
|
|
|
@ -433,15 +429,6 @@ public class DepositoryController { |
|
|
|
} |
|
|
|
depository_data.put("data", show_data); |
|
|
|
} else { |
|
|
|
// 定义线程
|
|
|
|
int threadSize = depositoryAllNameAndId.size(); |
|
|
|
ExecutorService exs = new ThreadPoolExecutor(threadSize, threadSize, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(threadSize)); |
|
|
|
|
|
|
|
// 结果集
|
|
|
|
List<Future<Object>> futureList = new ArrayList<Future<Object>>(); |
|
|
|
// 1.定义CompletionService
|
|
|
|
CompletionService<Object> completionService = new ExecutorCompletionService<Object>(exs); |
|
|
|
|
|
|
|
// 每天各仓库入库数目
|
|
|
|
while (it.hasNext()) { |
|
|
|
Object next = it.next(); |
|
|
|
@ -462,6 +449,8 @@ public class DepositoryController { |
|
|
|
depository_data.put("data", show_data); |
|
|
|
|
|
|
|
} |
|
|
|
// 关闭线程池
|
|
|
|
PublicConfig.closeThreadPool(exs); |
|
|
|
return depository_data; |
|
|
|
} |
|
|
|
|
|
|
|
@ -610,7 +599,8 @@ public class DepositoryController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} |
|
|
|
else { |
|
|
|
|
|
|
|
// 获取本周至今仓库的入/出库数量
|
|
|
|
Future<Object> futureForBarChartData = completionService.submit(new distributeTasks(depositoryAllNameAndId, type, 1, userByPort, depositoryName)); |
|
|
|
@ -638,6 +628,8 @@ public class DepositoryController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 关闭线程池
|
|
|
|
PublicConfig.closeThreadPool(exs); |
|
|
|
// 构造对应格式
|
|
|
|
depository_data.put("week", show_weekday); |
|
|
|
depository_data.put("lineChartData", lineChartData); |
|
|
|
@ -710,6 +702,9 @@ public class DepositoryController { |
|
|
|
show_data.putAll((Map<?, ?>) result); |
|
|
|
} |
|
|
|
|
|
|
|
// 关闭线程池
|
|
|
|
PublicConfig.closeThreadPool(exs); |
|
|
|
|
|
|
|
return show_data; |
|
|
|
} |
|
|
|
|
|
|
|
@ -744,6 +739,9 @@ public class DepositoryController { |
|
|
|
} |
|
|
|
result.add(obj); |
|
|
|
} |
|
|
|
|
|
|
|
// 关闭线程池
|
|
|
|
PublicConfig.closeThreadPool(exs); |
|
|
|
return result; |
|
|
|
} |
|
|
|
// 用于获取旭日图数据
|
|
|
|
@ -835,6 +833,8 @@ public class DepositoryController { |
|
|
|
stringObjectMap.put("itemStyle", itemStyle); |
|
|
|
result.add(stringObjectMap); |
|
|
|
} |
|
|
|
// 关闭线程池
|
|
|
|
PublicConfig.closeThreadPool(exs); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1252,6 +1252,8 @@ public class DepositoryController { |
|
|
|
} |
|
|
|
result.putAll((Map<?, ?>) obj); |
|
|
|
} |
|
|
|
// 关闭线程池
|
|
|
|
PublicConfig.closeThreadPool(exs); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1331,6 +1333,9 @@ public class DepositoryController { |
|
|
|
} |
|
|
|
show_data.putAll((Map<?, ?>) result); |
|
|
|
} |
|
|
|
|
|
|
|
// 关闭线程池
|
|
|
|
PublicConfig.closeThreadPool(exs); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1729,6 +1734,8 @@ public class DepositoryController { |
|
|
|
result.add(obj); |
|
|
|
sum += ObjectFormatUtil.toDouble(((Map<String, Object>) obj).get("value")); |
|
|
|
} |
|
|
|
// 关闭线程池
|
|
|
|
PublicConfig.closeThreadPool(exs); |
|
|
|
map.put("children", result); |
|
|
|
map.put("name", map.get("month")); |
|
|
|
map.remove("month"); |
|
|
|
|