监管指挥平台暂时不推送 20 - 23106 垃圾桶加盖
This commit is contained in:
parent
0b42353ac0
commit
534decb43b
@ -2,7 +2,7 @@
|
|||||||
%%% @author anlicheng
|
%%% @author anlicheng
|
||||||
%%% @copyright (C) 2024, <COMPANY>
|
%%% @copyright (C) 2024, <COMPANY>
|
||||||
%%% @doc
|
%%% @doc
|
||||||
%%%
|
%%% 监管指挥平台
|
||||||
%%% @end
|
%%% @end
|
||||||
%%% Created : 23. 7月 2024 14:51
|
%%% Created : 23. 7月 2024 14:51
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
@ -45,7 +45,15 @@ get_pid() ->
|
|||||||
|
|
||||||
-spec forward(LocationCode :: binary(), DynamicLocationCode :: binary(), EventType :: integer(), Params :: map()) -> no_return().
|
-spec forward(LocationCode :: binary(), DynamicLocationCode :: binary(), EventType :: integer(), Params :: map()) -> no_return().
|
||||||
forward(LocationCode, DynamicLocationCode, EventType, Params) when is_binary(LocationCode), is_binary(DynamicLocationCode), is_integer(EventType), is_map(Params) ->
|
forward(LocationCode, DynamicLocationCode, EventType, Params) when is_binary(LocationCode), is_binary(DynamicLocationCode), is_integer(EventType), is_map(Params) ->
|
||||||
gen_server:cast(?MODULE, {forward, LocationCode, DynamicLocationCode, EventType, Params}).
|
%% 需要暂时不推送的事件类型
|
||||||
|
IgnoreEventTypes = [20],
|
||||||
|
case lists:member(EventType, IgnoreEventTypes) of
|
||||||
|
true ->
|
||||||
|
lager:notice("[iot_jinzhi_endpoint] the event type: ~p, params: ~p, ignore", [EventType, Params]),
|
||||||
|
ok;
|
||||||
|
false ->
|
||||||
|
gen_server:cast(?MODULE, {forward, LocationCode, DynamicLocationCode, EventType, Params})
|
||||||
|
end.
|
||||||
|
|
||||||
%% @doc Spawns the server and registers the local name (unique)
|
%% @doc Spawns the server and registers the local name (unique)
|
||||||
-spec(start_link() ->
|
-spec(start_link() ->
|
||||||
@ -194,7 +202,7 @@ format_event(LocationCode, DynamicLocationCode, EventType, #{<<"event_code">> :=
|
|||||||
<<"category">> => EventCode,
|
<<"category">> => EventCode,
|
||||||
<<"description">> => Description,
|
<<"description">> => Description,
|
||||||
<<"occurrenceTime">> => Datetime,
|
<<"occurrenceTime">> => Datetime,
|
||||||
%% 给金智的数据,只番户附件信息里面的第一个附件;多了对方程序报错
|
%% 给金智的数据,只给附件信息里面的第一个附件;多了对方程序报错
|
||||||
<<"attachments">> => lists:sublist(Attachments, 1, 1)
|
<<"attachments">> => lists:sublist(Attachments, 1, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user