提交 2f25667e 作者: 17607474349

fix:

1、合并tml分支
上级 31bc9e8a
......@@ -39,10 +39,8 @@ public class RiskPush extends BasicEntity implements Serializable {
@ManyToOne
WorkArea workArea;
@Comment("风险等级")
@Enumerated(EnumType.STRING)
Level level;
@Comment("风险等级:1-红色风险,2-橙色风险,3-黄色风险,4-蓝色风险")
Integer level;
// @Comment("撤离推送")
// @Builder.Default
// @OneToMany(mappedBy = "riskPush")
......@@ -53,21 +51,21 @@ public class RiskPush extends BasicEntity implements Serializable {
// @OneToMany(mappedBy = "riskPush")
// Set<RiskHandlePush> handlePush = new HashSet<>(0);
@SuppressWarnings({ "unused" })
public enum Level {
RED("红色预警"),
ORANGE("橙色预警"),
YELLOW("黄色预警"),
BLUE("蓝色预警");
final String text;
Level(String text) {
this.text = text;
}
public String text() {
return this.text;
}
}
// @SuppressWarnings({ "unused" })
// public enum Level {
// RED("红色预警"),
// ORANGE("橙色预警"),
// YELLOW("黄色预警"),
// BLUE("蓝色预警");
//
// final String text;
//
// Level(String text) {
// this.text = text;
// }
//
// public String text() {
// return this.text;
// }
// }
}
......@@ -84,6 +84,12 @@ public class MockPositionMessageJob {
}
}
@XxlJob("MockMeterDetectHandler")
public void MockMeterDetectHandler() {
JSONObject extra = toJSON(XxlJobHelper.getJobParam());
log.info("[Mock] MeterDetect: {}, {}", mockMeterDetectMessage(extra), extra);
}
public JSONObject send(JSONObject body) {
if (rabbitmq.isMock()) {
rabbitTemplate.convertAndSend(rabbitmq.getQueueName(), body.toJSONString());
......@@ -183,4 +189,17 @@ public class MockPositionMessageJob {
body.put("params", params);
return send(body);
}
private JSONObject mockMeterDetectMessage(JSONObject extra) {
JSONObject params = new JSONObject();
params.put("locationNum", "4376");
params.put("newestMonitor", 1L);
params.put("time", LocalDateTime.now());
params.putAll(extra);
JSONObject body = new JSONObject();
body.put("method", "meterDetect");
body.put("params", params);
return send(body);
}
}
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.param.risk;
import com.yiring.app.domain.risk.RiskPush;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serial;
......@@ -31,6 +30,6 @@ public class RiskPushConditionParam implements Serializable {
@ApiModelProperty(value = "工区id", example = "1")
Long workId;
@ApiModelProperty(value = "风险等级", example = "RED/ORANGE/YELLOW/BLUE")
RiskPush.Level level;
@ApiModelProperty(value = "风险等级", example = "1-红色风险,2-橙色风险,3-黄色风险,4-蓝色风险")
Integer level;
}
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.param.risk;
import com.yiring.app.domain.risk.RiskPush;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serial;
......@@ -33,7 +32,7 @@ public class RiskPushSaveParam implements Serializable {
@NotNull(message = "工区id不能为空")
Long workId;
@ApiModelProperty(value = "风险等级", example = "RED/ORANGE/YELLOW/BLUE", required = true)
@ApiModelProperty(value = "风险等级", example = "1-红色风险,2-橙色风险,3-黄色风险,4-蓝色风险", required = true)
@NotNull(message = "风险等级不能为空")
RiskPush.Level level;
Integer level;
}
......@@ -39,7 +39,7 @@ public class RiskPushVo implements Serializable {
WorkAreaVo workAreaVo;
@ApiModelProperty(value = "风险等级", example = "红、橙、黄、蓝")
String level;
Integer level;
@ApiModelProperty(value = "撤离推送总数", example = "1")
String withdrawalPush;
......@@ -48,6 +48,6 @@ public class RiskPushVo implements Serializable {
String handlePush;
public static RiskPushVo transform(RiskPush riskPush) {
return RiskPushVo.builder().id(riskPush.getId()).level(riskPush.getLevel().text()).build();
return RiskPushVo.builder().id(riskPush.getId()).level(riskPush.getLevel()).build();
}
}
......@@ -6,7 +6,7 @@ buildscript {
// https://start.spring.io/
springCloudVersion = '2021.0.2'
// https://mvnrepository.com/artifact/com.github.xiaoymin/knife4j-spring-boot-starter
knife4jVersion = '3.0.3'
knife4jVersion = '2.0.9'
// https://mvnrepository.com/artifact/io.swagger/swagger-annotations
swaggerAnnotationsVersion = '1.6.6'
// https://mvnrepository.com/artifact/cn.dev33/sa-token-spring-boot-starter
......@@ -14,7 +14,7 @@ buildscript {
// https://mvnrepository.com/artifact/cn.hutool/hutool-all
hutoolVersion = '5.8.0'
// https://mvnrepository.com/artifact/com.alibaba/fastjson
fastJsonVersion = '2.0.3.graal'
fastJsonVersion = '1.2.80'
// https://mvnrepository.com/artifact/com.xuxueli/xxl-job-core
xxlJobVersion = '2.3.0'
// https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论