From b64d67ef01e81a857046f19dd556b4e4f0695e1c Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期三, 02 八月 2023 16:41:51 +0800 Subject: [PATCH] 后台代码 门店管理 --- cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 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 caaf629..b0d9bb4 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 @@ -1,6 +1,7 @@ package com.dsh.activity.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.dsh.activity.entity.*; import com.dsh.activity.feignclient.course.CoursePackageClient; @@ -17,11 +18,9 @@ import com.dsh.activity.util.TokenUtil; import com.dsh.activity.util.ToolUtil; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -64,13 +63,17 @@ @Autowired private TokenUtil tokenUtil; + @Resource + private CouponCityService ccityService; + + @ResponseBody @PostMapping("/base/pointMerchars/convertGoods") public List<IntegralCommodity> getConvertibleGoods(){ List<IntegralCommodity> commodity = new ArrayList<>(); List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>() .eq("state",1) - .lt("endTime",new Date())); + .gt("endTime",new Date())); if (merchandises.size() > 0){ for (PointsMerchandise merchandise : merchandises) { IntegralCommodity integralCommodity = new IntegralCommodity(); @@ -78,9 +81,11 @@ integralCommodity.setCommodityImg(merchandise.getProductImages()); integralCommodity.setCommodityName(merchandise.getName()); integralCommodity.setCommodityPrice(merchandise.getPrice()); + integralCommodity.setGoodsType(merchandise.getType()); commodity.add(integralCommodity); } } + System.out.println(commodity); return commodity; } @@ -267,7 +272,11 @@ if (coupon.getUseScope() == 1){ detailsVo.setBelongs("全国通用"); }else if (coupon.getUseScope() == 2){ - detailsVo.setBelongs(coupon.getProvince()+"|"+coupon.getCity() + "用户可用"); + List<CouponCity> list = ccityService.list(new LambdaQueryWrapper<CouponCity>() + .eq(CouponCity::getCouponId, coupon.getId())); + if (list.size() > 0){ + detailsVo.setBelongs(list.get(0).getProvince()+"|"+list.get(0).getCity() + "用户可用"); + } }else { List<CouponStore> list = cstoreService.list(new QueryWrapper<CouponStore>() .eq("couponId",coupon.getId() )); -- Gitblit v1.7.1