Commit 7df86e84 by 陶光胜

门店查询接口

parent 329e1b5a
......@@ -16,6 +16,7 @@ public class StoreSearchDTO implements Serializable {
private String storeInfoIds;
private Integer storeBrandId;
private String searchJson;
private String authSearchJson;
private Integer currentPage=1;
private Integer pageSize=20;
......@@ -138,4 +139,12 @@ public class StoreSearchDTO implements Serializable {
public void setStoreBrandId(Integer storeBrandId) {
this.storeBrandId = storeBrandId;
}
public String getAuthSearchJson() {
return authSearchJson;
}
public void setAuthSearchJson(String authSearchJson) {
this.authSearchJson = authSearchJson;
}
}
package com.gic.store.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.dto.StoreDTO;
import com.gic.store.dto.StoreWidgetDTO;
public interface StoreWidgetApiService {
......@@ -38,4 +40,13 @@ public interface StoreWidgetApiService {
* @return
*/
ServiceResponse<Integer> updateAuth(StoreWidgetDTO storeWidgetDTO);
/** @Description: 通过门店控件id查询门店
* @author taogs
* @Date 16:35 2019/12/4
* @Param
* @return
*/
ServiceResponse<Page<StoreDTO>> listStoreByStoreWidgetId(Integer enterpriseId, Integer storeWidgetId, int pageNum, int pageSize);
}
......@@ -887,6 +887,13 @@ public class StoreApiServiceImpl implements StoreApiService {
jsonObjectList.add(json);
}
}
if(StringUtils.isNotBlank(storeSearchDTO.getAuthSearchJson())){
ServiceResponse<JSONObject> jsonObjectServiceResponse = this.parseStoreSelectJson(storeSearchDTO.getAuthSearchJson());
if(jsonObjectServiceResponse.isSuccess()){
json = jsonObjectServiceResponse.getResult();
jsonObjectList.add(json);
}
}
enterpriseJson = QueryConditionAssemblyUtil.createListQueryNode(jsonObjectList, OperateEnum.OPERATE_AND);
return enterpriseJson;
}
......
package com.gic.store.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import com.gic.store.dto.StoreDTO;
import com.gic.store.dto.StoreSearchDTO;
import com.gic.store.dto.StoreWidgetDTO;
import com.gic.store.service.StoreApiService;
import com.gic.store.service.StoreWidgetApiService;
import com.gic.store.service.StoreWidgetService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -13,6 +17,8 @@ import org.springframework.stereotype.Service;
public class StoreWidgetApiServiceImpl implements StoreWidgetApiService {
@Autowired
private StoreWidgetService storeWidgetService;
@Autowired
private StoreApiService storeApiService;
@Override
public ServiceResponse<Integer> saveStoreWidget(StoreWidgetDTO storeWidgetDTO) {
......@@ -59,4 +65,22 @@ public class StoreWidgetApiServiceImpl implements StoreWidgetApiService {
}
return EnterpriseServiceResponse.failure(ErrorCode.SYSTEM_ERROR);
}
@Override
public ServiceResponse<Page<StoreDTO>> listStoreByStoreWidgetId(Integer enterpriseId, Integer storeWidgetId, int pageNum, int pageSize) {
if(pageSize == Integer.MAX_VALUE){
pageSize = 10000;
}
StoreWidgetDTO storeWidgetDTO = this.storeWidgetService.getStoreWidget(storeWidgetId);
if(storeWidgetDTO != null){
String authSearchParam = storeWidgetDTO.getAuthSearchParam();
String searchParam = storeWidgetDTO.getSearchParam();
StoreSearchDTO dto = new StoreSearchDTO();
dto.setEnterpriseId(enterpriseId);
dto.setAuthSearchJson(authSearchParam);
dto.setSearchJson(searchParam);
return this.storeApiService.listStore(dto, pageNum, pageSize);
}
return ServiceResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "门店控件id不存在");
}
}
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