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
d5dbbca2
Commit
d5dbbca2
authored
Sep 11, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店批量修改
parent
9357bbe6
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
109 additions
and
19 deletions
+109
-19
TabClerkMapper.java
...rc/main/java/com/gic/store/dao/mapper/TabClerkMapper.java
+13
-0
ClerkService.java
...ice/src/main/java/com/gic/store/service/ClerkService.java
+12
-0
ClerkServiceImpl.java
...ain/java/com/gic/store/service/impl/ClerkServiceImpl.java
+5
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+4
-2
BulkUpdateStoreStrtegy.java
...n/java/com/gic/store/strategy/BulkUpdateStoreStrtegy.java
+1
-1
StoreBrandUpdateStrategyImpl.java
...gic/store/strategy/impl/StoreBrandUpdateStrategyImpl.java
+2
-2
StoreBusinessTimeStrategyImpl.java
...ic/store/strategy/impl/StoreBusinessTimeStrategyImpl.java
+2
-2
StoreGroupStrategyImpl.java
...a/com/gic/store/strategy/impl/StoreGroupStrategyImpl.java
+2
-2
StorePhoneStategyImpl.java
...va/com/gic/store/strategy/impl/StorePhoneStategyImpl.java
+2
-2
StorePhotoAddStrategyImpl.java
...om/gic/store/strategy/impl/StorePhotoAddStrategyImpl.java
+2
-2
StorePhotoUpdateStrategyImpl.java
...gic/store/strategy/impl/StorePhotoUpdateStrategyImpl.java
+2
-2
StoreStatusStrategyImpl.java
.../com/gic/store/strategy/impl/StoreStatusStrategyImpl.java
+49
-4
TabClerkMapper.xml
...tore-service/src/main/resources/mapper/TabClerkMapper.xml
+13
-0
No files found.
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabClerkMapper.java
View file @
d5dbbca2
...
...
@@ -253,4 +253,16 @@ public interface TabClerkMapper {
* @throws
*/
List
<
Integer
>
listAllClerkId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
/**
* listStoreInfoIdByStoreInfoId
* @Title: listStoreInfoIdByStoreInfoId
* @Description:
* @author zhiwj
* @param enterpriseId
* @param storeInfoIdList
* @return java.util.List<java.lang.Integer>
* @throws
*/
List
<
Integer
>
listStoreInfoIdByStoreInfoId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"ids"
)
List
<
Integer
>
storeInfoIdList
);
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/ClerkService.java
View file @
d5dbbca2
...
...
@@ -293,4 +293,16 @@ public interface ClerkService {
* @throws
*/
List
<
Integer
>
listAllClerkId
(
Integer
enterpriseId
);
/**
* listStoreInfoIdByStoreInfoId
* @Title: listStoreInfoIdByStoreInfoId
* @Description:
* @author zhiwj
* @param enterpriseId
* @param storeInfoIdList
* @return java.util.List<java.lang.Integer>
* @throws
*/
List
<
Integer
>
listStoreInfoIdByStoreInfoId
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIdList
);
}
gic-store-service/src/main/java/com/gic/store/service/impl/ClerkServiceImpl.java
View file @
d5dbbca2
...
...
@@ -190,4 +190,9 @@ public class ClerkServiceImpl implements ClerkService {
return
tabClerkMapper
.
listAllClerkId
(
enterpriseId
);
}
@Override
public
List
<
Integer
>
listStoreInfoIdByStoreInfoId
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIdList
)
{
return
tabClerkMapper
.
listStoreInfoIdByStoreInfoId
(
enterpriseId
,
storeInfoIdList
);
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
d5dbbca2
...
...
@@ -1311,7 +1311,6 @@ public class StoreApiServiceImpl implements StoreApiService {
if
(
StringUtils
.
isBlank
(
storeIds
)
||
StringUtils
.
isBlank
(
value
))
{
return
EnterpriseServiceResponse
.
failure
(
com
.
gic
.
enterprise
.
error
.
ErrorCode
.
MISS_PARAMETER
);
}
int
i
=
0
;
try
{
String
storeInfoIds
;
if
(
StringUtils
.
equals
(
Constants
.
ALL
,
storeIds
))
{
...
...
@@ -1322,7 +1321,7 @@ public class StoreApiServiceImpl implements StoreApiService {
if
(
StringUtils
.
isBlank
(
storeInfoIds
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"门店不存在或非自有门店"
);
}
i
=
storeStrtegyMap
.
get
(
type
+
""
).
bulkUpdateStore
(
storeInfoIds
,
enterpriseId
,
value
,
storeService
,
operatorId
,
operatorName
);
String
msg
=
storeStrtegyMap
.
get
(
type
+
""
).
bulkUpdateStore
(
storeInfoIds
,
enterpriseId
,
value
,
storeService
,
operatorId
,
operatorName
);
List
<
Integer
>
storeIdList
=
new
ArrayList
<>();
if
(
Constants
.
ALL
.
equals
(
storeIds
))
{
this
.
removeCache
(
enterpriseId
);
...
...
@@ -1340,6 +1339,9 @@ public class StoreApiServiceImpl implements StoreApiService {
this
.
bulkAddStoreToIndex
(
enterpriseId
,
storeIdList
);
}
}
if
(
StringUtils
.
isNotBlank
(
msg
))
{
return
ServiceResponse
.
failure
(
"7777"
,
msg
);
}
// bulkUpdateLog(storeIds, value, enterpriseId, type, operatorId, operatorName);
}
catch
(
Exception
e
)
{
logger
.
error
(
""
,
e
);
...
...
gic-store-service/src/main/java/com/gic/store/strategy/BulkUpdateStoreStrtegy.java
View file @
d5dbbca2
...
...
@@ -24,5 +24,5 @@ public interface BulkUpdateStoreStrtegy {
* @return int
* @throws
*/
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
);
String
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 @
d5dbbca2
...
...
@@ -36,7 +36,7 @@ public class StoreBrandUpdateStrategyImpl implements BulkUpdateStoreStrtegy {
private
SparkJobApiService
sparkJobApiService
;
@Override
public
int
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
public
String
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
List
<
Integer
>
storeInfoIdList
;
List
<
StoreDTO
>
storeList
;
if
(
Constants
.
ALL
.
equals
(
storeInfoIds
))
{
...
...
@@ -70,7 +70,7 @@ public class StoreBrandUpdateStrategyImpl implements BulkUpdateStoreStrtegy {
sparkJobApiService
.
updateStoreBrand
(
enterpriseId
,
brandUpdateDTO
.
storeInfoId
,
brandUpdateDTO
.
oldStoreBrand
,
newBrand
);
}
return
i
;
return
null
;
}
class
BrandUpdateDTO
{
...
...
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreBusinessTimeStrategyImpl.java
View file @
d5dbbca2
...
...
@@ -30,7 +30,7 @@ public class StoreBusinessTimeStrategyImpl implements BulkUpdateStoreStrtegy {
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
public
String
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreBusinessTime
(
storeInfoIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeInfoIdList
;
...
...
@@ -68,6 +68,6 @@ public class StoreBusinessTimeStrategyImpl implements BulkUpdateStoreStrtegy {
btSb
.
append
(
"】"
);
storeLogService
.
saveBulkStoreInfoLog
(
storeInfoIdList
,
enterpriseId
,
operatorId
,
operatorName
,
btSb
.
toString
());
}
return
i
;
return
null
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreGroupStrategyImpl.java
View file @
d5dbbca2
...
...
@@ -27,7 +27,7 @@ public class StoreGroupStrategyImpl implements BulkUpdateStoreStrtegy {
private
StoreGroupService
storeGroupService
;
@Override
public
int
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
public
String
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreGroup
(
storeInfoIds
,
enterpriseId
,
Integer
.
valueOf
(
value
));
if
(
i
>
0
)
{
List
<
Integer
>
storeInfoIdList
;
...
...
@@ -43,6 +43,6 @@ public class StoreGroupStrategyImpl implements BulkUpdateStoreStrtegy {
TabStoreGroup
group
=
storeGroupService
.
getStoreGroupById
(
Integer
.
valueOf
(
value
));
storeLogService
.
saveBulkStoreGroupLog
(
storeInfoIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店分组变更为【"
+
group
.
getStoreGroupName
()
+
"】"
);
}
return
i
;
return
null
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StorePhoneStategyImpl.java
View file @
d5dbbca2
...
...
@@ -23,7 +23,7 @@ public class StorePhoneStategyImpl implements BulkUpdateStoreStrtegy {
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
public
String
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreConactsPhone
(
storeInfoIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeInfoIdList
;
...
...
@@ -38,6 +38,6 @@ public class StorePhoneStategyImpl implements BulkUpdateStoreStrtegy {
}
storeLogService
.
saveBulkStoreInfoLog
(
storeInfoIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店联系电话变更为【"
+
value
+
"】"
);
}
return
i
;
return
null
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StorePhotoAddStrategyImpl.java
View file @
d5dbbca2
...
...
@@ -24,7 +24,7 @@ public class StorePhotoAddStrategyImpl implements BulkUpdateStoreStrtegy {
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
public
String
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkAddStorePhoto
(
storeInfoIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeInfoIdList
;
...
...
@@ -39,6 +39,6 @@ public class StorePhotoAddStrategyImpl implements BulkUpdateStoreStrtegy {
}
storeLogService
.
saveBulkStoreInfoLog
(
storeInfoIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店照片添加"
);
}
return
i
;
return
null
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StorePhotoUpdateStrategyImpl.java
View file @
d5dbbca2
...
...
@@ -24,7 +24,7 @@ public class StorePhotoUpdateStrategyImpl implements BulkUpdateStoreStrtegy {
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
public
String
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStorePhoto
(
storeInfoIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeInfoIdList
;
...
...
@@ -39,6 +39,6 @@ public class StorePhotoUpdateStrategyImpl implements BulkUpdateStoreStrtegy {
}
storeLogService
.
saveBulkStoreInfoLog
(
storeInfoIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店照片变更"
);
}
return
i
;
return
null
;
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreStatusStrategyImpl.java
View file @
d5dbbca2
...
...
@@ -5,6 +5,9 @@ import com.gic.member.config.api.service.CardAscriptionConfigService;
import
com.gic.spark.api.service.SparkJobApiService
;
import
com.gic.store.constant.Constants
;
import
com.gic.store.constant.StoreStatusEnum
;
import
com.gic.store.dto.StoreDTO
;
import
com.gic.store.dto.StoreSearchDbDTO
;
import
com.gic.store.service.ClerkService
;
import
com.gic.store.service.StoreLogService
;
import
com.gic.store.service.StoreService
;
import
com.gic.store.strategy.BulkUpdateStoreStrtegy
;
...
...
@@ -33,9 +36,13 @@ public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
private
SparkJobApiService
sparkJobApiService
;
@Autowired
private
CardAscriptionConfigService
cardAscriptionConfigService
;
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
StoreService
storeService
;
@Override
public
int
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
public
String
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
List
<
Integer
>
storeInfoIdList
=
new
ArrayList
<>();
List
<
UserOwnerDefaultDTO
>
result
=
this
.
cardAscriptionConfigService
.
getDefaultUserOwner
(
enterpriseId
).
getResult
();
if
(
Constants
.
ALL
.
equals
(
storeInfoIds
))
{
...
...
@@ -58,10 +65,26 @@ public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
}).
collect
(
Collectors
.
toList
());
}
if
(
CollectionUtils
.
isNotEmpty
(
storeInfoIdList
)){
int
valueCode
=
Integer
.
parseInt
(
value
);
String
errorMsg
=
null
;
if
(
StoreStatusEnum
.
ONLINE
.
getCode
()
==
valueCode
)
{
// 改成启用 需要判断门店下有没有导购 没有导购不能启用 先查出来有导购的门店
List
<
Integer
>
storeInfoIdListNew
=
clerkService
.
listStoreInfoIdByStoreInfoId
(
enterpriseId
,
storeInfoIdList
);
if
(
CollectionUtils
.
isEmpty
(
storeInfoIdListNew
))
{
// 每个门店下都没有导购
return
getStoreHasNotClerkMsg
(
enterpriseId
,
storeInfoIdList
,
storeInfoIdListNew
);
}
else
if
(
storeInfoIdListNew
.
size
()
==
storeInfoIdList
.
size
())
{
// 每个门店下都有导购
errorMsg
=
null
;
}
else
{
errorMsg
=
getStoreHasNotClerkMsg
(
enterpriseId
,
storeInfoIdList
,
storeInfoIdListNew
);
storeInfoIdList
=
storeInfoIdListNew
;
}
}
String
storeInfoIdsNew
=
StringUtils
.
join
(
storeInfoIdList
,
","
);
int
i
=
storeService
.
bulkUpdateStoreStatus
(
storeInfoIdsNew
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
int
valueCode
=
Integer
.
parseInt
(
value
);
storeLogService
.
saveBulkStoreStatusLog
(
storeInfoIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店状态变更为【"
+
StoreStatusEnum
.
parseCode
(
valueCode
)
+
"】"
);
for
(
Integer
storeInfoId
:
storeInfoIdList
)
{
// 启用禁用的值和会员组取的不一致 需要转换下
...
...
@@ -69,8 +92,30 @@ public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
}
}
return
i
;
return
errorMsg
;
}
return
null
;
}
private
String
getStoreHasNotClerkMsg
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIdList
,
List
<
Integer
>
storeInfoIdListNew
)
{
// 没有导购的门店
List
<
Integer
>
storeInfoIdHasNotClerkMsgList
;
if
(
CollectionUtils
.
isNotEmpty
(
storeInfoIdListNew
))
{
storeInfoIdHasNotClerkMsgList
=
storeInfoIdList
.
stream
().
filter
(
e
->
!
storeInfoIdListNew
.
contains
(
e
)).
collect
(
Collectors
.
toList
());
}
else
{
storeInfoIdHasNotClerkMsgList
=
storeInfoIdList
;
}
return
0
;
StoreSearchDbDTO
storeSearchDbDTO
=
new
StoreSearchDbDTO
();
storeSearchDbDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDbDTO
.
setStoreInfoIdList
(
storeInfoIdHasNotClerkMsgList
);
String
msg
=
storeService
.
listStore
(
storeSearchDbDTO
,
1
,
Integer
.
MAX_VALUE
).
stream
().
map
(
StoreDTO:
:
getStoreName
).
collect
(
Collectors
.
joining
(
","
));
return
String
.
format
(
"共选中%d家门店,%d家成功启用,%s下无可用导购,无法启用门店,请在门店下至少新建或启用一个导购"
,
storeInfoIdList
.
size
(),
CollectionUtils
.
isNotEmpty
(
storeInfoIdListNew
)
?
storeInfoIdListNew
.
size
()
:
0
,
msg
);
}
}
gic-store-service/src/main/resources/mapper/TabClerkMapper.xml
View file @
d5dbbca2
...
...
@@ -411,4 +411,16 @@
from tab_clerk
where enterprise_id = #{enterpriseId}
</select>
<!-- listStoreInfoIdByStoreInfoId-->
<select
id=
"listStoreInfoIdByStoreInfoId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_clerk where enterprise_id = #{enterpriseId}
<if
test=
"null != ids and ids.size > 0"
>
and store_info_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
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