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
b6382451
Commit
b6382451
authored
Jul 22, 2022
by
张晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定铲派车写入分离
parent
50748bf6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
dispatcher.py
core/dispatcher.py
+35
-0
No files found.
core/dispatcher.py
View file @
b6382451
...
...
@@ -16,6 +16,7 @@ from equipment import TruckInfo, ExcavatorInfo, DumpInfo
from
core.schedule
import
PreSchedule
import
json
import
uuid
from
tables
import
session_mysql
,
session_postgre
import
numpy
as
np
from
datetime
import
datetime
,
timedelta
...
...
@@ -115,10 +116,44 @@ class DispatchSubmission:
record
=
{
"truckId"
:
truck_id
}
task
=
self
.
truck
.
get_truck_current_task
()[
truck_id
]
except
Exception
as
es
:
self
.
logger
.
error
(
"调度结果写入异常-读取矿卡信息异常(uuid, group id, task)"
)
self
.
logger
.
error
(
es
)
try
:
group_mode
=
DispatchInfo
.
get_group_mode
(
group_id
)
except
Exception
as
es
:
self
.
logger
.
error
(
"调度模式读取异常"
)
self
.
logger
.
error
(
es
)
group_mode
=
3
if
group_mode
==
3
:
try
:
item
=
session_mysql
.
query
(
DispatchSetting
)
.
filter_by
(
truck_id
=
truck_id
,
isdeleted
=
0
,
)
.
first
()
record
[
"dispatchId"
]
=
item
.
id
record
[
"exactorId"
]
=
item
.
exactor_id
record
[
"dumpId"
]
=
item
.
dump_id
record
[
"loadAreaId"
]
=
item
.
load_area_id
record
[
"unloadAreaId"
]
=
item
.
unload_area_id
record
[
"groupId"
]
=
item
.
group_id
record
[
"isdeleted"
]
=
False
record
[
"isTemp"
]
=
False
record
[
"haulFlag"
]
=
-
1
record
[
"groupName"
]
=
DispatchInfo
.
group_name
[
group_id
]
self
.
logger
.
info
(
"调度结果"
)
self
.
logger
.
info
(
record
)
except
Exception
as
es
:
self
.
logger
.
error
(
es
)
session_postgre
.
rollback
()
session_mysql
.
rollback
()
finally
:
redis5
.
set
(
truck_id
,
str
(
json
.
dumps
(
record
)))
else
:
if
task
in
[
0
,
1
,
2
]:
# 卡车空载或在装载区出场前, 可变更卸载目的地
# 查询车辆相关派车计划
...
...
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