From d2542a6123fa6834e01ed3af23c7ba0a02696bc6 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 29 十一月 2024 16:37:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java | 116 +++++
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OrderFallbackFactory.java | 39 +
ruoyi-service/ruoyi-account/pom.xml | 4
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java | 16
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TAppUserService.java | 44 ++
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/CouponClientFallbackFactory.java | 28 +
ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java | 4
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/IndexConfigSetDto.java | 23 +
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java | 27 +
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java | 2
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianSubscribeVO.java | 2
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java | 33 +
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java | 6
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java | 31 +
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserAddressController.java | 55 ++
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java | 4
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserCoupon.java | 17
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java | 3
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java | 28 +
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/StoreClient.java | 24 +
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java | 16
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/CouponInfoController.java | 64 +++
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java | 1
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/StoreFallbackFactory.java | 35 +
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java | 1
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java | 83 ++++
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java | 11
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OrderClient.java | 24 +
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java | 40 +
ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/service/AsyncLogService.java | 5
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Technician.java | 7
/dev/null | 75 ---
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java | 6
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java | 129 +++++-
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml | 31 +
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java | 115 +++++
36 files changed, 1,030 insertions(+), 119 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 32caa3c..c93b679 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
@@ -31,6 +31,12 @@
throw new RuntimeException("编辑用户信息失败");
}
+ @Override
+ public R<Long> getCouponCount(Long userId, Long couponId) {
+ 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 e8178d7..8c625c3 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
@@ -28,4 +28,7 @@
*/
@PostMapping("/appUser/editAppUserById")
R<Void> editAppUserById(@RequestParam("appUser") AppUser appUser);
+
+ @PostMapping("/appUser/getCouponCount")
+ R<Long> getCouponCount(@RequestParam("userId")Long userId, @RequestParam("couponId") Integer couponId );
}
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 c8cfc28..026c52b 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
@@ -85,10 +85,18 @@
@ApiModelProperty(value = "推广人id")
@TableField("invite_user_id")
private Long inviteUserId;
+ @ApiModelProperty(value = "推广人姓名")
+ @TableField(exist = false)
+ private String inviteUserName;
+
+
@ApiModelProperty(value = "绑定门店id")
@TableField("shop_id")
private Long shopId;
+ @ApiModelProperty(value = "绑定门店名称")
+ @TableField(exist = false)
+ private String shopName;
@ApiModelProperty(value = "合伙人积分数")
@TableField("part_point")
@@ -174,4 +182,27 @@
@TableField("district_code")
private String districtCode;
+ @ApiModelProperty("等级1会员数")
+ private Long count1;
+
+ @ApiModelProperty("等级2会员数")
+ private Long count2;
+
+ @ApiModelProperty("等级3会员数")
+ private Long count3;
+
+ @ApiModelProperty("等级4会员数")
+ private Long count4;
+
+ @ApiModelProperty("等级5会员数")
+ private Long count5;
+
+ @ApiModelProperty("等级6会员数")
+ private Long count6;
+
+ @ApiModelProperty("等级7会员数")
+ private Long count7;
+
+
+
}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserCoupon.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserCoupon.java
index 3ca871c..88c6de2 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserCoupon.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserCoupon.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.account.api.vo.CouponInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -48,9 +49,25 @@
@TableField("use_time")
private LocalDateTime useTime;
+ @ApiModelProperty(value = "开始时间")
+ @TableField("start_time")
+ private LocalDateTime startTime;
+
+ @ApiModelProperty(value = "结束时间")
+ @TableField("end_time")
+ private LocalDateTime endTime;
+
@ApiModelProperty(value = "优惠劵id")
@TableField("coupon_id")
private Integer couponId;
+ @ApiModelProperty(value = "优惠劵信息")
+ @TableField(exist = false)
+ private CouponInfoVo couponInfoVo;
+
+ @ApiModelProperty(value = "1未使用2已使用3已过期")
+ @TableField(exist = false)
+ private Integer status;
+
}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java
index 106134c..7c0f020 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java
@@ -33,4 +33,120 @@
private String periodEndTime;
@ApiModelProperty("是否可用")
private Boolean available;
+import com.baomidou.mybatisplus.annotation.*;
+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;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author luodangjia
+ * @since 2024-11-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("t_coupon_info")
+@ApiModel(value="CouponInfo对象", description="")
+public class CouponInfoVo implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "主键")
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+
+ @ApiModelProperty(value = "删除标志(0=否,1=是)")
+ @TableField("del_flag")
+ @TableLogic
+ private Integer delFlag;
+
+ @ApiModelProperty(value = "添加时间")
+ @TableField("create_time")
+ private LocalDateTime createTime;
+
+ @ApiModelProperty(value = "优惠券名称")
+ @TableField("coupon_name")
+ private String couponName;
+
+ @ApiModelProperty(value = "优惠券类型 1'满减券',2'代金券',3'折扣券',4'商品券'")
+ @TableField("coupon_type")
+ private Integer couponType;
+
+ @ApiModelProperty(value = "满x元")
+ @TableField("condition_amount")
+ private BigDecimal conditionAmount;
+
+ @ApiModelProperty(value = "减x元")
+ @TableField("discount_amount")
+ private BigDecimal discountAmount;
+
+ @ApiModelProperty(value = "代金x元")
+ @TableField("money_amount")
+ private BigDecimal moneyAmount;
+
+ @ApiModelProperty(value = "折扣")
+ @TableField("discount")
+ private BigDecimal discount;
+
+ @ApiModelProperty(value = "适用商品ids,全部-1")
+ @TableField("for_good_ids")
+ private String forGoodIds;
+
+ @ApiModelProperty(value = "发放数量")
+ @TableField("send_num")
+ private Integer sendNum;
+
+ @ApiModelProperty(value = "可领数量")
+ @TableField("max_num")
+ private Integer maxNum;
+
+ @ApiModelProperty(value = "有效期类型 1指定时间内有效 2领取后x天有效")
+ @TableField("period_type")
+ private Integer periodType;
+
+ @ApiModelProperty(value = "有效期开始时间")
+ @TableField("period_start_time")
+ private LocalDateTime periodStartTime;
+
+ @ApiModelProperty(value = "有效期结束时间")
+ @TableField("period_end_time")
+ private LocalDateTime periodEndTime;
+
+ @ApiModelProperty(value = "领取后x天有效")
+ @TableField("period_days")
+ private Integer periodDays;
+
+ @ApiModelProperty(value = "开始发放时间")
+ @TableField("send_start_time")
+ private LocalDateTime sendStartTime;
+
+ @ApiModelProperty(value = "结束发放时间")
+ @TableField("send_end_time")
+ private LocalDateTime sendEndTime;
+
+ @ApiModelProperty(value = "1免费发放2积分兑换")
+ @TableField("send_type")
+ private Integer sendType;
+
+ @ApiModelProperty(value = "兑换所需积分")
+ @TableField("need_point")
+ private BigDecimal needPoint;
+
+ @ApiModelProperty(value = "可领用户 1全部 2指定人员 3指定会员 4 新人注册")
+ @TableField("person_type")
+ private Integer personType;
+
+ @ApiModelProperty(value = "可领取对应的ids,用find_in_set查询")
+ @TableField("person_ids")
+ private String personIds;
+
+
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java
index b4c2140..745cad0 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java
@@ -10,6 +10,7 @@
import lombok.EqualsAndHashCode;
import java.io.Serializable;
+import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
@@ -39,10 +40,13 @@
@ApiModelProperty(value = "用户id")
@TableField("app_user_id")
private Long appUserId;
+ @ApiModelProperty(value = "订单id")
+ @TableField("order_id")
+ private Long orderId;
@ApiModelProperty(value = "评分")
@TableField("grade")
- private Integer grade;
+ private BigDecimal grade;
@ApiModelProperty(value = "评价内容")
@TableField("comment")
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 5fe3b42..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
@@ -7,6 +7,7 @@
import lombok.EqualsAndHashCode;
import java.io.Serializable;
+import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
@@ -73,6 +74,12 @@
@ApiModelProperty(value = "添加时间")
@TableField("create_time")
private LocalDateTime createTime;
+ @ApiModelProperty("服务次数")
+ @TableField(exist = false)
+ private Integer serveCount;
+ @ApiModelProperty("平均分")
+ @TableField(exist = false)
+ private BigDecimal grade;
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/IndexConfigSetDto.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/IndexConfigSetDto.java
new file mode 100644
index 0000000..00a8f45
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/IndexConfigSetDto.java
@@ -0,0 +1,23 @@
+package com.ruoyi.other.api.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class IndexConfigSetDto {
+ @ApiModelProperty("公司理念")
+ private String companyWant;
+ @ApiModelProperty("宣传图片1")
+ private String pic1;
+ @ApiModelProperty("跳转类型1 - 1无2外部链接3商品详情4秒杀商品详情5领卷中心")
+ private Integer direct1;
+ @ApiModelProperty("宣传图片2")
+ private String pic2;
+ @ApiModelProperty("跳转类型2 - 1无2外部链接3商品详情4秒杀商品详情5领卷中心")
+ private String direct2;
+ @ApiModelProperty("公司简介")
+ private String companyInfo;
+
+
+
+}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/CouponClientFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/CouponClientFallbackFactory.java
new file mode 100644
index 0000000..8a955a1
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/CouponClientFallbackFactory.java
@@ -0,0 +1,28 @@
+package com.ruoyi.other.api.factory;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.other.api.domain.CouponInfo;
+import com.ruoyi.other.api.domain.GoodsVip;
+import com.ruoyi.other.api.feignClient.CouponClient;
+import com.ruoyi.other.api.feignClient.GoodsVipClient;
+import org.springframework.cloud.openfeign.FallbackFactory;
+
+/**
+ * @author zhibing.pu
+ * @Date 2024/11/27 20:29
+ */
+public class CouponClientFallbackFactory implements FallbackFactory<CouponClient> {
+
+
+ @Override
+ public CouponClient create(Throwable cause) {
+ return new CouponClient() {
+
+
+ @Override
+ public R<CouponInfo> detail(Integer id) {
+ return R.fail("查看优惠券详情失败:" + cause.getMessage());
+ }
+ };
+ }
+}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OrderFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OrderFallbackFactory.java
new file mode 100644
index 0000000..762b040
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OrderFallbackFactory.java
@@ -0,0 +1,39 @@
+package com.ruoyi.other.api.factory;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.dto.ExchangeBackDto;
+import com.ruoyi.common.core.dto.ExchangeDto;
+
+import com.ruoyi.other.api.feignClient.OrderClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 充电订单服务降级处理
+ *
+ * @author ruoyi
+ */
+@Component
+public class OrderFallbackFactory implements FallbackFactory<OrderClient>
+{
+ private static final Logger log = LoggerFactory.getLogger(OrderFallbackFactory.class);
+
+
+ @Override
+ public OrderClient create(Throwable cause) {
+ log.error("商品订单调用失败:{}", cause.getMessage());
+ return new OrderClient() {
+
+
+ @Override
+ public R getOrderIdsByTechId(Integer id) {
+ return R.fail("根据技师id查订单ids失败:" + cause.getMessage());
+ }
+
+ };
+ }
+}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/StoreFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/StoreFallbackFactory.java
new file mode 100644
index 0000000..5c2081e
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/StoreFallbackFactory.java
@@ -0,0 +1,35 @@
+package com.ruoyi.other.api.factory;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.other.api.domain.Shop;
+import com.ruoyi.other.api.feignClient.OrderClient;
+import com.ruoyi.other.api.feignClient.StoreClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+/**
+ * 充电订单服务降级处理
+ *
+ * @author ruoyi
+ */
+@Component
+public class StoreFallbackFactory implements FallbackFactory<StoreClient>
+{
+ private static final Logger log = LoggerFactory.getLogger(StoreFallbackFactory.class);
+
+
+ @Override
+ public StoreClient create(Throwable cause) {
+ log.error("商品订单调用失败:{}", cause.getMessage());
+ return new StoreClient() {
+
+
+ @Override
+ public R<Shop> getStoreById(Long id) {
+ return R.fail("根据门店id查询详情:" + cause.getMessage());
+ }
+ };
+ }
+}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java
new file mode 100644
index 0000000..135b501
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java
@@ -0,0 +1,28 @@
+package com.ruoyi.other.api.feignClient;
+
+import com.ruoyi.common.core.constant.ServiceNameConstants;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.other.api.domain.CouponInfo;
+import com.ruoyi.other.api.domain.GoodsArea;
+import com.ruoyi.other.api.domain.GoodsVip;
+import com.ruoyi.other.api.factory.CouponClientFallbackFactory;
+import com.ruoyi.other.api.factory.GoodsVipClientFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * @author zhibing.pu
+ * @Date 2024/11/28 9:42
+ */
+@FeignClient(contextId = "GoodsVipClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = CouponClientFallbackFactory.class)
+public interface CouponClient {
+
+
+ @PostMapping("/coupon-info/detail")
+ R<CouponInfo> detail(@RequestParam("id") Integer id);
+
+
+
+}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OrderClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OrderClient.java
new file mode 100644
index 0000000..75929d3
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OrderClient.java
@@ -0,0 +1,24 @@
+package com.ruoyi.other.api.feignClient;
+
+import com.ruoyi.common.core.constant.ServiceNameConstants;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.dto.ExchangeBackDto;
+import com.ruoyi.common.core.dto.ExchangeDto;
+
+import com.ruoyi.other.api.factory.OrderFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 后台订单服务
+ * @author ruoyi
+ */
+@FeignClient(contextId = "OrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = OrderFallbackFactory.class)
+public interface OrderClient {
+ @PostMapping(value = "/management/give/vip")
+ public R<List<Long>> getOrderIdsByTechId(@RequestParam("id") Integer id);
+
+
+}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/StoreClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/StoreClient.java
new file mode 100644
index 0000000..79cc539
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/StoreClient.java
@@ -0,0 +1,24 @@
+package com.ruoyi.other.api.feignClient;
+
+import com.ruoyi.common.core.constant.ServiceNameConstants;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.other.api.domain.Shop;
+import com.ruoyi.other.api.factory.OrderFallbackFactory;
+import com.ruoyi.other.api.factory.StoreFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+/**
+ * 后台订单服务
+ * @author ruoyi
+ */
+@FeignClient(contextId = "StoreClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = StoreFallbackFactory.class)
+public interface StoreClient {
+ @PostMapping(value = "/shop/getDetailById")
+ public R<Shop> getStoreById(@RequestParam("id") Long id);
+
+
+}
diff --git a/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java b/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
index c443059..53ed3c5 100644
--- a/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
+++ b/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
@@ -14,7 +14,6 @@
import com.ruoyi.common.core.utils.ip.IpUtils;
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.common.security.utils.SecurityUtils;
-import com.ruoyi.system.api.RemoteUserService;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java
index a3220ef..2d674db 100644
--- a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java
+++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java
@@ -4,6 +4,8 @@
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.api.model.SysOperLog;
import org.apache.commons.lang3.ArrayUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
@@ -27,7 +29,7 @@
import com.ruoyi.common.log.filter.PropertyPreExcludeFilter;
import com.ruoyi.common.log.service.AsyncLogService;
import com.ruoyi.common.security.utils.SecurityUtils;
-import com.ruoyi.system.api.domain.SysOperLog;
+
/**
* 操作日志记录处理
diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/service/AsyncLogService.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/service/AsyncLogService.java
index e44b648..3b712b3 100644
--- a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/service/AsyncLogService.java
+++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/service/AsyncLogService.java
@@ -1,11 +1,10 @@
package com.ruoyi.common.log.service;
-import org.springframework.beans.factory.annotation.Autowired;
+import com.ruoyi.system.api.model.SysOperLog;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.constant.SecurityConstants;
-import com.ruoyi.system.api.RemoteLogService;
-import com.ruoyi.system.api.domain.SysOperLog;
+
import javax.annotation.Resource;
diff --git a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/utils/DictUtils.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/utils/DictUtils.java
deleted file mode 100644
index 8282fdc..0000000
--- a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/utils/DictUtils.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.ruoyi.common.security.utils;
-
-import java.util.Collection;
-import java.util.List;
-import com.alibaba.fastjson2.JSONArray;
-import com.ruoyi.common.core.constant.CacheConstants;
-import com.ruoyi.common.core.utils.SpringUtils;
-import com.ruoyi.common.core.utils.StringUtils;
-import com.ruoyi.common.redis.service.RedisService;
-import com.ruoyi.system.api.domain.SysDictData;
-
-/**
- * 字典工具类
- *
- * @author ruoyi
- */
-public class DictUtils
-{
- /**
- * 设置字典缓存
- *
- * @param key 参数键
- * @param dictDatas 字典数据列表
- */
- public static void setDictCache(String key, List<SysDictData> dictDatas)
- {
- SpringUtils.getBean(RedisService.class).setCacheObject(getCacheKey(key), dictDatas);
- }
-
- /**
- * 获取字典缓存
- *
- * @param key 参数键
- * @return dictDatas 字典数据列表
- */
- public static List<SysDictData> getDictCache(String key)
- {
- JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(getCacheKey(key));
- if (StringUtils.isNotNull(arrayCache))
- {
- return arrayCache.toList(SysDictData.class);
- }
- return null;
- }
-
- /**
- * 删除指定字典缓存
- *
- * @param key 字典键
- */
- public static void removeDictCache(String key)
- {
- SpringUtils.getBean(RedisService.class).deleteObject(getCacheKey(key));
- }
-
- /**
- * 清空字典缓存
- */
- public static void clearDictCache()
- {
- Collection<String> keys = SpringUtils.getBean(RedisService.class).keys(CacheConstants.SYS_DICT_KEY + "*");
- SpringUtils.getBean(RedisService.class).deleteObject(keys);
- }
-
- /**
- * 设置cache key
- *
- * @param configKey 参数键
- * @return 缓存键key
- */
- public static String getCacheKey(String configKey)
- {
- return CacheConstants.SYS_DICT_KEY + configKey;
- }
-}
diff --git a/ruoyi-service/ruoyi-account/pom.xml b/ruoyi-service/ruoyi-account/pom.xml
index 4c62224..7e756da 100644
--- a/ruoyi-service/ruoyi-account/pom.xml
+++ b/ruoyi-service/ruoyi-account/pom.xml
@@ -117,6 +117,10 @@
<version>2.6</version>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
</dependencies>
<build>
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 32e001d..1c552ce 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
@@ -1,6 +1,25 @@
package com.ruoyi.account.controller;
+import java.time.LocalDateTime;
+import com.ruoyi.account.api.model.AppUser;
+import com.ruoyi.account.api.model.UserCancellationLog;
+import com.ruoyi.account.service.AppUserService;
+import com.ruoyi.account.service.UserCancellationLogService;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.security.service.TokenService;
+import com.ruoyi.other.api.domain.Shop;
+import com.ruoyi.other.api.feignClient.StoreClient;
+import org.junit.Test;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import javax.annotation.Resource;
+import java.util.List;
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.account.service.AppUserService;
import com.ruoyi.account.vo.*;
@@ -27,15 +46,19 @@
@Api(tags = {"登录注册-小程序"})
@RestController
@RequestMapping("/app-user")
-public class AppUserController extends BaseController {
-
+public class AppUserController {
+
+
+
+ @Resource
+ private TokenService tokenService;
@Resource
private AppUserService appUserService;
-
-
-
-
-
+ @Resource
+ private StoreClient storeClient;
+
+
+
@ResponseBody
@PostMapping("/appletLogin")
@ApiOperation(value = "小程序一键登录")
@@ -59,17 +82,17 @@
public R getSMSCode(@RequestBody SMSCode smsCode){
return appUserService.getSMSCode(smsCode);
}
-
-
-
+
+
+
@ResponseBody
@PostMapping("/registerAccount")
@ApiOperation(value = "注册新账号")
public R<LoginVo> registerAccount(@RequestBody RegisterAccount registerAccount){
return appUserService.registerAccount(registerAccount);
}
-
-
+
+
@ResponseBody
@GetMapping("/getReferrer/{id}")
@ApiOperation(value = "获取推荐人信息")
@@ -82,9 +105,9 @@
phone = phone.substring(0, 3) + "****" + phone.substring(7);
return R.ok(appUser.getName() + "-" + phone);
}
-
-
-
+
+
+
@ResponseBody
@GetMapping("/getNearbyReferrer")
@ApiOperation(value = "获取附近推荐人列表")
@@ -93,10 +116,76 @@
List<NearbyReferrerVo> list = appUserService.getNearbyReferrer(nearbyReferrer);
return getDataTable(list);
}
-
-
-
-
-
+
+
+ @ResponseBody
+ @PostMapping("/info")
+ @ApiOperation(value = "我的资料", tags = {"小程序-个人中心首页-我的资料"})
+ public R<AppUser> info(){
+ Long userId = tokenService.getLoginUserApplet().getUserid();
+ AppUser user = appUserService.getById(userId);
+ return R.ok(user);
+ }
+ @Resource
+ private UserCancellationLogService userCancellationLogService;
+
+ @ResponseBody
+ @PostMapping("/unregis")
+ @ApiOperation(value = "注销", tags = {"小程序-个人中心首页-我的资料"})
+ public R unregis(){
+ Long userId = tokenService.getLoginUserApplet().getUserid();
+ AppUser user = appUserService.getById(userId);
+
+ //添加注销记录
+ UserCancellationLog userCancellationLog = new UserCancellationLog();
+ userCancellationLog.setAppUserId(user.getId());
+ userCancellationLog.setVipId(user.getVipId());
+ userCancellationLogService.save(userCancellationLog);
+
+
+ return R.ok();
+ }
+
+
+ @PostMapping("/index")
+ @ApiOperation(value = "个人中心首页", tags = {"小程序-个人中心首页"})
+ public R<AppUser> index(){
+ System.err.println("=-====");
+ Long userId = tokenService.getLoginUserApplet().getUserid();
+ //当前用户信息
+ AppUser user = appUserService.getById(userId);
+ //当前用户的推荐人信息
+ if (user.getInviteUserId()!=null){
+ AppUser inviteUser = appUserService.getById(user.getInviteUserId());
+ user.setInviteUserName(inviteUser.getName());
+ }
+ //当前绑定门店的店铺信息
+ if (user.getShopId()!=null){
+ R<Shop> storeById = storeClient.getStoreById(user.getShopId());
+ if (storeById.getData()!=null){
+ user.setShopName(storeById.getData().getName());
+ }
+ }
+ Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getTopInviteId, 1).count();
+ Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getTopInviteId, userId).count();
+ Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getTopInviteId, userId).count();
+ Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getTopInviteId, userId).count();
+ Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getTopInviteId, userId).count();
+ Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getTopInviteId, userId).count();
+ Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getTopInviteId, userId).count();
+ user.setCount1(count1);
+ user.setCount2(count2);
+ user.setCount3(count3);
+ user.setCount4(count4);
+ user.setCount5(count5);
+ user.setCount6(count6);
+ user.setCount7(count7);
+ return R.ok(user);
+
+
+ }
+
+
+
}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserAddressController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserAddressController.java
index c0c0621..8abf416 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserAddressController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserAddressController.java
@@ -9,6 +9,16 @@
import javax.annotation.Resource;
import java.util.List;
+import com.ruoyi.account.api.model.AppUser;
+import com.ruoyi.account.api.model.UserAddress;
+import com.ruoyi.account.service.UserAddressService;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.security.service.TokenService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
/**
* <p>
@@ -24,6 +34,9 @@
@Resource
private UserAddressService userAddressService;
+
+ @Resource
+ private TokenService tokenService;
/**
@@ -45,5 +58,47 @@
return R.ok(userAddress);
}
+
+ @ResponseBody
+ @PostMapping("/add")
+ @ApiOperation(value = "添加", tags = {"小程序-个人中心首页-我的地址"})
+ public R add(@RequestBody UserAddress userAddress){
+ Long userId = tokenService.getLoginUserApplet().getUserId();
+ userAddress.setAppUserId(userId);
+ userAddressService.save(userAddress);
+ return R.ok();
+ }
+ @ResponseBody
+ @PostMapping("/edit")
+ @ApiOperation(value = "编辑", tags = {"小程序-个人中心首页-我的地址"})
+ public R edit(@RequestBody UserAddress userAddress){
+ userAddressService.updateById(userAddress);
+ return R.ok();
+ }
+ @ResponseBody
+ @PostMapping("/delete")
+ @ApiOperation(value = "删除", tags = {"小程序-个人中心首页-我的地址"})
+ public R edit(@RequestParam Integer id){
+ userAddressService.removeById(id);
+ return R.ok();
+ }
+
+ @ResponseBody
+ @PostMapping("/set")
+ @ApiOperation(value = "设为默认", tags = {"小程序-个人中心首页-我的地址"})
+ public R set(@RequestParam Integer id){
+ Long userId = tokenService.getLoginUserApplet().getUserId();
+ List<UserAddress> list = userAddressService.lambdaQuery().eq(UserAddress::getAppUserId, userId).list();
+ for (UserAddress userAddress : list) {
+ userAddress.setIsDefault(0);
+ }
+ userAddressService.updateBatchById(list);
+
+ UserAddress byId = userAddressService.getById(id);
+ byId.setIsDefault(1);
+ userAddressService.updateById(byId);
+ return R.ok();
+ }
+
}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
index 5f62eed..003c5b0 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
@@ -1,6 +1,17 @@
package com.ruoyi.account.controller;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.account.api.model.AppUser;
+import com.ruoyi.account.api.model.UserCoupon;
+import com.ruoyi.account.api.model.UserPoint;
+import com.ruoyi.account.api.vo.CouponInfoVo;
+import com.ruoyi.account.service.AppUserService;
+import com.ruoyi.account.service.UserCouponService;
+import com.ruoyi.account.service.UserPointService;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.utils.bean.BeanUtils;
import com.ruoyi.account.api.vo.CouponInfoVo;
import com.ruoyi.account.api.vo.PaymentUserCoupon;
import com.ruoyi.account.service.UserCouponService;
@@ -10,6 +21,16 @@
import javax.annotation.Resource;
import java.util.List;
+import com.ruoyi.common.security.service.TokenService;
+import com.ruoyi.other.api.domain.Banner;
+import com.ruoyi.other.api.domain.CouponInfo;
+import com.ruoyi.other.api.feignClient.CouponClient;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
/**
* <p>
@@ -22,9 +43,99 @@
@RestController
@RequestMapping("/user-coupon")
public class UserCouponController {
+ @Resource
+ private UserCouponService userCouponService;
+ @Resource
+ private TokenService tokenService;
- @Resource
- private UserCouponService userCouponService;
+ @Resource
+ private CouponClient couponClient;
+ @Resource
+ private AppUserService appUserService;
+
+ @Resource
+ private UserPointService userPointService;
+
+
+
+
+ @PostMapping("/mine/list")
+ @ApiOperation(value = "已领取列表", tags = {"小程序-个人中心-优惠劵"})
+ public R<Page<UserCoupon>> minelist(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @ApiParam("1未使用2已使用3已过期") Integer status) {
+ Long userid = tokenService.getLoginUserApplet().getUserid();
+ Page<UserCoupon> page = userCouponService.lambdaQuery()
+ .isNull(status!=null&&(status==1||status==3),UserCoupon::getUseTime)
+ .isNotNull(status!=null&&status==2,UserCoupon::getUseTime)
+ .lt(status!=null&&status==3,UserCoupon::getEndTime, LocalDateTime.now())
+ .eq(UserCoupon::getAppUserId, userid).page(Page.of(pageNum, pageSize));
+ for (UserCoupon record : page.getRecords()) {
+ CouponInfo data = couponClient.detail(record.getCouponId()).getData();
+ CouponInfoVo vo = new CouponInfoVo();
+ BeanUtils.copyProperties(data,vo);
+ record.setCouponInfoVo(vo);
+ if (record.getUseTime()==null){
+ record.setStatus(1);
+ if (record.getEndTime().isBefore(LocalDateTime.now())){
+ record.setStatus(3);
+ }
+ }else {
+ record.setStatus(2);
+ }
+ }
+ return R.ok(page);
+ }
+
+
+ @PostMapping("/get")
+ @ApiOperation(value = "领取或者兑换优惠券", tags = {"小程序-个人中心-优惠劵"})
+ public R<Page<UserCoupon>> get(@RequestParam Integer couponId) {
+
+ Long userid = tokenService.getLoginUserApplet().getUserid();
+ AppUser byId = appUserService.getById(userid);
+
+ CouponInfo data = couponClient.detail(couponId).getData();
+ //检验当前优惠券是否存在
+ if (data==null){
+ return R.fail("当前优惠券不存在,请刷新后重试");
+ }
+ if (data.getSendType()!=1&&byId.getLavePoint().compareTo(data.getNeedPoint())==-1){
+ return R.fail("当前积分不足,兑换失败");
+ }
+ //检验发放时间
+ LocalDateTime now = LocalDateTime.now();
+ if (now.isBefore(data.getSendStartTime())||now.isAfter(data.getSendEndTime())){
+ return R.fail("领取失败,不在发放有效期");
+ }
+ //如果是积分兑换,增加积分的历史记录
+ if (data.getSendType()!=1){
+ UserPoint userPoint = new UserPoint();
+ userPoint.setType(4);
+ userPoint.setHistoricalPoint(byId.getLavePoint());
+ userPoint.setVariablePoint(data.getNeedPoint());
+ userPoint.setAppUserId(userid);
+ userPoint.setObjectId(Long.valueOf(data.getId()));
+ userPointService.save(userPoint);
+ //扣除积分
+ byId.setLavePoint(byId.getLavePoint().subtract(userPoint.getVariablePoint()));
+ appUserService.updateById(byId);
+ }
+ //增加优惠券记录,根据时间类型设置开始结束时间
+ UserCoupon userCoupon = new UserCoupon();
+ userCoupon.setAppUserId(userid);
+ if (data.getPeriodType()==1) {
+ userCoupon.setStartTime(data.getPeriodStartTime());
+ userCoupon.setEndTime(data.getPeriodEndTime());
+ }else {
+ userCoupon.setStartTime(now);
+ userCoupon.setEndTime(now.plusDays(data.getPeriodDays()));
+ }
+ userCoupon.setCouponId(data.getId());
+ userCouponService.save(userCoupon);
+ return R.ok();
+
+
+ }
+
/**
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TAppUserService.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TAppUserService.java
new file mode 100644
index 0000000..2482d4a
--- /dev/null
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TAppUserService.java
@@ -0,0 +1,44 @@
+package com.ruoyi.account.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author luodangjia
+ * @since 2024-08-06
+ */
+public interface TAppUserService extends IService<TAppUser> {
+
+ /**
+ * 微信小程序登录用户封装
+ * @param appletUserDecodeData
+ * @return
+ */
+ Map<String, Object> wxLogin(AppletUserDecodeData appletUserDecodeData,Long inviteUserId);
+
+ /**
+ * 支付宝小程序登录用户封装
+ * @param response
+ * @return
+ */
+// Map<String, Object> aliLogin(AlipaySystemOauthTokenResponse response, AlipayUserInfoShareResponse userInfo);
+ Map<String, Object> aliLogin(AlipaySystemOauthTokenResponse response,String phone,Long inviteUserId);
+
+ /**
+ * 封装用户信息和token
+ * @param appUser
+ * @return
+ */
+ Map<String, Object> getUserInfo(TAppUser appUser);
+
+ /**
+ * 账号判断
+ * @param status
+ */
+ public void throwInfo(Integer status);
+}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java
index d8785a1..5fe3a69 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java
@@ -1,6 +1,7 @@
package com.ruoyi.other.controller;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.other.api.domain.Banner;
@@ -8,10 +9,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@@ -39,6 +37,40 @@
.list();
return R.ok(list);
}
+ @PostMapping("/add")
+ @ApiOperation(value = "添加", tags = {"后台-广告管理-banner管理"})
+ public R add(@RequestBody Banner banner){
+ bannerService.save(banner);
+ return R.ok();
+ }
+ @PostMapping("/delete")
+ @ApiOperation(value = "删除", tags = {"后台-广告管理-banner管理"})
+ public R delete(@RequestParam Integer id){
+ bannerService.removeById(id);
+ return R.ok();
+ }
+ @PostMapping("/edit")
+ @ApiOperation(value = "修改", tags = {"后台-广告管理-banner管理"})
+ public R edit(@RequestBody Banner banner){
+ bannerService.updateById(banner);
+ return R.ok();
+ }
+ @PostMapping("/detail")
+ @ApiOperation(value = "详情", tags = {"后台-广告管理-banner管理"})
+ public R detail(@RequestParam Integer id){
+ Banner byId = bannerService.getById(id);
+ return R.ok(byId);
+ }
+ @PostMapping("/page/list")
+ @ApiOperation(value = "列表", tags = {"后台-广告管理--banner"})
+ public R<Page<Banner>> pagelist(String name, Integer jumpType, Integer position,Integer pageNum,Integer pageSize){
+ Page<Banner> page = bannerService.lambdaQuery().like(StringUtils.isNotEmpty(name), Banner::getName, name)
+ .eq(Banner::getJumpType, jumpType)
+ .eq(Banner::getPosition, position)
+ .page(Page.of(pageNum, pageSize));
+ return R.ok(page);
+ }
+
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/CouponInfoController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/CouponInfoController.java
index 75f6893..6c9c0cd 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/CouponInfoController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/CouponInfoController.java
@@ -1,12 +1,29 @@
package com.ruoyi.other.controller;
+import com.ruoyi.account.api.feignClient.AppUserClient;
+import com.ruoyi.account.api.model.AppUser;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.security.service.TokenService;
+import com.ruoyi.other.api.domain.Banner;
+import com.ruoyi.other.api.domain.CouponInfo;
+import com.ruoyi.other.service.CouponInfoService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.CouponInfo;
import com.ruoyi.other.service.CouponInfoService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
+import java.util.List;
+
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -20,9 +37,52 @@
@RestController
@RequestMapping("/coupon-info")
public class CouponInfoController {
+ @Resource
+ private CouponInfoService couponInfoService;
+ @Resource
+ private TokenService tokenService;
+ @Resource
+ private AppUserClient appUserClient;
+ //查看详情
+ @PostMapping("/detail")
+ @ApiOperation(value = "详情", tags = {"后台-优惠劵"})
+ public R<CouponInfo> detail(@RequestParam("id") Integer id){
+ CouponInfo byId = couponInfoService.getById(id);
+ return R.ok(byId);
+ }
- @Resource
- private CouponInfoService couponInfoService;
+
+ @PostMapping("/gift/list")
+ @ApiOperation(value = "待领取列表", tags = {"小程序-个人中心-优惠劵"})
+ public R<List<CouponInfo>> giftlist(){
+ Long userid = tokenService.getLoginUserApplet().getUserid();
+ AppUser appUserById = appUserClient.getAppUserById(userid);
+ LocalDateTime now = LocalDateTime.now();
+ //查出全部可领取的优惠劵
+ List<CouponInfo> list = couponInfoService.lambdaQuery().le(CouponInfo::getSendStartTime, now).ge(CouponInfo::getSendEndTime, now).eq(CouponInfo::getPersonType, 1).list();
+ //查出指定人员可领取优惠券
+ List<CouponInfo> list1 = couponInfoService.lambdaQuery().le(CouponInfo::getSendStartTime, now).ge(CouponInfo::getSendEndTime, now).eq(CouponInfo::getPersonType, 2).apply("FIND_IN_SET('" + appUserById.getId() + "', person_ids)").list();
+ //查出指定会员可领取优惠劵
+ List<CouponInfo> list2 = couponInfoService.lambdaQuery().le(CouponInfo::getSendStartTime, now).ge(CouponInfo::getSendEndTime, now).eq(CouponInfo::getPersonType, 3).apply("FIND_IN_SET('" + appUserById.getVipId() + "', person_ids)").list();
+ List<CouponInfo> returnList= new ArrayList<>();
+ count(userid, list, returnList);
+ count(userid, list1, returnList);
+ count(userid, list2, returnList);
+
+
+ return R.ok(returnList);
+ }
+
+ private void count(Long userid, List<CouponInfo> list1, List<CouponInfo> returnList) {
+ for (CouponInfo couponInfo : list1) {
+ Long count = appUserClient.getCouponCount(userid, couponInfo.getId()).getData();
+ couponInfo.setMaxNum(couponInfo.getMaxNum()-count.intValue());
+ for (int i = 0; i < couponInfo.getMaxNum(); i++) {
+ returnList.add(couponInfo);
+ }
+ }
+ }
+
/**
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 c60de73..3f1dfcc 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
@@ -4,11 +4,17 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.GoodsCategory;
import com.ruoyi.other.service.GoodsCategoryService;
+import io.swagger.annotations.ApiOperation;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.other.api.domain.GoodsCategory;
+import com.ruoyi.other.service.GoodsCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@@ -28,6 +34,16 @@
@Resource
private GoodsCategoryService goodsCategoryService;
+ @PostMapping("/index/list")
+ @ApiOperation(value = "商品分类", tags = {"小程序-首页"})
+ public R<List<GoodsCategory>> indexlist(){
+ List<GoodsCategory> indexlist = goodsCategoryService.lambdaQuery()
+ .orderByDesc(GoodsCategory::getCreateTime)
+ .last("limit 8")
+ .list()
+ ;
+ return R.ok(indexlist);
+ }
@GetMapping("/list")
@ApiOperation(value = "商品分类列表", tags = {"小程序-商城-商城-首页-筛选"})
public R<List<GoodsCategory>> list(){
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 9ff7b15..2751b13 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
@@ -11,6 +11,10 @@
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.*;
import com.ruoyi.other.vo.NearbyShopVO;
import com.ruoyi.other.vo.ShopDetailVO;
import com.ruoyi.other.vo.VerifiableShopVo;
@@ -39,6 +43,14 @@
@Resource
private AppUserClient appUserClient;
+
+ @PostMapping("/getDetailById")
+ public R<Shop> getDetailById(@RequestParam("id") Long id){
+ Shop byId = shopService.getById(id);
+ return R.ok(byId);
+ }
+
+
/**
* 附近门店列表
*/
@@ -52,6 +64,15 @@
/**
* 门店详情
*/
+ @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("/shopDetail")
@ApiOperation(value = "门店详情", tags = {"小程序-首页-门店详情"})
public R<ShopDetailVO> shopDetail(@ApiParam("门店id") @RequestParam Integer shopId,
@@ -83,9 +104,9 @@
appUserClient.editAppUserById(appUser);
return R.ok();
}
-
-
-
+
+
+
@ResponseBody
@GetMapping("/getVerifiableShop")
@ApiOperation(value = "获取可核销门店列表", tags = {"购物车-小程序"})
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java
index 5ae1bc6..53ff538 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java
@@ -1,14 +1,19 @@
package com.ruoyi.other.controller;
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.SystemConfig;
+import com.ruoyi.other.api.dto.IndexConfigSetDto;
import com.ruoyi.other.service.SystemConfigService;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
+import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
+import java.util.List;
/**
* <p>
@@ -23,11 +28,28 @@
public class SystemConfigController {
@Resource
private SystemConfigService systemConfigService;
- @GetMapping("/byType")
- @ApiOperation(value = "1=启动页管理,2=首页配置,3=订单包邮设置", tags = {"小程序-启动页面","小程序-首页","订单包邮配置"})
- public R<SystemConfig> byType(Integer type){
- SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, type).last("limit 1").one();
- return R.ok(one);
+ @PostMapping("/index/add")
+ @ApiOperation(value = "添加", tags = {"后台-广告管理-首页配置"})
+ public R add(@RequestBody IndexConfigSetDto indexConfigSetDto){
+ //先删除type=2的数据
+ List<SystemConfig> list = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 2).list();
+ systemConfigService.removeBatchByIds(list);
+ SystemConfig systemConfig = new SystemConfig();
+ systemConfig.setType(2);
+ systemConfig.setContent(JSON.toJSONString(indexConfigSetDto));
+ systemConfigService.save(systemConfig);
+ return R.ok();
+ }
+ @PostMapping("/index/detail")
+ @ApiOperation(value = "宣传图片-公司简介", tags = {"后台-广告管理-首页配置","小程序-首页"})
+ public R<IndexConfigSetDto> detail(){
+ SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 2).one();
+ if (one==null){
+ return R.ok();
+ }
+ IndexConfigSetDto indexConfigSetDto = JSONObject.parseObject(one.getContent(), IndexConfigSetDto.class);
+ return R.ok(indexConfigSetDto);
+
}
@@ -42,5 +64,6 @@
SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, type).last("limit 1").one();
return R.ok(one);
}
+
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
index e7ff8cd..63bc187 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
@@ -1,6 +1,23 @@
package com.ruoyi.other.controller;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.security.service.TokenService;
+import com.ruoyi.other.api.domain.GoodsEvaluate;
+import com.ruoyi.other.api.domain.Technician;
+import com.ruoyi.other.api.domain.TechnicianSubscribe;
+import com.ruoyi.other.api.feignClient.OrderClient;
+import com.ruoyi.other.service.GoodsEvaluateService;
+import com.ruoyi.other.service.TechnicianService;
+import com.ruoyi.other.service.TechnicianSubscribeService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.List;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.other.service.TechnicianService;
@@ -26,9 +43,73 @@
*/
@RestController
@RequestMapping("/technician")
-public class TechnicianController extends BaseController {
+public class TechnicianController {
@Resource
private TechnicianService technicianService;
+ @Resource
+ private GoodsEvaluateService goodsEvaluateService;
+ @Resource
+ private OrderClient orderClient;
+ @Resource
+ private TechnicianSubscribeService technicianSubscribeService;
+ @Resource
+ private TokenService tokenService;
+ @PostMapping("/shop/list")
+ @ApiOperation(value = "获取门店的技师列表", tags = {"小程序-门店详情-技师预约"})
+ public R<Page<Technician>> shoplist(@RequestParam Integer shopId,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
+ //查出技师列表
+ Page<Technician> page = technicianService.lambdaQuery().eq(Technician::getShopId, shopId).eq(Technician::getStatus, 2).page(Page.of(pageNum, pageSize));
+ for (Technician technician : page.getRecords()) {
+ //查出技师订单
+ R<List<Long>> orderIdsByTechId = orderClient.getOrderIdsByTechId(technician.getId());
+ if (orderIdsByTechId.getData().isEmpty()){
+ technician.setGrade(new BigDecimal(0));
+ technician.setServeCount(0);
+ continue;
+ }
+ //查出技师评价
+ List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().in(GoodsEvaluate::getOrderId, orderIdsByTechId.getData()).list();
+
+ //算出平均分并保留一位小数
+ BigDecimal avg = list.stream().map(GoodsEvaluate::getGrade).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(list.size()), 1, BigDecimal.ROUND_HALF_UP);
+ technician.setGrade(avg);
+ technician.setServeCount(orderIdsByTechId.getData().size());
+
+ }
+ return R.ok(page);
+ }
+
+ @PostMapping("/shop/detail")
+ @ApiOperation(value = "获取门店的技师详情", tags = {"小程序-门店详情-技师预约"})
+ public R<Technician> shopdetail(@RequestParam Integer techId){
+ //查出技师列表
+ Technician technician = technicianService.getById(techId);
+
+ //查出技师订单
+ R<List<Long>> orderIdsByTechId = orderClient.getOrderIdsByTechId(technician.getId());
+ if (orderIdsByTechId.getData().isEmpty()){
+ technician.setGrade(new BigDecimal(0));
+ technician.setServeCount(0);
+ return R.ok(technician);
+ }
+ //查出技师评价
+ List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().in(GoodsEvaluate::getOrderId, orderIdsByTechId.getData()).list();
+
+ //算出平均分并保留一位小数
+ BigDecimal avg = list.stream().map(GoodsEvaluate::getGrade).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(list.size()), 1, BigDecimal.ROUND_HALF_UP);
+ technician.setGrade(avg);
+ technician.setServeCount(orderIdsByTechId.getData().size());
+ return R.ok(technician);
+ }
+ @PostMapping("/shop/tech")
+ @ApiOperation(value = "预约操作", tags = {"小程序-门店详情-技师预约"})
+ public R<Technician> shoptech(@RequestBody TechnicianSubscribe subscribe){
+ Long userId = tokenService.getLoginUserApplet().getUserId();
+ subscribe.setAppUserId(userId);
+ technicianSubscribeService.save(subscribe);
+ return R.ok();
+ }
+
/**
* 指定门店技师列表
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 b072ab6..9b6010f 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
@@ -73,5 +73,16 @@
return R.ok();
}
+
+ @GetMapping("/home/list")
+ @ApiOperation(value = "列表", notes = "列表", tags = {"小程序-个人中心-我的预约"})
+ public TableDataInfo homelist(@ApiParam(value = "状态 0=待服务,1=已服务,2=已取消 4 已到期") @RequestParam Integer status){
+ startPage();
+ List<TechnicianSubscribeVO> list = technicianSubscribeService
+ .getTechnicianSubscribeByUser(SecurityUtils.getUserId(),status);
+ return getDataTable(list);
+ }
+
+
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java
index 82d8443..5543b93 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java
@@ -1,6 +1,12 @@
package com.ruoyi.other.controller;
+import com.ruoyi.account.api.model.AppUser;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.other.api.domain.VipSetting;
+import com.ruoyi.other.service.VipSettingService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.VipSetting;
import com.ruoyi.other.service.VipSettingService;
@@ -10,6 +16,9 @@
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;
+import java.util.List;
import javax.annotation.Resource;
@@ -27,6 +36,13 @@
public class VipSettingController {
@Resource
private VipSettingService vipSettingService;
+ @PostMapping("/info")
+ @ApiOperation(value = "获取各级会员信息", tags = {"小程序-个人中心首页"})
+ public R<List<VipSetting>> info(){
+ List<VipSetting> list = vipSettingService.list();
+ return R.ok(list);
+ }
+
@GetMapping("getVipSettingById")
@ApiOperation(value = "获取会员设置")
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 372bfbb..b3a3294 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
@@ -24,4 +24,6 @@
*/
public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(@Param("userId") Long userId,
@Param("shopId") Long shopId);
+ public List<TechnicianSubscribeVO> getTechnicianSubscribeByUser(@Param("userId") Long userId,
+ @Param("status") Integer status);
}
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 f2e2555..b31e9a0 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
@@ -20,6 +20,7 @@
* 查询用于指定门店的相关预约记录
*/
List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long userId, Long shopId);
+ List<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Long userId, Integer status);
void subscribe(TechnicianSubscribe technicianSubscribe);
}
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 e1434cb..3220f8c 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
@@ -37,6 +37,10 @@
public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long userId, Long shopId) {
return technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(userId, shopId);
}
+ @Override
+ public List<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Long userId, Integer status) {
+ return technicianSubscribeMapper.getTechnicianSubscribeByUser(userId, status);
+ }
@Override
@Transactional(rollbackFor = Exception.class)
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
index 699342d..1ec6886 100644
--- 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
@@ -49,6 +49,6 @@
/**
* 预约状态:0=待服务,1=已服务,2=已取消
*/
- @ApiModelProperty(value = "预约状态:0=待服务,1=已服务,2=已取消")
+ @ApiModelProperty(value = "预约状态:0=待服务,1=已服务,2=已取消 4 已到期")
private Integer status;
}
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
index df9a062..568c57a 100644
--- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
+++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
@@ -22,4 +22,35 @@
AND tts.del_flag = 0
ORDER BY tts.create_time DESC
</select>
+
+ <select id="getTechnicianSubscribeByUser" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO">
+ SELECT * from (
+ SELECT
+ tts.user_address,
+ ts.`name` shopName,
+ ts.address shopAddress,
+ tt.name technicianName,
+ tts.subscribe_time,
+ tts.service_mode,
+ CASE
+ WHEN tts.subscribe_time lt; NOW() THEN 4
+ ELSE tts.status
+ END AS 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
+ tts.app_user_id = #{userId}
+ AND tts.del_flag = 0
+ ORDER BY tts.create_time DESC
+
+ ) o
+ <where>
+ <if test="status !=null">
+ o.status = #{status}
+ </if>
+ </where>
+
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.7.1