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 c24594d8
authored
Jul 31, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-order-create' into develop
2 parents
6fd945d0
ab111cd5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
project-order/src/main/java/com/dituhui/pea/order/entity/OrderInfoEntity.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/entity/OrderInfoEntity.java
View file @
c24594d
...
...
@@ -49,6 +49,9 @@ public class OrderInfoEntity {
@Column
(
name
=
"y"
,
nullable
=
false
,
length
=
20
)
private
String
y
=
"0"
;
@Column
(
name
=
"bean_brand"
,
nullable
=
false
,
length
=
20
)
private
String
beanBrand
;
@Column
(
name
=
"brand"
,
nullable
=
false
,
length
=
20
)
private
String
brand
;
...
...
@@ -118,9 +121,12 @@ public class OrderInfoEntity {
@Column
(
name
=
"appointment_method"
,
length
=
20
,
columnDefinition
=
"varchar(20) default 'AUTO_BATCH'"
)
private
String
appointmentMethod
;
@Column
(
name
=
"appointment_status"
,
nullable
=
true
,
length
=
20
,
columnDefinition
=
"varchar(20) default 'INIT'"
)
@Column
(
name
=
"appointment_status"
,
length
=
20
,
columnDefinition
=
"varchar(20) default 'INIT'"
)
private
String
appointmentStatus
;
@Column
(
name
=
"dispatcher"
,
length
=
20
,
columnDefinition
=
"varchar(20) default ''"
)
private
String
dispatcher
;
@Column
(
name
=
"order_status"
,
length
=
20
,
columnDefinition
=
"varchar(20) default 'NORMAL'"
)
private
String
orderStatus
=
"NORMAL"
;
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
View file @
c24594d
...
...
@@ -119,7 +119,8 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setOrderId
(
orderId
);
entity
.
setName
(
req
.
getName
());
entity
.
setPhone
(
req
.
getPhone
());
entity
.
setBrand
(
req
.
getBrand
());
entity
.
setBeanBrand
(
req
.
getBrand
());
entity
.
setBrand
(
fixBrand
(
req
.
getBrand
()));
entity
.
setType
(
req
.
getType
());
entity
.
setSkill
(
req
.
getSkill
());
entity
.
setFaultDescribe
(
req
.
getFaultDescribe
());
...
...
@@ -192,17 +193,17 @@ public class OrderCreateServiceImpl implements OrderCreateService {
commonService
.
addOrderEvent
(
orderId
,
""
,
req
.
getSource
(),
"API"
,
"创建订单"
,
"创建订单"
,
""
);
// 指派检查,简单处理,遇到第一个可以指派的就停止检查
tryVirtualAppointment
(
req
,
entity
,
teamId
);
tryVirtualAppointment
(
entity
,
req
.
getSource
()
,
teamId
);
return
Result
.
success
(
null
);
}
private
void
tryVirtualAppointment
(
Order
CreateReqDTO
req
,
OrderInfoEntity
entity
,
String
teamId
)
{
private
void
tryVirtualAppointment
(
Order
InfoEntity
entity
,
String
source
,
String
teamId
)
{
// todo 等王力那边修改后,这边再进行整合,需要返回当前工单、后面的一个工单的数据情况,这边再进行修改
try
{
List
<
String
>
engineerCodes
=
engineerUtils
.
getEngineersByLevel
(
"team"
,
teamId
).
stream
()
.
map
(
EngineerInfoEntity:
:
getEngineerCode
).
collect
(
Collectors
.
toList
());
List
<
String
>
matchEngineerCodes
=
engineerSkillDao
.
findAllByBrandAndTypeAndSkillAndEngineerCodeIn
(
req
.
getBrand
(),
req
.
getType
(),
req
.
getSkill
(),
engineerCodes
).
stream
()
List
<
String
>
matchEngineerCodes
=
engineerSkillDao
.
findAllByBrandAndTypeAndSkillAndEngineerCodeIn
(
entity
.
getBrand
(),
entity
.
getType
(),
entity
.
getSkill
(),
engineerCodes
).
stream
()
.
map
(
EngineerSkillEntity:
:
getEngineerCode
).
collect
(
Collectors
.
toList
());
String
assignEngineerCode
=
null
;
OrderAssignCheck
.
Result
checkResult
=
null
;
...
...
@@ -223,7 +224,8 @@ public class OrderCreateServiceImpl implements OrderCreateService {
EngineerInfoEntity
engineerInfo
=
engineerInfoDao
.
getByEngineerCode
(
assignEngineerCode
);
entity
.
setEngineerName
(
engineerInfo
.
getName
());
entity
.
setEngineerPhone
(
engineerInfo
.
getPhone
());
entity
.
setAppointmentStatus
(
"VIRTUAL"
);
entity
.
setAppointmentStatus
(
"PRE"
);
entity
.
setDispatcher
(
"AUTO_NOW"
);
entity
.
setPlanStartTime
(
checkResult
.
getStart
());
entity
.
setPlanEndTime
(
checkResult
.
getEnd
());
entity
.
setArriveDistance
(
checkResult
.
getDistanceAddition
());
...
...
@@ -233,7 +235,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
// 如果影响到原有工单,修改原有工单
// 登记
commonService
.
addOrderEvent
(
entity
.
getOrderId
(),
entity
.
getSubId
(),
req
.
getSource
()
,
"API"
,
"虚拟指派"
,
"虚拟指派"
,
""
);
commonService
.
addOrderEvent
(
entity
.
getOrderId
(),
entity
.
getSubId
(),
source
,
"API"
,
"虚拟指派"
,
"虚拟指派"
,
""
);
}
log
.
info
(
"==== 已经完成虚拟指派 ===="
);
}
catch
(
Exception
e
)
{
...
...
@@ -244,4 +246,12 @@ public class OrderCreateServiceImpl implements OrderCreateService {
private
String
newSubId
(
String
orderId
,
LocalDate
date
)
{
return
String
.
format
(
"%s_%s"
,
orderId
,
DateUtils
.
formatDateTime
(
LocalDateTime
.
now
(),
"MMdd"
));
}
private
String
fixBrand
(
String
brand
){
if
(!
brand
.
equals
(
"嘉格纳"
)){
return
"博世/西门子以及其他品牌"
;
}
else
{
return
brand
;
}
}
}
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