Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c24ffade
authored
Jul 10, 2023
by
张晓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
1 parent
dabaca17
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
project-dispatch/src/main/java/com/dituhui/pea/dispatch/service/impl/BatchServiceImpl.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/service/impl/BatchServiceImpl.java
View file @
c24ffad
...
@@ -94,17 +94,35 @@ public class BatchServiceImpl implements BatchService {
...
@@ -94,17 +94,35 @@ public class BatchServiceImpl implements BatchService {
" order by a.engineer_code asc"
;
" order by a.engineer_code asc"
;
int
engCount
=
jdbcTemplate
.
update
(
sqlEngineer
,
batchNo
,
groupId
);
int
engCount
=
jdbcTemplate
.
update
(
sqlEngineer
,
batchNo
,
groupId
);
// 未派过的工单
String
sqlOrder
=
"INSERT INTO dispatch_order (group_id, batch_no, order_id , x, y, expect_time_begin, expect_time_end, tags, priority , skills , take_time )\n"
+
String
sqlOrder
=
"INSERT INTO dispatch_order (group_id, batch_no, order_id , x, y, expect_time_begin, expect_time_end, tags, priority , skills , take_time )\n"
+
" select a.org_group_id, ? , a.order_id, a.x, a.y , \n"
+
" select a.org_group_id, ? , a.order_id, a.x, a.y , \n"
+
" a.expect_time_begin, a.expect_time_end, a.tags, a.priority , concat(a.brand, a.type, a.skill) skills , b.take_time \n"
+
" a.expect_time_begin, a.expect_time_end, a.tags, a.priority , concat(a.brand, a.type, a.skill) skills , b.take_time \n"
+
" from order_request a left join product_category b on (a.brand=b.brand and a.type=b.type and a.skill=b.skill )\n"
+
" from order_request a left join product_category b on (a.brand=b.brand and a.type=b.type and a.skill=b.skill )\n"
+
" where a.org_group_id=? and status='OPEN' and appointment_status='NOT_ASSIGNED' and appointment_method like 'AUTO%' \n"
+
" where a.org_group_id=? and a.status='OPEN' "
+
" and expect_time_begin between ? and ? \n"
+
" and a.dt = ? "
+
" and appointment_status ='NOT_ASSIGNED' and appointment_method like 'AUTO%' \n"
+
" order by a.expect_time_begin asc "
;
" order by a.expect_time_begin asc "
;
int
orderCount
=
jdbcTemplate
.
update
(
sqlOrder
,
batchNo
,
groupId
,
batchDay
+
" 00:00:00"
,
batchDay
+
" 23:59:59"
);
int
orderCount
=
jdbcTemplate
.
update
(
sqlOrder
,
batchNo
,
groupId
,
batchDay
);
jdbcTemplate
.
update
(
"update dispatch_batch set engineer_num=? , order_num=?, start_time=?, status='RUNNING' where group_id=? and batch_no=?"
,
// 已派过PRE状态还可以再次派
engCount
,
orderCount
,
LocalDateTime
.
now
(),
groupId
,
batchNo
);
String
sqlOrderPre
=
"INSERT INTO dispatch_order (group_id, batch_no, order_id , x, y, expect_time_begin, expect_time_end, tags, priority , skills , take_time )\n"
+
" select a.org_group_id, ?, a.order_id, a.x, a.y , \n"
+
" a.expect_time_begin, a.expect_time_end, a.tags, a.priority , concat(a.brand, a.type, a.skill) skills , b.take_time \n"
+
" from order_request a "
+
" left join product_category b on (a.brand=b.brand and a.type=b.type and a.skill=b.skill )\n"
+
" left join order_appointment o on (a.order_id =o.order_id)\n"
+
" where a.org_group_id=? and a.status='OPEN' \n"
+
" and a.dt = ? "
+
" and a.appointment_status = 'ASSIGNED' and appointment_method like 'AUTO%' \n"
+
" and o.pre_status ='PRE' \n"
+
" order by a.expect_time_begin asc "
;
int
orderCountPre
=
jdbcTemplate
.
update
(
sqlOrderPre
,
batchNo
,
groupId
,
batchDay
);
jdbcTemplate
.
update
(
"update dispatch_batch set engineer_num=? , order_num=?, start_time=?, end_time=null, status='RUNNING' where group_id=? and batch_no=?"
,
engCount
,
orderCount
+
orderCountPre
,
LocalDateTime
.
now
(),
groupId
,
batchNo
);
log
.
info
(
"准备批次数据完成, groupId:{}, day:{}, batchNo:{}"
,
groupId
,
batchDay
,
batchNo
);
log
.
info
(
"准备批次数据完成, groupId:{}, day:{}, batchNo:{}"
,
groupId
,
batchDay
,
batchNo
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment