提交 2f25667e 作者: 17607474349

fix:

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