| | |
| | | } |
| | | |
| | | |
| | | |
| | | 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(); |
| | |
| | | for (CouponStore couponStore : storeId) { |
| | | storeCoupons.add(couponStore.getCouponId()); |
| | | } |
| | | List<Coupon> list = couponService.list(new QueryWrapper<Coupon>().in("id", storeCoupons).eq("state", 1).gt("endTime", new Date()).last("ORDER BY insertTime desc")); |
| | | 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(); |
| | |
| | | return commodity; |
| | | } |
| | | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | @Autowired |
| | | private PointsMerchandiseService pointsMerchandiseService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/getCommoditys") |
| | | public PointMerchandiseVo getVicinityGoods(@RequestBody CommodityRequest request) { |
| | | // if (request.getShopId()!=null){ |
| | | // List<CoursePackage> coursePackages = coursePackageClient.queryByStoreId(request.getShopId()); |
| | | // List<Integer> coursIds = new ArrayList<>(); |
| | | // for (CoursePackage coursePackage : coursePackages) { |
| | | // coursIds.add(coursePackage.getId()); |
| | | // } |
| | | // List<PointsMerchandise> points = pointsMerchandiseService.list(new QueryWrapper<PointsMerchandise>().eq("state",1).eq("shelves",1).in("coursePackageId", coursIds)); |
| | | // PointMerchandiseVo pointMerchandiseVo = new PointMerchandiseVo(); |
| | | // pointMerchandiseVo.setMerchandises(points); |
| | | // return pointMerchandiseVo; |
| | | // |
| | | // } |
| | | |
| | | |
| | | PointMerchandiseVo pointMerchandiseVo = new PointMerchandiseVo(); |
| | | List<PointsMerchandise> list = new ArrayList<>(); |
| | |
| | | //detailsResponse.setRid(rid); |
| | | // todo 修改区域id 临时 |
| | | // 根据门店id 写死区域id 后续调整为门票指定多个区域 |
| | | // 以下代码均为临时代码 |
| | | // 以下代码均为临时代码=============================== |
| | | for (Integer integer : collect) { |
| | | ArrayList<Integer> list2 = new ArrayList<>(); |
| | | if (integer==2024){ |
| | |
| | | } |
| | | } |
| | | } |
| | | //====================================================== |
| | | } |
| | | } |
| | | |
| | |
| | | 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(); |