1 文件已重命名
28个文件已修改
1个文件已删除
21个文件已添加
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | 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("编辑用户信息失败"); |
| | | } |
| | | |
| | | }; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | */ |
| | | @FeignClient(contextId = "AppUserClient", value = ServiceNameConstants.ACCOUNT_SERVICE, fallbackFactory = AppUserClientFallbackFactory.class) |
| | | public interface AppUserClient { |
| | | |
| | | |
| | | /** |
| | | * 根据id获取用户 |
| | | * @param id |
| | |
| | | */ |
| | | @PostMapping("/appUser/getAppUserById") |
| | | AppUser getAppUserById(@RequestParam("id") Long id); |
| | | |
| | | |
| | | /** |
| | | * 根据id编辑用户 |
| | | */ |
| | | @PostMapping("/appUser/editAppUserById") |
| | | R<Void> editAppUserById(@RequestParam("appUser") AppUser appUser); |
| | | } |
| | |
| | | @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") |
New file |
| | |
| | | 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(type = IdType.AUTO) |
| | | 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; |
| | | } |
| | |
| | | package factory; |
| | | |
| | | import feignClient.RemoteOrderClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | |
| | | * @author luofl |
| | | */ |
| | | @Component |
| | | public class RemoteOrderFallbackFactory { |
| | | public class RemoteOrderFallbackFactory implements FallbackFactory<RemoteOrderClient> { |
| | | |
| | | @Override |
| | | public RemoteOrderClient create(Throwable cause) { |
| | | return new RemoteOrderClient() { |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | 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("编辑用户信息失败"); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 订单远程调用接口 |
| | |
| | | */ |
| | | @FeignClient(contextId = "RemoteOrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = RemoteOrderFallbackFactory.class) |
| | | public interface RemoteOrderClient { |
| | | |
| | | } |
New file |
| | |
| | | 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); |
| | | } |
| | |
| | | @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; |
| | |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | | @TableField("name") |
| | |
| | | @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; |
| | |
| | | |
| | | @ApiModelProperty(value = "店长用户id") |
| | | @TableField("app_user_id") |
| | | private Integer appUserId; |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "客户电话(同步到t_phone表)") |
| | | @TableField("service_tel") |
| | |
| | | @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 |
| | |
| | | @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; |
New file |
| | |
| | | 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 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.math.BigDecimal; |
| | | |
| | | @Api("钱包") |
| | | @RestController |
| | | @RequestMapping("wallet") |
| | | public class WalletController extends BaseController { |
| | | @Resource |
| | | private BalanceChangeRecordService balanceChangeRecordService; |
| | | |
| | | /** |
| | | * 钱包详情 |
| | | */ |
| | | @GetMapping("detail") |
| | | @ApiOperation(value = "钱包详情", notes = "钱包详情") |
| | | public AjaxResult detail() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | // TODO 查询钱包详情 |
| | | WalletVO walletVO = new WalletVO(); |
| | | return AjaxResult.success(walletVO); |
| | | } |
| | | |
| | | /** |
| | | * 变更明细 |
| | | */ |
| | | @ApiOperation(value = "变更明细", notes = "变更明细") |
| | | @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(); |
| | | // } |
| | | |
| | | } |
| | |
| | | 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 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> |
| | |
| | | @RequestMapping("/withdrawal-requests") |
| | | public class WithdrawalRequestsController { |
| | | |
| | | @Resource |
| | | private WithdrawalRequestsService withdrawalRequestsService; |
| | | |
| | | /** |
| | | * 提现申请 |
| | | */ |
| | | @PostMapping("/withdrawalApply") |
| | | public AjaxResult withdrawalApply(@RequestBody WithdrawalRequestsDTO params){ |
| | | withdrawalRequestsService.withdrawalApply(params); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | 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; |
| | | } |
New file |
| | |
| | | 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> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | |
| | | public interface BalanceChangeRecordService extends IService<BalanceChangeRecord> { |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | import com.ruoyi.account.dto.WithdrawalRequestsDTO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface WithdrawalRequestsService extends IService<WithdrawalRequests> { |
| | | |
| | | /** |
| | | * 提现申请 |
| | | */ |
| | | void withdrawalApply(WithdrawalRequestsDTO params); |
| | | } |
New file |
| | |
| | | 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 { |
| | | } |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | @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); |
| | | } |
| | | } |
File was renamed from ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/WalletVO.java |
| | |
| | | package com.ruoyi.other.vo; |
| | | package com.ruoyi.account.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
New file |
| | |
| | | <?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> |
| | |
| | | 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> |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import model.OrderGood; |
| | | import model.RefundPassOrderGood; |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | 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; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/goods-category") |
| | | @Api(tags = "商品分类") |
| | | public class GoodsCategoryController { |
| | | @Resource |
| | | private GoodsCategoryService goodsCategoryService; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "商品分类列表") |
| | | public AjaxResult list(){ |
| | | return AjaxResult.success(goodsCategoryService.list()); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | 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> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/goods") |
| | | public class GoodsController { |
| | | @Api("商品") |
| | | public class GoodsController extends BaseController { |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | /** |
| | | * 商品列表 |
| | | */ |
| | | @GetMapping("/goodsList") |
| | | @ApiOperation(value = "商品列表") |
| | | public TableDataInfo goodsList(Goods goods){ |
| | | startPage(); |
| | | return getDataTable(goodsService.goodsList(goods)); |
| | | } |
| | | |
| | | /** |
| | | * 商品详情 |
| | | */ |
| | | @GetMapping("/goodsDetail/{goodsId}") |
| | | public AjaxResult goodsDetail(@PathVariable("goodsId") Integer goodsId){ |
| | | return success(goodsService.getById(goodsId)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | * @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 = "秒杀活动列表") |
| | | public AjaxResult list(Goods goods) |
| | | { |
| | | startPage(); |
| | | return AjaxResult.success(seckillActivityInfoService.listSeckillActivity(goods)); |
| | | } |
| | | |
| | | /** |
| | | * 秒杀活动详情 |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation(value = "秒杀活动详情") |
| | | public AjaxResult detail(@PathVariable("id") Integer id) |
| | | { |
| | | return AjaxResult.success(seckillActivityInfoService.detail(id)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | @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 = {"分享"}) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody Share share){ |
| | | share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); |
| | | return toAjax(shareService.updateById(share)); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | 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> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/shop") |
| | | @Api("门店") |
| | | public class ShopController extends BaseController { |
| | | @Resource |
| | | private TechnicianService technicianService; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private ShopService shopService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | /** |
| | | * 指定门店技师列表 |
| | | */ |
| | | @RequestMapping("/technicianList") |
| | | public AjaxResult technicianList(@RequestParam String shopId){ |
| | | @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(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | 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> |
| | |
| | | * @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 = "预约列表") |
| | | 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 = "取消服务") |
| | | 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(); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | 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; |
| | | } |
| | | } |
New file |
| | |
| | | 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; |
| | | } |
| | | } |
New file |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | public interface SeckillActivityInfoMapper extends BaseMapper<SeckillActivityInfo> { |
| | | |
| | | List<SeckillActivityVO> listSeckillActivity(Goods goods); |
| | | |
| | | SeckillActivityDetailVO selectDetail(Integer seckillActivityId); |
| | | } |
| | |
| | | |
| | | 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> |
| | |
| | | */ |
| | | public interface TechnicianSubscribeMapper extends BaseMapper<TechnicianSubscribe> { |
| | | |
| | | /** |
| | | * 查看用户预约记录 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(@Param("userId") Long userId, |
| | | @Param("shopId") Long shopId); |
| | | } |
| | |
| | | |
| | | 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> |
| | |
| | | */ |
| | | public interface GoodsService extends IService<Goods> { |
| | | |
| | | List<GoodsVO> goodsList(Goods goods); |
| | | |
| | | GoodsVO goodsDetail(Long goodsId); |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | public interface SeckillActivityInfoService extends IService<SeckillActivityInfo> { |
| | | |
| | | List<SeckillActivityVO> listSeckillActivity(Goods goods); |
| | | |
| | | SeckillActivityDetailVO detail(Integer seckillActivityId); |
| | | } |
| | |
| | | |
| | | 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 |
| | |
| | | */ |
| | | public interface TechnicianSubscribeService extends IService<TechnicianSubscribe> { |
| | | |
| | | /** |
| | | * 查询用于指定门店的相关预约记录 |
| | | */ |
| | | List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long userId, Long shopId); |
| | | |
| | | } |
| | |
| | | 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 |
| | |
| | | */ |
| | | @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) { |
| | | Goods goods = this.getById(goodsId); |
| | | if (Objects.nonNull(goods)){ |
| | | GoodsVO goodsVO = new GoodsVO(); |
| | | BeanUtils.copyBeanProp(goodsVO, goods); |
| | | } |
| | | return new GoodsVO(); |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | @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; |
| | | } |
| | | } |
| | |
| | | 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> |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | } |
New file |
| | |
| | | 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=服务商品,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 = "划线价") |
| | | private BigDecimal originalPrice; |
| | | |
| | | @ApiModelProperty(value = "基础售价") |
| | | private BigDecimal sellingPrice; |
| | | |
| | | @ApiModelProperty(value = "已售数量") |
| | | private Integer saleNum; |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | } |
New file |
| | |
| | | <?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> |
New file |
| | |
| | | <?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> |
New file |
| | |
| | | |
| | | <?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> |