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
6b513f23
Commit
6b513f23
authored
Jul 04, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分组策略
parent
6dc88658
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
StoreStrategyApiServiceImpl.java
.../gic/store/service/outer/StoreStrategyApiServiceImpl.java
+19
-0
StoreStrategyController.java
...com/gic/store/web/controller/StoreStrategyController.java
+16
-0
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/StoreStrategyApiServiceImpl.java
View file @
6b513f23
...
...
@@ -6,7 +6,9 @@ import com.gic.commons.util.EntityUtil;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.store.constant.StoreGroupConstant
;
import
com.gic.store.dto.StoreStrategyDTO
;
import
com.gic.store.entity.TabStoreGroupStrategyWeights
;
import
com.gic.store.entity.TabStoreStrategy
;
import
com.gic.store.service.StoreGroupStrategyWeightsService
;
import
com.gic.store.service.StoreStrategyApiService
;
import
com.gic.store.service.StoreStrategyService
;
import
com.gic.store.utils.ErrorCode
;
...
...
@@ -26,6 +28,8 @@ public class StoreStrategyApiServiceImpl implements StoreStrategyApiService{
@Autowired
private
StoreStrategyService
storeStrategyService
;
@Autowired
private
StoreGroupStrategyWeightsService
storeGroupStrategyWeightsService
;
@Override
public
ServiceResponse
<
Integer
>
saveStoreGroupStrategy
(
StoreStrategyDTO
storeStrategyDTO
)
{
...
...
@@ -157,4 +161,19 @@ public class StoreStrategyApiServiceImpl implements StoreStrategyApiService{
}
return
ServiceResponse
.
success
(
page
);
}
@Override
public
ServiceResponse
<
Integer
>
getWeightsByEnterpriseId
(
int
enterpriseId
)
{
TabStoreGroupStrategyWeights
weight
=
storeGroupStrategyWeightsService
.
getWeightByEnterpriseId
(
enterpriseId
);
int
result
=
weight
==
null
?
0
:
weight
.
getStatus
();
return
ServiceResponse
.
success
(
result
);
}
@Override
public
ServiceResponse
<
Integer
>
saveOrUpdateWeights
(
int
status
,
int
enterpriseId
)
{
TabStoreGroupStrategyWeights
record
=
new
TabStoreGroupStrategyWeights
();
record
.
setEnterpriseId
(
enterpriseId
);
record
.
setStatus
(
status
);
return
ServiceResponse
.
success
(
storeGroupStrategyWeightsService
.
saveOrUpdate
(
record
));
}
}
gic-store-web/src/main/java/com/gic/store/web/controller/StoreStrategyController.java
View file @
6b513f23
...
...
@@ -7,6 +7,7 @@ import com.gic.commons.webapi.reponse.RestResponse;
import
com.gic.store.constant.StoreGroupConstant
;
import
com.gic.store.dto.StoreStrategyDTO
;
import
com.gic.store.service.StoreStrategyApiService
;
import
com.gic.store.utils.ErrorCode
;
import
com.gic.store.web.qo.PageQO
;
import
com.gic.store.web.qo.storestrategy.StoreStrategyQO
;
import
com.gic.store.web.vo.storestrategy.StoreGroupStrateVO
;
...
...
@@ -122,6 +123,21 @@ public class StoreStrategyController {
}
}
@RequestMapping
(
"/update-group-strategy-weights"
)
public
RestResponse
updateWeight
(
Integer
status
)
{
if
(
status
==
null
)
{
RestResponse
.
failure
(
ErrorCode
.
ERR_5
.
getCode
(),
"参数错误"
);
}
ServiceResponse
<
Integer
>
result
=
storeStrategyApiService
.
saveOrUpdateWeights
(
status
,
StoreGroupConstant
.
TEST_ENTERPRISE_ID
);
return
RestResponse
.
success
(
result
.
getResult
());
}
@RequestMapping
(
"/get-group-strategy-weights"
)
public
RestResponse
getWeight
()
{
ServiceResponse
<
Integer
>
result
=
storeStrategyApiService
.
getWeightsByEnterpriseId
(
StoreGroupConstant
.
TEST_ENTERPRISE_ID
);
return
RestResponse
.
success
(
result
.
getResult
());
}
private
StoreStrategyDTO
transferQoToDTO
(
StoreStrategyQO
storeStrategyQO
)
{
StoreStrategyDTO
storeStrategyDTO
=
EntityUtil
.
changeEntityNew
(
StoreStrategyDTO
.
class
,
storeStrategyQO
);
...
...
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