Commit 805906d3 by 徐高华

Merge branch 'master_xgh_我的客户迭代' into 'developer'

门店查询

See merge request !365
parents fe9f8c71 853fdf4e
......@@ -24,7 +24,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
......@@ -41,6 +40,7 @@ import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.dto.StoreSearchDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.enterprise.api.service.StoreService;
import com.gic.enterprise.api.service.StoreWidgetService;
......@@ -1664,6 +1664,48 @@ public class WxStaffController extends WebBaseController {
return RestResponse.successResult(page);
}
//区经门店查询
@RequestMapping("search-clerk-store")
public RestResponse<Object> listClerkStoreByParams(String wxEnterpriseId, String enterpriseId, String storeSearchParams , String clerkId) {
if(StringUtils.isEmpty(storeSearchParams)) {
return RestResponse.failure("-1", "查询条件为空") ;
}
// 如果有权限控制,进行管辖门店过0滤
List<String> authStoreIdList = this.staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId, wxEnterpriseId);
if (CollectionUtils.isEmpty(authStoreIdList)) {
return RestResponse.failure("-1", "无授权门店");
}
StoreSearchDTO searchDTO = new StoreSearchDTO();
searchDTO.setRecycleStoreCount(0);
searchDTO.setMemberCountFlag(0);
searchDTO.setSearchName(storeSearchParams);
// 企业ID
searchDTO.setEnterpriseId(enterpriseId);
if(!authStoreIdList.contains("-1")) {
searchDTO.setAuthStoreIdList(authStoreIdList);
}
// 门店参数
Page page = new Page();
page.setPageSize(20);
page.setCurrentPage(1);
Map<String, Object> params = new HashMap<>();
params.put("searchDto", searchDTO);
page.setParams(params);
logger.info("查询条件={}", JSON.toJSONString(page));
Map<String, Object> result = storeService.getStoreListPage(page);
page = (Page) result.get("page");
List<StoreDTO> storeList = (List<StoreDTO>) result.get("list");
List<StoreListVO> retList = new ArrayList<StoreListVO>();
StoreListVO vo = null;
for (StoreDTO dto : storeList) {
vo = new StoreListVO();
vo.setStoreId(dto.getStoreId());
vo.setStoreName(dto.getStoreName());
retList.add(vo);
}
return RestResponse.successResult(retList);
}
private List<String> getStoreIdList(ClerkDTO clerkDTO) {
String enterpriseId = clerkDTO.getEnterpriseId() ;
String clerkId = clerkDTO.getClerkId();
......
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