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 12192dc1
authored
Nov 20, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:1:改约清除指定工程师
2:创单一家多单,超派消息提醒处理 3:返回工单池处理指定工程师
1 parent
6d7f4d37
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
75 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerGanttServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderAssignImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderInfoServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/utils/OrderUtil.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.java
View file @
12192dc
...
@@ -17,6 +17,7 @@ import com.dituhui.pea.order.entity.*;
...
@@ -17,6 +17,7 @@ import com.dituhui.pea.order.entity.*;
import
com.dituhui.pea.order.enums.*
;
import
com.dituhui.pea.order.enums.*
;
import
com.dituhui.pea.order.service.CommonService
;
import
com.dituhui.pea.order.service.CommonService
;
import
com.dituhui.pea.order.service.DispatchService
;
import
com.dituhui.pea.order.service.DispatchService
;
import
com.dituhui.pea.order.service.EngineerCalendarService
;
import
com.dituhui.pea.order.service.OrderInfoService
;
import
com.dituhui.pea.order.service.OrderInfoService
;
import
com.dituhui.pea.order.utils.CommonUtil
;
import
com.dituhui.pea.order.utils.CommonUtil
;
import
com.google.common.collect.Sets
;
import
com.google.common.collect.Sets
;
...
@@ -76,6 +77,9 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -76,6 +77,9 @@ public class DispatchServiceImpl implements DispatchService {
@Autowired
@Autowired
private
OrderInfoService
orderInfoService
;
private
OrderInfoService
orderInfoService
;
@Autowired
private
EngineerCalendarService
engineerCalendarService
;
@Transactional
@Transactional
@Override
@Override
public
Result
<?>
getDispatchOrderList
(
DispatchOrderListReq
reqDTO
)
{
public
Result
<?>
getDispatchOrderList
(
DispatchOrderListReq
reqDTO
)
{
...
@@ -243,22 +247,8 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -243,22 +247,8 @@ public class DispatchServiceImpl implements DispatchService {
List
engineerCodes2
=
new
ArrayList
();
List
engineerCodes2
=
new
ArrayList
();
for
(
String
engineerCode
:
engineerCodes
)
{
for
(
String
engineerCode
:
engineerCodes
)
{
//获取工作队休息时间, 判定目标时间是否在工作队休息日中
//获取工作队休息时间, 判定目标时间是否在工作队休息日中
Set
<
OrgTeamEntity
>
teams
=
orgTeamDao
.
selectTeamByEngineerCode
(
engineerCode
);
if
(!
engineerCalendarService
.
engineerTargetLeave
(
engineerCode
,
targetDate
))
{
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
teams
))
{
engineerCodes2
.
add
(
engineerCode
);
List
<
String
>
teamCommonWorkdaysOfWeek
=
teams
.
stream
()
.
map
(
team
->
Arrays
.
asList
(
team
.
getWorkdays
().
split
(
","
)))
.
flatMap
(
Collection:
:
stream
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
// 求多个工作队的公共空闲时间
final
int
dayOfWeek
=
targetDate
.
getDayOfWeek
().
getValue
();
List
<
String
>
commonLeisureDayOfWeek
=
EngineerCalendarServiceImpl
.
ALL_WORK_DAY_OF_WEEK
.
stream
().
filter
(
day
->
teamCommonWorkdaysOfWeek
.
stream
().
noneMatch
(
tDay
->
Objects
.
equals
(
day
,
tDay
)))
.
collect
(
Collectors
.
toList
());
if
(!
commonLeisureDayOfWeek
.
contains
(
String
.
valueOf
(
dayOfWeek
)))
{
engineerCodes2
.
add
(
engineerCode
);
}
//求所有事程时间与工作队休息时间的并集
}
}
}
}
return
engineerCodes2
;
return
engineerCodes2
;
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerGanttServiceImpl.java
View file @
12192dc
...
@@ -13,6 +13,7 @@ import com.dituhui.pea.order.enums.OrderFlowEnum;
...
@@ -13,6 +13,7 @@ import com.dituhui.pea.order.enums.OrderFlowEnum;
import
com.dituhui.pea.order.enums.OrderPeaTagsEnum
;
import
com.dituhui.pea.order.enums.OrderPeaTagsEnum
;
import
com.dituhui.pea.order.enums.ServiceStatusEnum
;
import
com.dituhui.pea.order.enums.ServiceStatusEnum
;
import
com.dituhui.pea.order.service.EngineerGanttService
;
import
com.dituhui.pea.order.service.EngineerGanttService
;
import
com.dituhui.pea.order.utils.OrderUtil
;
import
com.google.common.collect.Sets
;
import
com.google.common.collect.Sets
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
@@ -228,7 +229,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
...
@@ -228,7 +229,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"工单号码"
).
setValue
(
order
.
getOrderId
()));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"工单号码"
).
setValue
(
order
.
getOrderId
()));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"品牌/类型/技能"
).
setValue
(
String
.
format
(
"%s/%s/%s"
,
order
.
getBrand
(),
order
.
getType
(),
order
.
getSkill
())));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"品牌/类型/技能"
).
setValue
(
String
.
format
(
"%s/%s/%s"
,
order
.
getBrand
(),
order
.
getType
(),
order
.
getSkill
())));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"电话/地址"
).
setValue
(
String
.
format
(
"%s %s\n %s"
,
order
.
getName
(),
order
.
getPhone
(),
order
.
getAddress
())));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"电话/地址"
).
setValue
(
String
.
format
(
"%s %s\n %s"
,
order
.
getName
(),
order
.
getPhone
(),
order
.
getAddress
())));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"标签"
).
setValue
(
getTags
(
order
)));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"标签"
).
setValue
(
String
.
join
(
","
,
OrderUtil
.
handleTags
(
order
)
)));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"耗时"
).
setValue
(
String
.
format
(
"%s分钟"
,
order
.
getTakeTime
())));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"耗时"
).
setValue
(
String
.
format
(
"%s分钟"
,
order
.
getTakeTime
())));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"期望时间"
).
setValue
(
String
.
format
(
"%s-%s"
,
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"期望时间"
).
setValue
(
String
.
format
(
"%s-%s"
,
DateUtils
.
formatDateTime
(
order
.
getExpectTimeBegin
(),
"HH:mm"
),
DateUtils
.
formatDateTime
(
order
.
getExpectTimeEnd
(),
"HH:mm"
))));
DateUtils
.
formatDateTime
(
order
.
getExpectTimeBegin
(),
"HH:mm"
),
DateUtils
.
formatDateTime
(
order
.
getExpectTimeEnd
(),
"HH:mm"
))));
...
@@ -243,29 +244,6 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
...
@@ -243,29 +244,6 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
return
tips
;
return
tips
;
}
}
private
String
getTags
(
OrderInfoEntity
order
)
{
List
<
String
>
tagList
=
new
ArrayList
();
if
(
StringUtils
.
isNotBlank
(
order
.
getBeanTags
()))
{
tagList
=
Arrays
.
stream
(
order
.
getBeanTags
().
split
(
","
)).
collect
(
Collectors
.
toList
());
}
if
(
order
.
getIsCutoff
()
==
1
)
{
tagList
.
add
(
OrderPeaTagsEnum
.
cutoff
.
getTag
());
}
if
(
order
.
getIsSpecialTime
()
==
1
)
{
tagList
.
add
(
OrderPeaTagsEnum
.
special
.
getTag
());
}
if
(
order
.
getTranscend
()
==
1
)
{
tagList
.
add
(
OrderPeaTagsEnum
.
transcend
.
getTag
());
}
if
(
order
.
getBeanPriority
().
equals
(
"1"
))
{
tagList
.
add
(
OrderPeaTagsEnum
.
urgent
.
getTag
());
}
if
(
StringUtils
.
isNotBlank
(
order
.
getMultipleOrders
()))
{
tagList
.
add
(
OrderPeaTagsEnum
.
multipleOrders
.
getTag
());
}
return
String
.
join
(
","
,
tagList
);
}
private
boolean
checkOrderIsFinish
(
String
serviceStatus
)
{
private
boolean
checkOrderIsFinish
(
String
serviceStatus
)
{
String
[]
array
=
{
"FINISHED"
,
"UNFINISHED"
};
String
[]
array
=
{
"FINISHED"
,
"UNFINISHED"
};
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderAssignImpl.java
View file @
12192dc
...
@@ -279,6 +279,10 @@ public class OrderAssignImpl implements OrderAssign {
...
@@ -279,6 +279,10 @@ public class OrderAssignImpl implements OrderAssign {
// 更新order_request表为未指派
// 更新order_request表为未指派
order
=
OrderUtil
.
handleErrorOrder2
(
order
);
order
=
OrderUtil
.
handleErrorOrder2
(
order
);
}
}
if
(
order
.
getIsAppointEngineer
()
==
1
)
{
order
.
setIsAppointEngineer
(
0
);
order
.
setAppointEngineerCodes
(
null
);
}
orderInfoDao
.
save
(
order
);
orderInfoDao
.
save
(
order
);
commonService
.
addOrderEvent
(
orderId
,
""
,
"PEA"
,
"PEA"
,
OrderEventEnum
.
backOrderPool
.
getEvent
(),
OrderEventEnum
.
backOrderPool
.
getMsg
(),
""
);
commonService
.
addOrderEvent
(
orderId
,
""
,
"PEA"
,
"PEA"
,
OrderEventEnum
.
backOrderPool
.
getEvent
(),
OrderEventEnum
.
backOrderPool
.
getMsg
(),
""
);
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
View file @
12192dc
...
@@ -61,6 +61,7 @@ import com.dituhui.pea.order.service.MsgService;
...
@@ -61,6 +61,7 @@ import com.dituhui.pea.order.service.MsgService;
import
com.dituhui.pea.order.service.OrderCreateService
;
import
com.dituhui.pea.order.service.OrderCreateService
;
import
com.dituhui.pea.order.service.OrderInfoService
;
import
com.dituhui.pea.order.service.OrderInfoService
;
import
com.dituhui.pea.order.utils.CommonUtil
;
import
com.dituhui.pea.order.utils.CommonUtil
;
import
com.dituhui.pea.order.utils.OrderUtil
;
import
com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq
;
import
com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq
;
import
com.dituhui.pea.pojo.saas.resp.AdministrativeDistrictResp
;
import
com.dituhui.pea.pojo.saas.resp.AdministrativeDistrictResp
;
import
com.dituhui.pea.util.DateUtil
;
import
com.dituhui.pea.util.DateUtil
;
...
@@ -298,7 +299,6 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -298,7 +299,6 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setCity
(
adminDistrict
.
getResult
().
getSubNames
().
getCity
());
entity
.
setCity
(
adminDistrict
.
getResult
().
getSubNames
().
getCity
());
entity
.
setCounty
(
adminDistrict
.
getResult
().
getSubNames
().
getCounty
());
entity
.
setCounty
(
adminDistrict
.
getResult
().
getSubNames
().
getCounty
());
}
}
List
<
String
>
tags
=
req
.
getOrderTags
();
// 处理技能和标签
// 处理技能和标签
entity
.
setTakeTime
(
skillInfoEntity
.
getTakeTime
());
entity
.
setTakeTime
(
skillInfoEntity
.
getTakeTime
());
String
joinTags
=
CollectionUtils
.
isEmpty
(
req
.
getOrderTags
())
?
""
:
String
.
join
(
","
,
req
.
getOrderTags
());
String
joinTags
=
CollectionUtils
.
isEmpty
(
req
.
getOrderTags
())
?
""
:
String
.
join
(
","
,
req
.
getOrderTags
());
...
@@ -309,10 +309,10 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -309,10 +309,10 @@ public class OrderCreateServiceImpl implements OrderCreateService {
if
(!
DateUtil
.
judgeTimeIsToday
(
entity
.
getExpectTimeBegin
()))
{
if
(!
DateUtil
.
judgeTimeIsToday
(
entity
.
getExpectTimeBegin
()))
{
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
AUTO_NOW
.
name
());
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
AUTO_NOW
.
name
());
}
}
tags
.
add
(
OrderPeaTagsEnum
.
urgent
.
getTag
());
//发送通知分部消息
// sendMsg(entity.getOrgBranchId(), orderId, entity.getExpectTimeBegin().toLocalDate());
}
}
//一家多单
Result
<
String
>
addMultipleOrders
=
orderInfoService
.
addMultipleOrders
(
entity
.
getDt
(),
location
.
getAddressId
(),
orderId
);
entity
.
setMultipleOrders
(
addMultipleOrders
.
getResult
());
// 处理指派工程师
// 处理指派工程师
entity
.
setIsAppointEngineer
(
req
.
getIsAppointEngineer
());
entity
.
setIsAppointEngineer
(
req
.
getIsAppointEngineer
());
...
@@ -355,12 +355,10 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -355,12 +355,10 @@ public class OrderCreateServiceImpl implements OrderCreateService {
// 处理超派
// 处理超派
entity
.
setTranscend
(
1
);
entity
.
setTranscend
(
1
);
}
}
Integer
special
=
0
;
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
FENDAN_IS_TRANSCEND_AND_SPECIAL
.
getCode
()))
{
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
FENDAN_IS_TRANSCEND_AND_SPECIAL
.
getCode
()))
{
// 处理超派和特殊时间
// 处理超派和特殊时间
entity
.
setTranscend
(
1
);
entity
.
setTranscend
(
1
);
entity
.
setIsSpecialTime
(
1
);
entity
.
setIsSpecialTime
(
1
);
special
=
1
;
}
}
OrgBranchEntity
branchEntity
=
orgBranchDao
.
findByCitycodeListLike
(
"%"
+
adminDistrict
.
getResult
().
getSubNames
().
getCity
()
+
"%"
);
OrgBranchEntity
branchEntity
=
orgBranchDao
.
findByCitycodeListLike
(
"%"
+
adminDistrict
.
getResult
().
getSubNames
().
getCity
()
+
"%"
);
entity
.
setOrgClusterId
(
branchEntity
.
getClusterId
());
entity
.
setOrgClusterId
(
branchEntity
.
getClusterId
());
...
@@ -370,7 +368,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -370,7 +368,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
Integer
cutoff
=
CommonUtil
.
isCutoff
(
entity
.
getExpectTimeBegin
(),
null
);
Integer
cutoff
=
CommonUtil
.
isCutoff
(
entity
.
getExpectTimeBegin
(),
null
);
entity
.
setIsCutoff
(
cutoff
);
entity
.
setIsCutoff
(
cutoff
);
//发送通知分部消息
//发送通知分部消息
sendMsg
(
branchEntity
.
getBranchId
(),
orderId
,
entity
.
getExpectTimeBegin
().
toLocalDate
(),
tags
,
cutoff
,
special
);
sendMsg
(
branchEntity
.
getBranchId
(),
orderId
,
entity
.
getExpectTimeBegin
().
toLocalDate
(),
entity
);
}
else
{
}
else
{
// 根据分单工作队,填写clusterId/branchId/groupId/teamId等
// 根据分单工作队,填写clusterId/branchId/groupId/teamId等
OrgTeamInfo
teamInfo
=
fendanResult
.
getResult
();
OrgTeamInfo
teamInfo
=
fendanResult
.
getResult
();
...
@@ -395,7 +393,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -395,7 +393,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setIsSpecialTime
(
special
);
entity
.
setIsSpecialTime
(
special
);
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
MANUAL
.
name
());
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
MANUAL
.
name
());
//发送通知分部消息
//发送通知分部消息
sendMsg
(
teamInfo
.
getBranchId
(),
orderId
,
entity
.
getExpectTimeBegin
().
toLocalDate
(),
tags
,
cutoff
,
special
);
sendMsg
(
teamInfo
.
getBranchId
(),
orderId
,
entity
.
getExpectTimeBegin
().
toLocalDate
(),
entity
);
}
}
}
}
}
}
...
@@ -428,10 +426,6 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -428,10 +426,6 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setBeanSubStatus
(
""
);
entity
.
setBeanSubStatus
(
""
);
entity
.
setWorkshop
(
false
);
entity
.
setWorkshop
(
false
);
//一家多单
Result
<
String
>
addMultipleOrders
=
orderInfoService
.
addMultipleOrders
(
entity
.
getDt
(),
location
.
getAddressId
(),
orderId
);
entity
.
setMultipleOrders
(
addMultipleOrders
.
getResult
());
// 记录订单和节点
// 记录订单和节点
orderInfoDao
.
save
(
entity
);
orderInfoDao
.
save
(
entity
);
commonService
.
addOrderEvent
(
orderId
,
""
,
req
.
getSource
(),
"API"
,
OrderEventEnum
.
createOrder
.
getEvent
(),
String
.
format
(
OrderEventEnum
.
createOrder
.
getMsg
(),
req
.
getSource
(),
"BEAN"
,
req
.
getOrderId
()),
""
);
commonService
.
addOrderEvent
(
orderId
,
""
,
req
.
getSource
(),
"API"
,
OrderEventEnum
.
createOrder
.
getEvent
(),
String
.
format
(
OrderEventEnum
.
createOrder
.
getMsg
(),
req
.
getSource
(),
"BEAN"
,
req
.
getOrderId
()),
""
);
...
@@ -442,21 +436,12 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -442,21 +436,12 @@ public class OrderCreateServiceImpl implements OrderCreateService {
return
Result
.
success
(
null
);
return
Result
.
success
(
null
);
}
}
private
void
sendMsg
(
String
branchId
,
String
orderId
,
LocalDate
toLocalDate
,
List
<
String
>
tags
,
Integer
cutoff
,
Integer
special
)
{
private
void
sendMsg
(
String
branchId
,
String
orderId
,
LocalDate
toLocalDate
,
OrderInfoEntity
orderInfo
)
{
if
(
cutoff
==
1
)
{
tags
.
add
(
OrderPeaTagsEnum
.
cutoff
.
getTag
());
}
if
(
special
==
1
)
{
tags
.
add
(
OrderPeaTagsEnum
.
special
.
getTag
());
}
if
(
CollectionUtils
.
isNotEmpty
(
tags
))
{
tags
=
tags
.
stream
().
filter
(
e
->
StringUtils
.
isNotBlank
(
e
)).
collect
(
Collectors
.
toList
());
}
MsgDTO
msgDTO
=
new
MsgDTO
();
MsgDTO
msgDTO
=
new
MsgDTO
();
msgDTO
.
setBranchId
(
branchId
);
msgDTO
.
setBranchId
(
branchId
);
msgDTO
.
setType
(
0
);
msgDTO
.
setType
(
0
);
msgDTO
.
setOrderIds
(
orderId
);
msgDTO
.
setOrderIds
(
orderId
);
msgDTO
.
setContent
(
String
.
format
(
"有1条预约日期在%s的工单需人工外理,标签是(%s),单号:%S"
,
toLocalDate
,
String
.
join
(
","
,
tags
),
orderId
));
msgDTO
.
setContent
(
String
.
format
(
"有1条预约日期在%s的工单需人工外理,标签是(%s),单号:%S"
,
toLocalDate
,
String
.
join
(
","
,
OrderUtil
.
handleTags
(
orderInfo
)
),
orderId
));
msgService
.
add
(
msgDTO
);
msgService
.
add
(
msgDTO
);
}
}
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderInfoServiceImpl.java
View file @
12192dc
...
@@ -80,6 +80,9 @@ public class OrderInfoServiceImpl implements OrderInfoService {
...
@@ -80,6 +80,9 @@ public class OrderInfoServiceImpl implements OrderInfoService {
@Autowired
@Autowired
private
EngineerCalendarService
engineerCalendarService
;
private
EngineerCalendarService
engineerCalendarService
;
@Autowired
private
EngineerSkillGroupDao
engineerSkillGroupDao
;
/**
/**
* 新增订单处理一家多单逻辑
* 新增订单处理一家多单逻辑
...
@@ -324,13 +327,33 @@ public class OrderInfoServiceImpl implements OrderInfoService {
...
@@ -324,13 +327,33 @@ public class OrderInfoServiceImpl implements OrderInfoService {
// 是否网点
// 是否网点
//网点都需要重新指派
//网点都需要重新指派
boolean
isNetwork
=
ObjectUtil
.
isNull
(
groupEntity
)
?
false
:
groupEntity
.
getCategory
()
==
2
;
boolean
isNetwork
=
ObjectUtil
.
isNull
(
groupEntity
)
?
false
:
groupEntity
.
getCategory
()
==
2
;
// 是否需要从新指派
boolean
isAssign
=
false
;
String
branchId
=
order
.
getOrgBranchId
();
String
branchId
=
order
.
getOrgBranchId
();
String
clusterId
=
order
.
getOrgClusterId
();
String
clusterId
=
order
.
getOrgClusterId
();
String
teamId
=
order
.
getOrgTeamId
();
String
teamId
=
order
.
getOrgTeamId
();
// 修改技能时处理工单耗时
if
(
skillUpdate
)
{
isAssign
=
true
;
SkillInfoEntity
skillInfoEntity
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
order
.
getBrand
(),
order
.
getType
(),
order
.
getSkill
());
if
(
ObjectUtil
.
isNull
(
skillInfoEntity
))
{
return
Result
.
failed
(
StatusCodeEnum
.
ORDER_SKILL_NOT_EXISTS
);
}
order
.
setTakeTime
(
skillInfoEntity
.
getTakeTime
());
// 处理指定工程师技能是否符合
if
(
order
.
getIsAppointEngineer
()
==
1
)
{
EngineerSkillGroupEntity
skillGroupCode
=
engineerSkillGroupDao
.
findByEngineerCodeAndSkillGroupCode
(
order
.
getAppointEngineerCodes
().
split
(
","
)[
0
],
skillInfoEntity
.
getSkillGroupCode
());
if
(
ObjectUtil
.
isNotEmpty
(
skillGroupCode
))
{
isAssign
=
false
;
}
}
}
// 当天单变更技能直接人工指派
// 当天单变更技能直接人工指派
if
(
isToday
&&
skillUpdate
)
{
if
(
isToday
&&
skillUpdate
)
{
if
(
order
.
getIsAppointEngineer
()
!=
1
)
{
if
(
isAssign
)
{
order
=
OrderUtil
.
handleErrorOrder
(
order
);
order
=
OrderUtil
.
handleErrorOrder
(
order
);
teamId
=
null
;
teamId
=
null
;
order
.
setAppointmentMethod
(
AppointmentMethodEnum
.
MANUAL
.
name
());
order
.
setAppointmentMethod
(
AppointmentMethodEnum
.
MANUAL
.
name
());
...
@@ -342,12 +365,12 @@ public class OrderInfoServiceImpl implements OrderInfoService {
...
@@ -342,12 +365,12 @@ public class OrderInfoServiceImpl implements OrderInfoService {
// i.自有:优先改约指派给当前工程师
// i.自有:优先改约指派给当前工程师
// ii.网点:优先改约指派给当前网点
// ii.网点:优先改约指派给当前网点
// (不给当前工程师)
// (不给当前工程师)
if
(!
isToday
&&
isBelong
&&
skillUpdate
&&
order
.
getIsAppointEngineer
()
!=
1
)
{
if
(!
isToday
&&
isBelong
&&
skillUpdate
&&
isAssign
)
{
//地址变更需要从新分单
//地址变更需要从新分单
order
=
orderFendan
(
order
,
req
,
location
);
order
=
orderFendan
(
order
,
req
,
location
);
clusterId
=
order
.
getOrgClusterId
();
clusterId
=
order
.
getOrgClusterId
();
branchId
=
order
.
getOrgBranchId
();
branchId
=
order
.
getOrgBranchId
();
}
else
if
(
isToday
&&
isBelong
&&
order
.
getIsAppointEngineer
()
!=
1
)
{
}
else
if
(
isToday
&&
isBelong
&&
isAssign
)
{
// b.已派人-改约到当天
// b.已派人-改约到当天
// i.自有:优先改约指派给当前工程师
// i.自有:优先改约指派给当前工程师
// (会影响该工程师当天后续工单的时
// (会影响该工程师当天后续工单的时
...
@@ -394,15 +417,6 @@ public class OrderInfoServiceImpl implements OrderInfoService {
...
@@ -394,15 +417,6 @@ public class OrderInfoServiceImpl implements OrderInfoService {
}
}
}
}
// 修改技能时处理工单耗时
if
(
skillUpdate
)
{
SkillInfoEntity
skillInfoEntity
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
order
.
getBrand
(),
order
.
getType
(),
order
.
getSkill
());
if
(
ObjectUtil
.
isNull
(
skillInfoEntity
))
{
return
Result
.
failed
(
StatusCodeEnum
.
ORDER_SKILL_NOT_EXISTS
);
}
order
.
setTakeTime
(
skillInfoEntity
.
getTakeTime
());
}
//处理一家多单
//处理一家多单
// order = handleMultipleOrders(order);
// order = handleMultipleOrders(order);
if
(!
orderDt
.
isEqual
(
expectBegin
.
toLocalDate
()))
{
if
(!
orderDt
.
isEqual
(
expectBegin
.
toLocalDate
()))
{
...
@@ -708,6 +722,8 @@ public class OrderInfoServiceImpl implements OrderInfoService {
...
@@ -708,6 +722,8 @@ public class OrderInfoServiceImpl implements OrderInfoService {
* @return
* @return
*/
*/
private
OrderInfoEntity
orderFendan
(
OrderInfoEntity
order
,
OrderReschedule
req
,
Location
location
)
{
private
OrderInfoEntity
orderFendan
(
OrderInfoEntity
order
,
OrderReschedule
req
,
Location
location
)
{
//清除指派信息
order
=
OrderUtil
.
handleErrorOrder
(
order
);
order
.
setServiceStatus
(
ServiceStatusEnum
.
INIT
.
getCode
());
order
.
setServiceStatus
(
ServiceStatusEnum
.
INIT
.
getCode
());
if
(
StringUtils
.
isNotBlank
(
req
.
getDescription
()))
{
if
(
StringUtils
.
isNotBlank
(
req
.
getDescription
()))
{
order
.
setDescription
(
order
.
getDescription
());
order
.
setDescription
(
order
.
getDescription
());
...
...
project-order/src/main/java/com/dituhui/pea/order/utils/OrderUtil.java
View file @
12192dc
package
com
.
dituhui
.
pea
.
order
.
utils
;
package
com
.
dituhui
.
pea
.
order
.
utils
;
import
com.dituhui.pea.order.entity.OrderInfoEntity
;
import
com.dituhui.pea.order.entity.OrderInfoEntity
;
import
com.dituhui.pea.order.enums.OrderPeaTagsEnum
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
OrderUtil
{
public
class
OrderUtil
{
/**
/**
...
@@ -31,4 +38,34 @@ public class OrderUtil {
...
@@ -31,4 +38,34 @@ public class OrderUtil {
return
order
;
return
order
;
}
}
/**
* 分单,超派,特殊时间等处理工单指派工程师,网点等数据
*
* @param order
* @return
*/
public
static
List
<
String
>
handleTags
(
OrderInfoEntity
order
)
{
List
<
String
>
tagList
=
new
ArrayList
();
if
(
StringUtils
.
isNotBlank
(
order
.
getBeanTags
()))
{
tagList
=
Arrays
.
stream
(
order
.
getBeanTags
().
split
(
","
)).
collect
(
Collectors
.
toList
());
}
if
(
order
.
getIsCutoff
()
==
1
)
{
tagList
.
add
(
OrderPeaTagsEnum
.
cutoff
.
getTag
());
}
if
(
order
.
getIsSpecialTime
()
==
1
)
{
tagList
.
add
(
OrderPeaTagsEnum
.
special
.
getTag
());
}
if
(
order
.
getTranscend
()
==
1
)
{
tagList
.
add
(
OrderPeaTagsEnum
.
transcend
.
getTag
());
}
if
(
order
.
getBeanPriority
().
equals
(
"1"
))
{
tagList
.
add
(
OrderPeaTagsEnum
.
urgent
.
getTag
());
}
if
(
StringUtils
.
isNotBlank
(
order
.
getMultipleOrders
()))
{
tagList
.
add
(
OrderPeaTagsEnum
.
multipleOrders
.
getTag
());
}
return
tagList
;
}
}
}
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