Merge remote-tracking branch 'origin/master'
# Conflicts:
# ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java
18 文件已重命名
74个文件已修改
11个文件已添加
| | |
| | | @Override |
| | | public R<Void> editAppUserById(AppUser appUser) { |
| | | log.error("编辑用户信息失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("编辑用户信息失败"); |
| | | return R.fail("编辑用户信息失败"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/appUser/getAppUserById") |
| | | @PostMapping("/app-user/getAppUserById") |
| | | AppUser getAppUserById(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 根据id编辑用户 |
| | | */ |
| | | @PostMapping("/app-user/editAppUserById") |
| | | R<Void> editAppUserById(@RequestParam("appUser") AppUser appUser); |
| | | R<Void> editAppUserById(@RequestBody AppUser appUser); |
| | | |
| | | @PostMapping("/app-user/getCouponCount") |
| | | R<Long> getCouponCount(@RequestParam("userId")Long userId, @RequestParam("couponId") Integer couponId ); |
| | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.NONE) |
| | | @TableId("id") |
| | | @ApiModelProperty(value = "数据id") |
| | | private Long id; |
| | | /** |
File was renamed from ruoyi-api/ruoyi-api-order/src/main/java/factory/RemoteOrderGoodsFallbackFactory.java |
| | |
| | | package factory; |
| | | package com.ruoyi.order.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import model.Order; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.util.List; |
| | |
| | | public RemoteOrderGoodsClient create(Throwable cause) { |
| | | return new RemoteOrderGoodsClient(){ |
| | | @Override |
| | | public R<List<Order>> goodsOrder(List<Long> goodsIds) { |
| | | public R<List<OrderGood>> goodsOrder(List<Long> goodsIds) { |
| | | log.error("获取订单商品失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("获取订单商品失败"); |
| | | } |
File was renamed from ruoyi-api/ruoyi-api-order/src/main/java/feignClient/RemoteOrderGoodsClient.java |
| | |
| | | package feignClient; |
| | | package com.ruoyi.order.feignClient; |
| | | |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import factory.RemoteOrderGoodsFallbackFactory; |
| | | import model.Order; |
| | | import model.OrderGood; |
| | | import com.ruoyi.order.factory.RemoteOrderGoodsFallbackFactory; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | * 查询指定商品订单 |
| | | */ |
| | | @PostMapping("/order-good/selectGoodsOrder") |
| | | public R<List<Order>> goodsOrder(@RequestBody List<Long> goodsIds); |
| | | public R<List<OrderGood>> goodsOrder(@RequestBody List<Long> goodsIds); |
| | | |
| | | /** |
| | | * 根据ids查找订单列表 |
File was renamed from ruoyi-api/ruoyi-api-order/src/main/java/model/Order.java |
| | |
| | | package model; |
| | | package com.ruoyi.order.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "预计提货时间") |
| | | @TableField("expected_delivery_time") |
| | | private String expectedDeliveryTime; |
| | | |
| | | |
| | | } |
File was renamed from ruoyi-api/ruoyi-api-order/src/main/java/model/OrderGood.java |
| | |
| | | package model; |
| | | package com.ruoyi.order.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
File was renamed from ruoyi-api/ruoyi-api-order/src/main/java/model/RefundPass.java |
| | |
| | | package model; |
| | | package com.ruoyi.order.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
File was renamed from ruoyi-api/ruoyi-api-order/src/main/java/model/ShoppingCart.java |
| | |
| | | package model; |
| | | package com.ruoyi.order.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
File was renamed from ruoyi-api/ruoyi-api-order/src/main/java/vo/OrderDetailVO.java |
| | |
| | | package vo; |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
File was renamed from ruoyi-api/ruoyi-api-order/src/main/java/vo/OrderGoodsVO.java |
| | |
| | | package vo; |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | com.ruoyi.order.factory.RemoteOrderGoodsFallbackFactory |
| | |
| | | @TableField("pid") |
| | | private Integer pid; |
| | | |
| | | @ApiModelProperty(value = "营业星期(1,2,3,4,5,6,7)") |
| | | @ApiModelProperty(value = "营业星期:1-周一到周日 2-周一周五 3-仅周末") |
| | | @TableField("business_date") |
| | | private String businessDate; |
| | | private Integer businessDate; |
| | | |
| | | @ApiModelProperty(value = "开始时间(HH:mm)") |
| | | @TableField("start_time") |
New file |
| | |
| | | package com.ruoyi.other.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @TableName("t_shop_score") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Data |
| | | @ApiModel(value="ShopScore对象", description="") |
| | | public class ShopScore implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId("id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("shop_id") |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty(value = "评分") |
| | | @TableField("score") |
| | | private BigDecimal score; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | } |
| | |
| | | @TableField("vip_withdrawal_min_amount") |
| | | private BigDecimal vipWithdrawalMinAmount; |
| | | |
| | | @ApiModelProperty(value = "提现手续费") |
| | | @TableField("vip_withdrawal_fee") |
| | | private BigDecimal vipWithdrawalFee; |
| | | |
| | | @ApiModelProperty(value = "积分转赠权限 1开0关") |
| | | @TableField("vip_gift_role") |
| | | private Integer vipGiftRole; |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.BaseSetting; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.feignClient.BaseSettingClient; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.api.domain.GoodsVip; |
| | | import com.ruoyi.other.api.feignClient.CouponClient; |
| | | import com.ruoyi.other.api.feignClient.GoodsVipClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.other.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.GoodsArea; |
| | | import com.ruoyi.other.api.domain.GoodsVip; |
| | | import com.ruoyi.other.api.feignClient.GoodsVipClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | |
| | | package com.ruoyi.other.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.ExchangeBackDto; |
| | | import com.ruoyi.common.core.dto.ExchangeDto; |
| | | |
| | | import com.ruoyi.other.api.feignClient.OrderClient; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 充电订单服务降级处理 |
New file |
| | |
| | | package com.ruoyi.other.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.PointSetting; |
| | | import com.ruoyi.other.api.feignClient.PointSettingClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | public class PointSettingClientFallbackFactory implements FallbackFactory<PointSettingClient> { |
| | | @Override |
| | | public PointSettingClient create(Throwable cause) { |
| | | return new PointSettingClient() { |
| | | @Override |
| | | public R<PointSetting> getPointSetting(Integer id) { |
| | | return R.fail("获取积分配置失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.feignClient.OrderClient; |
| | | import com.ruoyi.other.api.feignClient.StoreClient; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.api.domain.GoodsArea; |
| | | import com.ruoyi.other.api.domain.GoodsVip; |
| | | import com.ruoyi.other.api.factory.CouponClientFallbackFactory; |
| | | import com.ruoyi.other.api.factory.GoodsVipClientFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.ExchangeBackDto; |
| | | import com.ruoyi.common.core.dto.ExchangeDto; |
| | | |
| | | import com.ruoyi.other.api.factory.OrderFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
New file |
| | |
| | | package com.ruoyi.other.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.PointSetting; |
| | | import com.ruoyi.other.api.factory.PointSettingClientFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | @FeignClient(contextId = "PointSettingClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = PointSettingClientFallbackFactory.class) |
| | | public interface PointSettingClient { |
| | | |
| | | @GetMapping("/point-setting/getPointSetting") |
| | | R<PointSetting> getPointSetting(@RequestParam("id") Integer id); |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 后台订单服务 |
| | | * @author ruoyi |
| | |
| | | |
| | | public static void main(String[] ages){ |
| | | GeodesyUtil geodesyUtil = new GeodesyUtil(); |
| | | Map<String, Double> distance = geodesyUtil.getDistance("104.063855,30.575442", "104.679931,31.471814"); |
| | | Map<String, Double> distance = geodesyUtil.getDistance("106.6664549,29.4158471", "104.0908333,30.4414610"); |
| | | System.err.println(distance); |
| | | } |
| | | } |
| | |
| | | * 响应请求分页数据 |
| | | */ |
| | | @SuppressWarnings({ "rawtypes", "unchecked" }) |
| | | protected TableDataInfo getDataTable(List<?> list) |
| | | protected <T>TableDataInfo<T> getDataTable(List<T> list) |
| | | { |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | TableDataInfo<T> rspData = new TableDataInfo(); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setRows(list); |
| | | rspData.setMsg("查询成功"); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 组装签名路径 |
| | | * @param params |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.model.AppUserBank; |
| | | import com.ruoyi.account.service.AppUserBankService; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | @RestController |
| | | @RequestMapping("/appUserBank") |
| | | public class AppUserBankController { |
| | | |
| | | @Resource |
| | | private AppUserBankService appUserBankService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @PostMapping("/saveAppUserBank") |
| | | @ApiOperation(value = "保存银行卡") |
| | | public AjaxResult saveAppUserBank(@RequestBody AppUserBank appUserBank){ |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | |
| | | AppUserBank bank = appUserBankService.getOne(new LambdaQueryWrapper<AppUserBank>() |
| | | .eq(AppUserBank::getAppUserId, loginUserApplet.getUserid())); |
| | | if (bank == null){ |
| | | appUserBank.setAppUserId(loginUserApplet.getUserid()); |
| | | appUserBankService.saveOrUpdate(appUserBank); |
| | | }else { |
| | | appUserBank.setId(bank.getId()); |
| | | appUserBank.setAppUserId(bank.getAppUserId()); |
| | | appUserBankService.updateById(appUserBank); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getAppUserBank") |
| | | @ApiOperation(value = "获取银行卡信息") |
| | | public AjaxResult<AppUserBank> getAppUserBank(){ |
| | | return AjaxResult.success(); |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | AppUserBank appUserBank = appUserBankService.getOne(new LambdaQueryWrapper<AppUserBank>() |
| | | .eq(AppUserBank::getAppUserId, loginUserApplet.getUserid())); |
| | | return AjaxResult.success(appUserBank); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.controller; |
| | | import java.time.LocalDateTime; |
| | | |
| | | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.feignClient.StoreClient; |
| | | import org.junit.Test; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | |
| | | import com.ruoyi.account.vo.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ResponseBody |
| | | @PostMapping("/mobileLogin") |
| | | @ApiOperation(value = "手机号登录") |
| | | public AjaxResult<LoginVo> mobileLogin(@RequestBody MobileLogin mobileLogin){ |
| | | public R<LoginVo> mobileLogin(@RequestBody MobileLogin mobileLogin){ |
| | | return appUserService.mobileLogin(mobileLogin); |
| | | } |
| | | |
| | | @PostMapping("getAppUserById") |
| | | AppUser getAppUserById(@RequestParam("id") Long id){ |
| | | return appUserService.getById(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editAppUserById") |
| | | public R<Void> editAppUserById(@RequestParam("appUser") AppUser appUser){ |
| | | public R<Void> editAppUserById(@RequestBody AppUser appUser) { |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | | @PostMapping("/mobileLogin") |
| | | @ApiOperation(value = "手机号登录") |
| | | public R<LoginVo> mobileLogin(@RequestBody MobileLogin mobileLogin){ |
| | | return appUserService.mobileLogin(mobileLogin); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | @ResponseBody |
| | | @PostMapping("/getVipCount") |
| | | public R<Long> getVipCount(@RequestParam("userId")Long userId, @RequestParam("vipId") Integer vipId ){ |
| | | appUserService.lambdaQuery().eq(AppUser::getInviteUserId, userId).eq(AppUser::getVipId, vipId).count() |
| | | Long count = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, userId).eq(AppUser::getVipId, vipId).count(); |
| | | return R.ok(count); |
| | | } |
| | | |
| | |
| | | private UserCancellationLogService userCancellationLogService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/unregis") |
| | | @GetMapping("/unregis") |
| | | @ApiOperation(value = "注销", tags = {"小程序-个人中心首页-我的资料"}) |
| | | public R unregis(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | |
| | | |
| | | |
| | | |
| | | @PostMapping("/index") |
| | | @GetMapping("/index") |
| | | @ApiOperation(value = "个人中心首页", tags = {"小程序-个人中心首页"}) |
| | | public R<AppUser> index(){ |
| | | System.err.println("=-===="); |
| | |
| | | |
| | | } |
| | | |
| | | @GetMapping("/index/change") |
| | | @ApiOperation(value = "修改个人资料", tags = {"小程序-个人中心首页"}) |
| | | public R<AppUser> indexchange(String avatar,String name){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | //当前用户信息 |
| | | AppUser user = appUserService.getById(userId); |
| | | user.setName(name); |
| | | user.setAvatar(avatar); |
| | | appUserService.updateById(user); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 获取用户的祖籍列表 |
| | | */ |
| | |
| | | package com.ruoyi.account.controller; |
| | | import java.math.BigDecimal; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.ruoyi.account.service.UserPointService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.account.api.vo.CouponInfoVo; |
| | | import com.ruoyi.account.api.vo.PaymentUserCoupon; |
| | | import com.ruoyi.account.service.UserCouponService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Banner; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.api.feignClient.CouponClient; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.UserPointService; |
| | | import com.ruoyi.account.vo.UserPointDetailVO; |
| | | import com.ruoyi.account.vo.UserPointVO; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.YearMonth; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | |
| | | public class UserPointController extends BaseController { |
| | | @Resource |
| | | private UserPointService userPointService; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/getUserPoint") |
| | | @ApiOperation("获取个人积分") |
| | | public R<UserPointVO> getUserPoint(){ |
| | | public R<UserPointVO> getUserPoint() { |
| | | return R.ok(userPointService.getUserPoint(SecurityUtils.getUserId())); |
| | | } |
| | | |
| | |
| | | */ |
| | | @GetMapping("/getUserPointDetail") |
| | | @ApiOperation("获取变更明细") |
| | | public TableDataInfo getUserPointDetail(@ApiParam("指定日期") LocalDateTime date, |
| | | @ApiParam("变动类型(1=消费积分,2=返佣积分,3=拉新人积分,4=兑换商品 " + |
| | | "5 = 门店业绩积分 6 =门店返佣积分7=技师业绩积分8 =转赠积分 9 =做工积分 " + |
| | | "10 =注册积分)") Integer type){ |
| | | public TableDataInfo<UserPointDetailVO> getUserPointDetail(@ApiParam("指定日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate date, |
| | | @ApiParam("变动类型(1=消费积分,2=返佣积分,3=拉新人积分,4=兑换商品 " + |
| | | "5 = 门店业绩积分 6 =门店返佣积分7=技师业绩积分8 =转赠积分 9 =做工积分 " + |
| | | "10 =注册积分)") Integer type) { |
| | | LocalDateTime startTime = null; |
| | | LocalDateTime endTime = null; |
| | | if (date != null) { |
| | | // 将 createTime 设置为当天的开始时间 (00:00) |
| | | startTime = date.atStartOfDay(); |
| | | |
| | | // 使用 YearMonth 来获取该月的最后一天 |
| | | YearMonth yearMonth = YearMonth.from(date); |
| | | LocalDate lastDayOfMonth = yearMonth.atEndOfMonth(); |
| | | |
| | | // 将最后一天转换为 LocalDateTime,并设置为当天的最后一秒 (23:59:59.999) |
| | | endTime = lastDayOfMonth.atTime(LocalTime.MAX); |
| | | } |
| | | |
| | | startPage(); |
| | | List<UserPointDetailVO> list = userPointService.getUserPointDetail(SecurityUtils.getUserId(), date, type); |
| | | List<UserPointDetailVO> list = userPointService.getUserPointDetail(SecurityUtils.getUserId(), startTime, endTime, type); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/transferPoint") |
| | | @ApiOperation("转赠积分") |
| | | public R<Void> transferPoint(@ApiParam("积分") BigDecimal point, @ApiParam("手机号") Long phone){ |
| | | public R<Void> transferPoint(@ApiParam("积分") BigDecimal point, @ApiParam("手机号") Long phone) { |
| | | AppUser appUser = appUserService.getOne(new LambdaQueryWrapper<AppUser>() |
| | | .eq(AppUser::getPhone, phone)); |
| | | if (null == appUser) { |
| | | return R.fail("用户不存在"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存积分流水记录 |
| | | * |
| | | * @param userPoint |
| | | * @return |
| | | */ |
| | | @PostMapping("/saveUserPoint") |
| | | public R saveUserPoint(@RequestBody UserPoint userPoint){ |
| | | public R saveUserPoint(@RequestBody UserPoint userPoint) { |
| | | userPointService.save(userPoint); |
| | | return R.ok(); |
| | | } |
| | |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.BalanceChangeRecordService; |
| | | import com.ruoyi.account.service.VipSettingService; |
| | | import com.ruoyi.account.service.WalletService; |
| | | import com.ruoyi.account.vo.WalletVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import feignClient.RemoteOrderClient; |
| | | import feignClient.RemoteOrderGoodsClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import model.Order; |
| | | import model.OrderGood; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.YearMonth; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api(tags = "小程序-个人中心-我的钱包") |
| | |
| | | private RemoteOrderGoodsClient remoteOrderGoodsClient; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | |
| | | /** |
| | | * 钱包详情 |
| | |
| | | @ApiOperation(value = "钱包详情", notes = "钱包详情") |
| | | public R<WalletVO> detail() { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | VipSetting vipSetting = vipSettingService.getVipSettingByUserId(loginUserApplet.getUserid()); |
| | | WalletVO walletVO = walletService.getWalletByUserId(loginUserApplet.getUserid()); |
| | | walletVO.setVipWithdrawalFee(vipSetting.getVipWithdrawalFee()); |
| | | return R.ok(walletVO); |
| | | } |
| | | |
| | |
| | | @RequestParam(required = false) Integer changeType, |
| | | @ApiParam(value = "创建时间") |
| | | @RequestParam(required = false) |
| | | @DateTimeFormat(pattern = "yyyy-MM") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | LocalDate createTime) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | |
| | | LocalDateTime localDateTime = null; |
| | | LocalDateTime startTime = null; |
| | | LocalDateTime endTime = null; |
| | | if (createTime != null) { |
| | | LocalTime specificTime = LocalTime.of(0, 0); |
| | | localDateTime = createTime.atTime(specificTime); |
| | | // 将 createTime 设置为当天的开始时间 (00:00) |
| | | startTime = createTime.atStartOfDay(); |
| | | |
| | | // 使用 YearMonth 来获取该月的最后一天 |
| | | YearMonth yearMonth = YearMonth.from(createTime); |
| | | LocalDate lastDayOfMonth = yearMonth.atEndOfMonth(); |
| | | |
| | | // 将最后一天转换为 LocalDateTime,并设置为当天的最后一秒 (23:59:59.999) |
| | | endTime = lastDayOfMonth.atTime(LocalTime.MAX); |
| | | } |
| | | |
| | | List<BalanceChangeRecord> list = balanceChangeRecordService.list(new LambdaQueryWrapper<BalanceChangeRecord>() |
| | | .eq(changeType != null, BalanceChangeRecord::getChangeType, changeType) |
| | | .eq(createTime != null, BalanceChangeRecord::getCreateTime, localDateTime) |
| | | .between(startTime != null, BalanceChangeRecord::getCreateTime, startTime, endTime) |
| | | .eq(BalanceChangeRecord::getAppUserId, userId)); |
| | | |
| | | List<Long> orderIds = list.stream().map(BalanceChangeRecord::getOrderId).collect(Collectors.toList()); |
| | | R<List<Order>> r = remoteOrderGoodsClient.getOrderListByIds(orderIds); |
| | | if (!R.isSuccess(r)){ |
| | | return R.fail(r.getMsg()); |
| | | } |
| | | List<Order> orderList = r.getData(); |
| | | list.forEach(bc -> { |
| | | orderList.stream().filter(o -> o.getId().equals(bc.getOrderId())).findFirst().ifPresent(o -> { |
| | | Long appUserId = o.getAppUserId(); |
| | | AppUser appUser = appUserService.getById(appUserId); |
| | | bc.setUserName(appUser.getName()); |
| | | bc.setAmount(o.getPaymentAmount()); |
| | | if (CollectionUtil.isNotEmpty(orderIds)){ |
| | | R<List<Order>> r = remoteOrderGoodsClient.getOrderListByIds(orderIds); |
| | | if (!R.isSuccess(r)){ |
| | | return R.fail(r.getMsg()); |
| | | } |
| | | List<Order> orderList = r.getData(); |
| | | list.forEach(bc -> { |
| | | orderList.stream().filter(o -> o.getId().equals(bc.getOrderId())).findFirst().ifPresent(o -> { |
| | | Long appUserId = o.getAppUserId(); |
| | | AppUser appUser = appUserService.getById(appUserId); |
| | | bc.setUserName(appUser.getName()); |
| | | bc.setAmount(o.getPaymentAmount()); |
| | | }); |
| | | }); |
| | | }); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.AppUserBank; |
| | | |
| | | public interface AppUserBankMapper extends BaseMapper<AppUserBank> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.AppUserBank; |
| | | |
| | | public interface AppUserBankService extends IService<AppUserBank> { |
| | | } |
| | |
| | | import com.ruoyi.account.vo.UserPointDetailVO; |
| | | import com.ruoyi.account.vo.UserPointVO; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | |
| | | UserPointVO getUserPoint(Long userId); |
| | | |
| | | |
| | | List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime date, Integer type); |
| | | List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime startTime, LocalDateTime endTime, Integer type); |
| | | |
| | | void transferPoint(BigDecimal point, Long phone); |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | |
| | | public interface VipSettingService { |
| | | |
| | | VipSetting getVipSettingById(Integer id); |
| | | |
| | | VipSetting getVipSettingByUserId(Long appUserId); |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.model.AppUserBank; |
| | | import com.ruoyi.account.mapper.AppUserBankMapper; |
| | | import com.ruoyi.account.service.AppUserBankService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class AppUserBankServiceImpl extends ServiceImpl<AppUserBankMapper, AppUserBank> implements AppUserBankService { |
| | | } |
| | |
| | | import com.ruoyi.account.util.weChat.WeChatUtil; |
| | | import com.ruoyi.account.vo.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.vo.CouponInfoVo; |
| | | import com.ruoyi.account.api.vo.PaymentUserCouponVo; |
| | | import com.ruoyi.account.mapper.UserCouponMapper; |
| | | import com.ruoyi.account.api.model.UserCoupon; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.Instant; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | import com.ruoyi.account.enums.PointChangeType; |
| | | import com.ruoyi.account.mapper.UserPointMapper; |
| | | import com.ruoyi.account.service.UserPointService; |
| | | import com.ruoyi.account.vo.UserPointDetailVO; |
| | | import com.ruoyi.account.vo.UserPointVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.RemoteVipSettingClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | public class UserPointServiceImpl extends ServiceImpl<UserPointMapper, UserPoint> implements UserPointService { |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private RemoteVipSettingClient remoteVipSettingClient; |
| | | |
| | | @Override |
| | | public UserPointVO getUserPoint(Long userId) { |
| | |
| | | Map<Integer, Integer> userBalanceMap = userPointList.stream() |
| | | .collect(Collectors.toMap(UserPoint::getType, UserPoint::getBalance)); |
| | | |
| | | R<VipSetting> r = remoteVipSettingClient.getVipSettingById(appUser.getVipId()); |
| | | if (!R.isSuccess(r)){ |
| | | throw new RuntimeException("会员等级获取失败"); |
| | | } |
| | | |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | UserPointVO userPointVO = new UserPointVO(); |
| | | userPointVO.setTotalPoint(lavePoint); |
| | | // userPointVO.setConsumePoint(lavePoint); |
| | | userPointVO.setShopPoint(userBalanceMap.get(PointChangeType.CONSUME.getCode())); |
| | | userPointVO.setSharePoint(userBalanceMap.get(PointChangeType.COMMISSION_RETURN.getCode())); |
| | | userPointVO.setPullNewPoint(userBalanceMap.get(PointChangeType.NEW_USER_REFERRAL.getCode())); |
| | | userPointVO.setShopAchievementPoint(userBalanceMap.get(PointChangeType.STORE_PERFORMANCE.getCode())); |
| | | userPointVO.setShopSharePoint(userBalanceMap.get(PointChangeType.STORE_COMMISSION_RETURN.getCode())); |
| | | userPointVO.setGiftPoint(r.getData().getVipGiftRole()); |
| | | return userPointVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime date, Integer type) { |
| | | public List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime startTime, LocalDateTime endTime, Integer type) { |
| | | List<UserPoint> userPointList = list(new LambdaQueryWrapper<UserPoint>() |
| | | .between(startTime != null, UserPoint::getCreateTime, startTime, endTime) |
| | | .eq(type != null, UserPoint::getType, type) |
| | | .eq(UserPoint::getAppUserId, userId)); |
| | | if (CollectionUtil.isNotEmpty(userPointList)) { |
| | | return userPointList.stream().map(p -> { |
| | |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void transferPoint(BigDecimal point, Long phone) { |
| | | AppUser appUser = appUserService.getOne(new LambdaQueryWrapper<AppUser>() |
| | | .eq(AppUser::getPhone, phone)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.service.VipSettingService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.RemoteVipSettingClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Service |
| | | public class VipSettingServiceImpl implements VipSettingService { |
| | | |
| | | @Resource |
| | | private RemoteVipSettingClient remoteVipSettingClient; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | @Override |
| | | public VipSetting getVipSettingById(Integer id) { |
| | | R<VipSetting> vipSettingById = remoteVipSettingClient.getVipSettingById(id); |
| | | if (!R.isSuccess(vipSettingById)){ |
| | | throw new ServiceException("会员等级获取失败"); |
| | | } |
| | | return vipSettingById.getData(); |
| | | } |
| | | |
| | | @Override |
| | | public VipSetting getVipSettingByUserId(Long appUserId) { |
| | | AppUser appUser = appUserClient.getAppUserById(appUserId); |
| | | if(null == appUser){ |
| | | throw new ServiceException("用户不存在"); |
| | | } |
| | | return getVipSettingById(appUser.getVipId()); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | import com.ruoyi.account.dto.WithdrawalRequestsDTO; |
| | | import com.ruoyi.account.mapper.WithdrawalRequestsMapper; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | import com.ruoyi.account.service.VipSettingService; |
| | | import com.ruoyi.account.service.WithdrawalRequestsService; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class WithdrawalRequestsServiceImpl extends ServiceImpl<WithdrawalRequestsMapper, WithdrawalRequests> implements WithdrawalRequestsService { |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | |
| | | public static final BigDecimal MAX_WITHDRAWAL_AMOUNT = new BigDecimal("200"); |
| | | public static final BigDecimal VIP_WITHDRAWAL_FEE_DENOMINATOR = new BigDecimal("100"); |
| | | |
| | | @Override |
| | | public void withdrawalApply(WithdrawalRequestsDTO params) { |
| | | if (params.getWithdrawalAmount().compareTo(MAX_WITHDRAWAL_AMOUNT) > 0) { |
| | | throw new ServiceException("提现失败,单次提现金额不能超过200元!"); |
| | | } |
| | | |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | AppUser appUser = appUserClient.getAppUserById(loginUserApplet.getUserid()); |
| | | |
| | | if (appUser.getWithdrawableAmount().compareTo(params.getWithdrawalAmount()) < 0) { |
| | | throw new ServiceException("提现失败,可提现金额不足!"); |
| | | } |
| | | |
| | | Integer vipId = appUser.getVipId(); |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(vipId); |
| | | if (vipSetting.getVipWithdrawalRole() == 0) { |
| | | throw new ServiceException("提现失败,当前会员等级不允许提现!"); |
| | | } |
| | | BigDecimal vipWithdrawalMinAmount = vipSetting.getVipWithdrawalMinAmount(); |
| | | if (params.getWithdrawalAmount().compareTo(vipWithdrawalMinAmount) < 0) { |
| | | throw new ServiceException("提现失败,提现金额不能小于" + vipWithdrawalMinAmount + "元!"); |
| | | } |
| | | // 提现手续费 |
| | | BigDecimal vipWithdrawalFee = vipSetting.getVipWithdrawalFee() |
| | | .divide(VIP_WITHDRAWAL_FEE_DENOMINATOR, 2, RoundingMode.HALF_UP); |
| | | // 减去手续费 |
| | | params.setWithdrawalAmount(params.getWithdrawalAmount() |
| | | .subtract(params.getWithdrawalAmount().multiply(vipWithdrawalFee))); |
| | | |
| | | WithdrawalRequests withdrawalRequests = new WithdrawalRequests(); |
| | | BeanUtils.copyBeanProp(withdrawalRequests, params); |
| | | withdrawalRequests.setDelFlag(0); |
| | |
| | | withdrawalRequests.setAuditStatus(1); |
| | | save(withdrawalRequests); |
| | | } |
| | | |
| | | } |
File was renamed from ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/TaskUtil.java |
| | |
| | | package com.ruoyi.account.util; |
| | | package com.ruoyi.account.util.weChat; |
| | | |
| | | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel(value="UserPointDetail对象", description="") |
| | | @ApiModel("UserPointDetail对象") |
| | | public class UserPointDetailVO { |
| | | |
| | | @ApiModelProperty(value = "变动类型(1=消费积分,2=返佣积分,3=拉新人积分,4=兑换商品 5 = 门店业绩积分 6 =门店返佣积分7=技师业绩积分8 =转赠积分 9 =做工积分 10 =注册积分)") |
| | |
| | | |
| | | @ApiModelProperty(value = "变动时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "总积分") |
| | | private Integer totalPoint; |
| | | |
| | | @ApiModelProperty(value = "可消费积分") |
| | | private Integer consumePoint; |
| | | |
| | | @ApiModelProperty(value = "消费积分数") |
| | | private Integer shopPoint; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "门店返佣积分") |
| | | private Integer shopSharePoint; |
| | | |
| | | @ApiModelProperty(value = "是否可转赠积分") |
| | | private Integer giftPoint; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "分销总金额") |
| | | private BigDecimal totalDistributionAmount; |
| | | |
| | | @ApiModelProperty(value = "提现手续费") |
| | | private BigDecimal vipWithdrawalFee; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import vo.OrderDetailVO; |
| | | import com.ruoyi.order.vo.OrderVO; |
| | | import com.ruoyi.order.vo.OrderDetailVO; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import model.Order; |
| | | import com.ruoyi.order.model.Order; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | @Api(tags = "订单") |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | public class OrderController { |
| | | public class OrderController extends BaseController { |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | |
| | | @ApiImplicitParam(value = "订单状态", name = "status", required = true, dataType = "int"), |
| | | }) |
| | | @GetMapping("/getMyOrderList/{status}") |
| | | public R<List<OrderVO>> getMyOrderList(@PathVariable("status") Integer status){ |
| | | public TableDataInfo getMyOrderList(@PathVariable("status") Integer status){ |
| | | startPage(); |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | return R.ok(orderService.selectOrderListByUserId(status, loginUserApplet.getUserid())); |
| | | return getDataTable(orderService.selectOrderListByUserId(status, loginUserApplet.getUserid())); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | import com.ruoyi.order.service.OrderGoodService; |
| | | import model.OrderGood; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.service.ShoppingCartService; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import model.ShoppingCart; |
| | | import com.ruoyi.order.model.ShoppingCart; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import model.OrderGood; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.vo.OrderVO; |
| | | import model.Order; |
| | | import com.ruoyi.order.model.Order; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import model.RefundPass; |
| | | import com.ruoyi.order.model.RefundPass; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import model.ShoppingCart; |
| | | import com.ruoyi.order.model.ShoppingCart; |
| | | |
| | | public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> { |
| | | |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import model.OrderGood; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import vo.OrderDetailVO; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.vo.OrderDetailVO; |
| | | import com.ruoyi.order.vo.OrderVO; |
| | | import model.Order; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import model.RefundPass; |
| | | import com.ruoyi.order.model.RefundPass; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.order.model.ShoppingCart; |
| | | import com.ruoyi.order.vo.*; |
| | | import model.ShoppingCart; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import model.Order; |
| | | import model.OrderGood; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.order.mapper.OrderGoodMapper; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | import com.ruoyi.order.service.OrderGoodService; |
| | | import model.OrderGood; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.order.enums.OrderType; |
| | | import com.ruoyi.order.mapper.OrderGoodMapper; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import vo.OrderDetailVO; |
| | | import vo.OrderGoodsVO; |
| | | import com.ruoyi.order.vo.OrderDetailVO; |
| | | import com.ruoyi.order.vo.OrderGoodsVO; |
| | | import com.ruoyi.order.vo.OrderVO; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | |
| | | import com.ruoyi.other.api.domain.Technician; |
| | | import com.ruoyi.other.api.feignClient.TechnicianClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import model.Order; |
| | | import model.OrderGood; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.order.mapper.RefundPassMapper; |
| | | import com.ruoyi.order.model.RefundPass; |
| | | import com.ruoyi.order.service.RefundPassService; |
| | | import model.RefundPass; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.*; |
| | |
| | | import com.ruoyi.account.api.vo.PaymentUserCoupon; |
| | | import com.ruoyi.account.api.vo.PaymentUserCouponVo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.mapper.ShoppingCartMapper; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | import com.ruoyi.order.model.ShoppingCart; |
| | | import com.ruoyi.order.service.OrderGoodService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.ShoppingCartService; |
| | |
| | | import com.ruoyi.other.api.vo.GetGoodsBargainPrice; |
| | | import com.ruoyi.other.api.vo.GetGoodsShopByGoodsIds; |
| | | import com.ruoyi.other.api.vo.GetSeckillActivityInfo; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import model.Order; |
| | | import model.OrderGood; |
| | | import model.ShoppingCart; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | return R.fail("修改数量不能小于等于0"); |
| | | } |
| | | ShoppingCart shoppingCart = this.getById(setGoodsNumber.getId()); |
| | | Goods goods = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData(); |
| | | if(null != goods.getPurchaseLimit() && -1 != goods.getPurchaseLimit() && goods.getPurchaseLimit() < setGoodsNumber.getNumber()){ |
| | | return R.fail("修改数量不能大于限购数量"); |
| | | } |
| | | |
| | | if(null != shoppingCart){ |
| | | |
| | | Goods goods = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData(); |
| | | if(null != goods.getPurchaseLimit() && -1 != goods.getPurchaseLimit() && goods.getPurchaseLimit() < setGoodsNumber.getNumber()){ |
| | | return R.fail("修改数量不能大于限购数量"); |
| | | } |
| | | |
| | | shoppingCart.setNumber(setGoodsNumber.getNumber()); |
| | | this.updateById(shoppingCart); |
| | | } |
| | |
| | | confirmOrderVo.setDiscountAmount(orderMoney.subtract(paymentMoney).setScale(2, RoundingMode.HALF_EVEN)); |
| | | } |
| | | BaseSetting baseSetting = baseSettingClient.getBaseSetting(4).getData(); |
| | | confirmOrderVo.setUseSimultaneously(baseSetting.getContent().equals("1") ? true : false); |
| | | confirmOrderVo.setUseSimultaneously(baseSetting.getContent().equals("1")); |
| | | int earnPoint = goodsList.stream().mapToInt(MyShoppingCartVo::getEarnSpendingPoints).sum(); |
| | | confirmOrderVo.setEarnPoint(earnPoint); |
| | | //支付金额,订单金额-订单优惠 |
| | |
| | | order.setPaymentAmount(paymentMoney); |
| | | order.setPoint(orderPoint); |
| | | order.setPayMethod(shoppingCartPayment.getPaymentType()); |
| | | if(StringUtils.isNotEmpty(shoppingCartPayment.getExpectedDeliveryTime())){ |
| | | order.setExpectedDeliveryTime(shoppingCartPayment.getExpectedDeliveryTime()); |
| | | } |
| | | if(3 != shoppingCartPayment.getPaymentType() && (fullReductionAmount.compareTo(BigDecimal.ZERO) > 0 ||moneyAmount.compareTo(BigDecimal.ZERO) > 0 || discountAmount.compareTo(BigDecimal.ZERO) > 0)){ |
| | | order.setCouponJson(JSON.toJSONString(couponInfoVo)); |
| | | } |
| | |
| | | * @Date 2024/11/25 11:51 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @ApiModel("购物车") |
| | | public class MyShoppingCartVo { |
| | | @ApiModelProperty("数据id") |
| | | private Long id; |
| | |
| | | private Integer distributionMode; |
| | | @ApiModelProperty(value = "配送地址id", required = false) |
| | | private Integer userAddressId; |
| | | @ApiModelProperty(value = "预计提货时间", required = false) |
| | | private String expectedDeliveryTime; |
| | | } |
| | |
| | | import com.ruoyi.other.service.BannerService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Banner; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.service.CouponInfoService; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.service.CouponInfoService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | import com.ruoyi.other.api.domain.GoodsCategory; |
| | | import com.ruoyi.other.service.GoodsCategoryService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.GoodsCategory; |
| | | import com.ruoyi.other.service.GoodsCategoryService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | |
| | | */ |
| | | @GetMapping("/goodsList") |
| | | @ApiOperation(value = "商品列表", tags = {"小程序-商城-首页-热门商品列表", "首页热门商品-小程序"}) |
| | | public R<List<GoodsVO>> goodsList(Goods goods){ |
| | | public R<TableDataInfo> goodsList(Goods goods){ |
| | | startPage(); |
| | | return R.ok(goodsService.goodsList(goods)); |
| | | return R.ok(getDataTable(goodsService.goodsList(goods))); |
| | | } |
| | | |
| | | |
| | |
| | | * 查询指定门店手机号 |
| | | */ |
| | | @GetMapping("/selectPhoneByShopId") |
| | | @ApiOperation(value = "查询指定门店手机号", tags = {"小程序-门店详情"}) |
| | | @ApiOperation(value = "查询指定门店手机号", tags = {"小程序-门店详情-查询客服电话"}) |
| | | public R<List<Phone>> getPhoneByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { |
| | | return R.ok(phoneService.list(new LambdaQueryWrapper<Phone>() |
| | | .eq(Phone::getType, PhoneType.SHOP.getCode()) |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.other.api.domain.PointSetting; |
| | | import com.ruoyi.other.service.PointSettingService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/point-setting") |
| | | public class PointSettingController { |
| | | public class PointSettingController extends BaseController { |
| | | |
| | | @Resource |
| | | private PointSettingService pointSettingService; |
| | | |
| | | @GetMapping("/getBaseSetting") |
| | | public R<PointSetting> getBaseSetting(@RequestParam Integer id) { |
| | | PointSetting pointSetting = pointSettingService.getById(id); |
| | | return R.ok(pointSetting); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.GoodsSeckill; |
| | | import com.ruoyi.other.api.domain.SeckillActivityInfo; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.time.temporal.TemporalUnit; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "秒杀活动列表",tags = {"小程序-商城-首页-秒杀活动列表"}) |
| | | public R<List<SeckillActivityVO>> list(Goods goods) |
| | | public R<TableDataInfo> list(Goods goods) |
| | | { |
| | | startPage(); |
| | | return R.ok(seckillActivityInfoService.listSeckillActivity(goods)); |
| | | return R.ok(getDataTable(seckillActivityInfoService.listSeckillActivity(goods))); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.domain.ShopScore; |
| | | import com.ruoyi.other.api.domain.Technician; |
| | | import com.ruoyi.other.enums.ShopStatus; |
| | | import com.ruoyi.other.service.ShopScoreService; |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.service.TechnicianService; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | import com.ruoyi.other.vo.VerifiableShopVo; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | import com.ruoyi.other.vo.VerifiableShopVo; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private ShopService shopService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private ShopScoreService shopScoreService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | @PostMapping("/getDetailById") |
| | |
| | | */ |
| | | @GetMapping("/nearbyShopList") |
| | | @ApiOperation(value = "附近门店列表", tags = {"小程序-首页-附近门店列表"}) |
| | | public R<List<NearbyShopVO>> nearbyShopList(@ApiParam("经度") @RequestParam String longitude, |
| | | @ApiParam("纬度") @RequestParam String latitude) { |
| | | public R<List<NearbyShopVO>> nearbyShopList(@ApiParam("经度") @RequestParam BigDecimal longitude, |
| | | @ApiParam("纬度") @RequestParam BigDecimal latitude) { |
| | | return R.ok(shopService.nearbyShopList(longitude, latitude)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/shopDetail") |
| | | @ApiOperation(value = "门店详情", tags = {"小程序-首页-门店详情"}) |
| | | public R<ShopDetailVO> shopDetail(@ApiParam("门店id") @RequestParam Integer shopId, |
| | | @ApiParam("经度") @RequestParam String longitude, |
| | | @ApiParam("纬度") @RequestParam String latitude) { |
| | | @ApiParam("经度") @RequestParam BigDecimal longitude, |
| | | @ApiParam("纬度") @RequestParam BigDecimal latitude) { |
| | | return R.ok(shopService.getShopDetail(shopId, longitude, latitude)); |
| | | } |
| | | |
| | |
| | | public R<Void> bindShop(@ApiParam("门店id") @RequestParam Long shopId) { |
| | | AppUser appUser = appUserClient.getAppUserById(SecurityUtils.getUserId()); |
| | | appUser.setShopId(shopId); |
| | | appUserClient.editAppUserById(appUser); |
| | | return appUserClient.editAppUserById(appUser); |
| | | } |
| | | |
| | | /** |
| | | * 门店打分 |
| | | * @return |
| | | */ |
| | | @PostMapping("/shopScore") |
| | | @ApiOperation(value = "门店打分", tags = {"小程序-个人中心-门店打分"}) |
| | | public R<Void> shopScore(@RequestBody ShopScore shopScore) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | shopScore.setAppUserId(loginUserApplet.getUserid()); |
| | | shopScore.setCreateTime(LocalDateTime.now()); |
| | | shopScoreService.save(shopScore); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.other.api.dto.StartPageSetDto; |
| | | import com.ruoyi.other.service.SystemConfigService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | return R.ok(one); |
| | | } |
| | | |
| | | @PostMapping("/index/start") |
| | | @GetMapping("/index/start") |
| | | @ApiOperation(value = "宣传图片-公司简介", tags = {"小程序-启动页"}) |
| | | public R<StartPageSetDto> indexstart(){ |
| | | SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 1).one(); |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.GoodsEvaluate; |
| | | import com.ruoyi.other.api.domain.Technician; |
| | | import com.ruoyi.other.api.domain.TechnicianSubscribe; |
| | | import com.ruoyi.other.api.feignClient.OrderClient; |
| | | import com.ruoyi.other.service.GoodsEvaluateService; |
| | | import com.ruoyi.other.service.TechnicianService; |
| | | import com.ruoyi.other.service.TechnicianSubscribeService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.other.service.TechnicianService; |
| | | |
| | | import com.ruoyi.other.vo.TechnicianDetailVO; |
| | | import com.ruoyi.other.vo.TechnicianVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | |
| | | import com.ruoyi.other.api.domain.TechnicianSubscribe; |
| | | import com.ruoyi.other.service.TechnicianSubscribeService; |
| | | import com.ruoyi.other.vo.TechnicianSubscribeVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "预约列表", notes = "预约列表", tags = {"小程序-个人中心-门店管理-预约列表"}) |
| | | public TableDataInfo list(@ApiParam(value = "状态") @RequestParam Integer status, |
| | | public TableDataInfo<TechnicianSubscribeVO> list(@ApiParam(value = "状态") @RequestParam Integer status, |
| | | @ApiParam(value = "门店id") @RequestParam Long shopId) { |
| | | startPage(); |
| | | List<TechnicianSubscribeVO> list = technicianSubscribeService |
| | |
| | | |
| | | |
| | | @GetMapping("/home/list") |
| | | @ApiOperation(value = "列表", notes = "列表", tags = {"小程序-个人中心-我的预约"}) |
| | | public TableDataInfo homelist(@ApiParam(value = "状态 0=待服务,1=已服务,2=已取消 4 已到期") Integer status) { |
| | | startPage(); |
| | | List<TechnicianSubscribeVO> list = technicianSubscribeService |
| | | .getTechnicianSubscribeByUser(SecurityUtils.getUserId(), status); |
| | | return getDataTable(list); |
| | | @ApiOperation(value = "列表", notes = "获取用户预约列表", tags = {"小程序-个人中心-我的预约"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "status", value = "状态 0=待服务,1=已服务,2=已取消, 4=已到期", required = true, dataType = "Integer", paramType = "query"), |
| | | @ApiImplicitParam(name = "current", value = "当前页码,从1开始", required = true, dataType = "Integer", paramType = "query"), |
| | | @ApiImplicitParam(name = "size", value = "每页显示数量,默认10", dataType = "Integer", paramType = "query") |
| | | }) |
| | | public R<IPage<TechnicianSubscribeVO>> homelist(@RequestParam(value = "status", required = false) @ApiParam(value = "状态 0=待服务,1=已服务,2=已取消 4 已到期") Integer status, |
| | | @ApiParam(hidden = true) Page<TechnicianSubscribe> page) { |
| | | return R.ok(technicianSubscribeService.getTechnicianSubscribeByUser(page, SecurityUtils.getUserId(), status)); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.VipGood; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.service.VipGoodService; |
| | | import com.ruoyi.other.service.VipSettingService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.service.VipSettingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private VipGoodService vipGoodService; |
| | | |
| | | @PostMapping("/info") |
| | | @ApiOperation(value = "获取各级会员信息", tags = {"小程序-个人中心首页","小程序-会员中心"}) |
| | | public R<List<VipSetting>> info(){ |
| | | @GetMapping("/info") |
| | | @ApiOperation(value = "获取各级会员信息", tags = {"小程序-个人中心首页", "小程序-会员中心"}) |
| | | public R<List<VipSetting>> info() { |
| | | List<VipSetting> list = vipSettingService.list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @PostMapping("/button/agent/check") |
| | | @ApiOperation(value = "准代理,代理按钮是否展示", tags = {"小程序-个人中心首页","小程序-会员中心"}) |
| | | public R<Boolean> buttoncheck(@ApiParam("4准代理,5代理")Integer id){ |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser appUserById = appUserClient.getAppUserById(userid); |
| | | Boolean back = true; |
| | | VipSetting byId = vipSettingService.getById(id); |
| | | //第一种判断 |
| | | if (byId == null) { |
| | | back = false; |
| | | }else { |
| | | if (byId.getVipAgentLevelUpRole() == null || byId.getVipAgentLevelUpRole() == 0) { |
| | | back = false; |
| | | } |
| | | if (byId.getVipLevelUpShop() == null || byId.getVipLevelUpShare() == null) { |
| | | back = false; |
| | | } else { |
| | | if (back && appUserById.getShopPoint().compareTo(byId.getVipLevelUpShop()) > 0 && appUserById.getSharePoint().compareTo(byId.getVipLevelUpShare()) > 0) { |
| | | back = true; |
| | | } |
| | | } |
| | | if (back) { |
| | | return R.ok(true); |
| | | } |
| | | //第二种判断 |
| | | if (byId.getVipDirectVipRole()== null || byId.getVipDirectVipRole() == 0||byId.getVipDirectVipNum() == null) { |
| | | back = false; |
| | | }else { |
| | | //拿到当前用户直推钻石会员人数 |
| | | Long data = appUserClient.getVipCount(userid, 3).getData(); |
| | | if (data>=byId.getVipDirectVipNum()){ |
| | | return R.ok(true); |
| | | } |
| | | } |
| | | //第三种判断 |
| | | List<VipGood> list = vipGoodService.lambdaQuery().eq(VipGood::getVipId, id).list(); |
| | | for (VipGood vipGood : list) { |
| | | //挨个判断是否购买商品 |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | // @PostMapping("/button/agent/check") |
| | | // @ApiOperation(value = "准代理,代理按钮是否展示", tags = {"小程序-个人中心首页","小程序-会员中心"}) |
| | | // public R<Boolean> buttoncheck(@ApiParam("4准代理,5代理")Integer id) { |
| | | // Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | // AppUser appUserById = appUserClient.getAppUserById(userid); |
| | | // Boolean back = true; |
| | | // VipSetting byId = vipSettingService.getById(id); |
| | | // //第一种判断 |
| | | // if (byId == null) { |
| | | // back = false; |
| | | // } else { |
| | | // if (byId.getVipAgentLevelUpRole() == null || byId.getVipAgentLevelUpRole() == 0) { |
| | | // back = false; |
| | | // } |
| | | // if (byId.getVipLevelUpShop() == null || byId.getVipLevelUpShare() == null) { |
| | | // back = false; |
| | | // } else { |
| | | // if (back && appUserById.getShopPoint().compareTo(byId.getVipLevelUpShop()) > 0 && appUserById.getSharePoint().compareTo(byId.getVipLevelUpShare()) > 0) { |
| | | // back = true; |
| | | // } |
| | | // } |
| | | // if (back) { |
| | | // return R.ok(true); |
| | | // } |
| | | // //第二种判断 |
| | | // if (byId.getVipDirectVipRole() == null || byId.getVipDirectVipRole() == 0 || byId.getVipDirectVipNum() == null) { |
| | | // back = false; |
| | | // } else { |
| | | // //拿到当前用户直推钻石会员人数 |
| | | // Long data = appUserClient.getVipCount(userid, 3).getData(); |
| | | // if (data >= byId.getVipDirectVipNum()) { |
| | | // return R.ok(true); |
| | | // } |
| | | // } |
| | | // //第三种判断 |
| | | // List<VipGood> list = vipGoodService.lambdaQuery().eq(VipGood::getVipId, id).list(); |
| | | // for (VipGood vipGood : list) { |
| | | // //挨个判断是否购买商品 |
| | | // |
| | | // |
| | | // } |
| | | // } |
| | | // |
| | | // return R.ok(); |
| | | // } |
| | | |
| | | |
| | | @GetMapping("getVipSettingById") |
| | | @ApiOperation(value = "获取会员设置") |
| | | public R<VipSetting> getVipSettingById(@ApiParam(value = "会员id") @RequestParam Integer id){ |
| | | public R<VipSetting> getVipSettingById(@ApiParam(value = "会员id") @RequestParam Integer id) { |
| | | return R.ok(vipSettingService.getById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface ShopMapper extends BaseMapper<Shop> { |
| | | |
| | | List<NearbyShopVO> selectNearbyShopList(@Param("longitude") String longitude,@Param("latitude") String latitude); |
| | | List<NearbyShopVO> selectNearbyShopList(@Param("longitude") BigDecimal longitude,@Param("latitude") BigDecimal latitude); |
| | | |
| | | ShopDetailVO selectShopDetail(Integer shopId); |
| | | |
New file |
| | |
| | | package com.ruoyi.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.other.api.domain.ShopScore; |
| | | |
| | | public interface ShopScoreMapper extends BaseMapper<ShopScore> { |
| | | } |
| | |
| | | package com.ruoyi.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.other.api.domain.TechnicianSubscribe; |
| | | import com.ruoyi.other.vo.TechnicianSubscribeVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | */ |
| | | public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(@Param("userId") Long userId, |
| | | @Param("shopId") Long shopId); |
| | | public List<TechnicianSubscribeVO> getTechnicianSubscribeByUser(@Param("userId") Long userId, |
| | | @Param("status") Integer status); |
| | | IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(@Param("page") Page<TechnicianSubscribe> page, @Param("userId") Long userId, |
| | | @Param("status") Integer status); |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.ShopScore; |
| | | |
| | | public interface ShopScoreService extends IService<ShopScore> { |
| | | } |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface ShopService extends IService<Shop> { |
| | | |
| | | List<NearbyShopVO> nearbyShopList(String longitude, String latitude); |
| | | List<NearbyShopVO> nearbyShopList(BigDecimal longitude, BigDecimal latitude); |
| | | |
| | | ShopDetailVO getShopDetail(Integer shopId,String longitude, String latitude); |
| | | ShopDetailVO getShopDetail(Integer shopId, BigDecimal longitude, BigDecimal latitude); |
| | | } |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.TechnicianSubscribe; |
| | | import com.ruoyi.other.vo.TechnicianSubscribeVO; |
| | |
| | | */ |
| | | List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long userId, Long shopId); |
| | | |
| | | List<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Long userId, Integer status); |
| | | IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Page<TechnicianSubscribe> page, Long userId, Integer status); |
| | | |
| | | void subscribe(TechnicianSubscribe technicianSubscribe, Long technicianId); |
| | | } |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
New file |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.other.api.domain.ShopScore; |
| | | import com.ruoyi.other.mapper.ShopScoreMapper; |
| | | import com.ruoyi.other.service.ShopScoreService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class ShopScoreServiceImpl extends ServiceImpl<ShopScoreMapper, ShopScore> implements ShopScoreService { |
| | | } |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.GeodesyUtil; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.mapper.GoodsMapper; |
| | | import com.ruoyi.other.api.domain.ShopScore; |
| | | import com.ruoyi.other.mapper.ShopMapper; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.service.ShopScoreService; |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.NoSuchElementException; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements ShopService { |
| | | @Resource |
| | | private ShopMapper shopMapper; |
| | | @Resource |
| | | private ShopScoreService shopScoreService; |
| | | |
| | | @Override |
| | | public List<NearbyShopVO> nearbyShopList(String longitude, String latitude) { |
| | | return shopMapper.selectNearbyShopList(longitude,latitude); |
| | | public List<NearbyShopVO> nearbyShopList(BigDecimal longitude, BigDecimal latitude) { |
| | | List<NearbyShopVO> nearbyShopVOS = shopMapper.selectNearbyShopList(longitude, longitude); |
| | | if (nearbyShopVOS == null || nearbyShopVOS.isEmpty()) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | List<Long> shopIds = nearbyShopVOS.stream().map(NearbyShopVO::getId).collect(Collectors.toList()); |
| | | List<ShopScore> shopScores = shopScoreService.list(new LambdaQueryWrapper<ShopScore>().in(ShopScore::getShopId, shopIds)); |
| | | if (shopScores == null || shopScores.isEmpty()) { |
| | | return nearbyShopVOS; |
| | | } |
| | | |
| | | Map<Long, List<ShopScore>> shopScoreMap = shopScores.stream().collect(Collectors.groupingBy(ShopScore::getShopId)); |
| | | |
| | | nearbyShopVOS.forEach(nearbyShopVO -> { |
| | | List<ShopScore> scores = shopScoreMap.get(nearbyShopVO.getId()); |
| | | if (scores != null && !scores.isEmpty()){ |
| | | BigDecimal score = scores.stream() |
| | | .map(ShopScore::getScore) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .divide(new BigDecimal(scores.size()), 1, RoundingMode.HALF_UP); |
| | | nearbyShopVO.setScore(score.toString()); |
| | | } |
| | | }); |
| | | return nearbyShopVOS; |
| | | } |
| | | |
| | | @Override |
| | | public ShopDetailVO getShopDetail(Integer shopId, String longitude, String latitude) { |
| | | public ShopDetailVO getShopDetail(Integer shopId, BigDecimal longitude, BigDecimal latitude) { |
| | | // 查询店铺详情 |
| | | ShopDetailVO shopDetailVO = shopMapper.selectShopDetail(shopId); |
| | | if (shopDetailVO == null) { |
| | |
| | | } |
| | | |
| | | // 计算距离 |
| | | String shopLocation = String.format("%s,%s", shopDetailVO.getLongitude(), shopDetailVO.getLatitude()); |
| | | String userLocation = String.format("%s,%s", longitude, latitude); |
| | | Map<String, Double> distanceMap = GeodesyUtil.getDistance(userLocation, shopLocation); |
| | | Double wGs84 = distanceMap.get("WGs84"); |
| | | shopDetailVO.setDistance(wGs84); |
| | | if (shopDetailVO.getLongitude() != null && shopDetailVO.getLatitude() != null){ |
| | | String shopLocation = String.format("%s,%s", shopDetailVO.getLongitude(), shopDetailVO.getLatitude()); |
| | | String userLocation = String.format("%s,%s", longitude.toString(), latitude.toString()); |
| | | Map<String, Double> distanceMap = GeodesyUtil.getDistance(userLocation, shopLocation); |
| | | Double wGs84 = distanceMap.get("WGS84"); |
| | | shopDetailVO.setDistance(wGs84); |
| | | } |
| | | return shopDetailVO; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.redis.annotation.DistributedLock; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.domain.TechnicianSubscribe; |
| | | import com.ruoyi.other.enums.TechnicianErrorCode; |
| | | import com.ruoyi.other.enums.TechnicianStatus; |
| | | import com.ruoyi.other.mapper.TechnicianMapper; |
| | | import com.ruoyi.other.mapper.TechnicianSubscribeMapper; |
| | |
| | | return technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(userId, shopId); |
| | | } |
| | | @Override |
| | | public List<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Long userId, Integer status) { |
| | | return technicianSubscribeMapper.getTechnicianSubscribeByUser(userId, status); |
| | | public IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Page<TechnicianSubscribe> page, Long userId, Integer status) { |
| | | return technicianSubscribeMapper.getTechnicianSubscribeByUser(page, userId, status); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public class NearbyShopVO { |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer id; |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "封面图片") |
| | | private String homePicture; |
| | |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "距离") |
| | | private String distance; |
| | | |
| | | @ApiModelProperty(value = "评分") |
| | | private String score; |
| | | } |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class SeckillActivityVO { |
| | |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Integer startTime; |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endTime; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "资质证书图片") |
| | | private String certification; |
| | | |
| | | @ApiModelProperty(value = "营业星期(1,2,3,4,5,6,7)") |
| | | private String businessDate; |
| | | @ApiModelProperty(value = "营业星期:1-周一到周日 2-周一周五 3-仅周末") |
| | | private Long businessDate; |
| | | |
| | | @ApiModelProperty(value = "开始时间(HH:mm)") |
| | | private String startTime; |
| | |
| | | private Double distance; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | private String longitude; |
| | | private BigDecimal longitude; |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | private String latitude; |
| | | private BigDecimal latitude; |
| | | } |
| | |
| | | ts.business_date, |
| | | ts.start_time, |
| | | ts.end_time, |
| | | ts.longitude, |
| | | ts.latitude, |
| | | AVG( tss.score ) score |
| | | FROM |
| | | t_shop ts |
| | |
| | | WHERE |
| | | ts.del_flag = 0 |
| | | AND ts.`status` = 1 |
| | | AND id = #{id} |
| | | AND ts.id = #{id} |
| | | GROUP BY |
| | | ts.id, |
| | | ts.details_picture, |
| | |
| | | ts.address, |
| | | ts.business_date, |
| | | ts.start_time, |
| | | ts.end_time |
| | | ts.end_time, |
| | | ts.longitude, |
| | | ts.latitude |
| | | </select> |
| | | </mapper> |
| | |
| | | tts.subscribe_time, |
| | | tts.service_mode, |
| | | CASE |
| | | WHEN tts.subscribe_time lt; NOW() THEN 4 |
| | | WHEN tts.subscribe_time <![CDATA[<]]> NOW() THEN 4 |
| | | ELSE tts.status |
| | | END AS status |
| | | FROM |