| | |
| | | public void changeState(@RequestBody CoachChangeStateVO dto) { |
| | | pmdsService.changeState(dto); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/goodsList") |
| | | public List<PointsMerchandise> goodsList() { |
| | | return pmdsService.list(); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询 |
| | | */ |
| | |
| | | @PostMapping("/base/pointMerchars/getCommoditys") |
| | | public PointMerchandiseVo getVicinityGoods(@RequestBody CommodityRequest request) { |
| | | |
| | | |
| | | PointMerchandiseVo pointMerchandiseVo = new PointMerchandiseVo(); |
| | | List<PointsMerchandise> list = new ArrayList<>(); |
| | | String provinceCode = ""; |
| | | String cityCode = ""; |
| | | if (ToolUtil.isEmpty(request.getLon()) && ToolUtil.isEmpty(request.getLat())) { |
| | | return pointMerchandiseVo; |
| | | } |
| | | }else{ |
| | | try { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(request.getLon(), request.getLat()); |
| | | provinceCode = geocode.get("provinceCode"); |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | list = pmdsService.list(new QueryWrapper<PointsMerchandise>() |
| | | .eq("state", 1) |
| | |
| | | .ge("endTime", new Date()) |
| | | .eq("status", 1) |
| | | ); |
| | | if (request.getShopId()!=null){ |
| | | List<Integer> storeId = new ArrayList<>(); |
| | | storeId.add(request.getShopId()); |
| | | List<Store> stores = storeClient.queryStoreByIds(storeId); |
| | | Store store = stores.get(0); |
| | | provinceCode = store.getProvinceCode(); |
| | | cityCode = store.getCityCode(); |
| | | List<Integer> pointsMerchandiseIds = pmdstoService.lambdaQuery().eq(PointsMerchandiseStore::getStoreId, request.getShopId()).list() |
| | | .stream().map(PointsMerchandiseStore::getPointsMerchandiseId) |
| | | .collect(Collectors.toList()); |
| | | if (pointsMerchandiseIds.isEmpty()){ |
| | | pointMerchandiseVo.setMerchandises(list); |
| | | return pointMerchandiseVo; |
| | | }else{ |
| | | List<PointsMerchandise> pointsMerchandiseList = pmdsService.lambdaQuery().in(PointsMerchandise::getId, pointsMerchandiseIds).list(); |
| | | list.addAll(pointsMerchandiseList); |
| | | List<PointsMerchandise> listAll = list.stream().distinct().collect(Collectors.toList()); |
| | | list = listAll; |
| | | } |
| | | } |
| | | |
| | | if (list.size() > 0) { |
| | | Iterator<PointsMerchandise> iterator = list.iterator(); |
| | | while (iterator.hasNext()) { |
| | |
| | | private ICouponService couponService; |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/getDetailsOfExchange") |
| | | public ExchangeDetailsVo getIntegralExchangeDetails(@RequestBody Integer appUserId) throws ParseException { |
| | |
| | | detailsResponse.setUseStatus(pointsMerchandise.getStatus() == 1 ? 2 : 1); |
| | | detailsResponse.setGoodType(merchandise.getType()); |
| | | if (merchandise.getType() == 3) { |
| | | detailsResponse.setCodeType(3); |
| | | detailsResponse.setDataId(pointsMerchandise.getPointsMerchandiseId()); |
| | | detailsResponse.setCardType(merchandise.getCardType()); |
| | | List<Integer> sids = new ArrayList<>(); |
| | | detailsResponse.setUserId(appUserId); |
| | |
| | | detailsResponse.setEndTime(simpleDateFormat.format(vipDetail.getEndTime())); |
| | | detailsResponse.setUseStatus(vipDetail.getStatus()==1?2:1); |
| | | detailsResponse.setGoodType(3); |
| | | detailsResponse.setCardType(3); |
| | | // 表明是会员赠送的门票 |
| | | detailsResponse.setExchangeType(4); |
| | | // 全国通用 |
| | |
| | | upmseService.save(merchandise); |
| | | return merchandise.getId(); |
| | | } |
| | | |
| | | @PostMapping("/base/pointMerchars/saveDetailsUserPointMercaseList") |
| | | public Boolean saveDetailsUserPointMercaseList(@RequestBody List<UserPointsMerchandise> merchandises) { |
| | | for (UserPointsMerchandise merchandise : merchandises) { |
| | |
| | | } |
| | | return storeVos; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |