门店号管理

master
LegnaYet 6 years ago
parent 43ad1c8480
commit 0abca1cfc7

@ -5,10 +5,13 @@ import com.kiisoo.ic.store.entity.PoiStore;
import com.kiisoo.ic.store.service.PoiStoreService; import com.kiisoo.ic.store.service.PoiStoreService;
import com.kiisoo.ic.utils.DataImportUtil; import com.kiisoo.ic.utils.DataImportUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -33,12 +36,22 @@ public class PoiStoreController extends BaseController {
*/ */
@RequestMapping(value = "/user/shop",method = RequestMethod.POST) @RequestMapping(value = "/user/shop",method = RequestMethod.POST)
@ResponseBody @ResponseBody
public Map<String,Object> getUserShop(@RequestParam("userId")long userId, @RequestParam(value = "customerIds[]",required =false)List<Long> customerIds,String customerId){ public Map<String,Object> getUserShop(@RequestParam("userId")long userId, @RequestParam(value = "customerIds",required =false)String customerIds){
try { try {
if((customerIds == null || customerIds.size() == 0)&& customerId != null){ List<Long> customers = null;
customerIds = Arrays.asList(customerId.split(",")).stream().map(Long::parseLong).collect(Collectors.toList());; if (StringUtils.isNotBlank(customerIds)){
String[] split = customerIds.replace("[", "").replace("]", "").split(",");
List<String> strings = Arrays.asList(split);
if (CollectionUtils.isNotEmpty(strings)){
customers = new ArrayList<>();
for (String customerId:strings){
if (StringUtils.isNotBlank(customerId)){
customers.add(Long.parseLong(customerId));
}
}
}
} }
return data(poiStoreService.getRegionShop(userId,customerIds)); return data(poiStoreService.getRegionShop(userId,customers));
}catch (Exception e){ }catch (Exception e){
log.error("获取用户店铺失败",e); log.error("获取用户店铺失败",e);
return fail(); return fail();

Loading…
Cancel
Save