Commit cba76f61 by zhiwj

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

parents 486fb9ef 1b191062
......@@ -2,6 +2,7 @@ package com.gic.store.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.dto.open.ClerkDTO;
import com.gic.store.dto.open.StoreGroupDTO;
import com.gic.store.dto.open.StoreOpenDTO;
/**
......@@ -182,4 +183,41 @@ public interface StoreOpenApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>


*/
ServiceResponse<String> listStoreGroup(String appId, Integer enterpriseId);
/**
* 新增分组
* @Title: saveStoreGroup

* @Description:

* @author guojuxing
* @param appId
* @param enterpriseId
* @param storeGroupInfo

* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>


*/
ServiceResponse<String> saveStoreGroup(String appId, Integer enterpriseId, StoreGroupDTO storeGroupInfo);
/**
* 编辑分组
* @Title: editStoreGroup

* @Description:

* @author guojuxing
* @param appId
* @param enterpriseId
* @param storeGroupId
* @param storeGroupName 

* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>


*/
ServiceResponse<String> editStoreGroup(String appId, Integer enterpriseId, Integer storeGroupId, String storeGroupName);
/**
* 删除分组
* @Title: deleteStoreGroup

* @Description:

* @author guojuxing
* @param appId
* @param enterpriseId
* @param storeGroupId

* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>


*/
ServiceResponse<String> deleteStoreGroup(String appId, Integer enterpriseId, Integer storeGroupId);
}
......@@ -283,7 +283,7 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
if (isContainStore(storeGroupId)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "该分组下存在门店,不能删除");
}
if (storeGroupService.isLeafNode(storeGroupId)) {
if (!storeGroupService.isLeafNode(storeGroupId)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "下面有子分组,不能删除");
}
ServiceResponse<TabStoreGroup> authValid = validIsDefault(storeGroupId);
......
......@@ -25,6 +25,7 @@ import com.gic.store.constant.StoreLogReasonEnum;
import com.gic.store.dto.*;
import com.gic.store.dto.open.ClerkDTO;
import com.gic.store.dto.open.*;
import com.gic.store.dto.open.StoreGroupDTO;
import com.gic.store.entity.*;
import com.gic.store.service.*;
import org.apache.commons.collections.CollectionUtils;
......@@ -78,6 +79,8 @@ public class StoreOpenApiServiceImpl implements StoreOpenApiService {
private ResourceApiService resourceApiService;
@Autowired
private StoreRegionService storeRegionService;
@Autowired
private StoreGroupApiService storeGroupApiService;
@Override
public ServiceResponse<String> getApiFieldJson(Integer enterpriseId, Integer regionId) {
......@@ -688,6 +691,41 @@ public class StoreOpenApiServiceImpl implements StoreOpenApiService {
return ServiceResponse.success();
}
@Override
@GatewayParams(query = { "appId", "enterpriseId"}, body = {"storeGroupInfo"})
public ServiceResponse<String> saveStoreGroup(String appId, Integer enterpriseId, StoreGroupDTO storeGroupInfo) {
com.gic.store.dto.StoreGroupDTO storeGroupDTO = EntityUtil.changeEntityNew(com.gic.store.dto.StoreGroupDTO.class, storeGroupInfo);
//确保是新增入口
storeGroupDTO.setStoreGroupId(null);
ServiceResponse<Integer> result = storeGroupApiService.save(storeGroupDTO);
if (result.isSuccess()) {
return ServiceResponse.success();
}
return ServiceResponse.failure("1", result.getMessage());
}
@Override
@GatewayParams(query = { "appId", "enterpriseId", "storeGroupId", "storeGroupName"})
public ServiceResponse<String> editStoreGroup(String appId, Integer enterpriseId, Integer storeGroupId, String storeGroupName) {
com.gic.store.dto.StoreGroupDTO storeGroupDTO = new com.gic.store.dto.StoreGroupDTO();
storeGroupDTO.setStoreGroupId(storeGroupId);
storeGroupDTO.setStoreGroupName(storeGroupName);
ServiceResponse<Integer> result = storeGroupApiService.updateStoreGroupName(storeGroupDTO);
if (result.isSuccess()) {
return ServiceResponse.success();
}
return ServiceResponse.failure("1", result.getMessage());
}
@Override
@GatewayParams(query = {"appId", "enterpriseId", "storeGroupId"})
public ServiceResponse<String> deleteStoreGroup(String appId, Integer enterpriseId, Integer storeGroupId) {
ServiceResponse<String> result = storeGroupApiService.remove(storeGroupId);
if (result.isSuccess()) {
return ServiceResponse.success();
}
return ServiceResponse.failure("1", result.getMessage());
}
/**
......
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