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
c8dfff46
Commit
c8dfff46
authored
Aug 13, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
给会员组通知
parent
58f5798c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
110 additions
and
30 deletions
+110
-30
pom.xml
gic-store-service/pom.xml
+5
-0
TabClerkMapper.java
...rc/main/java/com/gic/store/dao/mapper/TabClerkMapper.java
+3
-0
ClerkService.java
...ice/src/main/java/com/gic/store/service/ClerkService.java
+4
-2
ClerkServiceImpl.java
...ain/java/com/gic/store/service/impl/ClerkServiceImpl.java
+6
-12
ClerkApiServiceImpl.java
...com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
+20
-1
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+7
-0
StoreBrandUpdateStrategyImpl.java
...gic/store/strategy/impl/StoreBrandUpdateStrategyImpl.java
+47
-14
StoreStatusStrategyImpl.java
.../com/gic/store/strategy/impl/StoreStatusStrategyImpl.java
+10
-1
dubbo-gic-store-service.xml
...re-service/src/main/resources/dubbo-gic-store-service.xml
+1
-0
TabClerkMapper.xml
...tore-service/src/main/resources/mapper/TabClerkMapper.xml
+7
-0
No files found.
gic-store-service/pom.xml
View file @
c8dfff46
...
...
@@ -146,6 +146,11 @@
<artifactId>
gic-weimob-api
</artifactId>
<version>
${gic-weimob-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-spark-run-api
</artifactId>
<version>
${gic-spark-run-api}
</version>
</dependency>
</dependencies>
<build>
...
...
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabClerkMapper.java
View file @
c8dfff46
...
...
@@ -84,4 +84,6 @@ public interface TabClerkMapper {
List
<
TabClerk
>
listHaobanClerk
(
@Param
(
"enterpriseIdList"
)
List
<
Integer
>
enterpriseIdList
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"storeInfoIdList"
)
List
<
Integer
>
storeInfoIdList
);
List
<
TabClerk
>
listClerkByPositionId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"positionId"
)
Integer
positionId
);
List
<
Integer
>
listAllClerkId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/ClerkService.java
View file @
c8dfff46
...
...
@@ -106,12 +106,12 @@ public interface ClerkService {
* @Description: 批量修改导购状态
* @author zhiwj
* @param enterpriseId 企业id
* @param clerkId
s
导购ids
* @param clerkId
List
导购ids
* @param status 状态
* @return java.lang.Integer
* @throws
*/
Integer
updateClerkStatus
(
Integer
enterpriseId
,
String
clerkIds
,
Integer
status
);
Integer
updateClerkStatus
(
Integer
enterpriseId
,
List
<
Integer
>
clerkIdList
,
Integer
status
);
List
<
TabClerk
>
listClerkByIds
(
Integer
enterpriseId
,
String
clerkIds
);
...
...
@@ -132,4 +132,6 @@ public interface ClerkService {
List
<
TabClerk
>
listHaobanClerk
(
List
<
Integer
>
enterpriseIdList
,
String
keyword
,
List
<
Integer
>
storeInfoIdList
);
List
<
TabClerk
>
listClerkByPositionId
(
Integer
enterpriseId
,
Integer
positionId
);
List
<
Integer
>
listAllClerkId
(
Integer
enterpriseId
);
}
gic-store-service/src/main/java/com/gic/store/service/impl/ClerkServiceImpl.java
View file @
c8dfff46
...
...
@@ -120,18 +120,7 @@ public class ClerkServiceImpl implements ClerkService {
}
@Override
public
Integer
updateClerkStatus
(
Integer
enterpriseId
,
String
clerkIds
,
Integer
status
)
{
List
<
Integer
>
clerkIdList
;
if
(
StringUtils
.
isNotBlank
(
clerkIds
))
{
if
(
StringUtils
.
equals
(
"all"
,
clerkIds
))
{
clerkIdList
=
null
;
}
else
{
String
[]
split
=
clerkIds
.
split
(
GlobalInfo
.
FLAG_COMMA
);
clerkIdList
=
Stream
.
of
(
split
).
map
(
Integer:
:
parseInt
).
collect
(
Collectors
.
toList
());
}
}
else
{
return
0
;
}
public
Integer
updateClerkStatus
(
Integer
enterpriseId
,
List
<
Integer
>
clerkIdList
,
Integer
status
)
{
return
tabClerkMapper
.
updateClerkStatus
(
enterpriseId
,
clerkIdList
,
status
);
}
...
...
@@ -197,4 +186,9 @@ public class ClerkServiceImpl implements ClerkService {
return
tabClerkMapper
.
listClerkByPositionId
(
enterpriseId
,
positionId
);
}
@Override
public
List
<
Integer
>
listAllClerkId
(
Integer
enterpriseId
)
{
return
tabClerkMapper
.
listAllClerkId
(
enterpriseId
);
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
View file @
c8dfff46
...
...
@@ -6,6 +6,7 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.commons.util.CollectionUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.enterprise.constants.Constants
;
import
com.gic.enterprise.dto.wm.WmStoreSyncLogDTO
;
import
com.gic.enterprise.error.ErrorCode
;
...
...
@@ -13,6 +14,7 @@ import com.gic.enterprise.response.EnterpriseServiceResponse;
import
com.gic.enterprise.service.EnterpriseApiService
;
import
com.gic.enterprise.service.WmStoreSyncLogApiService
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.spark.api.service.SparkJobApiService
;
import
com.gic.store.constant.ClerkLogReasonEnum
;
import
com.gic.store.constant.ImportClerkBatchResultEnum
;
import
com.gic.store.constant.StoreLogTypeEnum
;
...
...
@@ -35,6 +37,7 @@ import org.springframework.stereotype.Service;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
* @author zhiwj
...
...
@@ -67,6 +70,8 @@ public class ClerkApiServiceImpl implements ClerkApiService {
private
WmStoreSyncLogApiService
wmStoreSyncLogApiService
;
@Autowired
private
ClerkPositionService
clerkPositionService
;
@Autowired
private
SparkJobApiService
sparkJobApiService
;
@Override
public
ServiceResponse
saveOrUpdate
(
ClerkDTO
clerkDTO
)
{
...
...
@@ -431,7 +436,21 @@ public class ClerkApiServiceImpl implements ClerkApiService {
@Override
public
ServiceResponse
updateClerkStatus
(
Integer
enterpriseId
,
String
clerkIds
,
Integer
status
)
{
return
ServiceResponse
.
success
(
clerkService
.
updateClerkStatus
(
enterpriseId
,
clerkIds
,
status
));
List
<
Integer
>
clerkIdList
;
if
(
StringUtils
.
isNotBlank
(
clerkIds
))
{
if
(
StringUtils
.
equals
(
"all"
,
clerkIds
))
{
clerkIdList
=
clerkService
.
listAllClerkId
(
enterpriseId
);
}
else
{
String
[]
split
=
clerkIds
.
split
(
GlobalInfo
.
FLAG_COMMA
);
clerkIdList
=
Stream
.
of
(
split
).
map
(
Integer:
:
parseInt
).
collect
(
Collectors
.
toList
());
}
Integer
i
=
clerkService
.
updateClerkStatus
(
enterpriseId
,
clerkIdList
,
status
);
for
(
Integer
clerkId
:
clerkIdList
)
{
sparkJobApiService
.
updateClerkStatus
(
enterpriseId
,
clerkId
.
longValue
(),
1
==
status
?
0
:
1
);
}
}
return
ServiceResponse
.
success
();
}
@Override
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
c8dfff46
...
...
@@ -24,6 +24,7 @@ import com.gic.search.business.api.dto.DynamicSearchDTO;
import
com.gic.search.business.api.dto.ESResponseQueryBatchDTO
;
import
com.gic.search.business.api.service.EsBusinessOperaApiService
;
import
com.gic.search.business.api.utils.QueryConditionAssemblyUtil
;
import
com.gic.spark.api.service.SparkJobApiService
;
import
com.gic.store.constant.*
;
import
com.gic.store.dto.*
;
import
com.gic.store.entity.*
;
...
...
@@ -112,6 +113,8 @@ public class StoreApiServiceImpl implements StoreApiService {
private
WeimobStoreSiteService
weimobStoreSiteService
;
@Autowired
private
WmStoreSyncLogApiService
wmStoreSyncLogApiService
;
@Autowired
private
SparkJobApiService
sparkJobApiService
;
private
Map
<
String
,
BulkUpdateStoreStrtegy
>
storeStrtegyMap
=
new
ConcurrentHashMap
<>();
...
...
@@ -205,6 +208,10 @@ public class StoreApiServiceImpl implements StoreApiService {
//修改门店同步到微盟
updateStoreToWm
(
storeDTO
);
// 给会员组发通知
if
(
StringUtils
.
isNotBlank
(
storeDTO
.
getBrandIds
())
&&
!
StringUtils
.
equals
(
existStore
.
getResult
().
getBrandIds
(),
storeDTO
.
getBrandIds
()))
{
sparkJobApiService
.
updateStoreBrand
(
storeDTO
.
getEnterpriseId
(),
storeDTO
.
getStoreInfoId
(),
Integer
.
parseInt
(
existStore
.
getResult
().
getBrandIds
()),
Integer
.
parseInt
(
storeDTO
.
getBrandIds
()));
}
}
// 自定义属性
String
error
=
storeExtendService
.
saveOrUpdate
(
storeDTO
.
getEnterpriseId
(),
storeDTO
.
getStoreInfoId
(),
storeDTO
.
getStoreExtendList
());
...
...
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreBrandUpdateStrategyImpl.java
View file @
c8dfff46
package
com
.
gic
.
store
.
strategy
.
impl
;
import
com.gic.spark.api.service.SparkJobApiService
;
import
com.gic.store.dto.StoreDTO
;
import
com.gic.store.dto.StoreSearchDBDTO
;
import
com.gic.store.entity.TabStoreBrand
;
import
com.gic.store.service.StoreBrandService
;
import
com.gic.store.service.StoreLogService
;
...
...
@@ -12,6 +15,7 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
@Component
(
"5"
)
public
class
StoreBrandUpdateStrategyImpl
implements
BulkUpdateStoreStrtegy
{
...
...
@@ -20,25 +24,54 @@ public class StoreBrandUpdateStrategyImpl implements BulkUpdateStoreStrtegy {
private
StoreLogService
storeLogService
;
@Autowired
private
StoreBrandService
storeBrandService
;
@Autowired
private
SparkJobApiService
sparkJobApiService
;
@Override
public
int
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreBrands
(
storeInfoIds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeInfoIds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeInfoIds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
}
List
<
Integer
>
storeInfoIdList
;
List
<
StoreDTO
>
storeList
;
if
(
"all"
.
equals
(
storeInfoIds
))
{
StoreSearchDBDTO
storeSearchDBDTO
=
new
StoreSearchDBDTO
();
storeSearchDBDTO
.
setOverflowStatus
(
0
);
storeList
=
storeService
.
listStore
(
storeSearchDBDTO
,
1
,
Integer
.
MAX_VALUE
);
storeInfoIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeInfoIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeInfoIds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeInfoIdList
.
add
(
Integer
.
valueOf
(
s
));
}
List
<
TabStoreBrand
>
storeBrandList
=
storeBrandService
.
listStoreBrandByIds
(
storeInfoIds
);
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
+
"】"
);
StoreSearchDBDTO
storeSearchDBDTO
=
new
StoreSearchDBDTO
();
storeSearchDBDTO
.
setOverflowStatus
(
0
);
storeSearchDBDTO
.
setStoreInfoIdList
(
storeInfoIdList
);
storeList
=
storeService
.
listStore
(
storeSearchDBDTO
,
1
,
Integer
.
MAX_VALUE
);
}
List
<
BrandUpdateDTO
>
brandUpdateList
=
new
ArrayList
<>(
storeList
.
size
());
for
(
StoreDTO
storeDTO
:
storeList
)
{
brandUpdateList
.
add
(
new
BrandUpdateDTO
(
storeDTO
.
getStoreInfoId
(),
Integer
.
valueOf
(
storeDTO
.
getBrandIds
())));
}
int
i
=
storeService
.
bulkUpdateStoreBrands
(
storeInfoIds
,
enterpriseId
,
value
);
List
<
TabStoreBrand
>
storeBrandList
=
storeBrandService
.
listStoreBrandByIds
(
value
);
String
content
=
Optional
.
ofNullable
(
storeBrandList
).
orElse
(
Collections
.
emptyList
()).
stream
().
map
(
TabStoreBrand:
:
getStoreBrandName
).
collect
(
Collectors
.
joining
(
","
));
storeLogService
.
saveBulkStoreInfoLog
(
storeInfoIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店品牌变更为【"
+
content
+
"】"
);
Integer
newBrand
=
Integer
.
valueOf
(
value
);
for
(
BrandUpdateDTO
brandUpdateDTO
:
brandUpdateList
)
{
sparkJobApiService
.
updateStoreBrand
(
enterpriseId
,
brandUpdateDTO
.
storeInfoId
,
brandUpdateDTO
.
oldStoreBrand
,
newBrand
);
}
return
i
;
}
class
BrandUpdateDTO
{
public
Integer
storeInfoId
;
public
Integer
oldStoreBrand
;
public
BrandUpdateDTO
(
Integer
storeInfoId
,
Integer
oldStoreBrand
)
{
this
.
storeInfoId
=
storeInfoId
;
this
.
oldStoreBrand
=
oldStoreBrand
;
}
}
}
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreStatusStrategyImpl.java
View file @
c8dfff46
package
com
.
gic
.
store
.
strategy
.
impl
;
import
com.gic.spark.api.service.SparkJobApiService
;
import
com.gic.store.constant.StoreStatusEnum
;
import
com.gic.store.service.StoreLogService
;
import
com.gic.store.service.StoreService
;
...
...
@@ -15,6 +16,8 @@ public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
@Autowired
private
StoreLogService
storeLogService
;
@Autowired
private
SparkJobApiService
sparkJobApiService
;
@Override
public
int
bulkUpdateStore
(
String
storeInfoIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
...
...
@@ -30,7 +33,13 @@ public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
storeInfoIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
storeLogService
.
saveBulkStoreStatusLog
(
storeInfoIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店状态变更为【"
+
StoreStatusEnum
.
parseCode
(
Integer
.
parseInt
(
value
))
+
"】"
);
int
valueCode
=
Integer
.
parseInt
(
value
);
storeLogService
.
saveBulkStoreStatusLog
(
storeInfoIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店状态变更为【"
+
StoreStatusEnum
.
parseCode
(
valueCode
)
+
"】"
);
for
(
Integer
storeInfoId
:
storeInfoIdList
)
{
// 启用禁用的值和会员组取的不一致 需要转换下
sparkJobApiService
.
updateStoreStatus
(
enterpriseId
,
storeInfoId
,
StoreStatusEnum
.
ONLINE
.
getCode
()
==
valueCode
?
0
:
1
);
}
}
return
i
;
}
...
...
gic-store-service/src/main/resources/dubbo-gic-store-service.xml
View file @
c8dfff46
...
...
@@ -68,4 +68,5 @@
<dubbo:reference
interface=
"com.gic.weimob.api.service.WeimobStoreSiteService"
id=
"weimobStoreSiteService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.enterprise.service.WmStoreSyncLogApiService"
id=
"wmStoreSyncLogApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.spark.api.service.SparkJobApiService"
id=
"sparkJobApiService"
timeout=
"6000"
/>
</beans>
gic-store-service/src/main/resources/mapper/TabClerkMapper.xml
View file @
c8dfff46
...
...
@@ -402,4 +402,10 @@
</if>
</where>
</select>
<select
id=
"listAllClerkId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_clerk
where enterprise_id = #{enterpriseId}
</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