| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PutMapping("/freezingOrThawing") |
| | | @ApiOperation(value = "门店管理-冻结/解冻门店", tags = {"管理后台-门店管理"}) |
| | | public R freezingOrThawing(@RequestParam("id") Integer id, @RequestParam("status") Integer status){ |
| | | Shop shop = shopService.getById(id); |
| | | if(shop.getStatus().equals(status)){ |
| | | return R.fail("不能重复操作"); |
| | | } |
| | | shop.setStatus(status); |
| | | shopService.updateById(shop); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "门店列表", tags = {"管理后台-门店管理"}) |
| | | public R<IPage<Shop>> list(@ApiParam("页码") @RequestParam Integer pageNum,@ApiParam("每一页数据大小") Integer pageSize,Shop shop){ |
| | |
| | | @ResponseBody |
| | | @PostMapping("/getShopByUserId") |
| | | public R<List<Shop>> getShopByUserId(@RequestParam("id") Long id){ |
| | | List<Shop> list = shopService.lambdaQuery().eq(Shop::getAppUserId, id).list(); |
| | | List<Shop> list = shopService.lambdaQuery().eq(Shop::getAppUserId, id).eq(Shop::getDelFlag,0).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "获取可核销门店列表", tags = {"购物车-小程序"}) |
| | | public R<List<VerifiableShopVo>> getVerifiableShop(String longitude, String latitude, Integer goodsId){ |
| | | String city = TencentMapUtil.inverseGeographicalAnalysis(longitude, latitude, false); |
| | | if(null == city){ |
| | | city = "510100"; |
| | | } |
| | | city = city.substring(0, 4) + "00"; |
| | | LambdaQueryWrapper<Shop> wrapper = new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0).eq(Shop::getCityCode, city); |
| | | if(null != goodsId){ |
| | | Goods goods = goodsService.getById(goodsId); |
| | | if(1 == goods.getType() && 1 == goods.getAppointStore()){ |
| | | List<Integer> collect = goodsShopService.list(new LambdaQueryWrapper<GoodsShop>().eq(GoodsShop::getGoodsId, goods)).stream().map(GoodsShop::getShopId).collect(Collectors.toList()); |
| | | List<Integer> collect = goodsShopService.list(new LambdaQueryWrapper<GoodsShop>().eq(GoodsShop::getGoodsId, goods.getId())) |
| | | .stream().map(GoodsShop::getShopId).collect(Collectors.toList()); |
| | | if(collect.size() > 0){ |
| | | wrapper.in(Shop::getId, collect); |
| | | } |