| | |
| | | for (PointsMerchandise merchandise : merchandises) { |
| | | IntegralCommodity integralCommodity = new IntegralCommodity(); |
| | | integralCommodity.setCommodityId(merchandise.getId()); |
| | | String[] split = merchandise.getProductImages().split(","); |
| | | integralCommodity.setCommodityImg(split[0]); |
| | | integralCommodity.setCommodityImg(merchandise.getCover()); |
| | | integralCommodity.setCommodityName(merchandise.getName()); |
| | | integralCommodity.setCommodityPrice(merchandise.getPrice()); |
| | | integralCommodity.setGoodsType(merchandise.getType()); |
| | |
| | | |
| | | list = pmdsService.list(new QueryWrapper<PointsMerchandise>() |
| | | .eq("state", 1) |
| | | .eq("shelves",1)); |
| | | .eq("shelves",1).le("startTime",new Date()).ge("endTime",new Date())); |
| | | if (list.size() > 0 ){ |
| | | Iterator<PointsMerchandise> iterator = list.iterator(); |
| | | while (iterator.hasNext()) { |
| | | PointsMerchandise merchandise = iterator.next(); |
| | | if (merchandise.getUseScope() == 2 && (!Objects.equals(merchandise.getCityCode(), cityCode) && !Objects.equals(merchandise.getProvinceCode(), provinceCode))) { |
| | | if (merchandise.getUseScope() == 2 && (!cityCode.equals(merchandise.getCityCode()) || !provinceCode.equals(merchandise.getProvinceCode()))) { |
| | | iterator.remove(); // 移除符合条件的商品 |
| | | } |
| | | } |
| | |
| | | detailsVo.setGoodId(merchandise.getId()); |
| | | List<String> list2 = new ArrayList<>(); |
| | | String cover = merchandise.getCover(); |
| | | list2.add(cover); |
| | | list2.addAll(Arrays.asList(StrUtils.splitStr2StrArr(merchandise.getProductImages(), ","))); |
| | | detailsVo.setPics(list2); |
| | | Collections.sort(detailsVo.getPics(), (s1, s2) -> { |
| | |
| | | detailsResponse.setEndTime(simpleDateFormat.format(merchandise.getEndTime())); |
| | | detailsResponse.setUseStatus(pointsMerchandise.getStatus() == 1 ? 2 : 1); |
| | | detailsResponse.setGoodType(merchandise.getType()); |
| | | if(merchandise.getType()==3){ |
| | | detailsResponse.setUserId(appUserId); |
| | | if(merchandise.getUseScope()==1){ |
| | | detailsResponse.setSid(0); |
| | | }else if(merchandise.getUseScope()==2){ |
| | | |
| | | }else if(merchandise.getUseScope()==3){ |
| | | |
| | | } |
| | | } |
| | | responses.add(detailsResponse); |
| | | } |
| | | detailsVo.setDetailsResponses(responses); |
| | |
| | | vo.setSort(byId.getSort()); |
| | | vo.setContent(byId.getRedemptionInstructions()); |
| | | } |
| | | int count = userPointsMerchandiseService.count(new LambdaQueryWrapper<UserPointsMerchandise>().eq(UserPointsMerchandise::getPointsMerchandiseId, pointMercharsId)); |
| | | vo.setNum(count); |
| | | return vo; |
| | | } |
| | | |