|
|
|
|
@@ -98,25 +98,25 @@ public class AutoQueryProudDayData {
|
|
|
|
|
List<JSONObject> collect = allIvtList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(item.getString("stor_id")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
json.put("TotalInventory", collect.isEmpty() ? "0" : NumberUtil.round(collect.get(0).getString("num"), 2)+"");
|
|
|
|
|
json.put("TotalInventory", collect.isEmpty() ? "0.00" : NumberUtil.round(collect.get(0).getString("num"), 2)+"");
|
|
|
|
|
|
|
|
|
|
// 超期库存
|
|
|
|
|
List<JSONObject> collect2 = sidIvtList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(item.getString("stor_id")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
json.put("OverdueInventory", collect2.isEmpty() ? "0" : NumberUtil.round(collect2.get(0).getString("num"),2)+"");
|
|
|
|
|
json.put("OverdueInventory", collect2.isEmpty() ? "0.00" : NumberUtil.round(collect2.get(0).getString("num"),2)+"");
|
|
|
|
|
|
|
|
|
|
// 临期库存
|
|
|
|
|
List<JSONObject> collect3 = faceIvtList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(item.getString("stor_id")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
json.put("InterimInventory", collect3.isEmpty() ? "0" : NumberUtil.round(collect3.get(0).getString("num"),2)+"");
|
|
|
|
|
json.put("InterimInventory", collect3.isEmpty() ? "0.00" : NumberUtil.round(collect3.get(0).getString("num"),2)+"");
|
|
|
|
|
|
|
|
|
|
// 正常库存
|
|
|
|
|
List<JSONObject> collect4 = regIvtList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(item.getString("stor_id")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
json.put("NormalStockAge", collect4.isEmpty() ? "0" : NumberUtil.round(collect4.get(0).getString("num"),2)+"");
|
|
|
|
|
json.put("NormalStockAge", collect4.isEmpty() ? "0.00" : NumberUtil.round(collect4.get(0).getString("num"),2)+"");
|
|
|
|
|
|
|
|
|
|
Arrayobject1.add(json);
|
|
|
|
|
}
|
|
|
|
|
@@ -125,10 +125,10 @@ public class AutoQueryProudDayData {
|
|
|
|
|
JSONObject allIvt = new JSONObject();
|
|
|
|
|
allIvt.put("local", "汇总");
|
|
|
|
|
;
|
|
|
|
|
allIvt.put("TotalInventory", NumberUtil.round(Arrayobject1.stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row)).getDoubleValue("TotalInventory")).reduce(Double::sum).orElse(0.0).toString(), 2)+"");
|
|
|
|
|
allIvt.put("OverdueInventory", NumberUtil.round(Arrayobject1.stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row)).getDoubleValue("OverdueInventory")).reduce(Double::sum).orElse(0.0).toString(), 2)+"");
|
|
|
|
|
allIvt.put("InterimInventory", NumberUtil.round(Arrayobject1.stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row)).getDoubleValue("InterimInventory")).reduce(Double::sum).orElse(0.0).toString(), 2)+"");
|
|
|
|
|
allIvt.put("NormalStockAge", NumberUtil.round(Arrayobject1.stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row)).getDoubleValue("NormalStockAge")).reduce(Double::sum).orElse(0.0).toString(), 2)+"");
|
|
|
|
|
allIvt.put("TotalInventory", NumberUtil.round(Arrayobject1.stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row)).getDoubleValue("TotalInventory")).reduce(Double::sum).orElse(0.00).toString(), 2)+"");
|
|
|
|
|
allIvt.put("OverdueInventory", NumberUtil.round(Arrayobject1.stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row)).getDoubleValue("OverdueInventory")).reduce(Double::sum).orElse(0.00).toString(), 2)+"");
|
|
|
|
|
allIvt.put("InterimInventory", NumberUtil.round(Arrayobject1.stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row)).getDoubleValue("InterimInventory")).reduce(Double::sum).orElse(0.00).toString(), 2)+"");
|
|
|
|
|
allIvt.put("NormalStockAge", NumberUtil.round(Arrayobject1.stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row)).getDoubleValue("NormalStockAge")).reduce(Double::sum).orElse(0.00).toString(), 2)+"");
|
|
|
|
|
Arrayobject1.add(allIvt);
|
|
|
|
|
result.put("Arrayobject1",Arrayobject1);
|
|
|
|
|
|
|
|
|
|
@@ -194,19 +194,19 @@ public class AutoQueryProudDayData {
|
|
|
|
|
List<JSONObject> collectB = custIvtBList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(item.getString("stor_id")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
json.put("Customernventory1", collectB.isEmpty() ? "0" : NumberUtil.round(collectB.get(0).getString("num"), 2)+"");
|
|
|
|
|
json.put("Customernventory1", collectB.isEmpty() ? "0.00" : NumberUtil.round(collectB.get(0).getString("num"), 2)+"");
|
|
|
|
|
|
|
|
|
|
// C库存
|
|
|
|
|
List<JSONObject> collectC = custIvtCList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(item.getString("stor_id")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
json.put("Customernventory2", collectC.isEmpty() ? "0" : NumberUtil.round(collectC.get(0).getString("num"), 2)+"");
|
|
|
|
|
json.put("Customernventory2", collectC.isEmpty() ? "0.00" : NumberUtil.round(collectC.get(0).getString("num"), 2)+"");
|
|
|
|
|
|
|
|
|
|
// 其他库存
|
|
|
|
|
List<JSONObject> collectOthen = custIvtOtherList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(item.getString("stor_id")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
json.put("Customernventory3", collectOthen.isEmpty() ? "0" : NumberUtil.round(collectOthen.get(0).getString("num"), 2)+"");
|
|
|
|
|
json.put("Customernventory3", collectOthen.isEmpty() ? "0.00" : NumberUtil.round(collectOthen.get(0).getString("num"), 2)+"");
|
|
|
|
|
|
|
|
|
|
Arrayobject2.add(json);
|
|
|
|
|
}
|
|
|
|
|
@@ -236,11 +236,11 @@ public class AutoQueryProudDayData {
|
|
|
|
|
JSONArray Arrayobject3 = new JSONArray();
|
|
|
|
|
|
|
|
|
|
JSONObject changeIvt = new JSONObject();
|
|
|
|
|
changeIvt.put("Customer1", "兰州仓库(除BC)");
|
|
|
|
|
changeIvt.put("Customer2", "兰州二期仓库(除BC)");
|
|
|
|
|
changeIvt.put("Customer1", "兰州一期仓(除BC)");
|
|
|
|
|
changeIvt.put("Customer2", "兰州二期仓(除BC)");
|
|
|
|
|
changeIvt.put("Customer3", "东莞仓");
|
|
|
|
|
changeIvt.put("Customer4", "兰州仓B客户");
|
|
|
|
|
changeIvt.put("Customer5", "兰州仓C客户");
|
|
|
|
|
changeIvt.put("Customer4", "兰州仓B");
|
|
|
|
|
changeIvt.put("Customer5", "兰州仓C");
|
|
|
|
|
Arrayobject3.add(changeIvt);
|
|
|
|
|
result.put("Arrayobject3", Arrayobject3);
|
|
|
|
|
|
|
|
|
|
@@ -540,12 +540,12 @@ public class AutoQueryProudDayData {
|
|
|
|
|
.collect(Collectors.groupingBy(row -> row.getString("region_code")));
|
|
|
|
|
|
|
|
|
|
if (paramMap.isEmpty()) {
|
|
|
|
|
result.put("Areaqty1","0");
|
|
|
|
|
result.put("Areaqty2","0");
|
|
|
|
|
result.put("Areaqty3","0");
|
|
|
|
|
result.put("Areaqty4","0");
|
|
|
|
|
result.put("Areaqty5","0");
|
|
|
|
|
result.put("Areaqty6","0");
|
|
|
|
|
result.put("Areaqty1","0.00");
|
|
|
|
|
result.put("Areaqty2","0.00");
|
|
|
|
|
result.put("Areaqty3","0.00");
|
|
|
|
|
result.put("Areaqty4","0.00");
|
|
|
|
|
result.put("Areaqty5","0.00");
|
|
|
|
|
result.put("Areaqty6","0.00");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (String region_code : paramMap.keySet()) {
|
|
|
|
|
@@ -566,22 +566,22 @@ public class AutoQueryProudDayData {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty1"))) {
|
|
|
|
|
result.put("Areaqty1","0");
|
|
|
|
|
result.put("Areaqty1","0.00");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty2"))) {
|
|
|
|
|
result.put("Areaqty2","0");
|
|
|
|
|
result.put("Areaqty2","0.00");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty3"))) {
|
|
|
|
|
result.put("Areaqty3","0");
|
|
|
|
|
result.put("Areaqty3","0.00");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty4"))) {
|
|
|
|
|
result.put("Areaqty4","0");
|
|
|
|
|
result.put("Areaqty4","0.00");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty5"))) {
|
|
|
|
|
result.put("Areaqty5","0");
|
|
|
|
|
result.put("Areaqty5","0.00");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty6"))) {
|
|
|
|
|
result.put("Areaqty6","0");
|
|
|
|
|
result.put("Areaqty6","0.00");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
@@ -603,12 +603,12 @@ public class AutoQueryProudDayData {
|
|
|
|
|
.collect(Collectors.groupingBy(row -> row.getString("region_code")));
|
|
|
|
|
|
|
|
|
|
if (paramMap.isEmpty()) {
|
|
|
|
|
result.put("Areaqty1","0");
|
|
|
|
|
result.put("Areaqty2","0");
|
|
|
|
|
result.put("Areaqty3","0");
|
|
|
|
|
result.put("Areaqty4","0");
|
|
|
|
|
result.put("Areaqty5","0");
|
|
|
|
|
result.put("Areaqty6","0");
|
|
|
|
|
result.put("Areaqty1","0.00");
|
|
|
|
|
result.put("Areaqty2","0.00");
|
|
|
|
|
result.put("Areaqty3","0.00");
|
|
|
|
|
result.put("Areaqty4","0.00");
|
|
|
|
|
result.put("Areaqty5","0.00");
|
|
|
|
|
result.put("Areaqty6","0.00");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (String region_code : paramMap.keySet()) {
|
|
|
|
|
@@ -634,22 +634,22 @@ public class AutoQueryProudDayData {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty1"))) {
|
|
|
|
|
result.put("Areaqty1","0");
|
|
|
|
|
result.put("Areaqty1","0.00");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty2"))) {
|
|
|
|
|
result.put("Areaqty2","0");
|
|
|
|
|
result.put("Areaqty2","0.00");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty3"))) {
|
|
|
|
|
result.put("Areaqty3","0");
|
|
|
|
|
result.put("Areaqty3","0.00");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty4"))) {
|
|
|
|
|
result.put("Areaqty4","0");
|
|
|
|
|
result.put("Areaqty4","0.00");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty5"))) {
|
|
|
|
|
result.put("Areaqty5","0");
|
|
|
|
|
result.put("Areaqty5","0.00");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isEmpty(result.getString("Areaqty6"))) {
|
|
|
|
|
result.put("Areaqty6", "0");
|
|
|
|
|
result.put("Areaqty6", "0.00");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
@@ -671,34 +671,34 @@ public class AutoQueryProudDayData {
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(AutoQueryEnum.AC01.getId()))
|
|
|
|
|
.filter(row -> !custBandC.contains(row.getString("customer_name")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
result.put("Customerqty1", NumberUtil.round(collect.stream().map(row -> row.getDoubleValue("num")).reduce(Double::sum).orElse(0.0).toString(), 2)+"");
|
|
|
|
|
result.put("Customerqty1", NumberUtil.round(collect.stream().map(row -> row.getDoubleValue("num")).reduce(Double::sum).orElse(0.00).toString(), 2)+"");
|
|
|
|
|
|
|
|
|
|
// 兰州二期仓(除BC)
|
|
|
|
|
List<JSONObject> collect2 = dataList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(AutoQueryEnum.BC01.getId()))
|
|
|
|
|
.filter(row -> !custBandC.contains(row.getString("customer_name")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
result.put("Customerqty2", NumberUtil.round(collect2.stream().map(row -> row.getDoubleValue("num")).reduce(Double::sum).orElse(0.0).toString(), 2)+"");
|
|
|
|
|
result.put("Customerqty2", NumberUtil.round(collect2.stream().map(row -> row.getDoubleValue("num")).reduce(Double::sum).orElse(0.00).toString(), 2)+"");
|
|
|
|
|
|
|
|
|
|
// 东莞仓
|
|
|
|
|
List<JSONObject> collect3 = dataList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(AutoQueryEnum.WK01.getId()))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
result.put("Customerqty3", NumberUtil.round(collect3.stream().map(row -> row.getDoubleValue("num")).reduce(Double::sum).orElse(0.0).toString(), 2)+"");
|
|
|
|
|
result.put("Customerqty3", NumberUtil.round(collect3.stream().map(row -> row.getDoubleValue("num")).reduce(Double::sum).orElse(0.00).toString(), 2)+"");
|
|
|
|
|
|
|
|
|
|
// 兰州一期仓(B)
|
|
|
|
|
List<JSONObject> collect4 = dataList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(AutoQueryEnum.AC01.getId()))
|
|
|
|
|
.filter(row -> custB.contains(row.getString("customer_name")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
result.put("Customerqty4", NumberUtil.round(collect4.stream().map(row -> row.getDoubleValue("num")).reduce(Double::sum).orElse(0.0).toString(), 2)+"");
|
|
|
|
|
result.put("Customerqty4", NumberUtil.round(collect4.stream().map(row -> row.getDoubleValue("num")).reduce(Double::sum).orElse(0.00).toString(), 2)+"");
|
|
|
|
|
|
|
|
|
|
// 兰州一期仓(C)
|
|
|
|
|
List<JSONObject> collect5 = dataList.stream()
|
|
|
|
|
.filter(row -> row.getString("stor_id").equals(AutoQueryEnum.AC01.getId()))
|
|
|
|
|
.filter(row -> custC.contains(row.getString("customer_name")))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
result.put("Customerqty5", NumberUtil.round(collect5.stream().map(row -> row.getDoubleValue("num")).reduce(Double::sum).orElse(0.0).toString(), 2)+"");
|
|
|
|
|
result.put("Customerqty5", NumberUtil.round(collect5.stream().map(row -> row.getDoubleValue("num")).reduce(Double::sum).orElse(0.00).toString(), 2)+"");
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
@@ -716,7 +716,7 @@ public class AutoQueryProudDayData {
|
|
|
|
|
|
|
|
|
|
double subIvt = NumberUtil.sub(jsonIvtB.getDoubleValue("num"), monthInB.getDoubleValue("num"));
|
|
|
|
|
|
|
|
|
|
result.put("Customerqty1", subIvt > 0 ? NumberUtil.round(subIvt, 2).toString() : "0");
|
|
|
|
|
result.put("Customerqty1", subIvt > 0 ? NumberUtil.round(subIvt, 2).toString() : "0.00");
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|