Commit 5bff806e by liuyang

2024-10-27 修复生产驾驶舱显示问题,添加app驾驶舱接口

parent 1834001d
......@@ -270,12 +270,17 @@ public class ServiceHPBI003 extends ServiceBase {
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryGX", params, 0,100);
Map<Object , List<Map>> mapList = listMap.stream().collect(Collectors.groupingBy(map -> map.get("groupName")));
List<Map> sortList = listMap.stream().map(map -> {
Map map1 = new HashMap();
map1.put("sort", map.get("groupName"));
return map1;
}).distinct().collect(Collectors.toList());
Map<Object , List<Map>> mapList = listMap.stream().sorted(Comparator.comparing(map -> map.get("groupName").toString())).collect(Collectors.groupingBy(map -> map.get("groupName")));
List<Map> result = new ArrayList<>();
for (Object key: mapList.keySet()) {
for (Map key: sortList) {
Map<Object, Object> map = new HashMap<>();
map.put("product", key);
for (Map map1: mapList.get(key)) {
map.put("product", key.get("sort"));
for (Map map1: mapList.get(key.get("sort"))) {
map.put(map1.get("series"), map1.get("wt"));
}
result.add(map);
......@@ -326,22 +331,29 @@ public class ServiceHPBI003 extends ServiceBase {
}
List<Map> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryDayWts", params, 0,100);
List<Map> sortList = listMap.stream().map(map -> {
Map map1 = new HashMap();
map1.put("sort", map.get("series"));
return map1;
}).distinct().collect(Collectors.toList());
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
Map<Object, List<Map>> listMap1 = listMap.stream().collect(Collectors.groupingBy(m -> m.get("series")));
for (Object key: listMap1.keySet()) {
List treeMap = new ArrayList();
for (Map key: sortList) {
Map<Object, Object> map = new HashMap<>();
map.put("name", key);
treeMap.add(key.get("sort"));
map.put("name", key.get("sort"));
map.put("type", "line");
map.put("stack", "Total");
List list1 = new ArrayList<>();
for (Map map1: listMap1.get(key)) {
for (Map map1: listMap1.get(key.get("sort"))) {
list1.add(map1.get("wt"));
}
map.put("data", list1);
result.add(map);
}
inInfo.set("date", listMap2);
inInfo.set("name", listMap1.keySet());
inInfo.set("name", treeMap);
inInfo.set(EiConstant.resultBlock, result);
return inInfo;
}
......@@ -429,4 +441,175 @@ public class ServiceHPBI003 extends ServiceBase {
inInfo.set(EiConstant.resultBlock, result);
return inInfo;
}
/**
* app查询日重量
* @param inInfo
* @return
*/
public EiInfo queryAppRCLInfo(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryDayWt", params, 0,100);
inInfo.set(EiConstant.resultBlock, listMap);
return inInfo;
}
/**
* app查询月重量
* @param inInfo
* @return
*/
public EiInfo queryYAppCLinfo(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryMonthWt", params, 0,100);
inInfo.set(EiConstant.resultBlock, listMap);
return inInfo;
}
/**
* app查询年重量
* @param inInfo
* @return
*/
public EiInfo queryAppNCLinfo(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryYearWt", params, 0,100);
inInfo.set(EiConstant.resultBlock, listMap);
return inInfo;
}
/**
* app组拼加焊综合总产量
* @param inInfo
* @return
*/
public EiInfo queryAppZCLinfo(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryZCL", params, 0,100);
inInfo.set(EiConstant.resultBlock, listMap);
return inInfo;
}
/**
* App查询工序产量
* @param inInfo
* @return
*/
public EiInfo queryAppGroupCLnfo(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryGX", params, 0,100);
inInfo.set(EiConstant.resultBlock, listMap);
return inInfo;
}
/**
* App生产项
* @param inInfo
* @return
*/
public EiInfo queryAppBJInfo(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryProducItem", params, 0,100);
inInfo.set(EiConstant.resultBlock, listMap);
return inInfo;
}
/**
* App主要项目进度
* @param inInfo
* @return
*/
public EiInfo queryAppXMinfo(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryProjNameWt", params, 0,100);
inInfo.set(EiConstant.resultBlock, listMap);
return inInfo;
}
/**
* App近5日综合产量
* @param inInfo
* @return
*/
public EiInfo queryAppZHCLInfo(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryDayWts", params, 0,100);
inInfo.set(EiConstant.resultBlock, listMap);
return inInfo;
}
/**
* App查询报设备状态
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "设备监控",operType = "查询",operDesc = "查询设备状态")
public EiInfo queryByAppSbStatus(EiInfo inInfo) {
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> result = DaoBase.getInstance().query("HPBI003.queryBySbStatus", params);
inInfo.set("result",result);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return inInfo;
}
/**
* App近7日设备运行时长
* @param inInfo
* @return
*/
public EiInfo queryAppSbYes(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
params.put("logValues", Arrays.asList("1", "2", "4"));
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryBySbYes", params, 0,100);
inInfo.set(EiConstant.resultBlock, listMap);
return inInfo;
}
/**
* app近7日设备运行时长
* @param inInfo
* @return
*/
public EiInfo queryAppSbNo(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
params.put("logValues", Arrays.asList("3", "5", "6"));
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryBySbYes", params, 0,100);
inInfo.set(EiConstant.resultBlock, listMap);
return inInfo;
}
}
......@@ -280,7 +280,8 @@
select
SERIES as "series",
X as "groupName",
ROUND(VALUE, 2) as "wt"
ROUND(VALUE, 2) as "wt",
SORT as "sort"
from
(
select
......@@ -520,7 +521,8 @@
select
SERIES as "series",
X as "date",
ROUND(VALUE, 2) as "wt"
ROUND(VALUE, 2) as "wt",
SORT as "sort"
from
(
select
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment