czt
2026-01-29 3b5a487f187138ee67e83752d9a67d2bb9058f36
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
package com.fzzy.igds.api.v1.service;
 
import com.fzzy.igds.api.v1.data.ApiV1Req;
import com.fzzy.igds.api.v1.data.ApiV1Resp;
import com.fzzy.igds.api.v1.util.ApiV1Constant;
import com.fzzy.igds.domain.GatewaySer;
import com.fzzy.igds.service.SecCameraService;
import com.fzzy.igds.service.SnapConfService;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
 
/**
 * @Description 心跳解析
 * @Author CZT
 * @Date 2026/1/7 11:01
 */
@Slf4j
@Component
public class ApiV1Service3010 {
 
    @Resource
    private SecCameraService cameraService;
    @Resource
    private SnapConfService snapConfService;
 
    /**
     *
     * @param req
     * @param gatewaySer
     * @return
     */
    public ApiV1Resp<Object> analysis(ApiV1Req<Object> req, GatewaySer gatewaySer) {
 
        Date end = new Date();
        Date start = gatewaySer.getHeartbeatTime();
        String functionId = "";
 
        //判断抓拍配置是否有更新
        int snapConfCount = snapConfService.getUpdateCount(gatewaySer.getDeptId(), start, end);
        if (snapConfCount > 0) {
            functionId += ApiV1Constant.API_FUNCTION_3020 + ",";
        }
 
        //判断监控是有更新
        int cameraCount = cameraService.getUpdateCount(gatewaySer.getDeptId(), start, end);
        if (cameraCount > 0) {
            functionId += ApiV1Constant.API_FUNCTION_3021 + ",";
        }
 
        if (StringUtils.isNotBlank(functionId)) {
            req.setFunctionId(functionId);
        }
        log.info("质押监管接口V1,3010接口解析完成={}", req);
        return ApiV1Resp.success(null, req);
    }
}