Commit ca5b6f5c by HlQ

[add] 事件类型添加

[fix] mall 绑定事件记录 bug 修改
1 parent 23abf342
...@@ -8,11 +8,34 @@ import java.util.Arrays; ...@@ -8,11 +8,34 @@ import java.util.Arrays;
public enum MqttMessageType { public enum MqttMessageType {
REGISTER("REGISTER"), REGISTER("REGISTER"),
DEVICE_OFFLINE("DEVICE_OFFLINE"), //设备离线
UPGRADE("UPGRADE"), UPGRADE("UPGRADE"),
WHOLEDAY_ANALYZE("WHOLE_ANALYZE_EXCEPTION"), //全天分析异常 /**
* store + mall 共有
*/
PASSENGER_FLOW_INTERRUPT("PASSENGER_FLOW_INTERRUPT"), //客流数据中断,
DEVICE_OFFLINE("DEVICE_OFFLINE"), //设备离线
REID_ANALYZE("REID_EXCEPTION"), //全天分析异常
DEVICE_REGISTRATION("DEVICE_REGISTRATION"), //设备注册次数异常 DEVICE_REGISTRATION("DEVICE_REGISTRATION"), //设备注册次数异常
PASSENGER_FLOW_INTERRUPT("PASSENGER_FLOW_INTERRUPT"); //客流数据中断 DEVICE_FEATURE("DEVICE_FEATURE"), //设备特征异常
HEADCOUNT_RATIO("HEADCOUNT_RATIO"), //人数/人次异常
STAFF_RECOGNIZE("STAFF_RECOGNIZE"), //店员识别异常
/**
* store
*/
STORE_CUSTOMER_UNDULATE("STORE_CUSTOMER_UNDULATE"), //门店顾客人数波动异常
STORE_GATE_DATA_UNDULATE("STORE_GATE_DATA_UNDULATE"), //门店监控点数据波动异常
STORE_INOUT_MATCH_RATIO("STORE_INOUT_MATCH_RATIO"), //门店进出匹配率异常
STORE_SINGLE_CLUSTER("STORE_SINGLE_CLUSTER"), //门店单聚类异常
STORE_ENTER_RATIO("STORE_ENTER_RATIO"), //门店进店率异常
/**
* mall
*/
MALL_INOUT_DIFF("MALL_INOUT_DIFF"), //广场进出客流差异异常
MALL_SHOP_INOUT_DIFF("MALL_SHOP_INOUT_DIFF"), //广场店铺进出差异异常
MALL_DATA_UNDULATE("MALL_DATA_UNDULATE"), //广场数据波动异常
MALL_GATE_DATA_UNDULATE("MALL_GATE_DATA_UNDULATE"), //广场外围入口数据波动异常
MALL_SHOP_DATA_UNDULATE("MALL_SHOP_DATA_UNDULATE"), //广场店铺数据波动异常
;
private final String type; private final String type;
......
...@@ -50,7 +50,7 @@ public class MqttClientMessageListener { ...@@ -50,7 +50,7 @@ public class MqttClientMessageListener {
//设备离线 //设备离线
handleDeviceOffline(jsonObj.toString()); handleDeviceOffline(jsonObj.toString());
break; break;
case MqttMessageType.WHOLEDAY_ANALYZE: case MqttMessageType.REID_ANALYZE:
//全天分析异常 //全天分析异常
handleWholeDayAnalyze(jsonObj.toString()); handleWholeDayAnalyze(jsonObj.toString());
break; break;
......
...@@ -45,17 +45,16 @@ public class EventServiceImpl extends MPJBaseServiceImpl<EventMapper, Event> imp ...@@ -45,17 +45,16 @@ public class EventServiceImpl extends MPJBaseServiceImpl<EventMapper, Event> imp
var eventVOPage = this.selectJoinListPage(Page.of(dto.getPageNum(), dto.getPageSize()), EventVO.class, wrapper); var eventVOPage = this.selectJoinListPage(Page.of(dto.getPageNum(), dto.getPageSize()), EventVO.class, wrapper);
Opt.ofEmptyAble(eventVOPage.getRecords()) Opt.ofEmptyAble(eventVOPage.getRecords())
.ifPresent(r -> { .ifPresent(r -> {
var eventUidList = r.stream().map(EventVO::getUid).toList();
// fixme data 是字符串 // fixme data 是字符串
/* var eventRecWrapper1 = new MPJLambdaWrapper<EventRecord>() /* var eventRecWrapper1 = new MPJLambdaWrapper<EventRecord>()
.select("DISTINCT on (event_uid) *") .select("DISTINCT on (mall_uid) *")
.in("event_uid", eventUidList) .eq("mall_uid", eventUidList)
.orderByDesc("event_uid", "create_time"); .orderByDesc("mall_uid", "create_time");
var eventRecordList1 = eventRecordService.selectJoinList(EventRecord.class, eventRecWrapper1);*/ var eventRecordList1 = eventRecordService.selectJoinList(EventRecord.class, eventRecWrapper1);*/
var eventRecWrapper = Wrappers.<EventRecord>query() var eventRecWrapper = Wrappers.<EventRecord>query()
.select("DISTINCT on (event_uid) *") .select("DISTINCT on (mall_uid) *")
.in("event_uid", eventUidList) .eq("mall_uid", dto.getMallUid())
.orderByDesc("event_uid", "create_time"); .orderByDesc("mall_uid", "create_time");
var eventRecordList = eventRecordService.list(eventRecWrapper); var eventRecordList = eventRecordService.list(eventRecWrapper);
var eventUid2SelfMap = eventRecordList.stream().collect(Collectors.toMap(EventRecord::getEventUid, Function.identity())); var eventUid2SelfMap = eventRecordList.stream().collect(Collectors.toMap(EventRecord::getEventUid, Function.identity()));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!