|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.productionboard.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.productionboard.entity.BaseLocationInfo;
|
|
|
|
|
import com.productionboard.mapper.BaseLocationInfoMapper;
|
|
|
|
@ -8,7 +9,10 @@ import com.productionboard.service.IBaseLocationService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author WenJY
|
|
|
|
@ -35,8 +39,17 @@ public class BaseLocationServiceImpl implements IBaseLocationService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<BaseLocationInfo> baseLocationInfos = lcoationMapper.selectList(wrapper);
|
|
|
|
|
|
|
|
|
|
return JSONArray.toJSONString(baseLocationInfos);
|
|
|
|
|
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<>();
|
|
|
|
|
for (String item : collect.keySet()) {
|
|
|
|
|
xValue.add(item);
|
|
|
|
|
yValue.add(collect.get(item).size()+"");
|
|
|
|
|
}
|
|
|
|
|
jsonObject.put("xValue",xValue);
|
|
|
|
|
jsonObject.put("yValue",yValue);
|
|
|
|
|
return JSONArray.toJSONString(jsonObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|