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 398ccd2c
authored
Jun 15, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-dingwf-mvp616' into develop
2 parents
5a02b1a8
82ca7f40
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
39 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/WorkbenchController.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/CapacityOrderQueryReqDTO.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/CapacityQueryOrderRespDTO.java → project-order/src/main/java/com/alibaba/cloud/integration/order/dto/CapacityOrderQueryRespDTO.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/CapacityStatQueryReqDTO.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/WorkbenchEngineersGanttReqDTO.java → project-order/src/main/java/com/alibaba/cloud/integration/order/dto/EngineersGanttReqDTO.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/WorkbenchEngineersGanttRespDTO.java → project-order/src/main/java/com/alibaba/cloud/integration/order/dto/EngineersGanttRespDTO.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/WorkbenchService.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/CapacityQueryServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/WorkbenchServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/WorkbenchController.java
View file @
398ccd2
...
...
@@ -2,7 +2,7 @@ package com.alibaba.cloud.integration.order.controller;
import
com.alibaba.cloud.integration.common.BusinessException
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.order.dto.
Workbench
EngineersGanttReqDTO
;
import
com.alibaba.cloud.integration.order.dto.EngineersGanttReqDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListReqDTO
;
import
com.alibaba.cloud.integration.order.service.WorkbenchService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -30,7 +30,7 @@ public class WorkbenchController {
}
@GetMapping
(
"/engineer/schedule/gantt"
)
public
Result
<?>
getEngineersGanttList
(
@Validated
Workbench
EngineersGanttReqDTO
reqDTO
)
{
public
Result
<?>
getEngineersGanttList
(
@Validated
EngineersGanttReqDTO
reqDTO
)
{
// todo 待移到 controller的engineer中
log
.
info
(
"getEngineersGanttList: {}"
,
reqDTO
);
Result
<?>
res
=
null
;
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/CapacityOrderQueryReqDTO.java
View file @
398ccd2
...
...
@@ -17,8 +17,8 @@ public class CapacityOrderQueryReqDTO {
private
String
type
;
@NotNull
(
message
=
"skill不能为空"
)
private
String
skill
;
@NotNull
(
message
=
"
begin
Date不能为空"
)
private
String
begin
Date
;
@NotNull
(
message
=
"
start
Date不能为空"
)
private
String
start
Date
;
@NotNull
(
message
=
"endDate不能为空"
)
private
String
endDate
;
}
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/Capacity
QueryOrder
RespDTO.java
→
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/Capacity
OrderQuery
RespDTO.java
View file @
398ccd2
...
...
@@ -7,8 +7,8 @@ import java.util.List;
@Data
@Accessors
(
chain
=
true
)
public
class
Capacity
QueryOrder
RespDTO
{
private
String
begin
Date
;
public
class
Capacity
OrderQuery
RespDTO
{
private
String
start
Date
;
private
String
endDate
;
private
String
remark
;
private
List
<
LegendDTO
>
legend
;
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/CapacityStatQueryReqDTO.java
View file @
398ccd2
...
...
@@ -3,7 +3,7 @@ package com.alibaba.cloud.integration.order.dto;
@lombok
.
Data
public
class
CapacityStatQueryReqDTO
{
private
String
begin
Date
;
private
String
start
Date
;
private
String
endDate
;
/**
* cluster/branch/group
...
...
@@ -14,5 +14,5 @@ public class CapacityStatQueryReqDTO {
*/
private
String
levelValue
;
private
Integer
page
;
private
Integer
pageS
ize
;
private
Integer
s
ize
;
}
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/
Workbench
EngineersGanttReqDTO.java
→
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/EngineersGanttReqDTO.java
View file @
398ccd2
...
...
@@ -4,7 +4,7 @@ package com.alibaba.cloud.integration.order.dto;
import
java.util.List
;
@lombok
.
Data
public
class
Workbench
EngineersGanttReqDTO
{
public
class
EngineersGanttReqDTO
{
private
String
levelType
;
private
String
levelValue
;
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/
Workbench
EngineersGanttRespDTO.java
→
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/EngineersGanttRespDTO.java
View file @
398ccd2
package
com
.
alibaba
.
cloud
.
integration
.
order
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.experimental.Accessors
;
...
...
@@ -9,7 +8,7 @@ import java.util.List;
@lombok
.
Data
@Accessors
(
chain
=
true
)
public
class
Workbench
EngineersGanttRespDTO
{
public
class
EngineersGanttRespDTO
{
private
String
date
;
private
List
<?>
engineers
;
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/service/WorkbenchService.java
View file @
398ccd2
package
com
.
alibaba
.
cloud
.
integration
.
order
.
service
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.order.dto.
Workbench
EngineersGanttReqDTO
;
import
com.alibaba.cloud.integration.order.dto.EngineersGanttReqDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListReqDTO
;
public
interface
WorkbenchService
{
Result
<?>
getOrderChangeList
(
WorkbenchOrderChangeListReqDTO
orderChangeListReqDTO
);
Result
<?>
getEngineersGanttList
(
Workbench
EngineersGanttReqDTO
ganttReqDTO
);
Result
<?>
getEngineersGanttList
(
EngineersGanttReqDTO
ganttReqDTO
);
}
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/CapacityQueryServiceImpl.java
View file @
398ccd2
...
...
@@ -3,7 +3,7 @@ package com.alibaba.cloud.integration.order.service.impl;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.order.dao.*
;
import
com.alibaba.cloud.integration.order.dto.CapacityOrderQueryReqDTO
;
import
com.alibaba.cloud.integration.order.dto.Capacity
QueryOrder
RespDTO
;
import
com.alibaba.cloud.integration.order.dto.Capacity
OrderQuery
RespDTO
;
import
com.alibaba.cloud.integration.order.dto.CapacityStatQueryReqDTO
;
import
com.alibaba.cloud.integration.order.dto.CapacityStatQueryRespDTO
;
import
com.alibaba.cloud.integration.order.entity.*
;
...
...
@@ -57,19 +57,19 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
String
layer
=
productCategoryDao
.
getLayerByBrandAndTypeAndSkill
(
reqDTO
.
getBrand
(),
reqDTO
.
getType
(),
reqDTO
.
getSkill
());
String
teamId
=
commonService
.
getTeamIdByInput
(
reqDTO
.
getLocation
(),
reqDTO
.
getAddress
(),
layer
);
log
.
info
(
"teamId[{}]layer[{}]"
,
teamId
,
layer
);
Capacity
QueryOrderRespDTO
capacityQueryRespDTO
=
new
CapacityQueryOrder
RespDTO
();
capacityQueryRespDTO
.
set
BeginDate
(
reqDTO
.
getBegin
Date
()).
setEndDate
(
reqDTO
.
getEndDate
());
capacityQueryRespDTO
.
setCalendar
(
getTeamCapacityByLayerAndDays
(
teamId
,
layer
,
reqDTO
.
get
Begin
Date
(),
reqDTO
.
getEndDate
()));
Capacity
OrderQueryRespDTO
capacityQueryRespDTO
=
new
CapacityOrderQuery
RespDTO
();
capacityQueryRespDTO
.
set
StartDate
(
reqDTO
.
getStart
Date
()).
setEndDate
(
reqDTO
.
getEndDate
());
capacityQueryRespDTO
.
setCalendar
(
getTeamCapacityByLayerAndDays
(
teamId
,
layer
,
reqDTO
.
get
Start
Date
(),
reqDTO
.
getEndDate
()));
capacityQueryRespDTO
.
setLegend
(
getLengends
());
capacityQueryRespDTO
.
setRemark
(
String
.
format
(
"%s-%s"
,
teamId
,
layer
));
return
Result
.
success
(
capacityQueryRespDTO
);
}
private
List
<
Capacity
QueryOrder
RespDTO
.
LegendDTO
>
getLengends
()
{
List
<
Capacity
QueryOrder
RespDTO
.
LegendDTO
>
legends
=
new
ArrayList
<>();
legends
.
add
(
new
Capacity
QueryOrder
RespDTO
.
LegendDTO
().
setType
(
1
).
setMemo
(
"剩余30%以上"
));
legends
.
add
(
new
Capacity
QueryOrder
RespDTO
.
LegendDTO
().
setType
(
2
).
setMemo
(
"剩余60%以上"
));
legends
.
add
(
new
Capacity
QueryOrder
RespDTO
.
LegendDTO
().
setType
(
3
).
setMemo
(
"剩余30%以内"
));
private
List
<
Capacity
OrderQuery
RespDTO
.
LegendDTO
>
getLengends
()
{
List
<
Capacity
OrderQuery
RespDTO
.
LegendDTO
>
legends
=
new
ArrayList
<>();
legends
.
add
(
new
Capacity
OrderQuery
RespDTO
.
LegendDTO
().
setType
(
1
).
setMemo
(
"剩余30%以上"
));
legends
.
add
(
new
Capacity
OrderQuery
RespDTO
.
LegendDTO
().
setType
(
2
).
setMemo
(
"剩余60%以上"
));
legends
.
add
(
new
Capacity
OrderQuery
RespDTO
.
LegendDTO
().
setType
(
3
).
setMemo
(
"剩余30%以内"
));
return
legends
;
}
...
...
@@ -77,19 +77,19 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
public
Result
<?>
getTeamStatData
(
CapacityStatQueryReqDTO
reqDTO
)
{
// 根据大区/分部/分站查询,分别返回分部/分站/工作队的容量
Page
<?>
stats
=
null
;
Pageable
pageable
=
PageRequest
.
of
(
reqDTO
.
getPage
()
-
1
,
reqDTO
.
get
Page
Size
());
Pageable
pageable
=
PageRequest
.
of
(
reqDTO
.
getPage
()
-
1
,
reqDTO
.
getSize
());
if
(
"cluster"
.
equals
(
reqDTO
.
getLevelType
()))
{
List
<
String
>
branchIds
=
getBranchIdsByClusterId
(
reqDTO
.
getLevelValue
());
log
.
info
(
"levelType: {} ==> branchIds: {}"
,
reqDTO
.
getLevelType
(),
branchIds
);
stats
=
capacityOrgStatDao
.
findByBranchIdsAndWorkdayBetween
(
branchIds
,
reqDTO
.
get
Begin
Date
(),
reqDTO
.
getEndDate
(),
pageable
);
stats
=
capacityOrgStatDao
.
findByBranchIdsAndWorkdayBetween
(
branchIds
,
reqDTO
.
get
Start
Date
(),
reqDTO
.
getEndDate
(),
pageable
);
}
else
if
(
"branch"
.
equals
(
reqDTO
.
getLevelType
()))
{
List
<
String
>
groupIds
=
getGroupIdsByBranchId
(
reqDTO
.
getLevelValue
());
log
.
info
(
"levelType: {} ==> groupIds: {}"
,
reqDTO
.
getLevelType
(),
groupIds
);
stats
=
capacityOrgStatDao
.
findByGroupIdsAndWorkdayBetween
(
groupIds
,
reqDTO
.
get
Begin
Date
(),
reqDTO
.
getEndDate
(),
pageable
);
stats
=
capacityOrgStatDao
.
findByGroupIdsAndWorkdayBetween
(
groupIds
,
reqDTO
.
get
Start
Date
(),
reqDTO
.
getEndDate
(),
pageable
);
}
else
{
List
<
String
>
teamIds
=
getTeamIdsByGroupId
(
reqDTO
.
getLevelValue
());
log
.
info
(
"levelType: {} ==> teamIds: {}"
,
reqDTO
.
getLevelType
(),
teamIds
);
stats
=
capacityTeamStatDao
.
findByTeamIdsAndWorkdayBetween
(
teamIds
,
reqDTO
.
get
Begin
Date
(),
reqDTO
.
getEndDate
(),
pageable
);
stats
=
capacityTeamStatDao
.
findByTeamIdsAndWorkdayBetween
(
teamIds
,
reqDTO
.
get
Start
Date
(),
reqDTO
.
getEndDate
(),
pageable
);
}
CapacityStatQueryRespDTO
data
=
new
CapacityStatQueryRespDTO
();
data
.
setLevelType
(
reqDTO
.
getLevelType
());
...
...
@@ -181,24 +181,24 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
* @param endDate
* @return
*/
private
List
<
Capacity
QueryOrder
RespDTO
.
CalendarDTO
>
getTeamCapacityByLayerAndDays
(
String
teamId
,
String
layer
,
String
beginDate
,
String
endDate
)
{
private
List
<
Capacity
OrderQuery
RespDTO
.
CalendarDTO
>
getTeamCapacityByLayerAndDays
(
String
teamId
,
String
layer
,
String
beginDate
,
String
endDate
)
{
log
.
info
(
"==> getTimeRangeByTeamSkill({}, {}, {}, {})"
,
teamId
,
layer
,
beginDate
,
endDate
);
Map
<
String
,
Capacity
QueryOrder
RespDTO
.
CalendarDTO
>
dayMaps
=
new
HashMap
<>();
Map
<
String
,
Capacity
OrderQuery
RespDTO
.
CalendarDTO
>
dayMaps
=
new
HashMap
<>();
List
<
CapacityTeamStatEntity
>
capacityTeamStatEntityList
=
capacityTeamStatDao
.
findAllByTeamIdAndLayerAndWorkdayBetween
(
teamId
,
layer
,
beginDate
,
endDate
);
for
(
CapacityTeamStatEntity
e
:
capacityTeamStatEntityList
)
{
log
.
info
(
"CapacityTeamStatEntity ==> {}"
,
e
);
Capacity
QueryOrderRespDTO
.
TimeDTO
timeDTO
=
new
CapacityQueryOrder
RespDTO
.
TimeDTO
();
Capacity
OrderQueryRespDTO
.
TimeDTO
timeDTO
=
new
CapacityOrderQuery
RespDTO
.
TimeDTO
();
timeDTO
.
setType
(
getSpanType
(
e
.
getCapLeft
(),
e
.
getCapTotal
()));
Object
[]
timeSpans
=
getTimeSpanInfo
(
e
.
getWorkday
(),
e
.
getTimeSpan
(),
e
.
getTimeSpanDetail
());
timeDTO
.
setText
((
String
)
timeSpans
[
0
]);
timeDTO
.
setBegin
((
String
)
timeSpans
[
1
]);
timeDTO
.
setEnd
((
String
)
timeSpans
[
2
]);
List
<
Capacity
QueryOrder
RespDTO
.
TimeDTO
>
times
=
null
;
Capacity
QueryOrder
RespDTO
.
CalendarDTO
calendarDTO
=
null
;
List
<
Capacity
OrderQuery
RespDTO
.
TimeDTO
>
times
=
null
;
Capacity
OrderQuery
RespDTO
.
CalendarDTO
calendarDTO
=
null
;
if
(
dayMaps
.
containsKey
(
e
.
getWorkday
()))
{
calendarDTO
=
dayMaps
.
get
(
e
.
getWorkday
());
}
else
{
calendarDTO
=
new
Capacity
QueryOrder
RespDTO
.
CalendarDTO
();
calendarDTO
=
new
Capacity
OrderQuery
RespDTO
.
CalendarDTO
();
calendarDTO
.
setDate
(
e
.
getWorkday
()).
setWeek
(
getWeekday
(
e
.
getWorkday
()));
calendarDTO
.
setTimes
(
new
ArrayList
<>());
}
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/WorkbenchServiceImpl.java
View file @
398ccd2
...
...
@@ -72,22 +72,22 @@ public class WorkbenchServiceImpl implements WorkbenchService {
}
@Override
public
Result
<?>
getEngineersGanttList
(
Workbench
EngineersGanttReqDTO
reqDTO
)
{
public
Result
<?>
getEngineersGanttList
(
EngineersGanttReqDTO
reqDTO
)
{
// 按日期返回技术员们当天的服务甘特图,不需要翻页
log
.
info
(
"getEngineersGanttList: {}"
,
reqDTO
);
List
<
OrderAppointmentEntity
>
orderAppointments
=
orderAppointmentDao
.
findByDateAndEngineerCodeIn
(
reqDTO
.
getDate
(),
reqDTO
.
getEngineerCodes
());
List
<
String
>
orderIds
=
orderAppointments
.
stream
().
map
(
OrderAppointmentEntity:
:
getOrderId
).
collect
(
Collectors
.
toList
());
Map
<
String
,
OrderRequestEntity
>
mapOrderRequest
=
getOrdersByOrderIds
(
orderIds
);
HashMap
<
String
,
List
<
Workbench
EngineersGanttRespDTO
.
Order
>>
mapEngineers
=
new
HashMap
<>();
HashMap
<
String
,
List
<
EngineersGanttRespDTO
.
Order
>>
mapEngineers
=
new
HashMap
<>();
for
(
OrderAppointmentEntity
e
:
orderAppointments
)
{
log
.
info
(
"===== order_id: [{}]"
,
e
.
getOrderId
());
WorkbenchEngineersGanttRespDTO
.
Order
order
=
new
Workbench
EngineersGanttRespDTO
.
Order
();
EngineersGanttRespDTO
.
Order
order
=
new
EngineersGanttRespDTO
.
Order
();
// todo 需要根据订单时间和状态,采用expectXXXX或者actualXXXX
order
.
setStartTime
(
e
.
getExpectStartTime
()).
setEndTime
(
e
.
getExpectEndTime
());
order
.
setOrderId
(
e
.
getOrderId
()).
setPreStatus
(
e
.
getPreStatus
());
order
.
setTips
(
getOrderTips
(
e
.
getOrderId
()));
order
.
setAppointmentStatus
(
mapOrderRequest
.
get
(
e
.
getOrderId
()).
getAppointmentStatus
());
List
<
Workbench
EngineersGanttRespDTO
.
Order
>
orders
=
null
;
List
<
EngineersGanttRespDTO
.
Order
>
orders
=
null
;
if
(
mapEngineers
.
containsKey
(
e
.
getEngineerCode
()))
{
orders
=
mapEngineers
.
get
(
e
.
getEngineerCode
());
}
else
{
...
...
@@ -97,10 +97,10 @@ public class WorkbenchServiceImpl implements WorkbenchService {
mapEngineers
.
put
(
e
.
getEngineerCode
(),
orders
);
}
List
<
Workbench
EngineersGanttRespDTO
.
GanttChart
>
engineers
=
new
ArrayList
<>();
List
<
EngineersGanttRespDTO
.
GanttChart
>
engineers
=
new
ArrayList
<>();
for
(
String
engineerCode
:
mapEngineers
.
keySet
())
{
EngineerInfoEntity
engineerInfo
=
engineerInfoDao
.
getByEngineerCode
(
engineerCode
);
WorkbenchEngineersGanttRespDTO
.
GanttChart
engineer
=
new
Workbench
EngineersGanttRespDTO
.
GanttChart
();
EngineersGanttRespDTO
.
GanttChart
engineer
=
new
EngineersGanttRespDTO
.
GanttChart
();
engineer
.
setEngineerCode
(
engineerCode
)
.
setStartTime
(
String
.
format
(
"%s 08:00"
,
reqDTO
.
getDate
()))
.
setEndTime
(
String
.
format
(
"%s 18:00"
,
reqDTO
.
getDate
()))
...
...
@@ -118,7 +118,7 @@ public class WorkbenchServiceImpl implements WorkbenchService {
// engineer.setErrorTip(); todo
engineers
.
add
(
engineer
);
}
WorkbenchEngineersGanttRespDTO
data
=
new
Workbench
EngineersGanttRespDTO
().
setDate
(
reqDTO
.
getDate
()).
setEngineers
(
engineers
);
EngineersGanttRespDTO
data
=
new
EngineersGanttRespDTO
().
setDate
(
reqDTO
.
getDate
()).
setEngineers
(
engineers
);
return
Result
.
success
(
data
);
}
...
...
@@ -133,6 +133,7 @@ public class WorkbenchServiceImpl implements WorkbenchService {
log
.
info
(
"==> getOrdertips: orderId[{}]"
,
orderId
);
OrderRequestEntity
order
=
orderRequestDao
.
getByOrderId
(
orderId
);
List
<
LabelValueDTO
>
tips
=
new
ArrayList
<>();
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"工单号码"
).
setValue
(
orderId
));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"类型/品牌"
).
setValue
(
String
.
format
(
"%s %s"
,
order
.
getBrand
(),
order
.
getType
())));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"电话/地址"
).
setValue
(
String
.
format
(
"%s %s\n %s"
,
order
.
getName
(),
order
.
getPhone
(),
order
.
getAddress
())));
if
(!
order
.
getApplyNote
().
isBlank
())
{
...
...
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