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 0f505160
authored
Nov 01, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:创单及展示添加cutoff逻辑
1 parent
0908004d
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
50 deletions
project-interface/src/main/java/com/dituhui/pea/util/DateUtil.java
project-order/src/main/java/com/dituhui/pea/order/dto/DispatchOrderListResp.java
project-order/src/main/java/com/dituhui/pea/order/entity/OrderInfoEntity.java
project-order/src/main/java/com/dituhui/pea/order/enums/AppointmentMethodEnum.java
project-order/src/main/java/com/dituhui/pea/order/enums/AppointmentStatus.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/utils/CommonUtil.java
project-interface/src/main/java/com/dituhui/pea/util/DateUtil.java
View file @
0f50516
...
@@ -556,6 +556,22 @@ public class DateUtil {
...
@@ -556,6 +556,22 @@ public class DateUtil {
return
false
;
return
false
;
}
}
/***
* @param localDateTime
* @return: boolean
* @Description: 根据LocalDateTime来判断是否是今天
*/
public
boolean
judgeTimeIsisTomorrow
(
LocalDateTime
localDateTime
)
{
LocalDateTime
startTime
=
LocalDate
.
now
().
plusDays
(
1
).
atTime
(
0
,
0
,
0
);
LocalDateTime
endTime
=
LocalDate
.
now
().
plusDays
(
1
).
atTime
(
23
,
59
,
59
);
//如果大于今天的开始日期,小于今天的结束日期
if
(
localDateTime
.
isAfter
(
startTime
)
&&
localDateTime
.
isBefore
(
endTime
))
{
return
true
;
}
return
false
;
}
/**
/**
* 根据日期转换到指定时间
* 根据日期转换到指定时间
* 2023-10-30+2023-10-22 21:21:12 -> 2023-10-30 21:21:12
* 2023-10-30+2023-10-22 21:21:12 -> 2023-10-30 21:21:12
...
...
project-order/src/main/java/com/dituhui/pea/order/dto/DispatchOrderListResp.java
View file @
0f50516
...
@@ -86,10 +86,19 @@ public class DispatchOrderListResp {
...
@@ -86,10 +86,19 @@ public class DispatchOrderListResp {
*/
*/
private
String
beanPriority
;
private
String
beanPriority
;
/**
/**
* 是否是特殊时间段,0否 1是 默认0
* 是否是特殊时间段,0否 1是 默认0
*/
*/
private
Integer
isSpecialTime
;
private
Integer
isSpecialTime
;
/**
* 是否是cutoff,0否 1是 默认0
*/
private
Integer
isCutoff
;
/**
* bean标签
*/
private
String
beanTags
;
}
}
}
}
project-order/src/main/java/com/dituhui/pea/order/entity/OrderInfoEntity.java
View file @
0f50516
...
@@ -234,4 +234,10 @@ public class OrderInfoEntity {
...
@@ -234,4 +234,10 @@ public class OrderInfoEntity {
*/
*/
@Column
(
name
=
"reason_for_failure"
)
@Column
(
name
=
"reason_for_failure"
)
private
String
reasonForFailure
;
private
String
reasonForFailure
;
/**
* 是否是cutoff,0否 1是 默认0
*/
@Column
(
name
=
"is_cutoff"
)
private
Integer
isCutoff
=
0
;
}
}
project-order/src/main/java/com/dituhui/pea/order/enums/AppointmentMethodEnum.java
0 → 100644
View file @
0f50516
package
com
.
dituhui
.
pea
.
order
.
enums
;
public
enum
AppointmentMethodEnum
{
// 指派方式(MANUAL人工/AUTO_NOW 自动立即/AUTO_BATCH/PROTECTION 自保点)
MANUAL
,
AUTO_NOW
,
AUTO_BATCH
,
PROTECTION
}
project-order/src/main/java/com/dituhui/pea/order/enums/AppointmentStatus.java
deleted
100644 → 0
View file @
0908004
package
com
.
dituhui
.
pea
.
order
.
enums
;
public
enum
AppointmentStatus
{
// 指派状态: INIT-待指派/PRE-预指派/CONFIRM-确认指派(通知BEAN)
INIT
(
"待指派"
),
PRE
(
"预指派"
),
CONFIRM
(
"确认指派"
);
private
final
String
description
;
AppointmentStatus
(
String
description
){
this
.
description
=
description
;
}
public
String
getDescription
()
{
return
description
;
}
public
static
String
getEnumName
(
AppointmentStatus
appointmentStatus
){
return
appointmentStatus
.
toString
();
}
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.java
View file @
0f50516
...
@@ -388,6 +388,8 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -388,6 +388,8 @@ public class DispatchServiceImpl implements DispatchService {
item
.
setBeanPriority
(
o
.
getBeanPriority
());
item
.
setBeanPriority
(
o
.
getBeanPriority
());
item
.
setOrgGroupId
(
o
.
getOrgGroupId
());
item
.
setOrgGroupId
(
o
.
getOrgGroupId
());
item
.
setIsSpecialTime
(
o
.
getIsSpecialTime
());
item
.
setIsSpecialTime
(
o
.
getIsSpecialTime
());
item
.
setBeanTags
(
o
.
getBeanTags
());
item
.
setIsCutoff
(
o
.
getIsCutoff
());
item
.
setOrgGroupName
(
groupMap
.
get
(
o
.
getOrgGroupId
()));
item
.
setOrgGroupName
(
groupMap
.
get
(
o
.
getOrgGroupId
()));
if
(
isContinue
&&
StringUtils
.
isNotEmpty
(
o
.
getMultipleOrders
()))
{
if
(
isContinue
&&
StringUtils
.
isNotEmpty
(
o
.
getMultipleOrders
()))
{
List
<
OrderInfoEntity
>
byMultipleOrders
=
orderInfoDao
.
findByMultipleOrdersAndOrderIdNot
(
o
.
getMultipleOrders
(),
o
.
getOrderId
());
List
<
OrderInfoEntity
>
byMultipleOrders
=
orderInfoDao
.
findByMultipleOrdersAndOrderIdNot
(
o
.
getMultipleOrders
(),
o
.
getOrderId
());
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
View file @
0f50516
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
package
com
.
dituhui
.
pea
.
order
.
service
.
impl
;
package
com
.
dituhui
.
pea
.
order
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.common.ResultEnum
;
import
com.dituhui.pea.common.ResultEnum
;
import
com.dituhui.pea.enums.StatusCodeEnum
;
import
com.dituhui.pea.enums.StatusCodeEnum
;
...
@@ -27,7 +28,7 @@ import com.dituhui.pea.order.dto.param.Location;
...
@@ -27,7 +28,7 @@ import com.dituhui.pea.order.dto.param.Location;
import
com.dituhui.pea.order.dto.param.OrderDTO
;
import
com.dituhui.pea.order.dto.param.OrderDTO
;
import
com.dituhui.pea.order.dto.param.OrgTeamInfo
;
import
com.dituhui.pea.order.dto.param.OrgTeamInfo
;
import
com.dituhui.pea.order.entity.*
;
import
com.dituhui.pea.order.entity.*
;
import
com.dituhui.pea.order.enums.Appointment
Status
;
import
com.dituhui.pea.order.enums.Appointment
MethodEnum
;
import
com.dituhui.pea.order.enums.OrderFlowEnum
;
import
com.dituhui.pea.order.enums.OrderFlowEnum
;
import
com.dituhui.pea.order.enums.OrderStatusEnum
;
import
com.dituhui.pea.order.enums.OrderStatusEnum
;
import
com.dituhui.pea.order.service.*
;
import
com.dituhui.pea.order.service.*
;
...
@@ -128,7 +129,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -128,7 +129,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
@Override
@Override
@Transactional
@Transactional
public
Result
<?>
createOrder
(
OrderDTO
.
OrderCreateRequest
req
)
{
public
Result
<?>
createOrder
(
OrderDTO
.
OrderCreateRequest
req
)
{
log
.
info
(
"[createOrder]
current XID: {}"
,
RootContext
.
getXID
(
));
log
.
info
(
"[createOrder]
req: {}"
,
JSONObject
.
toJSONString
(
req
));
OrderInfoEntity
entity
=
new
OrderInfoEntity
();
OrderInfoEntity
entity
=
new
OrderInfoEntity
();
String
orderId
=
req
.
getOrderId
();
String
orderId
=
req
.
getOrderId
();
if
(
StringUtils
.
isEmpty
(
orderId
))
{
if
(
StringUtils
.
isEmpty
(
orderId
))
{
...
@@ -140,14 +141,13 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -140,14 +141,13 @@ public class OrderCreateServiceImpl implements OrderCreateService {
return
Result
.
failed
(
StatusCodeEnum
.
ORDER_EXISTS
);
return
Result
.
failed
(
StatusCodeEnum
.
ORDER_EXISTS
);
}
}
// 分单处理
String
peaBrand
=
fixBrand
(
req
.
getBrand
());
String
peaBrand
=
fixBrand
(
req
.
getBrand
());
// location
Location
location
=
req
.
getLocation
();
Location
location
=
req
.
getLocation
();
//
先处理时间,后面用
//
预处理字段
entity
.
setExpectTimeBegin
(
DateUtil
.
fromDate
(
req
.
getExpectBegin
()));
entity
.
setExpectTimeBegin
(
DateUtil
.
fromDate
(
req
.
getExpectBegin
()));
entity
.
setExpectTimeEnd
(
DateUtil
.
fromDate
(
req
.
getExpectEnd
()));
entity
.
setExpectTimeEnd
(
DateUtil
.
fromDate
(
req
.
getExpectEnd
()));
entity
.
setAppointmentStatus
(
AppointmentStatus
.
INIT
.
getDescription
());
entity
.
setAppointmentStatus
(
OrderFlowEnum
.
INIT
.
name
());
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
AUTO_NOW
.
name
());
//获取省市区
//获取省市区
AdministrativeDistrictReq
administrativeDistrictReq
=
new
AdministrativeDistrictReq
();
AdministrativeDistrictReq
administrativeDistrictReq
=
new
AdministrativeDistrictReq
();
administrativeDistrictReq
.
setPoints
(
location
.
getLongitude
()
+
","
+
location
.
getLatitude
());
administrativeDistrictReq
.
setPoints
(
location
.
getLongitude
()
+
","
+
location
.
getLatitude
());
...
@@ -157,21 +157,19 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -157,21 +157,19 @@ 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
());
}
}
// 分单处理
Result
<
OrgTeamInfo
>
fendanResult
=
fendanService
.
fendanToGroupCapacity
(
req
,
2
,
entity
.
getExpectTimeBegin
().
toLocalDate
(),
entity
.
getExpectTimeBegin
().
toLocalTime
(),
entity
.
getExpectTimeEnd
().
toLocalTime
());
Result
<
OrgTeamInfo
>
fendanResult
=
fendanService
.
fendanToGroupCapacity
(
req
,
2
,
entity
.
getExpectTimeBegin
().
toLocalDate
(),
entity
.
getExpectTimeBegin
().
toLocalTime
(),
entity
.
getExpectTimeEnd
().
toLocalTime
());
if
(!
fendanResult
.
getCode
().
equals
(
ResultEnum
.
SUCCESS
.
getCode
())
||
ObjectUtil
.
isNull
(
fendanResult
.
getResult
()))
{
if
(!
fendanResult
.
getCode
().
equals
(
ResultEnum
.
SUCCESS
.
getCode
())
||
ObjectUtil
.
isNull
(
fendanResult
.
getResult
()))
{
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
FENDAN_IS_TRANSCEND
.
getCode
()))
{
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
FENDAN_IS_TRANSCEND
.
getCode
()))
{
// 处理超派
entity
.
setTranscend
(
1
);
entity
.
setTranscend
(
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
());
entity
.
setOrgBranchId
(
branchEntity
.
getBranchId
());
entity
.
setOrgBranchId
(
branchEntity
.
getBranchId
());
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
MANUAL
.
name
());
//发送通知分部消息
//发送通知分部消息
MsgDTO
msgDTO
=
new
MsgDTO
();
sendMsg
(
branchEntity
.
getBranchId
(),
orderId
,
entity
.
getExpectTimeBegin
().
toLocalDate
());
msgDTO
.
setBranchId
(
branchEntity
.
getBranchId
());
msgDTO
.
setType
(
0
);
msgDTO
.
setOrderIds
(
orderId
);
msgDTO
.
setContent
(
"有1条预约日期在"
+
entity
.
getExpectTimeBegin
().
toLocalDate
()
+
"的工单需人工外理"
);
msgService
.
add
(
msgDTO
);
}
else
{
}
else
{
// 根据分单工作队,填写clusterId/branchId/groupId/teamId等
// 根据分单工作队,填写clusterId/branchId/groupId/teamId等
OrgTeamInfo
teamInfo
=
fendanResult
.
getResult
();
OrgTeamInfo
teamInfo
=
fendanResult
.
getResult
();
...
@@ -179,11 +177,25 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -179,11 +177,25 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setOrgBranchId
(
teamInfo
.
getBranchId
());
entity
.
setOrgBranchId
(
teamInfo
.
getBranchId
());
entity
.
setOrgGroupId
(
teamInfo
.
getGroupId
());
entity
.
setOrgGroupId
(
teamInfo
.
getGroupId
());
entity
.
setOrgTeamId
(
teamInfo
.
getTeamId
());
entity
.
setOrgTeamId
(
teamInfo
.
getTeamId
());
entity
.
setAppointmentStatus
(
AppointmentStatus
.
PRE
.
getDescription
());
entity
.
setAppointmentStatus
(
OrderFlowEnum
.
PRE
.
name
());
//处理超派,特殊时间段
//特殊时间段
entity
.
setIsSpecialTime
(
CommonUtil
.
isSpecial
(
entity
.
getExpectTimeBegin
().
toLocalTime
(),
Integer
special
=
CommonUtil
.
isSpecial
(
entity
.
getExpectTimeBegin
().
toLocalTime
(),
entity
.
getExpectTimeEnd
().
toLocalTime
(),
teamInfo
.
getWorkOn
(),
teamInfo
.
getWorkOff
()));
entity
.
getExpectTimeEnd
().
toLocalTime
(),
teamInfo
.
getWorkOn
(),
teamInfo
.
getWorkOff
());
Integer
cutoff
=
CommonUtil
.
isCutoff
(
entity
.
getExpectTimeBegin
(),
teamInfo
.
getWorkOff
());
// 处理cutoff 动态排班结束后创建的当日单和次日单
boolean
isToday
=
DateUtil
.
judgeTimeIsToday
(
entity
.
getExpectTimeBegin
());
boolean
isTomorrow
=
DateUtil
.
judgeTimeIsisTomorrow
(
entity
.
getExpectTimeBegin
());
// 特殊时间段,当天单,cutoff需要人工处理
if
(
isToday
||
(
isTomorrow
&&
cutoff
==
1
)
||
special
==
1
)
{
//判断是否在今天cutoff之后
entity
.
setIsCutoff
(
cutoff
);
entity
.
setIsSpecialTime
(
special
);
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
MANUAL
.
name
());
//发送通知分部消息
sendMsg
(
teamInfo
.
getBranchId
(),
orderId
,
entity
.
getExpectTimeBegin
().
toLocalDate
());
}
}
}
// 字段转换
entity
.
setSource
(
req
.
getSource
());
entity
.
setSource
(
req
.
getSource
());
entity
.
setOrderId
(
orderId
);
entity
.
setOrderId
(
orderId
);
entity
.
setName
(
req
.
getName
());
entity
.
setName
(
req
.
getName
());
...
@@ -197,7 +209,8 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -197,7 +209,8 @@ public class OrderCreateServiceImpl implements OrderCreateService {
// 使用期望时间来初始化计划时间,后面在指派环节更新为真正的有效的计划时间
// 使用期望时间来初始化计划时间,后面在指派环节更新为真正的有效的计划时间
entity
.
setPlanStartTime
(
entity
.
getExpectTimeBegin
());
entity
.
setPlanStartTime
(
entity
.
getExpectTimeBegin
());
entity
.
setPlanEndTime
(
entity
.
getExpectTimeEnd
());
entity
.
setPlanEndTime
(
entity
.
getExpectTimeEnd
());
entity
.
setApplyNote
(
req
.
getDescription
());
// order_request的description字段,仅仅用于内部备注,不对外
// order_request的description字段,仅仅用于内部备注,不对外
entity
.
setApplyNote
(
req
.
getDescription
());
entity
.
setDt
(
entity
.
getExpectTimeBegin
().
toLocalDate
());
entity
.
setDt
(
entity
.
getExpectTimeBegin
().
toLocalDate
());
entity
.
setSubId
(
newSubId
(
entity
.
getOrderId
(),
entity
.
getDt
()));
entity
.
setSubId
(
newSubId
(
entity
.
getOrderId
(),
entity
.
getDt
()));
entity
.
setX
(
req
.
getLocation
().
getLongitude
().
toString
());
entity
.
setX
(
req
.
getLocation
().
getLongitude
().
toString
());
...
@@ -205,38 +218,44 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -205,38 +218,44 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setAddress
(
location
.
getAddress
());
entity
.
setAddress
(
location
.
getAddress
());
entity
.
setAddressId
(
location
.
getAddressId
());
entity
.
setAddressId
(
location
.
getAddressId
());
// 默认值
// 默认值
entity
.
setAppointmentStatus
(
OrderFlowEnum
.
INIT
.
name
());
//
entity.setAppointmentStatus(OrderFlowEnum.INIT.name());
entity
.
setBeanStatus
(
"OPEN"
);
entity
.
setBeanStatus
(
"OPEN"
);
entity
.
setBeanSubStatus
(
""
);
entity
.
setBeanSubStatus
(
""
);
entity
.
setAppointmentMethod
(
"AUTO_NOW"
);
entity
.
setWorkshop
(
false
);
entity
.
setWorkshop
(
false
);
// 处理工程师
entity
.
setIsAppointEngineer
(
req
.
getIsAppointEngineer
());
entity
.
setIsAppointEngineer
(
req
.
getIsAppointEngineer
());
String
appointEngineerCodes
=
CollectionUtils
.
isEmpty
(
req
.
getAppointEngineerCodes
())
?
""
:
String
.
join
(
","
,
req
.
getAppointEngineerCodes
());
String
appointEngineerCodes
=
CollectionUtils
.
isEmpty
(
req
.
getAppointEngineerCodes
())
?
""
:
String
.
join
(
","
,
req
.
getAppointEngineerCodes
());
entity
.
setAppointEngineerCodes
(
appointEngineerCodes
);
entity
.
setAppointEngineerCodes
(
appointEngineerCodes
);
// 处理技能和标签
SkillInfoEntity
skillInfoEntity
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
peaBrand
,
req
.
getProductType
(),
req
.
getServiceType
());
SkillInfoEntity
skillInfoEntity
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
peaBrand
,
req
.
getProductType
(),
req
.
getServiceType
());
assert
skillInfoEntity
!=
null
;
assert
skillInfoEntity
!=
null
;
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
());
entity
.
setBeanTags
(
joinTags
);
entity
.
setBeanTags
(
joinTags
);
entity
.
setBeanPriority
(
req
.
getPriority
());
entity
.
setBeanPriority
(
req
.
getPriority
());
entity
.
setIsMultiple
(
joinTags
.
contains
(
"重物搬运"
)
?
1
:
0
);
entity
.
setIsMultiple
(
joinTags
.
contains
(
"重物搬运"
)
?
1
:
0
);
//一家多单
//一家多单
Result
<
String
>
addMultipleOrders
=
orderInfoService
.
addMultipleOrders
(
entity
.
getDt
(),
location
.
getAddressId
(),
orderId
);
Result
<
String
>
addMultipleOrders
=
orderInfoService
.
addMultipleOrders
(
entity
.
getDt
(),
location
.
getAddressId
(),
orderId
);
entity
.
setMultipleOrders
(
addMultipleOrders
.
getResult
());
entity
.
setMultipleOrders
(
addMultipleOrders
.
getResult
());
// todo 服务单状态、预约状态等
// 记录订单和节点
orderInfoDao
.
save
(
entity
);
orderInfoDao
.
save
(
entity
);
// 登记
commonService
.
addOrderEvent
(
orderId
,
""
,
req
.
getSource
(),
"API"
,
OrderStatusEnum
.
CREATE
.
getDescription
(),
OrderStatusEnum
.
CREATE
.
getDescription
(),
""
);
commonService
.
addOrderEvent
(
orderId
,
""
,
req
.
getSource
(),
"API"
,
OrderStatusEnum
.
CREATE
.
getDescription
(),
OrderStatusEnum
.
CREATE
.
getDescription
(),
""
);
// 指派检查,简单处理,遇到第一个可以指派的就停止检查
// tryVirtualAppointment(entity, req.getSource(), teamId);
return
Result
.
success
(
null
);
return
Result
.
success
(
null
);
}
}
private
void
sendMsg
(
String
branchId
,
String
orderId
,
LocalDate
toLocalDate
)
{
MsgDTO
msgDTO
=
new
MsgDTO
();
msgDTO
.
setBranchId
(
branchId
);
msgDTO
.
setType
(
0
);
msgDTO
.
setOrderIds
(
orderId
);
msgDTO
.
setContent
(
"有1条预约日期在"
+
toLocalDate
+
"的工单需人工外理"
);
msgService
.
add
(
msgDTO
);
}
private
void
tryVirtualAppointment
(
OrderInfoEntity
thisOrderEntity
,
String
source
,
String
teamId
)
{
private
void
tryVirtualAppointment
(
OrderInfoEntity
thisOrderEntity
,
String
source
,
String
teamId
)
{
try
{
try
{
List
<
String
>
engineerCodes
=
engineerUtils
.
getEngineersByLevel
(
"team"
,
teamId
).
stream
()
List
<
String
>
engineerCodes
=
engineerUtils
.
getEngineersByLevel
(
"team"
,
teamId
).
stream
()
...
...
project-order/src/main/java/com/dituhui/pea/order/utils/CommonUtil.java
View file @
0f50516
...
@@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil;
...
@@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil;
import
com.dituhui.pea.util.DateUtil
;
import
com.dituhui.pea.util.DateUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.LocalTime
;
import
java.util.*
;
import
java.util.*
;
...
@@ -74,7 +76,20 @@ public class CommonUtil {
...
@@ -74,7 +76,20 @@ public class CommonUtil {
public
static
Integer
isSpecial
(
LocalTime
expectBegin
,
LocalTime
expectEnd
,
String
strOn
,
String
strOff
)
{
public
static
Integer
isSpecial
(
LocalTime
expectBegin
,
LocalTime
expectEnd
,
String
strOn
,
String
strOff
)
{
LocalTime
workOn
=
LocalTime
.
parse
(
strOn
+
":00"
,
DateUtil
.
TIME_FORMATTER
);
LocalTime
workOn
=
LocalTime
.
parse
(
strOn
+
":00"
,
DateUtil
.
TIME_FORMATTER
);
LocalTime
workOff
=
LocalTime
.
parse
(
strOff
+
":00"
,
DateUtil
.
TIME_FORMATTER
);
LocalTime
workOff
=
LocalTime
.
parse
(
strOff
+
":00"
,
DateUtil
.
TIME_FORMATTER
);
if
(
expectBegin
.
isBefore
(
workOn
)
||
expectEnd
.
isAfter
(
workOff
))
{
if
(
expectBegin
.
isBefore
(
workOn
)
||
expectBegin
.
isAfter
(
workOff
)
||
expectEnd
.
isAfter
(
workOff
)
||
expectEnd
.
isBefore
(
workOn
))
{
return
1
;
}
return
0
;
}
/**
* 判断是否cutoff
*
* @return
*/
public
static
Integer
isCutoff
(
LocalDateTime
localTime
,
String
strOff
)
{
LocalDateTime
workOff
=
LocalDate
.
now
().
atTime
(
Integer
.
parseInt
(
strOff
.
split
(
":"
)[
0
]),
Integer
.
parseInt
(
strOff
.
split
(
":"
)[
1
]),
0
);
if
(
localTime
.
isAfter
(
workOff
))
{
return
1
;
return
1
;
}
}
return
0
;
return
0
;
...
...
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