Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-webapp-plug
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
base_platform_enterprise
gic-webapp-plug
Commits
f3f884de
Commit
f3f884de
authored
Jan 20, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店选择器操作日志方案调整
parent
2ab6cb74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
StoreWidgetLogUtils.java
...main/java/com/gic/plug/web/utils/StoreWidgetLogUtils.java
+30
-2
No files found.
src/main/java/com/gic/plug/web/utils/StoreWidgetLogUtils.java
View file @
f3f884de
package
com
.
gic
.
plug
.
web
.
utils
;
package
com
.
gic
.
plug
.
web
.
utils
;
import
com.gic.store.dto.StoreWidgetLogDTO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
...
@@ -14,6 +16,10 @@ import com.gic.store.dto.StoreWidgetLogSaveDTO;
...
@@ -14,6 +16,10 @@ import com.gic.store.dto.StoreWidgetLogSaveDTO;
import
com.gic.store.service.StoreWidgetApiService
;
import
com.gic.store.service.StoreWidgetApiService
;
import
com.gic.store.service.StoreWidgetLogApiService
;
import
com.gic.store.service.StoreWidgetLogApiService
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* 门店选择器操作日志工具类
* 门店选择器操作日志工具类
* @ClassName:
* @ClassName:
...
@@ -44,8 +50,9 @@ public class StoreWidgetLogUtils {
...
@@ -44,8 +50,9 @@ public class StoreWidgetLogUtils {
if
(
oldStoreWidget
==
null
)
{
if
(
oldStoreWidget
==
null
)
{
logSaveDTO
=
buildStoreWidgetLogWhenCreate
(
storeWidgetQO
,
newStoreWidgetId
);
logSaveDTO
=
buildStoreWidgetLogWhenCreate
(
storeWidgetQO
,
newStoreWidgetId
);
}
else
{
}
else
{
//需要更新日志关联关系
//copy旧门店选择器ID上挂载的日志到新的ID上面
storeWidgetLogApiService
.
tmpUpdateByStoreWidgetId
(
storeWidgetId
,
newStoreWidgetId
);
copyStoreWidgetLog
(
storeWidgetId
,
newStoreWidgetId
);
//新门店选择器ID上新增新的日志
logSaveDTO
=
buildStoreWidgetLogWhenUpdate
(
oldStoreWidget
,
storeWidgetQO
,
newStoreWidgetId
);
logSaveDTO
=
buildStoreWidgetLogWhenUpdate
(
oldStoreWidget
,
storeWidgetQO
,
newStoreWidgetId
);
}
}
//写日志
//写日志
...
@@ -85,6 +92,27 @@ public class StoreWidgetLogUtils {
...
@@ -85,6 +92,27 @@ public class StoreWidgetLogUtils {
}
}
}
}
/**
* copy旧门店选择器ID上挂载的日志到新的ID上面
* @param oldStoreWidgetId
* @param newStoreWidgetId
*/
private
void
copyStoreWidgetLog
(
Integer
oldStoreWidgetId
,
Integer
newStoreWidgetId
)
{
//查询旧uuid上面挂载的日志数据
ServiceResponse
<
List
<
StoreWidgetLogDTO
>>
response
=
storeWidgetLogApiService
.
listStoreWidgetLog
(
oldStoreWidgetId
);
if
(
response
.
isSuccess
())
{
List
<
StoreWidgetLogDTO
>
list
=
response
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
//复制数据到新uuid上面
List
<
StoreWidgetLogDTO
>
copyList
=
list
.
stream
().
map
(
e
->
e
.
setStoreWidgetId
(
newStoreWidgetId
)
.
setStoreWidgetLogId
(
null
)).
collect
(
Collectors
.
toList
());
//
storeWidgetLogApiService
.
tmpInsert
(
copyList
);
}
}
}
private
StoreWidgetDTO
getOldStoreWidget
(
Integer
storeWidgetId
)
{
private
StoreWidgetDTO
getOldStoreWidget
(
Integer
storeWidgetId
)
{
if
(
storeWidgetId
==
null
)
{
if
(
storeWidgetId
==
null
)
{
...
...
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