|
@@ -104,10 +104,7 @@ public class ControlUtil {
|
|
|
SceneDataObject currData = (SceneDataObject) valueObject;
|
|
|
result = set(Repository, currData, infoValueSet, sdoList);
|
|
|
}
|
|
|
-
|
|
|
ControlUtil.saveBatchOperationLog(userId, userName,ipAddress,sdoList, infoValueSet, result, controlReason, Repository, request);
|
|
|
- // ControlUtil.saveOperationLog(userId, userName, sdoList, infoValueSet, result);
|
|
|
-
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -201,18 +198,17 @@ public class ControlUtil {
|
|
|
Date date = new Date();
|
|
|
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String currentTime=dateFormat.format(date);
|
|
|
+ //控制中心保存指令
|
|
|
+ commandRecordParam.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
|
|
|
+ commandRecordParam.put("projectId", RepositoryContainer.RepositoryProject.projectId);
|
|
|
+ commandRecordParam.put("executeTime",currentTime);
|
|
|
+ commandRecordParam.put("commandType",2);
|
|
|
for (int i = 0; i < sdoList.size(); i++) {
|
|
|
- JSONObject postParam;
|
|
|
- postParam = new JSONObject();
|
|
|
+ JSONObject postParam=new JSONObject();
|
|
|
JSONObject postParam2 = new JSONObject();
|
|
|
postParam.put("ipAddress", ipAddress);
|
|
|
postParam.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
|
|
|
postParam.put("projectId", RepositoryContainer.RepositoryProject.projectId);
|
|
|
- //控制中心保存指令
|
|
|
- commandRecordParam.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
|
|
|
- commandRecordParam.put("projectId", RepositoryContainer.RepositoryProject.projectId);
|
|
|
- commandRecordParam.put("executeTime",currentTime);
|
|
|
- commandRecordParam.put("commandType",2);
|
|
|
if (userId != null) {
|
|
|
postParam.put("userId", userId);
|
|
|
commandRecordParam.put("userId", userId);
|
|
@@ -293,8 +289,7 @@ public class ControlUtil {
|
|
|
sb.append(",切换原因:" + controlReason + "");
|
|
|
}
|
|
|
}
|
|
|
- String id = (String) sdo.get("id").value_prim.value;
|
|
|
- JSONObject obj = Repository.id2object.get(id);
|
|
|
+ JSONObject obj = Repository.id2object.get(objectId);
|
|
|
String objInfoValue = (String) obj.get(key);
|
|
|
if (objInfoValue != null && objInfoValue.length() > 0) {
|
|
|
int index_ = objInfoValue.lastIndexOf("-");
|
|
@@ -315,10 +310,8 @@ public class ControlUtil {
|
|
|
commandRecordParam.put("executeStatus",2);
|
|
|
}
|
|
|
}
|
|
|
-// if (i < sdoList.size() - 1) {
|
|
|
-// sb.append(",");
|
|
|
-// }
|
|
|
}
|
|
|
+ createCommandRecord(commandRecordParam);
|
|
|
for (int j = 1; j <= 2; j++) {
|
|
|
postParam2 = JSONObject.parseObject(postParam.toJSONString());
|
|
|
if (j == 1) {
|
|
@@ -331,8 +324,7 @@ public class ControlUtil {
|
|
|
postParamArray.add(postParam2);
|
|
|
}
|
|
|
}
|
|
|
- createCommandRecord(commandRecordParam);
|
|
|
- saveBatchOperationLog(postParamArray);
|
|
|
+ saveBatchOperationLog(postParamArray,request);
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
}
|
|
@@ -367,11 +359,9 @@ public class ControlUtil {
|
|
|
}
|
|
|
|
|
|
//批量保存日志
|
|
|
- private static void saveBatchOperationLog(JSONArray postParam) throws Exception {
|
|
|
+ private static void saveBatchOperationLog(JSONArray postParam,HttpServletRequest request) throws Exception {
|
|
|
String post_url = Constant.zkt_monitor_url + "/operatorLog/saveBatch";
|
|
|
- System.out.println("保存日志url:" + post_url);
|
|
|
- System.out.println("保存日志boby:" + postParam.toJSONString());
|
|
|
- String post_result = HttpClientUtil.instance("zkt_monitor").post(post_url, postParam.toJSONString());
|
|
|
+ String post_result = HttpClientUtil.instance("zkt_monitor").post(post_url, postParam.toJSONString(),request);
|
|
|
JSONObject result = JSON.parseObject(post_result);
|
|
|
log.debug(result.toJSONString());
|
|
|
}
|
|
@@ -379,8 +369,6 @@ public class ControlUtil {
|
|
|
//控制中心保存控制命令
|
|
|
private static void createCommandRecord(JSONObject postParam) throws Exception {
|
|
|
String post_url = Constant.zkt_control_url + "/commandRecord/createCommandRecord";
|
|
|
- System.out.println("保存控制指令url:" + post_url);
|
|
|
- System.out.println("控制指令boby:" + postParam.toJSONString());
|
|
|
String post_result = HttpClientUtil.instance("zkt_control").post(post_url, postParam.toJSONString());
|
|
|
JSONObject result = JSON.parseObject(post_result);
|
|
|
log.debug(result.toJSONString());
|