Commit 9b4e2a5d by 13420

生产驾驶舱大屏

parent b5fbc749
...@@ -520,6 +520,149 @@ public class ServiceHGBI002 extends ServiceBase { ...@@ -520,6 +520,149 @@ public class ServiceHGBI002 extends ServiceBase {
return outInfo; return outInfo;
} }
/** /**
* 近7日综合产量 45d33e71262840babc0d60c0a01863d0
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产管理驾驶舱1",operType = "查询",operDesc = "近7日综合产量")
public EiInfo queryZHCLInfo(EiInfo inInfo) {
String paramsStr = inInfo.getString(PARAMS_KEY_STR);
JSONArray jsonArray = (JSONArray) JSONArray.parse(paramsStr);
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
JSONArray idsArr = (JSONArray) jsonObject.get("ids");
String idsStr = idsArr.getString(0);
JSONObject paramsObj = null;
if (jsonObject.get("params") instanceof String) {
paramsObj=JSON.parseObject((String) jsonObject.get("params"));
} else {
paramsObj= (JSONObject) jsonObject.get("params");
}
String factStr = paramsObj.getString("factorycode");
String dateStr = paramsObj.getString("date").replace("-","");
EiInfo eiInfo = new EiInfo();
String serviceId = "S_BE_XP_17";
eiInfo.set(EiConstant.serviceId,serviceId);
Map map = new HashMap();
map.put("uuid","45d33e71262840babc0d60c0a01863d0");
map.put("offset",0);
map.put("limit",1000);
//获取公司代码
String companycode = "%";
if(!StringUtils.isEmpty(UserSessionUtils.getUserCompany().getUsercode())){
companycode = UserSessionUtils.getUserCompany().getUsercode();
}
//数据集入参
Map params =new HashMap();
params.put("companycode",companycode);
params.put("factorycode",factStr);
params.put("date",dateStr);
map.put("params",params);
List list =new ArrayList();
list.add(map);
eiInfo.set("queryInfo",list);
//服务接口调用
EiInfo outInfo = XServiceManager.call(eiInfo);
//调用微服务后的结果
Map result = (Map) outInfo.get("result");
Map result1 = (Map) result.get("45d33e71262840babc0d60c0a01863d0");
List<Map> list1 = (List) result1.get("data");
JSONArray tempArr = new JSONArray();
String json = "appEname,date,unitCover";
List tempContentList = Arrays.asList(json.split(","));
tempArr.add(tempContentList);
JSONObject item = new JSONObject();
list1.forEach(obj -> {
// 处理obj
List datalist =new ArrayList();
datalist.add(obj.get("SERIES"));
datalist.add(obj.get("X"));
datalist.add(obj.get("VALUE"));
tempArr.add(datalist);
});
JSONArray ids = new JSONArray();
ids.add(idsStr);
item.put("ids", ids);
item.put("component", null);
item.put("data", tempArr);
List list2 =new ArrayList();
list2.add(item);
outInfo.set("result",list2);
return outInfo;
}
/**
* 工序综合产量 4f5cb7ea6eb646d98aa0b1c79bf5c224
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产管理驾驶舱1",operType = "查询",operDesc = "工序综合产量")
public EiInfo queryGroupCLnfo(EiInfo inInfo) {
String paramsStr = inInfo.getString(PARAMS_KEY_STR);
JSONArray jsonArray = (JSONArray) JSONArray.parse(paramsStr);
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
JSONArray idsArr = (JSONArray) jsonObject.get("ids");
String idsStr = idsArr.getString(0);
JSONObject paramsObj = null;
if (jsonObject.get("params") instanceof String) {
paramsObj=JSON.parseObject((String) jsonObject.get("params"));
} else {
paramsObj= (JSONObject) jsonObject.get("params");
}
String factStr = paramsObj.getString("factorycode");
String dateStr = paramsObj.getString("date").replace("-","");
EiInfo eiInfo = new EiInfo();
String serviceId = "S_BE_XP_17";
eiInfo.set(EiConstant.serviceId,serviceId);
Map map = new HashMap();
map.put("uuid","4f5cb7ea6eb646d98aa0b1c79bf5c224");
map.put("offset",0);
map.put("limit",1000);
//获取公司代码
String companycode = "%";
if(!StringUtils.isEmpty(UserSessionUtils.getUserCompany().getUsercode())){
companycode = UserSessionUtils.getUserCompany().getUsercode();
}
//数据集入参
Map params =new HashMap();
params.put("companycode",companycode);
params.put("factorycode",factStr);
params.put("date",dateStr);
map.put("params",params);
List list =new ArrayList();
list.add(map);
eiInfo.set("queryInfo",list);
//服务接口调用
EiInfo outInfo = XServiceManager.call(eiInfo);
//调用微服务后的结果
Map result = (Map) outInfo.get("result");
Map result1 = (Map) result.get("4f5cb7ea6eb646d98aa0b1c79bf5c224");
List<Map> list1 = (List) result1.get("data");
JSONArray tempArr = new JSONArray();
String json = "appEname,date,unitCover";
List tempContentList = Arrays.asList(json.split(","));
tempArr.add(tempContentList);
JSONObject item = new JSONObject();
list1.forEach(obj -> {
// 处理obj
List datalist =new ArrayList();
datalist.add(obj.get("SERIES"));
datalist.add(obj.get("X"));
datalist.add(obj.get("VALUE"));
tempArr.add(datalist);
});
JSONArray ids = new JSONArray();
ids.add(idsStr);
item.put("ids", ids);
item.put("component", null);
item.put("data", tempArr);
List list2 =new ArrayList();
list2.add(item);
outInfo.set("result",list2);
return outInfo;
}
/**
* 查询报屏模块show21 * 查询报屏模块show21
* *
* @param inInfo * @param inInfo
......
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