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