From 559ee10df3622e4802ca5664b83b713cd3a75f97 Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期一, 25 十一月 2024 11:42:40 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/WithdrawalRequestsService.java | 5 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/WithdrawalRequestsDTO.java | 24 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java | 78 ++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/GoodsStatus.java | 22 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/LoginVo.java | 24 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java | 4 ruoyi-api/ruoyi-api-order/src/main/java/factory/RemoteOrderFallbackFactory.java | 19 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java | 27 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java | 42 + ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java | 76 ++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java | 11 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianSubscribeVO.java | 54 + ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml | 8 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShareService.java | 1 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java | 11 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java | 10 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java | 53 + ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java | 6 ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml | 8 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/SMSCode.java | 18 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java | 2 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/WithdrawalRequestsServiceImpl.java | 12 ruoyi-api/ruoyi-api-order/src/main/java/model/OrderGood.java | 4 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java | 16 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShareAddType.java | 19 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShareServiceImpl.java | 1 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/NearbyReferrerVo.java | 26 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java | 18 ruoyi-api/ruoyi-api-order/src/main/java/factory/RemoteOrderGoodsFallbackFactory.java | 23 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShoppingCartController.java | 11 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java | 10 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java | 4 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Technician.java | 4 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderGoodService.java | 1 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/WalletChangeVO.java | 24 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/SeckillActivityInfoMapper.java | 8 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/RegisterAccount.java | 24 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java | 72 ++ ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/WalletVO.java | 33 + ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShoppingCartMapper.xml | 8 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShoppingCartService.java | 7 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShoppingCart.java | 27 ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/BaseTable.java | 19 ruoyi-api/ruoyi-api-order/src/main/java/feignClient/RemoteOrderGoodsClient.java | 24 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java | 24 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/Home.java | 103 +++ ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java | 38 + ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/MobileLogin.java | 18 ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml | 46 + ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java | 23 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java | 11 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java | 6 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java | 10 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java | 11 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SeckillActivityInfoController.java | 36 + ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/NearbyReferrer.java | 22 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/BalanceChangeRecordMapper.java | 7 ruoyi-service/ruoyi-account/src/main/resources/mapping/BalanceChangeRecordMapper.xml | 5 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java | 10 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShoppingCartServiceImpl.java | 11 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WithdrawalRequestsController.java | 23 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PersonalCenterController.java | 24 ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml | 5 ruoyi-api/ruoyi-api-order/src/main/java/feignClient/RemoteOrderClient.java | 17 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java | 52 + ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/BalanceChangeRecordService.java | 7 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShareAuditStatus.java | 23 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityVO.java | 38 + ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java | 4 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/BalanceChangeRecord.java | 50 + ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/SeckillActivityInfoService.java | 8 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java | 62 ++ ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml | 27 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderGoodController.java | 25 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java | 37 + ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShopStatus.java | 18 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShoppingCartMapper.java | 7 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java | 46 + 78 files changed, 1,715 insertions(+), 37 deletions(-) diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java index a754d8b..32caa3c 100644 --- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java @@ -2,6 +2,7 @@ import com.ruoyi.account.api.feignClient.AppUserClient; import com.ruoyi.account.api.model.AppUser; +import com.ruoyi.common.core.domain.R; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.openfeign.FallbackFactory; @@ -20,10 +21,16 @@ return new AppUserClient() { @Override public AppUser getAppUserById(Long id) { - log.error("根据id获取用户失败:" + cause.getMessage()); + log.error("根据id获取用户失败:{}", cause.getMessage()); throw new RuntimeException("根据id获取用户失败"); } - + + @Override + public R<Void> editAppUserById(AppUser appUser) { + log.error("编辑用户信息失败:{}", cause.getMessage()); + throw new RuntimeException("编辑用户信息失败"); + } + }; } } diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java index 1d94198..e8178d7 100644 --- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java @@ -3,6 +3,7 @@ import com.ruoyi.account.api.factory.AppUserClientFallbackFactory; import com.ruoyi.account.api.model.AppUser; 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.PostMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -13,7 +14,7 @@ */ @FeignClient(contextId = "AppUserClient", value = ServiceNameConstants.ACCOUNT_SERVICE, fallbackFactory = AppUserClientFallbackFactory.class) public interface AppUserClient { - + /** * 根据id获取用户 * @param id @@ -21,5 +22,10 @@ */ @PostMapping("/appUser/getAppUserById") AppUser getAppUserById(@RequestParam("id") Long id); - + + /** + * 根据id编辑用户 + */ + @PostMapping("/appUser/editAppUserById") + R<Void> editAppUserById(@RequestParam("appUser") AppUser appUser); } diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java index 0837295..3e54505 100644 --- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java @@ -82,9 +82,9 @@ @TableField("invite_user_id") private Long inviteUserId; - @ApiModelProperty(value = "拥有门店id") + @ApiModelProperty(value = "绑定门店id") @TableField("shop_id") - private Integer shopId; + private Long shopId; @ApiModelProperty(value = "合伙人积分数") @TableField("part_point") @@ -110,5 +110,24 @@ @TableField("last_shop_time") private LocalDateTime lastShopTime; + @ApiModelProperty(value = "可提现金额") + @TableField("withdrawable_amount") + private BigDecimal withdrawal_amount; + + @ApiModelProperty(value = "已提现金额") + @TableField("withdrawn_amount") + private BigDecimal withdrawn_amount; + + @ApiModelProperty(value = "充值总金额") + @TableField("total_recharge_amount") + private BigDecimal total_recharge_amount; + + @ApiModelProperty(value = "红包总金额") + @TableField("total_red_packet_amount") + private BigDecimal total_red_packet_amount; + + @ApiModelProperty(value = "分销总金额") + @TableField("total_distribution_amount") + private BigDecimal total_distribution_amount; } diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/BalanceChangeRecord.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/BalanceChangeRecord.java new file mode 100644 index 0000000..8de1bfd --- /dev/null +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/BalanceChangeRecord.java @@ -0,0 +1,50 @@ +package com.ruoyi.account.api.model; + +import com.baomidou.mybatisplus.annotation.IdType; +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; +import java.util.Date; + +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("t_balance_change_record") +@ApiModel(value = "变更记录对象", description = "") +public class BalanceChangeRecord implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId + private Long id; + + @ApiModelProperty("用户id") + private Long appUserId; + + @ApiModelProperty("订单id") + private Long orderId; + + @ApiModelProperty("类型:1充值2提现3红包4分佣5商城购物") + private Integer type; + + @ApiModelProperty("变更前金额") + private BigDecimal beforeAmount; + + @ApiModelProperty("变更金额") + private BigDecimal changeAmount; + + @ApiModelProperty("变更后金额") + private BigDecimal afterAmount; + + @ApiModelProperty("删除(0=否,1=是") + private Integer delFlag; + + @ApiModelProperty("添加时间") + private LocalDateTime createTime; +} diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/factory/RemoteOrderFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/factory/RemoteOrderFallbackFactory.java new file mode 100644 index 0000000..031b643 --- /dev/null +++ b/ruoyi-api/ruoyi-api-order/src/main/java/factory/RemoteOrderFallbackFactory.java @@ -0,0 +1,19 @@ +package factory; + +import feignClient.RemoteOrderClient; +import org.springframework.cloud.openfeign.FallbackFactory; +import org.springframework.stereotype.Component; + +/** + * 订单服务降级处理 + * @author luofl + */ +@Component +public class RemoteOrderFallbackFactory implements FallbackFactory<RemoteOrderClient> { + + @Override + public RemoteOrderClient create(Throwable cause) { + return new RemoteOrderClient() { + }; + } +} diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/factory/RemoteOrderGoodsFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/factory/RemoteOrderGoodsFallbackFactory.java new file mode 100644 index 0000000..d270ee6 --- /dev/null +++ b/ruoyi-api/ruoyi-api-order/src/main/java/factory/RemoteOrderGoodsFallbackFactory.java @@ -0,0 +1,23 @@ +package factory; + +import com.ruoyi.common.core.domain.R; +import feignClient.RemoteOrderGoodsClient; +import lombok.extern.slf4j.Slf4j; +import model.OrderGood; +import org.springframework.cloud.openfeign.FallbackFactory; + +import java.util.List; + +@Slf4j +public class RemoteOrderGoodsFallbackFactory implements FallbackFactory<RemoteOrderGoodsClient> { + @Override + public RemoteOrderGoodsClient create(Throwable cause) { + return new RemoteOrderGoodsClient(){ + @Override + public R<List<OrderGood>> goodsOrder(List<Long> goodsIds) { + log.error("编辑用户信息失败:{}", cause.getMessage()); + throw new RuntimeException("编辑用户信息失败"); + } + }; + } +} diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/feignClient/RemoteOrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/feignClient/RemoteOrderClient.java new file mode 100644 index 0000000..362df6f --- /dev/null +++ b/ruoyi-api/ruoyi-api-order/src/main/java/feignClient/RemoteOrderClient.java @@ -0,0 +1,17 @@ +package feignClient; + +import com.ruoyi.common.core.constant.ServiceNameConstants; +import com.ruoyi.common.core.domain.R; +import factory.RemoteOrderFallbackFactory; +import model.Order; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * 订单远程调用接口 + * @author luofl + */ +@FeignClient(contextId = "RemoteOrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = RemoteOrderFallbackFactory.class) +public interface RemoteOrderClient { +} diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/feignClient/RemoteOrderGoodsClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/feignClient/RemoteOrderGoodsClient.java new file mode 100644 index 0000000..12ff392 --- /dev/null +++ b/ruoyi-api/ruoyi-api-order/src/main/java/feignClient/RemoteOrderGoodsClient.java @@ -0,0 +1,24 @@ +package feignClient; + + +import com.ruoyi.common.core.constant.ServiceNameConstants; +import com.ruoyi.common.core.domain.R; +import factory.RemoteOrderGoodsFallbackFactory; +import model.OrderGood; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +@FeignClient(contextId = "RemoteOrderGoodsClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = RemoteOrderGoodsFallbackFactory.class) +public interface RemoteOrderGoodsClient { + + /** + * 查询指定商品订单 + */ + @PostMapping("/order-good/selectGoodsOrder") + public R<List<OrderGood>> goodsOrder(@RequestBody List<Long> goodsIds); +} diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/model/OrderGood.java b/ruoyi-api/ruoyi-api-order/src/main/java/model/OrderGood.java index 4bb6975..98aebed 100644 --- a/ruoyi-api/ruoyi-api-order/src/main/java/model/OrderGood.java +++ b/ruoyi-api/ruoyi-api-order/src/main/java/model/OrderGood.java @@ -28,6 +28,10 @@ @TableId(value = "id", type = IdType.AUTO) private Long id; + @ApiModelProperty(value = "商品id") + @TableField("goods_id") + private Long goodsId; + @ApiModelProperty(value = "订单id") @TableField("order_id") private Integer orderId; diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java index 692bf5d..a41a2d3 100644 --- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java @@ -28,7 +28,7 @@ @ApiModelProperty(value = "主键") @TableId(value = "id", type = IdType.AUTO) - private Integer id; + private Long id; @ApiModelProperty(value = "名称") @TableField("name") @@ -98,6 +98,10 @@ @TableField("integral") private Integer integral; + @ApiModelProperty(value = "销量") + @TableField("sale_num") + private Integer saleNum; + @ApiModelProperty(value = "商品权限JSON(0=全部,1=游客,2=普通会员,3=黄金会员,4=钻石会员,5=准代理,6=代理,7=总代,8=合伙人)") @TableField("commodity_authority") private Integer commodityAuthority; diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java index 83dfe80..b44742a 100644 --- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java @@ -50,6 +50,14 @@ @TableField("end_time") private String endTime; + @ApiModelProperty(value = "封面图片") + @TableField("home_picture") + private String homePicture; + + @ApiModelProperty(value = "详情图,多个逗号分隔") + @TableField("details_picture") + private String detailsPicture; + @ApiModelProperty(value = "店长姓名") @TableField("shop_manager") private String shopManager; @@ -60,7 +68,7 @@ @ApiModelProperty(value = "店长用户id") @TableField("app_user_id") - private Integer appUserId; + private Long appUserId; @ApiModelProperty(value = "客户电话(同步到t_phone表)") @TableField("service_tel") @@ -146,6 +154,14 @@ @TableField("custom_order_number") private Integer customOrderNumber; + @ApiModelProperty(value = "总评分") + @TableField("score") + private Integer score; + + @ApiModelProperty(value = "评分数量") + @TableField("score_number") + private Integer scoreNumber; + @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShoppingCart.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShoppingCart.java new file mode 100644 index 0000000..410c4df --- /dev/null +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShoppingCart.java @@ -0,0 +1,27 @@ +package com.ruoyi.other.api.domain; + +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; + +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("t_shopping_cart") +@ApiModel(value = "购物车对象", description = "") +public class ShoppingCart implements Serializable { + private static final long serialVersionUID = 1L; + @ApiModelProperty("主键") + @TableId + private Long id; + @ApiModelProperty("用户id") + private Long appUserId; + @ApiModelProperty("商品id") + private Long goodsId; + @ApiModelProperty("数量") + private Integer number; +} diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Technician.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Technician.java index 73960e5..1b6834c 100644 --- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Technician.java +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Technician.java @@ -30,6 +30,10 @@ @TableId(value = "id", type = IdType.AUTO) private Integer id; + @ApiModelProperty(value = "用户id") + @TableField("app_user_id") + private Long appUserId; + @ApiModelProperty(value = "门店id") @TableField("shop_id") private Integer shopId; diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/BaseTable.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/BaseTable.java new file mode 100644 index 0000000..07059f6 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/BaseTable.java @@ -0,0 +1,19 @@ +package com.ruoyi.common.core.web.page; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhibing.pu + * @Date 2024/11/25 10:45 + */ +@Data +public class BaseTable<T> implements Serializable { + /** 总记录数 */ + private long total; + + /** 列表数据 */ + private List<T> rows; +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java index 563464b..3318a24 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java @@ -15,6 +15,13 @@ import javax.annotation.Resource; import java.util.List; +import com.ruoyi.account.vo.*; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.web.page.BaseTable; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; /** * <p> @@ -27,6 +34,71 @@ @RestController @RequestMapping("/app-user") public class AppUserController { + + + + + + + @ResponseBody + @PostMapping("/appletLogin") + @ApiOperation(value = "小程序一键登录", tags = {"登录注册-小程序"}) + public AjaxResult<LoginVo> appletLogin(@RequestBody AppletLogin appletLogin){ + // todo 待完善 pu + return AjaxResult.success(); + } + + + @ResponseBody + @PostMapping("/mobileLogin") + @ApiOperation(value = "手机号登录", tags = {"登录注册-小程序"}) + public AjaxResult<LoginVo> mobileLogin(@RequestBody MobileLogin mobileLogin){ + // todo 待完善 pu + return AjaxResult.success(); + } + + + + @ResponseBody + @PostMapping("/getSMSCode") + @ApiOperation(value = "获取短信验证码", tags = {"登录注册-小程序"}) + public AjaxResult getSMSCode(@RequestBody SMSCode smsCode){ + // todo 待完善 pu + return AjaxResult.success(); + } + + + + @ResponseBody + @PostMapping("/registerAccount") + @ApiOperation(value = "注册新账号", tags = {"登录注册-小程序"}) + public AjaxResult<LoginVo> registerAccount(@RequestBody RegisterAccount registerAccount){ + // todo 待完善 pu + return AjaxResult.success(); + } + + + @ResponseBody + @GetMapping("/getReferrer/{id}") + @ApiOperation(value = "获取推荐人信息", tags = {"登录注册-小程序"}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "推荐人id", required = true, dataType = "long") + }) + public AjaxResult<String> getReferrer(@PathVariable("id") Long id){ + // todo 待完善 pu + return AjaxResult.success(); + } + + + + @ResponseBody + @GetMapping("/getNearbyReferrer") + @ApiOperation(value = "获取附近推荐人列表", tags = {"登录注册-小程序"}) + public AjaxResult<BaseTable<NearbyReferrerVo>> getNearbyReferrer(NearbyReferrer nearbyReferrer){ + // todo 待完善 pu + return AjaxResult.success(); + } + @Resource private TokenService tokenService; @Resource diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java new file mode 100644 index 0000000..e6c1e7f --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java @@ -0,0 +1,62 @@ +package com.ruoyi.account.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.account.api.model.BalanceChangeRecord; +import com.ruoyi.account.service.BalanceChangeRecordService; +import com.ruoyi.account.vo.WalletVO; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.security.utils.SecurityUtils; +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 javax.annotation.Resource; + +@Api("钱包") +@RestController +@RequestMapping("wallet") +public class WalletController extends BaseController { + @Resource + private BalanceChangeRecordService balanceChangeRecordService; + + /** + * 钱包详情 + */ + @GetMapping("detail") + @ApiOperation(value = "钱包详情", notes = "钱包详情", tags = {"小程序-个人中心-我的钱包-钱包详情"}) + public AjaxResult detail() { + Long userId = SecurityUtils.getUserId(); + // TODO 查询钱包详情 + WalletVO walletVO = new WalletVO(); + return AjaxResult.success(walletVO); + } + + /** + * 变更明细 + */ + @ApiOperation(value = "变更明细", notes = "变更明细", tags = {"小程序-个人中心-我的钱包-变更记录"}) + @GetMapping("change") + public AjaxResult change() { + Long userId = SecurityUtils.getUserId(); + return AjaxResult.success(balanceChangeRecordService.list(new LambdaQueryWrapper<BalanceChangeRecord>() + .eq(BalanceChangeRecord::getAppUserId, userId))); + } + +// /** +// * 充值 +// */ +// @GetMapping("recharge") +// @ApiOperation(value = "充值", notes = "钱包充值") +// public AjaxResult recharge(@ApiParam(value = "充值金额", required = true) @RequestParam BigDecimal amount) { +// Long userId = SecurityUtils.getUserId(); +// String openId; +// // 商户号 +// String partnerTradeNo; +// // TODO 充值 +// return AjaxResult.success(); +// } + +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WithdrawalRequestsController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WithdrawalRequestsController.java index 56fdfc4..10b48d1 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WithdrawalRequestsController.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WithdrawalRequestsController.java @@ -1,8 +1,17 @@ package com.ruoyi.account.controller; +import com.ruoyi.account.dto.WithdrawalRequestsDTO; +import com.ruoyi.account.service.WithdrawalRequestsService; +import com.ruoyi.common.core.web.domain.AjaxResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; /** * <p> @@ -14,7 +23,21 @@ */ @RestController @RequestMapping("/withdrawal-requests") +@Api(tags = "提现申请") public class WithdrawalRequestsController { + @Resource + private WithdrawalRequestsService withdrawalRequestsService; + + /** + * 提现申请 + */ + @PostMapping("/withdrawalApply") + @ApiOperation(value = "提现申请", tags = {"提现申请-小程序"}) + public AjaxResult withdrawalApply(@RequestBody WithdrawalRequestsDTO params){ + withdrawalRequestsService.withdrawalApply(params); + return AjaxResult.success(); + } + } diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/WithdrawalRequestsDTO.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/WithdrawalRequestsDTO.java new file mode 100644 index 0000000..d5103e3 --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/WithdrawalRequestsDTO.java @@ -0,0 +1,24 @@ +package com.ruoyi.account.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@ApiModel(value="提现申请对象", description="") +@Data +public class WithdrawalRequestsDTO { + + @ApiModelProperty(value = "提现金额") + private BigDecimal withdrawalAmount; + + @ApiModelProperty(value = "1微信2银行卡") + private Integer withdrawalMethod; + + @ApiModelProperty(value = "开户人") + private String accountHolder; + + @ApiModelProperty(value = "银行卡号") + private String bankCardNumber; +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/BalanceChangeRecordMapper.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/BalanceChangeRecordMapper.java new file mode 100644 index 0000000..50b4149 --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/BalanceChangeRecordMapper.java @@ -0,0 +1,7 @@ +package com.ruoyi.account.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.account.api.model.BalanceChangeRecord; + +public interface BalanceChangeRecordMapper extends BaseMapper<BalanceChangeRecord> { +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/BalanceChangeRecordService.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/BalanceChangeRecordService.java new file mode 100644 index 0000000..d5e6f2a --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/BalanceChangeRecordService.java @@ -0,0 +1,7 @@ +package com.ruoyi.account.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.account.api.model.BalanceChangeRecord; + +public interface BalanceChangeRecordService extends IService<BalanceChangeRecord> { +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/WithdrawalRequestsService.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/WithdrawalRequestsService.java index 79d7d53..c0d5daf 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/WithdrawalRequestsService.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/WithdrawalRequestsService.java @@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.account.api.model.WithdrawalRequests; +import com.ruoyi.account.dto.WithdrawalRequestsDTO; /** * <p> @@ -13,4 +14,8 @@ */ public interface WithdrawalRequestsService extends IService<WithdrawalRequests> { + /** + * 提现申请 + */ + void withdrawalApply(WithdrawalRequestsDTO params); } diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java new file mode 100644 index 0000000..b59c292 --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java @@ -0,0 +1,11 @@ +package com.ruoyi.account.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.account.api.model.BalanceChangeRecord; +import com.ruoyi.account.mapper.BalanceChangeRecordMapper; +import com.ruoyi.account.service.BalanceChangeRecordService; +import org.springframework.stereotype.Service; + +@Service +public class BalanceChangeRecordServiceImpl extends ServiceImpl<BalanceChangeRecordMapper, BalanceChangeRecord> implements BalanceChangeRecordService { +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/WithdrawalRequestsServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/WithdrawalRequestsServiceImpl.java index 0d9ef69..d17cb72 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/WithdrawalRequestsServiceImpl.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/WithdrawalRequestsServiceImpl.java @@ -1,9 +1,12 @@ package com.ruoyi.account.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.account.dto.WithdrawalRequestsDTO; import com.ruoyi.account.mapper.WithdrawalRequestsMapper; import com.ruoyi.account.api.model.WithdrawalRequests; import com.ruoyi.account.service.WithdrawalRequestsService; +import com.ruoyi.common.core.utils.bean.BeanUtils; +import com.ruoyi.common.security.utils.SecurityUtils; import org.springframework.stereotype.Service; /** @@ -17,4 +20,13 @@ @Service public class WithdrawalRequestsServiceImpl extends ServiceImpl<WithdrawalRequestsMapper, WithdrawalRequests> implements WithdrawalRequestsService { + @Override + public void withdrawalApply(WithdrawalRequestsDTO params) { + WithdrawalRequests withdrawalRequests = new WithdrawalRequests(); + BeanUtils.copyBeanProp(withdrawalRequests, params); + withdrawalRequests.setDelFlag(0); + withdrawalRequests.setAppUserId(SecurityUtils.getUserId()); + withdrawalRequests.setAuditStatus(1); + save(withdrawalRequests); + } } diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/LoginVo.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/LoginVo.java new file mode 100644 index 0000000..b69d2be --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/LoginVo.java @@ -0,0 +1,24 @@ +package com.ruoyi.account.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author zhibing.pu + * @Date 2024/11/25 9:39 + */ +@Data +@ApiModel +public class LoginVo { + @ApiModelProperty("token") + private String token; + @ApiModelProperty("失效时间(秒)") + private Long failureTime; + @ApiModelProperty("跳转页面(1=首页,2=注册页)") + private Integer skipPage; + @ApiModelProperty("微信解密的手机号") + private String phone; + @ApiModelProperty("是否首次登录") + private Boolean firstTime; +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/MobileLogin.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/MobileLogin.java new file mode 100644 index 0000000..51fb446 --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/MobileLogin.java @@ -0,0 +1,18 @@ +package com.ruoyi.account.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author zhibing.pu + * @Date 2024/11/25 9:48 + */ +@Data +@ApiModel +public class MobileLogin { + @ApiModelProperty("手机号") + private String phone; + @ApiModelProperty("短信验证码") + private String code; +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/NearbyReferrer.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/NearbyReferrer.java new file mode 100644 index 0000000..2349be2 --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/NearbyReferrer.java @@ -0,0 +1,22 @@ +package com.ruoyi.account.vo; + +import com.ruoyi.common.core.web.page.BasePage; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author zhibing.pu + * @Date 2024/11/25 10:36 + */ +@Data +@ApiModel +public class NearbyReferrer extends BasePage { + @ApiModelProperty(value = "经度", required = true) + private String longitude; + @ApiModelProperty(value = "纬度", required = true) + private String latitude; + @ApiModelProperty(value = "搜索内容", required = false) + private String name; + +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/NearbyReferrerVo.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/NearbyReferrerVo.java new file mode 100644 index 0000000..7377ddb --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/NearbyReferrerVo.java @@ -0,0 +1,26 @@ +package com.ruoyi.account.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author zhibing.pu + * @Date 2024/11/25 10:42 + */ +@Data +@ApiModel +public class NearbyReferrerVo { + @ApiModelProperty("id") + private String id; + @ApiModelProperty("头像") + private String avatar; + @ApiModelProperty("姓名") + private String name; + @ApiModelProperty("会员类型名称") + private String vip; + @ApiModelProperty("距离(km)") + private BigDecimal distance; +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/RegisterAccount.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/RegisterAccount.java new file mode 100644 index 0000000..8084e52 --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/RegisterAccount.java @@ -0,0 +1,24 @@ +package com.ruoyi.account.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author zhibing.pu + * @Date 2024/11/25 10:03 + */ +@Data +@ApiModel +public class RegisterAccount { + @ApiModelProperty(value = "推广人id", required = false) + private Long promoter; + @ApiModelProperty(value = "头像", required = true) + private String avatar; + @ApiModelProperty(value = "姓名", required = true) + private String name; + @ApiModelProperty(value = "手机号", required = true) + private String phone; + @ApiModelProperty(value = "短信验证码", required = true) + private String code; +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/SMSCode.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/SMSCode.java new file mode 100644 index 0000000..42b193c --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/SMSCode.java @@ -0,0 +1,18 @@ +package com.ruoyi.account.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author zhibing.pu + * @Date 2024/11/25 9:53 + */ +@Data +@ApiModel +public class SMSCode { + @ApiModelProperty("类型(1=登录注册)") + private Integer type; + @ApiModelProperty("手机号") + private String phone; +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/WalletVO.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/WalletVO.java new file mode 100644 index 0000000..1b4fc74 --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/WalletVO.java @@ -0,0 +1,33 @@ +package com.ruoyi.account.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +@ApiModel(value="钱包对象", description="") +public class WalletVO { + + @ApiModelProperty(value = "可提现金额") + private BigDecimal withdrawal_amount; + + @ApiModelProperty(value = "已提现金额") + private BigDecimal withdrawn_amount; + + @ApiModelProperty(value = "最低提现门槛") + private BigDecimal vipWithdrawalMinAmount; + + @ApiModelProperty(value = "提现审核中金额") + private BigDecimal audit_amount; + + @ApiModelProperty(value = "充值总金额") + private BigDecimal total_recharge_amount; + + @ApiModelProperty(value = "红包总金额") + private BigDecimal total_red_packet_amount; + + @ApiModelProperty(value = "分销总金额") + private BigDecimal total_distribution_amount; +} diff --git a/ruoyi-service/ruoyi-account/src/main/resources/mapping/BalanceChangeRecordMapper.xml b/ruoyi-service/ruoyi-account/src/main/resources/mapping/BalanceChangeRecordMapper.xml new file mode 100644 index 0000000..7364121 --- /dev/null +++ b/ruoyi-service/ruoyi-account/src/main/resources/mapping/BalanceChangeRecordMapper.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.account.mapper.BalanceChangeRecordMapper"> + +</mapper> diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java index 47d3788..a15a2b2 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java @@ -1,8 +1,18 @@ package com.ruoyi.order.controller; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.order.service.OrderService; +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.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; /** * <p> @@ -12,9 +22,37 @@ * @author luodangjia * @since 2024-11-21 */ +@Api("订单") @RestController @RequestMapping("/order") public class OrderController { + @Resource + private OrderService orderService; + + + /** + * 扫码校验 + */ + @ApiOperation(value = "扫码校验", tags = {"小程序-个人中心-门店管理-扫码核销校验"}) + @ApiImplicitParams({ + @ApiImplicitParam(value = "分享id", name = "shareId", required = true, dataType = "int"), + }) + @GetMapping("/check/{orderId}/{shopId}") + public AjaxResult check(@PathVariable("orderId") Integer orderId, @PathVariable("shopId") Integer shopId){ + return AjaxResult.ok(orderService.check(orderId, shopId)); + } + + /** + * 订单详情 + */ + @ApiOperation(value = "订单详情", tags = {"订单详情"}) + @ApiImplicitParams({ + @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), + }) + @GetMapping("/detail/{orderId}") + public AjaxResult detail(@PathVariable("orderId") Integer orderId){ + return AjaxResult.success(orderService.getById(orderId)); + } } diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderGoodController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderGoodController.java index d049527..aead1c6 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderGoodController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderGoodController.java @@ -1,8 +1,15 @@ package com.ruoyi.order.controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +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.service.OrderGoodService; +import model.OrderGood; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; /** * <p> @@ -14,7 +21,19 @@ */ @RestController @RequestMapping("/order-good") -public class OrderGoodController { +public class OrderGoodController extends BaseController { + @Resource + private OrderGoodService orderGoodService; + /** + * 查询指定商品订单 + */ + @PostMapping("/selectGoodsOrder") + public R<List<OrderGood>> selectGoodsOrder(@RequestBody List<Long> goodsIds){ + startPage(); + List<OrderGood> orderGoods = orderGoodService.list(new LambdaQueryWrapper<OrderGood>() + .in(OrderGood::getGoodsId, goodsIds)); + return R.ok(orderGoods); + } } diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java index 426b11e..3ad28d4 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java @@ -1,7 +1,7 @@ package com.ruoyi.order.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import model.RefundPassOrder; +import model.Order; /** * <p> diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderGoodService.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderGoodService.java index 3ab2546..57be79b 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderGoodService.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderGoodService.java @@ -1,6 +1,7 @@ package com.ruoyi.order.service; import com.baomidou.mybatisplus.extension.service.IService; +import model.OrderGood; import model.RefundPassOrderGood; /** diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java index e879b05..541715a 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java @@ -1,7 +1,7 @@ package com.ruoyi.order.service; import com.baomidou.mybatisplus.extension.service.IService; -import model.RefundPassOrder; +import model.Order; /** * <p> @@ -12,5 +12,5 @@ * @since 2024-11-21 */ public interface OrderService extends IService<Order> { - + boolean check(Integer orderId, Integer shopId); } diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java index 8993f87..a969b93 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java @@ -1,9 +1,9 @@ package com.ruoyi.order.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.account.mapper.OrderMapper; -import model.RefundPassOrder; -import com.ruoyi.account.service.OrderService; +import com.ruoyi.order.mapper.OrderMapper; +import com.ruoyi.order.service.OrderService; +import model.Order; import org.springframework.stereotype.Service; /** @@ -17,4 +17,8 @@ @Service public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService { + @Override + public boolean check(Integer orderId, Integer shopId) { + return false; + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java index 7b59d65..ba1e75a 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java @@ -5,6 +5,11 @@ 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.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.*; @@ -22,19 +27,26 @@ */ @RestController @RequestMapping("/goods-category") +@Api(tags = "商品分类") public class GoodsCategoryController { @Resource private GoodsCategoryService goodsCategoryService; @PostMapping("/index/list") @ApiOperation(value = "商品分类", tags = {"小程序-首页"}) - public R<List<GoodsCategory>> list(){ - List<GoodsCategory> list = goodsCategoryService.lambdaQuery() + public R<List<GoodsCategory>> indexlist(){ + List<GoodsCategory> indexlist = goodsCategoryService.lambdaQuery() .orderByDesc(GoodsCategory::getCreateTime) .last("limit 8") .list() ; return R.ok(list); } + @GetMapping("/list") + @ApiOperation(value = "商品分类列表", tags = {"小程序-商城-商城-首页-筛选"}) + public AjaxResult list(){ + return AjaxResult.success(goodsCategoryService.list()); + } + } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java index 4e421e8..1a5b4f5 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java @@ -1,9 +1,19 @@ package com.ruoyi.other.controller; +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.service.GoodsService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; /** * <p> @@ -15,7 +25,30 @@ */ @RestController @RequestMapping("/goods") -public class GoodsController { +@Api("商品") +public class GoodsController extends BaseController { + @Resource + private GoodsService goodsService; + + /** + * 商品列表 + */ + @GetMapping("/goodsList") + @ApiOperation(value = "商品列表", tags = {"小程序-商城-首页-热门商品列表"}) + public TableDataInfo goodsList(Goods goods){ + startPage(); + return getDataTable(goodsService.goodsList(goods)); + } + + /** + * 商品详情 + */ + @GetMapping("/goodsDetail/{goodsId}") + @ApiOperation(value = "商品详情", tags = {"小程序-商城-首页-商品详情"}) + public AjaxResult goodsDetail(@PathVariable("goodsId") Long goodsId){ + return success(goodsService.goodsDetail(goodsId)); + } + } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PersonalCenterController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PersonalCenterController.java new file mode 100644 index 0000000..174c2e9 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PersonalCenterController.java @@ -0,0 +1,24 @@ +package com.ruoyi.other.controller; + +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.security.utils.SecurityUtils; +import com.ruoyi.other.vo.Home; +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; + +@Api(tags = "个人中心") +@RestController +@RequestMapping("/personalCenter") +public class PersonalCenterController { + + @GetMapping("/getUserInfo") + @ApiOperation(value = "获取用户信息") + public AjaxResult getUserInfo(){ + Long userId = SecurityUtils.getUserId(); + Home home = new Home(); + return AjaxResult.success(home); + } +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SeckillActivityInfoController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SeckillActivityInfoController.java index fa4f8ff..95242a8 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SeckillActivityInfoController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SeckillActivityInfoController.java @@ -1,8 +1,18 @@ package com.ruoyi.other.controller; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.other.api.domain.Goods; +import com.ruoyi.other.service.SeckillActivityInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; /** * <p> @@ -12,9 +22,33 @@ * @author luodangjia * @since 2024-11-20 */ +@Api(tags = "秒杀活动信息") @RestController @RequestMapping("/seckill-activity-info") -public class SeckillActivityInfoController { +public class SeckillActivityInfoController extends BaseController { + @Resource + private SeckillActivityInfoService seckillActivityInfoService; + + /** + * 秒杀活动列表 + */ + @GetMapping("/list") + @ApiOperation(value = "秒杀活动列表",tags = {"小程序-商城-首页-秒杀活动列表"}) + public AjaxResult list(Goods goods) + { + startPage(); + return AjaxResult.success(seckillActivityInfoService.listSeckillActivity(goods)); + } + + /** + * 秒杀活动详情 + */ + @GetMapping("/detail/{id}") + @ApiOperation(value = "秒杀活动详情", tags = {"小程序-商城-首页-秒杀活动列表-秒杀活动详情"}) + public AjaxResult detail(@PathVariable("id") Integer id) + { + return AjaxResult.success(seckillActivityInfoService.detail(id)); + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java index 63180db..d0df98b 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java @@ -1,9 +1,20 @@ package com.ruoyi.other.controller; -import org.springframework.web.bind.annotation.RequestMapping; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.other.enums.ShareAddType; +import com.ruoyi.other.api.domain.Share; +import com.ruoyi.other.enums.ShareAuditStatus; +import com.ruoyi.other.service.ShareService; +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 org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; /** * <p> @@ -13,9 +24,70 @@ * @author luodangjia * @since 2024-11-20 */ +@Api("分享") @RestController @RequestMapping("/share") -public class ShareController { +public class ShareController extends BaseController { + @Resource + private ShareService shareService; + + /** + * 分享列表 + */ + @ApiOperation(value = "分享列表", tags = {"小程序-个人中心-门店管理-分享列表"}) + @ApiImplicitParams({ + @ApiImplicitParam(value = "对象id(addType=1:平台添加,addType=2:推广人添加,addType=3:门店添加)", name = "objectId", required = true, dataType = "int"), + }) + @GetMapping("/list") + public AjaxResult list(@RequestParam Integer objectId){ + return AjaxResult.success(shareService.list(new LambdaQueryWrapper<Share>() + .eq(Share::getObjectId, objectId))); + } + + + /** + * 分享添加 + */ + @ApiOperation(value = "小程序-个人中心-门店管理-分享添加", tags = {"分享添加-小程序"}) + @PostMapping + public AjaxResult add(@RequestBody Share share){ + share.setAddType(ShareAddType.STORE.getCode()); + share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); + share.setDelFlag(0); + share.setAppletShare(1); + return toAjax(shareService.save(share)); + } + + /** + * 分享删除 + */ + @ApiOperation(value = "分享删除", tags = {"小程序-个人中心-门店管理-分享删除-小程序"}) + @DeleteMapping + public AjaxResult delete(@RequestBody Share share){ + return toAjax(shareService.removeById(share)); + } + + /** + * 分享编辑 + */ + @ApiOperation(value = "分享编辑", tags = {"小程序-个人中心-门店管理-分享编辑-小程序"}) + @PutMapping + public AjaxResult edit(@RequestBody Share share){ + share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); + return toAjax(shareService.updateById(share)); + } + + /** + * 分享详情 + */ + @ApiOperation(value = "分享详情", tags = {"小程序-个人中心-门店管理-分享详情-小程序"}) + @GetMapping("/detail/{id}") + public AjaxResult detail(@PathVariable("id") Integer id){ + return AjaxResult.success(shareService.getById(id)); + } + + + } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java index 6044121..fd5ea9f 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java @@ -1,8 +1,27 @@ package com.ruoyi.other.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.account.api.feignClient.AppUserClient; +import com.ruoyi.account.api.model.AppUser; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.security.utils.SecurityUtils; +import com.ruoyi.other.api.domain.Shop; +import com.ruoyi.other.api.domain.Technician; +import com.ruoyi.other.enums.ShopStatus; +import com.ruoyi.other.service.ShopService; +import com.ruoyi.other.service.TechnicianService; +import io.swagger.annotations.Api; +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> @@ -14,7 +33,62 @@ */ @RestController @RequestMapping("/shop") -public class ShopController { +@Api("门店") +public class ShopController extends BaseController { + @Resource + private TechnicianService technicianService; + @Resource + private ShopService shopService; + @Resource + private AppUserClient appUserClient; + + /** + * 附近门店列表 + */ + @GetMapping("/nearbyShopList") + @ApiOperation(value = "附近门店列表", tags = {"小程序-首页-附近门店列表"}) + public AjaxResult nearbyShopList(@ApiParam("经度") @RequestParam String longitude, + @ApiParam("纬度") @RequestParam String latitude){ + return success(shopService.nearbyShopList(longitude,latitude)); + } + + + /** + * 指定门店技师列表 + */ + @GetMapping("/technicianList") + @ApiOperation(value = "技师列表", tags = {"技师列表-小程序"}) + public AjaxResult technicianList(@ApiParam("门店id") @RequestParam String shopId){ + return success(technicianService.list(new LambdaQueryWrapper<Technician>() + .eq(Technician::getShopId,shopId) + .eq(Technician::getStatus,2) + .eq(Technician::getSubscribeStatus,1))); + } + + /** + * 查询当前店长所属门店 + */ + @GetMapping("/shopByUser") + @ApiOperation(value = "查询当前店长所属门店", tags = {"小程序-个人中心-首页-关联门店列表"}) + public AjaxResult shopByUser(){ + List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>() + .eq(Shop::getAppUserId, SecurityUtils.getUserId()) + .eq(Shop::getStatus, ShopStatus.SHOP_STATUS_NORMAL.getCode())); + return success(list); + } + + /** + * 绑定门店 + */ + @GetMapping("/bindShop") + @ApiOperation(value = "绑定门店", tags = {"小程序-个人中心-绑定门店"}) + public AjaxResult bindShop(@ApiParam("门店id") @RequestParam Long shopId){ + AppUser appUser = appUserClient.getAppUserById(SecurityUtils.getUserId()); + appUser.setShopId(shopId); + appUserClient.editAppUserById(appUser); + return success(); + } + } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShoppingCartController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShoppingCartController.java new file mode 100644 index 0000000..2a4fb7f --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShoppingCartController.java @@ -0,0 +1,11 @@ +package com.ruoyi.other.controller; + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/shopping-cart") +@Api(tags = "购物车") +public class ShoppingCartController { +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java index 2188dc1..36b76f0 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java @@ -1,8 +1,24 @@ package com.ruoyi.other.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.utils.SecurityUtils; +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 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> @@ -12,9 +28,43 @@ * @author luodangjia * @since 2024-11-20 */ +@Api(tags = "技师预约管理") @RestController @RequestMapping("/technician-subscribe") -public class TechnicianSubscribeController { +public class TechnicianSubscribeController extends BaseController { + @Resource + private TechnicianSubscribeService technicianSubscribeService; + + /** + * 预约列表 + */ + @GetMapping("/list") + @ApiOperation(value = "预约列表", notes = "预约列表", tags = {"小程序-个人中心-门店管理-预约列表"}) + public TableDataInfo list(@ApiParam(value = "状态") @RequestParam Integer status, + @ApiParam(value = "门店id") @RequestParam Long shopId){ + startPage(); + List<TechnicianSubscribeVO> list = technicianSubscribeService + .getTechnicianSubscribeByUserAndShop(SecurityUtils.getUserId(),shopId); + return getDataTable(list); + } + + /** + * 取消服务 + */ + @GetMapping("/cancel") + @ApiOperation(value = "取消服务", notes = "取消服务", tags = {"小程序-个人中心-门店管理-预约列表-取消服务"}) + public AjaxResult cancel(@ApiParam(value = "预约id") @RequestParam Long id){ + + TechnicianSubscribe subscribe = technicianSubscribeService.getOne(new LambdaQueryWrapper<TechnicianSubscribe>() + .eq(TechnicianSubscribe::getId, id) + .eq(TechnicianSubscribe::getStatus, 0)); + if (null == subscribe){ + return error("不满足取消条件"); + } + subscribe.setStatus(2); + technicianSubscribeService.updateById(subscribe); + return success(); + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/GoodsStatus.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/GoodsStatus.java new file mode 100644 index 0000000..c17d2e1 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/GoodsStatus.java @@ -0,0 +1,22 @@ +package com.ruoyi.other.enums; + +public enum GoodsStatus { + DOWN(0, "下架"), + UP(1, "上架"); + + private Integer code; + private String desc; + + GoodsStatus(Integer code, String desc) { + this.code = code; + this.desc = desc; + } + + public Integer getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShareAddType.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShareAddType.java new file mode 100644 index 0000000..819df7b --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShareAddType.java @@ -0,0 +1,19 @@ +package com.ruoyi.other.enums; + +import lombok.Getter; + +@Getter +public enum ShareAddType { + PLATFORM(1, "平台添加"), + PROMPOTERS(2, "推广人添加"), + STORE(3, "门店添加"); + + private final Integer code; + private final String message; + + ShareAddType(Integer code, String message) { + this.code = code; + this.message = message; + } + +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShareAuditStatus.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShareAuditStatus.java new file mode 100644 index 0000000..16a5617 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShareAuditStatus.java @@ -0,0 +1,23 @@ +package com.ruoyi.other.enums; + +public enum ShareAuditStatus { + WAIT(0, "待审核"), + SUCCESS(1, "审核通过"), + FAIL(2, "审核失败"); + + private final Integer code; + private final String message; + + ShareAuditStatus(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShopStatus.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShopStatus.java new file mode 100644 index 0000000..a82be5a --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShopStatus.java @@ -0,0 +1,18 @@ +package com.ruoyi.other.enums; + +import lombok.Getter; + +@Getter +public enum ShopStatus { + SHOP_STATUS_NORMAL(1, "正常"), + SHOP_STATUS_FREEZE(2, "冻结"); + + private final Integer code; + private final String message; + + ShopStatus(Integer code, String message) { + this.code = code; + this.message = message; + } + +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/SeckillActivityInfoMapper.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/SeckillActivityInfoMapper.java index 3906597..91eb0a3 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/SeckillActivityInfoMapper.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/SeckillActivityInfoMapper.java @@ -1,7 +1,12 @@ package com.ruoyi.other.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.SeckillActivityInfo; +import com.ruoyi.other.vo.SeckillActivityDetailVO; +import com.ruoyi.other.vo.SeckillActivityVO; + +import java.util.List; /** * <p> @@ -13,4 +18,7 @@ */ public interface SeckillActivityInfoMapper extends BaseMapper<SeckillActivityInfo> { + List<SeckillActivityVO> listSeckillActivity(Goods goods); + + SeckillActivityDetailVO selectDetail(Integer seckillActivityId); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java index ce002fe..6f6779b 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java @@ -2,6 +2,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.Shop; +import com.ruoyi.other.vo.NearbyShopVO; + +import java.util.List; /** * <p> @@ -13,4 +16,5 @@ */ public interface ShopMapper extends BaseMapper<Shop> { + List<NearbyShopVO> selectNearbyShopList(String longitude, String latitude); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShoppingCartMapper.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShoppingCartMapper.java new file mode 100644 index 0000000..8c645e2 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShoppingCartMapper.java @@ -0,0 +1,7 @@ +package com.ruoyi.other.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.other.api.domain.ShoppingCart; + +public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> { +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java index 5b35a84..372bfbb 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java @@ -2,6 +2,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.TechnicianSubscribe; +import com.ruoyi.other.vo.TechnicianSubscribeVO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * <p> @@ -13,4 +17,11 @@ */ public interface TechnicianSubscribeMapper extends BaseMapper<TechnicianSubscribe> { + /** + * 查看用户预约记录 + * @param shopId + * @return + */ + public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(@Param("userId") Long userId, + @Param("shopId") Long shopId); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java index 903aedb..c12ae58 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java @@ -2,6 +2,9 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.other.api.domain.Goods; +import com.ruoyi.other.vo.GoodsVO; + +import java.util.List; /** * <p> @@ -13,4 +16,7 @@ */ public interface GoodsService extends IService<Goods> { + List<GoodsVO> goodsList(Goods goods); + + GoodsVO goodsDetail(Long goodsId); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/SeckillActivityInfoService.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/SeckillActivityInfoService.java index d90c95d..1d46d76 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/SeckillActivityInfoService.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/SeckillActivityInfoService.java @@ -1,7 +1,12 @@ package com.ruoyi.other.service; +import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.SeckillActivityInfo; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.other.vo.SeckillActivityDetailVO; +import com.ruoyi.other.vo.SeckillActivityVO; + +import java.util.List; /** * <p> @@ -13,4 +18,7 @@ */ public interface SeckillActivityInfoService extends IService<SeckillActivityInfo> { + List<SeckillActivityVO> listSeckillActivity(Goods goods); + + SeckillActivityDetailVO detail(Integer seckillActivityId); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShareService.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShareService.java index d59e5c0..a77005b 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShareService.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShareService.java @@ -12,5 +12,4 @@ * @since 2024-11-20 */ public interface ShareService extends IService<Share> { - } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java index 18e887f..d563bbe 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java @@ -2,6 +2,9 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.other.api.domain.Shop; +import com.ruoyi.other.vo.NearbyShopVO; + +import java.util.List; /** * <p> @@ -13,4 +16,5 @@ */ public interface ShopService extends IService<Shop> { + List<NearbyShopVO> nearbyShopList(String longitude, String latitude); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShoppingCartService.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShoppingCartService.java new file mode 100644 index 0000000..fdaa67b --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShoppingCartService.java @@ -0,0 +1,7 @@ +package com.ruoyi.other.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.other.api.domain.ShoppingCart; + +public interface ShoppingCartService extends IService<ShoppingCart> { +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java index e91d442..2bbdf42 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java @@ -2,10 +2,13 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.other.api.domain.TechnicianSubscribe; +import com.ruoyi.other.vo.TechnicianSubscribeVO; + +import java.util.List; /** * <p> - * 服务类 + * 服务类 * </p> * * @author luodangjia @@ -13,4 +16,9 @@ */ public interface TechnicianSubscribeService extends IService<TechnicianSubscribe> { + /** + * 查询用于指定门店的相关预约记录 + */ + List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long userId, Long shopId); + } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java index eb17457..aff730b 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java @@ -1,14 +1,27 @@ package com.ruoyi.other.service.impl; +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.other.mapper.GoodsMapper; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.bean.BeanUtils; import com.ruoyi.other.api.domain.Goods; +import com.ruoyi.other.enums.GoodsStatus; +import com.ruoyi.other.mapper.GoodsMapper; import com.ruoyi.other.service.GoodsService; +import com.ruoyi.other.vo.GoodsVO; +import feignClient.RemoteOrderGoodsClient; +import model.OrderGood; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; /** * <p> - * 服务实现类 + * 服务实现类 * </p> * * @author luodangjia @@ -16,5 +29,34 @@ */ @Service public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService { + @Resource + private RemoteOrderGoodsClient orderGoodsClient; + @Override + public List<GoodsVO> goodsList(Goods search) { + List<Goods> goodsList = this.list(new LambdaQueryWrapper<Goods>() + .eq(Goods::getStatus, GoodsStatus.UP) + .eq(Objects.nonNull(search.getGoodsCategoryId()) ,Goods::getGoodsCategoryId, search.getGoodsCategoryId()) + .like(StringUtils.isNotEmpty(search.getName()), Goods::getName, search.getName())); + + List<GoodsVO> result = new ArrayList<>(); + for (Goods goods : goodsList) { + GoodsVO goodsVO = new GoodsVO(); + BeanUtils.copyBeanProp(goodsVO, goods); + result.add(goodsVO); + } + return result; + } + + @Override + public GoodsVO goodsDetail(Long goodsId) { + // TODO 根据会员等级展示价格 + Goods goods = this.getById(goodsId); + if (Objects.nonNull(goods)){ + GoodsVO goodsVO = new GoodsVO(); + BeanUtils.copyBeanProp(goodsVO, goods); + return goodsVO; + } + return new GoodsVO(); + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java index b618bba..bcb6b71 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java @@ -1,10 +1,22 @@ 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.other.mapper.SeckillActivityInfoMapper; +import com.ruoyi.other.api.domain.Goods; +import com.ruoyi.other.api.domain.GoodsShop; import com.ruoyi.other.api.domain.SeckillActivityInfo; +import com.ruoyi.other.api.domain.Shop; +import com.ruoyi.other.mapper.GoodsShopMapper; +import com.ruoyi.other.mapper.SeckillActivityInfoMapper; +import com.ruoyi.other.mapper.ShopMapper; import com.ruoyi.other.service.SeckillActivityInfoService; +import com.ruoyi.other.vo.SeckillActivityDetailVO; +import com.ruoyi.other.vo.SeckillActivityVO; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.stream.Collectors; /** * <p> @@ -16,5 +28,33 @@ */ @Service public class SeckillActivityInfoServiceImpl extends ServiceImpl<SeckillActivityInfoMapper, SeckillActivityInfo> implements SeckillActivityInfoService { + @Resource + private SeckillActivityInfoMapper seckillActivityInfoMapper; + @Resource + private GoodsShopMapper goodsShopMapper; + @Resource + private ShopMapper shopMapper; + @Override + public List<SeckillActivityVO> listSeckillActivity(Goods goods) { + return seckillActivityInfoMapper.listSeckillActivity(goods); + } + + @Override + public SeckillActivityDetailVO detail(Integer seckillActivityId) { + SeckillActivityDetailVO seckillActivityDetailVO = seckillActivityInfoMapper.selectDetail(seckillActivityId); + Long goodsId = seckillActivityDetailVO.getGoodsId(); + + List<Integer> shopIdList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>() + .eq(GoodsShop::getGoodsId, goodsId)).stream().map(GoodsShop::getShopId).collect(Collectors.toList()); + + List<String> shopNames = shopMapper.selectObjs(new LambdaQueryWrapper<Shop>() + .select(Shop::getName) + .in(Shop::getId, shopIdList)) + .stream() + .map(Object::toString) + .collect(Collectors.toList()); + seckillActivityDetailVO.setShopList(shopNames); + return seckillActivityDetailVO; + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShareServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShareServiceImpl.java index 67df77e..44dcb61 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShareServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShareServiceImpl.java @@ -16,5 +16,4 @@ */ @Service public class ShareServiceImpl extends ServiceImpl<ShareMapper, Share> implements ShareService { - } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java index 1313a27..c5f851b 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java @@ -4,7 +4,11 @@ import com.ruoyi.other.mapper.ShopMapper; import com.ruoyi.other.api.domain.Shop; import com.ruoyi.other.service.ShopService; +import com.ruoyi.other.vo.NearbyShopVO; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; /** * <p> @@ -16,5 +20,11 @@ */ @Service public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements ShopService { + @Resource + private ShopMapper shopMapper; + @Override + public List<NearbyShopVO> nearbyShopList(String longitude, String latitude) { + return shopMapper.selectNearbyShopList(longitude,latitude); + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShoppingCartServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShoppingCartServiceImpl.java new file mode 100644 index 0000000..887ae3f --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShoppingCartServiceImpl.java @@ -0,0 +1,11 @@ +package com.ruoyi.other.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.other.api.domain.ShoppingCart; +import com.ruoyi.other.mapper.ShoppingCartMapper; +import com.ruoyi.other.service.ShoppingCartService; +import org.springframework.stereotype.Service; + +@Service +public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, ShoppingCart> implements ShoppingCartService { +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java index b51c4a4..a1e6e7f 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java @@ -4,7 +4,12 @@ import com.ruoyi.other.mapper.TechnicianSubscribeMapper; import com.ruoyi.other.api.domain.TechnicianSubscribe; import com.ruoyi.other.service.TechnicianSubscribeService; +import com.ruoyi.other.vo.TechnicianSubscribeVO; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; /** * <p> @@ -16,5 +21,11 @@ */ @Service public class TechnicianSubscribeServiceImpl extends ServiceImpl<TechnicianSubscribeMapper, TechnicianSubscribe> implements TechnicianSubscribeService { + @Resource + private TechnicianSubscribeMapper technicianSubscribeMapper; + @Override + public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long userId, Long shopId) { + return technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(userId, shopId); + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java new file mode 100644 index 0000000..03308d7 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java @@ -0,0 +1,53 @@ +package com.ruoyi.other.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@ApiModel(value="商品热销对象", description="热门商品") +@Data +public class GoodsVO { + + @ApiModelProperty(value = "商品id") + private Long goodsId; + + @ApiModelProperty(value = "商品名称") + private String goodsName; + + @ApiModelProperty(value = "限购数量(-1不限购)") + private Integer purchaseLimit; + + @ApiModelProperty(value = "类型(1=服务商品,2=单品商品)") + private Integer type; + + @ApiModelProperty(value = "商品简介") + private String introduction; + + @ApiModelProperty(value = "商品详情") + private String detail; + + @ApiModelProperty(value = "封面图") + private String homePagePicture; + + @ApiModelProperty(value = "详情图,多个逗号分隔") + private String detailPicture; + + @ApiModelProperty(value = "积分支付(0=否,1=是)") + private Integer pointPayment; + + @ApiModelProperty(value = "基础积分") + @TableField("integral") + private Integer integral; + + @ApiModelProperty(value = "划线价") + private BigDecimal originalPrice; + + @ApiModelProperty(value = "基础售价") + private BigDecimal sellingPrice; + + @ApiModelProperty(value = "已售数量") + private Integer saleNum; +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/Home.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/Home.java new file mode 100644 index 0000000..9916852 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/Home.java @@ -0,0 +1,103 @@ +package com.ruoyi.other.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value="首页用户信息", description="") +public class Home { + /** + * 用户id + */ + @ApiModelProperty(value = "用户id") + private Long userId; + /** + * 头像 + */ + @ApiModelProperty(value = "头像") + private String avatar; + /** + * 上级 + */ + @ApiModelProperty(value = "上级") + private String parentName; + /** + * 绑定店铺 + */ + @ApiModelProperty(value = "绑定店铺") + private String shopName; + + /** + * 普通会员数量 + */ + @ApiModelProperty(value = "普通会员数量") + private Integer ordinaryMemberNum; + + /** + * 黄金会员数量 + */ + @ApiModelProperty(value = "黄金会员数量") + private Integer goldenMemberNum; + + /** + * 钻石会员数量 + */ + @ApiModelProperty(value = "钻石会员数量") + private Integer diamondMemberNum; + + /** + * 代理数量 + */ + @ApiModelProperty(value = "代理数量") + private Integer agentNum; + + /** + * 准代理数量 + */ + @ApiModelProperty(value = "准代理数量") + private Integer proxyNum; + + /** + * 总代理数量 + */ + @ApiModelProperty(value = "总代理数量") + private Integer totalAgentNum; + + /** + * 合伙人数量 + */ + @ApiModelProperty(value = "合伙人数量") + private Integer partnerNum; + + /** + * 营业时间 + */ + @ApiModelProperty(value = "营业星期") + private String businessDate; + + /** + * 评分 + */ + @ApiModelProperty(value = "评分") + private Integer score; + + /** + * 经度 + */ + @ApiModelProperty(value = "经度") + private String longitude; + + /** + * 纬度 + */ + @ApiModelProperty(value = "纬度") + private String latitude; + + /** + * 地址 + */ + @ApiModelProperty(value = "地址") + private String address; + +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java new file mode 100644 index 0000000..8c2dfb1 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java @@ -0,0 +1,24 @@ +package com.ruoyi.other.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class NearbyShopVO { + + @ApiModelProperty(value = "门店id") + private Integer id; + + @ApiModelProperty(value = "封面图片") + private String homePicture; + + @ApiModelProperty(value = "门店名称") + private String name; + + @ApiModelProperty(value = "详细地址") + private String address; + + @ApiModelProperty(value = "距离") + private String distance; +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java new file mode 100644 index 0000000..5511f3b --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java @@ -0,0 +1,27 @@ +package com.ruoyi.other.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class SeckillActivityDetailVO extends SeckillActivityVO{ + + @ApiModelProperty(value = "产品id") + private Long goodsId; + + @ApiModelProperty(value = "详情图,多个逗号分隔") + private String detailPicture; + + @ApiModelProperty(value = "活动结束日期") + private LocalDateTime endTime; + + @ApiModelProperty(value = "可用门店") + private List<String> shopList; + + @ApiModelProperty(value = "商品详情") + private String detail; +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityVO.java new file mode 100644 index 0000000..bd8e336 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityVO.java @@ -0,0 +1,38 @@ +package com.ruoyi.other.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class SeckillActivityVO { + + @ApiModelProperty(value = "活动id") + private Integer id; + + @ApiModelProperty(value = "商品名称") + private String goodsName; + + @ApiModelProperty(value = "商品简介") + private String introduction; + + @ApiModelProperty(value = "封面图") + private String homePagePicture; + + @ApiModelProperty(value = "划线价") + private BigDecimal originalPrice; + + @ApiModelProperty(value = "基础售价") + private BigDecimal sellingPrice; + + @ApiModelProperty(value = "已售数量") + private Integer saleNum; + + @ApiModelProperty(value = "开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Integer startTime; + +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianSubscribeVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianSubscribeVO.java new file mode 100644 index 0000000..699342d --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianSubscribeVO.java @@ -0,0 +1,54 @@ +package com.ruoyi.other.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +@ApiModel(value="技师预约对象", description="") +public class TechnicianSubscribeVO { + + /** + * 门店名称 + */ + @ApiModelProperty(value = "门店名称") + private String shopName; + + /** + * 门店地址 + */ + @ApiModelProperty(value = "门店地址") + private String shopAddress; + + /** + * 用户地址 + */ + @ApiModelProperty(value = "用户地址") + private String userAddress; + + /** + * 技师名字 + */ + @ApiModelProperty(value = "技师名字") + private String technicianName; + + /** + * 预约时间 + */ + @ApiModelProperty(value = "预约时间") + private LocalDateTime subscribeTime; + + /** + * 服务方式:1=上门服务,2=到店服务 + */ + @ApiModelProperty(value = "服务方式:1=上门服务,2=到店服务") + private Integer serviceMode; + + /** + * 预约状态:0=待服务,1=已服务,2=已取消 + */ + @ApiModelProperty(value = "预约状态:0=待服务,1=已服务,2=已取消") + private Integer status; +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/WalletChangeVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/WalletChangeVO.java new file mode 100644 index 0000000..61ea79b --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/WalletChangeVO.java @@ -0,0 +1,24 @@ +package com.ruoyi.other.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@ApiModel(value="变更明细", description="") +public class WalletChangeVO { + + @ApiModelProperty(value = "变更类型:1-充值 2-提现 3-红包 4-分佣 5商城购物") + private Integer type; + + @ApiModelProperty(value = "变更时间") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date changeTime; + + @ApiModelProperty(value = "分佣消费金额") + private BigDecimal price; +} diff --git a/ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml b/ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml index 4a30605..f773bb8 100644 --- a/ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml +++ b/ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml @@ -23,7 +23,7 @@ nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 192.168.110.169:8848 service: ${spring.application.name} group: DEFAULT_GROUP namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 @@ -31,7 +31,7 @@ password: nacos config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 192.168.110.169:8848 namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 group: DEFAULT_GROUP name: ${spring.application.name} @@ -143,13 +143,13 @@ nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 192.168.110.169:8848 service: ${spring.application.name} group: DEFAULT_GROUP namespace: 96712c7a-480b-4f40-b783-39f00f3b33ce config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 192.168.110.169:8848 namespace: 96712c7a-480b-4f40-b783-39f00f3b33ce group: DEFAULT_GROUP name: ${spring.application.name} diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml new file mode 100644 index 0000000..c149142 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.other.mapper.GoodsMapper"> + +</mapper> \ No newline at end of file diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml new file mode 100644 index 0000000..220571f --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.other.mapper.SeckillActivityInfoMapper"> + + <select id="listSeckillActivity" resultType="com.ruoyi.other.vo.SeckillActivityVO"> + SELECT + tsai.id, + tg.`name`, + tg.introduction, + tg.home_page_picture, + tg.original_price, + tgs.selling_price, + tg.sale_num, + tsai.start_time + FROM + t_seckill_activity_info tsai + LEFT JOIN t_goods tg ON tsai.good_id = tg.id + LEFT JOIN t_goods_seckill tgs ON tgs.goods_id = tg.id + WHERE tsai.end_time >= NOW() + <if test="goodsName != null and goodsName != ''"> + AND tg.`name` LIKE concat('%',#{goodsName},'%') + </if> + <if test="goodsCategoryId != null"> + AND tg.goods_category_id = #{goodsCategoryId} + </if> + </select> + <select id="selectDetail" resultType="com.ruoyi.other.vo.SeckillActivityDetailVO"> + SELECT + tsai.id, + tg.`name`, + tg.introduction, + tg.home_page_picture, + tg.original_price, + tgs.selling_price, + tg.sale_num, + tsai.start_time, + tg.detail_picture, + tsal.end_time, + tg.detail + FROM + t_seckill_activity_info tsai + LEFT JOIN t_goods tg ON tsai.good_id = tg.id + LEFT JOIN t_goods_seckill tgs ON tgs.goods_id = tg.id + WHERE tsai.id = #{seckillActivityId} + </select> +</mapper> \ No newline at end of file diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml new file mode 100644 index 0000000..6026678 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.other.mapper.ShopMapper"> + + <select id="selectNearbyShopList" resultType="com.ruoyi.other.vo.NearbyShopVO"> + + </select> +</mapper> \ No newline at end of file diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShoppingCartMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShoppingCartMapper.xml new file mode 100644 index 0000000..2182ba7 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShoppingCartMapper.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.other.mapper.ShoppingCartMapper"> + + <select id="selectNearbyShopList" resultType="com.ruoyi.other.vo.NearbyShopVO"> + + </select> +</mapper> \ No newline at end of file diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml new file mode 100644 index 0000000..c9c6dd8 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml @@ -0,0 +1,27 @@ + +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.other.mapper.TechnicianSubscribeMapper"> + + <select id="getTechnicianSubscribeByUserAndShop" + resultType="com.ruoyi.other.vo.TechnicianSubscribeVO"> + SELECT + tts.user_address, + ts.`name` shopName, + ts.address shopAddress, + tt.name technicianName, + tts.subscribe_time, + tts.service_mode, + tts.status + FROM + t_technician_subscribe tts + LEFT JOIN t_technician tt ON tts.technician_id = tt.id AND tt.del_flag = 0 + LEFT JOIN t_shop ts ON tt.shop_id = ts.id AND ts.del_flag = 0 + WHERE + ( (ts.app_user_id = #{userId} AND ts.id = #{shopId}) + OR + (tt.app_user_id = #{userId} AND ts.id = #{shopId})) + AND tts.del_flag = 0 + ORDER BY tts.create_time DESC + </select> +</mapper> \ No newline at end of file -- Gitblit v1.7.1