czt
2 天以前 b1e6bf7d3ed1a1d64182127f83fdc3fad2233a7e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.fzzy.sys.manager.security;
 
import com.fzzy.igds.constant.RespCodeEnum;
import com.fzzy.igds.data.PageResponse;
import com.fzzy.igds.domain.Camera;
import com.fzzy.igds.service.SecCameraService;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * @Description
 * @Author CZT
 * @Date 2025/12/9 9:19
 */
@Slf4j
@Component
public class SecManager {
 
    @Resource
    private SecCameraService secCameraService;
 
    /**
     *
     * @param deptId
     * @param companyId
     * @return
     */
    public List<Camera> listCamera(String deptId, String companyId) {
        if (null == deptId){
            return null;
        }
 
        List<Camera> list = secCameraService.getCameraByDeptId(companyId, deptId);
 
        if (null == list || list.isEmpty()){
            return null;
        }
 
        return list;
    }
 
    /**
     * 根据监控ID获取监控信息
     * @param companyId
     * @param cameraId
     * @return
     */
    public Camera getCameraById(String companyId, String cameraId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        if (StringUtils.isEmpty(cameraId)){
            return null;
        }
        return secCameraService.getCameraById(companyId, cameraId);
    }
 
    /**
     *
     * @param params
     * @return
     */
    public PageResponse<String> updatePos(List<Camera> params) {
 
        if (null == params || params.isEmpty()) {
            return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                    "当前没有需要执行的信息!");
        }
 
        for (Camera param : params) {
            secCameraService.updatePos(param);
        }
 
        secCameraService.refreshCache(ContextUtil.getCompanyId());
        return new PageResponse<>(RespCodeEnum.CODE_0000, "执行成功!!");
    }
}