Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
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-store
Commits
76fa85fc
Commit
76fa85fc
authored
Nov 12, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加门店日志
parent
d6b3c5ce
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
291 additions
and
14 deletions
+291
-14
StoreApiService.java
.../src/main/java/com/gic/store/service/StoreApiService.java
+1
-1
StoreLogService.java
.../src/main/java/com/gic/store/service/StoreLogService.java
+9
-0
StoreLogServiceImpl.java
.../java/com/gic/store/service/impl/StoreLogServiceImpl.java
+51
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+10
-4
BulkUpdateStoreStrtegy.java
...n/java/com/gic/store/strategy/BulkUpdateStoreStrtegy.java
+1
-1
StoreBrandUpdateStrategyImpl.java
...gic/store/strategy/impl/StoreBrandUpdateStrategyImpl.java
+33
-1
StoreBusinessTimeStrategyImpl.java
...ic/store/strategy/impl/StoreBusinessTimeStrategyImpl.java
+55
-1
StoreGroupStrategyImpl.java
...a/com/gic/store/strategy/impl/StoreGroupStrategyImpl.java
+30
-1
StorePhoneStategyImpl.java
...va/com/gic/store/strategy/impl/StorePhoneStategyImpl.java
+25
-1
StorePhotoAddStrategyImpl.java
...om/gic/store/strategy/impl/StorePhotoAddStrategyImpl.java
+25
-1
StorePhotoUpdateStrategyImpl.java
...gic/store/strategy/impl/StorePhotoUpdateStrategyImpl.java
+24
-1
StoreStatusStrategyImpl.java
.../com/gic/store/strategy/impl/StoreStatusStrategyImpl.java
+26
-1
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+1
-1
No files found.
gic-store-api/src/main/java/com/gic/store/service/StoreApiService.java
View file @
76fa85fc
...
...
@@ -93,7 +93,7 @@ public interface StoreApiService {
* @return com.gic.api.base.commons.ServiceResponse
* @throws
*/
ServiceResponse
bulkUpdateStore
(
String
storeIds
,
String
value
,
Integer
enterpriseId
,
int
type
);
ServiceResponse
bulkUpdateStore
(
String
storeIds
,
String
value
,
Integer
enterpriseId
,
int
type
,
Integer
operatorId
,
String
operatorName
);
/**
* @Title: getByStoreNameAndStoreCode
...
...
gic-store-service/src/main/java/com/gic/store/service/StoreLogService.java
View file @
76fa85fc
...
...
@@ -5,6 +5,8 @@ import com.gic.store.dto.StoreLogDTO;
import
com.gic.store.entity.TabStoreLog
;
import
com.github.pagehelper.Page
;
import
java.util.List
;
/**
*
* @ClassName: StoreLogService
...
...
@@ -37,4 +39,10 @@ public interface StoreLogService {
*/
Page
<
TabStoreLog
>
listStoreLog
(
StoreLogDTO
storeLogDTO
,
PageQO
pageQO
);
void
saveBulkStoreInfoLog
(
List
<
Integer
>
storeIdList
,
Integer
enterpriseId
,
Integer
operatorId
,
String
operatorName
,
String
content
);
void
saveBulkStoreStatusLog
(
List
<
Integer
>
storeIdList
,
Integer
enterpriseId
,
Integer
operatorId
,
String
operatorName
,
String
content
);
void
saveBulkStoreGroupLog
(
List
<
Integer
>
storeIdList
,
Integer
enterpriseId
,
Integer
operatorId
,
String
operatorName
,
String
content
);
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/impl/StoreLogServiceImpl.java
View file @
76fa85fc
...
...
@@ -3,6 +3,8 @@ package com.gic.store.service.impl;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.enterprise.qo.PageQO
;
import
com.gic.store.constant.StoreLogReasonEnum
;
import
com.gic.store.constant.StoreLogTypeEnum
;
import
com.gic.store.dao.mapper.TabStoreLogMapper
;
import
com.gic.store.dto.StoreLogDTO
;
import
com.gic.store.entity.TabStoreLog
;
...
...
@@ -13,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
/**
*
...
...
@@ -39,4 +42,52 @@ public class StoreLogServiceImpl implements StoreLogService {
PageHelper
.
startPage
(
pageQO
.
getCurrentPage
(),
pageQO
.
getPageSize
());
return
tabStoreLogMapper
.
listStoreLog
(
storeLogDTO
);
}
@Override
public
void
saveBulkStoreInfoLog
(
List
<
Integer
>
storeIdList
,
Integer
enterpriseId
,
Integer
operatorId
,
String
operatorName
,
String
content
)
{
TabStoreLog
storeLog
=
new
TabStoreLog
();
storeLog
.
setEnterpriseId
(
enterpriseId
);
storeLog
.
setReason
(
StoreLogReasonEnum
.
WEB
.
getCode
());
storeLog
.
setLogType
(
StoreLogTypeEnum
.
INFO_UPDATE
.
getCode
());
storeLog
.
setRemark
(
"批量编辑"
);
storeLog
.
setOperatorId
(
operatorId
);
storeLog
.
setOperatorName
(
operatorName
);
storeLog
.
setContent
(
content
);
for
(
Integer
storeId
:
storeIdList
)
{
storeLog
.
setStoreId
(
storeId
);
tabStoreLogMapper
.
insertSelective
(
storeLog
);
}
}
@Override
public
void
saveBulkStoreStatusLog
(
List
<
Integer
>
storeIdList
,
Integer
enterpriseId
,
Integer
operatorId
,
String
operatorName
,
String
content
)
{
TabStoreLog
storeLog
=
new
TabStoreLog
();
storeLog
.
setEnterpriseId
(
enterpriseId
);
storeLog
.
setReason
(
StoreLogReasonEnum
.
WEB
.
getCode
());
storeLog
.
setLogType
(
StoreLogTypeEnum
.
STATUS_UPDATE
.
getCode
());
storeLog
.
setRemark
(
"批量编辑"
);
storeLog
.
setOperatorId
(
operatorId
);
storeLog
.
setOperatorName
(
operatorName
);
storeLog
.
setContent
(
content
);
for
(
Integer
storeId
:
storeIdList
)
{
storeLog
.
setStoreId
(
storeId
);
tabStoreLogMapper
.
insertSelective
(
storeLog
);
}
}
@Override
public
void
saveBulkStoreGroupLog
(
List
<
Integer
>
storeIdList
,
Integer
enterpriseId
,
Integer
operatorId
,
String
operatorName
,
String
content
)
{
TabStoreLog
storeLog
=
new
TabStoreLog
();
storeLog
.
setEnterpriseId
(
enterpriseId
);
storeLog
.
setReason
(
StoreLogReasonEnum
.
WEB
.
getCode
());
storeLog
.
setLogType
(
StoreLogTypeEnum
.
GROUP_UPDATE
.
getCode
());
storeLog
.
setRemark
(
"批量编辑"
);
storeLog
.
setOperatorId
(
operatorId
);
storeLog
.
setOperatorName
(
operatorName
);
storeLog
.
setContent
(
content
);
for
(
Integer
storeId
:
storeIdList
)
{
storeLog
.
setStoreId
(
storeId
);
tabStoreLogMapper
.
insertSelective
(
storeLog
);
}
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
76fa85fc
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.commons.util.PageHelperUtils
;
...
...
@@ -208,8 +209,13 @@ public class StoreApiServiceImpl implements StoreApiService {
}
if
(!
CollectionUtils
.
isEqualCollection
(
oldStore
.
getBusinessTimeList
(),
newStore
.
getBusinessTimeList
()))
{
this
.
storeBusinessTimeService
.
convertBusinessTime
(
newStore
.
getBusinessTimeList
());
String
oldBusinessTimeShow
=
oldStore
.
getBusinessTimeList
().
stream
().
map
(
StoreBusinessTimeDTO:
:
getWeekdayShow
).
reduce
((
x
,
y
)
->
x
+
""
+
y
).
orElse
(
""
);
String
newBusinessTimeShow
=
newStore
.
getBusinessTimeList
().
stream
().
map
(
StoreBusinessTimeDTO:
:
getWeekdayShow
).
reduce
((
x
,
y
)
->
x
+
""
+
y
).
orElse
(
""
);
String
oldBusinessTimeShow
=
oldStore
.
getBusinessTimeList
().
stream
()
.
map
(
e
->
e
.
getWeekdayShow
()
+
":"
+
DateUtil
.
dateToStr
(
e
.
getOpenTime
(),
DateUtil
.
FORMAT_MINUTE_TIME
)
+
"~"
+
DateUtil
.
dateToStr
(
e
.
getCloseTime
(),
DateUtil
.
FORMAT_MINUTE_TIME
))
.
reduce
((
x
,
y
)
->
x
+
""
+
y
).
orElse
(
""
);
String
newBusinessTimeShow
=
newStore
.
getBusinessTimeList
().
stream
()
.
map
(
e
->
e
.
getWeekdayShow
()
+
":"
+
DateUtil
.
dateToStr
(
e
.
getOpenTime
(),
DateUtil
.
FORMAT_MINUTE_TIME
)
+
"~"
+
DateUtil
.
dateToStr
(
e
.
getCloseTime
(),
DateUtil
.
FORMAT_MINUTE_TIME
))
.
reduce
((
x
,
y
)
->
x
+
","
+
y
)
.
orElse
(
""
);
sb
.
append
(
"营业时间"
).
append
(
"【"
).
append
(
oldBusinessTimeShow
).
append
(
"】"
)
.
append
(
"变更为【"
).
append
(
newBusinessTimeShow
).
append
(
"】"
);
}
...
...
@@ -593,7 +599,7 @@ public class StoreApiServiceImpl implements StoreApiService {
}
@Override
public
ServiceResponse
bulkUpdateStore
(
String
storeIds
,
String
value
,
Integer
enterpriseId
,
int
type
)
{
public
ServiceResponse
bulkUpdateStore
(
String
storeIds
,
String
value
,
Integer
enterpriseId
,
int
type
,
Integer
operatorId
,
String
operatorName
)
{
//type表示操作的类型,1更新门店启用状态,2门店电话,3营业时间,4门店照片(替换),5关联品牌,6批量上传图片(原有基础上新增)
//7批量修改门店分组
if
(
StringUtils
.
isBlank
(
storeIds
)
||
StringUtils
.
isBlank
(
value
))
{
...
...
@@ -605,7 +611,7 @@ public class StoreApiServiceImpl implements StoreApiService {
if
(
StringUtils
.
isBlank
(
storeInfoIds
))
{
return
ServiceResponse
.
success
();
}
i
=
storeStrtegyMap
.
get
(
type
).
bulkUpdateStore
(
storeInfoIds
,
enterpriseId
,
value
,
storeService
);
i
=
storeStrtegyMap
.
get
(
type
).
bulkUpdateStore
(
storeInfoIds
,
enterpriseId
,
value
,
storeService
,
operatorId
,
operatorName
);
List
<
Integer
>
storeIdList
=
new
ArrayList
<>();
if
(
"all"
.
equals
(
storeIds
))
{
this
.
removeCache
(
enterpriseId
);
...
...
gic-store-service/src/main/java/com/gic/store/strategy/BulkUpdateStoreStrtegy.java
View file @
76fa85fc
...
...
@@ -3,5 +3,5 @@ package com.gic.store.strategy;
import
com.gic.store.service.StoreService
;
public
interface
BulkUpdateStoreStrtegy
{
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
);
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
);
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreBrandUpdateStrategyImpl.java
View file @
76fa85fc
package
com
.
gic
.
store
.
strategy
.
impl
;
import
com.gic.store.entity.TabStoreBrand
;
import
com.gic.store.service.StoreBrandService
;
import
com.gic.store.service.StoreLogService
;
import
com.gic.store.service.StoreService
;
import
com.gic.store.strategy.BulkUpdateStoreStrtegy
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Optional
;
@Component
public
class
StoreBrandUpdateStrategyImpl
implements
BulkUpdateStoreStrtegy
{
@Autowired
private
StoreLogService
storeLogService
;
@Autowired
private
StoreBrandService
storeBrandService
;
@Override
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
)
{
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreBrands
(
storeIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeIds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
List
<
TabStoreBrand
>
storeBrandList
=
storeBrandService
.
listStoreBrandByIds
(
storeIds
);
String
content
=
Optional
.
ofNullable
(
storeBrandList
).
orElse
(
Collections
.
emptyList
()).
stream
().
map
(
TabStoreBrand:
:
getStoreBrandName
).
reduce
((
x
,
y
)
->
x
+
","
+
y
).
orElse
(
""
);
storeLogService
.
saveBulkStoreInfoLog
(
storeIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店品牌变更为【"
+
content
+
"】"
);
}
return
i
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreBusinessTimeStrategyImpl.java
View file @
76fa85fc
package
com
.
gic
.
store
.
strategy
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.store.constant.WeekdayEnum
;
import
com.gic.store.service.StoreLogService
;
import
com.gic.store.service.StoreService
;
import
com.gic.store.strategy.BulkUpdateStoreStrtegy
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
@Component
public
class
StoreBusinessTimeStrategyImpl
implements
BulkUpdateStoreStrtegy
{
@Autowired
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
)
{
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreBusinessTime
(
storeIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeIds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
// [{"weekday":"1,2","openTime":"09:42","closeTime":"09:42"}]
StringBuilder
btSb
=
new
StringBuilder
(
"营业时间变更为【 "
);
List
<
JSONObject
>
businessTimeList
=
JSON
.
parseArray
(
value
,
JSONObject
.
class
);
for
(
JSONObject
storeBusinessTime
:
businessTimeList
)
{
String
weekday
=
storeBusinessTime
.
getString
(
"weekday"
);
List
<
Integer
>
list
=
Stream
.
of
(
weekday
.
split
(
GlobalInfo
.
FLAG_COMMA
)).
filter
(
e
->
StringUtils
.
isNotBlank
(
e
)).
map
(
Integer:
:
parseInt
).
collect
(
Collectors
.
toList
());
if
(
list
.
size
()
>=
3
&&
list
.
get
(
list
.
size
()
-
1
)
-
list
.
get
(
0
)
==
list
.
size
()
-
1
)
{
// 超过三条的需要判断
// 都是连续的
btSb
.
append
(
WeekdayEnum
.
parse
(
list
.
get
(
0
))
+
"至"
+
WeekdayEnum
.
parse
(
list
.
get
(
list
.
size
()
-
1
)));
}
else
{
// 直接解析返回
StringBuilder
sb
=
new
StringBuilder
();
for
(
Integer
code
:
list
)
{
sb
.
append
(
WeekdayEnum
.
parse
(
code
)).
append
(
"、"
);
}
sb
.
deleteCharAt
(
sb
.
length
()
-
1
);
btSb
.
append
(
sb
);
}
btSb
.
append
(
":"
).
append
(
storeBusinessTime
.
getString
(
"openTime"
)).
append
(
"~"
).
append
(
storeBusinessTime
.
getString
(
"endTime"
)).
append
(
","
);
}
btSb
.
deleteCharAt
(
btSb
.
length
()
-
1
);
btSb
.
append
(
"】"
);
storeLogService
.
saveBulkStoreInfoLog
(
storeIdList
,
enterpriseId
,
operatorId
,
operatorName
,
btSb
.
toString
());
}
return
i
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreGroupStrategyImpl.java
View file @
76fa85fc
package
com
.
gic
.
store
.
strategy
.
impl
;
import
com.gic.store.entity.TabStoreGroup
;
import
com.gic.store.service.StoreGroupService
;
import
com.gic.store.service.StoreLogService
;
import
com.gic.store.service.StoreService
;
import
com.gic.store.strategy.BulkUpdateStoreStrtegy
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
@Component
public
class
StoreGroupStrategyImpl
implements
BulkUpdateStoreStrtegy
{
@Autowired
private
StoreLogService
storeLogService
;
@Autowired
private
StoreGroupService
storeGroupService
;
@Override
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
)
{
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreGroup
(
storeIds
,
enterpriseId
,
Integer
.
valueOf
(
value
));
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeIds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
TabStoreGroup
group
=
storeGroupService
.
getStoreGroupById
(
Integer
.
valueOf
(
value
));
storeLogService
.
saveBulkStoreGroupLog
(
storeIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店分组变更为【"
+
group
.
getStoreGroupName
()
+
"】"
);
}
return
i
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StorePhoneStategyImpl.java
View file @
76fa85fc
package
com
.
gic
.
store
.
strategy
.
impl
;
import
com.gic.store.service.StoreLogService
;
import
com.gic.store.service.StoreService
;
import
com.gic.store.strategy.BulkUpdateStoreStrtegy
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
@Component
public
class
StorePhoneStategyImpl
implements
BulkUpdateStoreStrtegy
{
@Autowired
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
)
{
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreConactsPhone
(
storeIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeIds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
storeLogService
.
saveBulkStoreInfoLog
(
storeIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店联系电话变更为【"
+
value
+
"】"
);
}
return
i
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StorePhotoAddStrategyImpl.java
View file @
76fa85fc
package
com
.
gic
.
store
.
strategy
.
impl
;
import
com.gic.store.service.StoreLogService
;
import
com.gic.store.service.StoreService
;
import
com.gic.store.strategy.BulkUpdateStoreStrtegy
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
@Component
public
class
StorePhotoAddStrategyImpl
implements
BulkUpdateStoreStrtegy
{
@Autowired
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
)
{
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkAddStorePhoto
(
storeIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeIds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
storeLogService
.
saveBulkStoreInfoLog
(
storeIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店照片添加"
);
}
return
i
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StorePhotoUpdateStrategyImpl.java
View file @
76fa85fc
package
com
.
gic
.
store
.
strategy
.
impl
;
import
com.gic.store.service.StoreLogService
;
import
com.gic.store.service.StoreService
;
import
com.gic.store.strategy.BulkUpdateStoreStrtegy
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
@Component
public
class
StorePhotoUpdateStrategyImpl
implements
BulkUpdateStoreStrtegy
{
@Autowired
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
)
{
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStorePhoto
(
storeIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeIds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
storeLogService
.
saveBulkStoreInfoLog
(
storeIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店照片变更"
);
}
return
i
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreStatusStrategyImpl.java
View file @
76fa85fc
package
com
.
gic
.
store
.
strategy
.
impl
;
import
com.gic.store.constant.StoreStatusEnum
;
import
com.gic.store.service.StoreLogService
;
import
com.gic.store.service.StoreService
;
import
com.gic.store.strategy.BulkUpdateStoreStrtegy
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
@Component
public
class
StoreStatusStrategyImpl
implements
BulkUpdateStoreStrtegy
{
@Autowired
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
)
{
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreStatus
(
storeIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeIds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
storeLogService
.
saveBulkStoreInfoLog
(
storeIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店状态变更为【"
+
StoreStatusEnum
.
parseCode
(
Integer
.
parseInt
(
value
))
+
"】"
);
}
return
i
;
}
}
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
76fa85fc
...
...
@@ -203,7 +203,7 @@ public class StoreController {
if
(
StringUtils
.
isBlank
(
storeIds
)
||
StringUtils
.
isBlank
(
value
))
{
return
EnterpriseRestResponse
.
failure
(
ErrorCode
.
MISS_PARAMETER
);
}
ServiceResponse
response
=
this
.
storeApiService
.
bulkUpdateStore
(
storeIds
,
value
,
enterpriseId
,
type
);
ServiceResponse
response
=
this
.
storeApiService
.
bulkUpdateStore
(
storeIds
,
value
,
enterpriseId
,
type
,
UserDetailUtils
.
getUserDetail
().
getUserId
(),
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getUserName
()
);
if
(
response
.
isSuccess
())
{
return
RestResponse
.
success
();
}
...
...
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