| | |
| | | @Autowired |
| | | private PointsMerchandiseStoreService pointsMerchandiseStoreService; |
| | | |
| | | |
| | | @Autowired |
| | | private CouponStoreService couponStoreService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/convertGoods") |
| | | public List<IntegralCommodity> getConvertibleGoods(@RequestBody Location location) throws Exception { |
| | | List<IntegralCommodity> commodity = new ArrayList<>(); |
| | | |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(location.getLon(), location.getLat()); |
| | | if(null == geocode){ |
| | | return new ArrayList<>(); |
| | | } |
| | | String provinceCode = geocode.get("provinceCode"); |
| | | String cityCode = geocode.get("cityCode"); |
| | | |
| | | |
| | | // if(null != geocode) { |
| | | |
| | | List<Store> stores = storeClient.queryStoreList(new QueryStoreList(provinceCode, cityCode)); |
| | | Store s = null; |
| | | Double d = 0D; |
| | |
| | | d = wgs84; |
| | | } |
| | | } |
| | | // } |
| | | |
| | | // List<PointsMerchandiseCity> cityCode1 = pmdsCityService.list(new QueryWrapper<PointsMerchandiseCity>().eq("cityCode", cityCode)); |
| | | List<Integer> cIds = new ArrayList<>(); |
| | | // for (PointsMerchandiseCity pointsMerchandiseCity : cityCode1) { |
| | | // cIds.add(pointsMerchandiseCity.getPointsMerchandiseId()); |
| | | // } |
| | | |
| | | List<PointsMerchandiseStore> storesids = pointsMerchandiseStoreService.list(new QueryWrapper<PointsMerchandiseStore>().eq("storeId", s.getId())); |
| | | for (PointsMerchandiseStore storesid : storesids) { |
| | | cIds.add(storesid.getPointsMerchandiseId()); |
| | | } |
| | | |
| | | |
| | | // if (cIds.size()>0) { |
| | | |
| | | 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(); |
| | |
| | | integralCommodity.setSort(merchandise.getSort()); |
| | | commodity.add(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); |
| | | 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<>(); |
| | |
| | | detailsVo.setGoodName(coursePackage.getName()); |
| | | detailsVo.setBelongsScope(merchandise.getUserPopulation()); |
| | | int coursePackageNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId", merchandise.getId())); |
| | | .eq("pointsMerchandiseId", merchandise.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | detailsVo.setRedeemedNum(coursePackageNums); |
| | | detailsVo.setResidueNum(Math.max(merchandise.getQuantityIssued() - coursePackageNums, 0)); |
| | | detailsVo.setPerLimit(merchandise.getPickUpQuantity()); |
| | |
| | | detailsVo.setGoodName(merchandise.getName()); |
| | | detailsVo.setBelongsScope(merchandise.getUserPopulation()); |
| | | int count = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId", merchandise.getId())); |
| | | .eq("pointsMerchandiseId", merchandise.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | detailsVo.setRedeemedNum(count); |
| | | detailsVo.setResidueNum(Math.max(merchandise.getQuantityIssued() - count, 0)); |
| | | detailsVo.setPerLimit(merchandise.getPickUpQuantity()); |
| | |
| | | detailsVo.setGoodName(coupon.getName()); |
| | | detailsVo.setBelongsScope(coupon.getUserPopulation()); |
| | | int couponNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId", merchandise.getId())); |
| | | .eq("pointsMerchandiseId", merchandise.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | detailsVo.setRedeemedNum(couponNums); |
| | | detailsVo.setResidueNum(Math.max(coupon.getQuantityIssued() - couponNums, 0)); |
| | | detailsVo.setPerLimit(coupon.getPickUpQuantity()); |
| | |
| | | detailsVo.setGoodName(coursePackage.getName()); |
| | | detailsVo.setBelongsScope(merchandise.getUserPopulation()); |
| | | int coursePackageNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId", merchandise.getId())); |
| | | .eq("pointsMerchandiseId", merchandise.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | detailsVo.setRedeemedNum(coursePackageNums); |
| | | detailsVo.setResidueNum(Math.max(merchandise.getQuantityIssued() - coursePackageNums, 0)); |
| | | detailsVo.setPerLimit(merchandise.getPickUpQuantity()); |
| | |
| | | detailsVo.setGoodName(merchandise.getName()); |
| | | detailsVo.setBelongsScope(merchandise.getUserPopulation()); |
| | | int count = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId", merchandise.getId())); |
| | | .eq("pointsMerchandiseId", merchandise.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | detailsVo.setRedeemedNum(count); |
| | | detailsVo.setResidueNum(Math.max(merchandise.getQuantityIssued() - count, 0)); |
| | | detailsVo.setPerLimit(merchandise.getPickUpQuantity()); |
| | |
| | | //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 { |
| | | ArrayList<Integer> list3 = new ArrayList<>(); |
| | | list3.add(43); |
| | | detailsResponse.setRid(list3); |
| | | }else if(pointsMerchandise.getPointsMerchandiseId()==197) { |
| | | ArrayList<Integer> list4 = new ArrayList<>(); |
| | | list4.add(43); |
| | | detailsResponse.setRid(list4); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //====================================================== |
| | | } |
| | | } |
| | | |
| | |
| | | String endDate = dateFormat.format(end); |
| | | detailsResponse.setStartTime(startDate); |
| | | detailsResponse.setEndTime(startDate); |
| | | |
| | | Date now = new Date(); |
| | | Calendar cal1 = Calendar.getInstance(); |
| | | cal1.setTime(pointsMerchandise.getInsertTime()); |
| | | |
| | | Calendar cal2 = Calendar.getInstance(); |
| | | cal2.setTime(now); |
| | | |
| | | // Compare the year, month, and day of the two Calendar instances |
| | | boolean isSameDate = cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && |
| | | cal1.get(Calendar.MONTH) == cal2.get(Calendar.MONTH) && |
| | |
| | | public int queryUserHasGoodsNums(@RequestBody AppUserGoodResp goodResp) { |
| | | int count = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getUserId, goodResp.getAppUserId()) |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, goodResp.getGoodId())); |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, goodResp.getGoodId()) |
| | | .eq(UserPointsMerchandise::getPayStatus, 2).eq(UserPointsMerchandise::getState, 1)); |
| | | System.out.println(count); |
| | | return count; |
| | | } |
| | |
| | | @PostMapping("/base/pointMerchars/queryUserHasGoodsNums1") |
| | | public int queryUserHasGoodsNums1(@RequestBody AppUserGoodResp goodResp) { |
| | | int count = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, goodResp.getGoodId())); |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, goodResp.getGoodId()) |
| | | .eq(UserPointsMerchandise::getPayStatus, 2).eq(UserPointsMerchandise::getState, 1)); |
| | | System.out.println(count); |
| | | return count; |
| | | } |
| | |
| | | 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(); |
| | |
| | | List<Integer> ids = queryDataFee.getIds(); |
| | | if (ids.size() == 0) { |
| | | ids.add(-1); |
| | | }else{ |
| | | |
| | | } |
| | | List<PointsMerchandise> list1 = pmdsService.list(new LambdaQueryWrapper<PointsMerchandise>().eq(PointsMerchandise::getRedemptionMethod, 3)); |
| | | LambdaQueryWrapper<UserPointsMerchandise> vipPaymentLambdaQueryWrapper = new LambdaQueryWrapper<>(); |