ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
@@ -11,6 +11,7 @@ import com.ycl.controller.BaseController; import com.ycl.dto.caseHandler.QueryForViolationParam; import com.ycl.dto.casePool.IllegalBuildingParam; import com.ycl.dto.casePool.VideoInspectParam; import com.ycl.dto.casePool.ViolationParam; import com.ycl.entity.caseHandler.BaseCase; import com.ycl.entity.caseHandler.BaseCaseDetail; @@ -279,12 +280,12 @@ public CommonResult queryCase(@RequestParam Integer pageSize, @RequestParam Integer current, @RequestParam(required = false) String number, @RequestParam(required = false) Integer streetId, @RequestParam(required = false) Integer communityId, @RequestParam(required = false) Integer categories, @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime, @RequestParam(required = false) String site) { return CommonResult.success(baseCaseService.selectPage(new Page<BaseCase>().setCurrent(current).setSize(pageSize), number, streetId, categories, startTime, endTime, site)); return CommonResult.success(baseCaseService.selectPage(new Page<BaseCase>().setCurrent(current).setSize(pageSize), number, communityId, categories, startTime, endTime, site)); } @GetMapping("/query_for_violation") @@ -314,8 +315,7 @@ @PutMapping("/video_inspection") @ApiOperation("预警研判确定") public CommonResult searchCount(ViolationParam violationParam){ public CommonResult searchCount(@RequestBody VideoInspectParam violationParam){ return CommonResult.success(baseCaseService.updateCase(violationParam)); } } ycl-platform/src/main/java/com/ycl/dto/casePool/VideoInspectParam.java
New file @@ -0,0 +1,48 @@ package com.ycl.dto.casePool; import com.ycl.dto.caseHandler.DispatchInfoParam; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @Data public class VideoInspectParam extends DispatchInfoParam { private Long baseId; @ApiModelProperty(value = "状态") private Integer state; /** * 大类 */ @ApiModelProperty(value = "大类") @NotNull(message = "不允许大类为空") private Integer categoryId; /** * 小类 */ @ApiModelProperty(value = "小类") @NotNull(message = "不允许小类为空") private Integer typeId; /** * 关联商铺名称 */ @ApiModelProperty(value = "关联商铺名称") private Integer shopName; /** * 问题描述 */ @ApiModelProperty(value = "问题描述") @NotBlank(message = "不允许问题描述为空") private String description; @ApiModelProperty(value = "是否关联商铺") private Integer linkShop; } ycl-platform/src/main/java/com/ycl/dto/casePool/ViolationParam.java
@@ -11,9 +11,8 @@ @Data @ApiModel(value = "添加违规案件") public class ViolationParam extends DispatchInfoParam { public class ViolationParam { private Long baseId; @ApiModelProperty(value = "状态") private Integer state; @@ -91,7 +90,7 @@ * 关联商铺名称 */ @ApiModelProperty(value = "关联商铺名称") private String shopName; private Integer shopName; /** * 车牌号 ycl-platform/src/main/java/com/ycl/entity/caseHandler/BaseCase.java
@@ -1,15 +1,13 @@ package com.ycl.entity.caseHandler; import cn.hutool.core.date.LocalDateTimeUtil; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.ycl.vo.casePool.ViolationsVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.*; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.time.LocalDateTime; @@ -198,7 +196,7 @@ */ @TableField(value = "violations",exist = false) @ApiModelProperty(value = "违规事件") private Violations violations; private ViolationsVO violationsVO; /** * 违建事件 @@ -213,7 +211,6 @@ @TableField(value = "dispatchInfo",exist = false) @ApiModelProperty(value = "调度信息") private DispatchInfo dispatchInfo; } ycl-platform/src/main/java/com/ycl/entity/caseHandler/Violations.java
@@ -73,7 +73,7 @@ */ @TableField("shop_name") @ApiModelProperty(value = "关联商铺名称") private String shopName; private Integer shopName; /** * 车牌号 ycl-platform/src/main/java/com/ycl/mapper/caseHandler/ViolationsMapper.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ycl.entity.caseHandler.Violations; import com.ycl.vo.casePool.ViolationsVO; import java.util.Map; @@ -15,6 +16,6 @@ */ public interface ViolationsMapper extends BaseMapper<Violations> { Violations selectCondMap(Map map); ViolationsVO selectCondMap(Map map); } ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ycl.dto.caseHandler.QueryForViolationParam; import com.ycl.dto.casePool.IllegalBuildingParam; import com.ycl.dto.casePool.VideoInspectParam; import com.ycl.dto.casePool.ViolationParam; import com.ycl.entity.caseHandler.BaseCase; import com.ycl.entity.caseHandler.BaseCaseDetail; @@ -68,7 +69,7 @@ Map<String, Object> selectCount(); Boolean updateCase(ViolationParam violationParam); Boolean updateCase(VideoInspectParam videoInspectParam); Integer dayCount(); ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -15,6 +15,7 @@ import com.ycl.dto.caseHandler.DispatchInfoParam; import com.ycl.dto.caseHandler.QueryForViolationParam; import com.ycl.dto.casePool.IllegalBuildingParam; import com.ycl.dto.casePool.VideoInspectParam; import com.ycl.dto.casePool.ViolationParam; import com.ycl.entity.caseHandler.*; import com.ycl.entity.dict.DataDictionary; @@ -31,7 +32,6 @@ import com.ycl.service.caseHandler.IViolationsService; import com.ycl.service.video.IVideoAlarmReportService; import com.ycl.vo.casePool.*; import com.ycl.vo.cockpit.enforcementEvents.EnforcementEventsVO; import com.ycl.vo.cockpit.enforcementEvents.EventVO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -250,8 +250,8 @@ if (baseCase.getCategory() == 1) { Map mapV = new HashMap(); mapV.put("id", baseCase.getId()); Violations violations = violationsMapper.selectCondMap(mapV); baseCase.setViolations(violations); ViolationsVO violationsVO = violationsMapper.selectCondMap(mapV); baseCase.setViolationsVO(violationsVO); } else { IllegalBuilding illegalBuilding = illegalBuildingMapper.selectById(baseCase.getId()); LambdaQueryWrapper<DataDictionary> dict = new LambdaQueryWrapper<>(); @@ -426,7 +426,7 @@ @Override @Transactional(rollbackFor = Exception.class) public Boolean updateCase(ViolationParam violationParam) { public Boolean updateCase(VideoInspectParam violationParam) { BaseCase baseCase = new BaseCase(); BeanUtils.copyProperties(violationParam, baseCase); baseCase.setId(violationParam.getBaseId()); @@ -434,7 +434,7 @@ baseCaseMapper.updateById(baseCase); Violations violations = new Violations(); BeanUtils.copyProperties(violationParam, violations); violations.setId(violations.getId()); violations.setId(violationParam.getBaseId()); if (violationParam.getState() == 6) { AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); violationParam.setCreateUser(user.getUserId()); ycl-platform/src/main/java/com/ycl/vo/casePool/ViolationsVO.java
New file @@ -0,0 +1,138 @@ package com.ycl.vo.casePool; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * <p> * 违规事件 * </p> * * @author wl * @since 2022-09-24 */ @Data public class ViolationsVO { private static final long serialVersionUID = 1L; /** * 案件id(同ums_base_case表id) */ @TableId("id") @ApiModelProperty(value = "案件id(同ums_base_case表id)") private Long id; /** * 大类 */ @TableField("category_id") @ApiModelProperty(value = "大类") private Integer categoryId; /** * 小类 */ @TableField("type_id") @ApiModelProperty(value = "小类") private Integer typeId; /** * 事件等级 */ @TableField("grade_id") @ApiModelProperty(value = "事件等级") private Integer gradeId; /** * 案由 */ @TableField("action_cause") @ApiModelProperty(value = "案由") private String actionCause; /** * 是否关联商铺 */ @TableField("link_shop") @ApiModelProperty(value = "是否关联商铺") private Integer linkShop; /** * 关联商铺名称 */ @TableField("shop_name") @ApiModelProperty(value = "关联商铺名称") private String shopName; /** * 车牌号 */ @TableField("car_number") @ApiModelProperty(value = "车牌号") private String carNumber; /** * 问题描述 */ @TableField("description") @ApiModelProperty(value = "问题描述") private String description; /** * 反映人 */ @TableField("informant") @ApiModelProperty(value = "反映人") private String informant; /** * 反映人联系方式 */ @TableField("informant_phone_code") @ApiModelProperty(value = "反映人联系方式") private String informantPhoneCode; /** * 身份证号码 */ @TableField("informant_id_card") @ApiModelProperty(value = "身份证号码") private String informantIdCard; /** * 视频报警id */ @TableField("video_alarm_report_id") @ApiModelProperty(value = "视频报警id") private Integer videoAlarmReportId; /** * 视频报警id */ @TableField("video_point_id") @ApiModelProperty(value = "视频点位") private Integer videoPointId; /** * 大类文本 */ @TableField(value = "category_text", exist = false) @ApiModelProperty(value = "所属社区文本") private String categoryText; /** * 小类文本 */ @TableField(value = "type_text", exist = false) @ApiModelProperty(value = "小类文本") private String typeText; /** * 事件等级文本 */ @TableField(value = "grade_text", exist = false) @ApiModelProperty(value = "事件等级文本") private String gradeText; } ycl-platform/src/main/java/com/ycl/vo/cockpit/enforcementEvents/EventVO.java
@@ -1,10 +1,21 @@ package com.ycl.vo.cockpit.enforcementEvents; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "事件") public class EventVO { @ApiModelProperty(value = "事件经度") private String longitude; @ApiModelProperty(value = "事件纬度") private String latitude; @ApiModelProperty(value = "事件类型") private String type; @ApiModelProperty(value = "告警设备") private String alarmAdvice; @ApiModelProperty(value = "事件描述") private String description; @ApiModelProperty(value = "事发地点") ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml
@@ -127,13 +127,13 @@ select t1.*, t3.region_name community_text from ums_base_case t1 left join ums_sccg_region t3 on t1.street_id=t3.id left join ums_sccg_region t3 on t1.community_id=t3.id <where> <if test="categories != null"> t1.category = #{categories} </if> <if test="streetId != null"> and t1.street_id = #{streetId} and t1.community_id = #{streetId} </if> <if test="code != null and code !=''"> and t1.code like concat('%',#{code},'%') @@ -263,20 +263,22 @@ </select> <select id="dispatchCount" resultType="java.lang.Integer"> select count(1) FROM ums_base_case t1 FROM ums_base_case t1 LEFT JOIN ums_dispose_record t2 ON t1.id = t2.base_case_id WHERE t2.workflow_config_step_id =1 WHERE t2.workflow_config_step_id = 1 </select> <select id="alCount" resultType="java.lang.Integer"> select count(1) FROM ums_base_case WHERE event_source=1; FROM ums_base_case WHERE event_source = 1; </select> <select id="selectEventList" resultType="com.ycl.vo.cockpit.enforcementEvents.EventVO"> SELECT t1.alarm_time, t1.longitude, t1.latitude, ( CASE WHEN t1.category = 1 THEN "违规" WHEN t1.category = 2 THEN "违建" ELSE "其他" END ) AS type, ( CASE WHEN t1.event_source = 1 THEN "视频巡查" WHEN t1.event_source = 2 THEN "人工上报" ELSE "其他" END ) AS alarmAdvice, ( CASE WHEN t1.event_source = 1 THEN "视频巡查" WHEN t1.event_source = 2 THEN "人工上报" ELSE "其他" END ) AS source, t1.site AS address, t2.description, @@ -288,10 +290,12 @@ LEFT JOIN ums_video_point t3 ON t3.id = t2.video_point_id LEFT JOIN ums_video_alarm_report t4 ON t4.id = t2.video_alarm_report_id <where> t1.category=1 <if test="beginTime !=''and beginTime!=null and endTime!=''and endTime!=null"> t1.create_time BETWEEN #{beginTime} and t1.create_time BETWEEN #{beginTime} AND #{endTime} </if> </where> </select> ycl-platform/src/main/resources/mapper/caseHandler/ViolationsMapper.xml
@@ -3,21 +3,21 @@ <mapper namespace="com.ycl.mapper.caseHandler.ViolationsMapper"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.ycl.entity.caseHandler.Violations"> <resultMap id="BaseResultMap" type="com.ycl.vo.casePool.ViolationsVO"> <id column="id" property="id" /> <result column="category_id" property="categoryId" /> <result column="type_id" property="typeId" /> <result column="grade_id" property="gradeId" /> <result column="action_cause" property="actionCause" /> <result column="link_shop" property="linkShop" /> <result column="shop_name" property="shopName" /> <result column="store_name" property="shopName" /> <result column="car_number" property="carNumber" /> <result column="description" property="description" /> <result column="informant" property="informant" /> <result column="informant_phone_code" property="informantPhoneCode" /> <result column="informant_id_card" property="informantIdCard" /> </resultMap> <resultMap type="com.ycl.entity.caseHandler.Violations" id="CondMapResultMap" extends="BaseResultMap"> <resultMap type="com.ycl.vo.casePool.ViolationsVO" id="CondMapResultMap" extends="BaseResultMap"> <result column="category_text" property="categoryText" /> <result column="type_text" property="typeText" /> <result column="grade_text" property="gradeText" /> @@ -29,6 +29,7 @@ <select id="selectCondMap" parameterType="map" resultMap="CondMapResultMap"> SELECT uv.*, t4.store_name , udd.name category_text, udd2.name type_text, udd3.name grade_text @@ -37,6 +38,7 @@ LEFT JOIN ums_data_dictionary udd on uv.category_id = udd.id LEFT JOIN ums_data_dictionary udd2 on uv.type_id = udd2.id LEFT JOIN ums_data_dictionary udd3 on uv.grade_id = udd3.id LEFT JOIN ums_store_store_info t4 on t4.id=uv.shop_name WHERE uv.`id` = #{id} </select>