fix task_id
This commit is contained in:
parent
5112bf1d3d
commit
77d6559573
@ -205,17 +205,14 @@ format_event(LocationCode, DynamicLocationCode, EventType, #{<<"event_code">> :=
|
|||||||
},
|
},
|
||||||
iolist_to_binary(jiffy:encode(ReqData, [force_utf8])).
|
iolist_to_binary(jiffy:encode(ReqData, [force_utf8])).
|
||||||
|
|
||||||
-spec generate_task_id(DynamicLocationCode :: binary(), EventCode :: binary()) -> binary().
|
-spec generate_task_id(LocationCode :: binary(), EventCode :: binary()) -> binary().
|
||||||
generate_task_id(DynamicLocationCode, EventCode) when is_binary(DynamicLocationCode), is_binary(EventCode) ->
|
generate_task_id(LocationCode, EventCode) when is_binary(LocationCode), is_binary(EventCode) ->
|
||||||
case byte_size(DynamicLocationCode) of
|
case byte_size(LocationCode) > 22 of
|
||||||
22 ->
|
true ->
|
||||||
LocCode = binary_part(DynamicLocationCode, 0, 17),
|
LocCode = binary_part(LocationCode, 0, 22),
|
||||||
<<LocCode/binary, "_", EventCode/binary>>;
|
<<LocCode/binary, "_", EventCode/binary>>;
|
||||||
28 ->
|
false ->
|
||||||
LocCode = binary_part(DynamicLocationCode, 0, 22),
|
<<LocationCode/binary, "_", EventCode/binary>>
|
||||||
<<LocCode/binary, "_", EventCode/binary>>;
|
|
||||||
_ ->
|
|
||||||
<<DynamicLocationCode/binary, "_", EventCode/binary>>
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec generate_private_key(PriFile :: string()) -> public_key:private_key().
|
-spec generate_private_key(PriFile :: string()) -> public_key:private_key().
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
# 事件分类
|
# 事件分类
|
||||||
|
|
||||||
```text
|
```text
|
||||||
23103 鼠类监测 event_code:
|
23103 鼠类监测 event_code: 11
|
||||||
20407 异物占道 event_code:
|
20407 异物占道 event_code: 13
|
||||||
10404 垃圾溢满 event_code:
|
10404 垃圾溢满 event_code: 14
|
||||||
22503 后厨非标着装 event_code:
|
22503 后厨非标着装 event_code: 12
|
||||||
23104 动火离人 event_code:
|
23104 动火离人 event_code: 15
|
||||||
```
|
```
|
||||||
|
|
||||||
1、鼠类检测 0508103010001050300001 朴苑餐厅
|
1、鼠类检测 0508103010001050300001 朴苑餐厅
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user