| | |
| | | package com.dsh.account.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.*; |
| | | import com.dsh.account.enums.RechargeRecordEnum; |
| | | import com.dsh.account.feignclient.activity.IntroduceRewardsClient; |
| | | import com.dsh.account.feignclient.activity.MerChandiseClient; |
| | | import com.dsh.account.feignclient.activity.MerChandiseStoreClient; |
| | | import com.dsh.account.feignclient.activity.UserConponClient; |
| | |
| | | import com.dsh.account.feignclient.competition.DeductionCompetitionsClient; |
| | | import com.dsh.account.feignclient.competition.model.BillingDataRequestVo; |
| | | import com.dsh.account.feignclient.competition.model.PaymentCompetition; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.CoursePackageClient; |
| | | import com.dsh.account.feignclient.course.CoursePackageConfigClient; |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | |
| | | import com.dsh.account.model.vo.classDetails.RegisteredCourse; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassInfoVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.*; |
| | | import com.dsh.account.service.TAppGiftService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.util.*; |
| | | import com.dsh.account.util.akeylogin.Md5Util; |
| | |
| | | @Autowired |
| | | private TAppUserMapper appUserMapper; |
| | | |
| | | @Autowired |
| | | private TAppGiftService appGiftService; |
| | | |
| | | @Autowired |
| | | private IntroduceRewardsClient introduceRewardsClient; |
| | | @Override |
| | | public List<QueryAppUserVO> listAll(QueryAppUser query) { |
| | | return appUserMapper.listAll(query); |
| | |
| | | couList.setTimeStr(courseOfStoreVo.getClassStartTime() + "-" + courseOfStoreVo.getClassEndTime()); |
| | | couList.setDetail("¥" + courseOfStoreVo.getCoursePrice() + "/会员扣2学时"); |
| | | couList.setStatus(courseOfStoreVo.getStatus()); |
| | | |
| | | couList.setAllNum(courseOfStoreVo.getAllNum()); |
| | | couList.setUseNum(courseOfStoreVo.getUseNum()); |
| | | couList.setLastNum(courseOfStoreVo.getLastNum()); |
| | | courses.add(couList); |
| | | } |
| | | courseVenue.setCourses(courses); |
| | |
| | | tAppUser.setState(1); |
| | | tAppUser.setInsertTime(new Date()); |
| | | this.baseMapper.insert(tAppUser); |
| | | |
| | | |
| | | // 介绍有礼 |
| | | if(addAppUserVo.getReferralUserId()!=null){ |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(addAppUserVo.getLon(), addAppUserVo.getLat()); |
| | | Integer num=0; |
| | | if(null != geocode){ |
| | | String province = geocode.get("province"); |
| | | String provinceCode = geocode.get("provinceCode"); |
| | | String city = geocode.get("city"); |
| | | String cityCode = geocode.get("cityCode"); |
| | | num = introduceRewardsClient.getGiftList(cityCode); |
| | | } |
| | | TAppGift one = appGiftService.getOne(new LambdaQueryWrapper<TAppGift>().eq(TAppGift::getUserId, addAppUserVo.getReferralUserId())); |
| | | if(one!=null){ |
| | | one.setNum(one.getNum()+num); |
| | | appGiftService.updateById(one); |
| | | }else { |
| | | TAppGift tAppGift = new TAppGift(); |
| | | tAppGift.setUserId(addAppUserVo.getReferralUserId()); |
| | | tAppGift.setNum(num); |
| | | appGiftService.save(tAppGift); |
| | | } |
| | | |
| | | } |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | commodity.setBelongsType(vicinityGood.getUserPopulation()); |
| | | commodity.setGoodsType(1); |
| | | commodity.setNums(mcClient.getRedeemedQuantity(vicinityGood.getId())); |
| | | List<Integer> integers = mcsClient.queryPointMerStoreIds(vicinityGood.getId()); |
| | | commodity.setShopIds(integers); |
| | | break; |
| | | case 2: |
| | | commodity.setGoodId(vicinityGood.getCoursePackageId()); |
| | |
| | | commodity.setBelongsType(vicinityGood.getUserPopulation()); |
| | | commodity.setGoodsType(2); |
| | | commodity.setNums(mcClient.getRedeemedQuantity(vicinityGood.getId())); |
| | | commodity.setShopIds(mcsClient.queryPointMerStoreIds(vicinityGood.getId())); |
| | | break; |
| | | case 3: |
| | | commodity.setGoodId(vicinityGood.getId()); |
| | |
| | | commodity.setBelongsType(vicinityGood.getUserPopulation()); |
| | | commodity.setGoodsType(3); |
| | | commodity.setNums(mcClient.getRedeemedQuantity(vicinityGood.getId())); |
| | | commodity.setShopIds(mcsClient.queryPointMerStoreIds(vicinityGood.getId())); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | goods.add(commodity); |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.hasText(request.getSearch())){ |
| | | if (goods.size() > 0 ){ |
| | | goods = goods.stream() |
| | |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | // 2.0 门店筛选 |
| | | if (request.getShopId()!=null){ |
| | | if (goods.size() > 0 ){ |
| | | goods = goods.stream() |
| | | .filter(merchandise -> merchandise.getShopIds().contains(request.getShopId())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | |
| | | if (null != request.getRank()){ |
| | | switch (request.getRank()){ |
| | | case 1: |