change - 门体库库存统计

master
wenjy 2 years ago
parent aa459ab7bc
commit d9be5dfb2c

@ -44,16 +44,18 @@ public class BaseLocationServiceImpl implements IBaseLocationService {
List<BaseLocationInfo> baseLocationInfos = lcoationMapper.selectList(wrapper);
Map<String, List<BaseLocationInfo>> collect = baseLocationInfos.stream().collect(Collectors.groupingBy(BaseLocationInfo::getMaterialType));
JSONObject jsonObject = new JSONObject();
List<String> xValue = new ArrayList<>();
List<String> yValue = new ArrayList<>();
List<JSONObject> result = new ArrayList<>();
for (String item : collect.keySet()) {
xValue.add(item);
yValue.add(collect.get(item).size()+"");
JSONObject jsonObject = new JSONObject();
jsonObject.put("materialName",item);
jsonObject.put("lineStoreAmount",collect.get(item).stream().filter(x->x.getLocationArea().equals("1")).collect(Collectors.toList()).size());
jsonObject.put("hullStoreAmount",collect.get(item).stream().filter(x->x.getLocationArea().equals("2")).collect(Collectors.toList()).size());
result.add(jsonObject);
}
jsonObject.put("xValue",xValue);
jsonObject.put("yValue",yValue);
return JSONArray.toJSONString(jsonObject);
String s = JSONArray.toJSONString(result);
System.out.println("物料库存统计:"+s);
return s;
}
@Override

Loading…
Cancel
Save