Commit b207b14e by zhiwj

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-store into developer

parents 83245949 5cec8bed
......@@ -188,6 +188,16 @@ public interface StoreGroupService {
boolean isLeafNode(Integer storeGroupId);
/**
* 是否是叶子节点
* @Title: isLeafNodeWhenNewStoreGroup

* @Description:

* @author guojuxing
* @param storeGroupId

* @return boolean


*/
boolean isLeafNodeWhenNewStoreGroup(Integer storeGroupId);
/**
* 查询所有门店分组
* @Title: selectAllStoreGroup

* @Description:
......
......@@ -147,7 +147,18 @@ public class StoreGroupServiceImpl implements StoreGroupService{
@Override
public boolean isLeafNode(Integer storeGroupId) {
int count = tabStoreGroupMapper.countByParentId(storeGroupId);
if (count > 1) { //新节点已经创建,所以应该大于1
if (count > 0) {
return false;
} else {
return true;
}
}
@Override
public boolean isLeafNodeWhenNewStoreGroup(Integer storeGroupId) {
int count = tabStoreGroupMapper.countByParentId(storeGroupId);
//新节点已经创建,所以应该大于1
if (count > 1) {
return false;
} else {
return true;
......
......@@ -77,7 +77,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
storeGroupChain.setStoreGroupId(storeGroupId);
storeGroupChain.setStoreGroupChain(getStoreGroupChain(storeGroupId));
storeGroupService.update(storeGroupChain);
boolean needTransferStore = isNeedTransferStore(storeGroupDTO.getParentStoreGroupId());
boolean needTransferStore = isNeedTransferStoreWhenNew(storeGroupDTO.getParentStoreGroupId());
logger.info("needTransferStore:{}", needTransferStore);
if (needTransferStore) {
//转移门店
......@@ -419,6 +419,20 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
* @param parentStoreGroupId
* @return
*/
private boolean isNeedTransferStoreWhenNew(Integer parentStoreGroupId) {
if (storeGroupService.isLeafNodeWhenNewStoreGroup(parentStoreGroupId)
&& isContainStore(parentStoreGroupId)) {
return true;
} else {
return false;
}
}
/**
* 是否需要转移门店 判断上级门店是否是子节点,并且是否有门店
* @param parentStoreGroupId
* @return
*/
private boolean isNeedTransferStore(Integer parentStoreGroupId) {
if (storeGroupService.isLeafNode(parentStoreGroupId)
&& isContainStore(parentStoreGroupId)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment