Browse Source

扫码报警图片视频改为内网路径

develop
lau572 3 months ago
parent
commit
5ccd92b5f5
  1. 30
      zc-business/src/main/java/com/zc/business/controller/CodeScanningAlarmController.java

30
zc-business/src/main/java/com/zc/business/controller/CodeScanningAlarmController.java

@ -113,9 +113,10 @@ public class CodeScanningAlarmController extends BaseController {
}
String id = String.valueOf(params.get("id"));
String type = String.valueOf(params.get("type"));
String url = String.valueOf(params.get("url"));
String url = String.valueOf(params.get("url")); //外网路径
String intranetUrl = String.valueOf(params.get("intranetUrl")); //内网路径
if (StringUtils.isEmpty(id) || StringUtils.isEmpty(type) || StringUtils.isEmpty(url)){
if (StringUtils.isEmpty(id) || StringUtils.isEmpty(type) || StringUtils.isEmpty(url) || StringUtils.isEmpty(intranetUrl)){
return AjaxResult.error("参数错误");
}
@ -125,20 +126,39 @@ public class CodeScanningAlarmController extends BaseController {
}
JSONObject otherConfig = JSONObject.parseObject(oldData.get("otherConfig").toString());
if (type.equals("video")){
//内网路径
JSONArray videoUrl = new JSONArray();
if (otherConfig.containsKey("videoUrl")){
videoUrl = otherConfig.getJSONArray("videoUrl");
}
videoUrl.add(url);
videoUrl.add(intranetUrl);
otherConfig.put("videoUrl",videoUrl);
//外网路径
JSONArray externalVideoUrl = new JSONArray();
if (otherConfig.containsKey("externalVideoUrl")){
externalVideoUrl = otherConfig.getJSONArray("externalVideoUrl");
}
externalVideoUrl.add(url);
otherConfig.put("externalVideoUrl",externalVideoUrl);
} else {
//内网路径
JSONArray imgUrl = new JSONArray();
if (otherConfig.containsKey("imgUrl")){
imgUrl = otherConfig.getJSONArray("imgUrl");
}
imgUrl.add(url);
imgUrl.add(intranetUrl);
otherConfig.put("imgUrl",imgUrl);
//外网路径
JSONArray externalImgUrl = new JSONArray();
if (otherConfig.containsKey("externalImgUrl")){
externalImgUrl = otherConfig.getJSONArray("externalImgUrl");
}
externalImgUrl.add(url);
otherConfig.put("externalImgUrl",externalImgUrl);
}
DcWarning dcWarning = new DcWarning();
dcWarning.setId(oldData.get("id").toString());
@ -153,7 +173,7 @@ public class CodeScanningAlarmController extends BaseController {
} else {
dcEventProcess.setType("png");
}
dcEventProcess.setContext(url);
dcEventProcess.setContext(intranetUrl);
dcEventProcess.setOperatorName("上报人");
dcEventProcess.setOperationTime(new Date());
dcEventProcessMapper.insertDcEventProcess(dcEventProcess);

Loading…
Cancel
Save