|
@@ -36,15 +36,19 @@ public class MtStarUtil {
|
|
|
map.put("startIndex", 0);
|
|
|
map.put("queryCount", 1);
|
|
|
map.put("select_name", equipmentCode);
|
|
|
- String post = HttpUtil.post(mtStarProperties.getUrl() + "dev_get_devs_cmarks", map);
|
|
|
- JSONObject obj = JSONUtil.parseObj(post);
|
|
|
- if (obj.get("retCode",Integer.class) == 0){
|
|
|
- List<String> list = obj.getBeanList("cMarkList", String.class);
|
|
|
- if (list != null && !list.isEmpty()){
|
|
|
- JSONObject entries = JSONUtil.parseObj(list.get(0));
|
|
|
- return entries.get("cMark", String.class);
|
|
|
- }
|
|
|
+ try {
|
|
|
+ String post = HttpUtil.post(mtStarProperties.getUrl() + "dev_get_devs_cmarks", map);
|
|
|
+ JSONObject obj = JSONUtil.parseObj(post);
|
|
|
+ if (obj.get("retCode",Integer.class) == 0){
|
|
|
+ List<String> list = obj.getBeanList("cMarkList", String.class);
|
|
|
+ if (list != null && !list.isEmpty()){
|
|
|
+ JSONObject entries = JSONUtil.parseObj(list.get(0));
|
|
|
+ return entries.get("cMark", String.class);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ return "error";
|
|
|
}
|
|
|
return "error";
|
|
|
}
|
|
@@ -66,10 +70,14 @@ public class MtStarUtil {
|
|
|
sCmd.put("subcmd", "ctrl_lcd_onoff_ontime");
|
|
|
map.put("params", sCmd.toString());
|
|
|
map.put("retry", 0);
|
|
|
- String post = HttpUtil.post(mtStarProperties.getUrl() + "sendClientParams", map);
|
|
|
- JSONObject obj = JSONUtil.parseObj(post);
|
|
|
- if (0 == obj.get("retCode", Integer.class))
|
|
|
- return "success";
|
|
|
+ try {
|
|
|
+ String post = HttpUtil.post(mtStarProperties.getUrl() + "sendClientParams", map);
|
|
|
+ JSONObject obj = JSONUtil.parseObj(post);
|
|
|
+ if (0 == obj.get("retCode", Integer.class))
|
|
|
+ return "success";
|
|
|
+ }catch (Exception e){
|
|
|
+ return "error";
|
|
|
+ }
|
|
|
return "error";
|
|
|
}
|
|
|
|