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 e509492e
authored
Nov 15, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复指定排除工程师逻辑
1 parent
d64e0934
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
project-dispatch/src/main/java/com/dituhui/pea/dispatch/constraint/DispatchConstraintProvider.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/service/impl/SolveServiceImpl.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/constraint/DispatchConstraintProvider.java
View file @
e509492
...
...
@@ -93,16 +93,18 @@ public class DispatchConstraintProvider implements ConstraintProvider {
.
asConstraint
(
ConstraintNameEnum
.
technicianCapacityMatch
.
name
());
}
protected
Constraint
dispatchedMatch
(
ConstraintFactory
factory
)
{
return
factory
.
forEach
(
Customer
.
class
).
filter
(
customer
->
// 已分配
(
customer
.
getDispatchedTechnicianCode
()
!=
null
&&
(
customer
.
getTechnician
()
==
null
||
!
StringUtils
.
equals
(
customer
.
getDispatchedTechnicianCode
(),
customer
.
getTechnician
().
getCode
())))
||
(
customer
.
getExclusiveTechnicianCode
()
!=
null
&&
(
customer
.
getTechnician
()
==
null
||
StrUtil
.
contains
(
","
+
customer
.
getExclusiveTechnicianCode
()
+
","
,
","
+
customer
.
getTechnician
().
getCode
()
+
","
))))
.
penalizeLong
(
HardSoftLongScore
.
ONE_HARD
,
customer
->
50
)
.
asConstraint
(
ConstraintNameEnum
.
dispatchedMatch
.
name
());
}
protected
Constraint
dispatchedMatch
(
ConstraintFactory
factory
)
{
return
factory
.
forEach
(
Customer
.
class
).
filter
(
customer
->
// 已分配但是分给了别人
(
customer
.
getDispatchedTechnicianCode
()
!=
null
&&
customer
.
getTechnician
()
!=
null
&&
!
StringUtils
.
equals
(
customer
.
getDispatchedTechnicianCode
(),
customer
.
getTechnician
().
getCode
()))
||
// 已排除但是分给了这个人
(
customer
.
getExclusiveTechnicianCode
()
!=
null
&&
customer
.
getTechnician
()
!=
null
&&
StringUtils
.
equals
(
customer
.
getExclusiveTechnicianCode
(),
customer
.
getTechnician
().
getCode
())))
.
penalizeLong
(
HardSoftLongScore
.
ONE_HARD
,
customer
->
50
)
.
asConstraint
(
ConstraintNameEnum
.
dispatchedMatch
.
name
());
}
// protected Constraint customerTimeWindowsMatch1(ConstraintFactory factory) {
// return factory.forEach(Customer.class).filter(
...
...
project-dispatch/src/main/java/com/dituhui/pea/dispatch/service/impl/SolveServiceImpl.java
View file @
e509492
...
...
@@ -271,6 +271,11 @@ public class SolveServiceImpl implements SolveService {
customer
.
setExclusiveTechnicianCode
(
Objects
.
nonNull
(
orderInfo
.
getAppointEngineerCodes
())
?
orderInfo
.
getAppointEngineerCodes
().
trim
()
:
null
);
}
log
.
info
(
"订单指定排除工程师, teamId:{}, batchNo:{}, orderId:{}, dispatchedTechnicianCode:{}, exclusiveTechnicianCode:{}"
,
teamId
,
batchNo
,
order
.
getOrderId
(),
customer
.
getDispatchedTechnicianCode
(),
customer
.
getExclusiveTechnicianCode
());
customerList
.
add
(
customer
);
});
...
...
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