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 e2ca3576
authored
Jun 08, 2023
by
wangli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重命名
1 parent
b9067e24
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
38 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/DispatchController.java
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/EnginnerTimelineController.java → project-order/src/main/java/com/alibaba/cloud/integration/order/controller/EngineerTimelineController.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/DispatchService.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/EnginnerTimelineService.java → project-order/src/main/java/com/alibaba/cloud/integration/order/service/EngineerTimelineService.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/DispatchServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/EnginnerTimelineServiceImpl.java → project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/EngineerTimelineServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/DispatchController.java
View file @
e2ca357
...
...
@@ -14,11 +14,12 @@ public class DispatchController {
private
DispatchService
dispatchService
;
@GetMapping
(
"/dispatch/order/list"
)
public
Result
<?>
getDispatchOrderList
(
@RequestParam
String
date
,
@RequestParam
String
groupId
)
{
public
Result
<?>
getDispatchOrderList
(
@RequestParam
String
levelType
,
@RequestParam
(
"levelId"
)
String
levelIds
,
@RequestParam
String
date
,
@RequestParam
String
groupTagId
)
{
// 获取派工台待派订单列表
Result
<?>
res
=
null
;
try
{
res
=
dispatchService
.
getDispatchOrderList
(
date
,
group
Id
);
res
=
dispatchService
.
getDispatchOrderList
(
levelType
,
levelIds
,
date
,
groupTag
Id
);
}
catch
(
BusinessException
e
)
{
Result
.
failed
(
e
.
getMessage
());
}
...
...
@@ -26,11 +27,11 @@ public class DispatchController {
}
@GetMapping
(
"/dispatch/engineer/order/list"
)
public
Result
<?>
getDispatchEngineerOrderList
(
@RequestParam
String
date
)
{
public
Result
<?>
getDispatchEngineerOrderList
(
@RequestParam
String
levelType
,
@RequestParam
(
"levelId"
)
String
levelIds
,
@RequestParam
String
date
)
{
// 获取派工台工程师已派订单列表
Result
<?>
res
=
null
;
try
{
res
=
dispatchService
.
getDispatchEngineerOrderList
(
date
);
res
=
dispatchService
.
getDispatchEngineerOrderList
(
levelType
,
levelIds
,
date
);
}
catch
(
BusinessException
e
)
{
Result
.
failed
(
e
.
getMessage
());
}
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/Engin
n
erTimelineController.java
→
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/Engin
e
erTimelineController.java
View file @
e2ca357
package
com
.
alibaba
.
cloud
.
integration
.
order
.
controller
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.order.dto.EnginnerTimelineReq
;
import
com.alibaba.cloud.integration.order.service.EnginnerTimelineService
;
import
com.alibaba.cloud.integration.order.service.EngineerTimelineService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -12,13 +11,13 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping
(
"/pea-order"
)
public
class
Engin
n
erTimelineController
{
public
class
Engin
e
erTimelineController
{
@Autowired
private
Engin
nerTimelineService
enginn
erTimelineService
;
private
Engin
eerTimelineService
engine
erTimelineService
;
@GetMapping
(
"/engin
n
er/work/trace"
)
public
Result
<?>
GetEngin
nerTimeline
(
@RequestParam
EnginnerTimelineReq
req
)
{
return
engin
nerTimelineService
.
GetEnginnerTimelines
(
req
.
getEnginnerCode
(),
req
.
getDate
()
);
@GetMapping
(
"/engin
e
er/work/trace"
)
public
Result
<?>
GetEngin
eerTimeline
(
@RequestParam
String
engineerCode
,
String
date
)
{
return
engin
eerTimelineService
.
getEngineerTimelines
(
engineerCode
,
date
);
}
}
project-order/src/main/java/com/alibaba/cloud/integration/order/service/DispatchService.java
View file @
e2ca357
...
...
@@ -5,7 +5,7 @@ import org.springframework.web.bind.annotation.RequestParam;
public
interface
DispatchService
{
Result
<?>
getDispatchOrderList
(
String
date
,
String
group
Id
);
Result
<?>
getDispatchEngineerOrderList
(
String
date
);
Result
<?>
getDispatchOrderList
(
String
levelType
,
String
levelIds
,
String
date
,
String
groupTag
Id
);
Result
<?>
getDispatchEngineerOrderList
(
String
levelType
,
String
levelIds
,
String
date
);
Result
<?>
dispatchOrderConfirm
(
String
orderId
,
String
engineerCode
);
}
project-order/src/main/java/com/alibaba/cloud/integration/order/service/Engin
n
erTimelineService.java
→
project-order/src/main/java/com/alibaba/cloud/integration/order/service/Engin
e
erTimelineService.java
View file @
e2ca357
...
...
@@ -2,6 +2,6 @@ package com.alibaba.cloud.integration.order.service;
import
com.alibaba.cloud.integration.common.Result
;
public
interface
Engin
n
erTimelineService
{
Result
<?>
GetEnginn
erTimelines
(
String
engineerCode
,
String
date
);
public
interface
Engin
e
erTimelineService
{
Result
<?>
getEngine
erTimelines
(
String
engineerCode
,
String
date
);
}
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/DispatchServiceImpl.java
View file @
e2ca357
...
...
@@ -7,12 +7,12 @@ import org.springframework.stereotype.Service;
@Service
public
class
DispatchServiceImpl
implements
DispatchService
{
@Override
public
Result
<?>
getDispatchOrderList
(
String
date
,
String
groupId
)
{
public
Result
<?>
getDispatchOrderList
(
String
levelType
,
String
levelIds
,
String
date
,
String
groupId
)
{
return
null
;
}
@Override
public
Result
<?>
getDispatchEngineerOrderList
(
String
date
)
{
public
Result
<?>
getDispatchEngineerOrderList
(
String
levelType
,
String
levelIds
,
String
date
)
{
return
null
;
}
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/Engin
n
erTimelineServiceImpl.java
→
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/Engin
e
erTimelineServiceImpl.java
View file @
e2ca357
...
...
@@ -4,7 +4,7 @@ import com.alibaba.cloud.integration.common.Result;
import
com.alibaba.cloud.integration.order.dao.*
;
import
com.alibaba.cloud.integration.order.dto.EnginnerTimelineResp
;
import
com.alibaba.cloud.integration.order.entity.*
;
import
com.alibaba.cloud.integration.order.service.Engin
n
erTimelineService
;
import
com.alibaba.cloud.integration.order.service.Engin
e
erTimelineService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -18,7 +18,7 @@ import java.util.stream.Stream;
@Service
public
class
Engin
nerTimelineServiceImpl
implements
Enginn
erTimelineService
{
public
class
Engin
eerTimelineServiceImpl
implements
Engine
erTimelineService
{
@Autowired
private
EngineerTimelineMPDao
engineerTimelineMPDao
;
...
...
@@ -40,27 +40,27 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
@Transactional
@Override
public
Result
<?>
GetEnginn
erTimelines
(
String
engineerCode
,
String
date
){
public
Result
<?>
getEngine
erTimelines
(
String
engineerCode
,
String
date
){
// 工程师姓名
String
name
=
this
.
GetEnginn
erName
(
engineerCode
);
String
name
=
this
.
getEngine
erName
(
engineerCode
);
// 获取工程师已完成的timeline数据
List
<
EngineerTimeline
>
timelines
=
this
.
Enginn
erTimelines
(
engineerCode
,
date
);
List
<
EngineerTimeline
>
timelines
=
this
.
engine
erTimelines
(
engineerCode
,
date
);
// 获取工程师date日的订单数据
List
<
OrderAppointment
>
orders
=
this
.
O
rderAppointments
(
engineerCode
,
date
);
List
<
OrderAppointment
>
orders
=
this
.
o
rderAppointments
(
engineerCode
,
date
);
// 获取客户地址
List
<
String
>
orderIds
=
new
ArrayList
<>();
for
(
OrderAppointment
o:
orders
)
{
orderIds
.
add
(
o
.
getOrderId
());
}
HashMap
<
String
,
String
>
orderLocations
=
this
.
O
rderRequestsLocation
(
orderIds
);
HashMap
<
String
,
String
>
orderLocations
=
this
.
o
rderRequestsLocation
(
orderIds
);
// 获取配送站地址
String
branchId
=
this
.
getEngineerBranchId
(
engineerCode
);
String
warehouseLocation
=
this
.
getWarehouseLocation
(
branchId
);
List
<
EnginnerTimelineResp
.
DynamicItem
>
dynamics
=
this
.
P
ackItems
(
timelines
,
orders
,
orderLocations
,
warehouseLocation
);
List
<
EnginnerTimelineResp
.
DynamicItem
>
dynamics
=
this
.
p
ackItems
(
timelines
,
orders
,
orderLocations
,
warehouseLocation
);
EnginnerTimelineResp
res
=
new
EnginnerTimelineResp
();
res
.
setEngineerCode
(
engineerCode
);
...
...
@@ -69,14 +69,14 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
return
Result
.
success
(
res
);
}
private
String
GetEnginnerName
(
String
enginer
rCode
){
private
String
getEngineerName
(
String
enginee
rCode
){
LambdaQueryWrapper
<
EngineerInfo
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
eq
(
EngineerInfo:
:
getEngineerCode
,
engine
r
rCode
);
lqw
.
eq
(
EngineerInfo:
:
getEngineerCode
,
engine
e
rCode
);
EngineerInfo
e
=
engineerInfoMPDao
.
selectOne
(
lqw
);
return
e
.
getName
();
}
private
List
<
OrderAppointment
>
O
rderAppointments
(
String
engineerCode
,
String
date
){
private
List
<
OrderAppointment
>
o
rderAppointments
(
String
engineerCode
,
String
date
){
// 获取指派单列表
LambdaQueryWrapper
<
OrderAppointment
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
eq
(
OrderAppointment:
:
getEngineerCode
,
engineerCode
);
...
...
@@ -85,7 +85,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
return
orderAppointmentMPDao
.
selectList
(
lqw
);
}
private
List
<
EngineerTimeline
>
Enginn
erTimelines
(
String
engineerCode
,
String
date
){
private
List
<
EngineerTimeline
>
engine
erTimelines
(
String
engineerCode
,
String
date
){
// 获取工程师timeline
List
<
String
>
events
=
Stream
.
of
(
"分站取还配件"
,
"已出发"
,
"加单"
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
EngineerTimeline
>
lqw
=
new
LambdaQueryWrapper
<>();
...
...
@@ -96,7 +96,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
return
engineerTimelineMPDao
.
selectList
(
lqw
);
}
private
HashMap
<
String
,
String
>
O
rderRequestsLocation
(
List
<
String
>
orderIds
)
{
private
HashMap
<
String
,
String
>
o
rderRequestsLocation
(
List
<
String
>
orderIds
)
{
// 获取客户地址location
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
...
...
@@ -134,9 +134,9 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
}
private
List
<
EnginnerTimelineResp
.
DynamicItem
>
P
ackItems
(
List
<
EngineerTimeline
>
timelines
,
List
<
OrderAppointment
>
orders
,
HashMap
<
String
,
String
>
locations
,
String
warehouseLocation
)
{
private
List
<
EnginnerTimelineResp
.
DynamicItem
>
p
ackItems
(
List
<
EngineerTimeline
>
timelines
,
List
<
OrderAppointment
>
orders
,
HashMap
<
String
,
String
>
locations
,
String
warehouseLocation
)
{
Integer
index
=
1
;
int
index
=
1
;
String
order_id
,
title
,
type
,
text
,
location
;
List
<
EnginnerTimelineResp
.
DynamicItem
>
items
=
new
ArrayList
<>();
...
...
@@ -144,12 +144,12 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
for
(
EngineerTimeline
t:
timelines
){
EnginnerTimelineResp
.
DynamicItem
item
=
new
EnginnerTimelineResp
.
DynamicItem
();
if
(
t
.
getEvent
()
==
"分站取还配件"
)
{
if
(
t
.
getEvent
()
.
equals
(
"分站取还配件"
)
)
{
title
=
t
.
getEvent
();
text
=
"取"
;
type
=
"other"
;
location
=
warehouseLocation
;
}
else
if
(
t
.
getEvent
()
==
"加单"
)
{
}
else
if
(
t
.
getEvent
()
.
equals
(
"加单"
)
)
{
title
=
t
.
getEvent
();
text
=
"加"
;
type
=
"other"
;
...
...
@@ -175,7 +175,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
for
(
OrderAppointment
o:
orders
){
order_id
=
o
.
getOrderId
()
+
o
.
getSuborderId
();
if
(
s
.
equal
s
(
order_id
))
{
if
(
s
.
contain
s
(
order_id
))
{
continue
;
}
index
+=
1
;
...
...
@@ -189,12 +189,11 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
items
.
add
(
item
);
}
// 根据items的time升序排序
items
.
stream
().
sorted
(
Comparator
.
comparing
(
EnginnerTimelineResp
.
DynamicItem
::
getTime
)).
collect
(
Collectors
.
toList
());
return
items
;
return
items
.
stream
().
sorted
(
Comparator
.
comparing
(
EnginnerTimelineResp
.
DynamicItem
::
getTime
)).
collect
(
Collectors
.
toList
());
}
private
String
Timestamp2Datetime
(
Timestamp
t
)
{
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-
mm-dd HH:MM:SS
"
);
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-
MM-dd HH:mm:ss
"
);
return
df
.
format
(
t
.
toLocalDateTime
());
}
}
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