From a9564eae9f0169ca39329b2f14a8f13d13358a0a Mon Sep 17 00:00:00 2001 From: nickchange <126672920+nickchange@users.noreply.github.com> Date: 星期五, 17 十一月 2023 15:28:44 +0800 Subject: [PATCH] 11.7 --- cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java | 42 +++++++++++++++++++++++++----------------- 1 files changed, 25 insertions(+), 17 deletions(-) diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java index 9619f4c..dd4a567 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java @@ -294,22 +294,25 @@ cIds.add(pointsMerchandiseCity.getPointsMerchandiseId()); } + if (cIds.size()>0) { - List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>() - .eq("state",1) - .eq("shelves",1).in("id",cIds) - .gt("endTime",new Date())); - if (merchandises.size() > 0){ - for (PointsMerchandise merchandise : merchandises) { - IntegralCommodity integralCommodity = new IntegralCommodity(); - integralCommodity.setCommodityId(merchandise.getId()); - integralCommodity.setCommodityImg(merchandise.getCover()); - integralCommodity.setCommodityName(merchandise.getName()); - integralCommodity.setCommodityPrice(merchandise.getPrice()); - integralCommodity.setGoodsType(merchandise.getType()); - commodity.add(integralCommodity); + List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>() + .eq("state", 1) + .eq("shelves", 1).in("id", cIds) + .gt("endTime", new Date())); + if (merchandises.size() > 0){ + for (PointsMerchandise merchandise : merchandises) { + IntegralCommodity integralCommodity = new IntegralCommodity(); + integralCommodity.setCommodityId(merchandise.getId()); + integralCommodity.setCommodityImg(merchandise.getCover()); + integralCommodity.setCommodityName(merchandise.getName()); + integralCommodity.setCommodityPrice(merchandise.getPrice()); + integralCommodity.setGoodsType(merchandise.getType()); + commodity.add(integralCommodity); + } } } + System.out.println(commodity); return commodity; } @@ -786,7 +789,10 @@ ids.add(coupon.getId()); } } - List<UserCoupon> userCoupons = userCouponService.list(new QueryWrapper<UserCoupon>().eq("userId", appUserId).in("couponId",ids)); + List<UserCoupon> userCoupons = new ArrayList<>(); + if (ids.size()>0) { + userCoupons = userCouponService.list(new QueryWrapper<UserCoupon>().eq("userId", appUserId).in("couponId", ids)); + } if (pointsMerchandises.size() > 0 ){ for (UserPointsMerchandise pointsMerchandise : pointsMerchandises) { PointsMerchandise merchandise = pmdsService.getById(pointsMerchandise.getPointsMerchandiseId()); @@ -977,7 +983,7 @@ @ResponseBody @PostMapping("/base/pointMerchars/getSpecificsOfGoods") public PointDetailsVo getSpecificsOfGoods(@RequestBody Long speMercharsId){ - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); PointDetailsVo detailsVo = new PointDetailsVo(); UserPointsMerchandise byId = upmseService.getById(speMercharsId); @@ -985,6 +991,7 @@ PointsMerchandise pmdsServiceById = pmdsService.getById(byId.getPointsMerchandiseId()); // 2.0 detailsVo.setCardType(pmdsServiceById.getCardType()); + detailsVo.setExchangeAddrType(pmdsServiceById.getUseScope()); detailsVo.setExchangeType(pmdsServiceById.getRedemptionMethod()); detailsVo.setGoodType(pmdsServiceById.getType()); if (pmdsServiceById.getRedemptionMethod() == 1){ @@ -1162,8 +1169,9 @@ detailsVo.setBelongs(pmdsServiceById.getProvince()+pmdsServiceById.getCity()); break; case 3: - StoreDetailOfCourse courseOfStore = stoClient.getCourseOfStore(byId.getStoreId()); - detailsVo.setBelongs(courseOfStore.getStoreName()+" "+courseOfStore.getStoreAddr()); +// StoreDetailOfCourse courseOfStore = stoClient.getCourseOfStore(byId.getStoreId()); +// detailsVo.setBelongs(courseOfStore.getStoreName()+" "+courseOfStore.getStoreAddr()); +// detailsVo.setBelongs("---------------"); break; default: break; -- Gitblit v1.7.1