From 1e790795f4e2c365f604ecc0fc1b290e3ff3c35f Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期五, 20 十月 2023 09:34:22 +0800 Subject: [PATCH] 更新bug --- cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 53 insertions(+), 5 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 f85e7b7..c818370 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 @@ -15,6 +15,7 @@ import com.dsh.activity.model.CoachChangeStateVO; import com.dsh.activity.model.PointMerchandiseIncomeVo; import com.dsh.activity.model.PointMerchandiseVo; +import com.dsh.activity.model.WriteOffDTO; import com.dsh.activity.model.QueryDataFee; import com.dsh.activity.model.request.*; import com.dsh.activity.model.response.GoodsInfoOneVo; @@ -90,6 +91,19 @@ @RequestMapping("/base/pointMerchars/changeState") public Object changeState(@RequestBody CoachChangeStateVO dto){ return pmdsService.changeState(dto); + } + /** + * 门票核销 + */ + @RequestMapping("/base/pointMerchars/writeOff") + public Object writeOff(@RequestBody WriteOffDTO dto){ + UserPointsMerchandise byId = userPointsMerchandiseService.getById(dto.getId()); + byId.setStoreId(dto.getVerifiStoreId()); + byId.setStatus(2); + byId.setVerificationTime(new Date()); + byId.setUserId(null); + byId.setVerificationUserId(dto.getVerificationUserId()); + return userPointsMerchandiseService.updateById(byId); } @ResponseBody @PostMapping("/base/pointMerchars/ticketList") @@ -167,7 +181,7 @@ for (PointsMerchandise merchandise : merchandises) { IntegralCommodity integralCommodity = new IntegralCommodity(); integralCommodity.setCommodityId(merchandise.getId()); - integralCommodity.setCommodityImg(merchandise.getProductImages()); + integralCommodity.setCommodityImg(merchandise.getCover()); integralCommodity.setCommodityName(merchandise.getName()); integralCommodity.setCommodityPrice(merchandise.getPrice()); integralCommodity.setGoodsType(merchandise.getType()); @@ -199,12 +213,12 @@ 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(); // 移除符合条件的商品 } } @@ -296,7 +310,6 @@ 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) -> { @@ -434,6 +447,32 @@ detailsResponse.setEndTime(simpleDateFormat.format(merchandise.getEndTime())); detailsResponse.setUseStatus(pointsMerchandise.getStatus() == 1 ? 2 : 1); detailsResponse.setGoodType(merchandise.getType()); + if(merchandise.getType()==3){ + detailsResponse.setCardType(merchandise.getCardType()); + List<Integer> sids = new ArrayList<>(); + detailsResponse.setUserId(appUserId); + if(merchandise.getUseScope()==1){ + sids.add(0); + detailsResponse.setSid(sids); + }else if(merchandise.getUseScope()==2){ + // 指定城市 + List<PointsMerchandiseCity> list = pmdsCityService.list(new LambdaQueryWrapper<PointsMerchandiseCity>().eq(PointsMerchandiseCity::getPointsMerchandiseId, merchandise.getId())); + List<String> collect = list.stream().map(PointsMerchandiseCity::getCityCode).collect(Collectors.toList()); + if(collect.size()==0){ + collect.add("-1"); + } + List<Integer> storeIds = stoClient.queryStoreIdByCityCode(collect); + detailsResponse.setSid(storeIds); + + }else if(merchandise.getUseScope()==3){ + // 指定门店 + 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); + + + } + } responses.add(detailsResponse); } detailsVo.setDetailsResponses(responses); @@ -699,6 +738,8 @@ vo.setSort(byId.getSort()); vo.setContent(byId.getRedemptionInstructions()); } + int count = userPointsMerchandiseService.count(new LambdaQueryWrapper<UserPointsMerchandise>().eq(UserPointsMerchandise::getPointsMerchandiseId, pointMercharsId)); + vo.setNum(count); return vo; } @@ -856,7 +897,14 @@ for (Store store : stores) { StoreVos storeVos1 = new StoreVos(); storeVos1.setNum1(store.getProvince() +"省"+ store.getCity() +"市"); - storeVos1.setNum2(store.getName()); + if(store.getOperatorId()==0){ + storeVos1.setNum2("平台"); + }else { + + storeVos1.setNum2(store.getOName()); + } + storeVos1.setNum3(store.getName()); + storeVos1.setNum4(store.getIds()); storeVos.add(storeVos1); } } -- Gitblit v1.7.1