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 1ab51cd0
authored
Oct 31, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Plain Diff
fix: 解决代码冲突
2 parents
b231066d
43fdaccb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
186 additions
and
37 deletions
project-dispatch/src/main/java/com/dituhui/pea/dispatch/pojo/Location.java
project-interface/src/main/java/com/dituhui/pea/enums/StatusCodeEnum.java
project-order/src/main/java/com/dituhui/pea/order/common/CapacityUtils.java
project-order/src/main/java/com/dituhui/pea/order/common/DateSplit.java
project-order/src/main/java/com/dituhui/pea/order/controller/OrderAssignController.java
project-order/src/main/java/com/dituhui/pea/order/controller/PeaApiController.java
project-order/src/main/java/com/dituhui/pea/order/scheduler/CalcEngineerCapacityScheduler.java
project-order/src/main/java/com/dituhui/pea/order/service/CapacityQueryService.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessLayerServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/CapacityQueryServiceImpl.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/service/impl/ScheduleServiceImpl.java
project-user/src/main/java/com/dituhui/pea/user/service/RoleService.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/pojo/Location.java
View file @
1ab51cd
...
...
@@ -171,12 +171,15 @@ public class Location {
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
null
)
if
(
obj
==
null
)
{
return
false
;
if
(!(
obj
instanceof
Location
))
}
if
(!(
obj
instanceof
Location
))
{
return
false
;
if
(
obj
==
this
)
}
if
(
obj
==
this
)
{
return
true
;
}
return
this
.
id
==
((
Location
)
obj
).
getId
();
}
...
...
project-interface/src/main/java/com/dituhui/pea/enums/StatusCodeEnum.java
View file @
1ab51cd
...
...
@@ -132,7 +132,9 @@ public enum StatusCodeEnum {
FENDAN_ENGINEER_UNMATCHED
(
"023"
,
"分单接口没有查到配置工程师"
,
false
),
FENDAN_IS_TRANSCEND
(
"024"
,
"分单超派"
,
false
);
FENDAN_IS_TRANSCEND
(
"024"
,
"分单超派"
,
false
),
RESOURCE_USER_EXISTS_ROLE
(
"025"
,
"用绑定用户的角色不允许删除,需要解绑后才可以删除角色"
,
false
);
/**
* 状态码
...
...
project-order/src/main/java/com/dituhui/pea/order/common/CapacityUtils.java
View file @
1ab51cd
package
com
.
dituhui
.
pea
.
order
.
common
;
import
com.dituhui.pea.order.common.jackson.DateUtil
;
import
com.dituhui.pea.order.dao.MapBlockInfoDao
;
import
com.dituhui.pea.order.dao.SkillInfoDao
;
import
com.dituhui.pea.order.dto.param.CapacityQueryDTO
;
import
com.dituhui.pea.order.entity.CapacityEngineerSliceUsedEntity
;
import
com.dituhui.pea.order.entity.MapBlockInfoEntity
;
import
com.dituhui.pea.order.entity.SkillInfoEntity
;
import
com.dituhui.pea.order.entity.TimeSliceEntity
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.OptionalLong
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ForkJoinPool
;
import
java.util.concurrent.ForkJoinTask
;
import
java.util.stream.Collectors
;
@Component
...
...
@@ -58,4 +70,64 @@ public class CapacityUtils {
return
layers
;
}
public
static
List
<
CapacityQueryDTO
.
Segment
>
getEngineerTypeDay
(
List
<
TimeSliceEntity
>
typeTimeSlice
,
List
<
CapacityEngineerSliceUsedEntity
>
engineerTimeSlice
,
LocalDate
date
,
int
totalTakeTime
)
{
ForkJoinPool
forkJoinPool
=
new
ForkJoinPool
(
Runtime
.
getRuntime
().
availableProcessors
());
//容量
ForkJoinTask
<
List
<
CapacityQueryDTO
.
Segment
>>
fork
=
forkJoinPool
.
submit
(()
->
typeTimeSlice
.
parallelStream
()
.
map
(
targetTimeSlice
->
{
final
LocalTime
targetStartTime
=
LocalTime
.
parse
(
targetTimeSlice
.
getStart
(),
DateUtil
.
TIME_FORMATTER
);
final
LocalTime
targetEndTime
=
LocalTime
.
parse
(
targetTimeSlice
.
getEnd
(),
DateUtil
.
TIME_FORMATTER
);
return
caculateTargetTimeSlice
(
totalTakeTime
,
targetTimeSlice
.
getName
(),
engineerTimeSlice
,
targetStartTime
,
targetEndTime
,
date
);
}).
collect
(
Collectors
.
toList
())).
fork
();
try
{
return
fork
.
get
();
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
throw
new
RuntimeException
(
e
);
}
finally
{
forkJoinPool
.
shutdown
();
}
}
public
static
CapacityQueryDTO
.
Segment
caculateTargetTimeSlice
(
int
totalTakeTime
,
String
timeSliceName
,
List
<
CapacityEngineerSliceUsedEntity
>
engineerTimeSlice
,
LocalTime
targetStartTime
,
LocalTime
targetEndTime
,
LocalDate
targetDate
)
{
List
<
CapacityEngineerSliceUsedEntity
>
collect
=
engineerTimeSlice
.
parallelStream
().
filter
(
t
->
{
TimeSliceEntity
timeSlice
=
t
.
getTimmeSlice
();
LocalTime
sliceStartHour
=
LocalTime
.
parse
(
timeSlice
.
getStart
(),
DateUtil
.
TIME_FORMATTER
);
LocalTime
sliceEndHour
=
LocalTime
.
parse
(
timeSlice
.
getEnd
(),
DateUtil
.
TIME_FORMATTER
);
return
(
targetStartTime
.
isAfter
(
sliceStartHour
)
&&
targetEndTime
.
isBefore
(
sliceEndHour
))
||
(
targetStartTime
.
equals
(
sliceStartHour
)
||
targetEndTime
.
equals
(
sliceEndHour
));
}).
collect
(
Collectors
.
toList
());
CapacityQueryDTO
.
Segment
segment
=
new
CapacityQueryDTO
.
Segment
();
segment
.
setName
(
timeSliceName
);
segment
.
setEndTime
(
DateUtil
.
toDate
(
LocalDateTime
.
of
(
targetDate
,
targetEndTime
)));
segment
.
setBeginTime
(
DateUtil
.
toDate
(
LocalDateTime
.
of
(
targetDate
,
targetStartTime
)));
if
(!
org
.
apache
.
commons
.
collections4
.
CollectionUtils
.
isEmpty
(
collect
))
{
OptionalLong
optionalLong
=
collect
.
stream
().
mapToLong
(
t
->
{
Long
maxDuration
=
t
.
getMaxDuration
();
return
Objects
.
isNull
(
maxDuration
)
?
0L
:
maxDuration
;
}).
max
();
long
maxDuration
=
optionalLong
.
isEmpty
()
?
0
:
optionalLong
.
getAsLong
();
segment
.
setMaxDuration
(
maxDuration
);
long
remain
=
collect
.
stream
().
mapToLong
(
CapacityEngineerSliceUsedEntity:
:
getCapLeft
).
sum
();
segment
.
setRemain
(
remain
);
segment
.
setStatus
(
totalTakeTime
<=
maxDuration
?
1
:
0
);
}
else
{
segment
.
setMaxDuration
(
0
);
segment
.
setRemain
(
0
);
segment
.
setStatus
(
0
);
}
return
segment
;
}
}
project-order/src/main/java/com/dituhui/pea/order/common/DateSplit.java
View file @
1ab51cd
...
...
@@ -31,7 +31,7 @@ public class DateSplit {
}
public
LocalDateTime
getLocalEndDateTime
()
{
return
DateUtil
.
fromDate
(
this
.
start
DateTime
);
return
DateUtil
.
fromDate
(
this
.
end
DateTime
);
}
/**
...
...
project-order/src/main/java/com/dituhui/pea/order/controller/OrderAssignController.java
View file @
1ab51cd
...
...
@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/pea-order"
)
...
...
@@ -50,6 +51,20 @@ public class OrderAssignController {
return
res
;
}
@PostMapping
(
"/order/assign/list"
)
public
Result
<?>
orderAssign
(
@RequestBody
List
<
OrderAssignReq
>
assignReqList
)
{
// 服务单指派-指派提交
try
{
for
(
OrderAssignReq
assignReq
:
assignReqList
)
{
orderAssign
.
orderAssign
(
assignReq
);
}
}
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
return
Result
.
success
();
}
@PostMapping
(
"/order/revoke/assign"
)
public
Result
<?>
orderRevokeAssign
(
@RequestBody
OrderRevokeAssign
req
)
{
// 放回工单池
...
...
@@ -73,4 +88,23 @@ public class OrderAssignController {
}
return
res
;
}
/**
* 批量改约
*
* @param rescheduleList
* @return
*/
@PostMapping
(
"/order/rescheduling/list"
)
public
Result
<?>
orderRescheduling
(
@RequestBody
List
<
OrderReschedule
>
rescheduleList
)
{
// 订单改约
try
{
for
(
OrderReschedule
reschedule
:
rescheduleList
)
{
orderInfoService
.
orderReschedule
(
reschedule
);
}
}
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
return
Result
.
success
();
}
}
project-order/src/main/java/com/dituhui/pea/order/controller/PeaApiController.java
View file @
1ab51cd
...
...
@@ -134,7 +134,7 @@ public class PeaApiController {
return
service
;
}).
collect
(
Collectors
.
toList
());
return
capacityQueryService
.
matchCapacityData
(
convertService
,
reqDTO
.
getLocation
(),
startDate
,
endDate
);
return
capacityQueryService
.
matchCapacityData
(
reqDTO
,
convertService
,
reqDTO
.
getLocation
(),
startDate
,
endDate
);
}
private
String
fixBrand
(
String
brand
)
{
...
...
project-order/src/main/java/com/dituhui/pea/order/scheduler/CalcEngineerCapacityScheduler.java
View file @
1ab51cd
...
...
@@ -33,6 +33,7 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
...
...
@@ -123,7 +124,12 @@ public class CalcEngineerCapacityScheduler {
final
TimeSliceEntity
timeSlice
=
sliceCap
.
getTimmeSlice
();
LocalTime
sliceStartLocalTime
=
LocalTime
.
parse
(
timeSlice
.
getStart
(),
DateUtil
.
TIME_FORMATTER
);
LocalTime
sliceEndLocalTime
=
LocalTime
.
parse
(
timeSlice
.
getEnd
(),
DateUtil
.
TIME_FORMATTER
);
long
lengthOfLeave
=
sliceCap
.
getCapTotal
();
if
(
Objects
.
isNull
(
sliceCap
.
getCapTotal
())
||
0
==
sliceCap
.
getCapTotal
())
{
log
.
info
(
"-----------------》工程师{}的时间片总容量为0, 跳过容量计算"
,
engineerCode
);
continue
;
}
long
totalUseTime
=
0
;
long
maxDuration
=
0
;
for
(
OrderInfoEntity
order
:
orders
)
{
LocalTime
planStartTime
=
order
.
getPlanStartTime
().
toLocalTime
();
LocalTime
planEndTime
=
order
.
getPlanEndTime
().
toLocalTime
();
...
...
@@ -135,22 +141,26 @@ public class CalcEngineerCapacityScheduler {
boolean
contains
=
ss
.
contains
(
order
.
getOrderStatus
());
//请假时间仅落在当前时间段内, 当前时间段请假时长为 请假结束时间- 请假开始时间
if
(
startIn
&&
DateTimeUtil
.
isIn
(
planEndTime
,
sliceStartLocalTime
,
sliceEndLocalTime
))
{
l
engthOfLeave
=
contains
?
lengthOfLeave
-
DateTimeUtil
.
betweenTwoTime
(
planStartTime
,
planEndTime
,
TimeUnit
.
MINUTES
)
:
lengthOfLeave
+
DateTimeUtil
.
betweenTwoTime
(
planStartTime
,
planEndTime
,
TimeUnit
.
MINUTES
)
;
l
ong
useTime
=
DateTimeUtil
.
betweenTwoTime
(
planStartTime
,
planEndTime
,
TimeUnit
.
MINUTES
);
totalUseTime
=
contains
?
totalUseTime
+
useTime
:
totalUseTime
-
useTime
;
}
else
if
(
startIn
&&
endAfter
)
{
//落在当前时间段和下一个时间段
l
engthOfLeave
=
contains
?
lengthOfLeave
-
DateTimeUtil
.
betweenTwoTime
(
planStartTime
,
sliceEndLocalTime
,
TimeUnit
.
MINUTES
)
:
lengthOfLeave
+
DateTimeUtil
.
betweenTwoTime
(
planStartTime
,
sliceEndLocalTime
,
TimeUnit
.
MINUTES
)
;
l
ong
useTime
=
DateTimeUtil
.
betweenTwoTime
(
planStartTime
,
sliceEndLocalTime
,
TimeUnit
.
MINUTES
);
totalUseTime
=
contains
?
totalUseTime
+
useTime
:
totalUseTime
-
useTime
;
}
else
if
(
planStartTime
.
isBefore
(
sliceStartLocalTime
)
&&
endAfter
)
{
l
engthOfLeave
=
contains
?
lengthOfLeave
-
DateTimeUtil
.
betweenTwoTime
(
sliceStartLocalTime
,
sliceEndLocalTime
,
TimeUnit
.
MINUTES
):
lengthOfLeave
+
DateTimeUtil
.
betweenTwoTime
(
sliceStartLocalTime
,
sliceEndLocalTime
,
TimeUnit
.
MINUTES
)
;
l
ong
usedTime
=
DateTimeUtil
.
betweenTwoTime
(
sliceStartLocalTime
,
sliceEndLocalTime
,
TimeUnit
.
MINUTES
);
totalUseTime
=
contains
?
totalUseTime
+
usedTime
:
totalUseTime
-
usedTime
;
}
}
sliceCap
.
setCapLeft
(
lengthOfLeave
);
if
(
totalUseTime
<
0
)
{
totalUseTime
=
0
;
}
sliceCap
.
setCapLeft
(
sliceCap
.
getCapTotal
()
-
totalUseTime
);
sliceCap
.
setMaxDuration
(
sliceCap
.
getCapTotal
()
-
totalUseTime
);
}
engineerSliceUsedCapacityDao
.
saveAll
(
engineerTimeSlice
);
}
...
...
project-order/src/main/java/com/dituhui/pea/order/service/CapacityQueryService.java
View file @
1ab51cd
...
...
@@ -21,7 +21,8 @@ public interface CapacityQueryService {
* @param endDate 结束日期
* @return 满足对应技能工作队的容量(三种类型与分站绑定)
*/
Result
<
CapacityQueryDTO
.
Result
>
matchCapacityData
(
List
<
CapacityQueryDTO
.
Service
>
services
,
Location
location
,
LocalDate
beginDate
,
LocalDate
endDate
);
Result
<
CapacityQueryDTO
.
Result
>
matchCapacityData
(
CapacityQueryDTO
.
Request
request
,
List
<
CapacityQueryDTO
.
Service
>
services
,
Location
location
,
LocalDate
beginDate
,
LocalDate
endDate
);
/**
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessLayerServiceImpl.java
View file @
1ab51cd
...
...
@@ -16,6 +16,7 @@ import com.dituhui.pea.order.utils.TypeUtils;
import
com.google.gson.internal.LinkedTreeMap
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
...
...
@@ -238,6 +239,7 @@ public class BusinessLayerServiceImpl implements BusinessLayerService {
}
@Override
@Transactional
public
Result
<?>
businessCustomLayerRemove
(
String
layerId
)
throws
BusinessException
{
MapLayerCustomizeEntity
layer
=
mapLayerCustomizeDao
.
getByLayerId
(
layerId
);
...
...
@@ -251,12 +253,14 @@ public class BusinessLayerServiceImpl implements BusinessLayerService {
return
Result
.
failure
(
"该图层下面还有区块"
);
}
// 同步删除saas图层
String
result
=
saasRemoteService
.
deleteLayer
(
ak
,
layer
.
getSaasLayerId
());
log
.
info
(
"deleteLayer params:{} result:{}"
,
layerId
,
result
);
Result
<
Boolean
>
saasResult
=
TypeUtils
.
convertResult
(
result
);
if
(!
ResultEnum
.
SUCCESS
.
getCode
().
equals
(
saasResult
.
getCode
()))
{
return
Result
.
failure
(
saasResult
.
getMessage
());
if
(
StringUtils
.
isNotBlank
(
layer
.
getSaasLayerId
()))
{
// 同步删除saas图层
String
result
=
saasRemoteService
.
deleteLayer
(
ak
,
layer
.
getSaasLayerId
());
log
.
info
(
"deleteLayer params:{} result:{}"
,
layerId
,
result
);
Result
<
Boolean
>
saasResult
=
TypeUtils
.
convertResult
(
result
);
if
(!
ResultEnum
.
SUCCESS
.
getCode
().
equals
(
saasResult
.
getCode
()))
{
return
Result
.
failure
(
saasResult
.
getMessage
());
}
}
// 更新状态为删除状态
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/CapacityQueryServiceImpl.java
View file @
1ab51cd
This diff is collapsed.
Click to expand it.
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
View file @
1ab51cd
...
...
@@ -91,6 +91,9 @@ public class OrderCreateServiceImpl implements OrderCreateService {
private
OrgGroupDao
orgGroupDao
;
@Autowired
private
OrgBranchDao
orgBranchDao
;
@Autowired
private
MsgService
msgService
;
@Autowired
...
...
@@ -154,13 +157,12 @@ public class OrderCreateServiceImpl implements OrderCreateService {
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
FENDAN_IS_TRANSCEND
.
getCode
()))
{
entity
.
setTranscend
(
1
);
}
OrgGroupEntity
groupDaoByCitycodeListLike
=
orgGroupDao
.
getByCitycodeListLike
(
adminDistrict
.
getResult
().
getSubNames
().
getCounty
());
entity
.
setOrgClusterId
(
groupDaoByCitycodeListLike
.
getClusterId
());
entity
.
setOrgBranchId
(
groupDaoByCitycodeListLike
.
getBranchId
());
entity
.
setOrgGroupId
(
groupDaoByCitycodeListLike
.
getGroupId
());
OrgBranchEntity
branchEntity
=
orgBranchDao
.
findByCitycodeListLike
(
"%"
+
adminDistrict
.
getResult
().
getSubNames
().
getCounty
()
+
"%"
);
entity
.
setOrgClusterId
(
branchEntity
.
getClusterId
());
entity
.
setOrgBranchId
(
branchEntity
.
getBranchId
());
//发送通知分部消息
MsgDTO
msgDTO
=
new
MsgDTO
();
msgDTO
.
set
GroupId
(
groupDaoByCitycodeListLike
.
getGroup
Id
());
msgDTO
.
set
BranchId
(
branchEntity
.
getBranch
Id
());
msgDTO
.
setType
(
0
);
msgDTO
.
setOrderIds
(
orderId
);
msgDTO
.
setContent
(
"有1条预约日期在"
+
entity
.
getExpectTimeBegin
().
toLocalDate
()
+
"的工单需人工外理"
);
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderInfoServiceImpl.java
View file @
1ab51cd
...
...
@@ -256,7 +256,15 @@ public class OrderInfoServiceImpl implements OrderInfoService {
return
Result
.
success
(
null
);
}
/**
* 改约
*
* @param req
* @return
* @throws BusinessException
*/
@Override
@Transactional
public
Result
<?>
orderReschedule
(
OrderReschedule
req
)
throws
BusinessException
{
// 判断是否分配到人和是否是今天
LocalDateTime
expectBegin
=
TimeUtils
.
IsoDateTime2LocalDateTime
(
req
.
getExpectBegin
());
...
...
@@ -353,22 +361,24 @@ public class OrderInfoServiceImpl implements OrderInfoService {
fendanReq
.
setLocation
(
location
);
Result
<
OrgTeamInfo
>
fendanResult
=
fendanService
.
fendanToGroupCapacity
(
fendanReq
,
2
,
order
.
getDt
(),
expectBegin
.
toLocalTime
(),
expectEnd
.
toLocalTime
());
if
(!
fendanResult
.
getCode
().
equals
(
ResultEnum
.
SUCCESS
.
getCode
())
||
ObjectUtil
.
isNull
(
fendanResult
.
getResult
()))
{
OrgBranchEntity
branchEntity
=
orgBranchDao
.
findByCitycodeListLike
(
"%"
+
adminDistrict
.
getResult
().
getSubNames
().
getCounty
()
+
"%"
);
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
FENDAN_IS_TRANSCEND
.
getCode
()))
{
order
.
setTranscend
(
1
);
}
OrgBranchEntity
branchEntity
=
orgBranchDao
.
findByCitycodeListLike
(
"%"
+
adminDistrict
.
getResult
().
getSubNames
().
getCounty
()
+
"%"
);
clusterId
=
branchEntity
.
getClusterId
();
branchId
=
branchEntity
.
getBranchId
();
sendMsg
(
branchEntity
.
getBranchId
(),
order
.
getOrderId
(),
req
.
getExpectBegin
());
}
else
{
// 根据分单工作队,填写clusterId/branchId/groupId/teamId等
OrgTeamInfo
teamInfo
=
fendanResult
.
getResult
();
clusterId
=
teamInfo
.
getClusterId
();
branchId
=
teamInfo
.
getBranchId
();
order
.
setOrgGroupId
(
teamInfo
.
getGroupId
());
order
.
setOrgTeamId
(
teamInfo
.
getTeamId
());
//处理超派,特殊时间段
order
.
setIsSpecialTime
(
CommonUtil
.
isSpecial
(
order
.
getExpectTimeBegin
().
toLocalTime
(),
order
.
getExpectTimeEnd
().
toLocalTime
(),
teamInfo
.
getWorkOn
(),
teamInfo
.
getWorkOff
()));
}
order
.
setOrgClusterId
(
clusterId
);
order
.
setOrgBranchId
(
branchId
);
//处理一家多单
order
=
handleMultipleOrders
(
order
);
}
else
if
(
isToday
&&
!
isBelong
)
{
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/ScheduleServiceImpl.java
View file @
1ab51cd
package
com
.
dituhui
.
pea
.
order
.
service
.
impl
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.Result
;
...
...
@@ -19,6 +21,7 @@ import org.springframework.stereotype.Service;
import
javax.persistence.criteria.Predicate
;
import
java.time.LocalDate
;
import
java.time.temporal.ChronoUnit
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -204,12 +207,16 @@ public class ScheduleServiceImpl implements ScheduleService {
item
.
setSkill
(
o
.
getSkill
());
item
.
setOrderStatus
(
o
.
getAppointmentStatus
());
item
.
setOrderStatusName
(
""
);
item
.
setDistance
(
3000
);
item
.
setDistance
(
o
.
getArriveDistance
()
);
item
.
setTimeType
(
"auto"
);
item
.
setExpectArriveDuration
(
"10分钟"
);
item
.
setArriveTime
(
"10分钟"
);
item
.
setExpectWorkDuration
(
"30分钟"
);
item
.
setWorkDuration
(
"30分钟"
);
item
.
setExpectArriveDuration
(
o
.
getArriveElapsed
()
+
"分钟"
);
item
.
setArriveTime
(
null
);
if
(
ObjectUtil
.
isAllNotEmpty
(
o
.
getPlanStartTime
(),
o
.
getPlanEndTime
()))
{
item
.
setExpectWorkDuration
(
LocalDateTimeUtil
.
between
(
o
.
getPlanStartTime
(),
o
.
getPlanEndTime
(),
ChronoUnit
.
MINUTES
)
+
"分钟"
);
}
if
(
ObjectUtil
.
isAllNotEmpty
(
o
.
getActualStartTime
(),
o
.
getActualEndTime
()))
{
item
.
setWorkDuration
(
LocalDateTimeUtil
.
between
(
o
.
getActualStartTime
(),
o
.
getActualEndTime
(),
ChronoUnit
.
MINUTES
)
+
"分钟"
);
}
orders
.
add
(
item
);
}
...
...
project-user/src/main/java/com/dituhui/pea/user/service/RoleService.java
View file @
1ab51cd
...
...
@@ -131,6 +131,10 @@ public class RoleService {
if
(
ObjectUtil
.
isNull
(
roleEntity
))
{
throw
new
BusinessException
(
StatusCodeEnum
.
ROLE_DOES_NOT_EXIST
);
}
List
<
UserRoleEntity
>
roleEntities
=
userRoleDao
.
findByRoleId
(
roleId
);
if
(
CollectionUtils
.
isNotEmpty
(
roleEntities
))
{
throw
new
BusinessException
(
StatusCodeEnum
.
RESOURCE_USER_EXISTS_ROLE
);
}
// 删除角色
roleDao
.
deleteById
(
roleId
);
// 删除用户和角色的关系
...
...
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