| | |
| | | import com.dsh.account.entity.VipPayment; |
| | | import com.dsh.account.enums.RechargeRecordEnum; |
| | | import com.dsh.account.feignclient.activity.MerChandiseClient; |
| | | import com.dsh.account.feignclient.activity.UserConponClient; |
| | | import com.dsh.account.feignclient.activity.model.CommodityRequest; |
| | | import com.dsh.account.feignclient.activity.model.PointsMerchandise; |
| | | import com.dsh.account.feignclient.course.CoursePackageClient; |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | | import com.dsh.account.feignclient.course.model.CourseOfStoreVo; |
| | | import com.dsh.account.feignclient.course.model.CoursePackage; |
| | | import com.dsh.account.feignclient.course.model.QueryStoreList; |
| | | import com.dsh.account.feignclient.course.model.StuCourseResp; |
| | | import com.dsh.account.feignclient.other.ImgConfigClient; |
| | |
| | | import com.dsh.account.model.JoinPlayPaiVo; |
| | | import com.dsh.account.model.LoginSMSCodeVo; |
| | | import com.dsh.account.model.LoginWeChatVo; |
| | | import com.dsh.account.model.dto.Coupon; |
| | | import com.dsh.account.model.vo.classDetails.CourseVenue; |
| | | import com.dsh.account.model.vo.classDetails.ExerciseVideo; |
| | | import com.dsh.account.model.vo.classDetails.RegisteredCourse; |
| | | import com.dsh.account.model.vo.classDetails.WeekedCourse; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassInfoVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.BillingDetailsVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.IndexOfUserBenefirVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.RechargeCentVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.*; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.util.*; |
| | | import com.dsh.account.util.akeylogin.Md5Util; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private RechargeConfigClient reconMapper; |
| | | |
| | | @Resource |
| | | private UserConponClient ucponClient; |
| | | |
| | | @Resource |
| | | private CoursePackageClient cpageClient; |
| | | |
| | | @Override |
| | | public ClassInfoVo queryUserOfStus(Integer id,String latitude,String longitude) { |
| | |
| | | return centVos; |
| | | } |
| | | |
| | | @Override |
| | | public PointMallDetailsResponse queryAppUserIntegral(MallRequest request, Integer userIdFormRedis) { |
| | | PointMallDetailsResponse detailsResponse = new PointMallDetailsResponse(); |
| | | List<PointMallDetailsResponse.Goods> goods = new ArrayList<>(); |
| | | |
| | | TAppUser tAppUser = this.baseMapper.selectById(userIdFormRedis); |
| | | detailsResponse.setName(tAppUser.getName()); |
| | | detailsResponse.setIntegral(tAppUser.getIntegral()); |
| | | detailsResponse.setHeadImg(tAppUser.getHeadImg()); |
| | | |
| | | CommodityRequest commodityRequest = new CommodityRequest(); |
| | | commodityRequest.setLon(request.getLon()); |
| | | commodityRequest.setLat(request.getLat()); |
| | | List<PointsMerchandise> vicinityGoods = mcClient.getVicinityGoods(commodityRequest); |
| | | if (vicinityGoods.size() > 0) { |
| | | for (PointsMerchandise vicinityGood : vicinityGoods) { |
| | | PointMallDetailsResponse.Goods commodity = new PointMallDetailsResponse.Goods(); |
| | | switch (vicinityGood.getType()) { |
| | | case 1: |
| | | commodity.setGoodId(vicinityGood.getId()); |
| | | commodity.setGoodName(vicinityGood.getName()); |
| | | commodity.setGoodImg(vicinityGood.getCover()); |
| | | commodity.setCondition(vicinityGood.getRedemptionMethod()); |
| | | if (vicinityGood.getRedemptionMethod() == 1) { |
| | | commodity.setIntegral(vicinityGood.getIntegral().intValue()); |
| | | } else { |
| | | commodity.setIntegral(vicinityGood.getIntegral().intValue()); |
| | | commodity.setAmount(vicinityGood.getCash()); |
| | | } |
| | | commodity.setBelongsType(vicinityGood.getUserPopulation()); |
| | | commodity.setGoodsType(1); |
| | | commodity.setNums(mcClient.getRedeemedQuantity(vicinityGood.getId())); |
| | | break; |
| | | case 2: |
| | | commodity.setGoodId(vicinityGood.getCoursePackageId()); |
| | | CoursePackage coursePackage = cpageClient.queryCoursePackageById(vicinityGood.getCoursePackageId()); |
| | | commodity.setGoodImg(coursePackage.getCoverDrawing()); |
| | | commodity.setGoodName(coursePackage.getName()); |
| | | commodity.setCondition(vicinityGood.getRedemptionMethod()); |
| | | if (vicinityGood.getRedemptionMethod() == 1) { |
| | | commodity.setIntegral(vicinityGood.getIntegral().intValue()); |
| | | } else { |
| | | commodity.setIntegral(vicinityGood.getIntegral().intValue()); |
| | | commodity.setAmount(vicinityGood.getCash()); |
| | | } |
| | | commodity.setBelongsType(vicinityGood.getUserPopulation()); |
| | | commodity.setGoodsType(2); |
| | | commodity.setNums(mcClient.getRedeemedQuantity(vicinityGood.getId())); |
| | | break; |
| | | case 3: |
| | | commodity.setGoodId(vicinityGood.getId()); |
| | | commodity.setGoodName(vicinityGood.getName()); |
| | | commodity.setGoodImg(vicinityGood.getCover()); |
| | | commodity.setCondition(vicinityGood.getRedemptionMethod()); |
| | | if (vicinityGood.getRedemptionMethod() == 1) { |
| | | commodity.setIntegral(vicinityGood.getIntegral().intValue()); |
| | | } else { |
| | | commodity.setIntegral(vicinityGood.getIntegral().intValue()); |
| | | commodity.setAmount(vicinityGood.getCash()); |
| | | } |
| | | commodity.setBelongsType(vicinityGood.getUserPopulation()); |
| | | commodity.setGoodsType(3); |
| | | commodity.setNums(mcClient.getRedeemedQuantity(vicinityGood.getId())); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | goods.add(commodity); |
| | | } |
| | | } |
| | | List<Coupon> allCoupons = ucponClient.getAllCoupons(commodityRequest); |
| | | if (allCoupons.size() > 0) { |
| | | for (Coupon allCoupon : allCoupons) { |
| | | PointMallDetailsResponse.Goods commodity = new PointMallDetailsResponse.Goods(); |
| | | commodity.setGoodId(allCoupon.getId()); |
| | | commodity.setGoodName(allCoupon.getName()); |
| | | commodity.setCondition(allCoupon.getRedemptionMethod()); |
| | | commodity.setGoodImg(allCoupon.getCover()); |
| | | if (allCoupon.getRedemptionMethod() == 1) { |
| | | commodity.setIntegral(allCoupon.getIntegral().intValue()); |
| | | } else { |
| | | commodity.setIntegral(allCoupon.getIntegral().intValue()); |
| | | commodity.setAmount(allCoupon.getCash()); |
| | | } |
| | | commodity.setBelongsType(allCoupon.getUserPopulation()); |
| | | commodity.setGoodsType(4); |
| | | commodity.setNums(ucponClient.getRedeemedQuantity(allCoupon.getId())); |
| | | goods.add(commodity); |
| | | } |
| | | } |
| | | if (StringUtils.hasText(request.getSearch())){ |
| | | goods = goods.stream() |
| | | .filter(merchandise -> merchandise.getGoodName().contains(request.getSearch())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | if (null != request.getRank()){ |
| | | switch (request.getRank()){ |
| | | case 1: |
| | | goods = goods.stream() |
| | | .sorted(Comparator.comparing(PointMallDetailsResponse.Goods::getIntegral).reversed()) |
| | | .collect(Collectors.toList()); |
| | | break; |
| | | case 2: |
| | | goods = goods.stream() |
| | | .sorted(Comparator.comparing(PointMallDetailsResponse.Goods::getIntegral)) |
| | | .collect(Collectors.toList()); |
| | | break; |
| | | case 3: |
| | | goods = goods.stream() |
| | | .sorted(Comparator.comparing(PointMallDetailsResponse.Goods::getNums).reversed()) |
| | | .collect(Collectors.toList()); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | } |
| | | if (null != request.getGoodsType()){ |
| | | goods = goods.stream() |
| | | .filter(merchandise -> merchandise.getGoodsType().equals(request.getGoodsType())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | detailsResponse.setGoods(goods); |
| | | return detailsResponse; |
| | | } |
| | | |
| | | } |