Browse Source

优化魔法值

develop
zhaoxianglong 4 months ago
parent
commit
972c686d59
  1. 72
      zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java
  2. 6
      zc-business/src/main/java/com/zc/business/controller/DeviceStatus.java
  3. 45
      zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java
  4. 116
      zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java

72
zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java

@ -536,13 +536,13 @@ public class DcDeviceController extends BaseController {
String iotDeviceId = device.getString("iotDeviceId"); String iotDeviceId = device.getString("iotDeviceId");
String deviceType = device.getString("deviceType"); String deviceType = device.getString("deviceType");
boolean continueToExecute = true; boolean continueToExecute = true;
if (Objects.equals(deviceType, "10")) { if (Objects.equals(deviceType, UniversalEnum.TEN.getValue())) {
JSONObject mdJSONObject = (JSONObject) JSON.toJSON(getDeviceLatestProperty(iotDeviceId, "MD").get("data")); JSONObject mdJSONObject = (JSONObject) JSON.toJSON(getDeviceLatestProperty(iotDeviceId, UniversalEnum.MD.getValue()).get("data"));
String mdValue = mdJSONObject.getString("value"); String mdValue = mdJSONObject.getString("value");
JSONObject tmJSONObject = (JSONObject) JSON.toJSON(getDeviceLatestProperty(iotDeviceId, "TM").get("data")); JSONObject tmJSONObject = (JSONObject) JSON.toJSON(getDeviceLatestProperty(iotDeviceId, UniversalEnum.TM.getValue()).get("data"));
String tmValue = tmJSONObject.getString("value"); String tmValue = tmJSONObject.getString("value");
@ -563,7 +563,7 @@ public class DcDeviceController extends BaseController {
} }
} else { } else {
List<Object> collect = resultArray.stream().filter(item -> Objects.equals(((JSONObject) JSON.toJSON(item)).getString("device"), device.getString("id"))).collect(Collectors.toList()); List<Object> collect = resultArray.stream().filter(item -> Objects.equals(((JSONObject) JSON.toJSON(item)).getString("device"), device.getString("id"))).collect(Collectors.toList());
if (collect.size() == 0) { if (collect.size() == UniversalEnum.ZERO.getNumber()) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("device", device.getString("id")); result.put("device", device.getString("id"));
result.put("deviceType", device.getInteger("deviceType")); result.put("deviceType", device.getInteger("deviceType"));
@ -571,14 +571,14 @@ public class DcDeviceController extends BaseController {
result.put("result", AjaxResult.error()); result.put("result", AjaxResult.error());
resultArray.add(result); resultArray.add(result);
} else { } else {
for (int i = 0; i < resultArray.size(); i++) { for (int i = UniversalEnum.ZERO.getNumber(); i < resultArray.size(); i++) {
JSONObject jsonObject = (JSONObject) JSON.toJSON(resultArray.get(i)); JSONObject jsonObject = (JSONObject) JSON.toJSON(resultArray.get(i));
if (!Objects.equals(jsonObject.getString("device"), device.getString("id"))) { if (!Objects.equals(jsonObject.getString("device"), device.getString("id"))) {
JSONObject result = jsonObject.getJSONObject("result"); JSONObject result = jsonObject.getJSONObject("result");
if (!Objects.equals(result.getString("code"), "200")) { if (!Objects.equals(result.getString("code"), UniversalEnum.TWO_HUNDRED.getValue())) {
break; break;
} else { } else {
result.put("code", "500"); result.put("code", UniversalEnum.FIVE_HUNDRED.getValue());
jsonObject.put("result", result); jsonObject.put("result", result);
resultArray.add(i, jsonObject); resultArray.add(i, jsonObject);
} }
@ -588,15 +588,15 @@ public class DcDeviceController extends BaseController {
} }
} }
if (Objects.equals(functionId, "SETMD")) { if (Objects.equals(functionId, UniversalEnum.SETMD.getValue())) {
JSONObject jsonObjectMD = new JSONObject(); JSONObject jsonObjectMD = new JSONObject();
jsonObjectMD.put("SET", mdValue); jsonObjectMD.put(UniversalEnum.SET.getValue(), mdValue);
getAjaxResult(iotDeviceId, functionId, jsonObjectMD.toJavaObject(new TypeReference<HashMap<String, Object>>() { getAjaxResult(iotDeviceId, functionId, jsonObjectMD.toJavaObject(new TypeReference<HashMap<String, Object>>() {
})); }));
} }
if (Objects.equals(functionId, "SETTM")) { if (Objects.equals(functionId, UniversalEnum.SETTM.getValue())) {
JSONObject jsonObjectTM = new JSONObject(); JSONObject jsonObjectTM = new JSONObject();
jsonObjectTM.put("SET", tmValue); jsonObjectTM.put(UniversalEnum.SET.getValue(), tmValue);
getAjaxResult(iotDeviceId, functionId, jsonObjectTM.toJavaObject(new TypeReference<HashMap<String, Object>>() { getAjaxResult(iotDeviceId, functionId, jsonObjectTM.toJavaObject(new TypeReference<HashMap<String, Object>>() {
})); }));
} }
@ -610,15 +610,15 @@ public class DcDeviceController extends BaseController {
String functionId = functionJSONObject.getString("functionId"); String functionId = functionJSONObject.getString("functionId");
if (continueToExecute) { if (continueToExecute) {
JSONObject jsonObject = functionJSONObject.getJSONObject("params") != null ? functionJSONObject.getJSONObject("params") : new JSONObject(); JSONObject jsonObject = functionJSONObject.getJSONObject("params") != null ? functionJSONObject.getJSONObject("params") : new JSONObject();
//JSONObject result = getResult(device, iotDeviceId, functionId, jsonObject); JSONObject result = getResult(device, iotDeviceId, functionId, jsonObject);
//resultArray.add(result); resultArray.add(result);
//AjaxResult ajaxResult = (AjaxResult) result.get("result"); AjaxResult ajaxResult = (AjaxResult) result.get("result");
//if (!Objects.equals(String.valueOf(ajaxResult.get("code")), UniversalEnum.TWO_HUNDRED.getValue())) { if (!Objects.equals(String.valueOf(ajaxResult.get("code")), UniversalEnum.TWO_HUNDRED.getValue())) {
// continueToExecute = false; continueToExecute = false;
// if (Objects.equals(device.getString("deviceType"), UniversalEnum.FIFTEEN.getValue())) { if (Objects.equals(device.getString("deviceType"), UniversalEnum.FIFTEEN.getValue())) {
// return AjaxResult.error(UniversalEnum.TWO_HUNDRED.getNumber(), UniversalEnum.FIVE_HUNDRED.getValue()); return AjaxResult.error(UniversalEnum.TWO_HUNDRED.getNumber(), UniversalEnum.FIVE_HUNDRED.getValue());
// } }
//} }
} else { } else {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("device", device.getString("id")); result.put("device", device.getString("id"));
@ -641,22 +641,22 @@ public class DcDeviceController extends BaseController {
result.put("device", device.getString("id")); result.put("device", device.getString("id"));
result.put("deviceType", device.getInteger("deviceType")); result.put("deviceType", device.getInteger("deviceType"));
result.put("functionId", functionId); result.put("functionId", functionId);
//if (device.getInteger("deviceType").equals(DeviceTypeConstants.ROAD_SECTION_VOICE_BROADCASTING)) { if (device.getInteger("deviceType").equals(DeviceTypeConstants.ROAD_SECTION_VOICE_BROADCASTING)) {
// JSONObject value = broadcastController.nearCamListDistance(jsonObject); JSONObject value = broadcastController.nearCamListDistance(jsonObject);
// AjaxResult ajaxResult = new AjaxResult(); AjaxResult ajaxResult = new AjaxResult();
// value.keySet().forEach(item -> { value.keySet().forEach(item -> {
// ajaxResult.put(item, value.getString(item)); ajaxResult.put(item, value.getString(item));
// }); });
// if (Objects.equals(String.valueOf(ajaxResult.get("retCode")), UniversalEnum.ZERO.getValue())) { if (Objects.equals(String.valueOf(ajaxResult.get("retCode")), UniversalEnum.ZERO.getValue())) {
// ajaxResult.put("code", UniversalEnum.TWO_HUNDRED.getNumber()); ajaxResult.put("code", UniversalEnum.TWO_HUNDRED.getNumber());
// } else { } else {
// ajaxResult.put("code", UniversalEnum.FIVE_HUNDRED.getNumber()); ajaxResult.put("code", UniversalEnum.FIVE_HUNDRED.getNumber());
// } }
//
// result.put("result", ajaxResult); result.put("result", ajaxResult);
//} else { } else {
// result.put("result", getAjaxResult(iotDeviceId, functionId, params)); result.put("result", getAjaxResult(iotDeviceId, functionId, params));
//} }
return result; return result;
} }

6
zc-business/src/main/java/com/zc/business/controller/DeviceStatus.java

@ -15,7 +15,6 @@ import com.zc.business.service.impl.StatusService;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.io.BufferedReader; import java.io.BufferedReader;
@ -23,7 +22,9 @@ import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.InetAddress; import java.net.InetAddress;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
import java.util.ArrayList; import java.util.ArrayList;
@ -103,7 +104,8 @@ public class DeviceStatus {
//@Scheduled(cron = "0 30 23 * * ?") //@Scheduled(cron = "0 30 23 * * ?")
public void periodicDataClearing() { public void periodicDataClearing() {
StatusService statusService = SpringUtils.getBean(StatusService.class); StatusService statusService = SpringUtils.getBean(StatusService.class);
LocalDateTime startTime = LocalDateTime.now().minusMonths(UniversalEnum.THREE.getNumber()); LocalDateTime startTime = LocalDateTime.of(LocalDate.now().minusMonths(UniversalEnum.THREE.getNumber()), LocalTime.MIN);
;
Status status = new Status(); Status status = new Status();
status.setStartTime(startTime); status.setStartTime(startTime);
statusService.delStatusByTime(status); statusService.delStatusByTime(status);

45
zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java

@ -772,6 +772,36 @@ public enum UniversalEnum {
// 内容 // 内容
CONTENT(0, "内容"), CONTENT(0, "内容"),
// 关闭
OFF(0, "关闭"),
// 打开
UNPACK(0, "打开"),
// 常亮
STEADY_ON(0, "常亮"),
// 间隔100ms闪烁
BLINK_AT_AN_INTERVAL_OF_100_MS(0, "间隔100ms闪烁"),
// 间隔200ms闪烁
BLINK_AT_AN_INTERVAL_OF_200_MS(0, "间隔200ms闪烁"),
// 间隔500ms闪烁
BLINK_AT_AN_INTERVAL_OF_500_MS(0, "间隔500ms闪烁"),
// 2次闪烁
DOUBLE_FLICKER(0, "2次闪烁"),
// SOS
SOS(0, "SOS"),
// 自定义闪烁时间
CUSTOMIZE_THE_BLINKING_TIME(0, "自定义闪烁时间"),
// 模式
MODE(0, "模式"),
// 一般 // 一般
NORMAL(0, "一般"), NORMAL(0, "一般"),
@ -1162,12 +1192,18 @@ public enum UniversalEnum {
// SETMD // SETMD
SETMD(0, "SETMD"), SETMD(0, "SETMD"),
// MD
MD(0, "MD"),
// ASKMD // ASKMD
ASKMD(0, "ASKMD"), ASKMD(0, "ASKMD"),
// SETTM // SETTM
SETTM(0, "SETTM"), SETTM(0, "SETTM"),
// TM
TM(0, "TM"),
// ASKTM // ASKTM
ASKTM(0, "ASKTM"), ASKTM(0, "ASKTM"),
@ -2064,6 +2100,15 @@ public enum UniversalEnum {
// 行车诱导功能码 01 // 行车诱导功能码 01
ZERO_ONE(0, "01"), ZERO_ONE(0, "01"),
// 行车诱导功能码 02
ZERO_TWO(0, "02"),
// 行车诱导功能码 03
ZERO_THREE(0, "03"),
// 行车诱导功能码 04
ZERO_FOUR(0, "04"),
// 行车诱导功能码 0b // 行车诱导功能码 0b
ZERO_B(0, "0b"), ZERO_B(0, "0b"),

116
zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java

@ -224,7 +224,7 @@ public class OperationLogAspect {
JSONObject params = function.getJSONObject("params"); JSONObject params = function.getJSONObject("params");
if (Objects.equals(deviceType, "2")) { if (Objects.equals(deviceType, UniversalEnum.TWO.getValue())) {
//if (Objects.equals(functionId, UniversalEnum.ELEVEN.getValue())) { //if (Objects.equals(functionId, UniversalEnum.ELEVEN.getValue())) {
// //
@ -235,13 +235,13 @@ public class OperationLogAspect {
JSONArray parameters = params.getJSONArray("parameters"); JSONArray parameters = params.getJSONArray("parameters");
for (int i2 = 0; i2 < parameters.size(); i2++) { for (int i2 = UniversalEnum.ZERO.getNumber(); i2 < parameters.size(); i2++) {
remark.append(((JSONObject) JSON.toJSON(parameters.get(i2))).getString("CONTENT")); remark.append(((JSONObject) JSON.toJSON(parameters.get(i2))).getString("CONTENT"));
//remark.append("文件内容:").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) { if (i2 < parameters.size() - UniversalEnum.ONE.getNumber()) {
remark.append("、"); remark.append(UniversalEnum.SEMICOLON.getValue());
} }
} }
@ -252,175 +252,175 @@ public class OperationLogAspect {
// //
//} //}
} else if (Objects.equals(deviceType, "5")) { } else if (Objects.equals(deviceType, UniversalEnum.FIVE.getValue())) {
remark.append(params.getString("text")); remark.append(params.getString("text"));
} else if (Objects.equals(deviceType, "10")) { } else if (Objects.equals(deviceType, UniversalEnum.TEN.getValue())) {
String set = params.getString("SET"); String set = params.getString(UniversalEnum.SET.getValue());
if (Objects.equals(functionId, UniversalEnum.SETMD.getValue())) { if (Objects.equals(functionId, UniversalEnum.SETMD.getValue())) {
if (Objects.equals(set, "0")) { if (Objects.equals(set, UniversalEnum.ZERO.getValue())) {
remark.append("关闭"); remark.append(UniversalEnum.OFF.getValue());
} else if (Objects.equals(set, "1")) { } else if (Objects.equals(set, UniversalEnum.ONE.getValue())) {
remark.append("常亮"); remark.append(UniversalEnum.STEADY_ON.getValue());
} else if (Objects.equals(set, "2")) { } else if (Objects.equals(set, UniversalEnum.TWO.getValue())) {
remark.append("间隔100ms闪烁"); remark.append(UniversalEnum.BLINK_AT_AN_INTERVAL_OF_100_MS.getValue());
} else if (Objects.equals(set, "3")) { } else if (Objects.equals(set, UniversalEnum.THREE.getValue())) {
remark.append("间隔200ms闪烁"); remark.append(UniversalEnum.BLINK_AT_AN_INTERVAL_OF_200_MS.getValue());
} else if (Objects.equals(set, "4")) { } else if (Objects.equals(set, UniversalEnum.FOUR.getValue())) {
remark.append("间隔500ms闪烁"); remark.append(UniversalEnum.BLINK_AT_AN_INTERVAL_OF_500_MS.getValue());
} else if (Objects.equals(set, "5")) { } else if (Objects.equals(set, UniversalEnum.FIVE.getValue())) {
remark.append("2次闪烁"); remark.append(UniversalEnum.DOUBLE_FLICKER.getValue());
} else if (Objects.equals(set, "6")) { } else if (Objects.equals(set, UniversalEnum.SIX.getValue())) {
remark.append("SOS"); remark.append(UniversalEnum.SOS.getValue());
} else if (Objects.equals(set, "7")) { } else if (Objects.equals(set, UniversalEnum.SEVEN.getValue())) {
remark.append("自定义闪烁时间"); remark.append(UniversalEnum.CUSTOMIZE_THE_BLINKING_TIME.getValue());
} }
remark.append("模式"); remark.append(UniversalEnum.MODE.getValue());
} else if (Objects.equals(functionId, UniversalEnum.SETTM.getValue())) { } else if (Objects.equals(functionId, UniversalEnum.SETTM.getValue())) {
remark.append(set).append("分钟"); remark.append(set).append(UniversalEnum.MINUTES.getValue());
} }
} else if (Objects.equals(deviceType, "12")) { } else if (Objects.equals(deviceType, UniversalEnum.TWELVE.getValue())) {
if (Objects.equals(functionId, "51")) { if (Objects.equals(functionId, UniversalEnum.FIFTY_ONE.getValue())) {
//remark.append("模式:"); //remark.append("模式:");
String mode = params.getString("mode"); String mode = params.getString("mode");
if (Objects.equals(mode, "00")) { if (Objects.equals(mode, UniversalEnum.ZERO_ZERO.getValue())) {
remark.append("远程手动控制模式:上行:"); remark.append("远程手动控制模式:上行:");
String onWorkStatus = params.getString("onWorkStatus"); String onWorkStatus = params.getString("onWorkStatus");
String inWorkStatus = params.getString("inWorkStatus"); String inWorkStatus = params.getString("inWorkStatus");
if (Objects.equals(onWorkStatus, "00")) { if (Objects.equals(onWorkStatus, UniversalEnum.ZERO_ZERO.getValue())) {
remark.append("不更新状态,下行:"); remark.append("不更新状态,下行:");
} else if (Objects.equals(onWorkStatus, "01")) { } else if (Objects.equals(onWorkStatus, UniversalEnum.ZERO_ONE.getValue())) {
remark.append("常亮,下行:"); remark.append("常亮,下行:");
} else if (Objects.equals(onWorkStatus, "02")) { } else if (Objects.equals(onWorkStatus, UniversalEnum.ZERO_TWO.getValue())) {
remark.append("流水,下行:"); remark.append("流水,下行:");
} else if (Objects.equals(onWorkStatus, "03")) { } else if (Objects.equals(onWorkStatus, UniversalEnum.ZERO_THREE.getValue())) {
remark.append("闪烁,下行:"); remark.append("闪烁,下行:");
} else if (Objects.equals(onWorkStatus, "04")) { } else if (Objects.equals(onWorkStatus, UniversalEnum.ZERO_FOUR.getValue())) {
remark.append("关闭,下行:"); remark.append("关闭,下行:");
} }
if (Objects.equals(inWorkStatus, "00")) { if (Objects.equals(inWorkStatus, UniversalEnum.ZERO_ZERO.getValue())) {
remark.append("不更新状态"); remark.append("不更新状态");
} else if (Objects.equals(inWorkStatus, "01")) { } else if (Objects.equals(inWorkStatus, UniversalEnum.ZERO_ONE.getValue())) {
remark.append("常亮"); remark.append("常亮");
} else if (Objects.equals(inWorkStatus, "02")) { } else if (Objects.equals(inWorkStatus, UniversalEnum.ZERO_TWO.getValue())) {
remark.append("流水"); remark.append("流水");
} else if (Objects.equals(inWorkStatus, "03")) { } else if (Objects.equals(inWorkStatus, UniversalEnum.ZERO_THREE.getValue())) {
remark.append("闪烁"); remark.append("闪烁");
} else if (Objects.equals(inWorkStatus, "04")) { } else if (Objects.equals(inWorkStatus, UniversalEnum.ZERO_FOUR.getValue())) {
remark.append("关闭"); remark.append("关闭");
} }
} else if (Objects.equals(mode, "01")) { } else if (Objects.equals(mode, UniversalEnum.ZERO_ONE.getValue())) {
remark.append("时间段自动控制模式:") remark.append("时间段自动控制模式:")
.append(params.getString("startDisplayTime")) .append(params.getString("startDisplayTime"))
.append("-") .append("-")
.append(params.getString("endDisplayTime")); .append(params.getString("endDisplayTime"));
} else if (Objects.equals(mode, "02")) { } else if (Objects.equals(mode, UniversalEnum.ZERO_TWO.getValue())) {
remark.append("万年历自动控制模式"); remark.append("万年历自动控制模式");
} else if (Objects.equals(mode, "03")) { } else if (Objects.equals(mode, UniversalEnum.ZERO_THREE.getValue())) {
remark.append("能见度自动控制模式"); remark.append("能见度自动控制模式");
} }
} else if (Objects.equals(functionId, "30")) { } else if (Objects.equals(functionId, UniversalEnum.THIRTY.getValue())) {
String onWorkStatus = params.getString("onWorkStatus"); String onWorkStatus = params.getString("onWorkStatus");
String inWorkStatus = params.getString("inWorkStatus"); String inWorkStatus = params.getString("inWorkStatus");
if (Objects.equals(onWorkStatus, "00")) { if (Objects.equals(onWorkStatus, UniversalEnum.ZERO_ZERO.getValue())) {
remark.append("上行:不更新状态,下行:"); remark.append("上行:不更新状态,下行:");
} else if (Objects.equals(onWorkStatus, "01")) { } else if (Objects.equals(onWorkStatus, UniversalEnum.ZERO_ONE.getValue())) {
remark.append("上行:常亮,下行:"); remark.append("上行:常亮,下行:");
} else if (Objects.equals(onWorkStatus, "02")) { } else if (Objects.equals(onWorkStatus, UniversalEnum.ZERO_TWO.getValue())) {
remark.append("上行:流水,下行:"); remark.append("上行:流水,下行:");
} else if (Objects.equals(onWorkStatus, "03")) { } else if (Objects.equals(onWorkStatus, UniversalEnum.ZERO_THREE.getValue())) {
remark.append("上行:闪烁,下行:"); remark.append("上行:闪烁,下行:");
} else if (Objects.equals(onWorkStatus, "04")) { } else if (Objects.equals(onWorkStatus, UniversalEnum.ZERO_FOUR.getValue())) {
remark.append("上行:关闭,下行:"); remark.append("上行:关闭,下行:");
} }
if (Objects.equals(inWorkStatus, "00")) { if (Objects.equals(inWorkStatus, UniversalEnum.ZERO_ZERO.getValue())) {
remark.append("不更新状态"); remark.append("不更新状态");
} else if (Objects.equals(inWorkStatus, "01")) { } else if (Objects.equals(inWorkStatus, UniversalEnum.ZERO_ONE.getValue())) {
remark.append("常亮"); remark.append("常亮");
} else if (Objects.equals(inWorkStatus, "02")) { } else if (Objects.equals(inWorkStatus, UniversalEnum.ZERO_TWO.getValue())) {
remark.append("流水"); remark.append("流水");
} else if (Objects.equals(inWorkStatus, "03")) { } else if (Objects.equals(inWorkStatus, UniversalEnum.ZERO_THREE.getValue())) {
remark.append("闪烁"); remark.append("闪烁");
} else if (Objects.equals(inWorkStatus, "04")) { } else if (Objects.equals(inWorkStatus, UniversalEnum.ZERO_FOUR.getValue())) {
remark.append("关闭"); remark.append("关闭");
@ -561,30 +561,30 @@ public class OperationLogAspect {
// : String.valueOf(((HashMap<String, Object>) (DEVICEFUNCTIONNAME.get(deviceType))).get(functionId)); // : String.valueOf(((HashMap<String, Object>) (DEVICEFUNCTIONNAME.get(deviceType))).get(functionId));
// //
//remark.append(hashMap).append(":"); //remark.append(hashMap).append(":");
if (Objects.equals(deviceType, "13") || Objects.equals(deviceType, "16")) { if (Objects.equals(deviceType, UniversalEnum.THIRTEEN.getValue()) || Objects.equals(deviceType, UniversalEnum.SIXTEEN.getValue())) {
String identification = params.getString("deviceName"); String identification = params.getString("deviceName");
String value = params.getString("value"); String value = params.getString("value");
if (Objects.equals(identification, "ac_out_1_en")) { if (Objects.equals(identification, "ac_out_1_en")) {
remark.append("220V 输出 1").append(Objects.equals(value, "1") ? "打开" : "关闭"); remark.append("220V 输出 1").append(Objects.equals(value, UniversalEnum.ONE.getValue()) ? UniversalEnum.UNPACK.getValue() : UniversalEnum.OFF.getValue());
} else if (Objects.equals(identification, "ac_out_2_en")) { } else if (Objects.equals(identification, "ac_out_2_en")) {
remark.append("220V 输出 2").append(Objects.equals(value, "1") ? "打开" : "关闭"); remark.append("220V 输出 2").append(Objects.equals(value, UniversalEnum.ONE.getValue()) ? UniversalEnum.UNPACK.getValue() : UniversalEnum.OFF.getValue());
} else if (Objects.equals(identification, "dc_out_1_en")) { } else if (Objects.equals(identification, "dc_out_1_en")) {
remark.append("12V 输出 1").append(Objects.equals(value, "1") ? "打开" : "关闭"); remark.append("12V 输出 1").append(Objects.equals(value, UniversalEnum.ONE.getValue()) ? UniversalEnum.UNPACK.getValue() : UniversalEnum.OFF.getValue());
} else if (Objects.equals(identification, "dc_out_2_en")) { } else if (Objects.equals(identification, "dc_out_2_en")) {
remark.append("12V 输出 2").append(Objects.equals(value, "1") ? "打开" : "关闭"); remark.append("12V 输出 2").append(Objects.equals(value, UniversalEnum.ONE.getValue()) ? UniversalEnum.UNPACK.getValue() : UniversalEnum.OFF.getValue());
} else if (Objects.equals(identification, "fan_out_en")) { } else if (Objects.equals(identification, "fan_out_en")) {
remark.append("风扇").append(Objects.equals(value, "1") ? "打开" : "关闭"); remark.append("风扇").append(Objects.equals(value, UniversalEnum.ONE.getValue()) ? UniversalEnum.UNPACK.getValue() : UniversalEnum.OFF.getValue());
} }

Loading…
Cancel
Save