From aa45df63fa01b2f010560e4157f00bec5150a1fb Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期一, 27 十一月 2023 17:08:15 +0800 Subject: [PATCH] 后台bug修改 --- cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java | 84 +++++++++++++++++++++++++++--------------- 1 files changed, 54 insertions(+), 30 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 9394121..936ea1c 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 @@ -300,7 +300,7 @@ List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>() .eq("state", 1) .eq("shelves", 1) - .gt("endTime", new Date())); + .gt("endTime", new Date()).last("ORDER BY sort desc,insertTime desc")); if (merchandises.size() > 0){ for (PointsMerchandise merchandise : merchandises) { IntegralCommodity integralCommodity = new IntegralCommodity(); @@ -309,6 +309,7 @@ integralCommodity.setCommodityName(merchandise.getName()); integralCommodity.setCommodityPrice(merchandise.getPrice()); integralCommodity.setGoodsType(merchandise.getType()); + integralCommodity.setSort(merchandise.getSort()); commodity.add(integralCommodity); } // } @@ -840,22 +841,41 @@ List<Integer> rid= stoClient.querySiteIdById(storeIds); detailsResponse.setRid(rid); } - - }else if(merchandise.getUseScope()==3){ // 指定门店 - List<PointsMerchandiseStore> list = pmdstoService.list(new LambdaQueryWrapper<PointsMerchandiseStore>().eq(PointsMerchandiseStore::getPointsMerchandiseId, merchandise.getId())); + List<PointsMerchandiseStore> list = pmdstoService.list(new LambdaQueryWrapper<PointsMerchandiseStore>() + .eq(PointsMerchandiseStore::getPointsMerchandiseId, merchandise.getId())); List<Integer> collect = list.stream().map(PointsMerchandiseStore::getStoreId).collect(Collectors.toList()); detailsResponse.setSid(collect); if(collect.size()>0){ // 获取rid - List<Integer> rid= stoClient.querySiteIdById(collect); - detailsResponse.setRid(rid); +// List<Integer> rid= stoClient.querySiteIdById(collect); + //detailsResponse.setRid(rid); + // todo 修改区域id 临时 + // 根据门店id 写死区域id 后续调整为门票指定多个区域 + // 以下代码均为临时代码 + for (Integer integer : collect) { + ArrayList<Integer> list2 = new ArrayList<>(); + if (integer==2024){ + list2.add(32); + detailsResponse.setRid(list2); + } + // 临时 根据门票id 指定的区域 + if (integer==9919){ + if (pointsMerchandise.getPointsMerchandiseId()==196||pointsMerchandise.getPointsMerchandiseId()==198){ + // 返回儿童区id + ArrayList<Integer> list3 = new ArrayList<>(); + list3.add(44); + detailsResponse.setRid(list3); + }else { + ArrayList<Integer> list3 = new ArrayList<>(); + list3.add(43); + detailsResponse.setRid(list3); + } + } + } } - } - - if (merchandise.getCardType()==1){ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calendar.getInstance(); @@ -991,9 +1011,10 @@ PointDetailsVo detailsVo = new PointDetailsVo(); UserPointsMerchandise byId = upmseService.getById(speMercharsId); - List<PointsMerchandiseStore> stores = storeService.list(new QueryWrapper<PointsMerchandiseStore>().eq("pointsMerchandiseId", byId.getPointsMerchandiseId())); if (ToolUtil.isNotEmpty(byId)){ + List<PointsMerchandiseStore> stores = storeService.list(new QueryWrapper<PointsMerchandiseStore>().eq("pointsMerchandiseId", byId.getPointsMerchandiseId())); + PointsMerchandise pmdsServiceById = pmdsService.getById(byId.getPointsMerchandiseId()); // 2.0 detailsVo.setCardType(pmdsServiceById.getCardType()); @@ -1185,7 +1206,9 @@ detailsVo.setUseType(2); }else { detailsVo.setUseType(1); - detailsVo.setWriteOffTime(simpleDateFormat.format(byId.getVerificationTime())); + if (pmdsServiceById.getType()!=2) { + detailsVo.setWriteOffTime(simpleDateFormat.format(byId.getVerificationTime())); + } if (byId.getStoreId()!=null) { StoreDetailOfCourse courseOfStore = stoClient.getCourseOfStore(byId.getStoreId()); detailsVo.setWriteOffName(courseOfStore.getStoreName()); @@ -1246,25 +1269,26 @@ detailsVo.setIntegral(coupon.getIntegral().intValue()); detailsVo.setCash(coupon.getCash()); } -// if (coupon.getUseScope() == 1){ -// detailsVo.setExchangeAddrType(1); -// detailsVo.setBelongs("全国通用"); -// }else if (coupon.getUseScope() == 2){ -// detailsVo.setExchangeAddrType(2); -// 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 { -// detailsVo.setExchangeAddrType(3); -// List<CouponStore> list = cstoreService.list(new QueryWrapper<CouponStore>() -// .eq("couponId",coupon.getId() )); -// StoreDetailOfCourse courseOfStore = stoClient.getCourseOfStore(list.get(0).getStoreId()); -// detailsVo.setBelongs(courseOfStore.getStoreName()+"可用"); -// } -// detailsVo.setStartTime(format.format(coupon.getStartTime())); -// detailsVo.setEndTime(format.format(coupon.getEndTime())); + if (coupon.getUseScope() == 1){ + detailsVo.setExchangeAddrType(1); + detailsVo.setBelongs("全国通用"); + }else if (coupon.getUseScope() == 2){ + detailsVo.setExchangeAddrType(2); + 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 { + detailsVo.setExchangeAddrType(3); + List<CouponStore> list = cstoreService.list(new QueryWrapper<CouponStore>() + .eq("couponId",coupon.getId() )); + StoreDetailOfCourse courseOfStore = stoClient.getCourseOfStore(list.get(0).getStoreId()); + detailsVo.setBelongs(courseOfStore.getStoreName()+"可用"); + } + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + detailsVo.setStartTime(format.format(coupon.getStartTime())); + detailsVo.setEndTime(format.format(coupon.getEndTime())); detailsVo.setContents(coupon.getIllustrate()); detailsVo.setGoodType(4); -- Gitblit v1.7.1