Browse Source

Merge branch 'master' of http://124.70.58.209:3000/ytrd-project-management/GeoHazardMonitor

hexiao 1 year ago
parent
commit
4e1a9e4cbf

+ 0 - 1
business-service/src/main/java/com/ozs/service/entity/CameraLogDetail.java

@@ -73,7 +73,6 @@ public class CameraLogDetail implements Serializable {
     /**
      * 备注
      */
-    @Excel(name = "备注")
     private String remark;
 
     /**

+ 1 - 1
business-service/src/main/java/com/ozs/service/service/impl/BaseCameraManagementServiceImpl.java

@@ -318,7 +318,7 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
     public List<BaseCameraManagement> cameraAllList(BaseCameraManagement baseCameraManagement) {
         LambdaQueryWrapper<BaseCameraManagement> wrapper = new LambdaQueryWrapper<>();
         if (!StringUtils.isEmptySunhh(baseCameraManagement) && !StringUtils.isEmptySunhh(baseCameraManagement.getCameraCode())) {
-            wrapper.eq(BaseCameraManagement::getCameraCode, baseCameraManagement.getCameraCode());
+            wrapper.like(BaseCameraManagement::getCameraCode, baseCameraManagement.getCameraCode());
         }
         if (!StringUtils.isEmptySunhh(baseCameraManagement) && !StringUtils.isEmptySunhh(baseCameraManagement.getVersionId())) {
             wrapper.ne(BaseCameraManagement::getVersionId, baseCameraManagement.getVersionId());

+ 13 - 13
business-service/src/main/java/com/ozs/service/service/impl/CameraCaptureService.java

@@ -25,6 +25,7 @@ public class CameraCaptureService {
         HttpURLConnection connection = null;
         BufferedInputStream bis = null;
         BufferedOutputStream bos = null;
+        ByteArrayOutputStream byteArrayOutputStream = null;
         try {
             connection = (HttpURLConnection) url.openConnection();
             // http正文内,因此需要设为true
@@ -49,20 +50,19 @@ public class CameraCaptureService {
             connection.connect();
 
             // 返回流
-            System.out.println("responseCode=" + connection.getResponseCode());
+            System.out.println("responseCode=" + connection.getResponseCode()+"url"+url.toString());
             log.info("responseCode="+connection.getResponseCode());
             if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
                 InputStream input = connection.getInputStream();
                 bis = new BufferedInputStream(input);
-                minioUtils.minIoClientUpload(bis, fileName);
-                FileOutputStream output = new FileOutputStream(fileName);
-                bos = new BufferedOutputStream(output);
-                byte[] buffer = new byte[1024];
-                int size = 0;
-                while ((size = bis.read(buffer, 0, 1024)) != -1) {
-                    bos.write(buffer, 0, size);
+                byte [] bytes = new byte[102400];
+                int index = 0;
+                byteArrayOutputStream = new ByteArrayOutputStream();
+                while (-1 != (index = input.read(bytes,0,bytes.length))){
+                    byteArrayOutputStream.write(bytes,0,index);
                 }
-                bos.flush();
+                ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
+                minioUtils.minIoClientUpload(byteArrayInputStream, fileName);
             }
         } catch (Exception e) {
             //先关闭外层的缓冲流,再关闭内层的流,但是在关闭外层流的同时,
@@ -72,13 +72,13 @@ public class CameraCaptureService {
             if (bis != null) {
                 bis.close();
             }
-//            if (bos != null) {
-//                bos.close();
-//            }
             if (connection != null) {
                 connection.disconnect();
             }
-//            os.close();
+            if(byteArrayOutputStream != null){
+                byteArrayOutputStream.flush();
+                byteArrayOutputStream.close();
+            }
         }
     }
 }

+ 1 - 1
business-service/src/main/java/com/ozs/service/utils/PublishCallback.java

@@ -85,7 +85,7 @@ public class PublishCallback implements MqttCallback {
             if (sign.startsWith("rate")&&code==400){
                 CallbackUtil.callback(deviceSn,code,"帧率升级失败");
             }
-            if (sign.startsWith("cient")&&code==400){
+            if (sign.startsWith("cien")&&code==400){
                 CallbackUtil.callback(deviceSn,code,"置信度升级失败");
             }
             CallbackUtil.callback(deviceSn,code,"");

+ 4 - 3
business-service/src/main/java/com/ozs/service/utils/PublishClient.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.ozs.common.utils.sign.Md5Utils;
 import com.ozs.common.utils.stateSecrets.SM4Utils;
+import com.ozs.common.utils.uuid.IdUtils;
 import com.ozs.service.entity.vo.BaseCameraVersionVo;
 import com.ozs.service.entity.vo.Codec;
 import com.ozs.service.entity.vo.Data;
@@ -167,7 +168,7 @@ public class PublishClient {
                 updateDeviceSn.setName("UpdateRequest");
                 updateDeviceSn.setType(Integer.valueOf(baseCameraVersionVo.getUpgradeType()));
                 updateDeviceSn.setMd5(baseCameraVersionVo.getMd5());
-                updateDeviceSn.setSign(UUID.randomUUID().toString());
+                updateDeviceSn.setSign(IdUtils.fastSimpleUUID());
                 updateDeviceSn.setUrl(baseCameraVersionVo.getVersionAddress());
                 String s = JSON.toJSONString(updateDeviceSn);
                 server.message = new MqttMessage();
@@ -209,7 +210,7 @@ public class PublishClient {
                 Map<String, Object> map = new HashMap<>();
                 map.put("svp", svp);
                 res.put("data", map);
-                res.put("sign", "cient"+UUID.randomUUID().toString());
+                res.put("sign", "cien"+IdUtils.fastSimpleUUID());
                 String s = JSONObject.toJSONString(res);
 
                 server.message = new MqttMessage();
@@ -251,7 +252,7 @@ public class PublishClient {
                 Map<String, Object> map = new HashMap<>();
                 map.put("codec", codec);
                 res.put("data", map);
-                res.put("sign", "rate"+UUID.randomUUID().toString());
+                res.put("sign", "rate"+IdUtils.fastSimpleUUID());
                 String s = JSONObject.toJSONString(res);
 
                 server.message = new MqttMessage();

+ 0 - 80
hazard-admin/src/main/java/com/ozs/web/controller/common/PictureController.java

@@ -1,80 +0,0 @@
-package com.ozs.web.controller.common;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.ozs.common.core.domain.AjaxResult;
-import com.ozs.common.utils.ApiTokenUtils;
-import com.ozs.common.utils.MinioUtils;
-import com.ozs.common.utils.uuid.IdUtils;
-import com.ozs.service.entity.BaseCameraManagement;
-import com.ozs.service.entity.MsgAlarm;
-import com.ozs.service.service.BaseCameraManagementService;
-import com.ozs.service.service.MsgAlarmService;
-import com.ozs.service.service.impl.CameraCaptureService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-
-/**
- * @author wyy
- * @subject
- * @creat 2023/4/18
- */
-@RestController
-@RequestMapping("/getPicture")
-public class PictureController {
-    private static final Logger log = LoggerFactory.getLogger(PictureController.class);
-    @Resource
-    private ApiTokenUtils apiTokenUtils;
-    @Resource
-    BaseCameraManagementService baseCameraManagementService;
-    @Resource
-    MsgAlarmService msgAlarmService;
-    @Resource
-    CameraCaptureService cameraCaptureService;
-
-    /**
-     * 获取图片
-     *
-     * @param
-     * @return
-     */
-    @PostMapping("/api/snap")
-    public AjaxResult getPicture() throws IOException {
-        List<BaseCameraManagement> list = baseCameraManagementService.list();
-        list.forEach(l -> {
-            String uuid = IdUtils.fastSimpleUUID();
-            if(!ObjectUtils.isEmpty(l.getCameraCode()) &&!ObjectUtils.isEmpty(l.getChannel())){
-                QueryWrapper<MsgAlarm> queryWrapper = new QueryWrapper<MsgAlarm>();
-                queryWrapper.lambda().eq(MsgAlarm::getCameraCode,l.getCameraCode());
-                queryWrapper.lambda().eq(MsgAlarm::getIsLock,2);
-                List<MsgAlarm> msgAlarmList = msgAlarmService.list(queryWrapper);
-                try {
-                    System.out.println("http://124.70.58.209:18891/snap/"+l.getCameraCode()+"/"+l.getChannel());
-                    log.info("请求url"+"http://124.70.58.209:18891/snap/"+l.getCameraCode()+"/"+l.getChannel());
-                    URL url = new URL("http://124.70.58.209:18891/snap/"+l.getCameraCode()+"/"+l.getChannel());
-                    String fileName = "cameraPicture/"+l.getCameraCode()+"_"+uuid +".jpg";
-                    log.info("fileName="+fileName);
-                    cameraCaptureService.getCapture(url, fileName);
-                } catch (MalformedURLException e) {
-                    e.printStackTrace();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        });
-        return AjaxResult.success(list);
-    }
-}

+ 71 - 0
hazard-admin/src/main/java/com/ozs/web/controller/shotschedule/ShotExecutors.java

@@ -0,0 +1,71 @@
+package com.ozs.web.controller.shotschedule;
+
+import com.ozs.system.service.ISysDictDataService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import java.util.UUID;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author wyy
+ * @subject
+ * @creat 2023/5/6
+ */
+@Configuration
+@EnableScheduling
+@EnableAsync
+@Slf4j
+public class ShotExecutors {
+
+   // private  static ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(5);
+    @Autowired
+    private ISysDictDataService dictDataService;
+    @Autowired
+    private TaskNormalService taskNormalService; //定时任务-没有报警摄像头
+    @Autowired
+    private TaskAlarmService taskAlarmService;//定时任务-报警摄像头
+
+    /**
+     * 处理非预警摄像头截图
+     */
+    @Async
+    @Scheduled(fixedRate = 500)
+    public void handleNormalPicture() {
+        boolean shotSwitch = Boolean.parseBoolean(dictDataService.selectDictLabel("shot_switch", String.valueOf(0)));
+        try {
+            if (shotSwitch) {
+                taskNormalService.getNormalPicture();
+            }
+        } catch (Exception e) {
+            e.getMessage();
+            log.error(e.getMessage());
+        }
+    }
+
+    /**
+     * 处理预警摄像头截图
+     */
+    @Async
+    @Scheduled(fixedRate = 200)
+    public void handleAlarmPicture() {
+        boolean shotSwitch = Boolean.parseBoolean(dictDataService.selectDictLabel("shot_switch", String.valueOf(0)));
+        try {
+            if (shotSwitch) {
+                taskAlarmService.getAlarmPicture();
+            }
+        } catch (Exception e) {
+            e.getMessage();
+            log.error(e.getMessage());
+        }
+    }
+}

+ 79 - 0
hazard-admin/src/main/java/com/ozs/web/controller/shotschedule/TaskAlarmService.java

@@ -0,0 +1,79 @@
+package com.ozs.web.controller.shotschedule;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ozs.common.utils.uuid.IdUtils;
+import com.ozs.service.entity.BaseCameraManagement;
+import com.ozs.service.entity.MsgAlarm;
+import com.ozs.service.service.BaseCameraManagementService;
+import com.ozs.service.service.MsgAlarmService;
+import com.ozs.service.service.impl.CameraCaptureService;
+import com.ozs.system.service.ISysDictDataService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @author wyy
+ * @subject
+ * @creat 2023/5/6
+ */
+@Slf4j
+@Service
+public class TaskAlarmService {
+    @Resource
+    BaseCameraManagementService baseCameraManagementService;
+    @Resource
+    MsgAlarmService msgAlarmService;
+    @Resource
+    CameraCaptureService cameraCaptureService;
+    @Autowired
+    private ISysDictDataService dictDataService;
+    private  static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+    @Value("${shot.urlAddress}")
+    private String urlAddress;
+
+
+    public void getAlarmPicture() {
+        QueryWrapper<MsgAlarm> queryWrapper = new QueryWrapper<MsgAlarm>();
+        queryWrapper.lambda().eq(MsgAlarm::getIsLock,2);
+        List<MsgAlarm> msgAlarmList = msgAlarmService.list(queryWrapper);
+        if(!CollectionUtils.isEmpty(msgAlarmList) && Objects.nonNull(msgAlarmList.get(0))){
+            msgAlarmList.forEach(l -> {
+                String uuid = IdUtils.fastSimpleUUID();
+                QueryWrapper<BaseCameraManagement> wrapper = new QueryWrapper<BaseCameraManagement>();
+                wrapper.lambda().eq(BaseCameraManagement::getCameraCode,l.getCameraCode());
+                BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(wrapper);
+                if(!ObjectUtils.isEmpty(l.getCameraCode()) &&!ObjectUtils.isEmpty(baseCameraManagement)){
+                    try {
+                        System.out.println(urlAddress+l.getCameraCode()+"/"+baseCameraManagement.getChannel());
+                        log.info("请求url======"+urlAddress+l.getCameraCode()+"/"+baseCameraManagement.getChannel());
+                        URL url = new URL(urlAddress+l.getCameraCode()+"/"+baseCameraManagement.getChannel());
+                        String root = dictDataService.selectDictLabel("shot_address", String.valueOf(0));
+                        String dateString = format.format(new Date());
+                        String fileName = root + "/" + dateString + "/" + uuid + ".jpeg";
+                        //String fileName = root + "/" + dateString + "/alarm/"+ l.getCameraCode()+"_"+ uuid + ".jpeg";
+                        log.info("fileName======"+fileName);
+                        log.info("报警摄像头截图开始");
+                        cameraCaptureService.getCapture(url, fileName);
+                        log.info("报警摄像头截图结束");
+                    } catch (Throwable e) {
+                        e.printStackTrace();
+                        log.error(e.getMessage());
+                    }
+                }
+            });
+        }
+    }
+}

+ 82 - 0
hazard-admin/src/main/java/com/ozs/web/controller/shotschedule/TaskNormalService.java

@@ -0,0 +1,82 @@
+package com.ozs.web.controller.shotschedule;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ozs.common.utils.uuid.IdUtils;
+import com.ozs.service.entity.BaseCameraManagement;
+import com.ozs.service.entity.MsgAlarm;
+import com.ozs.service.service.BaseCameraManagementService;
+import com.ozs.service.service.MsgAlarmService;
+import com.ozs.service.service.impl.CameraCaptureService;
+import com.ozs.system.service.ISysDictDataService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @author wyy
+ * @subject
+ * @creat 2023/5/6
+ */
+@Slf4j
+@Service
+public class TaskNormalService{
+    @Resource
+    BaseCameraManagementService baseCameraManagementService;
+    @Resource
+    MsgAlarmService msgAlarmService;
+    @Resource
+    CameraCaptureService cameraCaptureService;
+    @Autowired
+    private ISysDictDataService dictDataService;
+    private  static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+    @Value("${shot.urlAddress}")
+    private String urlAddress;
+
+
+    public void getNormalPicture() {
+        List<BaseCameraManagement> list = baseCameraManagementService.list();
+        QueryWrapper<MsgAlarm> queryWrapper = new QueryWrapper<MsgAlarm>();
+        queryWrapper.lambda().eq(MsgAlarm::getIsLock,2);
+        List<MsgAlarm> msgAlarmList = msgAlarmService.list(queryWrapper);
+        list.forEach(l -> {
+            if(!CollectionUtils.isEmpty(msgAlarmList) && Objects.nonNull(msgAlarmList.get(0))) {
+                boolean isCotain = msgAlarmList.stream().filter(m -> m.getCameraCode().equals(l.getCameraCode())).findAny().isPresent();
+                    if(isCotain){
+                        return;
+                    }
+            }
+            String uuid = IdUtils.fastSimpleUUID();
+            if (!ObjectUtils.isEmpty(l.getCameraCode()) && !ObjectUtils.isEmpty(l.getChannel())) {
+                try {
+                    System.out.println(urlAddress + l.getCameraCode() + "/" + l.getChannel());
+                    log.info("请求url======" + urlAddress + l.getCameraCode() + "/" + l.getChannel());
+                    URL url = new URL(urlAddress + l.getCameraCode() + "/" + l.getChannel());
+                    String root = dictDataService.selectDictLabel("shot_address", String.valueOf(0));
+                    String dateString = format.format(new Date());
+                    String fileName = root + "/" + dateString + "/" + uuid + ".jpeg";
+                    //String fileName = root + "/" + dateString + "/normal/"+ l.getCameraCode()+"_"+ uuid + ".jpeg";
+                    log.info("fileName======" + fileName);
+                    log.info("没有报警摄像头截图开始");
+                    cameraCaptureService.getCapture(url, fileName);
+                    log.info("没有报警摄像头截图结束");
+                } catch (MalformedURLException e) {
+                    e.printStackTrace();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+    }
+}

+ 3 - 3
hazard-admin/src/main/java/com/ozs/web/controller/system/SysDeptController.java

@@ -96,7 +96,7 @@ public class SysDeptController extends BaseController {
     @PreAuthorize("@ss.hasPermi('system:dept:query')")
     @GetMapping(value = "/{deptId}")
     public AjaxResult getInfo(@PathVariable Long deptId) {
-        deptService.checkDeptDataScope(deptId);
+        //deptService.checkDeptDataScope(deptId);
         SysDept dept = deptService.selectDeptById(deptId);
         dept.setParentName(deptService.selectDeptById(dept.getParentId()).getDeptName());
         return success(dept);
@@ -133,7 +133,7 @@ public class SysDeptController extends BaseController {
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody SysDept dept) {
         Long deptId = dept.getDeptId();
-        deptService.checkDeptDataScope(deptId);
+        //deptService.checkDeptDataScope(deptId);
         if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
             return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
         } else if (dept.getParentId().equals(deptId)) {
@@ -167,7 +167,7 @@ public class SysDeptController extends BaseController {
         if (deptService.checkDeptExistUser(deptId)) {
             return warn("部门存在用户,不允许删除");
         }
-        deptService.checkDeptDataScope(deptId);
+        //deptService.checkDeptDataScope(deptId);
         return toAjax(deptService.deleteDeptById(deptId));
     }
 

+ 10 - 6
hazard-admin/src/main/java/com/ozs/web/controller/system/SysRoleController.java

@@ -16,6 +16,7 @@ import com.ozs.common.core.domain.entity.SysMenu;
 import com.ozs.common.core.domain.vo.SysDeptVo;
 import com.ozs.common.core.domain.vo.SysRoleRequestVo;
 import com.ozs.common.core.domain.vo.SysUserVo;
+import com.ozs.service.entity.BaseRailwayManagement;
 import com.ozs.service.entity.BaseUser;
 import com.ozs.service.service.BaseUserService;
 import com.ozs.system.domain.SysRoleMenu;
@@ -97,13 +98,15 @@ public class SysRoleController extends BaseController {
     @Log(title = "角色管理", businessType = BusinessType.SELECT)
     public AjaxResult page(@NotEmpty(message = "数据为空")
                            @RequestBody SysRoleRequestVo vo) {
-        vo = (SysRoleRequestVo) dataScoreUtil.setDataScore(getUserId(), vo);
-        IPage<SysRole> page = roleService.queryPage(vo);
-        page.setTotal(page.getTotal());
-        page.setCurrent(page.getCurrent());
-        page.setPages(page.getPages());
+        LambdaQueryWrapper<SysRole> lw = new LambdaQueryWrapper<SysRole>();
+        if (!StringUtils.isBlank(vo.getRoleName())) {
+            lw.like(SysRole::getRoleName, "%" + vo.getRoleName() + "%");
+        }
+        if (!ObjectUtils.isEmpty(vo.getStatus())) {
+            lw.eq(SysRole::getStatus, vo.getStatus());
+        }
+        IPage<SysRole> page = roleService.page(new Page<SysRole>(vo.getPageNum(), vo.getPageSize()), lw);
         return success(page);
-
     }
 
     @Log(title = "角色管理", businessType = BusinessType.EXPORT)
@@ -172,6 +175,7 @@ public class SysRoleController extends BaseController {
             if (!ObjectUtils.isEmpty(role.getStatus())) {
                 role.setStatus("1");
             }
+            return error("超级管理员角色不能修改");
         } else {
             if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
                 return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");

+ 18 - 0
hazard-admin/src/main/java/com/ozs/web/controller/system/SysUserController.java

@@ -29,6 +29,8 @@ import com.ozs.service.entity.MsgAlarm;
 import com.ozs.service.entity.vo.CameraTreeVo;
 import com.ozs.service.entity.vo.MsgAlarmVo;
 import com.ozs.service.service.BaseUserService;
+import com.ozs.system.domain.SysUserRole;
+import com.ozs.system.mapper.SysUserRoleMapper;
 import com.ozs.system.service.DataScoreUtil;
 import com.ozs.system.service.ISysDictTypeService;
 import io.swagger.annotations.ApiOperation;
@@ -92,6 +94,8 @@ public class SysUserController extends BaseController {
     private ISysDictTypeService dictTypeService;
     @Value("${base.defaultPassword:yn5aq5Mt.106.tky}")
     private String defaultPassword;
+    @Autowired
+    private SysUserRoleMapper sysUserRoleMapper;
 //    /**
 //     * 获取用户列表
 //     */
@@ -357,6 +361,20 @@ public class SysUserController extends BaseController {
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @GetMapping("/resetPwd/{id}")
     public AjaxResult resetPwd(@PathVariable(value = "id") Long id) {
+        boolean stop=false;
+        LambdaQueryWrapper<SysUserRole> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(SysUserRole::getUserId,id);
+        List<SysUserRole> sysUserRoles = sysUserRoleMapper.selectList(wrapper);
+        for (SysUserRole sysUserRole : sysUserRoles) {
+            String roleKey = roleService.getRoleKey(sysUserRole.getRoleId());
+            if ("admin".equals(roleKey)){
+                stop=true;
+                break;
+            }
+        }
+        if (!stop){
+            return error("只有超级管理员才能重置密码!!");
+        }
         String password = null;
         SysUser user = new SysUser();
         user.setId(id);

+ 2 - 2
hazard-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

@@ -170,7 +170,7 @@ public class CameraUtil {
      * @return
      */
     public static String startRecording(String cameraCode, String channel) {
-        return webUrl + "/api/record/flv/start?streamPath=" + channel + "/" + cameraCode;
+        return webUrl + "/recordpro/api/start?streamPath=" + channel + "/" + cameraCode;
     }
 
     /**
@@ -180,7 +180,7 @@ public class CameraUtil {
      * @return
      */
     public static String endRecording(String taskId) {
-        return webUrl + "/api/record/flv/stop?id=" + taskId;
+        return webUrl + "/recordpro/api/stop?id=" + taskId;
     }
 
 

+ 3 - 0
hazard-admin/src/main/resources/application.yml

@@ -168,3 +168,6 @@ mqtt:
   host: tcp://124.70.58.209:1883
   userName: guest
   passWord: guest
+
+shot:
+  urlAddress: http://124.70.58.209:18891/snap/