liujie
2023-10-31 904cfe3bad14c27857a062849fc92dd85035c524
cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
@@ -480,6 +480,7 @@
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        ProductDetailsVo detailsVo = new ProductDetailsVo();
        PointsMerchandise merchandise = pmdsService.getById(detailRequest.getGoodId());
        detailsVo.setCardType(merchandise.getCardType());
        switch (detailRequest.getGoodsType()){
            case 2:
@@ -695,6 +696,7 @@
                    if(merchandise.getUseScope()==1){
                        sids.add(0);
                        detailsResponse.setSid(sids);
                        detailsResponse.setRid(new ArrayList<>());
                    }else if(merchandise.getUseScope()==2){
                        // 指定城市
                        List<PointsMerchandiseCity> list = pmdsCityService.list(new LambdaQueryWrapper<PointsMerchandiseCity>().eq(PointsMerchandiseCity::getPointsMerchandiseId, merchandise.getId()));
@@ -704,13 +706,23 @@
                        }
                        List<Integer> storeIds = stoClient.queryStoreIdByCityCode(collect);
                        detailsResponse.setSid(storeIds);
                        if(storeIds.size()>0){
                            // 获取rid
                            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<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);
                        }
                    }
                }
@@ -848,6 +860,7 @@
        upmseService.updateById(merchandise);
    }
    @ResponseBody
    @PostMapping("/base/pointMerchars/queryUserPointMerchaseByCode")
    public List<UserPointsMerchandise> queryUserPointMerchaseByCode(@RequestBody String code){
        return upmseService.list(new QueryWrapper<UserPointsMerchandise>()