nickchange
2023-10-31 986989a2b7a49353598fda317e3bdaed59f09abc
cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
@@ -126,7 +126,26 @@
                    result.add(map);
                }
            }
        }else {
        }else if(ofSearch.getObjType()==2){
            for (Map<String, Object> map : result1) {
                // 拿到当前运营商下的门店的门票
                List<PointsMerchandiseStore> id = pmdstoService.list(new QueryWrapper<PointsMerchandiseStore>().in("storeId",ofSearch.getStoreIds()));
                // 拿到积分商品id集合
                List<Integer> collect = id.stream().map(PointsMerchandiseStore::getPointsMerchandiseId).collect(Collectors.toList());
                if(collect.size()==0){
                    collect.add(-1);
                }
                Integer temp =(Integer)map.get("id");
                if (collect.contains(temp)){
                    if(id.size()>1){
                        map.put("size",1);
                    }else {
                        map.put("size",0);
                    }
                    result.add(map);
                }
            }
        } else {
            result=result1;
        }
        if (result.size() > 0){
@@ -461,13 +480,19 @@
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        ProductDetailsVo detailsVo = new ProductDetailsVo();
        PointsMerchandise merchandise = pmdsService.getById(detailRequest.getGoodId());
        detailsVo.setCardType(merchandise.getCardType());
        if (merchandise!=null) {
            detailsVo.setCardType(merchandise.getCardType());
        }
        switch (detailRequest.getGoodsType()){
            case 2:
//                课包
                CoursePackage coursePackage = cpClient.queryCoursePackageById(merchandise.getCoursePackageId());
                detailsVo.setGoodId(coursePackage.getId());
//                detailsVo.setGoodId(coursePackage.getId());
                detailsVo.setGoodId(merchandise.getId());
                List<String> list1 = new ArrayList<>();
                list1.add(coursePackage.getCoverDrawing());
                list1.addAll(Arrays.asList(StrUtils.splitStr2StrArr(coursePackage.getDetailDrawing(), ",")));
@@ -601,10 +626,10 @@
                });
                detailsVo.setGoodName(coupon.getName());
                detailsVo.setBelongsScope(coupon.getUserPopulation());
                int couponNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>()
                        .eq("pointsMerchandiseId",merchandise.getId() ));
                detailsVo.setRedeemedNum(couponNums);
                detailsVo.setResidueNum(Math.max(coupon.getQuantityIssued() - couponNums, 0));
//                int couponNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>()
//                        .eq("pointsMerchandiseId",merchandise.getId() ));
                detailsVo.setRedeemedNum(coupon.getPickUpQuantity());
                detailsVo.setResidueNum(Math.max(coupon.getQuantityIssued() - coupon.getPickUpQuantity(), 0));
                detailsVo.setPerLimit(coupon.getPickUpQuantity());
                detailsVo.setExchangeType(coupon.getRedemptionMethod());
                if (coupon.getRedemptionMethod() == 1){
@@ -840,6 +865,7 @@
        upmseService.updateById(merchandise);
    }
    @ResponseBody
    @PostMapping("/base/pointMerchars/queryUserPointMerchaseByCode")
    public List<UserPointsMerchandise> queryUserPointMerchaseByCode(@RequestBody String code){
        return upmseService.list(new QueryWrapper<UserPointsMerchandise>()