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
Show 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 {
...
@@ -14,11 +14,12 @@ public class DispatchController {
private
DispatchService
dispatchService
;
private
DispatchService
dispatchService
;
@GetMapping
(
"/dispatch/order/list"
)
@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
;
Result
<?>
res
=
null
;
try
{
try
{
res
=
dispatchService
.
getDispatchOrderList
(
date
,
group
Id
);
res
=
dispatchService
.
getDispatchOrderList
(
levelType
,
levelIds
,
date
,
groupTag
Id
);
}
catch
(
BusinessException
e
)
{
}
catch
(
BusinessException
e
)
{
Result
.
failed
(
e
.
getMessage
());
Result
.
failed
(
e
.
getMessage
());
}
}
...
@@ -26,11 +27,11 @@ public class DispatchController {
...
@@ -26,11 +27,11 @@ public class DispatchController {
}
}
@GetMapping
(
"/dispatch/engineer/order/list"
)
@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
;
Result
<?>
res
=
null
;
try
{
try
{
res
=
dispatchService
.
getDispatchEngineerOrderList
(
date
);
res
=
dispatchService
.
getDispatchEngineerOrderList
(
levelType
,
levelIds
,
date
);
}
catch
(
BusinessException
e
)
{
}
catch
(
BusinessException
e
)
{
Result
.
failed
(
e
.
getMessage
());
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
;
package
com
.
alibaba
.
cloud
.
integration
.
order
.
controller
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.order.dto.EnginnerTimelineReq
;
import
com.alibaba.cloud.integration.order.service.EngineerTimelineService
;
import
com.alibaba.cloud.integration.order.service.EnginnerTimelineService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -12,13 +11,13 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -12,13 +11,13 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RestController
@RequestMapping
(
"/pea-order"
)
@RequestMapping
(
"/pea-order"
)
public
class
Engin
n
erTimelineController
{
public
class
Engin
e
erTimelineController
{
@Autowired
@Autowired
private
Engin
nerTimelineService
enginn
erTimelineService
;
private
Engin
eerTimelineService
engine
erTimelineService
;
@GetMapping
(
"/engin
n
er/work/trace"
)
@GetMapping
(
"/engin
e
er/work/trace"
)
public
Result
<?>
GetEngin
nerTimeline
(
@RequestParam
EnginnerTimelineReq
req
)
{
public
Result
<?>
GetEngin
eerTimeline
(
@RequestParam
String
engineerCode
,
String
date
)
{
return
engin
nerTimelineService
.
GetEnginnerTimelines
(
req
.
getEnginnerCode
(),
req
.
getDate
()
);
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;
...
@@ -5,7 +5,7 @@ import org.springframework.web.bind.annotation.RequestParam;
public
interface
DispatchService
{
public
interface
DispatchService
{
Result
<?>
getDispatchOrderList
(
String
date
,
String
group
Id
);
Result
<?>
getDispatchOrderList
(
String
levelType
,
String
levelIds
,
String
date
,
String
groupTag
Id
);
Result
<?>
getDispatchEngineerOrderList
(
String
date
);
Result
<?>
getDispatchEngineerOrderList
(
String
levelType
,
String
levelIds
,
String
date
);
Result
<?>
dispatchOrderConfirm
(
String
orderId
,
String
engineerCode
);
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;
...
@@ -2,6 +2,6 @@ package com.alibaba.cloud.integration.order.service;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.common.Result
;
public
interface
Engin
n
erTimelineService
{
public
interface
Engin
e
erTimelineService
{
Result
<?>
GetEnginn
erTimelines
(
String
engineerCode
,
String
date
);
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;
...
@@ -7,12 +7,12 @@ import org.springframework.stereotype.Service;
@Service
@Service
public
class
DispatchServiceImpl
implements
DispatchService
{
public
class
DispatchServiceImpl
implements
DispatchService
{
@Override
@Override
public
Result
<?>
getDispatchOrderList
(
String
date
,
String
groupId
)
{
public
Result
<?>
getDispatchOrderList
(
String
levelType
,
String
levelIds
,
String
date
,
String
groupId
)
{
return
null
;
return
null
;
}
}
@Override
@Override
public
Result
<?>
getDispatchEngineerOrderList
(
String
date
)
{
public
Result
<?>
getDispatchEngineerOrderList
(
String
levelType
,
String
levelIds
,
String
date
)
{
return
null
;
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;
...
@@ -4,7 +4,7 @@ import com.alibaba.cloud.integration.common.Result;
import
com.alibaba.cloud.integration.order.dao.*
;
import
com.alibaba.cloud.integration.order.dao.*
;
import
com.alibaba.cloud.integration.order.dto.EnginnerTimelineResp
;
import
com.alibaba.cloud.integration.order.dto.EnginnerTimelineResp
;
import
com.alibaba.cloud.integration.order.entity.*
;
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
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -18,7 +18,7 @@ import java.util.stream.Stream;
...
@@ -18,7 +18,7 @@ import java.util.stream.Stream;
@Service
@Service
public
class
Engin
nerTimelineServiceImpl
implements
Enginn
erTimelineService
{
public
class
Engin
eerTimelineServiceImpl
implements
Engine
erTimelineService
{
@Autowired
@Autowired
private
EngineerTimelineMPDao
engineerTimelineMPDao
;
private
EngineerTimelineMPDao
engineerTimelineMPDao
;
...
@@ -40,27 +40,27 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
...
@@ -40,27 +40,27 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
@Transactional
@Transactional
@Override
@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数据
// 获取工程师已完成的timeline数据
List
<
EngineerTimeline
>
timelines
=
this
.
Enginn
erTimelines
(
engineerCode
,
date
);
List
<
EngineerTimeline
>
timelines
=
this
.
engine
erTimelines
(
engineerCode
,
date
);
// 获取工程师date日的订单数据
// 获取工程师date日的订单数据
List
<
OrderAppointment
>
orders
=
this
.
O
rderAppointments
(
engineerCode
,
date
);
List
<
OrderAppointment
>
orders
=
this
.
o
rderAppointments
(
engineerCode
,
date
);
// 获取客户地址
// 获取客户地址
List
<
String
>
orderIds
=
new
ArrayList
<>();
List
<
String
>
orderIds
=
new
ArrayList
<>();
for
(
OrderAppointment
o:
orders
)
{
for
(
OrderAppointment
o:
orders
)
{
orderIds
.
add
(
o
.
getOrderId
());
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
branchId
=
this
.
getEngineerBranchId
(
engineerCode
);
String
warehouseLocation
=
this
.
getWarehouseLocation
(
branchId
);
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
();
EnginnerTimelineResp
res
=
new
EnginnerTimelineResp
();
res
.
setEngineerCode
(
engineerCode
);
res
.
setEngineerCode
(
engineerCode
);
...
@@ -69,14 +69,14 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
...
@@ -69,14 +69,14 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
return
Result
.
success
(
res
);
return
Result
.
success
(
res
);
}
}
private
String
GetEnginnerName
(
String
enginer
rCode
){
private
String
getEngineerName
(
String
enginee
rCode
){
LambdaQueryWrapper
<
EngineerInfo
>
lqw
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
EngineerInfo
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
eq
(
EngineerInfo:
:
getEngineerCode
,
engine
r
rCode
);
lqw
.
eq
(
EngineerInfo:
:
getEngineerCode
,
engine
e
rCode
);
EngineerInfo
e
=
engineerInfoMPDao
.
selectOne
(
lqw
);
EngineerInfo
e
=
engineerInfoMPDao
.
selectOne
(
lqw
);
return
e
.
getName
();
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
<>();
LambdaQueryWrapper
<
OrderAppointment
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
eq
(
OrderAppointment:
:
getEngineerCode
,
engineerCode
);
lqw
.
eq
(
OrderAppointment:
:
getEngineerCode
,
engineerCode
);
...
@@ -85,7 +85,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
...
@@ -85,7 +85,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
return
orderAppointmentMPDao
.
selectList
(
lqw
);
return
orderAppointmentMPDao
.
selectList
(
lqw
);
}
}
private
List
<
EngineerTimeline
>
Enginn
erTimelines
(
String
engineerCode
,
String
date
){
private
List
<
EngineerTimeline
>
engine
erTimelines
(
String
engineerCode
,
String
date
){
// 获取工程师timeline
// 获取工程师timeline
List
<
String
>
events
=
Stream
.
of
(
"分站取还配件"
,
"已出发"
,
"加单"
).
collect
(
Collectors
.
toList
());
List
<
String
>
events
=
Stream
.
of
(
"分站取还配件"
,
"已出发"
,
"加单"
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
EngineerTimeline
>
lqw
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
EngineerTimeline
>
lqw
=
new
LambdaQueryWrapper
<>();
...
@@ -96,7 +96,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
...
@@ -96,7 +96,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
return
engineerTimelineMPDao
.
selectList
(
lqw
);
return
engineerTimelineMPDao
.
selectList
(
lqw
);
}
}
private
HashMap
<
String
,
String
>
O
rderRequestsLocation
(
List
<
String
>
orderIds
)
{
private
HashMap
<
String
,
String
>
o
rderRequestsLocation
(
List
<
String
>
orderIds
)
{
// 获取客户地址location
// 获取客户地址location
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
...
@@ -134,9 +134,9 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
...
@@ -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
;
String
order_id
,
title
,
type
,
text
,
location
;
List
<
EnginnerTimelineResp
.
DynamicItem
>
items
=
new
ArrayList
<>();
List
<
EnginnerTimelineResp
.
DynamicItem
>
items
=
new
ArrayList
<>();
...
@@ -144,12 +144,12 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
...
@@ -144,12 +144,12 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
for
(
EngineerTimeline
t:
timelines
){
for
(
EngineerTimeline
t:
timelines
){
EnginnerTimelineResp
.
DynamicItem
item
=
new
EnginnerTimelineResp
.
DynamicItem
();
EnginnerTimelineResp
.
DynamicItem
item
=
new
EnginnerTimelineResp
.
DynamicItem
();
if
(
t
.
getEvent
()
==
"分站取还配件"
)
{
if
(
t
.
getEvent
()
.
equals
(
"分站取还配件"
)
)
{
title
=
t
.
getEvent
();
title
=
t
.
getEvent
();
text
=
"取"
;
text
=
"取"
;
type
=
"other"
;
type
=
"other"
;
location
=
warehouseLocation
;
location
=
warehouseLocation
;
}
else
if
(
t
.
getEvent
()
==
"加单"
)
{
}
else
if
(
t
.
getEvent
()
.
equals
(
"加单"
)
)
{
title
=
t
.
getEvent
();
title
=
t
.
getEvent
();
text
=
"加"
;
text
=
"加"
;
type
=
"other"
;
type
=
"other"
;
...
@@ -175,7 +175,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
...
@@ -175,7 +175,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
for
(
OrderAppointment
o:
orders
){
for
(
OrderAppointment
o:
orders
){
order_id
=
o
.
getOrderId
()
+
o
.
getSuborderId
();
order_id
=
o
.
getOrderId
()
+
o
.
getSuborderId
();
if
(
s
.
equal
s
(
order_id
))
{
if
(
s
.
contain
s
(
order_id
))
{
continue
;
continue
;
}
}
index
+=
1
;
index
+=
1
;
...
@@ -189,12 +189,11 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
...
@@ -189,12 +189,11 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
items
.
add
(
item
);
items
.
add
(
item
);
}
}
// 根据items的time升序排序
// 根据items的time升序排序
items
.
stream
().
sorted
(
Comparator
.
comparing
(
EnginnerTimelineResp
.
DynamicItem
::
getTime
)).
collect
(
Collectors
.
toList
());
return
items
.
stream
().
sorted
(
Comparator
.
comparing
(
EnginnerTimelineResp
.
DynamicItem
::
getTime
)).
collect
(
Collectors
.
toList
());
return
items
;
}
}
private
String
Timestamp2Datetime
(
Timestamp
t
)
{
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
());
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