imageConfigs = imageConfigService.selectByExample(example);
+ return R.data(imageConfigs);
+
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+ }
+
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/controller/ImageInfoController.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/controller/ImageInfoController.java
new file mode 100644
index 0000000..368221c
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/controller/ImageInfoController.java
@@ -0,0 +1,178 @@
+package com.hnac.hzims.videoimage.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import com.hnac.hzims.videoimage.entity.ImageInfo;
+import com.hnac.hzims.videoimage.service.ImageInfoService;
+import com.hnac.hzims.videoimage.util.ConvertUtils;
+import com.hnac.hzims.videoimage.vo.ImageInfoVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ *
+ * 图片数据放在公共库,不进行切库处理,因此查询操作不需要加@ChangeHZDataSource
+ *
+ */
+@RestController
+@RequestMapping("/videoImage/imageInfo")
+@Api(value = "图片墙图片数据接口", tags = "图片墙图片数据接口")
+public class ImageInfoController {
+
+ @Autowired
+ private ImageInfoService imageInfoService;
+
+
+ @RequestMapping(value="/addImage", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="上传图片", value = "上传图片")
+ public R addImage(@RequestParam("data") MultipartFile file, HttpServletRequest request) throws Exception {
+
+ try {
+ Object path = imageInfoService.addImage(file);
+ if (path!=null) {
+ return R.data(path);
+ } else {
+ return R.fail(500,"操作失败");
+ }
+ }catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+
+ }
+
+
+ @RequestMapping(value="/addImageInfo", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="手动添加图片", value = "手动添加图片")
+ public R addImageInfo(@ModelAttribute ImageInfo imageInfo){
+
+ try {
+ int status = imageInfoService.addImageInfo(imageInfo);
+ if (status == 1) {
+ return R.data("操作成功");
+ } else {
+ String msg = ConvertUtils.errorCodeToMsg(status);
+ return R.fail(500,msg);
+ }
+ }catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+
+ }
+
+
+ @RequestMapping(value="/deleteImageInfo", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="删除手动添加的图片", value = "删除手动添加的图片")
+ public R deleteImageInfo(@RequestParam long Id){
+
+ try {
+ int status = imageInfoService.deleteImageInfo(Id);
+ if (status == 1) {
+ return R.data("操作成功");
+ } else {
+ String msg = ConvertUtils.errorCodeToMsg(status);
+ return R.fail(500,msg);
+ }
+ }catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+
+ }
+
+
+ /**
+ *
+ * Title: selectNewestImageByDevId
+ * Description: 根据测站编码stcd获取最新图片信息
+ * @param stcds 测站设备编码
+ * @return 图片信息集合
+ */
+
+ @RequestMapping(value="/selectNewestImageByDevId", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="根据测站编码stcd获取最新图片信息", value = "根据测站编码stcd获取最新图片信息")
+ public R selectNewestImageByDevId( String[] stcds) {
+ try {
+
+ List imageInfos = imageInfoService.selectNewestImageByDevId(stcds);
+ return R.data(imageInfos);
+
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+
+ }
+
+ /**
+ *
+ * Title: selectImagesByDevIdAndTime
+ * Description:根据测站编码stcd和时间范围获取图片信息
+ * @param stcd 测站设备编码
+ * @param startTime 开始时间
+ * @param endTime 结束时间
+ * @return 图片数据集合
+ */
+
+ @RequestMapping(value="/selectImagesByDevIdAndTime", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="根据测站编码stcd和时间范围获取图片信息", value = "根据测站编码stcd和时间范围获取图片信息")
+ public R selectImagesByDevIdAndTime(@RequestParam String stcd,
+ @ApiParam(value="查询开始时间字符串,格式为yyyy-MM-dd HH:mm:ss") @RequestParam(required=true, value="startTime") String startTime,
+ @ApiParam(value="查询结束时间字符串,格式为yyyy-MM-dd HH:mm:ss") @RequestParam(required=true, value="endTime") String endTime) {
+
+ try {
+
+ List imageInfos = imageInfoService.selectImagesByDevIdAndTime(stcd,
+ startTime, endTime);
+ return R.data(imageInfos);
+
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+
+ }
+
+ @RequestMapping(value="/pageQueryImagesByDevIdAndTime", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="根据测站编码stcd和时间范围分页获取图片信息", value = "根据测站编码stcd和时间范围分页获取图片信息")
+
+ public R pageQueryImagesByDevIdAndTime(String stcd,
+ @ApiParam(value="查询开始时间字符串,格式为yyyy-MM-dd HH:mm:ss") @RequestParam(required=true, value="startTime") String startTime,
+ @ApiParam(value="查询结束时间字符串,格式为yyyy-MM-dd HH:mm:ss") @RequestParam(required=true, value="endTime") String endTime,
+ Query query) {
+ try {
+
+ IPage imageInfos = imageInfoService.pageQueryImagesByDevIdAndTime(stcd,
+ startTime, endTime, Condition.getPage(query));
+ return R.data(imageInfos);
+
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+
+ }
+
+
+ @RequestMapping(value="/pageQueryManualImagesByDevIdAndTime", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="根据测站编码stcd和时间范围分页获取手动上传图片信息", value = "根据测站编码stcd和时间范围分页获取手动上传图片信息")
+ public R pageQueryManualImagesByDevIdAndTime(String stcd,
+ @ApiParam(value="查询开始时间字符串,格式为yyyy-MM-dd HH:mm:ss") @RequestParam(required=true, value="startTime") String startTime,
+ @ApiParam(value="查询结束时间字符串,格式为yyyy-MM-dd HH:mm:ss") @RequestParam(required=true, value="endTime") String endTime,
+ Query query) {
+ try {
+
+ IPage imageInfos = imageInfoService.pageQueryManualImagesByDevIdAndTime(stcd,
+ startTime, endTime, Condition.getPage(query));
+ return R.data(imageInfos);
+
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+ }
+
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/controller/ImagePointController.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/controller/ImagePointController.java
new file mode 100644
index 0000000..f48af06
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/controller/ImagePointController.java
@@ -0,0 +1,629 @@
+package com.hnac.hzims.videoimage.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
+import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
+import com.hnac.hzinfo.sdk.core.response.Result;
+import com.hnac.hzinfo.sdk.real.RealDataSearchClient;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import com.hnac.hzims.videoimage.entity.*;
+import com.hnac.hzims.videoimage.service.ImageConfigService;
+import com.hnac.hzims.videoimage.service.ImageInfoService;
+import com.hnac.hzims.videoimage.service.ImagePointService;
+import com.hnac.hzims.videoimage.util.Constants;
+import com.hnac.hzims.videoimage.util.ConvertUtils;
+import com.hnac.hzims.videoimage.vo.ImagePointVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/videoImage/imagePoint")
+@Api(value = "图片墙数据点接口", tags = "图片墙数据点接口")
+public class ImagePointController {
+
+ private static Logger logger = LoggerFactory.getLogger(ImagePointController.class);
+
+ @Autowired
+ ImagePointService imagePointService;
+
+ @Autowired
+ ImageConfigService imageConfigService;
+
+// @Autowired
+// private RealDataSearchClient realDataSearchClient;
+
+ @Autowired
+ ImageInfoService imageInfoService;
+
+ @Autowired
+ RealDataSearchClient realDataSearchClient;
+
+// @Autowired
+// IHz3000RealDataClient hz3000RealDataClient;
+
+
+ /**
+ *
+ * Title: addImagePoint
+ * Description:添加测站设备信息
+ * @param imagePoint 测站设备数据结构
+ * @return 操作结果
+ */
+
+ @RequestMapping(value="/addImagePoint", method = {RequestMethod.POST})
+ @ApiOperation(notes ="添加测站", value = "添加测站")
+ public R addImagePoint(@RequestBody ImagePoint imagePoint){
+
+ try {
+ Long userId=AuthUtil.getUserId();
+
+ imagePoint.setCreateUser(userId);
+ imagePoint.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+ imagePoint.setCreateTime(new Date());
+
+ imagePoint.setUpdateTime(new Date());
+ imagePoint.setUpdateUser(userId);
+ imagePoint.setIsDeleted(0);
+
+ int count = imagePointService.addImagePoint(imagePoint);
+ if (count == 1) {
+ return R.data("操作成功");
+ } else {
+ String msg = ConvertUtils.errorCodeToMsg(count);
+ return R.fail(500,msg);
+ }
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+ }
+
+ /**
+ *
+ * Title: deleteImagePoint
+ * Description: 删除测站设备信息,逻辑删除,物理数据库中保留
+ * @param id 测站设备id
+ * @return 操作结果
+ */
+
+ @RequestMapping(value="/deleteImagePoint", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="删除测站", value = "删除测站")
+ public R deleteImagePoint(@RequestParam Long id){
+ try {
+
+ int status = imagePointService.deleteImagePoint(id);
+ if (status == 1) {
+ return R.data("操作成功");
+ } else {
+ String msg = ConvertUtils.errorCodeToMsg(status);
+ return R.fail(500,msg);
+ }
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+ }
+
+ /**
+ *
+ * Title: updateImagePoint
+ * Description: 更新测站设备信息
+ * @param imagePoint 测站数据结果
+ * @return 操作结果
+ */
+
+ @RequestMapping(value="/updateImagePoint", method = {RequestMethod.POST})
+ @ApiOperation(notes ="更新测站", value = "更新测站")
+ public R updateImagePoint(@RequestBody ImagePoint imagePoint){
+
+ try {
+ imagePoint.setUpdateTime(new Date());
+ imagePoint.setUpdateUser(AuthUtil.getUserId());
+ int count = imagePointService.updateImagePoint(imagePoint);
+ if (count == 1) {
+ return R.data("操作成功");
+ } else {
+ String msg = ConvertUtils.errorCodeToMsg(count);
+ return R.fail(500,msg);
+ }
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+ }
+
+ /**
+ *
+ * Title: queryImagePoint
+ * Description: 查询测站设备
+ * @param stcd 测站设备编码
+ * @return 测站设备信息
+ */
+
+ @RequestMapping(value="/queryImagePoint", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="查询测站", value = "查询测站")
+ public R queryImagePoint(@RequestParam String stcd){
+
+ try {
+ ImagePoint imagePoint = imagePointService.selectImagePoint(stcd);
+ return R.data(imagePoint);
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+
+ }
+
+ /**
+ *
+ * Title: queryAllImagePoint
+ * Description:查询所有测站设备信息
+ * @return 测站设备信息集合
+ */
+
+ @RequestMapping(value="/queryAllImagePoint", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="查询所有测站", value = "查询所有测站")
+ public R queryAllImagePoint(){
+
+ try {
+ List imagePoints = imagePointService.selelctAllImagePoint();
+ return R.data(imagePoints);
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+ }
+
+
+ /**
+ *
+ * Title: getRealDataByDeviceCods
+ * Description: 获取点的实时数据信息
+ * @param deviceCodes 点id
+ * @return 点id和对应实时数据映射集合
+ */
+ //15133048833073742754: {value: 0, time: "2000-01-01 00:00:00", point: "", q: 1}
+ //根据realId集合获取实时数据
+ public Map> getRealDataByDeviceCods(String[] deviceCodes) {
+
+ Map> dataMap = new HashMap<>();
+ try{
+ for(int i = 0; i < deviceCodes.length; i++){
+ String deviceCode=deviceCodes[i];
+ //获取实时值
+ RealDataSearchPO po=new RealDataSearchPO();
+ po.setAnalyzeCode(deviceCode);
+ Result> res=realDataSearchClient.getRealDataByDeviceCode(po);
+ logger.info("=================res"+res);
+ dataMap.put(deviceCode, dealRealDataMap(res.getData()));
+ }
+ } catch (Exception e) {
+
+ }
+
+ return dataMap;
+ }
+
+
+ private Map dealRealDataMap(List list){
+ Map data=new HashMap<>();
+ for (FieldsData fieldsData:list){
+ data.put(fieldsData.getSignage(),fieldsData.getValue());
+ }
+ return data;
+ }
+
+ /**
+ *
+ * Title: queryImagePointRelateInfo
+ * Description: 分页查询当前站中的所有测站设备图文实时数据
+ * @param deptId 机构id
+ * @param query 分页参数
+ * @return
+ */
+ // TODO: 后续stationId 改为从session 中获取
+
+ @RequestMapping(value="/queryImagePointRelateInfo", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="分页查询当前站中的所有测站设备图文实时数据", value = "分页查询当前站中的所有测站设备图文实时数据")
+ public R queryImagePointRelateInfo(@RequestParam(required=false, value = "deptId")String deptId,HttpServletRequest request,
+ Query query){
+
+ ArrayList imagePointRelateInfoList = new ArrayList<>();
+ try {
+
+ List queryDeptIds = new ArrayList<>();
+ //http://175.6.40.67:8092/hznet/sys/user/wkStationList?userId=admin
+ logger.debug("queryImagePointRelateInfo deptId is " + deptId);
+ // 根据和前端约定,修改参数:
+ //1、第一次加载前端传当前站点ID
+ if(!StringUtils.isBlank(deptId)){
+ queryDeptIds.add(deptId);
+ } else {
+ //前端不传deptId的情况,后台自动从session中获取
+ String sessionDeptId =request.getHeader("dept-id");
+ if(StringUtils.isBlank(sessionDeptId)) {
+ sessionDeptId = AuthUtil.getDeptId();
+ }
+ logger.debug("queryImagePointRelateInfo sessionDeptId is " + sessionDeptId);
+ queryDeptIds.add(sessionDeptId);
+ }
+
+ // 查出站集合下面的所有设备集合(站和设备,一对多)
+ List stcdList = new ArrayList<>();
+ // 分页查询只要对站下面的设备返回结果分页即可
+ List imagePoints = null;
+ IPage imagePointsModel = imagePointService.pageQueryImagePonit(queryDeptIds, null, null, Condition.getPage(query));
+ //整理出站点下的设备集合
+ if (null != imagePointsModel) {
+ imagePoints = imagePointsModel.getRecords();
+ }
+
+ if(imagePoints==null || imagePoints.isEmpty()){
+ return R.data(null);
+ }
+
+ for(ImagePointVo imagePoint : imagePoints) {
+ stcdList.add(imagePoint.getStcd());
+ }
+ //logger.debug("queryImagePointRelateInfo stcdList=" +stcdList);
+
+ // 根据编码stcds 查询出所有符合条件的属性记录集合,对于属性中的热点数据,需要实时获取
+ ImageConfigExample configExample = new ImageConfigExample();
+ ImageConfigExample.Criteria configCri = configExample.createCriteria();
+ // stcdList 不为空才作为条件查询
+ if (null != stcdList && stcdList.size() > 0){
+ configCri.andStcdIn(stcdList);
+ // 根据前面的设备集合,查询所有的属性集合 (设备和属性,一对多)
+ List imageConfigs = imageConfigService.selectByExample(configExample);
+
+ // TODO: 根据stcd查询其对应的deptId, 还是的一个站一个站地循环查实时数据
+// ArrayList pointsForOneStation = new ArrayList<>();
+// ArrayList ycIdList = new ArrayList<>();
+
+ ArrayList deviceList = new ArrayList<>();
+
+// for(String sid : queryDeptIds){
+// for (ImagePoint imagePoint : imagePoints){
+// //找到某个站下的所有设备stcd
+// if (sid.equals(imagePoint.getCreateDept())){
+// pointsForOneStation.add(imagePoint);
+// }
+// }
+
+
+// for(ImagePoint imagePoint : pointsForOneStation){
+ for(ImagePoint imagePoint : imagePoints){
+ //再根据设备找设备下的所有属性集合config下的实时数据
+ for(ImageConfig ic: imageConfigs) {
+ String type = ic.getType();
+ String stcd = ic.getStcd();
+ if (Constants.REAL_DATA_TYPE.equals(type) &&
+ stcd.equals(imagePoint.getStcd())) {
+ //统一收集realId, 随后一次查询
+ String deviceCode = ic.getDeviceCode();
+ logger.debug(" deviceCode is "+ deviceCode );
+// String realId = ic.getRealid();
+ if(deviceCode!=null && !"".equals(deviceCode)) {
+ deviceList.add(deviceCode);
+ }
+// if(realId!=null && !"".equals(realId)) {
+// ycIdList.add(realId);
+// }
+
+ }
+ }
+ }
+
+ //使用realId集成,查询所有需要查询设备的各个实时数据集成,填充数据结构中的value
+// String[] ycIds = ycIdList.toArray(new String[ycIdList.size()]);
+ String[] deviceCodes = deviceList.toArray(new String[deviceList.size()]);
+ logger.debug(" deviceCodes size is "+( deviceCodes==null ? null: deviceCodes.length));
+
+ Map> realDataByCodes = getRealDataByDeviceCods(deviceCodes);
+
+// Map realDataByIds =null;
+// if(!ycIdList.isEmpty()) {
+// realDataByIds = hz3000RealDataClient.getRealDataById(ycIds, "0");
+// }
+
+// logger.debug("realDataByCodes data for sid=" + sid +" realDataByCodes size is "+( realDataByCodes==null ? null: realDataByCodes.size()));
+
+ for(ImageConfig ic: imageConfigs) {
+ String type = ic.getType();
+ if (Constants.REAL_DATA_TYPE.equals(type)) {
+ String deviceCode = ic.getDeviceCode();
+// String realId = ic.getRealid();
+ //查到实时数据先存储到对应的数据结构内存,不存数据库
+ if (deviceCode!=null && null != realDataByCodes &&
+ null!= realDataByCodes.get(deviceCode)){
+ String value = realDataByCodes.get(deviceCode).get(ic.getCode());
+ ic.setValue(value);
+ }
+// if(realId!=null && realDataByIds!=null && null!= realDataByIds.get(deviceCode)){
+// double value = realDataByIds.get(realId).getValue();
+// BigDecimal dd=new BigDecimal(value);
+// ic.setValue(dd.setScale(3,BigDecimal.ROUND_HALF_UP).toString());
+// } else {
+// logger.error("queryImagePointRelateInfo realData is null ,please check the redis config");
+// }
+
+ }
+ }
+
+ //下一个站之前先清空数据
+// pointsForOneStation.clear();
+ deviceList.clear();
+// ycIdList.clear();
+// }
+
+ // 根据stcds 查询设备的最新图片信息
+ String[] stcds =stcdList.toArray(new String[stcdList.size()]);
+ List imageInfos = imageInfoService.selectNewestImageByDevId(stcds);
+
+ //根据stcd来组装各条数据
+ for(ImagePoint imagePoint: imagePoints) {
+ String stcd = imagePoint.getStcd();
+ ImagePointRelateInfo imagePointRelateInfo = new ImagePointRelateInfo();
+ imagePointRelateInfo.setCreateDept(imagePoint.getCreateDept());
+ imagePointRelateInfo.setStcd(imagePoint.getStcd());
+ imagePointRelateInfo.setAddress(imagePoint.getAddress());
+ imagePointRelateInfo.setCreateTime(imagePoint.getCreateTime());
+ imagePointRelateInfo.setLgtd(imagePoint.getLgtd());
+ imagePointRelateInfo.setLtid(imagePoint.getLtid());
+ imagePointRelateInfo.setRemark(imagePoint.getRemark());
+ imagePointRelateInfo.setStnm(imagePoint.getStnm());
+ imagePointRelateInfo.setPno(imagePoint.getPno());
+ imagePointRelateInfo.setDefaultimagepath(imagePoint.getDefaultimagepath());
+
+
+ ArrayList imageConfigList = new ArrayList<>();
+ for(ImageConfig imageConfig: imageConfigs) {
+ //刷选绑定stcd关联
+ if (stcd.equals(imageConfig.getStcd())) {
+ imageConfigList.add(imageConfig);
+ }
+ }
+ // 设置属性配置集合
+ imagePointRelateInfo.setImageConfigs(imageConfigList);
+
+ int index=0;
+ int imageInfosCount = imageInfos.size();
+ for(ImageInfo imageInfo: imageInfos) {
+
+ //判断年月日时相同
+ if(!checkSameHour(imageInfo)){
+ imageInfo.setData(null);
+ }
+
+ // 将最新图片设置到对应的stcd
+ if (stcd.equals(imageInfo.getStcd())) {
+ imagePointRelateInfo.setNewestImageInfo(imageInfo);
+ break;
+ }
+ //记录是否能找到最新图片,找不到的话需要查询上传的默认图片路径
+ index++;
+ }
+ logger.debug("imageInfosCount="+imageInfosCount+" index="+index + " stcd="+stcd);
+ if (imageInfosCount == index){
+ logger.debug("use default image to show");
+ //使用上传的默认图片地址构造一个最新图片对象
+ ImageInfo defaultImage = new ImageInfo();
+ defaultImage.setData(imagePoint.getDefaultimagepath());
+ defaultImage.setStcd(imagePoint.getStcd());
+ imagePointRelateInfo.setNewestImageInfo(defaultImage);
+ }
+
+ //将数据组装好后放入列表集合中
+ imagePointRelateInfoList.add(imagePointRelateInfo);
+ }
+ }
+
+
+ IPage imagePointRelateInfos = new Page(imagePointsModel.getCurrent(),imagePointsModel.getSize());
+ imagePointRelateInfos.setRecords(imagePointRelateInfoList);
+ imagePointRelateInfos.setPages(imagePointsModel.getPages());
+ imagePointRelateInfos.setTotal(imagePointsModel.getTotal());
+ return R.data(imagePointRelateInfos);
+
+ } catch (Exception e) {
+// e.printStackTrace();
+ return R.fail(500,"操作失败");
+ }
+ }
+
+
+ private boolean checkSameHour(ImageInfo imageInfo){
+ if(imageInfo!=null && imageInfo.getTime()!=null){
+ Date now=new Date();
+ Date old=imageInfo.getTime();
+
+ SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH");
+
+ String nowStr=sdf.format(now);
+ String oldStr=sdf.format(old);
+
+ if(nowStr.equals(oldStr)){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ *
+ * Title: pageQueryImagePoint
+ * Description:分页查询所有测站设备信息
+ * @param deptId 站点id
+ * @param stcd 测站设备编码
+ * @param stnm 测站设备名称
+ * @param query 分页参数
+ * @return
+ */
+
+ @RequestMapping(value="/pageQueryImagePoint", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="分页查询所有测站", value = "分页查询所有测站")
+ public R pageQueryImagePoint(@ApiParam(value = "deptId,精确匹配") @RequestParam(required=false, value = "deptId")String deptId,
+ @ApiParam(value = "测站设备编码,精确匹配") @RequestParam(required=false, value = "stcd") String stcd,
+ @ApiParam(value = "测站设备名称,模糊匹配") @RequestParam(required=false, value = "stnm")String stnm,
+ Query query,HttpServletRequest request){
+
+ try {
+
+ List deptIds = new ArrayList<>();
+ // 根据和前端约定,修改参数:
+ //1、第一次加载前端传当前站点ID
+ //2、前端查询站点下拉框中增加全部传为 ALL
+ if(!StringUtils.isBlank(deptId)){
+ deptIds.add(deptId);
+ } else {
+ //前端不传deptId的情况,后台自动从session中获取
+ String sessionDeptId =request.getHeader("dept-id");
+ if(StringUtils.isBlank(sessionDeptId)) {
+ sessionDeptId = AuthUtil.getDeptId();
+ }
+ deptIds.add(sessionDeptId);
+ }
+ logger.debug("queryImagePointRelateInfo sessionDeptId is " + deptId);
+
+ IPage imagePoints = imagePointService.pageQueryImagePonit(deptIds, stcd, stnm, Condition.getPage(query));
+
+ return R.data(imagePoints);
+
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+ }
+
+
+ /**
+ *
+ * Title: pageQueryImagePointOrderBy
+ * Description:分根据排序要求页查询所有测站设备信息
+ * @param request
+ * @param deptId 机构id
+ * @param stcd 测站设备编码
+ * @param stnm 测站设备名称
+ * @param query 分页参数
+ * @param orderByField 排序参数
+ * @return
+ */
+
+ @RequestMapping(value="/pageQueryImagePointOrderBy", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="根据排序要求分页查询所有测站", value = "根据排序要求分页查询所有测站")
+ public R pageQueryImagePointOrderBy(HttpServletRequest request,
+ @ApiParam(value = "机构id,精确匹配") @RequestParam(required=false, value = "deptId")String deptId,
+ @ApiParam(value = "测站设备编码,精确匹配") @RequestParam(required=false, value = "stcd") String stcd,
+ @ApiParam(value = "测站设备名称,模糊匹配") @RequestParam(required=false, value = "stnm")String stnm,
+ Query query,
+ @ApiParam(value = "排序参数,只能传入stationName, stcd, stnm, pno 几个字段与 ASC升序 DESC降序 的排列组合,如果字段中有中文,需要将其转为gbk编码排序" +
+ "例如按照设备编码升序排序,stcd ASC, 按照设备名称降序排序,CONVERT(stnm USING gbk) DESC")
+ @RequestParam(required=false, value = "orderByField")String orderByField){
+ try {
+
+ // TODO: deptId 参数要改为列表,如果前端传入为空,则后台默认从session中获取userId,然后调用接口获取账号下的deptIds
+ List queryDeptIds = new ArrayList<>();
+ logger.debug("queryImagePointRelateInfo deptId is " + deptId);
+ // 根据和前端约定,修改参数:
+ //1、第一次加载前端传当前站点ID
+ //2、前端查询站点下拉框中增加全部传为 ALL
+ if(!StringUtils.isBlank(deptId)){
+ queryDeptIds.add(deptId);
+ } else {
+ //前端不传deptId的情况,后台自动从session中获取
+ String sessionDeptId =request.getHeader("dept-id");
+ if(StringUtils.isBlank(sessionDeptId)) {
+ sessionDeptId = AuthUtil.getDeptId();
+ }
+ logger.debug("queryImagePointRelateInfo sessionDeptId is " + sessionDeptId);
+ queryDeptIds.add(sessionDeptId);
+ }
+
+ IPage imagePoints = imagePointService.pageQueryImagePonitOrderBy(queryDeptIds, stcd, stnm, Condition.getPage(query), orderByField);
+ return R.data(imagePoints);
+
+ } catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+
+ }
+
+
+
+ @RequestMapping(value="/getNewestImageForStation", method = {RequestMethod.POST, RequestMethod.GET})
+ @ApiOperation(notes ="获取站点下所有设备中最新采集的图片", value = "获取站点下所有设备中最新采集的图片")
+ public R getNewestImageForStation(HttpServletRequest request,
+ @ApiParam(value = "机构id,精确匹配") @RequestParam(required=false, value = "deptId")String deptId){
+
+ try {
+ List queryDeptIds = new ArrayList<>();
+
+ logger.debug("getNewestImageForStation deptId is " + deptId);
+ // 根据和前端约定,修改参数:
+ //1、第一次加载前端传当前站点ID
+ //2、前端查询站点下拉框中增加全部传为 ALL
+ if(!StringUtils.isBlank(deptId)){
+ queryDeptIds.add(deptId);
+ } else {
+ //前端不传deptId的情况,后台自动从session中获取
+ String sessionDeptId =request.getHeader("dept-id");
+ if(StringUtils.isBlank(sessionDeptId)) {
+ sessionDeptId = AuthUtil.getDeptId();
+ }
+ logger.debug("getNewestImageForStation sessionDeptId is " + sessionDeptId);
+ queryDeptIds.add(sessionDeptId);
+ }
+
+ LambdaQueryWrapper exp=new LambdaQueryWrapper();
+ exp.in(ImagePoint::getCreateDept,queryDeptIds);
+ List imagePoints = imagePointService.selectByExample(exp);
+ List stcds = new ArrayList<>();
+ for(ImagePoint imagePoint: imagePoints){
+ String stcd = imagePoint.getStcd();
+ stcds.add(stcd);
+ }
+
+ String[] stcdStrs = stcds.toArray(new String[stcds.size()]);
+ int len = (null==stcdStrs)?0:stcdStrs.length;
+ logger.debug("getNewestImageForStation stcdStrs length="+ len);
+ //如果没有查到任何设备就不要查询,因为查询接口会查所有设备,然后根据stcds过滤,没有则不过滤
+ ImageInfo newestImageInfoForAllDevice = null;
+ if (len>0){
+ List imageInfos = imageInfoService.selectNewestImageByDevId(stcdStrs);
+ if (null!=imageInfos && imageInfos.size()>0){
+ int index = 0;
+ for(ImageInfo imageInfo: imageInfos){
+ //将每次获取的第一个都赋值给最新图片变量,随后遍历比较时间如果有时间新的,则替换最新图片
+ if (index == 0){
+ newestImageInfoForAllDevice = imageInfo;
+ }
+ Date time = imageInfo.getTime();
+ Date newestImageTime = newestImageInfoForAllDevice.getTime();
+ if (time.after(newestImageTime)){
+ newestImageInfoForAllDevice = imageInfo;
+ }
+ index++;
+ }
+ }else {
+ logger.debug("getNewestImageForStation 没有查询到图片");
+ }
+ }
+
+ return R.data(newestImageInfoForAllDevice);
+
+ }catch (Exception e) {
+ return R.fail(500,"操作失败");
+ }
+
+ }
+
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/MonitorPoint.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/MonitorPoint.java
new file mode 100644
index 0000000..5b9150d
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/MonitorPoint.java
@@ -0,0 +1,64 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.entity;
+
+public class MonitorPoint {
+ private Long id;
+ private String name;
+ private Long parentId;
+ private String deptId;
+ private String remark;
+
+ public MonitorPoint() {
+ }
+
+ public MonitorPoint(Long id, String name, Long parentId, String remark) {
+ this.id = id;
+ this.name = name;
+ this.parentId = parentId;
+ this.remark = remark;
+ }
+
+ public Long getId() {
+ return this.id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Long getParentId() {
+ return this.parentId;
+ }
+
+ public void setParentId(Long parentId) {
+ this.parentId = parentId;
+ }
+
+ public String getDeptId() {
+ return deptId;
+ }
+
+ public void setDeptId(String deptId) {
+ this.deptId = deptId;
+ }
+
+ public String getRemark() {
+ return this.remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/PointLeafNode.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/PointLeafNode.java
new file mode 100644
index 0000000..a8ae957
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/PointLeafNode.java
@@ -0,0 +1,44 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.entity;
+
+
+import com.hnac.hzims.videoimage.enums.VideoType;
+import com.hnac.hzims.videoimage.utils.TreeNode;
+
+public class PointLeafNode extends TreeNode {
+ private Long pointId;
+ private VideoType type;
+
+ public PointLeafNode() {
+ }
+
+ @Override
+ public boolean isLeaf() {
+ return true;
+ }
+
+ public Long getPointId() {
+ return this.pointId;
+ }
+
+ public void setPointId(Long pointId) {
+ this.pointId = pointId;
+ }
+
+ public VideoType getType() {
+ return this.type;
+ }
+
+ public void setType(VideoType type) {
+ this.type = type;
+ }
+
+ @Override
+ public String toString() {
+ return "PointLeafNode [isLeaf()=" + this.isLeaf() + ", getPointId()=" + this.getPointId() + ", getType()=" + this.getType() + ", getId()=" + this.getId() + ", getName()=" + this.getName() + "]";
+ }
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/PointTreeNode.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/PointTreeNode.java
new file mode 100644
index 0000000..6937fe0
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/PointTreeNode.java
@@ -0,0 +1,73 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.entity;
+
+
+import com.hnac.hzims.videoimage.enums.VideoType;
+import com.hnac.hzims.videoimage.utils.Childable;
+import com.hnac.hzims.videoimage.utils.Markable;
+import com.hnac.hzims.videoimage.utils.TreeNode;
+
+import java.util.*;
+
+public class PointTreeNode extends TreeNode implements Childable, Markable {
+ private List children;
+ private List leaves;
+
+ public PointTreeNode(List children) {
+ this.children = children;
+ }
+
+ public PointTreeNode() {
+ }
+
+ public Map> map() {
+ assert Objects.nonNull(this.children);
+
+ Map> map = new EnumMap(VideoType.class);
+ Iterator var2 = this.children.iterator();
+
+ while(var2.hasNext()) {
+ PointTreeNode node = (PointTreeNode)var2.next();
+ if (Objects.nonNull(node.getLeaves()) && !node.getLeaves().isEmpty()) {
+ node.getLeaves().stream().filter(Objects::nonNull).forEach((leaf) -> {
+ VideoType type = leaf.getType();
+ map.putIfAbsent(type, new ArrayList());
+ ((List)map.get(type)).add(leaf.getId());
+ });
+ }
+ }
+
+ return map;
+ }
+
+ @Override
+ public boolean isLeaf() {
+ return false;
+ }
+
+ @Override
+ public Long getUniqueMark() {
+ return super.getId();
+ }
+
+ @Override
+ public List getChildren() {
+ return this.children;
+ }
+
+ public void setChildren(List children) {
+ this.children = children;
+ }
+
+ public List getLeaves() {
+ return this.leaves;
+ }
+
+ public void setLeaves(List leaves) {
+ this.leaves = leaves;
+ }
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/SysStationHikSecret.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/SysStationHikSecret.java
new file mode 100644
index 0000000..02f2dea
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/SysStationHikSecret.java
@@ -0,0 +1,48 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.entity;
+
+public class SysStationHikSecret {
+ private Integer id;
+ private String host;
+ private String appkey;
+ private String appsecret;
+
+ public SysStationHikSecret() {
+ }
+
+ public Integer getId() {
+ return this.id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getHost() {
+ return this.host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ public String getAppkey() {
+ return this.appkey;
+ }
+
+ public void setAppkey(String appkey) {
+ this.appkey = appkey;
+ }
+
+ public String getAppsecret() {
+ return this.appsecret;
+ }
+
+ public void setAppsecret(String appsecret) {
+ this.appsecret = appsecret;
+ }
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/SysStationHikVideo.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/SysStationHikVideo.java
new file mode 100644
index 0000000..856670a
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/SysStationHikVideo.java
@@ -0,0 +1,114 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.hnac.hzims.videoimage.enums.VideoType;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@TableName("sys_station_hikvideo")
+public class SysStationHikVideo extends Video {
+ private String addressType;
+ private String livesourceaddress;
+ private String address;
+ private String pointCode;
+ @DateTimeFormat(
+ pattern = "yyyy-MM-dd hh:mm:ss"
+ )
+ @JsonFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss",
+ timezone = "GMT+8"
+ )
+ private Date lastRequesttime;
+ private Byte isControl;
+ private Byte isHikvideo;
+ private BigDecimal nlgtd;
+ private BigDecimal nlttd;
+
+ public SysStationHikVideo() {
+ }
+
+ public BigDecimal getNlgtd() {
+ return nlgtd;
+ }
+
+ public void setNlgtd(BigDecimal nlgtd) {
+ this.nlgtd = nlgtd;
+ }
+
+ public BigDecimal getNlttd() {
+ return nlttd;
+ }
+
+ public void setNlttd(BigDecimal nlttd) {
+ this.nlttd = nlttd;
+ }
+
+ public String getAddressType() {
+ return this.addressType;
+ }
+
+ public void setAddressType(String addressType) {
+ this.addressType = addressType;
+ }
+
+ public String getLivesourceaddress() {
+ return this.livesourceaddress;
+ }
+
+ public void setLivesourceaddress(String livesourceaddress) {
+ this.livesourceaddress = livesourceaddress;
+ }
+
+ public String getAddress() {
+ return this.address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getPointCode() {
+ return this.pointCode;
+ }
+
+ public void setPointCode(String pointCode) {
+ this.pointCode = pointCode;
+ }
+
+ public Date getLastRequesttime() {
+ return this.lastRequesttime;
+ }
+
+ public void setLastRequesttime(Date lastRequesttime) {
+ this.lastRequesttime = lastRequesttime;
+ }
+
+ public Byte getIsControl() {
+ return this.isControl;
+ }
+
+ public void setIsControl(Byte isControl) {
+ this.isControl = isControl;
+ }
+
+ public Byte getIsHikvideo() {
+ return isHikvideo;
+ }
+
+ public void setIsHikvideo(Byte isHikvideo) {
+ this.isHikvideo = isHikvideo;
+ }
+
+ @Override
+ public VideoType getVideoType() {
+ return VideoType.HIK_VIDEO;
+ }
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/SysStationVideoSet.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/SysStationVideoSet.java
new file mode 100644
index 0000000..030910c
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/SysStationVideoSet.java
@@ -0,0 +1,57 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.entity;
+
+public class SysStationVideoSet {
+ private Integer id;
+ private String tenantId;
+ private Integer videoId;
+ private String videoValue;
+ private Integer isrId;
+
+ public SysStationVideoSet() {
+ }
+
+ public Integer getId() {
+ return this.id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public Integer getVideoId() {
+ return this.videoId;
+ }
+
+ public void setVideoId(Integer videoId) {
+ this.videoId = videoId;
+ }
+
+ public String getVideoValue() {
+ return this.videoValue;
+ }
+
+ public void setVideoValue(String videoValue) {
+ this.videoValue = videoValue;
+ }
+
+ public Integer getIsrId() {
+ return this.isrId;
+ }
+
+ public void setIsrId(Integer isrId) {
+ this.isrId = isrId;
+ }
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/Video.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/Video.java
new file mode 100644
index 0000000..dbe4399
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/entity/Video.java
@@ -0,0 +1,49 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.entity;
+
+import com.hnac.hzims.videoimage.enums.VideoType;
+import org.springblade.core.mp.base.BaseEntity;
+
+public abstract class Video extends BaseEntity {
+ private String name;
+ private Long pointId;
+ private Integer inUse;
+
+ public Video() {
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Long getPointId() {
+ return this.pointId;
+ }
+
+ public void setPointId(Long pointId) {
+ this.pointId = pointId;
+ }
+
+ public Integer getInUse() {
+ return this.inUse;
+ }
+
+ public void setInUse(Integer inUse) {
+ this.inUse = inUse;
+ }
+
+ public abstract VideoType getVideoType();
+
+ @Override
+ public String toString() {
+ return "Video [getId()=" + this.getId() + ", getName()=" + this.getName() + ", getPointId()=" + this.getPointId() + ", getInUse()=" + this.getInUse() + ", getVideoType()=" + this.getVideoType() + "]";
+ }
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/enums/CommandEnum.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/enums/CommandEnum.java
new file mode 100644
index 0000000..a7edb5c
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/enums/CommandEnum.java
@@ -0,0 +1,46 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.enums;
+
+public enum CommandEnum {
+ LEFT("LEFT", "左转"),
+ RIGHT("RIGHT", "右转"),
+ UP("UP", "上转"),
+ DOWN("DOWN", "下转"),
+ ZOOM_IN("ZOOM_IN", "焦距变大"),
+ ZOOM_OUT("ZOOM_OUT", "焦距变小"),
+ LEFT_UP("RIGHT", "左上"),
+ LEFT_DOWN("LEFT_DOWN", "左下"),
+ RIGHT_UP("RIGHT_UP ", "右上"),
+ RIGHT_DOWN("RIGHT_DOWN", "右下"),
+ FOCUS_FAR("FOCUS_FAR", "焦点后移"),
+ IRIS_ENLARGE("IRIS_ENLARGE", "光圈扩大"),
+ IRIS_REDUCE("IRIS_REDUCE ", "光圈缩小");
+
+ private String code;
+ private String desc;
+
+ private CommandEnum(String code, String desc) {
+ this.code = code;
+ this.desc = desc;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public String getDesc() {
+ return this.desc;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/enums/VideoEnum.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/enums/VideoEnum.java
new file mode 100644
index 0000000..f56033f
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/enums/VideoEnum.java
@@ -0,0 +1,35 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.enums;
+
+public enum VideoEnum {
+ ISC("isc", "ISC平台视频"),
+ EZVIZ("ezviz", "萤石云");
+
+ private String code;
+ private String desc;
+
+ private VideoEnum(String code, String desc) {
+ this.code = code;
+ this.desc = desc;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public String getDesc() {
+ return this.desc;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/enums/VideoType.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/enums/VideoType.java
new file mode 100644
index 0000000..8121431
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/enums/VideoType.java
@@ -0,0 +1,51 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.enums;
+
+
+import com.hnac.hzims.videoimage.service.IHikVideoService;
+import com.hnac.hzims.videoimage.service.VideoBaseService;
+
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum VideoType {
+// DIRECT_LINK("direct", "链接", IDirectLinkVideoService.class),
+// CLOUD("cloud", "萤石云", ICloudVideoService.class),
+ HIK_VIDEO("hikvideo", "萤石云", IHikVideoService.class);
+
+ private final String code;
+ private final String description;
+ private final Class extends VideoBaseService> serviceClass;
+ private static final Map DICT = (Map)Stream.of(values()).collect(Collectors.toMap(Object::toString, (type) -> {
+ return type;
+ }));
+
+ public static Optional fromString(String code) {
+ return Optional.ofNullable(DICT.get(code));
+ }
+
+ private VideoType(String code, String description, Class extends VideoBaseService> serviceClass) {
+ this.code = code;
+ this.description = description;
+ this.serviceClass = serviceClass;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public Class extends VideoBaseService> getServiceClass() {
+ return this.serviceClass;
+ }
+
+ @Override
+ public String toString() {
+ return this.code;
+ }
+}
diff --git a/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/manager/HikVideoManager.java b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/manager/HikVideoManager.java
new file mode 100644
index 0000000..844377a
--- /dev/null
+++ b/hzims-service/video-image/src/main/java/com/hnac/hzims/videoimage/manager/HikVideoManager.java
@@ -0,0 +1,106 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.hnac.hzims.videoimage.manager;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.hnac.hzims.videoimage.entity.SysStationHikVideo;
+import com.hnac.hzims.videoimage.entity.Video;
+import com.hnac.hzims.videoimage.enums.VideoType;
+import com.hnac.hzims.videoimage.search.VideoSearchCondition;
+import com.hnac.hzims.videoimage.service.IHikVideoService;
+import com.hnac.hzims.videoimage.utils.PointTreeCache;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class HikVideoManager {
+ @Autowired
+ IHikVideoService hikVideoService;
+ @Autowired
+ MonitorPointManager pointManager;
+
+ public HikVideoManager() {
+ }
+
+ public boolean deleteById(String deptId, long id) {
+ if (hikVideoService.deleteById(id)) {
+ PointTreeCache.clearCache(deptId);
+ }
+
+ return true;
+ }
+
+ public SysStationHikVideo insert(String deptId, SysStationHikVideo sysStationHikvideo) {
+ if (sysStationHikvideo.getCreateDept() == null) {
+ sysStationHikvideo.setCreateDept(Long.valueOf(deptId));
+ }
+
+ sysStationHikvideo.setCreateTime(new Date());
+ sysStationHikvideo.setCreateUser(AuthUtil.getUserId());
+ sysStationHikvideo.setUpdateUser(AuthUtil.getUserId());
+ sysStationHikvideo.setUpdateTime(new Date());
+
+ hikVideoService.insert(sysStationHikvideo);
+ PointTreeCache.clearCache(deptId);
+ return sysStationHikvideo;
+ }
+
+ public SysStationHikVideo update(String deptId, SysStationHikVideo sysStationHikvideo) {
+ if (sysStationHikvideo.getCreateDept() == null) {
+ sysStationHikvideo.setCreateDept(Long.valueOf(deptId));
+ }
+ sysStationHikvideo.setUpdateUser(AuthUtil.getUserId());
+ sysStationHikvideo.setUpdateTime(new Date());
+ hikVideoService.update(sysStationHikvideo);
+ PointTreeCache.clearCache(deptId);
+ return sysStationHikvideo;
+ }
+
+ public IPage