|
@@ -125,20 +125,19 @@ public class GeoHazardMonitorTokenController {
|
|
|
AjaxResults AjaxResults1 = null;
|
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
|
String[] split = token.split("-");
|
|
|
- String key = split[split.length - 1];
|
|
|
if (ObjectUtils.isEmpty(parameterVo)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "parameterVo参数不能为空");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
- String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
|
|
|
+ String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), "f5408458becc8c68");
|
|
|
ReqMsgAlarmMatterVo reqMsgAlarmMatterVo = JSON.parseObject(s, ReqMsgAlarmMatterVo.class);
|
|
|
if (!reqMsgAlarmMatterVo.getAlarmMile().toString().matches(PATTERNS)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "报警里程位置填写错误");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (reqMsgAlarmMatterVo.getLineDir() != 1 && reqMsgAlarmMatterVo.getLineDir() != 2) {
|
|
|
AjaxResults1 = new AjaxResults(0, "行别填写错误");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
LambdaQueryWrapper<BaseRailwayManagement> queryWrapper = new LambdaQueryWrapper<BaseRailwayManagement>();
|
|
|
if (!ObjectUtils.isEmpty(reqMsgAlarmMatterVo.getAlarmRailway())) {
|
|
@@ -147,23 +146,23 @@ public class GeoHazardMonitorTokenController {
|
|
|
BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(queryWrapper);
|
|
|
if (ObjectUtils.isEmpty(baseRailwayManagement)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "填写的报警线路编码不存在");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (ObjectUtils.isEmpty(reqMsgAlarmMatterVo.getAlarmId())) {
|
|
|
AjaxResults1 = new AjaxResults(0, "报警的唯一标识不能为空");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (ObjectUtils.isEmpty(reqMsgAlarmMatterVo.getAlarmTime())) {
|
|
|
AjaxResults1 = new AjaxResults(0, "报警时间不能为空");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (reqMsgAlarmMatterVo.getAlarmType() < 1 || reqMsgAlarmMatterVo.getAlarmType() > 4) {
|
|
|
AjaxResults1 = new AjaxResults(0, "报警病害类型填写错误");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (!reqMsgAlarmMatterVo.getAlarmLevel().toString().matches(PATTERNS)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "报警级别填写错误");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (reqMsgAlarmMatterVo.getAlarmTime().toString().length() == 10) {
|
|
|
reqMsgAlarmMatterVo.setAlarmTime(reqMsgAlarmMatterVo.getAlarmTime() * 1000);
|
|
@@ -198,11 +197,11 @@ public class GeoHazardMonitorTokenController {
|
|
|
for (int i = 0; i < files1.length; i++) {
|
|
|
if (ObjectUtils.isEmpty(files1[i].fileUrl)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "上传文件地址不能为空!!!");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (files1[i].fileType < 1 || files1[i].fileType > 3) {
|
|
|
AjaxResults1 = new AjaxResults(0, "文件类型填写错误!!!");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
MsgAlarmExt msgAlarmExt = new MsgAlarmExt();
|
|
|
msgAlarmExt.setAlarmId(msgAlarmMatter.getAlarmId());
|
|
@@ -239,7 +238,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
long end = System.currentTimeMillis();
|
|
|
log.info("报警信息数据传输结束时间: " + simpleDateFormat.format(new Date(end)));
|
|
|
log.info("报警信息数据传输请求用时时间:" + (end - begin) + "毫秒");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
} else {
|
|
|
AjaxResults1 = new AjaxResults(2, "token验证失败");
|
|
|
return JSONObject.toJSONString(AjaxResults1);
|
|
@@ -260,36 +259,34 @@ public class GeoHazardMonitorTokenController {
|
|
|
log.info("token:{}", token);
|
|
|
log.info("parameter:{}", parameterVo);
|
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
|
- String[] split = token.split("-");
|
|
|
- String key = split[split.length - 1];
|
|
|
if (ObjectUtils.isEmpty(parameterVo)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "parameterVo参数不能为空");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
- String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
|
|
|
+ String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), "f5408458becc8c68");
|
|
|
ReleaseAlarmVo releaseAlarmVo = JSON.parseObject(s, ReleaseAlarmVo.class);
|
|
|
if (ObjectUtils.isEmpty(releaseAlarmVo.getAlarmId())) {
|
|
|
AjaxResults1 = new AjaxResults(0, "报警的唯一标识不能为空");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (ObjectUtils.isEmpty(releaseAlarmVo.getReleaseTime())) {
|
|
|
AjaxResults1 = new AjaxResults(0, "解除报警时间不能为空");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (ObjectUtils.isEmpty(releaseAlarmVo.getReleaseContent())) {
|
|
|
AjaxResults1 = new AjaxResults(0, "解除原因不能为空");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (ObjectUtils.isEmpty(releaseAlarmVo.getOperator())) {
|
|
|
AjaxResults1 = new AjaxResults(0, "解除人不能为空");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
LambdaQueryWrapper<MsgAlarmMatter> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.eq(MsgAlarmMatter::getAlarmId, releaseAlarmVo.getAlarmId());
|
|
|
MsgAlarmMatter msgAlarm = msgAlarmMatterService.getOne(wrapper);
|
|
|
if (ObjectUtils.isEmpty(msgAlarm)) {
|
|
|
AjaxResults1 = new AjaxResults(0, "不存在该报警的唯一标识的数据");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
}
|
|
|
if (releaseAlarmVo.getReleaseTime().toString().length() == 10) {
|
|
|
releaseAlarmVo.setReleaseTime(releaseAlarmVo.getReleaseTime() * 1000);
|
|
@@ -314,7 +311,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
map.put("releaseState", 2);
|
|
|
AjaxResults1 = new AjaxResults(0, "失败", map);
|
|
|
}
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), "f5408458becc8c68");
|
|
|
} else {
|
|
|
AjaxResults1 = new AjaxResults(2, "token验证失败");
|
|
|
return JSONObject.toJSONString(AjaxResults1);
|