|
@@ -161,7 +161,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
@PostMapping("/api/token")
|
|
|
public String getWebToken(@RequestBody SvcAddress svcAddress) {
|
|
|
// 生成令牌
|
|
|
- AjaxResult ajaxResult1=null;
|
|
|
+ AjaxResult ajaxResult1 = null;
|
|
|
if (ObjectUtils.isEmpty(svcAddress)) {
|
|
|
ajaxResult1 = new AjaxResult(0, "svcAddress参数不能为空");
|
|
|
return JSONObject.toJSONString(ajaxResult1);
|
|
@@ -195,7 +195,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
Long l = Long.valueOf(objects.get(0));
|
|
|
respGeoHazardMonitorVo.setExpiresIn(l / 1000);
|
|
|
respGeoHazardMonitorVo.setTokenType("令牌类型");
|
|
|
- ajaxResult1 = new AjaxResult(1, "ok",respGeoHazardMonitorVo);
|
|
|
+ ajaxResult1 = new AjaxResult(1, "ok", respGeoHazardMonitorVo);
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), sm4);
|
|
|
} else {
|
|
|
ajaxResult1 = new AjaxResult(0, "生成token失败");
|
|
@@ -220,7 +220,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
String token = apiTokenUtils.getGeoHazardMonitorToken(request);
|
|
|
log.info("token:{}", token);
|
|
|
log.info("parameter:{}", parameterVo);
|
|
|
- AjaxResult ajaxResult1=null;
|
|
|
+ AjaxResult ajaxResult1 = null;
|
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
|
String[] split = token.split("-");
|
|
|
String key = split[split.length - 1];
|
|
@@ -364,7 +364,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
*/
|
|
|
@PostMapping("/api/releaseAlarm")
|
|
|
public String releaseAlarm(@RequestBody ParameterVo parameterVo, HttpServletRequest request) {
|
|
|
- AjaxResult ajaxResult1=null;
|
|
|
+ AjaxResult ajaxResult1 = null;
|
|
|
String token = apiTokenUtils.getGeoHazardMonitorToken(request);
|
|
|
log.info("token:{}", token);
|
|
|
log.info("parameter:{}", parameterVo);
|
|
@@ -413,10 +413,10 @@ public class GeoHazardMonitorTokenController {
|
|
|
map.put("alarmId", msgAlarm.getAlarmId());
|
|
|
if (count) {
|
|
|
map.put("releaseState", 1);
|
|
|
- ajaxResult1 = new AjaxResult(1, "ok",map);
|
|
|
+ ajaxResult1 = new AjaxResult(1, "ok", map);
|
|
|
} else {
|
|
|
map.put("releaseState", 2);
|
|
|
- ajaxResult1 = new AjaxResult(0, "失败",map);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "失败", map);
|
|
|
}
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
} else {
|
|
@@ -435,6 +435,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
@PostMapping("/api/terminal/heartbeat")
|
|
|
@Transactional
|
|
|
public String heartbeat(@RequestBody ParameterVo parameterVo, HttpServletRequest request) {
|
|
|
+ AjaxResult ajaxResult1 = null;
|
|
|
long begin = System.currentTimeMillis();
|
|
|
Map<String, Object> twoMap = new HashMap<>();
|
|
|
int distance = 0;
|
|
@@ -443,43 +444,32 @@ public class GeoHazardMonitorTokenController {
|
|
|
String token = apiTokenUtils.getGeoHazardMonitorToken(request);
|
|
|
//log.info("token:{}", token);
|
|
|
//log.info("parameter:{}", parameterVo);
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
|
String[] split = token.split("-");
|
|
|
String key = split[split.length - 1];
|
|
|
if (ObjectUtils.isEmpty(parameterVo)) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "parameterVo参数不能为空");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "parameterVo参数不能为空");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
// 1. 解密参数
|
|
|
String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
|
|
|
// 2、 心跳参数
|
|
|
HeartbeatVo heartbeatVo = JSON.parseObject(s, HeartbeatVo.class);
|
|
|
if (ObjectUtils.isEmpty(heartbeatVo.getTerminalCode())) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "车载终端编码不能为空");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "车载终端编码不能为空");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
if (!heartbeatVo.getCurrentMile().toString().matches(PATTERNS)) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "当前里程位置填写错误");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "当前里程位置填写错误");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
if (ObjectUtils.isEmpty(heartbeatVo.getLatitude())) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "当前所在纬度不能为空");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "当前所在纬度不能为空");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
if (ObjectUtils.isEmpty(heartbeatVo.getLongitude())) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "当前所在经度不能为空");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "当前所在经度不能为空");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
LambdaQueryWrapper<BaseRailwayManagement> railway = new LambdaQueryWrapper<BaseRailwayManagement>();
|
|
|
if (!ObjectUtils.isEmpty(heartbeatVo.getRailwayCode())) {
|
|
@@ -487,28 +477,20 @@ public class GeoHazardMonitorTokenController {
|
|
|
}
|
|
|
BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(railway);
|
|
|
if (ObjectUtils.isEmpty(baseRailwayManagement)) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "填写的线路编码不存在");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "填写的线路编码不存在");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
if (heartbeatVo.getLineDir() != 1 && heartbeatVo.getLineDir() != 2) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "行别填写错误");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "行别填写错误");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
if (!heartbeatVo.getVisualDistance().toString().matches(PATTERNS)) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "司机目视距离填写错误");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "司机目视距离填写错误");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
if (heartbeatVo.getSignalStrength() != 1 && heartbeatVo.getSignalStrength() != 2) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "信号强度填写错误");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "信号强度填写错误");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
VehiclePosition vehiclePosition = new VehiclePosition();
|
|
|
BeanUtils.copyProperties(heartbeatVo, vehiclePosition);
|
|
@@ -516,10 +498,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
wrapper.eq(BaseVehicleTerminal::getTerminalCode, vehiclePosition.getTerminalCode());
|
|
|
BaseVehicleTerminal baseTerminal = baseVehicleTerminalService.getOne(wrapper);
|
|
|
if (ObjectUtils.isEmpty(baseTerminal)) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "关联表中没有改终端编码的信息");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "关联表中没有改终端编码的信息");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
if (heartbeatVo.getSignalStrength() == 1) {
|
|
|
type = 0;
|
|
@@ -606,10 +586,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
camerasVo.setCameraIndexCode(baseCameraManagementList.get(0).getCameraCode());
|
|
|
String playFlv = cameraUtil.apiPreviewURLs(camerasVo);
|
|
|
if ("1".equals(playFlv)) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- jsonObject.put("data", "天网实时流接口调用失败");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "天网实时流接口调用失败");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
respHeartbeatVo.setCurrentStream(playFlv);
|
|
|
respHeartbeatVo.setIsAlarm(1);
|
|
@@ -639,10 +617,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
}
|
|
|
respHeartbeatVo.setAlarmInfo(alarmInfoVo);
|
|
|
} else {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- jsonObject.put("data", "报警里程无可用相机");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "报警里程无可用相机");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
MsgHeartbeatAlarmMessage msgHearbeatAlarmMessage = new MsgHeartbeatAlarmMessage();
|
|
@@ -670,10 +646,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
camerasVo.setCameraIndexCode(baseList.get(o).getCameraCode());
|
|
|
String playFlv = cameraUtil.apiPreviewURLs(camerasVo);
|
|
|
if ("1".equals(playFlv)) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- jsonObject.put("data", "天网实时流接口调用失败");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "天网实时流接口调用失败");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
AlarmListVo alarmListVo = new AlarmListVo();
|
|
|
//alarmList对象
|
|
@@ -716,10 +690,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
base.last("limit 4");
|
|
|
List<BaseCameraManagement> list1 = baseCameraManagementService.list(base);
|
|
|
if (list1.size() <= 0) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- jsonObject.put("data", "没有监控里程的相机");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "没有监控里程的相机");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
//获取视频点播地址
|
|
|
CamerasVo camerasVo = new CamerasVo();
|
|
@@ -727,10 +699,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
camerasVo.setCameraIndexCode(list1.get(0).getCameraCode());
|
|
|
String playFlv = cameraUtil.apiPreviewURLs(camerasVo);
|
|
|
if ("1".equals(playFlv)) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- jsonObject.put("data", "天网实时流接口调用失败");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "天网实时流接口调用失败");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
twoMap.put("currentStream", playFlv);
|
|
|
twoMap.put("cameraCode", list1.get(0).getCameraCode());
|
|
@@ -750,10 +720,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
base.last("limit 4");
|
|
|
List<BaseCameraManagement> list1 = baseCameraManagementService.list(base);
|
|
|
if (list1.size() <= 0) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- jsonObject.put("data", "没有监控里程的相机");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "没有监控里程的相机");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
//获取视频点播地址
|
|
|
CamerasVo camerasVo = new CamerasVo();
|
|
@@ -761,10 +729,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
camerasVo.setCameraIndexCode(list1.get(0).getCameraCode());
|
|
|
String playFlv = cameraUtil.apiPreviewURLs(camerasVo);
|
|
|
if ("1".equals(playFlv)) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- jsonObject.put("data", "天网实时流接口调用失败");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "天网实时流接口调用失败");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
twoMap.put("currentStream", playFlv);
|
|
|
twoMap.put("cameraCode", list1.get(0).getCameraCode());
|
|
@@ -784,21 +750,17 @@ public class GeoHazardMonitorTokenController {
|
|
|
twoMap.put("visualDistance", heartbeatVo.getVisualDistance().toString());
|
|
|
String string = JSON.toJSONString(twoMap);
|
|
|
heartbeatUtils.createHeartbeat(Constant.HERTBEA_KEY + heartbeatVo.getTerminalCode(), string);
|
|
|
- jsonObject.put("resultCode", 1);
|
|
|
- jsonObject.put("message", "ok");
|
|
|
- jsonObject.put("data", respHeartbeatVo);
|
|
|
+ ajaxResult1 = new AjaxResult(1, "ok",respHeartbeatVo);
|
|
|
long end = System.currentTimeMillis();
|
|
|
- System.out.println("-------------------" + (begin - end) / 1000);
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ System.out.println("-------------------" + (begin - end)+"秒");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
} else {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "心跳机制交互失败");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "心跳机制交互失败");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
} else {
|
|
|
- jsonObject.put("resultCode", 2);
|
|
|
- jsonObject.put("message", "token验证失败");
|
|
|
- return JSONObject.toJSONString(jsonObject);
|
|
|
+ ajaxResult1 = new AjaxResult(2, "token验证失败");
|
|
|
+ return JSONObject.toJSONString(ajaxResult1);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -816,29 +778,23 @@ public class GeoHazardMonitorTokenController {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
log.info("token:{}", token);
|
|
|
log.info("parameter:{}", parameterVo);
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
+ AjaxResult ajaxResult1 = null;
|
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
|
String[] split = token.split("-");
|
|
|
String key = split[split.length - 1];
|
|
|
if (ObjectUtils.isEmpty(parameterVo)) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "parameterVo参数不能为空");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "parameterVo参数不能为空");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
|
|
|
TerminalIgnoreVo terminalIgnoreVo = JSON.parseObject(s, TerminalIgnoreVo.class);
|
|
|
if (ObjectUtils.isEmpty(terminalIgnoreVo.getTerminalCode())) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "车载终端编码不能为空");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "车载终端编码不能为空");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
if (ObjectUtils.isEmpty(terminalIgnoreVo.getAlarmId())) {
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "报警唯一UUID不能为空");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "报警唯一UUID不能为空");
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
map.put("terminalCode", terminalIgnoreVo.getTerminalCode());
|
|
|
map.put("alarmId", terminalIgnoreVo.getAlarmId());
|
|
@@ -847,10 +803,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
MsgAlarm msgAlarm = msgAlarmService.getOne(wrapper);
|
|
|
if (ObjectUtils.isEmpty(msgAlarm)) {
|
|
|
map.put("isIgnore", 1);
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- jsonObject.put("data", map);
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "失败",map);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
}
|
|
|
TerminalIgnoreAlarm terminalIgnoreAlarm = new TerminalIgnoreAlarm();
|
|
|
terminalIgnoreAlarm.setAlarmId(terminalIgnoreVo.getAlarmId());
|
|
@@ -862,21 +816,16 @@ public class GeoHazardMonitorTokenController {
|
|
|
if (save) {
|
|
|
ignoreUtils.createIgnore("HL" + terminalIgnoreAlarm.getTerminalCode(), terminalIgnoreAlarm.getAlarmId());
|
|
|
map.put("isIgnore", 2);
|
|
|
- jsonObject.put("resultCode", 1);
|
|
|
- jsonObject.put("message", "ok");
|
|
|
- jsonObject.put("data", map);
|
|
|
+ ajaxResult1 = new AjaxResult(1, "ok",map);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
} else {
|
|
|
map.put("isIgnore", 3);
|
|
|
- jsonObject.put("resultCode", 0);
|
|
|
- jsonObject.put("message", "失败");
|
|
|
- jsonObject.put("data", map);
|
|
|
+ ajaxResult1 = new AjaxResult(0, "失败",map);
|
|
|
}
|
|
|
- return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
|
|
|
} else {
|
|
|
- jsonObject.put("resultCode", 2);
|
|
|
- jsonObject.put("message", "token验证失败");
|
|
|
- jsonObject.put("data", "");
|
|
|
- return JSONObject.toJSONString(jsonObject);
|
|
|
+ ajaxResult1 = new AjaxResult(2, "token验证失败");
|
|
|
+ return JSONObject.toJSONString(ajaxResult1);
|
|
|
}
|
|
|
}
|
|
|
|