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
7d2bf082
Commit
7d2bf082
authored
Nov 14, 2022
by
张晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据库迁移优化
parent
c6d18b36
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
21 deletions
+22
-21
config.json
config.json
+7
-6
dispatchInfo.py
data/dispatchInfo.py
+10
-10
static_data_process.py
data/static_data_process.py
+4
-4
excavator.py
equipment/excavator.py
+1
-1
truck.py
equipment/truck.py
+0
-0
No files found.
config.json
View file @
7d2bf082
...
...
@@ -7,16 +7,16 @@
"excavator_target_mass"
:
5000
},
"m
y
sql"
:
{
"host"
:
"192.168.
9.1
52"
,
"port"
:
"
3306
"
,
"user"
:
"
root
"
,
"m
s
sql"
:
{
"host"
:
"192.168.
88.
52"
,
"port"
:
"
1433
"
,
"user"
:
"
sa
"
,
"password"
:
"Huituo@123"
,
"database"
:
"waytous"
},
"postgresql"
:
{
"host"
:
"192.168.9.1
52
"
,
"host"
:
"192.168.9.1
97
"
,
"port"
:
"5432"
,
"user"
:
"postgres"
,
"password"
:
"Huituo@123"
,
...
...
@@ -24,7 +24,7 @@
},
"redis"
:
{
"host"
:
"192.168.9.1
52
"
,
"host"
:
"192.168.9.1
97
"
,
"password"
:
"Huituo@123"
}
}
\ No newline at end of file
data/dispatchInfo.py
View file @
7d2bf082
...
...
@@ -323,7 +323,7 @@ class DispatchInfo:
cls
.
load_area_uuid_to_index_dict
=
{}
cls
.
unload_area_uuid_to_index_dict
=
{}
#
try:
try
:
groups
=
cls
.
group_excavator_dict
.
keys
()
for
item
in
groups
:
try
:
...
...
@@ -388,6 +388,12 @@ class DispatchInfo:
if
unload_area_id
not
in
group_unload_area_uuid_to_index
:
group_unload_area_uuid_to_index
[
unload_area_id
]
=
group_unload_area_count
group_dump_count
+=
1
group_unload_area_count
+=
1
group_excavator_count
+=
1
group_load_area_count
+=
1
group_excavator_uuid_to_index
=
bidict
(
group_excavator_uuid_to_index
)
group_dump_uuid_to_index
=
bidict
(
group_dump_uuid_to_index
)
group_load_area_uuid_to_index
=
bidict
(
group_load_area_uuid_to_index
)
...
...
@@ -398,12 +404,6 @@ class DispatchInfo:
cls
.
load_area_uuid_to_index_dict
[
item
]
=
group_load_area_uuid_to_index
cls
.
unload_area_uuid_to_index_dict
[
item
]
=
group_unload_area_uuid_to_index
group_dump_count
+=
1
group_unload_area_count
+=
1
group_excavator_count
+=
1
group_load_area_count
+=
1
cls
.
load_distance
[
item
]
=
unload_load_distance
except
Exception
as
es
:
...
...
@@ -430,9 +430,9 @@ class DispatchInfo:
session_postgre
.
rollback
()
session_mysql
.
rollback
()
#
except Exception as es:
#
logger.error("路网距离更新异常-调度部分和路网部分不一致")
#
logger.error(es)
except
Exception
as
es
:
logger
.
error
(
"路网距离更新异常-调度部分和路网部分不一致"
)
logger
.
error
(
es
)
# @classmethod
# def update_device_dict(cls):
...
...
data/static_data_process.py
View file @
7d2bf082
...
...
@@ -86,7 +86,7 @@ def build_truck_uuid_name_map():
try
:
for
item
in
session_mysql
.
query
(
Equipment
)
.
filter_by
(
EQUIPMENT_TYPE_ID
=
1
)
.
all
():
truck_id
=
item
.
EQUIPMENT_ID
truck_id
=
str
(
item
.
EQUIPMENT_ID
)
truck_name
=
item
.
EQUIPMENT_NAME
.
encode
(
"latin-1"
)
.
decode
(
"GBK"
,
"ignore"
)
truck_name_to_uuid_dict
[
truck_name
]
=
truck_id
...
...
@@ -108,7 +108,7 @@ def build_equipment_uuid_name_map():
try
:
for
item
in
session_mysql
.
query
(
Equipment
)
.
filter_by
(
EQUIPMENT_TYPE_ID
=
2
)
.
all
():
truck_id
=
item
.
EQUIPMENT_ID
truck_id
=
str
(
item
.
EQUIPMENT_ID
)
truck_name
=
item
.
EQUIPMENT_NAME
excavator_uuid_to_name_dict
[
truck_id
]
=
truck_name
...
...
@@ -122,7 +122,7 @@ def build_equipment_uuid_name_map():
try
:
for
item
in
session_mysql
.
query
(
Equipment
)
.
filter_by
(
EQUIPMENT_TYPE_ID
=
3
)
.
all
():
truck_id
=
item
.
EQUIPMENT_ID
truck_id
=
str
(
item
.
EQUIPMENT_ID
)
truck_name
=
item
.
EQUIPMENT_NAME
dump_uuid_to_name_dict
[
truck_id
]
=
truck_name
...
...
@@ -245,7 +245,7 @@ def update_total_truck():
# if is_online:
# truck_list.append(item.id)
for
item
in
query
:
truck_list
.
append
(
item
.
EQUIPMENT_ID
)
truck_list
.
append
(
str
(
item
.
EQUIPMENT_ID
)
)
if
len
(
truck_list
)
<
1
:
raise
Exception
(
"无矿卡设备可用-矿卡集合读取异常"
)
...
...
equipment/excavator.py
View file @
7d2bf082
...
...
@@ -185,7 +185,7 @@ class ExcavatorInfo(WalkManage):
try
:
load_ability
=
session_mysql
.
query
(
EquipmentSpec
.
MINING_ABILILTY
)
.
\
join
(
Equipment
,
Equipment
.
EQUIPMENT_MODEL_ID
==
EquipmentSpec
.
EQUIPMENT_MODEL_ID
)
.
\
filter
(
Equipment
.
EQUIPMENT_ID
==
self
.
excavator_index_to_uuid_dict
[
excavator_index
]
)
.
first
()
filter
(
Equipment
.
EQUIPMENT_ID
==
int
(
self
.
excavator_index_to_uuid_dict
[
excavator_index
])
)
.
first
()
self
.
excavator_strength
[
excavator_index
]
=
load_ability
.
MINING_ABILILTY
# if load_ability.mining_abililty < 200:
...
...
equipment/truck.py
View file @
7d2bf082
This diff is collapsed.
Click to expand it.
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