Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-qc-change-system
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
胡园园
yanxuan-qc-change-system
Commits
d35574da
Commit
d35574da
authored
Dec 15, 2022
by
“zcwang”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify:待办工单名字
parent
3cf7f493
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
28 deletions
+46
-28
pom.xml
pom.xml
+1
-1
ChangeFlowBiz.java
...om/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
+36
-27
ChangeSubjectEnum.java
...e/mail/yanxuan/change/common/enums/ChangeSubjectEnum.java
+9
-0
No files found.
pom.xml
View file @
d35574da
...
@@ -400,7 +400,7 @@
...
@@ -400,7 +400,7 @@
<dependency>
<dependency>
<groupId>
com.netease.yanxuan.flowx
</groupId>
<groupId>
com.netease.yanxuan.flowx
</groupId>
<artifactId>
yanxuan-flowx-sdk
</artifactId>
<artifactId>
yanxuan-flowx-sdk
</artifactId>
<version>
1.
3
</version>
<version>
1.
4
</version>
<exclusions>
<exclusions>
<exclusion>
<exclusion>
<artifactId>
logback-classic
</artifactId>
<artifactId>
logback-classic
</artifactId>
...
...
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
View file @
d35574da
...
@@ -227,9 +227,39 @@ public class ChangeFlowBiz {
...
@@ -227,9 +227,39 @@ public class ChangeFlowBiz {
content
.
put
(
"createTime"
,
System
.
currentTimeMillis
());
content
.
put
(
"createTime"
,
System
.
currentTimeMillis
());
content
.
put
(
"updateTime"
,
System
.
currentTimeMillis
());
content
.
put
(
"updateTime"
,
System
.
currentTimeMillis
());
content
.
put
(
CommonConstants
.
FLOW_OPERATION_KEY
,
FlowOperationTypeEnum
.
PASS
.
getValue
());
content
.
put
(
CommonConstants
.
FLOW_OPERATION_KEY
,
FlowOperationTypeEnum
.
PASS
.
getValue
());
// 变更类型, 一级变更类型>二级变更类型
ChangeConfigPo
changeConfigPo
=
changeConfigService
.
queryInfoPo
(
parentChangeClassId
,
sonChangeClassId
);
StringBuilder
changeType
=
new
StringBuilder
();
try
{
changeType
.
append
(
changeConfigPo
.
getChangeTypes
().
get
(
0
).
getTypeName
());
changeType
.
append
(
changeConfigPo
.
getChangeTypes
().
get
(
1
).
getTypeName
());
}
catch
(
Exception
e
)
{
log
.
error
(
"queryInfoPo error:{}"
,
JSON
.
toJSONString
(
changeConfigPo
));
}
// 变更工单命名:变更主体+变更类型+变更商品(SPU+商品名称)/变更供应商(供应商ID+供应商名称)
String
subject
=
ChangeSubjectEnum
.
getDescByType
(
changeFlowCreateReq
.
getChangeSubject
());
String
flowName
=
subject
+
changeType
;
// 商品变更
if
(
ChangeSubjectEnum
.
PRODUCT
.
getType
().
equals
(
changeFlowCreateReq
.
getChangeSubject
()))
{
// 批量查询spu信息
List
<
SpuTO
>
spuTOS
=
itemService
.
batchQuerySpuInfo
(
BatchQuerySpuInfoParam
.
builder
().
ids
(
itemIds
)
.
commonProps
(
new
ArrayList
<>()).
spuProps
(
new
ArrayList
<>()).
build
());
log
.
debug
(
"[createAndSubmit] uid:{}, spuTOS:{}"
,
uid
,
JSON
.
toJSONString
(
spuTOS
));
String
spuList
=
spuTOS
.
stream
().
map
(
spu
->
"("
+
spu
.
getId
()
+
spu
.
getName
()
+
")"
)
.
collect
(
Collectors
.
joining
(
","
));
flowName
+=
spuList
;
}
if
(
ChangeSubjectEnum
.
SUPPLIER
.
getType
().
equals
(
changeFlowCreateReq
.
getChangeSubject
()))
{
List
<
SupplierSimpleRsp
>
supplierSimple
=
supplierService
.
getSupplierName
(
changeFlowCreateReq
.
getChangeSupplier
());
if
(
CollectionUtils
.
isNotEmpty
(
supplierSimple
))
{
SupplierSimpleRsp
supplier
=
supplierSimple
.
get
(
0
);
flowName
+=
supplier
.
getSupplierId
()
+
supplier
.
getSupplierName
();
}
}
// 组装工单创建数据
// 组装工单创建数据
FlowCreateReqDTO
flowCreateReqDTO
=
buildFlowCreateReqDTO
(
ChangeFlowEnum
.
CHANGE_FLOW_START
.
getTopoId
(),
uid
,
FlowCreateReqDTO
flowCreateReqDTO
=
buildFlowCreateReqDTO
(
ChangeFlowEnum
.
CHANGE_FLOW_START
.
getTopoId
(),
uid
,
JSON
.
toJSONString
(
content
),
FlowxOperationEnum
.
CREATE
.
getName
(),
name
);
JSON
.
toJSONString
(
content
),
FlowxOperationEnum
.
CREATE
.
getName
(),
name
,
flowName
);
// 创建工单
// 创建工单
String
flowId
=
flowService
.
createFlow
(
flowCreateReqDTO
);
String
flowId
=
flowService
.
createFlow
(
flowCreateReqDTO
);
// 查询工单详情
// 查询工单详情
...
@@ -293,18 +323,6 @@ public class ChangeFlowBiz {
...
@@ -293,18 +323,6 @@ public class ChangeFlowBiz {
dataList
.
add
(
changeExecuteEmailDTO
);
dataList
.
add
(
changeExecuteEmailDTO
);
});
});
param
.
put
(
"dataList"
,
dataList
);
param
.
put
(
"dataList"
,
dataList
);
ChangeConfigPo
changeConfigPo
=
changeConfigService
.
queryInfoPo
(
parentChangeClassId
,
sonChangeClassId
);
StringBuilder
changeType
=
new
StringBuilder
();
try
{
changeType
.
append
(
changeConfigPo
.
getChangeTypes
().
get
(
0
).
getTypeName
());
}
catch
(
Exception
e
)
{
log
.
error
(
"queryInfoPo error:{}"
,
JSON
.
toJSONString
(
changeConfigPo
));
}
try
{
changeType
.
append
(
changeConfigPo
.
getChangeTypes
().
get
(
1
).
getTypeName
());
}
catch
(
Exception
e
)
{
log
.
error
(
"queryInfoPo error:{}"
,
JSON
.
toJSONString
(
changeConfigPo
));
}
String
subjectParam
=
ChangeSubjectEnum
.
getChangeSubjectEnum
(
changeRecord
.
getChangeSubject
()).
getDesc
()
+
changeType
String
subjectParam
=
ChangeSubjectEnum
.
getChangeSubjectEnum
(
changeRecord
.
getChangeSubject
()).
getDesc
()
+
changeType
+
changeRecord
.
getFlowId
().
toString
();
+
changeRecord
.
getFlowId
().
toString
();
...
@@ -330,18 +348,7 @@ public class ChangeFlowBiz {
...
@@ -330,18 +348,7 @@ public class ChangeFlowBiz {
HashMap
<
String
,
Object
>
param
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"changeId"
,
changeRecord
.
getFlowId
());
param
.
put
(
"changeId"
,
changeRecord
.
getFlowId
());
param
.
put
(
"changeSubject"
,
ChangeSubjectEnum
.
getChangeSubjectEnum
(
changeRecord
.
getChangeSubject
()).
getDesc
());
param
.
put
(
"changeSubject"
,
ChangeSubjectEnum
.
getChangeSubjectEnum
(
changeRecord
.
getChangeSubject
()).
getDesc
());
ChangeConfigPo
changeConfigPo
=
changeConfigService
.
queryInfoPo
(
parentChangeClassId
,
sonChangeClassId
);
StringBuilder
changeType
=
new
StringBuilder
();
try
{
changeType
.
append
(
changeConfigPo
.
getChangeTypes
().
get
(
0
).
getTypeName
());
}
catch
(
Exception
e
)
{
log
.
error
(
"queryInfoPo error:{}"
,
JSON
.
toJSONString
(
changeConfigPo
));
}
try
{
changeType
.
append
(
changeConfigPo
.
getChangeTypes
().
get
(
1
).
getTypeName
());
}
catch
(
Exception
e
)
{
log
.
error
(
"queryInfoPo error:{}"
,
JSON
.
toJSONString
(
changeConfigPo
));
}
param
.
put
(
"changeType"
,
changeType
.
toString
());
param
.
put
(
"changeType"
,
changeType
.
toString
());
param
.
put
(
"flowUrl"
,
changeRecord
.
getFlowId
());
param
.
put
(
"flowUrl"
,
changeRecord
.
getFlowId
());
String
subjectParam
=
changeRecord
.
getFlowId
().
toString
();
String
subjectParam
=
changeRecord
.
getFlowId
().
toString
();
...
@@ -445,7 +452,8 @@ public class ChangeFlowBiz {
...
@@ -445,7 +452,8 @@ public class ChangeFlowBiz {
}
}
}
}
private
FlowCreateReqDTO
buildFlowCreateReqDTO
(
String
topoId
,
String
uid
,
String
content
,
String
operateResult
,
String
name
)
{
private
FlowCreateReqDTO
buildFlowCreateReqDTO
(
String
topoId
,
String
uid
,
String
content
,
String
operateResult
,
String
name
,
String
flowName
)
{
FlowCreateReqDTO
flowCreateReqDTO
=
new
FlowCreateReqDTO
();
FlowCreateReqDTO
flowCreateReqDTO
=
new
FlowCreateReqDTO
();
flowCreateReqDTO
.
setTopoId
(
topoId
);
flowCreateReqDTO
.
setTopoId
(
topoId
);
flowCreateReqDTO
.
setUid
(
uid
);
flowCreateReqDTO
.
setUid
(
uid
);
...
@@ -453,6 +461,7 @@ public class ChangeFlowBiz {
...
@@ -453,6 +461,7 @@ public class ChangeFlowBiz {
flowCreateReqDTO
.
setOperateResult
(
operateResult
);
flowCreateReqDTO
.
setOperateResult
(
operateResult
);
flowCreateReqDTO
.
setWorkOrderId
(
StringUtils
.
joinWith
(
"-"
,
topoId
,
UUID
.
randomUUID
().
toString
()));
flowCreateReqDTO
.
setWorkOrderId
(
StringUtils
.
joinWith
(
"-"
,
topoId
,
UUID
.
randomUUID
().
toString
()));
flowCreateReqDTO
.
setContent
(
content
);
flowCreateReqDTO
.
setContent
(
content
);
flowCreateReqDTO
.
setFlowName
(
flowName
);
return
flowCreateReqDTO
;
return
flowCreateReqDTO
;
}
}
...
@@ -930,7 +939,7 @@ public class ChangeFlowBiz {
...
@@ -930,7 +939,7 @@ public class ChangeFlowBiz {
List
<
Long
>
itemIds
=
itemList
.
stream
().
map
(
ItemVO:
:
getItemId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
itemIds
=
itemList
.
stream
().
map
(
ItemVO:
:
getItemId
).
collect
(
Collectors
.
toList
());
// 批量查询spu信息
// 批量查询spu信息
List
<
SpuTO
>
spuTOS
=
itemService
.
batchQuerySpuInfo
(
BatchQuerySpuInfoParam
.
builder
().
ids
(
itemIds
)
List
<
SpuTO
>
spuTOS
=
itemService
.
batchQuerySpuInfo
(
BatchQuerySpuInfoParam
.
builder
().
ids
(
itemIds
)
.
commonProps
(
new
ArrayList
<>()).
spuProps
(
Arrays
.
asList
(
"itemSetupType"
,
"
+
"
)).
build
());
.
commonProps
(
new
ArrayList
<>()).
spuProps
(
Arrays
.
asList
(
"itemSetupType"
,
"
businessForm
"
)).
build
());
log
.
debug
(
"[detail] spuTOS:{}"
,
JSON
.
toJSONString
(
spuTOS
));
log
.
debug
(
"[detail] spuTOS:{}"
,
JSON
.
toJSONString
(
spuTOS
));
// 批量查询物理类目
// 批量查询物理类目
Map
<
Long
,
List
<
SimplePhyCateGoryResultCo
>>
categoryChain
=
itemService
Map
<
Long
,
List
<
SimplePhyCateGoryResultCo
>>
categoryChain
=
itemService
...
...
yanxuan-qc-change-system-common/src/main/java/com/netease/mail/yanxuan/change/common/enums/ChangeSubjectEnum.java
View file @
d35574da
...
@@ -43,6 +43,15 @@ public enum ChangeSubjectEnum {
...
@@ -43,6 +43,15 @@ public enum ChangeSubjectEnum {
return
null
;
return
null
;
}
}
public
static
String
getDescByType
(
Integer
type
)
{
for
(
ChangeSubjectEnum
value
:
ChangeSubjectEnum
.
values
())
{
if
(
value
.
getType
().
equals
(
type
))
{
return
value
.
getDesc
();
}
}
return
""
;
}
public
static
ChangeSubjectEnum
getChangeSubjectEnum
(
Integer
id
){
public
static
ChangeSubjectEnum
getChangeSubjectEnum
(
Integer
id
){
for
(
ChangeSubjectEnum
day
:
ChangeSubjectEnum
.
values
())
{
for
(
ChangeSubjectEnum
day
:
ChangeSubjectEnum
.
values
())
{
if
(
id
==
day
.
getType
()){
if
(
id
==
day
.
getType
()){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment