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 d8211205
authored
Jul 18, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://zhangguoping@gitlab.dituhui.com/bsh/project/pr…
…oject.git into develop
2 parents
b890dd07
a4a3fdbc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
16 deletions
project-order/pom.xml
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.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/resources/application.yaml
project-order/pom.xml
View file @
d821120
...
...
@@ -108,6 +108,12 @@
<groupId>
com.fasterxml.jackson.datatype
</groupId>
<artifactId>
jackson-datatype-jsr310
</artifactId>
</dependency>
<dependency>
<groupId>
io.sentry
</groupId>
<artifactId>
sentry-spring-boot-starter
</artifactId>
<version>
6.22.0
</version>
</dependency>
</dependencies>
<build>
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.java
View file @
d821120
...
...
@@ -126,20 +126,18 @@ public class DispatchServiceImpl implements DispatchService {
public
Result
<?>
getDispatchEngineerOrderList
(
DispatchEngineerOrderListReq
reqDTO
)
throws
BusinessException
{
// 派工台技术员预约单列表
// 获取技能耗时
HashMap
<
String
,
Integer
>
skillTakeTime
=
this
.
querySkillTakeTime
();
// 获取技能信息
HashMap
<
String
,
SkillInfo
>
skillInfo
=
this
.
querySkillInfo
();
// 获取groupIds
List
<
String
>
groupIds
=
this
.
queryOrgGroup
Ids
(
reqDTO
.
getLevelType
(),
reqDTO
.
getLevelValue
(),
reqDTO
.
getBranchIds
(),
List
<
String
>
teamIds
=
this
.
queryOrgTeam
Ids
(
reqDTO
.
getLevelType
(),
reqDTO
.
getLevelValue
(),
reqDTO
.
getBranchIds
(),
reqDTO
.
getGroupIds
(),
reqDTO
.
getTeamIds
());
if
(
group
Ids
.
isEmpty
())
{
if
(
team
Ids
.
isEmpty
())
{
throw
new
BusinessException
(
"大区/分部/小组组织结构配置可能错误或缺失,请联系管理员/研发"
);
}
// 获取engineer列表
List
<
EngineerInfo
>
engineers
=
this
.
queryEngineers
(
group
Ids
,
reqDTO
.
getEngineerCodes
(),
reqDTO
.
getKey
());
List
<
EngineerInfo
>
engineers
=
this
.
queryEngineers
(
team
Ids
,
reqDTO
.
getEngineerCodes
(),
reqDTO
.
getKey
());
if
(
engineers
.
isEmpty
())
{
// 该group下没有技术员,返回空
DispatchEngineerOrderListResp
res
=
new
DispatchEngineerOrderListResp
();
...
...
@@ -398,13 +396,16 @@ public class DispatchServiceImpl implements DispatchService {
}
private
List
<
EngineerInfo
>
queryEngineers
(
List
<
String
>
group
Ids
,
List
<
String
>
engineerCodes
,
String
key
)
{
private
List
<
EngineerInfo
>
queryEngineers
(
List
<
String
>
team
Ids
,
List
<
String
>
engineerCodes
,
String
key
)
{
// 通过groupIds获取技术员列表
LambdaQueryWrapper
<
EngineerInfo
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
in
(
EngineerInfo:
:
getGroupId
,
groupIds
);
lqw
.
eq
(
EngineerInfo:
:
getBeanStatus
,
1
);
lqw
.
in
(
ListUtils
.
isNotEmpty
(
engineerCodes
),
EngineerInfo:
:
getEngineerCode
,
engineerCodes
);
String
inTeamIds
=
"'"
+
teamIds
.
stream
().
map
(
Object:
:
toString
).
collect
(
Collectors
.
joining
(
"','"
))
+
"'"
;
String
sql
=
String
.
format
(
"select 1 from org_team_engineer ot where ot.engineer_code = engineer_info.engineer_code and ot.team_id in (%s)"
,
inTeamIds
);
lqw
.
exists
(
sql
);
if
(
StringUtils
.
isNotEmpty
(
key
))
{
lqw
.
and
(
w
->
w
.
like
(
EngineerInfo:
:
getPhone
,
key
)
...
...
@@ -418,7 +419,7 @@ public class DispatchServiceImpl implements DispatchService {
return
engineerInfoMPDao
.
selectList
(
lqw
);
}
private
List
<
String
>
queryOrg
Group
Ids
(
String
levelType
,
String
levelIds
,
List
<
String
>
branchIds
,
List
<
String
>
groupIds
,
List
<
String
>
teamIds
)
{
private
List
<
String
>
queryOrg
Team
Ids
(
String
levelType
,
String
levelIds
,
List
<
String
>
branchIds
,
List
<
String
>
groupIds
,
List
<
String
>
teamIds
)
{
LambdaQueryWrapper
<
OrgTeam
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
eq
(
levelType
.
equals
(
"cluster"
),
OrgTeam:
:
getClusterId
,
levelIds
);
lqw
.
eq
(
levelType
.
equals
(
"branch"
),
OrgTeam:
:
getBranchId
,
levelIds
);
...
...
@@ -427,8 +428,8 @@ public class DispatchServiceImpl implements DispatchService {
lqw
.
in
(
ListUtils
.
isNotEmpty
(
groupIds
),
OrgTeam:
:
getGroupId
,
groupIds
);
lqw
.
in
(
ListUtils
.
isNotEmpty
(
teamIds
),
OrgTeam:
:
getTeamId
,
teamIds
);
List
<
OrgTeam
>
group
s
=
orgTeamMPDao
.
selectList
(
lqw
);
return
groups
.
stream
().
map
(
OrgTeam:
:
getGroup
Id
).
collect
(
Collectors
.
toList
());
List
<
OrgTeam
>
team
s
=
orgTeamMPDao
.
selectList
(
lqw
);
return
teams
.
stream
().
map
(
OrgTeam:
:
getTeam
Id
).
collect
(
Collectors
.
toList
());
}
private
HashMap
<
String
,
Integer
>
querySkillTakeTime
()
{
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderAssignImpl.java
View file @
d821120
...
...
@@ -70,20 +70,20 @@ public class OrderAssignImpl implements OrderAssign {
String
date
=
TimeUtils
.
timestamp2DateTime
(
order
.
getExpectTimeBegin
(),
TimeUtils
.
DATE_GAP_FORMAT
);
// 获取
group内的小组成
员
// 获取
符合筛选条件的技术
员
List
<
String
>
engineerCodes
=
this
.
searchEngineerCodes
(
order
,
distance
,
key
,
recommend
);
List
<
EngineerInfo
>
engineers
=
engineerInfoMPDao
.
selectByEngineerCodes
(
engineerCodes
);
List
<
OrderAssignRecommendResp
.
Engineer
>
items
=
new
ArrayList
<>();
for
(
EngineerInfo
engineer
:
engineers
)
{
OrderAssignCheck
.
Result
result
=
orderAssignCheck
.
orderAssignCheck
(
orderId
,
engineer
.
getEngineerCode
());
log
.
info
(
"指派检查结果:{}"
,
result
);
if
(!
result
.
getCanAssign
())
{
continue
;
}
// 获取已技术员已指派订单列表
List
<
OrderAppointment
>
orderAppointments
=
orderAppointmentMPDao
.
selectByEngineerCodeAndDt
(
engineer
.
getEngineerCode
(),
order
.
getDt
());
// 获取订单tips
...
...
@@ -306,13 +306,14 @@ public class OrderAssignImpl implements OrderAssign {
return
new
ArrayList
<>();
}
/*
if (StringUtils.isEmpty(distance)) {
return new ArrayList<>(engineerCodes1);
}
//进行距离匹配TODO
*/
return
n
ull
;
return
n
ew
ArrayList
<>(
engineerCodes1
)
;
}
private
Set
<
String
>
searchEngineerByRecommend
(
OrderRequest
order
,
String
recommend
)
{
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
View file @
d821120
...
...
@@ -120,7 +120,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setExpectTimeBegin
(
LocalDateTimeUtil
.
parse
(
req
.
getExpectBegin
(),
PATTERN_DATETIME
));
entity
.
setExpectTimeEnd
(
LocalDateTimeUtil
.
parse
(
req
.
getExpectEnd
(),
PATTERN_DATETIME
));
entity
.
setExpectTimeDesc
(
req
.
getExpectDesc
());
entity
.
set
Description
(
req
.
getDescription
());
entity
.
set
ApplyNote
(
req
.
getDescription
());
// order_request的description字段,仅仅用于内部备注,不对外
entity
.
setDt
(
LocalDateTimeUtil
.
parseDate
(
req
.
getExpectBegin
().
substring
(
0
,
10
),
PATTERN_DATE
));
// location
LocationDTO
location
=
req
.
getLocation
();
...
...
@@ -128,7 +128,6 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setCity
(
location
.
getCity
());
entity
.
setCounty
(
location
.
getDistrict
());
entity
.
setAddress
(
location
.
getFormattedAddress
());
// 根据分单,填写clusterId/branchId/groupId/teamId等
List
<
String
>
blockIds
=
null
;
List
<
String
>
layerIds
=
capacityUtils
.
getLayers
(
req
.
getBrand
(),
req
.
getType
(),
req
.
getSkill
());
...
...
@@ -152,6 +151,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
// 遍历工作队,每个工作队
String
teamId
=
teamIds
.
get
(
0
);
OrgTeamEntity
teamEntity
=
orgTeamDao
.
getByTeamId
(
teamId
);
// 根据分单,填写clusterId/branchId/groupId/teamId等
entity
.
setOrgClusterId
(
teamEntity
.
getClusterId
());
entity
.
setOrgBranchId
(
teamEntity
.
getBranchId
());
entity
.
setOrgGroupId
(
teamEntity
.
getGroupId
());
...
...
project-order/src/main/resources/application.yaml
View file @
d821120
...
...
@@ -46,3 +46,12 @@ mybatis-plus:
id-type
:
auto
configuration
:
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
sentry
:
dsn
:
http://85293a9310fc4a8187422a7a257fc1ba@sentry.zjhuixinyun.com/8
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
tracesSampleRate
:
1.0
exception-resolver-order
:
-2147483647
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