From a9b5f6f22dff958a650261eccfe3a4d782695ad2 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Tue, 28 Jun 2022 19:12:52 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=9F=BA=E7=A1=80=E8=AE=BE=E6=96=BD=E6=91=84?= =?UTF-8?q?=E5=83=8F=E5=A4=B4=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=202.=E7=94=B3=E8=B4=AD=E8=BD=A6=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E6=B5=81=E7=A8=8BID=E6=9F=A5=E8=AF=A2=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E7=9A=84=E6=91=84=E5=83=8F=E5=A4=B4=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitor/controller/Controller.java | 20 +++- .../monitor/mapper/CameraChannelMapper.java | 7 +- .../dto/TAbilityApplicationDTO.java | 3 + .../dto/TAbilityBatchApplicationDTO.java | 4 +- .../entity/TAbilityApplicationEntity.java | 13 ++- .../controller/ResourceController.java | 7 ++ .../resource/service/ResourceService.java | 2 + .../service/impl/ResourceServiceImpl.java | 15 +++ .../db/V2.6__ability_application_add_col.sql | 1 + .../mapper/monitor/CameraChannelMapper.xml | 97 ++++++++++++++++--- 10 files changed, 144 insertions(+), 25 deletions(-) create mode 100644 renren-admin/src/main/resources/db/V2.6__ability_application_add_col.sql diff --git a/renren-admin/src/main/java/io/renren/modules/monitor/controller/Controller.java b/renren-admin/src/main/java/io/renren/modules/monitor/controller/Controller.java index 81de3c72..2537d7cb 100644 --- a/renren-admin/src/main/java/io/renren/modules/monitor/controller/Controller.java +++ b/renren-admin/src/main/java/io/renren/modules/monitor/controller/Controller.java @@ -173,21 +173,31 @@ public class Controller { /** * 根据parentId和checkStatus查询摄像头 - * @param parentId + * @param * @return */ @GetMapping("selectByParentId") @ApiOperation("根据摄像头的组织Id和异常状态查询摄像头") @ApiImplicitParams({ @ApiImplicitParam(name = "parentId",value = "摄像头的组织Id",required = true,dataType = "String"), - @ApiImplicitParam(name = "checkStatus",value = "异常状态 1正常,0异常",required = true,dataType = "String") + @ApiImplicitParam(name = "checkStatus",value = "异常状态 1正常,0异常",required = true,dataType = "String"), + @ApiImplicitParam(name = "cameraName",value = "摄像头名称",dataType = "String"), + @ApiImplicitParam(name = "gpsX",value = "经度坐标",dataType = "Double"), + @ApiImplicitParam(name = "gpsY",value = "纬度坐标",dataType = "Double"), + @ApiImplicitParam(name = "pageNum",value = "页码",dataType = "Integer"), + @ApiImplicitParam(name = "pageSize",value = "页数大小",dataType = "Integer"), + @ApiImplicitParam(name = "radius",value = "半径",dataType = "Integer") }) - public Result selectByParentId(String parentId,String checkStatus){ + public Result selectByParentId(@RequestParam Map queryMap){ + if (!queryMap.containsKey("pageNum")) { + queryMap.put("pageNum", null); + queryMap.put("pageSize", null); + } - List list = cameraChannelMapper.selectByParentId(parentId,checkStatus); + List list = cameraChannelMapper.selectByParentId(queryMap); Result success = Result.success(list); - + success.setCount(cameraChannelMapper.selectByParentIdCount(queryMap)); return success; } diff --git a/renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraChannelMapper.java b/renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraChannelMapper.java index 0fe00a13..8db1e9fa 100644 --- a/renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraChannelMapper.java +++ b/renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraChannelMapper.java @@ -1,6 +1,5 @@ package io.renren.modules.monitor.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import io.renren.common.dao.BaseDao; import io.renren.modules.monitor.dto.CameraChannelDto; import io.renren.modules.monitor.dto.CameraChannelDto1; @@ -13,6 +12,7 @@ import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; +import java.util.Map; @Mapper public interface CameraChannelMapper extends BaseDao { @@ -24,9 +24,7 @@ public interface CameraChannelMapper extends BaseDao { @Select("select cc.*,cp.pic_url from t_camera_channel cc LEFT JOIN t_channel_picture cp ON cc.channel_code=cp.channel_code where cc.channel_code = #{channelCode}") List selectByChannelCode(@Param("channelCode") String channelCode); - @Select("select * from t_camera_channel where parent_id = #{parentId} and check_status in (${checkStatus}) ") - List selectByParentId(@Param("parentId") String parentId, - @Param("checkStatus") String checkStatus); + List selectByParentId(@Param("map") Map queryMap); @Select("select c.* from t_camera_channel c where channel_code in " + "(select b.channel_code from t_channel_mtm_label b where b.label_code = #{labelCode}) ") @@ -62,4 +60,5 @@ public interface CameraChannelMapper extends BaseDao { List selectByLabel(@Param("page") Integer page,@Param("pageSize") Integer pageSize); + Integer selectByParentIdCount(@Param("map") Map queryMap); } diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java index 586a25bf..c800ef61 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java @@ -52,4 +52,7 @@ public class TAbilityApplicationDTO extends AuditingBaseDTO implements Serializa @ApiModelProperty(value = "附件") private String enclosure; + @ApiModelProperty(value = "摄像头ID数组") + private String cameraList; + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java index 60fc1bb6..d9552a46 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java @@ -9,7 +9,6 @@ import java.io.Serializable; import java.util.List; import java.util.Map; - @Data @ApiModel(value = "批量能力申请表单") public class TAbilityBatchApplicationDTO extends AuditingBaseDTO implements Serializable { @@ -48,4 +47,7 @@ public class TAbilityBatchApplicationDTO extends AuditingBaseDTO implements Seri @ApiModelProperty(value = "附件") private String enclosure; + + @ApiModelProperty(value = "摄像头ID数组") + private String cameraList; } diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java b/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java index d43307cd..b4e3c7e6 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java @@ -1,8 +1,12 @@ package io.renren.modules.processForm.entity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; -import com.baomidou.mybatisplus.annotation.*; + +import java.io.Serializable; /** * 能力申请表单 @@ -13,7 +17,7 @@ import com.baomidou.mybatisplus.annotation.*; @Data @EqualsAndHashCode(callSuper = false) @TableName("t_ability_application") -public class TAbilityApplicationEntity { +public class TAbilityApplicationEntity implements Serializable { private static final long serialVersionUID = 1L; @TableId @@ -87,4 +91,9 @@ public class TAbilityApplicationEntity { * 流程通过后api网关注册的认证code,用于三方接口调用 */ private String gatewayCode; + + /** + * 摄像头ID数组 + */ + private String cameraList; } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 7b4dff3f..c1899796 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -450,4 +450,11 @@ public class ResourceController { } return null; } + + @GetMapping("/getApplyCameraList") + @ApiOperation("根据流程实例ID获取申请摄像头列表") + @LogOperation("根据流程实例ID获取申请摄像头列表") + public Result getApplyCameraList(@RequestParam Long instanceId) { + return new Result().ok(resourceService.getApplyCameraList(instanceId)); + } } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java index b75ad212..34b620e7 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java @@ -107,4 +107,6 @@ public interface ResourceService extends CrudService selectDTOPageSpecilTotal(ResourceDTO resourceDTO); + Object getApplyCameraList(Long instanceId); + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index a666aae2..9c3bb2ff 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -14,6 +14,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.renren.common.constant.Constant; import io.renren.common.domain.Tsingtao_xhaProperties; import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.processForm.dao.TAbilityApplicationDao; +import io.renren.modules.processForm.dto.TAbilityApplicationDTO; +import io.renren.modules.processForm.entity.TAbilityApplicationEntity; import io.renren.modules.resource.dao.AttrDao; import io.renren.modules.resource.dao.ResourceDao; import io.renren.modules.resource.dataResource.domain.TsingtaoDataResourceService; @@ -123,6 +126,9 @@ public class ResourceServiceImpl extends CrudServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("instance_id", instanceId); + TAbilityApplicationEntity applicationEntity = tAbilityApplicationDao.selectOne(queryWrapper); + String cameraListString = applicationEntity.getCameraList(); + return JSONArray.parseObject(cameraListString, List.class); + } + @Override public Object selectResourceListByType(String type) { return resourceDao.selectByType(type); diff --git a/renren-admin/src/main/resources/db/V2.6__ability_application_add_col.sql b/renren-admin/src/main/resources/db/V2.6__ability_application_add_col.sql new file mode 100644 index 00000000..5ff95ae4 --- /dev/null +++ b/renren-admin/src/main/resources/db/V2.6__ability_application_add_col.sql @@ -0,0 +1 @@ +ALTER TABLE t_ability_application ADD COLUMN `cameraList` json NULL COMMENT '摄像头ID数组'; \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/monitor/CameraChannelMapper.xml b/renren-admin/src/main/resources/mapper/monitor/CameraChannelMapper.xml index 812f872d..9feea701 100644 --- a/renren-admin/src/main/resources/mapper/monitor/CameraChannelMapper.xml +++ b/renren-admin/src/main/resources/mapper/monitor/CameraChannelMapper.xml @@ -1,20 +1,11 @@ - - - - - - - @@ -25,11 +16,91 @@ + + + + \ No newline at end of file