Commit e19651a3 authored by 刘凡's avatar 刘凡

*)修改二维码过滤

parent 89b864e4
......@@ -77,7 +77,7 @@ public class DPSubServiceImpl {
if (!ValidationUtil.isEmpty(api)){
ResponseModel responseModel = this.getApiResult((JSONObject) api, !ValidationUtil.isEmpty(resultConvert) ? resultConvert.toString() : null);
if (!ValidationUtil.isEmpty(responseModel)) {
if (!ValidationUtil.isEmpty(responseModel.getResult())) {
apiResult = JSONObject.parseObject(responseModel.getResult().toString());
}
}
......@@ -110,6 +110,8 @@ public class DPSubServiceImpl {
map.put("columns", JsonValueUtils.getValueByKey(yObj, "visualParams", "visualParams.modelTableColumns"));
map.put("dataList", apiResult);
map.put("showPage", true);
map.put("api", api);
map.put("rowKey", "record");
content.put(tab.getString("key"), map);
}
}
......@@ -268,6 +270,7 @@ public class DPSubServiceImpl {
JSONObject qrcode = map.getJSONObject("qrcode");
String problemTime = apiResult.getString("problemTime");
String problemStatus = apiResult.getString("problemStatus");
String color = null;
if (!ValidationUtil.isEmpty(problemTime)){
try {
qrcode.put("text", DateUtil.formatDate(DateUtil.smartFormat(problemTime), "yyyy-MM-dd"));
......@@ -277,15 +280,16 @@ public class DPSubServiceImpl {
}
}
if ("正常".equals(problemStatus)){
problemStatus = "green";
color = "green";
} else if("异常".equals(problemStatus)){
problemStatus = "red";
color = "red";
}
qrcode.put("value", !ValidationUtil.isEmpty(apiResult.get("useCode")) ? apiResult.get("useCode") : apiResult.get("USE_ORG_CODE"));
qrcode.put("status", problemStatus);
qrcode.put("color", color);
});
mergedArray = mergedArray.stream().filter(x -> !"QRCode".equals(JsonValueUtils.getValueByKey(x, "visualParams", "visualParams.componentKey"))).collect(Collectors.toList());
mergedArray = mergedArray.stream().filter(x -> !"QRCode".equals(JsonValueUtils.getValueByKey(x, "componentKey", null))).collect(Collectors.toList());
mergedArray.stream().forEach(x -> {
JSONObject xObj = (JSONObject) x;
JSONObject visualParams = xObj.getJSONObject("visualParams");
......@@ -396,6 +400,7 @@ public class DPSubServiceImpl {
return jsonObject;
}).collect(Collectors.toList());
subObj.put("rowKey", "key");
subObj.put("showPage", false);
subObj.put("columns", columns);
subObj.put("dataList", apiResult.get(JsonValueUtils.getValueByKey(yObj, "visualParams", "visualParams.fieldKey")));
......
......@@ -28,7 +28,7 @@
"apiPath":"/jg/equipment-register/page",
"params": {
"number": 1,
"size": 10,
"size": 14,
"USE_UNIT_CREDIT_CODE": "{useUnitCode}"
}
}
......
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