Commit e25a358c by zhiwj

门店字段open api

parent 2879d498
......@@ -134,4 +134,41 @@ public interface StoreOpenApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>


*/
ServiceResponse<String> pageClerk(String appId, Integer enterpriseId, String storeCode, Integer regionId, Integer pageNum, Integer pageSize);
/**
* listRegion 门店域列表
* @Title: listRegion
* @Description:
* @author zhiwj
* @param appId
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>
* @throws
*/
ServiceResponse<String> listRegion(String appId, Integer enterpriseId);
/**
* listBrand 门店品牌列表
* @Title: listBrand
* @Description:
* @author zhiwj
* @param appId
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>
* @throws
*/
ServiceResponse<String> listBrand(String appId, Integer enterpriseId);
/**
* listField 域下自定义属性列表查询
* @Title: listField
* @Description:
* @author zhiwj
* @param appId
* @param enterpriseId
* @param regionId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>
* @throws
*/
ServiceResponse<String> listField(String appId, Integer enterpriseId, Integer regionId);
}
......@@ -27,10 +27,7 @@ import com.gic.store.dto.open.BusinessTimeOpenDTO;
import com.gic.store.dto.open.ClerkDTO;
import com.gic.store.dto.open.ClerkDetailDTO;
import com.gic.store.dto.open.StoreOpenDTO;
import com.gic.store.entity.TabClerk;
import com.gic.store.entity.TabStore;
import com.gic.store.entity.TabStoreBrand;
import com.gic.store.entity.TabStoreGroup;
import com.gic.store.entity.*;
import com.gic.store.service.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -81,6 +78,8 @@ public class StoreOpenApiServiceImpl implements StoreOpenApiService {
private StoreWidgetApiService storeWidgetApiService;
@Autowired
private ResourceApiService resourceApiService;
@Autowired
private StoreRegionService storeRegionService;
@Override
public ServiceResponse<String> getApiFieldJson(Integer enterpriseId, Integer regionId) {
......@@ -626,6 +625,61 @@ public class StoreOpenApiServiceImpl implements StoreOpenApiService {
return ServiceResponse.failure(clerkResult.getCode(), clerkResult.getMessage());
}
@Override
@GatewayParams(query = {"appId", "enterpriseId"})
public ServiceResponse<String> listRegion(String appId, Integer enterpriseId) {
//参数校验
ServiceResponse<EnterpriseDTO> enterpriseResult = enterpriseApiService.getEnterpriseById(enterpriseId);
if (!enterpriseResult.isSuccess()) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商户ID错误,无此商户");
}
List<StoreRegionDTO> regionList = storeRegionService.listStoreRegion(enterpriseId, null, null);
if (CollectionUtils.isNotEmpty(regionList)) {
return ServiceResponse.success(JSON.toJSONString(regionList));
} else {
return ServiceResponse.success();
}
}
@Override
@GatewayParams(query = {"appId", "enterpriseId"})
public ServiceResponse<String> listBrand(String appId, Integer enterpriseId) {
//参数校验
ServiceResponse<EnterpriseDTO> enterpriseResult = enterpriseApiService.getEnterpriseById(enterpriseId);
if (!enterpriseResult.isSuccess()) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商户ID错误,无此商户");
}
List<TabStoreBrand> storeBrandList = storeBrandService.listAllStoreBrand(enterpriseId, null);
if (CollectionUtils.isNotEmpty(storeBrandList)) {
return ServiceResponse.success(JSON.toJSONString(storeBrandList));
} else {
return ServiceResponse.success();
}
}
@Override
@GatewayParams(query = {"appId", "enterpriseId", "regionId"})
public ServiceResponse<String> listField(String appId, Integer enterpriseId, Integer regionId) {
//参数校验
ServiceResponse<EnterpriseDTO> enterpriseResult = enterpriseApiService.getEnterpriseById(enterpriseId);
if (!enterpriseResult.isSuccess()) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商户ID错误,无此商户");
}
TabStoreRegion region = storeRegionService.getById(enterpriseId, regionId);
if (region == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "门店域不存在");
}
List<StoreFieldDTO> fieldList = storeFieldService.listStoreFieldByRegionId(regionId);
if (CollectionUtils.isNotEmpty(fieldList)) {
return ServiceResponse.success(JSON.toJSONString(fieldList));
} else {
return ServiceResponse.success();
}
}
/**
* 验证权限门店相关权限
* @param appId
......
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