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 ecbf6aa3
authored
Dec 06, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:调用bean改约原因树优化
1 parent
2b450cc7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
3 deletions
project-order/src/main/java/com/dituhui/pea/order/constant/OrderReschedulingReason.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderInfoServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/constant/OrderReschedulingReason.java
View file @
ecbf6aa
package
com
.
dituhui
.
pea
.
order
.
constant
;
import
com.alibaba.fastjson.JSONObject
;
import
com.dituhui.pea.order.feign.bean.Reason
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -10,6 +14,9 @@ import java.util.Map;
*/
public
class
OrderReschedulingReason
{
/**
* 改约原因树
*/
public
final
static
Map
<
String
,
List
<
String
>>
ReschedulingReasonMap
=
new
HashMap
<>()
{
{
put
(
"服务设备/工具相关"
,
new
ArrayList
<>()
{
...
...
@@ -91,4 +98,33 @@ public class OrderReschedulingReason {
});
}
};
/**
* 获取bean改约原因树
*
* @param reason
* @return
*/
public
static
Reason
getReason
(
String
reason
)
{
Reason
reasonRes
=
new
Reason
();
if
(
StringUtils
.
isBlank
(
reason
))
{
return
reasonRes
;
}
for
(
String
reasonKey
:
ReschedulingReasonMap
.
keySet
())
{
if
(
reasonKey
.
equals
(
reason
))
{
reasonRes
.
setOneLevel
(
reasonKey
);
}
for
(
String
reasonValue
:
ReschedulingReasonMap
.
get
(
reasonKey
))
{
if
(
reasonValue
.
equals
(
reason
))
{
reasonRes
.
setOneLevel
(
reasonKey
);
reasonRes
.
setTwoLevel
(
reasonValue
);
}
}
}
return
reasonRes
;
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
JSONObject
.
toJSONString
(
getReason
(
"其它原因"
)));
}
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderInfoServiceImpl.java
View file @
ecbf6aa
...
...
@@ -498,9 +498,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
rescheduled
.
setRisId
(
source
.
getOrderId
());
rescheduled
.
setInitiatorOfRescheduling
(
operator
);
Reason
reasons
=
new
Reason
();
reasons
.
setOneLevel
(
reason
);
rescheduled
.
setReasonForRescheduling
(
reasons
);
rescheduled
.
setReasonForRescheduling
(
OrderReschedulingReason
.
getReason
(
reason
));
rescheduled
.
setRescheduledDate
(
happened
.
getTime
());
rescheduled
.
setRequireApprove
(
Boolean
.
FALSE
);
...
...
@@ -513,6 +511,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
rescheduled
.
setAssistantWorkNo
(
code
.
getCosmosId
());
rescheduled
.
setAssOrgUnitId
(
code
.
getGroupId
());
}
//判断是否是改派
if
((
StringUtils
.
isNotBlank
(
target
.
getEngineerCode
())
&&
!
Objects
.
equals
(
engineerCode
,
source
.
getEngineerCode
()))
||
(
StringUtils
.
isNotBlank
(
target
.
getEngineerCodeSub
())
&&
!
Objects
.
equals
(
target
.
getEngineerCodeSub
(),
source
.
getEngineerCodeSub
())))
{
...
...
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