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 ef68f6f4
authored
Oct 10, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理orderid重复问题
1 parent
7ea6b402
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
project-dispatch/src/main/java/com/dituhui/pea/dispatch/dao/OrderInfoRepository.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/service/impl/BatchServiceImpl.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/dao/OrderInfoRepository.java
View file @
ef68f6f
...
...
@@ -18,5 +18,7 @@ public interface OrderInfoRepository extends CrudRepository<OrderInfo, Long> {
List
<
OrderInfo
>
findByOrderId
(
String
orderId
);
List
<
OrderInfo
>
findByOrgTeamIdAndDt
(
String
teamId
,
LocalDate
dt
);
List
<
OrderInfo
>
findByOrgGroupIdAndDt
(
String
groupId
,
LocalDate
dt
);
}
project-dispatch/src/main/java/com/dituhui/pea/dispatch/service/impl/BatchServiceImpl.java
View file @
ef68f6f
...
...
@@ -86,7 +86,7 @@ public class BatchServiceImpl implements BatchService {
// FIXME 因为系统暂时没有订单,每次固定拉取2023-08-13号订单数据生成新订单
LocalDate
localDt
=
LocalDate
.
parse
(
batchDay
,
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
List
<
OrderInfo
>
orders
=
orderInfoRepository
.
findByOrg
Team
IdAndDt
(
groupId
,
localDt
);
List
<
OrderInfo
>
orders
=
orderInfoRepository
.
findByOrg
Group
IdAndDt
(
groupId
,
localDt
);
if
(
CollectionUtils
.
isEmpty
(
orders
))
{
String
tempDay
=
"2023-08-13"
;
String
createOrder
=
"INSERT INTO order_info (\r\n"
+
" order_id,\r\n"
+
" dt,\r\n"
+
" sub_id,\r\n"
...
...
@@ -102,7 +102,7 @@ public class BatchServiceImpl implements BatchService {
+
" engineer_phone,\r\n"
+
" engineer_code_sub,\r\n"
+
" plan_start_time,\r\n"
+
" plan_end_time,\r\n"
+
" arrive_elapsed,\r\n"
+
" arrive_distance,\r\n"
+
" actual_start_time,\r\n"
+
" actual_end_time,\r\n"
+
" description,\r\n"
+
" extra_info,\r\n"
+
" create_time,\r\n"
+
" update_time\r\n"
+
") \r\n"
+
"SELECT \r\n"
+
" order_id,\r\n"
+
" '"
+
" create_time,\r\n"
+
" update_time\r\n"
+
") \r\n"
+
"SELECT \r\n"
+
"
CONCAT(order_id,'"
+
batchDay
+
"')
order_id,\r\n"
+
" '"
+
batchDay
+
"',\r\n"
+
" sub_id,\r\n"
+
" NAME,\r\n"
+
" phone,\r\n"
+
" province,\r\n"
+
" city,\r\n"
+
" county,\r\n"
+
" address,\r\n"
+
" X,\r\n"
+
" Y,\r\n"
+
" bean_brand,\r\n"
+
" brand,\r\n"
+
" TYPE,\r\n"
+
" skill,\r\n"
+
" take_time,\r\n"
+
" is_workshop,\r\n"
...
...
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