| | |
| | | detailsVo.setGoodName(coursePackage.getName()); |
| | | detailsVo.setBelongsScope(merchandise.getUserPopulation()); |
| | | int coursePackageNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId", merchandise.getId())); |
| | | .eq("pointsMerchandiseId", merchandise.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | detailsVo.setRedeemedNum(coursePackageNums); |
| | | detailsVo.setResidueNum(Math.max(merchandise.getQuantityIssued() - coursePackageNums, 0)); |
| | | detailsVo.setPerLimit(merchandise.getPickUpQuantity()); |
| | |
| | | detailsVo.setGoodName(merchandise.getName()); |
| | | detailsVo.setBelongsScope(merchandise.getUserPopulation()); |
| | | int count = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId", merchandise.getId())); |
| | | .eq("pointsMerchandiseId", merchandise.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | detailsVo.setRedeemedNum(count); |
| | | detailsVo.setResidueNum(Math.max(merchandise.getQuantityIssued() - count, 0)); |
| | | detailsVo.setPerLimit(merchandise.getPickUpQuantity()); |
| | |
| | | detailsVo.setGoodName(coupon.getName()); |
| | | detailsVo.setBelongsScope(coupon.getUserPopulation()); |
| | | int couponNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId", merchandise.getId())); |
| | | .eq("pointsMerchandiseId", merchandise.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | detailsVo.setRedeemedNum(couponNums); |
| | | detailsVo.setResidueNum(Math.max(coupon.getQuantityIssued() - couponNums, 0)); |
| | | detailsVo.setPerLimit(coupon.getPickUpQuantity()); |
| | |
| | | detailsVo.setGoodName(coursePackage.getName()); |
| | | detailsVo.setBelongsScope(merchandise.getUserPopulation()); |
| | | int coursePackageNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId", merchandise.getId())); |
| | | .eq("pointsMerchandiseId", merchandise.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | detailsVo.setRedeemedNum(coursePackageNums); |
| | | detailsVo.setResidueNum(Math.max(merchandise.getQuantityIssued() - coursePackageNums, 0)); |
| | | detailsVo.setPerLimit(merchandise.getPickUpQuantity()); |
| | |
| | | detailsVo.setGoodName(merchandise.getName()); |
| | | detailsVo.setBelongsScope(merchandise.getUserPopulation()); |
| | | int count = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId", merchandise.getId())); |
| | | .eq("pointsMerchandiseId", merchandise.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | detailsVo.setRedeemedNum(count); |
| | | detailsVo.setResidueNum(Math.max(merchandise.getQuantityIssued() - count, 0)); |
| | | detailsVo.setPerLimit(merchandise.getPickUpQuantity()); |
| | |
| | | list4.add(43); |
| | | detailsResponse.setRid(list4); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //====================================================== |
| | | } |
| | | }else{ |
| | | // todo 返回门店id 和场地id |
| | | // 查询指定场地 |
| | | List<PointsMerchandiseStore> list = pmdstoService.list(new LambdaQueryWrapper<PointsMerchandiseStore>() |
| | | .eq(PointsMerchandiseStore::getPointsMerchandiseId, merchandise.getId())); |
| | | // 门店 |
| | | ArrayList<Integer> list3 = new ArrayList<>(); |
| | | // 场地 |
| | | ArrayList<Integer> list4 = new ArrayList<>(); |
| | | for (PointsMerchandiseStore temp : list) { |
| | | Integer storeId = temp.getStoreId(); |
| | | Integer siteId = temp.getSiteId(); |
| | | list3.add(storeId); |
| | | list4.add(siteId); |
| | | } |
| | | detailsResponse.setRid(list4); |
| | | detailsResponse.setSid(list3); |
| | | } |
| | | |
| | | |
| | |
| | | public int queryUserHasGoodsNums(@RequestBody AppUserGoodResp goodResp) { |
| | | int count = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getUserId, goodResp.getAppUserId()) |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, goodResp.getGoodId())); |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, goodResp.getGoodId()) |
| | | .eq(UserPointsMerchandise::getPayStatus, 2).eq(UserPointsMerchandise::getState, 1)); |
| | | System.out.println(count); |
| | | return count; |
| | | } |
| | |
| | | @PostMapping("/base/pointMerchars/queryUserHasGoodsNums1") |
| | | public int queryUserHasGoodsNums1(@RequestBody AppUserGoodResp goodResp) { |
| | | int count = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, goodResp.getGoodId())); |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, goodResp.getGoodId()) |
| | | .eq(UserPointsMerchandise::getPayStatus, 2).eq(UserPointsMerchandise::getState, 1)); |
| | | System.out.println(count); |
| | | return count; |
| | | } |
| | |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | LambdaQueryWrapper<UserPointsMerchandise> userPointsMerchandiseLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | userPointsMerchandiseLambdaQueryWrapper.eq(UserPointsMerchandise::getPointsMerchandiseId, pointMercharsPayedVo.getId()); |
| | | userPointsMerchandiseLambdaQueryWrapper.eq(UserPointsMerchandise::getPayStatus, 2).eq(UserPointsMerchandise::getState, 1); |
| | | if (ToolUtil.isNotEmpty(pointMercharsPayedVo.getStatus())) { |
| | | userPointsMerchandiseLambdaQueryWrapper.eq(UserPointsMerchandise::getStatus, pointMercharsPayedVo.getStatus()); |
| | | } |
| | |
| | | List<StoreVos> storeVos = new ArrayList<>(); |
| | | List<PointsMerchandiseStore> list = pmdstoService.list(new QueryWrapper<PointsMerchandiseStore>() |
| | | .eq("pointsMerchandiseId", id)); |
| | | if (list.size() > 0) { |
| | | List<Integer> collect = list.stream().map(PointsMerchandiseStore::getStoreId).collect(Collectors.toList()); |
| | | List<Integer> collect1 = list.stream().map(PointsMerchandiseStore::getSiteId).collect(Collectors.toList()); |
| | | List<Store> stores = stoClient.queryStoreByIds(collect); |
| | | if (stores.size() > 0) { |
| | | int a = 0; |
| | | for (Store store : stores) { |
| | | StoreVos storeVos1 = new StoreVos(); |
| | | storeVos1.setNum1(store.getProvince() + "省" + store.getCity() + "市"); |
| | | if (store.getOperatorId()==null){ |
| | | storeVos1.setNum2("平台"); |
| | | }else if (store.getOperatorId() == 0) { |
| | | storeVos1.setNum2("平台"); |
| | | } else { |
| | | PointsMerchandise byId = pmdsService.getById(id); |
| | | |
| | | storeVos1.setNum2(store.getOName()); |
| | | if (list.size() > 0) { |
| | | |
| | | if (byId.getUseScope()==3){ |
| | | // 如果是指定门店 |
| | | List<Integer> collect = list.stream().map(PointsMerchandiseStore::getStoreId).collect(Collectors.toList()); |
| | | |
| | | List<Store> stores = stoClient.queryStoreByIds(collect); |
| | | if (stores.size() > 0) { |
| | | int a = 0; |
| | | for (Store store : stores) { |
| | | StoreVos storeVos1 = new StoreVos(); |
| | | storeVos1.setNum1(store.getProvince() + "省" + store.getCity() + "市"); |
| | | if (store.getOperatorId()==null){ |
| | | storeVos1.setNum2("平台"); |
| | | }else if (store.getOperatorId() == 0) { |
| | | storeVos1.setNum2("平台"); |
| | | } else { |
| | | storeVos1.setNum2(store.getOName()); |
| | | } |
| | | storeVos1.setNum3(store.getName()); |
| | | storeVos1.setNum4(store.getIds()); |
| | | storeVos.add(storeVos1); |
| | | } |
| | | storeVos1.setNum3(store.getName()); |
| | | storeVos1.setNum4(store.getIds()); |
| | | if (collect1.get(a)!=null){ |
| | | Site site = siteClient.querySiteById(collect1.get(a)); |
| | | storeVos1.setNum5(site.getName()); |
| | | } |
| | | storeVos1.setNum4(store.getIds()); |
| | | storeVos.add(storeVos1); |
| | | } |
| | | }else if (byId.getUseScope()==4){ |
| | | // 如果是指定场地 |
| | | List<Integer> collect1 = list.stream().map(PointsMerchandiseStore::getSiteId).distinct().collect(Collectors.toList()); |
| | | int temp =0; |
| | | List<Integer> collect = list.stream().map(PointsMerchandiseStore::getStoreId).collect(Collectors.toList()); |
| | | List<Store> stores1 = new ArrayList<>(); |
| | | for (Integer integer : collect) { |
| | | List<Integer> list1 = new ArrayList<>(); |
| | | list1.add(integer); |
| | | List<Store> stores = stoClient.queryStoreByIds(list1); |
| | | stores1.addAll(stores); |
| | | } |
| | | List<Store> stores = stoClient.queryStoreByIds(collect); |
| | | while (temp!=collect1.size()){ |
| | | for (Store store : stores1) { |
| | | Integer integer = collect1.get(temp); |
| | | Site site = siteClient.querySiteById(integer); |
| | | StoreVos storeVos1 = new StoreVos(); |
| | | storeVos1.setNum5(site.getName()); |
| | | storeVos1.setNum1(store.getProvince() + "省" + store.getCity() + "市"); |
| | | if (store.getOperatorId()==null){ |
| | | storeVos1.setNum2("平台"); |
| | | }else if (store.getOperatorId() == 0) { |
| | | storeVos1.setNum2("平台"); |
| | | } else { |
| | | storeVos1.setNum2(store.getOName()); |
| | | } |
| | | storeVos1.setNum3(store.getName()); |
| | | storeVos1.setNum4(store.getIds()); |
| | | storeVos.add(storeVos1); |
| | | temp++; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | return storeVos; |
| | | } |