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 0c7e3fcb
authored
Sep 28, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 批量拉取数据调整
1 parent
97ab6586
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 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 @
0c7e3fc
package
com
.
dituhui
.
pea
.
dispatch
.
service
.
impl
;
package
com
.
dituhui
.
pea
.
dispatch
.
service
.
impl
;
import
com.dituhui.pea.dispatch.dao.DispatchBatchRepository
;
import
java.time.LocalDateTime
;
import
com.dituhui.pea.dispatch.entity.DispatchBatch
;
import
java.time.LocalTime
;
import
com.dituhui.pea.dispatch.service.BatchService
;
import
java.time.format.DateTimeFormatter
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.Optional
;
import
javax.persistence.EntityManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.TransactionStatus
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.DefaultTransactionDefinition
;
import
org.springframework.transaction.support.TransactionTemplate
;
import
javax.persistence.EntityManager
;
import
com.dituhui.pea.dispatch.dao.DispatchBatchRepository
;
import
javax.sql.DataSource
;
import
com.dituhui.pea.dispatch.entity.DispatchBatch
;
import
java.sql.Connection
;
import
com.dituhui.pea.dispatch.service.BatchService
;
import
java.sql.SQLException
;
import
java.time.LocalDate
;
import
lombok.extern.slf4j.Slf4j
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
import
java.util.Optional
;
/**
/**
...
@@ -112,7 +105,12 @@ public class BatchServiceImpl implements BatchService {
...
@@ -112,7 +105,12 @@ public class BatchServiceImpl implements BatchService {
" and appointment_method like 'AUTO%' and a.appointment_status in ('INIT', 'PRE')\n"
+
" and appointment_method like 'AUTO%' and a.appointment_status in ('INIT', 'PRE')\n"
+
" and order_status ='NORMAL' and service_status='INIT'\n"
+
" and order_status ='NORMAL' and service_status='INIT'\n"
+
" order by a.expect_time_begin asc "
;
" order by a.expect_time_begin asc "
;
int
orderCount
=
jdbcTemplate
.
update
(
sqlOrder
,
batchNo
,
groupId
,
batchDay
);
String
tempDay
=
"2023-08-13"
;
int
orderCount
=
jdbcTemplate
.
update
(
sqlOrder
,
batchNo
,
groupId
,
/**
* FIXME 因为系统暂时没有订单,每次固定拉取2023-08-13号数据tempDay,上线后改成batchDay
*/
tempDay
);
// confirm的要做预占用,所以也加入进来
// confirm的要做预占用,所以也加入进来
String
sqlOrderConfirm
=
"INSERT INTO dispatch_order (group_id, batch_no, team_id, order_id , dt, x, y, \n"
+
String
sqlOrderConfirm
=
"INSERT INTO dispatch_order (group_id, batch_no, team_id, order_id , dt, x, y, \n"
+
...
@@ -128,7 +126,7 @@ public class BatchServiceImpl implements BatchService {
...
@@ -128,7 +126,7 @@ public class BatchServiceImpl implements BatchService {
" order by a.expect_time_begin asc "
;
" order by a.expect_time_begin asc "
;
int
orderConfirmCount
=
jdbcTemplate
.
update
(
sqlOrderConfirm
,
batchNo
,
groupId
,
batchDay
);
int
orderConfirmCount
=
jdbcTemplate
.
update
(
sqlOrderConfirm
,
batchNo
,
groupId
,
batchDay
);
log
.
info
(
"准备批次数据
orderCount:{}, orderConfirmCount:{}"
,
orderCount
,
orderConfirmCount
);
log
.
info
(
"准备批次数据
engCount:{}, orderCount:{}, orderConfirmCount:{}"
,
engCount
,
orderCount
,
orderConfirmCount
);
if
(
orderCount
+
orderConfirmCount
>
0
)
{
if
(
orderCount
+
orderConfirmCount
>
0
)
{
...
...
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