| | |
| | | import com.fzzy.igds.camera.data.ApiCameraData; |
| | | import com.fzzy.igds.camera.data.ApiCameraResp; |
| | | import com.fzzy.igds.constant.RespCodeEnum; |
| | | import com.fzzy.igds.data.PageResponse; |
| | | import com.fzzy.igds.data.PatrolSuperData; |
| | | import com.fzzy.igds.domain.Camera; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import com.fzzy.igds.domain.Patrol; |
| | | import com.fzzy.igds.domain.PatrolRecord; |
| | | import com.fzzy.igds.service.CoreDeptService; |
| | | import com.fzzy.igds.service.PatrolService; |
| | | import com.fzzy.igds.service.SecCameraService; |
| | | import com.fzzy.igds.data.*; |
| | | import com.fzzy.igds.domain.*; |
| | | import com.fzzy.igds.service.*; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | |
| | | public class SecManager { |
| | | |
| | | @Resource |
| | | private CommonManager commonManager; |
| | | @Resource |
| | | private SecCameraService secCameraService; |
| | | @Resource |
| | | private ApiCameraManager apiCameraManager; |
| | |
| | | @Resource |
| | | private CoreDeptService coreDeptService; |
| | | @Resource |
| | | private CommonManager commonManager; |
| | | private QuantityService quantityService; |
| | | @Resource |
| | | private FileService fileService; |
| | | |
| | | /** |
| | | * |
| | | * @param deptId |
| | | * @param companyId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 根据监控ID获取监控信息 |
| | | * |
| | | * @param companyId |
| | | * @param cameraId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取播放信息 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 云台控制 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 预置位设置 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | secCameraService.refreshCache(ContextUtil.getCompanyId()); |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, "执行成功!!"); |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功!!"); |
| | | } |
| | | |
| | | /** |
| | | * 巡检统计 |
| | | * |
| | | * @return |
| | | */ |
| | | public PatrolSuperData patrolTrack() { |
| | |
| | | |
| | | return patrolRecords; |
| | | } |
| | | |
| | | /** |
| | | * 获取数量检测配置信息 |
| | | * |
| | | * @param deptId |
| | | * @return |
| | | */ |
| | | public List<QuantityConf> getQuantityConfByDeptId(String deptId) { |
| | | |
| | | return quantityService.getConfList(ContextUtil.getCompanyId(), deptId); |
| | | } |
| | | |
| | | /** |
| | | * 查询数量检测记录,默认查询4条 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<List<Quantity>> quantityList(IgdsBaseParam param) { |
| | | |
| | | if (StringUtils.isEmpty(param.getDepotId())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), "参数为空!!"); |
| | | } |
| | | |
| | | List<Quantity> quantityList = quantityService.getQuantityList(param.getDepotId(), 4); |
| | | if (null == quantityList || quantityList.isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "数据为空!!"); |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功!!", quantityList); |
| | | } |
| | | |
| | | /** |
| | | * 查询数量检测记录,默认查询7条,封装成图表信息 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<GroupIndexData> getQuantityChart(IgdsBaseParam param) { |
| | | |
| | | if (StringUtils.isEmpty(param.getDepotId())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), "参数为空!!"); |
| | | } |
| | | |
| | | |
| | | List<Quantity> quantityList = quantityService.getQuantityList(param.getDepotId(), 7); |
| | | if (null == quantityList || quantityList.isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "数据为空!!"); |
| | | } |
| | | |
| | | GroupIndexData data = new GroupIndexData(); |
| | | |
| | | for (int i = (quantityList.size() - 1); i >= 0; i--) { |
| | | data.getXaxis().add(DateFormatUtils.format(quantityList.get(i).getReceiveDate(), "MM-dd HH:mm")); |
| | | data.getSeriesData().add(quantityList.get(i).getWeight() + ""); |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功!!", data); |
| | | } |
| | | |
| | | /** |
| | | * 查询检测数据对应抓图 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<List<FileInfo>> getQuantityFiles(IgdsBaseParam param) { |
| | | |
| | | if (StringUtils.isEmpty(param.getKey())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), "参数为空!!"); |
| | | } |
| | | |
| | | List<FileInfo> fileList = fileService.listFile(null, param.getKey()); |
| | | if (null == fileList || fileList.isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "数据为空!!"); |
| | | } |
| | | |
| | | //判断文件是否存在 |
| | | for (FileInfo fileInfo : fileList) { |
| | | fileInfo.setFilePath(commonManager.isImgExit(fileInfo.getFilePath(), null)); |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功!!", fileList); |
| | | } |
| | | } |