|
@@ -47,12 +47,8 @@ public class BigScreenDetailServiceImpl implements BigScreenDetailService {
|
|
|
String deviceInfo = json.get("deviceInfo").toString();
|
|
|
cn.hutool.json.JSONObject jsonObject=new cn.hutool.json.JSONObject(deviceInfo);
|
|
|
json.putAll(jsonObject);
|
|
|
- if(ObjectUtil.isNotEmpty(json.get("mainProg"))){
|
|
|
- String mainProg = json.get("mainProg").toString();
|
|
|
- int lastBackslashIndex = mainProg.lastIndexOf('\\');
|
|
|
- String result = mainProg.substring(lastBackslashIndex + 1);
|
|
|
- json.put("mainProg",result);
|
|
|
- }
|
|
|
+ //处理字符串
|
|
|
+ subJsonStr(json);
|
|
|
String ip = json.get("ip").toString();
|
|
|
List<String> pastDaysDates = DateUtils.getPastDaysDates(new Date(), 5);
|
|
|
String collect = pastDaysDates.stream()
|
|
@@ -141,4 +137,23 @@ public class BigScreenDetailServiceImpl implements BigScreenDetailService {
|
|
|
jsonObject.put("avgYearMonth",avgYearMonth);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void subJsonStr(JSONObject json){
|
|
|
+ if(ObjectUtil.isNotEmpty(json.get("mainProg"))){
|
|
|
+ String mainProg = json.get("mainProg").toString();
|
|
|
+ int lastBackslashIndex = mainProg.lastIndexOf('\\');
|
|
|
+ String result = mainProg.substring(lastBackslashIndex + 1);
|
|
|
+ json.put("mainProg",result);
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(json.get("actFeed"))){
|
|
|
+ String actFeed = json.get("actFeed").toString();
|
|
|
+ String[] parts = actFeed.split("\\.");
|
|
|
+ json.put("actFeed",parts[0]);
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(json.get("actSpindle"))){
|
|
|
+ String actSpindle = json.get("actSpindle").toString();
|
|
|
+ String[] parts = actSpindle.split("\\.");
|
|
|
+ json.put("actSpindle",parts[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|