代码提交
parent
827b7ee209
commit
a24adf091d
|
|
@ -209,7 +209,7 @@ CREATE TABLE "FXKH_TXL"."QXWARNING"
|
||||||
"CONTENT" VARCHAR(500),
|
"CONTENT" VARCHAR(500),
|
||||||
"WARNID" INTEGER,
|
"WARNID" INTEGER,
|
||||||
"CTNM" VARCHAR(200),
|
"CTNM" VARCHAR(200),
|
||||||
"CNNM" VARCHAR(200),
|
"CNNM" VARCHAR(1000),
|
||||||
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;
|
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;
|
||||||
|
|
||||||
COMMENT ON TABLE "FXKH_TXL"."QXWARNING" IS '气象预警表';
|
COMMENT ON TABLE "FXKH_TXL"."QXWARNING" IS '气象预警表';
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,6 @@ public class QXWarnController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "气象预警-正在生效的预警信息")
|
@ApiOperation(value = "气象预警-正在生效的预警信息")
|
||||||
@PostMapping("/getGroupWarning")
|
@PostMapping("/getGroupWarning")
|
||||||
// @Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
|
||||||
public ResultJson<List<QXWarningVO>> getGroupWarning() {
|
public ResultJson<List<QXWarningVO>> getGroupWarning() {
|
||||||
|
|
||||||
return ResultJson.ok(service.find());
|
return ResultJson.ok(service.find());
|
||||||
|
|
@ -242,7 +241,6 @@ public class QXWarnController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "确认处理完成")
|
@ApiOperation(value = "确认处理完成")
|
||||||
@PostMapping("/confirmHandle")
|
@PostMapping("/confirmHandle")
|
||||||
@Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
|
||||||
public ResultJson<List<WarnDppleVO>> confirmHandle(
|
public ResultJson<List<WarnDppleVO>> confirmHandle(
|
||||||
@RequestBody WarnMsgFB dto) {
|
@RequestBody WarnMsgFB dto) {
|
||||||
//根据warnid和phone判断是否重复
|
//根据warnid和phone判断是否重复
|
||||||
|
|
@ -419,7 +417,7 @@ public class QXWarnController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "历史气象预警查询")
|
@ApiOperation(value = "历史气象预警查询")
|
||||||
@PostMapping("/getHistoryWarning")
|
@PostMapping("/getHistoryWarning")
|
||||||
// @Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
@Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
||||||
public ResultJson<HistoryWarnsVO> getHistoryWarning(@RequestBody GroupWarningDto dto) {
|
public ResultJson<HistoryWarnsVO> getHistoryWarning(@RequestBody GroupWarningDto dto) {
|
||||||
// List<QXWarningVO> warnList = new ArrayList<>();
|
// List<QXWarningVO> warnList = new ArrayList<>();
|
||||||
// HistoryWarnsVO historyWarnsVO = new HistoryWarnsVO();
|
// HistoryWarnsVO historyWarnsVO = new HistoryWarnsVO();
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
@ -68,7 +67,6 @@ public class WarningController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "气象预警")
|
@ApiOperation(value = "气象预警")
|
||||||
@PostMapping("/getGroupWarning")
|
@PostMapping("/getGroupWarning")
|
||||||
@Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
|
||||||
public ResultJson<List<WarningListVo>> getGroupWarning(
|
public ResultJson<List<WarningListVo>> getGroupWarning(
|
||||||
@RequestBody GroupWarningDto dto) {
|
@RequestBody GroupWarningDto dto) {
|
||||||
|
|
||||||
|
|
@ -146,7 +144,7 @@ public class WarningController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "历史气象预警统计")
|
@ApiOperation(value = "历史气象预警统计")
|
||||||
@PostMapping("/getHistoryGroupWarning")
|
@PostMapping("/getHistoryGroupWarning")
|
||||||
@Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
// @Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
||||||
public ResultJson<List<WarningHistoryListVo>> getHistoryGroupWarning(@RequestBody GroupWarningDto dto) {
|
public ResultJson<List<WarningHistoryListVo>> getHistoryGroupWarning(@RequestBody GroupWarningDto dto) {
|
||||||
|
|
||||||
ApiDto apiDto = new ApiDto();
|
ApiDto apiDto = new ApiDto();
|
||||||
|
|
@ -346,7 +344,8 @@ public class WarningController {
|
||||||
|
|
||||||
// 类型 只要暴雨
|
// 类型 只要暴雨
|
||||||
Map<String, List<WarningData.Warning>> types = v.stream()
|
Map<String, List<WarningData.Warning>> types = v.stream()
|
||||||
.filter(o -> "暴雨".equals(o.getWarnSignalType()))
|
// .filter(o -> "暴雨".equals(o.getWarnSignalType()))
|
||||||
|
.filter(o -> "橙色".equals(o.getWarnSignalLevel()) || "红色".equals(o.getWarnSignalLevel()))
|
||||||
.collect(Collectors
|
.collect(Collectors
|
||||||
.groupingBy(WarningData.Warning::getWarnSignalType, Collectors.toList()));
|
.groupingBy(WarningData.Warning::getWarnSignalType, Collectors.toList()));
|
||||||
|
|
||||||
|
|
@ -437,6 +436,12 @@ public class WarningController {
|
||||||
|
|
||||||
for (AdcdTree adcdTree : tree) {
|
for (AdcdTree adcdTree : tree) {
|
||||||
String adnm = adcdTree.getAdnm();
|
String adnm = adcdTree.getAdnm();
|
||||||
|
|
||||||
|
if ("恩施土家族苗族自治州".equals(adnm)){
|
||||||
|
adnm = "恩施州";
|
||||||
|
adcdTree.setAdnm(adnm);
|
||||||
|
}
|
||||||
|
|
||||||
List<AdcdTree> children = adcdTree.getChildren();
|
List<AdcdTree> children = adcdTree.getChildren();
|
||||||
|
|
||||||
List<WarningHistoryListVo> vos = areaMap.remove(adnm);
|
List<WarningHistoryListVo> vos = areaMap.remove(adnm);
|
||||||
|
|
@ -449,6 +454,9 @@ public class WarningController {
|
||||||
for (int i = 1; i < children.size(); i++) {
|
for (int i = 1; i < children.size(); i++) {
|
||||||
AdcdTree t = children.get(i);
|
AdcdTree t = children.get(i);
|
||||||
String adnm1 = t.getAdnm();
|
String adnm1 = t.getAdnm();
|
||||||
|
if ("经济技术开发区(汉南区)".equals(adnm1)){
|
||||||
|
adnm1 = "武汉经济技术开发区";
|
||||||
|
}
|
||||||
List<WarningHistoryListVo> vos1 = areaMap.remove(adnm1);
|
List<WarningHistoryListVo> vos1 = areaMap.remove(adnm1);
|
||||||
if (CollectionUtils.isNotEmpty(vos1)) {
|
if (CollectionUtils.isNotEmpty(vos1)) {
|
||||||
childList.addAll(vos1);
|
childList.addAll(vos1);
|
||||||
|
|
@ -456,13 +464,23 @@ public class WarningController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vo.setAreaChild(childList);
|
vo.setAreaChild(childList);
|
||||||
respList.add(vo);
|
respList.add(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
areaMap.keySet().forEach(s -> System.out.println("未匹配行政区划: " + s));
|
||||||
|
|
||||||
return respList;
|
return respList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// public static void main(String[] args) {
|
||||||
|
// GroupWarningDto dto = new GroupWarningDto();
|
||||||
|
// dto.setStartTime("2024-01-01 00:00:00");
|
||||||
|
// dto.setEndTime("2024-06-20 23:00:00");
|
||||||
|
// System.out.println(new WarningController().getHistoryGroupWarning(dto));
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.whdc.model.dto;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
|
|
@ -10,6 +12,8 @@ import lombok.Data;
|
||||||
* @author XuSan
|
* @author XuSan
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class GroupWarningDto extends FindPageDto{
|
public class GroupWarningDto extends FindPageDto{
|
||||||
|
|
||||||
|
|
@ -28,10 +32,4 @@ public class GroupWarningDto extends FindPageDto{
|
||||||
@ApiModelProperty(value = "级别")
|
@ApiModelProperty(value = "级别")
|
||||||
private String warnSignalLevel;
|
private String warnSignalLevel;
|
||||||
|
|
||||||
@ApiModelProperty(value = "页数", dataType = "java.lang.Integer", example = "1")
|
|
||||||
private Integer pageNumber = 1;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "条数", dataType = "java.lang.Integer", example = "999")
|
|
||||||
private Integer pageSize = 999;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,15 @@ public class AdinfoServiceImpl extends ServiceImpl<AdinfoMapper, Adinfo> impleme
|
||||||
tree.add(adcdTree);
|
tree.add(adcdTree);
|
||||||
|
|
||||||
} else if ("000000000".equals(ad.substring(6))) { // 县
|
} else if ("000000000".equals(ad.substring(6))) { // 县
|
||||||
adcdTree.setAdlevel(2);
|
// 县级市
|
||||||
addTree(county, cityStr, adcdTree);
|
if (ad.contains("4290")){
|
||||||
|
adcdTree.setAdlevel(1);
|
||||||
|
addTree(city, provinceStr, adcdTree);
|
||||||
|
tree.add(adcdTree);
|
||||||
|
}else{
|
||||||
|
adcdTree.setAdlevel(2);
|
||||||
|
addTree(county, cityStr, adcdTree);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,11 +40,11 @@ spring:
|
||||||
# Redis
|
# Redis
|
||||||
redis:
|
redis:
|
||||||
database: 5
|
database: 5
|
||||||
host: 10.42.6.75
|
# host: 10.42.6.75
|
||||||
# host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
|
password:
|
||||||
|
# password: Whdc_890
|
||||||
port: 6379
|
port: 6379
|
||||||
# password:
|
|
||||||
password: Whdc_890
|
|
||||||
|
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue