| | |
| | | @Autowired |
| | | private PointsMerchandiseStoreService pointsMerchandiseStoreService; |
| | | |
| | | |
| | | @Autowired |
| | | private CouponStoreService couponStoreService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/convertGoods") |
| | | public List<IntegralCommodity> getConvertibleGoods(@RequestBody Location location) throws Exception { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>().in("id", cIds) |
| | | QueryWrapper<PointsMerchandise> wrapper = new QueryWrapper<PointsMerchandise>() |
| | | .eq("state", 1) |
| | | .eq("shelves", 1) |
| | | .gt("endTime", new Date()).last("ORDER BY sort desc,insertTime desc")); |
| | | .gt("endTime", new Date()); |
| | | if(cIds.size() > 0){ |
| | | wrapper.in("id", cIds); |
| | | } |
| | | List<PointsMerchandise> merchandises = pmdsService.list(wrapper.last("ORDER BY sort desc,insertTime desc")); |
| | | if (merchandises.size() > 0) { |
| | | for (PointsMerchandise merchandise : merchandises) { |
| | | IntegralCommodity integralCommodity = new IntegralCommodity(); |
| | |
| | | } |
| | | } |
| | | |
| | | List<CouponStore> storeId = couponStoreService.list(new QueryWrapper<CouponStore>().eq("storeId", s.getId())); |
| | | List<Integer> storeCoupons = new ArrayList<>(); |
| | | for (CouponStore couponStore : storeId) { |
| | | storeCoupons.add(couponStore.getCouponId()); |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | QueryWrapper<Coupon> queryWrapper = new QueryWrapper<Coupon>().eq("state", 1).gt("endTime", sdf.format(new Date())); |
| | | if(storeCoupons.size() > 0){ |
| | | queryWrapper.in("id", storeCoupons); |
| | | } |
| | | List<Coupon> list = couponService.list(queryWrapper.last(" ORDER BY insertTime desc")); |
| | | if (!list.isEmpty()){ |
| | | for (Coupon coupon : list) { |
| | | IntegralCommodity integralCommodity = new IntegralCommodity(); |
| | | integralCommodity.setCommodityId(coupon.getId()); |
| | | integralCommodity.setCommodityImg(coupon.getCover()); |
| | | integralCommodity.setCommodityName(coupon.getName()); |
| | | integralCommodity.setCommodityPrice(coupon.getIntegral()); |
| | | integralCommodity.setGoodsType(coupon.getType()); |
| | | // integralCommodity.setSort(coupon.getSort()); |
| | | commodity.add(integralCommodity); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | System.out.println(commodity); |
| | |
| | | //detailsResponse.setRid(rid); |
| | | // todo 修改区域id 临时 |
| | | // 根据门店id 写死区域id 后续调整为门票指定多个区域 |
| | | // 以下代码均为临时代码 |
| | | // 以下代码均为临时代码=============================== |
| | | for (Integer integer : collect) { |
| | | ArrayList<Integer> list2 = new ArrayList<>(); |
| | | if (integer==2024){ |
| | |
| | | ArrayList<Integer> list3 = new ArrayList<>(); |
| | | list3.add(44); |
| | | detailsResponse.setRid(list3); |
| | | }else { |
| | | }else if(pointsMerchandise.getPointsMerchandiseId()==197) { |
| | | ArrayList<Integer> list4 = new ArrayList<>(); |
| | | list4.add(43); |
| | | detailsResponse.setRid(list4); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //====================================================== |
| | | } |
| | | } |
| | | |
| | |
| | | public Integer add(@RequestBody PointsMerchandise pointsMerchandise) { |
| | | Integer storeId = pointsMerchandise.getShelves(); |
| | | pointsMerchandise.setShelves(1); |
| | | pointsMerchandise.setInsertTime(new Date()); |
| | | boolean save = pmdsService.save(pointsMerchandise); |
| | | if (save && ToolUtil.isNotEmpty(storeId) && pointsMerchandise.getType() == 2) { |
| | | PointsMerchandiseStore pointsMerchandiseStore = new PointsMerchandiseStore(); |