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<JSONObject> 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);
|
}
|
}
|