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
e9bfa290
Commit
e9bfa290
authored
Mar 25, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店分组如果上级分组是子节点且下面有门店,则提示
parent
2341841d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
6 deletions
+45
-6
StoreGroupApiService.java
...main/java/com/gic/store/service/StoreGroupApiService.java
+22
-0
StoreGroupApiServiceImpl.java
...ic/store/service/outer/impl/StoreGroupApiServiceImpl.java
+23
-6
No files found.
gic-store-api/src/main/java/com/gic/store/service/StoreGroupApiService.java
View file @
e9bfa290
...
...
@@ -35,6 +35,28 @@ public interface StoreGroupApiService {
ServiceResponse
<
String
>
update
(
StoreGroupDTO
storeGroupDTO
);
/**
* 修改上级分组之前验证,上级分组ID是否是子节点且有门店
* @Title: tipWhenUpdateParentId
* @Description:
* @author guojuxing
* @param parentStoreGroupId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Boolean>
*/
ServiceResponse
<
Boolean
>
tipWhenUpdateParentId
(
Integer
parentStoreGroupId
);
/**
* 新增子分组验证,是否是子节点且有门店
* @Title: tipWhenSaveStoreGroup
* @Description:
* @author guojuxing
* @param groupLevel
* @param enterpriseId
* @param parentStoreGroupId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Boolean>
*/
ServiceResponse
<
Boolean
>
tipWhenSaveStoreGroup
(
Integer
groupLevel
,
Integer
enterpriseId
,
Integer
parentStoreGroupId
);
/**
* 编辑名称
* @Title: updateStoreGroupName
* @Description:
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreGroupApiServiceImpl.java
View file @
e9bfa290
...
...
@@ -73,7 +73,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
storeGroupChain
.
setStoreGroupChain
(
getStoreGroupChain
(
storeGroupId
));
storeGroupService
.
update
(
storeGroupChain
);
if
(
isNeedTransferStore
(
storeGroupDTO
))
{
if
(
isNeedTransferStore
(
storeGroupDTO
.
getParentStoreGroupId
()
))
{
//转移门店
storeService
.
updateGroupId
(
storeGroupDTO
.
getParentStoreGroupId
(),
storeGroupId
);
}
...
...
@@ -143,7 +143,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
storeGroupService
.
update
(
tabStoreGroup
);
//如果上级分组有门店,则新建一个未分组数据,然后把所有门店放进去
if
(
isNeedTransferStore
(
storeGroup
DTO
))
{
if
(
isNeedTransferStore
(
storeGroup
ParentId
))
{
StoreGroupDTO
noStoreGroup
=
new
StoreGroupDTO
();
noStoreGroup
.
setEnterpriseId
(
storeGroupDTO
.
getEnterpriseId
());
noStoreGroup
.
setGroupLevel
(
oldStoreGroup
.
getGroupLevel
());
...
...
@@ -164,6 +164,23 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
}
@Override
public
ServiceResponse
<
Boolean
>
tipWhenUpdateParentId
(
Integer
parentStoreGroupId
)
{
return
ServiceResponse
.
success
(
isNeedTransferStore
(
parentStoreGroupId
));
}
@Override
public
ServiceResponse
<
Boolean
>
tipWhenSaveStoreGroup
(
Integer
groupLevel
,
Integer
enterpriseId
,
Integer
parentStoreGroupId
)
{
//父级ID
ServiceResponse
<
Integer
>
parentIdWhenNew
=
getParentIdWhenNew
(
groupLevel
,
enterpriseId
,
parentStoreGroupId
);
if
(
parentIdWhenNew
.
isSuccess
())
{
parentStoreGroupId
=
parentIdWhenNew
.
getResult
();
}
else
{
return
ServiceResponse
.
failure
(
parentIdWhenNew
.
getCode
(),
parentIdWhenNew
.
getMessage
());
}
return
ServiceResponse
.
success
(
isNeedTransferStore
(
parentStoreGroupId
));
}
@Override
public
ServiceResponse
<
Integer
>
updateStoreGroupName
(
StoreGroupDTO
storeGroupDTO
)
{
if
(
storeGroupDTO
.
getStoreGroupId
()
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"主键不能为空"
);
...
...
@@ -366,12 +383,12 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
/**
* 是否需要转移门店,新增门店,判断上级门店是否是子节点,并且是否有门店
* @param
storeGroupDTO
* @param
parentStoreGroupId
* @return
*/
private
boolean
isNeedTransferStore
(
StoreGroupDTO
storeGroupDTO
)
{
if
(
storeGroupService
.
isLeafNode
(
storeGroupDTO
.
getParentStoreGroupId
()
)
&&
isContainStore
(
storeGroupDTO
.
getStoreGroupId
()
))
{
private
boolean
isNeedTransferStore
(
Integer
parentStoreGroupId
)
{
if
(
storeGroupService
.
isLeafNode
(
parentStoreGroupId
)
&&
isContainStore
(
parentStoreGroupId
))
{
return
true
;
}
else
{
return
false
;
...
...
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