Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
integrated-scheduling-v3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张晓彤
integrated-scheduling-v3
Commits
58bf095b
Commit
58bf095b
authored
Dec 15, 2025
by
Allvey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新版地图问题修复
parent
c5c70aad
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
69 additions
and
54 deletions
+69
-54
group.py
core/group.py
+12
-11
submit.py
core/submit.py
+7
-7
util.py
core/util.py
+0
-0
dispatchInfo.py
data/dispatchInfo.py
+6
-6
dump.py
equipment/dump.py
+16
-8
excavator.py
equipment/excavator.py
+5
-1
truck.py
equipment/truck.py
+3
-1
gothrough_digging.py
gothrough/gothrough_digging.py
+8
-8
realtime_dispatch_test.py
realtime_dispatch_test.py
+9
-9
area_analysis.py
util/area_analysis.py
+3
-3
No files found.
core/group.py
View file @
58bf095b
...
@@ -43,12 +43,12 @@ def direct2redis():
...
@@ -43,12 +43,12 @@ def direct2redis():
if
item
.
truck_id
not
in
truck_disp
:
if
item
.
truck_id
not
in
truck_disp
:
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
load_area_feature_id
=
session_mysql
.
query
(
DiggingWorkArea
)
.
filter_by
(
Id
=
item
.
load_area_id
,
# load_area_feature_id = session_postgre
.query(DiggingWorkArea).filter_by(Id=item.load_area_id,
MapVersion
=
map_version
)
.
first
()
.
FeatureId
#
MapVersion=map_version).first().FeatureId
unload_area_feature_id
=
session_mysql
.
query
(
DumpArea
)
.
filter_by
(
Id
=
item
.
unload_area_id
,
# unload_area_feature_id = session_postgre
.query(DumpArea).filter_by(Id=item.unload_area_id,
MapVersion
=
map_version
)
.
first
()
.
FeatureId
#
MapVersion=map_version).first().FeatureId
record
=
{
"truckId"
:
item
.
truck_id
,
"dispatchId"
:
item
.
id
,
"exactorId"
:
item
.
exactor_id
,
record
=
{
"truckId"
:
item
.
truck_id
,
"dispatchId"
:
item
.
id
,
"exactorId"
:
item
.
exactor_id
,
"dumpId"
:
item
.
dump_id
,
"loadAreaId"
:
load_area_feature_id
,
"unloadAreaId"
:
unload_area_feature
_id
,
"dumpId"
:
item
.
dump_id
,
"loadAreaId"
:
item
.
load_area_id
,
"unloadAreaId"
:
item
.
unload_area
_id
,
"groupId"
:
item
.
group_id
,
"isdeleted"
:
False
,
"isTemp"
:
False
,
"haulFlag"
:
-
1
,
"groupId"
:
item
.
group_id
,
"isdeleted"
:
False
,
"isTemp"
:
False
,
"haulFlag"
:
-
1
,
"groupName"
:
DispatchInfo
.
group_name
[
item
.
group_id
]}
"groupName"
:
DispatchInfo
.
group_name
[
item
.
group_id
]}
...
@@ -95,14 +95,15 @@ def truck_direct2redis(truck_id):
...
@@ -95,14 +95,15 @@ def truck_direct2redis(truck_id):
item
=
session_mysql
.
query
(
DispatchSetting
)
.
filter_by
(
truck_id
=
truck_id
,
isdeleted
=
0
,
)
.
first
()
item
=
session_mysql
.
query
(
DispatchSetting
)
.
filter_by
(
truck_id
=
truck_id
,
isdeleted
=
0
,
)
.
first
()
if
item
is
None
:
if
item
is
None
:
raise
CoreException
(
101
,
"无可用派车计划"
)
raise
CoreException
(
101
,
"无可用派车计划"
)
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
load_area_feature_id
=
session_mysql
.
query
(
DiggingWorkArea
)
.
filter_by
(
Id
=
item
.
load_area_id
,
# map_version = session_postgre.query(Distribute_Library).filter_by(Status="1").first().Version
MapVersion
=
map_version
)
.
first
()
.
FeatureId
#
unload_area_feature_id
=
session_mysql
.
query
(
DumpArea
)
.
filter_by
(
Id
=
item
.
unload_area_id
,
# load_area_feature_id = session_postgre.query(DiggingWorkArea).filter_by(FeatureId=item.load_area_id,
MapVersion
=
map_version
)
.
first
()
.
FeatureId
# MapVersion=map_version).first().FeatureId
# unload_area_feature_id = session_postgre.query(DumpArea).filter_by(Id=item.unload_area_id,
# MapVersion=map_version).first().FeatureId
record
=
{
"truckId"
:
item
.
truck_id
,
"dispatchId"
:
item
.
id
,
"exactorId"
:
item
.
exactor_id
,
record
=
{
"truckId"
:
item
.
truck_id
,
"dispatchId"
:
item
.
id
,
"exactorId"
:
item
.
exactor_id
,
"dumpId"
:
item
.
dump_id
,
"loadAreaId"
:
load_area_feature_id
,
"unloadAreaId"
:
unload_area_feature
_id
,
"dumpId"
:
item
.
dump_id
,
"loadAreaId"
:
item
.
load_area_id
,
"unloadAreaId"
:
item
.
unload_area
_id
,
"groupId"
:
item
.
group_id
,
"isdeleted"
:
False
,
"isTemp"
:
False
,
"haulFlag"
:
-
1
,
"groupId"
:
item
.
group_id
,
"isdeleted"
:
False
,
"isTemp"
:
False
,
"haulFlag"
:
-
1
,
"groupName"
:
DispatchInfo
.
group_name
[
item
.
group_id
]}
"groupName"
:
DispatchInfo
.
group_name
[
item
.
group_id
]}
logger
.
info
(
f
'写入redis调度结果: {record}'
)
logger
.
info
(
f
'写入redis调度结果: {record}'
)
...
...
core/submit.py
View file @
58bf095b
...
@@ -245,13 +245,13 @@ class DispatchSubmission:
...
@@ -245,13 +245,13 @@ class DispatchSubmission:
def
redis_format
(
truck_id
,
group_id
,
dispatch_id
,
item
):
def
redis_format
(
truck_id
,
group_id
,
dispatch_id
,
item
):
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
#
map_version = session_postgre.query(Distribute_Library).filter_by(Status="1").first().Version
#
load_area_feature_id
=
session_mysql
.
query
(
DiggingWorkArea
)
.
filter_by
(
Id
=
item
.
load_area_id
,
# load_area_feature_id = session_postgre
.query(DiggingWorkArea).filter_by(Id=item.load_area_id,
MapVersion
=
map_version
)
.
first
()
.
FeatureId
#
MapVersion=map_version).first().FeatureId
unload_area_feature_id
=
session_mysql
.
query
(
DumpArea
)
.
filter_by
(
Id
=
item
.
unload_area_id
,
# unload_area_feature_id = session_postgre
.query(DumpArea).filter_by(Id=item.unload_area_id,
MapVersion
=
map_version
)
.
first
()
.
FeatureId
#
MapVersion=map_version).first().FeatureId
record
=
{
"truckId"
:
truck_id
,
"dispatchId"
:
dispatch_id
,
"exactorId"
:
item
.
exactor_id
,
"dumpId"
:
item
.
dump_id
,
record
=
{
"truckId"
:
truck_id
,
"dispatchId"
:
dispatch_id
,
"exactorId"
:
item
.
exactor_id
,
"dumpId"
:
item
.
dump_id
,
"loadAreaId"
:
load_area_feature_id
,
"unloadAreaId"
:
unload_area_feature
_id
,
"groupId"
:
item
.
group_id
,
"loadAreaId"
:
item
.
load_area_id
,
"unloadAreaId"
:
item
.
unload_area
_id
,
"groupId"
:
item
.
group_id
,
"isdeleted"
:
False
,
"isTemp"
:
False
,
"haulFlag"
:
-
1
,
"groupName"
:
DispatchInfo
.
group_name
[
group_id
]}
"isdeleted"
:
False
,
"isTemp"
:
False
,
"haulFlag"
:
-
1
,
"groupName"
:
DispatchInfo
.
group_name
[
group_id
]}
return
record
return
record
core/util.py
View file @
58bf095b
data/dispatchInfo.py
View file @
58bf095b
...
@@ -211,12 +211,12 @@ class DispatchInfo:
...
@@ -211,12 +211,12 @@ class DispatchInfo:
if
str
(
bytes
.
decode
(
excavator_state
))
==
"7"
or
str
(
bytes
.
decode
(
truck_state
))
==
"7"
:
if
str
(
bytes
.
decode
(
excavator_state
))
==
"7"
or
str
(
bytes
.
decode
(
truck_state
))
==
"7"
:
continue
continue
if
bytes
.
decode
(
is_excavator_online
)
not
in
[
"true"
or
"True"
]
or
bytes
.
decode
(
is_truck_online
)
not
in
\
#
if bytes.decode(is_excavator_online) not in ["true" or "True"] or bytes.decode(is_truck_online) not in \
[
"true"
or
"True"
]:
#
["true" or "True"]:
continue
#
continue
# add group_excavators
# add group_excavators
excavator_state
=
session_mysql
.
query
(
Equipment
)
.
filter_by
(
id
=
item
.
exactor_id
)
.
first
()
#
excavator_state = session_mysql.query(Equipment).filter_by(id=item.exactor_id).first()
# if excavator_state is not None and excavator_state.disabled == 0:
# if excavator_state is not None and excavator_state.disabled == 0:
if
item
.
group_id
not
in
cls
.
group_excavator_dict
.
keys
():
if
item
.
group_id
not
in
cls
.
group_excavator_dict
.
keys
():
cls
.
group_excavator_dict
[
item
.
group_id
]
=
[
item
.
exactor_id
]
cls
.
group_excavator_dict
[
item
.
group_id
]
=
[
item
.
exactor_id
]
...
@@ -234,7 +234,7 @@ class DispatchInfo:
...
@@ -234,7 +234,7 @@ class DispatchInfo:
cls
.
unload_area_group_dict
[
item
.
unload_area_id
]
=
item
.
group_id
cls
.
unload_area_group_dict
[
item
.
unload_area_id
]
=
item
.
group_id
# add dump
# add dump
dump_state
=
session_mysql
.
query
(
Equipment
)
.
filter_by
(
id
=
item
.
dump_id
)
.
first
()
#
dump_state = session_mysql.query(Equipment).filter_by(id=item.dump_id).first()
# if dump_state is not None and dump_state.disabled == 1:
# if dump_state is not None and dump_state.disabled == 1:
# add group_dumps
# add group_dumps
if
item
.
group_id
not
in
cls
.
group_dump_dict
.
keys
():
if
item
.
group_id
not
in
cls
.
group_dump_dict
.
keys
():
...
@@ -245,7 +245,7 @@ class DispatchInfo:
...
@@ -245,7 +245,7 @@ class DispatchInfo:
cls
.
dump_group_dict
[
item
.
dump_id
]
=
item
.
group_id
cls
.
dump_group_dict
[
item
.
dump_id
]
=
item
.
group_id
# add truck
# add truck
truck_state
=
session_mysql
.
query
(
Equipment
)
.
filter_by
(
id
=
item
.
truck_id
)
.
first
()
#
truck_state = session_mysql.query(Equipment).filter_by(id=item.truck_id).first()
# if truck_state is not None and truck_state.disabled == 1:
# if truck_state is not None and truck_state.disabled == 1:
if
item
.
group_id
not
in
cls
.
group_truck_dict
.
keys
():
if
item
.
group_id
not
in
cls
.
group_truck_dict
.
keys
():
cls
.
group_truck_dict
[
item
.
group_id
]
=
[
item
.
truck_id
]
cls
.
group_truck_dict
[
item
.
group_id
]
=
[
item
.
truck_id
]
...
...
equipment/dump.py
View file @
58bf095b
...
@@ -122,8 +122,11 @@ class DumpInfo(WalkManage):
...
@@ -122,8 +122,11 @@ class DumpInfo(WalkManage):
for
dump_id
in
get_value
(
"dynamic_dump_set"
):
for
dump_id
in
get_value
(
"dynamic_dump_set"
):
try
:
try
:
# unload_area_id = session_mysql.query(DispatchSetting).filter_by(dump_id=dump_id, isauto=1, isdeleted=0).first().unload_area_id
# unload_area_id = session_mysql.query(DispatchSetting).filter_by(dump_id=dump_id, isauto=1, isdeleted=0).first().unload_area_id
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
unload_area_id
=
session_mysql
.
query
(
DispatchSetting
)
.
filter_by
(
dump_id
=
dump_id
,
isdeleted
=
0
)
.
first
()
.
unload_area_id
unload_area_id
=
session_mysql
.
query
(
DispatchSetting
)
.
filter_by
(
dump_id
=
dump_id
,
isdeleted
=
0
)
.
first
()
.
unload_area_id
dump_material_id
=
session_postgre
.
query
(
DumpArea
)
.
filter_by
(
Id
=
unload_area_id
)
.
first
()
.
Materials
dump_material_id
=
session_postgre
.
query
(
DumpArea
)
.
filter_by
(
FeatureId
=
unload_area_id
,
MapVersion
=
map_version
)
.
first
()
.
Materials
if
dump_material_id
is
None
:
if
dump_material_id
is
None
:
dump_material_id
=
[]
dump_material_id
=
[]
else
:
else
:
...
@@ -140,15 +143,18 @@ class DumpInfo(WalkManage):
...
@@ -140,15 +143,18 @@ class DumpInfo(WalkManage):
unload_area_index_to_uuid_dict
=
get_value
(
"unload_area_index_to_uuid_dict"
)
unload_area_index_to_uuid_dict
=
get_value
(
"unload_area_index_to_uuid_dict"
)
self
.
dump_priority_coefficient
=
np
.
ones
(
self
.
dynamic_dump_num
)
self
.
dump_priority_coefficient
=
np
.
ones
(
self
.
dynamic_dump_num
)
for
dump_id
in
self
.
dynamic_dump_set
:
for
dump_id
in
self
.
dynamic_dump_set
:
try
:
#
try:
unload_area_index
=
self
.
dump_index_to_unload_area_index_dict
[
self
.
dump_uuid_to_index_dict
[
dump_id
]]
unload_area_index
=
self
.
dump_index_to_unload_area_index_dict
[
self
.
dump_uuid_to_index_dict
[
dump_id
]]
unload_area_id
=
unload_area_index_to_uuid_dict
[
unload_area_index
]
unload_area_id
=
unload_area_index_to_uuid_dict
[
unload_area_index
]
item
=
session_postgre
.
query
(
DumpArea
)
.
filter_by
(
Id
=
unload_area_id
)
.
first
()
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
item
=
session_postgre
.
query
(
DumpArea
)
.
filter_by
(
FeatureId
=
unload_area_id
,
MapVersion
=
map_version
)
.
first
()
# item = session_postgre.query(DumpArea).filter_by(Id=unload_area_id).first()
self
.
dump_priority_coefficient
[
self
.
dump_uuid_to_index_dict
[
dump_id
]]
+=
item
.
Priority
self
.
dump_priority_coefficient
[
self
.
dump_uuid_to_index_dict
[
dump_id
]]
+=
item
.
Priority
except
Exception
as
es
:
#
except Exception as es:
self
.
logger
.
error
(
"卸点优先级更新异常"
)
#
self.logger.error("卸点优先级更新异常")
self
.
logger
.
error
(
es
)
#
self.logger.error(es)
session_postgre
.
rollback
()
#
session_postgre.rollback()
self
.
logger
.
info
(
'卸载点优先级更新'
)
self
.
logger
.
info
(
'卸载点优先级更新'
)
self
.
logger
.
info
(
self
.
dump_priority_coefficient
)
self
.
logger
.
info
(
self
.
dump_priority_coefficient
)
...
@@ -167,7 +173,9 @@ class DumpInfo(WalkManage):
...
@@ -167,7 +173,9 @@ class DumpInfo(WalkManage):
unload_area_id
=
unload_area_index_to_uuid_dict
[
self
.
dump_index_to_unload_area_index_dict
[
dump_index
]]
unload_area_id
=
unload_area_index_to_uuid_dict
[
self
.
dump_index_to_unload_area_index_dict
[
dump_index
]]
try
:
try
:
unload_ability
=
session_postgre
.
query
(
DumpArea
)
.
filter_by
(
Id
=
unload_area_id
)
.
first
()
.
UnloadAbililty
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
unload_ability
=
session_postgre
.
query
(
DumpArea
)
.
filter_by
(
FeatureId
=
unload_area_id
,
MapVersion
=
map_version
)
.
first
()
.
UnloadAbililty
except
Exception
as
es
:
except
Exception
as
es
:
self
.
logger
.
error
(
es
)
self
.
logger
.
error
(
es
)
session_mysql
.
rollback
()
session_mysql
.
rollback
()
...
...
equipment/excavator.py
View file @
58bf095b
...
@@ -135,8 +135,12 @@ class ExcavatorInfo(WalkManage):
...
@@ -135,8 +135,12 @@ class ExcavatorInfo(WalkManage):
for
excavator_id
in
self
.
dynamic_excavator_set
:
for
excavator_id
in
self
.
dynamic_excavator_set
:
try
:
try
:
# load_area_id = session_mysql.query(DispatchSetting).filter_by(exactor_id=excavator_id, isdeleted=0, isauto=1).first().load_area_id
# load_area_id = session_mysql.query(DispatchSetting).filter_by(exactor_id=excavator_id, isdeleted=0, isauto=1).first().load_area_id
load_area_id
=
session_mysql
.
query
(
DispatchSetting
)
.
filter_by
(
exactor_id
=
excavator_id
,
isdeleted
=
0
)
.
first
()
.
load_area_id
load_area_id
=
session_mysql
.
query
(
DispatchSetting
)
.
filter_by
(
exactor_id
=
excavator_id
,
isdeleted
=
0
)
.
first
()
.
load_area_id
excavator_material_id
=
session_postgre
.
query
(
DiggingWorkArea
)
.
filter_by
(
Id
=
load_area_id
)
.
first
()
.
Material
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
excavator_material_id
=
session_postgre
.
query
(
DiggingWorkArea
)
.
filter_by
(
FeatureId
=
load_area_id
,
MapVersion
=
map_version
)
.
first
()
.
Material
self
.
excavator_material
[
excavator_id
]
=
excavator_material_id
self
.
excavator_material
[
excavator_id
]
=
excavator_material_id
except
Exception
as
es
:
except
Exception
as
es
:
self
.
logger
.
warning
(
es
)
self
.
logger
.
warning
(
es
)
...
...
equipment/truck.py
View file @
58bf095b
...
@@ -744,7 +744,9 @@ class TruckInfo(WalkManage):
...
@@ -744,7 +744,9 @@ class TruckInfo(WalkManage):
if
truck_id
in
self
.
truck_dump_bind
:
if
truck_id
in
self
.
truck_dump_bind
:
unload_area_id
=
self
.
truck_dump_bind
[
truck_id
]
unload_area_id
=
self
.
truck_dump_bind
[
truck_id
]
try
:
try
:
dump_material_id
=
session_postgre
.
query
(
DumpArea
)
.
filter_by
(
Id
=
unload_area_id
)
.
first
()
.
Materials
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
dump_material_id
=
session_postgre
.
query
(
DumpArea
)
.
filter_by
(
FeatureId
=
unload_area_id
,
MapVersion
=
map_version
)
.
first
()
.
Materials
except
Exception
as
es
:
except
Exception
as
es
:
session_postgre
.
rollback
()
session_postgre
.
rollback
()
session_mysql
.
rollback
()
session_mysql
.
rollback
()
...
...
gothrough/gothrough_digging.py
View file @
58bf095b
...
@@ -432,18 +432,18 @@ def truck_dispatch_to_redis(truck_id, group_id, excavator_id):
...
@@ -432,18 +432,18 @@ def truck_dispatch_to_redis(truck_id, group_id, excavator_id):
# 其余调度信息写入
# 其余调度信息写入
try
:
try
:
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
#
map_version = session_postgre.query(Distribute_Library).filter_by(Status="1").first().Version
#
load_area_feature_id
=
session_mysql
.
query
(
DiggingWorkArea
)
.
filter_by
(
Id
=
item
.
load_area_id
,
# load_area_feature_id = session_postgre
.query(DiggingWorkArea).filter_by(Id=item.load_area_id,
MapVersion
=
map_version
)
.
first
()
.
FeatureId
#
MapVersion=map_version).first().FeatureId
unload_area_feature_id
=
session_mysql
.
query
(
DumpArea
)
.
filter_by
(
Id
=
item
.
unload_area_id
,
# unload_area_feature_id = session_postgre
.query(DumpArea).filter_by(Id=item.unload_area_id,
MapVersion
=
map_version
)
.
first
()
.
FeatureId
#
MapVersion=map_version).first().FeatureId
# record["dispatchId"] = item.id
# record["dispatchId"] = item.id
record
[
"dispatchId"
]
=
str
(
uuid
.
uuid1
())
record
[
"dispatchId"
]
=
str
(
uuid
.
uuid1
())
record
[
"exactorId"
]
=
item
.
exactor_id
record
[
"exactorId"
]
=
item
.
exactor_id
record
[
"loadAreaId"
]
=
load_area_feature
_id
record
[
"loadAreaId"
]
=
item
.
load_area
_id
record
[
"dumpId"
]
=
item
.
dump_id
record
[
"dumpId"
]
=
item
.
dump_id
record
[
"unloadAreaId"
]
=
unload_area_feature
_id
record
[
"unloadAreaId"
]
=
item
.
unload_area
_id
record
[
"groupId"
]
=
group_id
record
[
"groupId"
]
=
group_id
record
[
"isdeleted"
]
=
False
record
[
"isdeleted"
]
=
False
record
[
"isTemp"
]
=
False
record
[
"isTemp"
]
=
False
...
...
realtime_dispatch_test.py
View file @
58bf095b
...
@@ -36,19 +36,19 @@ def direct2redis():
...
@@ -36,19 +36,19 @@ def direct2redis():
truck_disp
=
{}
truck_disp
=
{}
for
item
in
session_mysql
.
query
(
DispatchSetting
)
.
all
():
for
item
in
session_mysql
.
query
(
DispatchSetting
)
.
all
():
if
item
.
truck_id
not
in
truck_disp
:
if
item
.
truck_id
not
in
truck_disp
:
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
#
map_version = session_postgre.query(Distribute_Library).filter_by(Status="1").first().Version
#
load_area_feature_id
=
session_mysql
.
query
(
DiggingWorkArea
)
.
filter_by
(
Id
=
item
.
load_area_id
,
# load_area_feature_id = session_postgre.query(DiggingWorkArea).filter_by(Feature
Id=item.load_area_id,
MapVersion
=
map_version
)
.
first
()
.
FeatureId
#
MapVersion=map_version).first().FeatureId
unload_area_feature_id
=
session_mysql
.
query
(
DumpArea
)
.
filter_by
(
Id
=
item
.
unload_area_id
,
# unload_area_feature_id = session_postgre.query(DumpArea).filter_by(Feature
Id=item.unload_area_id,
MapVersion
=
map_version
)
.
first
()
.
FeatureId
#
MapVersion=map_version).first().FeatureId
record
=
{
"truckId"
:
item
.
truck_id
}
record
=
{
"truckId"
:
item
.
truck_id
}
record
[
"id"
]
=
item
.
id
record
[
"id"
]
=
item
.
id
record
[
"exactorId"
]
=
item
.
exactor_id
record
[
"exactorId"
]
=
item
.
exactor_id
record
[
"dumpId"
]
=
item
.
dump_id
record
[
"dumpId"
]
=
item
.
dump_id
record
[
"loadAreaId"
]
=
load_area_feature
_id
record
[
"loadAreaId"
]
=
item
.
load_area
_id
record
[
"unloadAreaId"
]
=
unload_area_feature
_id
record
[
"unloadAreaId"
]
=
item
.
unload_area
_id
record
[
"groupId"
]
=
item
.
group_id
record
[
"groupId"
]
=
item
.
group_id
record
[
"isdeleted"
]
=
False
record
[
"isdeleted"
]
=
False
record
[
"isTemp"
]
=
False
record
[
"isTemp"
]
=
False
...
@@ -200,4 +200,4 @@ if __name__ == "__main__":
...
@@ -200,4 +200,4 @@ if __name__ == "__main__":
logger
.
info
(
" "
)
logger
.
info
(
" "
)
logger
.
info
(
"调度系统启动"
)
logger
.
info
(
"调度系统启动"
)
main
(
1
0
,
dispatcher
)
main
(
2
0
,
dispatcher
)
util/area_analysis.py
View file @
58bf095b
...
@@ -194,10 +194,10 @@ def truck_pass_first_area(truck_id, lane_id, closer_entrance_node_id, further_en
...
@@ -194,10 +194,10 @@ def truck_pass_first_area(truck_id, lane_id, closer_entrance_node_id, further_en
# try:
# try:
def
backtracking
(
root_node
):
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
map_version
=
session_postgre
.
query
(
Distribute_Library
)
.
filter_by
(
Status
=
"1"
)
.
first
()
.
Version
def
backtracking
(
root_node
):
from
collections
import
deque
from
collections
import
deque
que
=
deque
([
root_node
])
que
=
deque
([
root_node
])
...
@@ -218,7 +218,7 @@ def truck_pass_first_area(truck_id, lane_id, closer_entrance_node_id, further_en
...
@@ -218,7 +218,7 @@ def truck_pass_first_area(truck_id, lane_id, closer_entrance_node_id, further_en
if
item
:
if
item
:
que
.
append
(
item
.
EndNodeId
)
que
.
append
(
item
.
EndNodeId
)
node_id
=
session_postgre
.
query
(
Lane
)
.
filter_by
(
Id
=
lane_id
)
.
first
()
.
EndNodeId
node_id
=
session_postgre
.
query
(
Lane
)
.
filter_by
(
Id
=
lane_id
,
MapVersion
=
map_version
)
.
first
()
.
EndNodeId
if
backtracking
(
root_node
=
node_id
)
==
0
:
if
backtracking
(
root_node
=
node_id
)
==
0
:
return
True
return
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment