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
a2508fd8
Commit
a2508fd8
authored
Mar 25, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/base_platform_enterprise/gic-store
into developer
parents
f16b50bf
a1b24491
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
13 deletions
+76
-13
StoreGroupApiService.java
...main/java/com/gic/store/service/StoreGroupApiService.java
+22
-0
StoreGroupApiServiceImpl.java
...ic/store/service/outer/impl/StoreGroupApiServiceImpl.java
+23
-6
StoreGroupController.java
...va/com/gic/store/web/controller/StoreGroupController.java
+31
-7
No files found.
gic-store-api/src/main/java/com/gic/store/service/StoreGroupApiService.java
View file @
a2508fd8
...
...
@@ -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 @
a2508fd8
...
...
@@ -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
;
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreGroupController.java
View file @
a2508fd8
...
...
@@ -3,6 +3,7 @@ package com.gic.store.web.controller;
import
java.util.List
;
import
com.gic.download.utils.OperationResultUtils
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -70,26 +71,49 @@ public class StoreGroupController {
return
OperationResultUtils
.
operationResult
(
result
,
"修改上级分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
/**
* 新增子分组验证,是否是子节点且有门店
* @param groupLevel
* @param parentStoreGroupId
* @return
*/
@RequestMapping
(
"/has-parent-store-group-store-when-save"
)
public
RestResponse
hasParentStoreGroupStoreWhenSave
(
Integer
groupLevel
,
Integer
parentStoreGroupId
)
{
return
ResultControllerUtils
.
commonResult
(
storeGroupApiService
.
tipWhenSaveStoreGroup
(
groupLevel
,
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
parentStoreGroupId
));
}
/**
* 修改上级分组之前验证,上级分组ID是否是子节点且有门店
* @param parentStoreGroupId
* @return
*/
@RequestMapping
(
"/has-parent-store-group-store"
)
public
RestResponse
hasParentStoreGroupStore
(
Integer
parentStoreGroupId
)
{
return
ResultControllerUtils
.
commonResult
(
storeGroupApiService
.
tipWhenUpdateParentId
(
parentStoreGroupId
));
}
@RequestMapping
(
"/drag-sort"
)
public
RestResponse
dragSort
(
@Validated
({
StoreGroupQO
.
RemoveValidView
.
class
,
StoreGroupQO
.
SetSortValueValidView
.
class
})
StoreGroupQO
storeGroupQO
)
{
ServiceResponse
<
String
>
result
=
storeGroupApiService
.
dragSort
(
storeGroupQO
.
getStoreGroupId
(),
storeGroupQO
.
getSortValue
());
return
OperationResultUtils
.
operationResult
(
result
,
"拖拽排序门店分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
ServiceResponse
<
String
>
result
=
storeGroupApiService
.
dragSort
(
storeGroupQO
.
getStoreGroupId
(),
storeGroupQO
.
getSortValue
());
return
OperationResultUtils
.
operationResult
(
result
,
"拖拽排序门店分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/sort"
)
public
RestResponse
sort
(
@Validated
({
StoreGroupQO
.
SortValidView
.
class
})
StoreGroupQO
storeGroupQO
)
{
ServiceResponse
<
String
>
result
=
storeGroupApiService
.
sort
(
transferQoToDTO
(
storeGroupQO
),
storeGroupQO
.
isUp
());
return
OperationResultUtils
.
operationResult
(
result
,
"上下排序门店分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
return
OperationResultUtils
.
operationResult
(
result
,
"上下排序门店分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/remove"
)
public
RestResponse
remove
(
@Validated
({
StoreGroupQO
.
RemoveValidView
.
class
})
StoreGroupQO
storeGroupQO
)
{
ServiceResponse
<
String
>
result
=
storeGroupApiService
.
remove
(
storeGroupQO
.
getStoreGroupId
());
return
OperationResultUtils
.
operationResult
(
result
,
OperationResultUtils
.
LOG_DELETE
+
"门店分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
return
OperationResultUtils
.
operationResult
(
result
,
OperationResultUtils
.
LOG_DELETE
+
"门店分组"
,
OperationResultUtils
.
getOperationObject
(
result
));
}
private
StoreGroupDTO
transferQoToDTO
(
StoreGroupQO
storeGroupQO
)
{
...
...
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