Compare commits

...

2 Commits

Author SHA1 Message Date
吴顺杰 50d7f0a07f 添加utils模块;
2 months ago
吴顺杰 3a38a3eb9b 添加aiid分页查询条件;
2 months ago

@ -105,5 +105,11 @@ public class AlarmFindRequest implements Serializable {
* 1ai120Id 2ai120Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的")
private Integer selectIsNull;
private Integer select120;
/**
* 1ai119Id 2ai119Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的")
private Integer select119;
}

@ -117,6 +117,12 @@ public class EventPageRequest implements Serializable {
* 1ai110Id 2ai110Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai110Id不为空的 2查询ai110Id为空的")
private Integer selectIsNull;
private Integer select110;
/**
* 1ai119Id 2ai119Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai119Id不为空的 2查询ai119Id为空的")
private Integer select119;
}

@ -54,4 +54,16 @@ public class FireFindRequest implements Serializable {
*/
@ApiModelProperty(value = "案发地址")
private String afdz;
/**
* 1ai120Id 2ai120Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的")
private Integer select120;
/**
* 1ai110Id 2ai110Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai110Id不为空的 2查询ai110Id为空的")
private Integer select110;
}

@ -35,7 +35,26 @@ public class FireServiceImpl extends ServiceImpl<FireMapper, Fire> implements Fi
.like(StrUtil.isNotEmpty(fire.getAjms()), "ajms", fire.getAjms())
.like(StrUtil.isNotEmpty(fire.getAfdz()), "afdz", fire.getAfdz())
.orderByDesc("create_time");
addCondition(fire.getSelect110(), "ai_110_id", wrapper);
addCondition(fire.getSelect120(), "ai_120_id", wrapper);
return this.page(page, wrapper);
}
/**
* wrapper
*
* @param key
* @param selectKey
* @param wrapper wrapper
*/
private void addCondition(Integer key, String selectKey, QueryWrapper<Fire> wrapper) {
if (key != null) {
if (key == 1) {
wrapper.and(wq -> wq.isNotNull(selectKey).and(q -> q.ne(selectKey, "")));
} else if (key == 2) {
wrapper.and(wq -> wq.isNull(selectKey).or(q -> q.eq(selectKey, "")));
}
}
}
}

@ -48,7 +48,7 @@ spring:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
login-password: jichuang@123
filter:
stat:
enabled: true

@ -165,12 +165,20 @@
<if test="req.aiNumMax != null ">
and ai_num &lt;= #{req.aiNumMax}
</if>
<if test="req.selectIsNull == 1 ">
<if test="req.select120 == 1 ">
and ai_120_id is not null and ai_120_id != ''
</if>
<if test="req.selectIsNull == 2 ">
<if test="req.select120 == 2 ">
and ai_120_id is null or ai_120_id = ''
</if>
<if test="req.select119 == 1 ">
and ai_119_id is not null and ai_119_id != ''
</if>
<if test="req.select119 == 2 ">
and ai_119_id is null or ai_119_id = ''
</if>
</where>
order by update_time desc
</select>

@ -105,12 +105,19 @@
<if test="event.alarmUnitTelephone != null and event.alarmUnitTelephone !=''">
AND alarm_unit_telephone LIKE CONCAT('%', #{event.alarmUnitTelephone}, '%')
</if>
<if test="event.selectIsNull == 1 ">
<if test="event.select110 == 1 ">
and ai_110_id is not null and ai_110_id != ''
</if>
<if test="event.selectIsNull == 2 ">
<if test="event.select110 == 2 ">
and ai_110_id is null or ai_110_id = ''
</if>
<if test="event.select119 == 1 ">
and ai_119_id is not null and ai_119_id != ''
</if>
<if test="event.select119 == 2 ">
and ai_119_id is null or ai_119_id = ''
</if>
</where>
order by event_date_time desc
</select>

@ -17,6 +17,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.yingji</groupId>
<artifactId>utils</artifactId>
</dependency>
</dependencies>
<build>
<!--打包成jar包时的名字-->
<finalName>alarm</finalName>

@ -17,6 +17,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.yingji</groupId>
<artifactId>utils</artifactId>
</dependency>
</dependencies>
<build>
<!--打包成jar包时的名字-->
<finalName>fire</finalName>

@ -16,6 +16,15 @@
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.yingji</groupId>
<artifactId>utils</artifactId>
</dependency>
</dependencies>
<build>
<!--打包成jar包时的名字-->
<finalName>page</finalName>

@ -1,6 +1,7 @@
package com.yingji.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -28,13 +29,21 @@ public class FireServiceImpl extends ServiceImpl<FireMapper, Fire> implements Fi
*/
@Override
public Page<Fire> page(Page<Fire> page, FireFindRequest fire) {
log.error("==================119入参开始=====================");
log.error("==================119每页显示条数: " + page.getSize() + "页数: " + page.getCurrent() + "=====================");
log.error(JSONUtil.toJsonStr(fire));
log.error("==================119入参结束=====================");
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);
Page<Fire> firePage = this.page(page, wrapper);
log.error("==================119响应开始=====================");
log.error(JSONUtil.toJsonStr(firePage));
log.error("==================119响应结束=====================");
return firePage;
}
}

@ -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: jichuang@123
driverClassName: com.mysql.cj.jdbc.Driver

@ -13,6 +13,7 @@
<module>rescue</module>
<module>page</module>
<module>fire</module>
<module>utils</module>
</modules>
<properties>
<java.version>1.8</java.version>

@ -17,6 +17,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.yingji</groupId>
<artifactId>utils</artifactId>
</dependency>
</dependencies>
<build>
<!--打包成jar包时的名字-->
<finalName>rescue</finalName>

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yingji</groupId>
<artifactId>yingjiAlgorithms</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>utils</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

@ -0,0 +1,64 @@
package com.utils;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import java.util.HashMap;
import java.util.Map;
/**
*
*
* @author wu
* @since 2024/9/24 10:18
*/
public class SmsUtil {
/**
* token
*
* @return token
*/
public static String getSmsToken() {
Map<String, Object> bodyMap = new HashMap<>();
bodyMap.put("uid", "yjglj_yjjyszzh");
bodyMap.put("pwd", "f604d2d6de51573b5cef5c95c11ffabe");
String bodyJson = JSONUtil.toJsonStr(bodyMap);
String responseStr = HttpRequest.post("http://2.46.42.43:80/admin-api/sms/token")
.body(bodyJson)
.execute()
.body();
JSONObject responseJson = JSONUtil.parseObj(responseStr);
return (String) responseJson.get("data");
}
/**
*
*
* @param content
* @param tel 使,
* @return
*/
public static Object sendSms(String content, String tel) {
String token = getSmsToken();
Map<String, Object> bodyMap = new HashMap<>();
bodyMap.put("uid", "yjglj_yjjyszzh");
bodyMap.put("pwd", "f604d2d6de51573b5cef5c95c11ffabe");
bodyMap.put("extensionNo", "2559");
if (StrUtil.isNotEmpty(tel)) {
bodyMap.put("tel", tel);
} else {
bodyMap.put("tel", "18870257135,18261462112,15850922852,18112760590");
}
bodyMap.put("content", "市应急局提醒: " + content);
String bodyJson = JSONUtil.toJsonStr(bodyMap);
String responseStr = HttpRequest.post("http://2.46.42.43:80/admin-api/sms/send")
.header("Authorization", token)
.body(bodyJson)
.execute()
.body();
return JSONUtil.parseObj(responseStr);
}
}
Loading…
Cancel
Save