liujie
2023-10-18 b5e51fc48bc65fc27ed4d6c4f3e82414646113bd
cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
@@ -447,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);
@@ -712,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;
    }