wushunjie
杜函宇 11 months ago
parent 6d38844948
commit 5a464028f2

@ -16,7 +16,11 @@
</description>
<dependencies>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.25</version>
</dependency>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>

@ -12,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@ -25,7 +26,7 @@ import java.util.List;
@RestController
@RequestMapping("algorithms/alarm")
public class AlarmController extends BaseController {
@Autowired
@Resource
private IAlarmService alarmService;
/**

@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
@ -30,7 +31,7 @@ import java.util.List;
@RestController
@RequestMapping("algorithms/event")
public class EventController extends BaseController {
@Autowired
@Resource
private IEventService eventService;
/**

@ -0,0 +1,68 @@
package com.ruoyi.page.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.yingji.entity.Fire;
import com.yingji.entity.dto.request.FireFindRequest;
import com.yingji.service.FireService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.Serializable;
/**
* 119(Fire)
*
* @author wu
* @since 2024-06-05 09:24:14
*/
@RestController
@RequestMapping("algorithms/fire")
@Api(tags = "119数据")
@Transactional(rollbackFor = Exception.class)
public class FireController extends BaseController {
/**
*
*/
@Resource
private FireService fireService;
/**
*
*
* @param page
* @param fire
* @return
*/
@GetMapping
@ApiOperation(value = "分页条件查询119数据", response = Fire.class)
public AjaxResult page(Page<Fire> page, FireFindRequest fire) {
if (page.getSize() > 1000) {
page.setSize(1000);
}
return success(fireService.page(page, fire));
}
/**
*
*
* @param id
* @return
*/
@GetMapping("{id}")
@ApiOperation(value = "通过主键查询单条119数据", response = Fire.class)
public AjaxResult getById(@PathVariable Serializable id) {
return success(fireService.getById(id));
}
}

@ -0,0 +1,117 @@
package com.yingji.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 119(Fire)
*
* @author wu
* @since 2024-06-05 09:24:14
*/
@Data
@ApiModel("119数据实体类")
@TableName(value = "fire")
public class Fire implements Serializable {
private static final long serialVersionUID = -96682169109217319L;
/**
* id
*/
@ApiModelProperty(value = "主键id")
private String id;
/**
*
*/
@ApiModelProperty(value = "行政区划")
private String xzqh;
/**
*
*/
@ApiModelProperty(value = "案件编号")
private String ajbh;
/**
*
*/
@ApiModelProperty(value = "案件描述")
private String ajms;
/**
*
*/
@ApiModelProperty(value = "归队时间")
private Date gdsj;
private String jjyxm;
/**
*
*/
@ApiModelProperty(value = "时间戳")
private Date sjc;
/**
*
*/
@ApiModelProperty(value = "纬度")
private String wd;
/**
*
*/
@ApiModelProperty(value = "经度")
private String jd;
/**
*
*/
@ApiModelProperty(value = "备注信息")
private String bcxx;
/**
*
*/
@ApiModelProperty(value = "结束时间")
private Date jssj;
/**
*
*/
@ApiModelProperty(value = "案发地址")
private String afdz;
/**
*
*/
@ApiModelProperty(value = "出动时间")
private Date cdsj;
/**
*
*/
@ApiModelProperty(value = "立案方式代码")
private String lafsdm;
/**
* topic
*/
@ApiModelProperty(value = "topic")
private String topic;
private Date xdsj;
/**
*
*/
@ApiModelProperty(value = "立案时间")
private Date lasj;
/**
*
*/
@ApiModelProperty(value = "行政区划名称")
private String xzqhmc;
/**
*
*/
@ApiModelProperty(value = "到达现场时间")
private Date ddxcsj;
/**
*
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
}

@ -0,0 +1,57 @@
package com.yingji.entity.dto.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 119
*
* @author wu
* @since 2024/4/30 3:59
*/
@ApiModel(value = "119查询请求类")
@Data
public class FireFindRequest implements Serializable {
private static final long serialVersionUID = -3688091864596277161L;
/**
*
*/
@ApiModelProperty("开始时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;
/**
*
*/
@ApiModelProperty("结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
/**
*
*/
@ApiModelProperty(value = "案件编号")
private String ajbh;
/**
*
*/
@ApiModelProperty(value = "案件描述")
private String ajms;
/**
*
*/
@ApiModelProperty(value = "案发地址")
private String afdz;
}

@ -0,0 +1,15 @@
package com.ruoyi.page.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yingji.entity.Fire;
/**
* 119(Fire)访
*
* @author wu
* @since 2024-06-05 09:24:14
*/
public interface FireMapper extends BaseMapper<Fire> {
}

@ -0,0 +1,25 @@
package com.yingji.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yingji.entity.Fire;
import com.yingji.entity.dto.request.FireFindRequest;
/**
* 119(Fire)
*
* @author wu
* @since 2024-06-05 09:24:14
*/
public interface FireService extends IService<Fire> {
/**
*
*
* @param page
* @param fire
* @return
*/
Page<Fire> page(Page<Fire> page, FireFindRequest fire);
}

@ -9,6 +9,8 @@ import com.ruoyi.page.mapper.AlarmMapper;
import com.ruoyi.page.domain.Alarm;
import com.ruoyi.page.service.IAlarmService;
import javax.annotation.Resource;
/**
* Service
*
@ -18,7 +20,7 @@ import com.ruoyi.page.service.IAlarmService;
@Service
public class AlarmServiceImpl implements IAlarmService
{
@Autowired
@Resource
private AlarmMapper alarmMapper;
/**

@ -7,6 +7,7 @@ import com.ruoyi.page.service.IEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@ -19,7 +20,7 @@ import java.util.List;
@Service
public class EventServiceImpl implements IEventService
{
@Autowired
@Resource
private EventMapper eventMapper;
/**

@ -0,0 +1,40 @@
package com.ruoyi.page.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.page.mapper.FireMapper;
import com.yingji.entity.Fire;
import com.yingji.entity.dto.request.FireFindRequest;
import com.yingji.service.FireService;
import org.springframework.stereotype.Service;
/**
* 119(Fire)
*
* @author wu
* @since 2024-06-05 09:24:14
*/
@Service("fireService")
public class FireServiceImpl extends ServiceImpl<FireMapper, Fire> implements FireService {
/**
*
*
* @param page
* @param fire
* @return
*/
@Override
public Page<Fire> page(Page<Fire> page, FireFindRequest fire) {
QueryWrapper<Fire> wrapper = new QueryWrapper<>();
wrapper.like(StrUtil.isNotEmpty(fire.getAjbh()), "ajbh", fire.getAjbh())
.ge(fire.getStartTime() != null, "create_time", fire.getStartTime())
.le(fire.getEndTime() != null, "create_time", fire.getEndTime())
.like(StrUtil.isNotEmpty(fire.getAjms()), "ajms", fire.getAjms())
.like(StrUtil.isNotEmpty(fire.getAfdz()), "afdz", fire.getAfdz());
return this.page(page, wrapper);
}
}

@ -2,6 +2,9 @@ package com.ruoyi.web.core.config;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
@ -61,7 +64,7 @@ public class SwaggerConfig {
// 是否启用Swagger
.enable(enabled)
//分组名称
.groupName("江宁城管")
.groupName("1")
// 用来创建该API的基本信息展示在文档的页面中自定义展示的信息
.apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示
@ -73,9 +76,9 @@ public class SwaggerConfig {
// 扫描所有 .apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.pathMapping(pathMapping);
.pathMapping(pathMapping)
// 排除mybatis-plus的分页参数
//.ignoredParameterTypes(Page.class, IPage.class);
.ignoredParameterTypes(Page.class, IPage.class);
}
@ -86,9 +89,9 @@ public class SwaggerConfig {
// 用ApiInfoBuilder进行定制
return new ApiInfoBuilder()
// 设置标题
.title("江宁城管")
.title("1")
// 描述
.description("描述:用于江宁城管系统")
.description("描述:1")
// 作者信息
.contact(new Contact(ruoyiConfig.getName(), null, null))
// 版本

@ -8,7 +8,7 @@ spring:
master:
url: jdbc:mysql://localhost:3306/algorithms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
password: root
# 从库数据源
slave:
# 从数据源开关/默认关闭

@ -99,8 +99,8 @@ token:
# 令牌有效期默认30分钟
expireTime: 30
# MyBatis配置
mybatis:
# MyBatis Plus配置
mybatis-plus:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
@ -116,7 +116,7 @@ pagehelper:
# Swagger配置
knife4j:
enable: false
enable: true
# 防止XSS攻击

@ -16,7 +16,11 @@
</description>
<dependencies>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.1</version>
</dependency>
<!-- Spring框架基本的核心工具 -->
<dependency>
<groupId>org.springframework</groupId>

@ -0,0 +1,62 @@
package com.ruoyi.framework.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* Mybatis Plus
*
* @author ruoyi
*/
@EnableTransactionManagement(proxyTargetClass = true)
@Configuration
public class MybatisPlusConfig
{
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor()
{
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 分页插件
interceptor.addInnerInterceptor(paginationInnerInterceptor());
// 乐观锁插件
interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor());
// 阻断插件
interceptor.addInnerInterceptor(blockAttackInnerInterceptor());
return interceptor;
}
/**
* https://baomidou.com/guide/interceptor-pagination.html
*/
public PaginationInnerInterceptor paginationInnerInterceptor()
{
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
// 设置数据库类型为mysql
paginationInnerInterceptor.setDbType(DbType.MYSQL);
// 设置最大单页限制数量,默认 500 条,-1 不受限制
paginationInnerInterceptor.setMaxLimit(-1L);
return paginationInnerInterceptor;
}
/**
* https://baomidou.com/guide/interceptor-optimistic-locker.html
*/
public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor()
{
return new OptimisticLockerInnerInterceptor();
}
/**
* https://baomidou.com/guide/interceptor-block-attack.html
*/
public BlockAttackInnerInterceptor blockAttackInnerInterceptor()
{
return new BlockAttackInnerInterceptor();
}
}

@ -68,52 +68,53 @@
<include refid="selectEventVo"/>
where event_id = #{eventId}
</select>
<select id="selectEventList" resultType="com.ruoyi.system.domain.Event">
SELECT *
FROM event
<where>
<if test="event.eventType != '转院'">
AND event_type != '转院'
</if>
<if test="event.eventName !=null and event.eventName !=''">
AND event_name LIKE CONCAT('%', #{event.eventName}, '%')
</if>
<if test="event.eventType !=null and event.eventType !=''">
AND event_type = #{event.eventType}
</if>
<if test="event.eventLevel !=null and event.eventLevel !=''">
AND event_level = #{event.eventLevel}
</if>
<if test="event.startTime != null">
AND event_date_time &gt;= #{event.startTime}
</if>
<if test="event.endTime != null">
AND event_date_time &lt;= #{event.endTime}
</if>
<if test="event.eventArea !=null and event.eventArea !=''">
AND event_area LIKE CONCAT('%', #{event.eventArea}, '%')
</if>
<if test="event.eventAddress !=null and event.eventAddress !=''">
AND event_address LIKE CONCAT('%', #{event.eventAddress}, '%')
</if>
<if test="event.sendAmbCount != null">
AND send_amb_count = #{event.sendAmbCount}
</if>
<if test="event.eventDescribe !=null and event.eventDescribe !=''">
AND event_describe LIKE CONCAT('%', #{event.eventDescribe}, '%')
</if>
<if test="event.alarmUnit !=null and event.alarmUnit !=''">
AND alarm_unit LIKE CONCAT('%', #{event.alarmUnit}, '%')
</if>
<if test="event.alarmUnitContactor !=null and event.alarmUnitContactor !=''">
AND alarm_unit_contactor LIKE CONCAT('%', #{event.alarmUnitContactor}, '%')
</if>
<if test="event.alarmUnitTelephone != null and event.alarmUnitTelephone !=''">
AND alarm_unit_telephone LIKE CONCAT('%', #{event.alarmUnitTelephone}, '%')
</if>
</where>
<select id="selectEventList" resultType="com.ruoyi.page.domain.Event">
SELECT *
FROM event
<where>
<if test="event.eventType != '转院'">
AND event_type != '转院'
</if>
<if test="event.eventName !=null and event.eventName !=''">
AND event_name LIKE CONCAT('%', #{event.eventName}, '%')
</if>
<if test="event.eventType !=null and event.eventType !=''">
AND event_type = #{event.eventType}
</if>
<if test="event.eventLevel !=null and event.eventLevel !=''">
AND event_level = #{event.eventLevel}
</if>
<if test="event.startTime != null">
AND event_date_time &gt;= #{event.startTime}
</if>
<if test="event.endTime != null">
AND event_date_time &lt;= #{event.endTime}
</if>
<if test="event.eventArea !=null and event.eventArea !=''">
AND event_area LIKE CONCAT('%', #{event.eventArea}, '%')
</if>
<if test="event.eventAddress !=null and event.eventAddress !=''">
AND event_address LIKE CONCAT('%', #{event.eventAddress}, '%')
</if>
<if test="event.sendAmbCount != null">
AND send_amb_count = #{event.sendAmbCount}
</if>
<if test="event.eventDescribe !=null and event.eventDescribe !=''">
AND event_describe LIKE CONCAT('%', #{event.eventDescribe}, '%')
</if>
<if test="event.alarmUnit !=null and event.alarmUnit !=''">
AND alarm_unit LIKE CONCAT('%', #{event.alarmUnit}, '%')
</if>
<if test="event.alarmUnitContactor !=null and event.alarmUnitContactor !=''">
AND alarm_unit_contactor LIKE CONCAT('%', #{event.alarmUnitContactor}, '%')
</if>
<if test="event.alarmUnitTelephone != null and event.alarmUnitTelephone !=''">
AND alarm_unit_telephone LIKE CONCAT('%', #{event.alarmUnitTelephone}, '%')
</if>
</where>
</select>
<insert id="insertEvent" parameterType="Event">
insert into event
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -3,7 +3,7 @@ spring:
datasource:
url: jdbc:mysql://localhost:3306/algorithms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
password: root
driverClassName: com.mysql.cj.jdbc.Driver

Loading…
Cancel
Save