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
14e65c11
Commit
14e65c11
authored
Jul 02, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店分组
parent
bdd10c81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
StoreGroupApiServiceImpl.java
...com/gic/store/service/outer/StoreGroupApiServiceImpl.java
+11
-3
StoreGroupQO.java
...in/java/com/gic/store/web/qo/storegroup/StoreGroupQO.java
+2
-1
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/StoreGroupApiServiceImpl.java
View file @
14e65c11
...
...
@@ -110,8 +110,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService{
}
int
storeGroupId
=
storeGroupDTO
.
getStoreGroupId
();
TabStoreGroup
oldStoreGroup
=
validIsDefault
(
storeGroupId
);
if
(
storeGroupDTO
.
getGroupLevel
()
!=
StoreGroupConstant
.
FIRST_STORE_GROUP_LEVEL
)
{
//如果不是第一级,则可能有上级分组修改
if
(
oldStoreGroup
.
getGroupLevel
()
!=
StoreGroupConstant
.
FIRST_STORE_GROUP_LEVEL
)
{
if
(
storeGroupDTO
.
getParentStoreGroupId
()
==
null
)
{
throw
new
StoreGroupException
(
StoreGroupErrorEnum
.
ParentStoreGroupParamError
.
getCode
(),
StoreGroupErrorEnum
.
ParentStoreGroupParamError
.
getMessage
());
}
...
...
@@ -119,6 +118,15 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService{
int
oldStoreGroupParentId
=
oldStoreGroup
.
getParentStoreGroupId
();
boolean
hasEditParentId
=
storeGroupParentId
!=
oldStoreGroupParentId
;
if
(
hasEditParentId
)
{
//验证父级ID的层级和当前层级是否相差一,如果是,则正确,否则,数据异常
TabStoreGroup
parentStoreGroup
=
tabStoreGroupMapper
.
selectByPrimaryKey
(
storeGroupParentId
);
if
(
parentStoreGroup
==
null
)
{
throw
new
StoreGroupException
(
StoreGroupErrorEnum
.
ParentStoreGroupParamError
.
getCode
(),
"父级ID数据错误,查询不到数据"
);
}
if
(
oldStoreGroup
.
getGroupLevel
()
-
parentStoreGroup
.
getGroupLevel
()
!=
1
)
{
throw
new
StoreGroupException
(
StoreGroupErrorEnum
.
ParentStoreGroupParamError
.
getCode
(),
"父级ID数据错误,不是当前的上级层级"
);
}
//如果修改了上级分组,则该分组下的所有子级分组都需要修改分组链数据
tabStoreGroupMapper
.
updateStoreGroupChainByStoreGroupId
(
storeGroupId
,
oldStoreGroupParentId
,
storeGroupParentId
);
...
...
@@ -134,7 +142,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService{
StoreGroupDTO
noStoreGroup
=
new
StoreGroupDTO
();
noStoreGroup
.
setEnterpriseId
(
storeGroupDTO
.
getEnterpriseId
());
noStoreGroup
.
setGroupLevel
(
oldStoreGroup
.
getGroupLevel
());
noStoreGroup
.
setStoreGroupName
(
"未分组门店"
);
noStoreGroup
.
setStoreGroupName
(
"未分组门店"
+
System
.
currentTimeMillis
()
);
noStoreGroup
.
setParentStoreGroupId
(
storeGroupParentId
);
int
noStoreGroupId
=
save
(
noStoreGroup
);
//转移门店
...
...
gic-store-web/src/main/java/com/gic/store/web/qo/storegroup/StoreGroupQO.java
View file @
14e65c11
...
...
@@ -48,6 +48,7 @@ public class StoreGroupQO implements Serializable{
/**
* 父级分组id
*/
@NotNull
(
message
=
"父级ID不能为空"
,
groups
=
{
EditParentIdValidView
.
class
})
private
Integer
parentStoreGroupId
;
/**
...
...
@@ -58,7 +59,7 @@ public class StoreGroupQO implements Serializable{
/**
* 分组层级
*/
@NotNull
(
message
=
"层级不能为空"
,
groups
=
{
SaveValidView
.
class
,
EditParentIdValidView
.
class
})
@NotNull
(
message
=
"层级不能为空"
,
groups
=
{
SaveValidView
.
class
})
private
Integer
groupLevel
;
/**
...
...
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