|
|
@ -81,6 +81,7 @@ public class OperationLogAspect { |
|
|
|
put(UniversalEnum.THREE_C.getValue(), UniversalEnum.READ_THE_CURRENT_DEVICE_STATUS.getValue()); |
|
|
|
}}); |
|
|
|
put(UniversalEnum.THIRTEEN.getValue(), new HashMap<String, Object>() {{ |
|
|
|
put("102", "设备开关"); |
|
|
|
}}); |
|
|
|
put(UniversalEnum.FOURTEEN.getValue(), new HashMap<String, Object>() {{ |
|
|
|
}}); |
|
|
@ -93,6 +94,7 @@ public class OperationLogAspect { |
|
|
|
put(UniversalEnum.A_SIX.getValue(), UniversalEnum.QUERY_DATA.getValue()); |
|
|
|
}}); |
|
|
|
put(UniversalEnum.SIXTEEN.getValue(), new HashMap<String, Object>() {{ |
|
|
|
put("102", "设备开关"); |
|
|
|
}}); |
|
|
|
}}; |
|
|
|
|
|
|
@ -104,7 +106,7 @@ public class OperationLogAspect { |
|
|
|
|
|
|
|
@AfterThrowing(value = "@annotation(operationLog)", throwing = "e") |
|
|
|
public void AfterThrowing(JoinPoint joinPoint, OperationLog operationLog, Exception e) throws Throwable { |
|
|
|
around((ProceedingJoinPoint) joinPoint, operationLog, UniversalEnum.ONE.getValue(), null, e); |
|
|
|
around((ProceedingJoinPoint) joinPoint, operationLog, UniversalEnum.ONE.getValue(), AjaxResult.error(), e); |
|
|
|
} |
|
|
|
|
|
|
|
public void around(ProceedingJoinPoint joinPoint, OperationLog operationLog, String state, Object jsonResult, Exception exception) throws Throwable { |
|
|
@ -208,21 +210,241 @@ public class OperationLogAspect { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
remark.append(deviceName); |
|
|
|
|
|
|
|
String hashMap = Objects.equals(deviceType, UniversalEnum.FIVE.getValue()) ? |
|
|
|
UniversalEnum.RELEASE_VOICE_BROADCAST.getValue() : |
|
|
|
String.valueOf( |
|
|
|
((HashMap<String, Object>) (DEVICEFUNCTIONNAME.get(deviceType))) |
|
|
|
.get(functionId) == null ? |
|
|
|
UniversalEnum.UNKNOWN_METHOD.getValue() : |
|
|
|
((HashMap<String, Object>) (DEVICEFUNCTIONNAME.get(deviceType))) |
|
|
|
.get(functionId)); |
|
|
|
//String hashMap = Objects.equals(deviceType, UniversalEnum.FIVE.getValue()) ?
|
|
|
|
// UniversalEnum.RELEASE_VOICE_BROADCAST.getValue() :
|
|
|
|
// String.valueOf(
|
|
|
|
// ((HashMap<String, Object>) (DEVICEFUNCTIONNAME.get(deviceType)))
|
|
|
|
// .get(functionId) == null ?
|
|
|
|
// UniversalEnum.UNKNOWN_METHOD.getValue() :
|
|
|
|
// ((HashMap<String, Object>) (DEVICEFUNCTIONNAME.get(deviceType)))
|
|
|
|
// .get(functionId));
|
|
|
|
//remark.append(hashMap).append(":");
|
|
|
|
|
|
|
|
remark.append(UniversalEnum.INVOKE.getValue()).append(hashMap).append(UniversalEnum.FEATURE.getValue()); |
|
|
|
JSONObject params = function.getJSONObject("params"); |
|
|
|
|
|
|
|
if (i1 < functions.size() - UniversalEnum.ONE.getNumber()) { |
|
|
|
remark.append(UniversalEnum.SEMICOLON.getValue()); |
|
|
|
|
|
|
|
if (Objects.equals(deviceType, "2")) { |
|
|
|
|
|
|
|
//if (Objects.equals(functionId, UniversalEnum.ELEVEN.getValue())) {
|
|
|
|
//
|
|
|
|
// remark.append("文件名称:").append(params.getString("fileName")).append("、文件大小:").append(params.getString("size")).append("KB");
|
|
|
|
//
|
|
|
|
//} else
|
|
|
|
if (Objects.equals(functionId, UniversalEnum.THIRTEEN.getValue())) { |
|
|
|
|
|
|
|
JSONArray parameters = params.getJSONArray("parameters"); |
|
|
|
|
|
|
|
for (int i2 = 0; i2 < parameters.size(); i2++) { |
|
|
|
|
|
|
|
remark.append(((JSONObject) JSON.toJSON(parameters.get(i2))).getString("CONTENT")); |
|
|
|
//remark.append("文件内容:").append(((JSONObject) JSON.toJSON(parameters.get(i2))).getString("CONTENT"));
|
|
|
|
|
|
|
|
if (i2 < parameters.size() - 1) { |
|
|
|
remark.append("、"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//else if (Objects.equals(functionId, UniversalEnum.ONE_B.getValue())) {
|
|
|
|
//
|
|
|
|
// remark.append("文件标识:").append(params.getString("fileId"));
|
|
|
|
//
|
|
|
|
//}
|
|
|
|
|
|
|
|
} else if (Objects.equals(deviceType, "5")) { |
|
|
|
|
|
|
|
remark.append(params.getString("text")); |
|
|
|
|
|
|
|
} else if (Objects.equals(deviceType, "10")) { |
|
|
|
|
|
|
|
String set = params.getString("SET"); |
|
|
|
if (Objects.equals(functionId, UniversalEnum.SETMD.getValue())) { |
|
|
|
|
|
|
|
if (Objects.equals(set, "0")) { |
|
|
|
|
|
|
|
remark.append("关闭"); |
|
|
|
|
|
|
|
} else if (Objects.equals(set, "1")) { |
|
|
|
|
|
|
|
remark.append("常亮"); |
|
|
|
|
|
|
|
} else if (Objects.equals(set, "2")) { |
|
|
|
|
|
|
|
remark.append("间隔100ms闪烁"); |
|
|
|
|
|
|
|
} else if (Objects.equals(set, "3")) { |
|
|
|
|
|
|
|
remark.append("间隔200ms闪烁"); |
|
|
|
|
|
|
|
} else if (Objects.equals(set, "4")) { |
|
|
|
|
|
|
|
remark.append("间隔500ms闪烁"); |
|
|
|
|
|
|
|
} else if (Objects.equals(set, "5")) { |
|
|
|
|
|
|
|
remark.append("2次闪烁"); |
|
|
|
|
|
|
|
} else if (Objects.equals(set, "6")) { |
|
|
|
|
|
|
|
remark.append("SOS"); |
|
|
|
|
|
|
|
} else if (Objects.equals(set, "7")) { |
|
|
|
|
|
|
|
remark.append("自定义闪烁时间"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
remark.append("模式"); |
|
|
|
|
|
|
|
} else if (Objects.equals(functionId, UniversalEnum.SETTM.getValue())) { |
|
|
|
|
|
|
|
remark.append(set).append("分钟"); |
|
|
|
} |
|
|
|
|
|
|
|
} else if (Objects.equals(deviceType, "12")) { |
|
|
|
|
|
|
|
if (Objects.equals(functionId, "51")) { |
|
|
|
|
|
|
|
//remark.append("模式:");
|
|
|
|
|
|
|
|
String mode = params.getString("mode"); |
|
|
|
|
|
|
|
if (Objects.equals(mode, "00")) { |
|
|
|
|
|
|
|
remark.append("远程手动控制模式:上行:"); |
|
|
|
String onWorkStatus = params.getString("onWorkStatus"); |
|
|
|
String inWorkStatus = params.getString("inWorkStatus"); |
|
|
|
|
|
|
|
if (Objects.equals(onWorkStatus, "00")) { |
|
|
|
|
|
|
|
remark.append("不更新状态,下行:"); |
|
|
|
|
|
|
|
} else if (Objects.equals(onWorkStatus, "01")) { |
|
|
|
|
|
|
|
remark.append("常亮,下行:"); |
|
|
|
|
|
|
|
} else if (Objects.equals(onWorkStatus, "02")) { |
|
|
|
|
|
|
|
remark.append("流水,下行:"); |
|
|
|
|
|
|
|
} else if (Objects.equals(onWorkStatus, "03")) { |
|
|
|
|
|
|
|
remark.append("闪烁,下行:"); |
|
|
|
|
|
|
|
} else if (Objects.equals(onWorkStatus, "04")) { |
|
|
|
|
|
|
|
remark.append("关闭,下行:"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Objects.equals(inWorkStatus, "00")) { |
|
|
|
|
|
|
|
remark.append("不更新状态"); |
|
|
|
|
|
|
|
} else if (Objects.equals(inWorkStatus, "01")) { |
|
|
|
|
|
|
|
remark.append("常亮"); |
|
|
|
|
|
|
|
} else if (Objects.equals(inWorkStatus, "02")) { |
|
|
|
|
|
|
|
remark.append("流水"); |
|
|
|
|
|
|
|
} else if (Objects.equals(inWorkStatus, "03")) { |
|
|
|
|
|
|
|
remark.append("闪烁"); |
|
|
|
|
|
|
|
} else if (Objects.equals(inWorkStatus, "04")) { |
|
|
|
|
|
|
|
remark.append("关闭"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (Objects.equals(mode, "01")) { |
|
|
|
|
|
|
|
remark.append("时间段自动控制模式:") |
|
|
|
.append(params.getString("startDisplayTime")) |
|
|
|
.append("-") |
|
|
|
.append(params.getString("endDisplayTime")); |
|
|
|
|
|
|
|
} else if (Objects.equals(mode, "02")) { |
|
|
|
|
|
|
|
remark.append("万年历自动控制模式"); |
|
|
|
|
|
|
|
} else if (Objects.equals(mode, "03")) { |
|
|
|
|
|
|
|
remark.append("能见度自动控制模式"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (Objects.equals(functionId, "30")) { |
|
|
|
|
|
|
|
String onWorkStatus = params.getString("onWorkStatus"); |
|
|
|
String inWorkStatus = params.getString("inWorkStatus"); |
|
|
|
|
|
|
|
if (Objects.equals(onWorkStatus, "00")) { |
|
|
|
|
|
|
|
remark.append("上行:不更新状态,下行:"); |
|
|
|
|
|
|
|
} else if (Objects.equals(onWorkStatus, "01")) { |
|
|
|
|
|
|
|
remark.append("上行:常亮,下行:"); |
|
|
|
|
|
|
|
} else if (Objects.equals(onWorkStatus, "02")) { |
|
|
|
|
|
|
|
remark.append("上行:流水,下行:"); |
|
|
|
|
|
|
|
} else if (Objects.equals(onWorkStatus, "03")) { |
|
|
|
|
|
|
|
remark.append("上行:闪烁,下行:"); |
|
|
|
|
|
|
|
} else if (Objects.equals(onWorkStatus, "04")) { |
|
|
|
|
|
|
|
remark.append("上行:关闭,下行:"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Objects.equals(inWorkStatus, "00")) { |
|
|
|
|
|
|
|
remark.append("不更新状态"); |
|
|
|
|
|
|
|
} else if (Objects.equals(inWorkStatus, "01")) { |
|
|
|
|
|
|
|
remark.append("常亮"); |
|
|
|
|
|
|
|
} else if (Objects.equals(inWorkStatus, "02")) { |
|
|
|
|
|
|
|
remark.append("流水"); |
|
|
|
|
|
|
|
} else if (Objects.equals(inWorkStatus, "03")) { |
|
|
|
|
|
|
|
remark.append("闪烁"); |
|
|
|
|
|
|
|
} else if (Objects.equals(inWorkStatus, "04")) { |
|
|
|
|
|
|
|
remark.append("关闭"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//remark.append(deviceName);
|
|
|
|
|
|
|
|
//String hashMap = Objects.equals(deviceType, UniversalEnum.FIVE.getValue()) ?
|
|
|
|
// UniversalEnum.RELEASE_VOICE_BROADCAST.getValue() :
|
|
|
|
// String.valueOf(
|
|
|
|
// ((HashMap<String, Object>) (DEVICEFUNCTIONNAME.get(deviceType)))
|
|
|
|
// .get(functionId) == null ?
|
|
|
|
// UniversalEnum.UNKNOWN_METHOD.getValue() :
|
|
|
|
// ((HashMap<String, Object>) (DEVICEFUNCTIONNAME.get(deviceType)))
|
|
|
|
// .get(functionId));
|
|
|
|
|
|
|
|
//remark.append(UniversalEnum.INVOKE.getValue()).append(hashMap).append(UniversalEnum.FEATURE.getValue());
|
|
|
|
|
|
|
|
if (i1 < functions.size() - UniversalEnum.ONE.getNumber() && !Objects.equals(deviceType, "2")) { |
|
|
|
remark.append(UniversalEnum.COMMA.getValue()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -239,7 +461,7 @@ public class OperationLogAspect { |
|
|
|
} |
|
|
|
|
|
|
|
if (i < (devices.size() - UniversalEnum.ONE.getNumber())) { |
|
|
|
remark.append(UniversalEnum.COMMA.getValue()); |
|
|
|
remark.append(UniversalEnum.UNDERLINE.getValue()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@ -317,6 +539,8 @@ public class OperationLogAspect { |
|
|
|
|
|
|
|
String functionId = String.valueOf(pointArgs[UniversalEnum.ONE.getNumber()]); |
|
|
|
|
|
|
|
JSONObject params = (JSONObject) JSON.toJSON(pointArgs[UniversalEnum.TWO.getNumber()]); |
|
|
|
|
|
|
|
if (Objects.equals(functionId, UniversalEnum.A_ONE.getValue()) || |
|
|
|
Objects.equals(functionId, UniversalEnum.A_TWO.getValue()) || |
|
|
|
Objects.equals(functionId, UniversalEnum.A_THREE.getValue()) || |
|
|
@ -332,9 +556,39 @@ public class OperationLogAspect { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
String hashMap = Objects.equals(deviceType, UniversalEnum.FIVE.getValue()) ? UniversalEnum.RELEASE_VOICE_BROADCAST.getValue() : String.valueOf(((HashMap<String, Object>) (DEVICEFUNCTIONNAME.get(deviceType))).get(functionId)); |
|
|
|
//String hashMap = Objects.equals(deviceType, UniversalEnum.FIVE.getValue())
|
|
|
|
// ? UniversalEnum.RELEASE_VOICE_BROADCAST.getValue()
|
|
|
|
// : String.valueOf(((HashMap<String, Object>) (DEVICEFUNCTIONNAME.get(deviceType))).get(functionId));
|
|
|
|
//
|
|
|
|
//remark.append(hashMap).append(":");
|
|
|
|
if (Objects.equals(deviceType, "13") || Objects.equals(deviceType, "16")) { |
|
|
|
|
|
|
|
String identification = params.getString("deviceName"); |
|
|
|
String value = params.getString("value"); |
|
|
|
|
|
|
|
if (Objects.equals(identification, "ac_out_1_en")) { |
|
|
|
|
|
|
|
remark.append("220V 输出 1").append(Objects.equals(value, "1") ? "打开" : "关闭"); |
|
|
|
|
|
|
|
} else if (Objects.equals(identification, "ac_out_2_en")) { |
|
|
|
|
|
|
|
remark.append("220V 输出 2").append(Objects.equals(value, "1") ? "打开" : "关闭"); |
|
|
|
|
|
|
|
} else if (Objects.equals(identification, "dc_out_1_en")) { |
|
|
|
|
|
|
|
remark.append("12V 输出 1").append(Objects.equals(value, "1") ? "打开" : "关闭"); |
|
|
|
|
|
|
|
remark.append(deviceName).append(UniversalEnum.INVOKE.getValue()).append(hashMap).append(UniversalEnum.FEATURE.getValue()); |
|
|
|
} else if (Objects.equals(identification, "dc_out_2_en")) { |
|
|
|
|
|
|
|
remark.append("12V 输出 2").append(Objects.equals(value, "1") ? "打开" : "关闭"); |
|
|
|
|
|
|
|
} else if (Objects.equals(identification, "fan_out_en")) { |
|
|
|
|
|
|
|
remark.append("风扇").append(Objects.equals(value, "1") ? "打开" : "关闭"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (loginUser != null) { |
|
|
|
SysDept sysDept = deptService.selectDeptById(loginUser.getDeptId()); |
|
|
@ -396,7 +650,7 @@ public class OperationLogAspect { |
|
|
|
operLog.setOperTime(new Date()); |
|
|
|
operLog.setDcDeviceType(deviceType); |
|
|
|
operLog.setRemark(remark.toString()); |
|
|
|
operLog.setJsonResult(jsonResult.toJSONString()); |
|
|
|
operLog.setJsonResult(jsonResult != null ? jsonResult.toJSONString() : AjaxResult.error().toString()); |
|
|
|
dcOperLogService.save(operLog); |
|
|
|
} |
|
|
|
} |
|
|
|