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
0b1561af
Commit
0b1561af
authored
Oct 08, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改分组策略bug
parent
f3537f69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+7
-3
dubbo-project.properties
...store-service/src/main/resources/dubbo-project.properties
+4
-2
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
0b1561af
...
...
@@ -31,6 +31,7 @@ import org.apache.logging.log4j.Logger;
import
org.redisson.api.RKeys
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -47,6 +48,8 @@ import java.util.stream.Collectors;
public
class
StoreApiServiceImpl
implements
StoreApiService
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
StoreApiServiceImpl
.
class
);
private
static
Map
<
Integer
,
BulkUpdateStoreStrtegy
>
storeStrtegyMap
=
new
HashMap
<>();
@Value
(
"${storeExpiredTime}"
)
private
Long
storeExpiredTime
;
@Autowired
private
StoreService
storeService
;
@Autowired
...
...
@@ -192,7 +195,7 @@ public class StoreApiServiceImpl implements StoreApiService {
* @return
*/
private
String
getGroup
(
StoreDTO
storeDTO
)
{
if
(
Integer
.
valueOf
(
1
)
==
storeStrategyApiService
.
getStoreGroupStrategyWeight
(
storeDTO
.
getEnterpriseId
()).
getResult
()
&&
storeDTO
.
getIsEditStoreGroup
()
==
1
)
{
if
(
storeDTO
.
getIsEditStoreGroup
()
==
1
||
Integer
.
valueOf
(
0
).
equals
(
storeStrategyApiService
.
getStoreGroupStrategyWeight
(
storeDTO
.
getEnterpriseId
()).
getResult
())
)
{
// 不启用分组策略
if
(
storeDTO
.
getStoreGroupId
()
==
null
)
{
// 取 未分类 分组
...
...
@@ -355,12 +358,13 @@ public class StoreApiServiceImpl implements StoreApiService {
return
ServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
ErrorCode
.
NOTEXISTS
.
getMsg
());
}
// todo 修改门店缓存时间
RedisUtil
.
setCache
(
key
,
storeDTO
,
1L
,
TimeUnit
.
HOURS
);
RedisUtil
.
setCache
(
key
,
storeDTO
,
storeExpiredTime
,
TimeUnit
.
HOURS
);
}
return
ServiceResponse
.
success
(
storeDTO
);
}
private
StoreDTO
getStoreDTO
(
Integer
enterpriseId
,
Integer
storeId
)
{
@Override
public
StoreDTO
getStoreDTO
(
Integer
enterpriseId
,
Integer
storeId
)
{
StoreDTO
store
=
storeService
.
getById
(
storeId
);
if
(
store
==
null
)
{
return
null
;
...
...
gic-store-service/src/main/resources/dubbo-project.properties
View file @
0b1561af
dubbo.registry.file
=
gic-store-service
\ No newline at end of file
dubbo.registry.file
=
gic-store-service
# 门店详情过期时间 单位:小时
storeExpiredTime
=
1
\ 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