Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
zhaoxianglong 5 months ago
parent
commit
4dcfab3c29
  1. 54
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

54
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -842,6 +842,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
errorResult.put("code",UniversalEnum.FIVE_HUNDRED.getNumber()); errorResult.put("code",UniversalEnum.FIVE_HUNDRED.getNumber());
errorResult.put("msg",UniversalEnum.OPERATION_FAILURE.getValue()); errorResult.put("msg",UniversalEnum.OPERATION_FAILURE.getValue());
result.put("deviceName", deviceTypeName); result.put("deviceName", deviceTypeName);
result.put("deviceType", deviceType);
result.put("content", UniversalEnum.NO_DEVICE_FOUND.getValue()); result.put("content", UniversalEnum.NO_DEVICE_FOUND.getValue());
result.put("result", errorResult); result.put("result", errorResult);
resultArray.add(result); resultArray.add(result);
@ -871,12 +872,8 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
// functions // functions
List<Map<String, Object>> functionList = new ArrayList<>(); List<Map<String, Object>> functionList = new ArrayList<>();
remark.append("在");
SimpleDateFormat dateFormat = new SimpleDateFormat(UniversalEnum.TIME_FORMAT_ALL.getValue());
Calendar calendar = Calendar.getInstance();
remark.append(dateFormat.format(calendar.getTime()));
remark.append(UniversalEnum.INVOKE.getValue());
remark.append(device.getDeviceName()); remark.append(device.getDeviceName());
remark.append(UniversalEnum.INVOKE.getValue());
try { try {
if (device.getDeviceType().equals(DeviceTypeConstants.DRIVING_GUIDANCE.toString())) { if (device.getDeviceType().equals(DeviceTypeConstants.DRIVING_GUIDANCE.toString())) {
// 行车诱导 // 行车诱导
@ -901,6 +898,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
} }
result.put("device", device.getId()); result.put("device", device.getId());
result.put("deviceName", device.getDeviceName()); result.put("deviceName", device.getDeviceName());
result.put("deviceType", deviceType);
processingDeviceParameters(functionId, functionList, props); processingDeviceParameters(functionId, functionList, props);
@ -909,11 +907,10 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
if (ajaxResult.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) { if (ajaxResult.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) {
status = UniversalEnum.ZERO.getNumber(); status = UniversalEnum.ZERO.getNumber();
remark.append(UniversalEnum.SUCCESSFUL.getValue());
} else { } else {
status = UniversalEnum.ONE.getNumber(); status = UniversalEnum.ONE.getNumber();
remark.append(UniversalEnum.LOSE.getValue());
} }
remark.append(UniversalEnum.DEVICE_CONTROL_MODE.getValue());
result.put("result", ajaxResult); result.put("result", ajaxResult);
resultArray.add(result); resultArray.add(result);
@ -930,16 +927,16 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("device", device.getId()); result.put("device", device.getId());
result.put("deviceName", device.getDeviceName()); result.put("deviceName", device.getDeviceName());
result.put("deviceType", deviceType);
result.put("content", UniversalEnum.RESTORE_LAST_TIME.getValue()); result.put("content", UniversalEnum.RESTORE_LAST_TIME.getValue());
result.put("result", ajaxResult1B); result.put("result", ajaxResult1B);
resultArray.add(result); resultArray.add(result);
if (ajaxResult1B.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) { if (ajaxResult1B.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) {
status = UniversalEnum.ZERO.getNumber(); status = UniversalEnum.ZERO.getNumber();
remark.append(UniversalEnum.SUCCESSFUL.getValue());
} else { } else {
status = UniversalEnum.ONE.getNumber(); status = UniversalEnum.ONE.getNumber();
remark.append(UniversalEnum.LOSE.getValue());
} }
remark.append(UniversalEnum.RESTORE_LAST_TIME.getValue());
} else { } else {
// 情报板发布全流程 // 情报板发布全流程
JSONArray contentList = JSON.parseArray(otherConfig.get("contentList").toString()); JSONArray contentList = JSON.parseArray(otherConfig.get("contentList").toString());
@ -949,28 +946,28 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
jsonObject.get("dcDeviceId").toString().equals(device.getId().toString())) jsonObject.get("dcDeviceId").toString().equals(device.getId().toString()))
.findFirst() .findFirst()
.orElse(null); .orElse(null);
remark.append(UniversalEnum.FILE_NAME_SENDING.getValue());
remark.append("、");
remark.append(UniversalEnum.FILE_SENDING.getValue());
remark.append("、");
remark.append(UniversalEnum.SPECIFIES_THE_LIST_THAT_CURRENTLY_NEEDS_TO_BE_PLAYED.getValue());
if (foundContent == null) { if (foundContent == null) {
// 说明没有匹配到设备 // 说明没有匹配到设备
JSONObject errorResult = new JSONObject(); JSONObject errorResult = new JSONObject();
errorResult.put("device", device.getId()); errorResult.put("device", device.getId());
errorResult.put("content", UniversalEnum.THE_CORRESPONDING_TEMPLATE_CONTENT_IS_NOT_MATCHED.getValue()); errorResult.put("content", UniversalEnum.THE_CORRESPONDING_TEMPLATE_CONTENT_IS_NOT_MATCHED.getValue());
errorResult.put("deviceName", device.getDeviceName()); errorResult.put("deviceName", device.getDeviceName());
errorResult.put("deviceType", deviceType);
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("result",errorResult); result.put("result",errorResult);
result.put("code",UniversalEnum.FIVE_HUNDRED.getNumber()); result.put("code",UniversalEnum.FIVE_HUNDRED.getNumber());
result.put("msg",UniversalEnum.OPERATION_FAILURE.getValue()); result.put("msg",UniversalEnum.OPERATION_FAILURE.getValue());
resultArray.add(result); resultArray.add(result);
status = UniversalEnum.ONE.getNumber(); status = UniversalEnum.ONE.getNumber();
remark.append(UniversalEnum.LOSE.getValue());
} else { } else {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("dcInfoBoardTemplate", foundContent); jsonObject.put("dcInfoBoardTemplate", foundContent);
status = boardReleaseProcess(props, iotDeviceId, jsonObject, device, resultArray, functionList); status = boardReleaseProcess(props, iotDeviceId, jsonObject, device, resultArray, functionList);
if (status.equals(UniversalEnum.ZERO.getNumber())) {
remark.append(UniversalEnum.SUCCESSFUL.getValue());
} else {
remark.append(UniversalEnum.LOSE.getValue());
}
} }
} }
@ -994,6 +991,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
JSONObject errorResult = new JSONObject(); JSONObject errorResult = new JSONObject();
errorResult.put("device", device.getId()); errorResult.put("device", device.getId());
errorResult.put("deviceName", device.getDeviceName()); errorResult.put("deviceName", device.getDeviceName());
errorResult.put("deviceType", deviceType);
errorResult.put("content", UniversalEnum.NO_BROADCAST_CONTENT_IS_MATCHED_PROCEDURE.getValue()); errorResult.put("content", UniversalEnum.NO_BROADCAST_CONTENT_IS_MATCHED_PROCEDURE.getValue());
resultArray.add(errorResult); resultArray.add(errorResult);
} }
@ -1012,20 +1010,23 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("device", device.getId()); result.put("device", device.getId());
result.put("deviceName", device.getDeviceName()); result.put("deviceName", device.getDeviceName());
result.put("deviceType", deviceType);
result.put("content", params.get("text")); result.put("content", params.get("text"));
remark.append(UniversalEnum.RELEASE_VOICE_BROADCAST.getValue());
processingDeviceParameters(UniversalEnum.A_ONE.getValue(), functionList, params); processingDeviceParameters(UniversalEnum.A_ONE.getValue(), functionList, params);
JSONObject returnResult = broadcastController.nearCamListDistance(params); JSONObject returnResult = broadcastController.nearCamListDistance(params);
result.put("result", returnResult);
resultArray.add(result);
if (Objects.equals(returnResult.getString("retCode"), UniversalEnum.ZERO.getValue())) { if (Objects.equals(returnResult.getString("retCode"), UniversalEnum.ZERO.getValue())) {
status = UniversalEnum.ZERO.getNumber(); status = UniversalEnum.ZERO.getNumber();
remark.append(UniversalEnum.SUCCESSFUL.getValue()); returnResult.put("code", UniversalEnum.TWO_HUNDRED.getNumber());
} else { } else {
status = UniversalEnum.ONE.getNumber(); status = UniversalEnum.ONE.getNumber();
remark.append(UniversalEnum.LOSE.getValue()); returnResult.put("code", UniversalEnum.FIVE_HUNDRED.getNumber());
} }
result.put("result", returnResult);
resultArray.add(result);
} else if (device.getDeviceType().equals(DeviceTypeConstants.LASER_FATIGUE_AWAKENING.toString())) { } else if (device.getDeviceType().equals(DeviceTypeConstants.LASER_FATIGUE_AWAKENING.toString())) {
@ -1035,6 +1036,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
JSONObject resultTime = new JSONObject(); JSONObject resultTime = new JSONObject();
resultTime.put("device", device.getId()); resultTime.put("device", device.getId());
resultTime.put("deviceName", device.getDeviceName()); resultTime.put("deviceName", device.getDeviceName());
resultTime.put("deviceType", device.getDeviceType());
remark.append(UniversalEnum.MODE_SETTING_COMMAND.getValue());
remark.append("、");
remark.append(UniversalEnum.WORK_TIME_SETTING_COMMAND.getValue());
processingDeviceParameters(UniversalEnum.SETMD.getValue(), functionList, map); processingDeviceParameters(UniversalEnum.SETMD.getValue(), functionList, map);
@ -1057,10 +1063,8 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
if (ajaxResultState.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber()) && ajaxResult.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) { if (ajaxResultState.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber()) && ajaxResult.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) {
status = UniversalEnum.ZERO.getNumber(); status = UniversalEnum.ZERO.getNumber();
remark.append(UniversalEnum.SUCCESSFUL.getValue());
} else { } else {
status = UniversalEnum.ONE.getNumber(); status = UniversalEnum.ONE.getNumber();
remark.append(UniversalEnum.LOSE.getValue());
} }
} }
@ -1153,6 +1157,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("device", device.getId()); result.put("device", device.getId());
result.put("deviceName", device.getDeviceName()); result.put("deviceName", device.getDeviceName());
result.put("deviceType", device.getDeviceType());
if (ajaxResult13.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) { if (ajaxResult13.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) {
HashMap<String, Object> props1B = new HashMap<>(); HashMap<String, Object> props1B = new HashMap<>();
// 3: 执行1B功能码 // 3: 执行1B功能码
@ -1179,6 +1184,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
JSONObject error = new JSONObject(); JSONObject error = new JSONObject();
error.put("result",ajaxResult11); error.put("result",ajaxResult11);
error.put("deviceName",device.getDeviceName()); error.put("deviceName",device.getDeviceName());
error.put("deviceType",device.getDeviceType());
error.put("device",device.getId()); error.put("device",device.getId());
error.put("content",dcInfoBoardTemplate.getContent()); error.put("content",dcInfoBoardTemplate.getContent());
resultArray.add(error); resultArray.add(error);
@ -1216,7 +1222,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
dcOperLog.setOperIp(IpUtils.getIpAddr(ServletUtils.getRequest())); dcOperLog.setOperIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
dcOperLog.setOperLocation(SecurityUtils.getLoginUser().getLoginLocation()); dcOperLog.setOperLocation(SecurityUtils.getLoginUser().getLoginLocation());
dcOperLog.setOperParam(JSON.toJSONString(propsList)); dcOperLog.setOperParam(JSON.toJSONString(propsList));
dcOperLog.setJsonResult(String.valueOf(resultList)); List<JSONObject> filterResult = resultList.stream()
.map(o -> JSON.parseObject(o.toString()))
.filter(jsonObject -> jsonObject.getString("device").equals(dcDevice.getId().toString()))
.collect(Collectors.toList());
dcOperLog.setJsonResult(String.valueOf(filterResult));
dcOperLog.setStatus(status); dcOperLog.setStatus(status);
dcOperLog.setOperTime(new Date()); dcOperLog.setOperTime(new Date());
dcOperLog.setRemark(remark); dcOperLog.setRemark(remark);

Loading…
Cancel
Save