ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java
@@ -77,6 +77,10 @@ @ApiModelProperty(value = "最后一次登录时间") @TableField("last_login_time") private LocalDateTime lastLoginTime; @ApiModelProperty(value = "顶级推广人id") @TableField("top_invite_id") private Long topInviteId; @ApiModelProperty(value = "推广人id") @TableField("invite_user_id") @@ -122,23 +126,63 @@ @ApiModelProperty(value = "可提现金额") @TableField("withdrawable_amount") private BigDecimal withdrawal_amount; private BigDecimal withdrawableAmount; @ApiModelProperty(value = "已提现金额") @TableField("withdrawn_amount") private BigDecimal withdrawn_amount; private BigDecimal withdrawnAmount; @ApiModelProperty(value = "充值总金额") @TableField("total_recharge_amount") private BigDecimal total_recharge_amount; private BigDecimal totalRechargeAmount; @ApiModelProperty(value = "红包总金额") @TableField("total_red_packet_amount") private BigDecimal total_red_packet_amount; private BigDecimal totalRedPacketAmount; @ApiModelProperty(value = "分销总金额") @TableField("total_distribution_amount") private BigDecimal total_distribution_amount; private BigDecimal totalDistributionAmount; @ApiModelProperty(value = "剩余积分") @TableField("lave_point") private BigDecimal lavePoint; @ApiModelProperty(value = "是否可更换推广人(0=否,1=是)") @TableField("change_promoter") private Integer changePromoter; @ApiModelProperty(value = "经度") @TableField("longitude") private String longitude; @ApiModelProperty(value = "纬度") @TableField("latitude") private String latitude; @ApiModelProperty(value = "省") @TableField("province") private String province; @ApiModelProperty(value = "省编号") @TableField("province_code") private String provinceCode; @ApiModelProperty(value = "市") @TableField("city") private String city; @ApiModelProperty(value = "市编号") @TableField("city_code") private String cityCode; @ApiModelProperty(value = "区") @TableField("district") private String district; @ApiModelProperty(value = "区编号") @TableField("district_code") private String districtCode; @ApiModelProperty("等级1会员数") private Long count1; ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUserBank.java
New file @@ -0,0 +1,43 @@ package com.ruoyi.account.api.model; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author zhibing.pu * @Date 2024/11/25 14:59 */ @Data @ApiModel @TableName("t_app_user_bank") public class AppUserBank { /** * 主键 */ @TableId(value = "id", type = IdType.NONE) @ApiModelProperty(value = "数据id") private Long id; /** * 用户id */ @TableField("app_user_id") @ApiModelProperty(value = "用户id") private Long appUserId; /** * 开户银行名称 */ @TableField("bank_name") @ApiModelProperty(value = "开户银行名称", required = true) private String bankName; /** * 银行卡号 */ @TableField("bank_number") @ApiModelProperty(value = "银行卡号", required = true) private String bankNumber; } ruoyi-api/ruoyi-api-order/src/main/java/feignClient/RemoteOrderGoodsClient.java
@@ -6,10 +6,8 @@ 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; ruoyi-api/ruoyi-api-order/src/main/java/model/Order.java
@@ -84,6 +84,10 @@ @TableField("express_json") private String expressJson; @ApiModelProperty(value = "收货地址信息") @TableField("address_json") private String addressJson; @ApiModelProperty(value = "平台分佣") @TableField("share_amount") private BigDecimal shareAmount; ruoyi-api/ruoyi-api-order/src/main/java/model/ShoppingCart.java
File was renamed from ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShoppingCart.java @@ -1,5 +1,6 @@ package com.ruoyi.other.api.domain; package model; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; @@ -19,9 +20,11 @@ @TableId private Long id; @ApiModelProperty("用户id") @TableField("app_user_id") private Long appUserId; @ApiModelProperty("商品id") private Long goodsId; @TableField("goods_id") private Integer goodsId; @ApiModelProperty("数量") private Integer number; } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java
@@ -104,7 +104,7 @@ @ApiModelProperty(value = "商品权限JSON(0=全部,1=游客,2=普通会员,3=黄金会员,4=钻石会员,5=准代理,6=代理,7=总代,8=合伙人)") @TableField("commodity_authority") private Integer commodityAuthority; private String commodityAuthority; @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsArea.java
New file @@ -0,0 +1,128 @@ package com.ruoyi.other.api.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.math.BigDecimal; /** * <p> * * </p> * * @author luodangjia * @since 2024-11-20 */ @Data @EqualsAndHashCode(callSuper = false) @TableName("t_goods_area") @ApiModel(value="GoodsArea对象", description="") public class GoodsArea implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键") @TableId(value = "id", type = IdType.NONE) private Long id; @ApiModelProperty(value = "商品id") @TableField("goods_id") private Integer goodsId; @ApiModelProperty(value = "省") @TableField("province") private String province; @ApiModelProperty(value = "省编号") @TableField("province_code") private String provinceCode; @ApiModelProperty(value = "市") @TableField("city") private String city; @ApiModelProperty(value = "市编号") @TableField("city_code") private String cityCode; @ApiModelProperty(value = "区") @TableField("districts") private String districts; @ApiModelProperty(value = "区编号") @TableField("districts_code") private String districtsCode; @ApiModelProperty(value = "会员级别(1=普通会员,2=黄金会员,3=钻石会员,4=准代理,5=代理,6=总代,7=合伙人)") @TableField("vip") private Integer vip; @ApiModelProperty(value = "现金支付(0=否,1=是)") @TableField("cash_payment") private Integer cashPayment; @ApiModelProperty(value = "积分支付(0=否,1=是)") @TableField("point_payment") private Integer pointPayment; @ApiModelProperty(value = "基础售价") @TableField("selling_price") private BigDecimal sellingPrice; @ApiModelProperty(value = "基础积分") @TableField("integral") private Integer integral; @ApiModelProperty(value = "可获得消费积分") @TableField("earn_spending_points") private Integer earnSpendingPoints; @ApiModelProperty(value = "上级获得分佣金额") @TableField("superior_subcommission") private BigDecimal superiorSubcommission; @ApiModelProperty(value = "上级获得返佣积分") @TableField("superior_rebate_points") private Integer superiorRebatePoints; @ApiModelProperty(value = "获取返佣积分上级类型(1=直推上级,2=直帮上级)") @TableField("superior_type") private Integer superiorType; @ApiModelProperty(value = "核销门店可获得服务费") @TableField("servuce_shop_charges") private BigDecimal servuceShopCharges; @ApiModelProperty(value = "核销门店可获得服务积分") @TableField("servuce_shop_points") private Integer servuceShopPoints; @ApiModelProperty(value = "技师可获得服务积分") @TableField("technician_points") private Integer technicianPoints; @ApiModelProperty(value = "绑定门店可获得分佣金额") @TableField("bound_shop_charges") private BigDecimal boundShopCharges; @ApiModelProperty(value = "绑定门店可获得返佣积分") @TableField("bound_shop_points") private Integer boundShopPoints; @ApiModelProperty(value = "绑定门店上级门店可获得分佣金额") @TableField("bound_shop_superiors_charges") private BigDecimal boundShopSuperiorsCharges; @ApiModelProperty(value = "绑定门店上级门店可获得返佣积分") @TableField("bound_shop_superiors_points") private Integer boundShopSuperiorsPoints; } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsSeckill.java
@@ -32,9 +32,9 @@ @TableId(value = "id", type = IdType.AUTO) private Integer id; @ApiModelProperty(value = "商品id") @TableField("goods_id") private Integer goodsId; @ApiModelProperty(value = "秒杀活动主表") @TableField("seckill_activity_info_id") private Integer seckillActivityInfoId; @ApiModelProperty(value = "会员级别(1=普通会员,2=黄金会员,3=钻石会员,4=准代理,5=代理,6=总代,7=合伙人)") @TableField("vip") @@ -99,6 +99,10 @@ @ApiModelProperty(value = "绑定门店上级门店可获得返佣积分") @TableField("bound_shop_superiors_points") private Integer boundShopSuperiorsPoints; @ApiModelProperty(value = "活动结束时间") @TableField(exist = false) private Long endTime; } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Region.java
New file @@ -0,0 +1,31 @@ package com.ruoyi.other.api.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; @Data @EqualsAndHashCode(callSuper = false) @TableName("t_region") @ApiModel(value="Region对象", description="") public class Region implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; private String name; private String code; private String citycode; private Long parentId; private String english; } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java
@@ -154,14 +154,6 @@ @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 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TechnicianScore.java
New file @@ -0,0 +1,33 @@ package com.ruoyi.other.api.domain; 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; @Data @EqualsAndHashCode(callSuper = false) @TableName("t_goods_evaluate") @ApiModel(value="GoodsEvaluate对象", description="") public class TechnicianScore implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键") private Long id; @ApiModelProperty(value = "app_user_id") private Long appUserId; @ApiModelProperty(value = "技师id") private Long technicianId; @ApiModelProperty(value = "评分") private BigDecimal score; @ApiModelProperty(value = "添加时间") private LocalDateTime createTime; } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TechnicianSubscribe.java
@@ -38,7 +38,7 @@ @ApiModelProperty(value = "技师id") @TableField("technician_id") private Integer technicianId; private Long technicianId; @ApiModelProperty(value = "预约时间") @TableField("subscribe_time") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsAreaClientFallbackFactory.java
New file @@ -0,0 +1,25 @@ package com.ruoyi.other.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.GoodsArea; import com.ruoyi.other.api.feignClient.GoodsAreaClient; import org.springframework.cloud.openfeign.FallbackFactory; /** * @author zhibing.pu * @Date 2024/11/27 20:29 */ public class GoodsAreaClientFallbackFactory implements FallbackFactory<GoodsAreaClient> { @Override public GoodsAreaClient create(Throwable cause) { return new GoodsAreaClient() { @Override public R<GoodsArea> getGoodsArea(GoodsArea area) { return R.fail("根据省市区获取地区价格配置失败:" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsBargainPriceClientFallbackFactory.java
New file @@ -0,0 +1,21 @@ package com.ruoyi.other.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.GoodsBargainPriceDetail; import com.ruoyi.other.api.feignClient.GoodsBargainPriceClient; import com.ruoyi.other.api.vo.GetGoodsBargainPrice; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.openfeign.FallbackFactory; @Slf4j public class GoodsBargainPriceClientFallbackFactory implements FallbackFactory<GoodsBargainPriceClient> { @Override public GoodsBargainPriceClient create(Throwable cause) { return new GoodsBargainPriceClient(){ @Override public R<GoodsBargainPriceDetail> getGoodsBargainPrice(GetGoodsBargainPrice goodsBargainPrice) { return R.fail("根据商品id和会员等级获取门店特价失败:" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsClientFallbackFactory.java
New file @@ -0,0 +1,29 @@ package com.ruoyi.other.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.feignClient.GoodsClient; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.openfeign.FallbackFactory; import java.util.List; /** * @author zhibing.pu * @Date 2024/11/27 19:57 */ @Slf4j public class GoodsClientFallbackFactory implements FallbackFactory<GoodsClient> { @Override public GoodsClient create(Throwable cause) { return new GoodsClient(){ @Override public R<List<Goods>> getGoodsByType(Integer type) { return R.fail("根据类型(1=服务商品,2=单品商品)获取商品数据失败:" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsShopClientFallbackFactory.java
New file @@ -0,0 +1,24 @@ package com.ruoyi.other.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.GoodsShop; import com.ruoyi.other.api.feignClient.GoodsShopClient; import org.springframework.cloud.openfeign.FallbackFactory; /** * @author zhibing.pu * @Date 2024/11/27 20:29 */ public class GoodsShopClientFallbackFactory implements FallbackFactory<GoodsShopClient> { @Override public GoodsShopClient create(Throwable cause) { return new GoodsShopClient() { @Override public R<GoodsShop> getGoodsShop(GoodsShop goodsShop) { return R.fail("获取商品门店关系数据失败:" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsVipClientFallbackFactory.java
New file @@ -0,0 +1,27 @@ package com.ruoyi.other.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.GoodsArea; import com.ruoyi.other.api.domain.GoodsVip; import com.ruoyi.other.api.feignClient.GoodsVipClient; import org.springframework.cloud.openfeign.FallbackFactory; /** * @author zhibing.pu * @Date 2024/11/27 20:29 */ public class GoodsVipClientFallbackFactory implements FallbackFactory<GoodsVipClient> { @Override public GoodsVipClient create(Throwable cause) { return new GoodsVipClient() { @Override public R<GoodsVip> getGoodsVip(Integer vip) { return R.fail("获取会员价格配置失败:" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/RemoteVipSettingFallbackFactory.java
New file @@ -0,0 +1,22 @@ package com.ruoyi.other.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.other.api.domain.VipSetting; import com.ruoyi.other.api.feignClient.RemoteVipSettingClient; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.openfeign.FallbackFactory; @Slf4j public class RemoteVipSettingFallbackFactory implements FallbackFactory<RemoteVipSettingClient> { @Override public RemoteVipSettingClient create(Throwable cause) { return new RemoteVipSettingClient(){ @Override public R<VipSetting> getVipSettingById(Integer id) { log.error("获取会员设置信息失败:{}", cause.getMessage()); throw new ServiceException("获取会员设置信息失败"); } }; } } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/SeckillActivityInfoClientFallbackFactory.java
New file @@ -0,0 +1,20 @@ package com.ruoyi.other.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.GoodsSeckill; import com.ruoyi.other.api.feignClient.SeckillActivityInfoClient; import com.ruoyi.other.api.vo.GetSeckillActivityInfo; import lombok.extern.slf4j.Slf4j; @Slf4j public class SeckillActivityInfoClientFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<SeckillActivityInfoClient> { @Override public SeckillActivityInfoClient create(Throwable cause) { return new SeckillActivityInfoClient(){ @Override public R<GoodsSeckill> getSeckillActivityInfo(GetSeckillActivityInfo info) { return R.fail("根据商品id和会员等级获取对应的秒杀活动失败:" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsAreaClient.java
New file @@ -0,0 +1,26 @@ 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.GoodsArea; import com.ruoyi.other.api.factory.GoodsAreaClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; /** * @author zhibing.pu * @Date 2024/11/28 9:38 */ @FeignClient(contextId = "GoodsAreaClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = GoodsAreaClientFallbackFactory.class) public interface GoodsAreaClient { /** * 根据省市区获取地区价格配置 * @param area * @return */ @PostMapping("/goodsArea/getGoodsArea") R<GoodsArea> getGoodsArea(@RequestBody GoodsArea area); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsBargainPriceClient.java
New file @@ -0,0 +1,27 @@ 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.GoodsBargainPriceDetail; import com.ruoyi.other.api.factory.GoodsBargainPriceClientFallbackFactory; import com.ruoyi.other.api.vo.GetGoodsBargainPrice; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; /** * @author zhibing.pu * @Date 2024/11/28 10:53 */ @FeignClient(contextId = "GoodsBargainPriceClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = GoodsBargainPriceClientFallbackFactory.class) public interface GoodsBargainPriceClient { /** * 根据商品id和会员等级获取门店特价 * @param goodsBargainPrice * @return */ @PostMapping("/goods-bargain-price/getGoodsBargainPrice") R<GoodsBargainPriceDetail> getGoodsBargainPrice(@RequestBody GetGoodsBargainPrice goodsBargainPrice); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java
New file @@ -0,0 +1,29 @@ 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.Goods; import com.ruoyi.other.api.factory.GoodsClientFallbackFactory; 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 zhibing.pu * @Date 2024/11/27 19:56 */ @FeignClient(contextId = "GoodsClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = GoodsClientFallbackFactory.class) public interface GoodsClient{ /** * 根据类型(1=服务商品,2=单品商品)获取商品数据 * @param type * @return */ @PostMapping("/goods/getGoodsByType") R<List<Goods>> getGoodsByType(@RequestParam("type") Integer type); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsShopClient.java
New file @@ -0,0 +1,25 @@ 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.GoodsShop; import com.ruoyi.other.api.factory.GoodsShopClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; /** * @author zhibing.pu * @Date 2024/11/27 20:28 */ @FeignClient(contextId = "GoodsShopClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = GoodsShopClientFallbackFactory.class) public interface GoodsShopClient { /** * 获取商品门店关系数据 * @param goodsShop * @return */ @PostMapping("/goods-shop/getGoodsShop") R<GoodsShop> getGoodsShop(@RequestBody GoodsShop goodsShop); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsVipClient.java
New file @@ -0,0 +1,26 @@ 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.GoodsVip; 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.RequestParam; /** * @author zhibing.pu * @Date 2024/11/28 9:42 */ @FeignClient(contextId = "GoodsVipClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = GoodsVipClientFallbackFactory.class) public interface GoodsVipClient { /** * 获取会员价格配置 * @param vip * @return */ @PostMapping("/goods-vip/getGoodsVip") R<GoodsVip> getGoodsVip(@RequestParam("vip") Integer vip); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/RemoteVipSettingClient.java
New file @@ -0,0 +1,15 @@ 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.VipSetting; import com.ruoyi.other.api.factory.RemoteVipSettingFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; @FeignClient(contextId = "RemoteOrderGoodsClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = RemoteVipSettingFallbackFactory.class) public interface RemoteVipSettingClient { @GetMapping("/vip-setting/getVipSettingById") R<VipSetting> getVipSettingById(Integer id); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/SeckillActivityInfoClient.java
New file @@ -0,0 +1,27 @@ 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.GoodsSeckill; import com.ruoyi.other.api.factory.SeckillActivityInfoClientFallbackFactory; import com.ruoyi.other.api.vo.GetSeckillActivityInfo; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; /** * @author zhibing.pu * @Date 2024/11/28 10:38 */ @FeignClient(contextId = "SeckillActivityInfoClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = SeckillActivityInfoClientFallbackFactory.class) public interface SeckillActivityInfoClient { /** * 根据商品id和会员等级获取对应的秒杀活动 * @param info * @return */ @PostMapping("/seckill-activity-info/getSeckillActivityInfo") R<GoodsSeckill> getSeckillActivityInfo(@RequestBody GetSeckillActivityInfo info); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/model/Agreement.java
File was deleted ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/vo/GetGoodsBargainPrice.java
New file @@ -0,0 +1,23 @@ package com.ruoyi.other.api.vo; import lombok.Data; /** * @author zhibing.pu * @Date 2024/11/28 10:47 */ @Data public class GetGoodsBargainPrice { /** * 商品id */ private Integer goodsId; /** * 会员 */ private Integer vip; /** * 门店id */ private Integer shopId; } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/vo/GetSeckillActivityInfo.java
New file @@ -0,0 +1,19 @@ package com.ruoyi.other.api.vo; import lombok.Data; /** * @author zhibing.pu * @Date 2024/11/28 10:33 */ @Data public class GetSeckillActivityInfo { /** * 商品id */ private Integer goodsId; /** * 会员 */ private Integer vip; } ruoyi-api/ruoyi-api-other/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1,6 @@ com.ruoyi.other.api.factory.GoodsClientFallbackFactory com.ruoyi.other.api.factory.GoodsShopClientFallbackFactory com.ruoyi.other.api.factory.GoodsAreaClientFallbackFactory com.ruoyi.other.api.factory.GoodsVipClientFallbackFactory com.ruoyi.other.api.factory.SeckillActivityInfoClientFallbackFactory com.ruoyi.other.api.factory.GoodsBargainPriceClientFallbackFactory ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/RemoteFileService.java
New file @@ -0,0 +1,29 @@ package com.ruoyi.system.api; import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysFile; import com.ruoyi.system.api.factory.RemoteFileFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; /** * 文件服务 * * @author ruoyi */ @FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class) public interface RemoteFileService { /** * 上传文件 * * @param file 文件信息 * @return 结果 */ @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public R<SysFile> upload(@RequestPart(value = "file") MultipartFile file); } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/RemoteLogService.java
New file @@ -0,0 +1,31 @@ package com.ruoyi.system.api; import com.ruoyi.common.core.constant.SecurityConstants; import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysOperLog; import com.ruoyi.system.api.factory.RemoteLogFallbackFactory; 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.RequestHeader; /** * 日志服务 * * @author ruoyi */ @FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class) public interface RemoteLogService { /** * 保存系统日志 * * @param sysOperLog 日志实体 * @param source 请求来源 * @return 结果 */ @PostMapping("/operlog") public R<Boolean> saveLog(@RequestBody SysOperLog sysOperLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/RemoteUserService.java
New file @@ -0,0 +1,39 @@ package com.ruoyi.system.api; import com.ruoyi.common.core.constant.SecurityConstants; import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.factory.RemoteUserFallbackFactory; import com.ruoyi.system.api.model.LoginUser; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; /** * 用户服务 * * @author ruoyi */ @FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class) public interface RemoteUserService { /** * 通过用户名查询用户信息 * * @param username 用户名 * @param source 请求来源 * @return 结果 */ @GetMapping("/user/info/{username}") public R<LoginUser> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 注册用户信息 * * @param sysUser 用户信息 * @param source 请求来源 * @return 结果 */ @PostMapping("/user/register") public R<Boolean> registerUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysDept.java
New file @@ -0,0 +1,200 @@ package com.ruoyi.system.api.domain; import com.ruoyi.common.core.web.domain.BaseEntity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import javax.validation.constraints.Email; import javax.validation.constraints.Size; import java.util.ArrayList; import java.util.List; /** * 部门表 sys_dept * * @author ruoyi */ public class SysDept extends BaseEntity { private static final long serialVersionUID = 1L; /** 部门ID */ private Long deptId; /** 父部门ID */ private Long parentId; /** 祖级列表 */ private String ancestors; /** 部门名称 */ private String deptName; /** 显示顺序 */ private Integer orderNum; /** 负责人 */ private String leader; /** 联系电话 */ private String phone; /** 邮箱 */ private String email; /** 部门状态:0正常,1停用 */ private String status; /** 删除标志(0代表存在 2代表删除) */ private String delFlag; /** 父部门名称 */ private String parentName; /** 子部门 */ private List<SysDept> children = new ArrayList<SysDept>(); public Long getDeptId() { return deptId; } public void setDeptId(Long deptId) { this.deptId = deptId; } public Long getParentId() { return parentId; } public void setParentId(Long parentId) { this.parentId = parentId; } public String getAncestors() { return ancestors; } public void setAncestors(String ancestors) { this.ancestors = ancestors; } @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") public String getDeptName() { return deptName; } public void setDeptName(String deptName) { this.deptName = deptName; } public Integer getOrderNum() { return orderNum; } public void setOrderNum(Integer orderNum) { this.orderNum = orderNum; } public String getLeader() { return leader; } public void setLeader(String leader) { this.leader = leader; } @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } @Email(message = "邮箱格式不正确") @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getDelFlag() { return delFlag; } public void setDelFlag(String delFlag) { this.delFlag = delFlag; } public String getParentName() { return parentName; } public void setParentName(String parentName) { this.parentName = parentName; } public List<SysDept> getChildren() { return children; } public void setChildren(List<SysDept> children) { this.children = children; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("deptId", getDeptId()) .append("parentId", getParentId()) .append("ancestors", getAncestors()) .append("deptName", getDeptName()) .append("orderNum", getOrderNum()) .append("leader", getLeader()) .append("phone", getPhone()) .append("email", getEmail()) .append("status", getStatus()) .append("delFlag", getDelFlag()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .toString(); } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysDictData.java
New file @@ -0,0 +1,177 @@ package com.ruoyi.system.api.domain; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.annotation.Excel.ColumnType; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.web.domain.BaseEntity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; /** * 字典数据表 sys_dict_data * * @author ruoyi */ public class SysDictData extends BaseEntity { private static final long serialVersionUID = 1L; /** 字典编码 */ @Excel(name = "字典编码", cellType = ColumnType.NUMERIC) private Long dictCode; /** 字典排序 */ @Excel(name = "字典排序", cellType = ColumnType.NUMERIC) private Long dictSort; /** 字典标签 */ @Excel(name = "字典标签") private String dictLabel; /** 字典键值 */ @Excel(name = "字典键值") private String dictValue; /** 字典类型 */ @Excel(name = "字典类型") private String dictType; /** 样式属性(其他样式扩展) */ private String cssClass; /** 表格字典样式 */ private String listClass; /** 是否默认(Y是 N否) */ @Excel(name = "是否默认", readConverterExp = "Y=是,N=否") private String isDefault; /** 状态(0正常 1停用) */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用") private String status; public Long getDictCode() { return dictCode; } public void setDictCode(Long dictCode) { this.dictCode = dictCode; } public Long getDictSort() { return dictSort; } public void setDictSort(Long dictSort) { this.dictSort = dictSort; } @NotBlank(message = "字典标签不能为空") @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符") public String getDictLabel() { return dictLabel; } public void setDictLabel(String dictLabel) { this.dictLabel = dictLabel; } @NotBlank(message = "字典键值不能为空") @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符") public String getDictValue() { return dictValue; } public void setDictValue(String dictValue) { this.dictValue = dictValue; } @NotBlank(message = "字典类型不能为空") @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符") public String getDictType() { return dictType; } public void setDictType(String dictType) { this.dictType = dictType; } @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符") public String getCssClass() { return cssClass; } public void setCssClass(String cssClass) { this.cssClass = cssClass; } public String getListClass() { return listClass; } public void setListClass(String listClass) { this.listClass = listClass; } public boolean getDefault() { return UserConstants.YES.equals(this.isDefault); } public String getIsDefault() { return isDefault; } public void setIsDefault(String isDefault) { this.isDefault = isDefault; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("dictCode", getDictCode()) .append("dictSort", getDictSort()) .append("dictLabel", getDictLabel()) .append("dictValue", getDictValue()) .append("dictType", getDictType()) .append("cssClass", getCssClass()) .append("listClass", getListClass()) .append("isDefault", getIsDefault()) .append("status", getStatus()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysDictType.java
New file @@ -0,0 +1,97 @@ package com.ruoyi.system.api.domain; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.annotation.Excel.ColumnType; import com.ruoyi.common.core.web.domain.BaseEntity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; /** * 字典类型表 sys_dict_type * * @author ruoyi */ public class SysDictType extends BaseEntity { private static final long serialVersionUID = 1L; /** 字典主键 */ @Excel(name = "字典主键", cellType = ColumnType.NUMERIC) private Long dictId; /** 字典名称 */ @Excel(name = "字典名称") private String dictName; /** 字典类型 */ @Excel(name = "字典类型") private String dictType; /** 状态(0正常 1停用) */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用") private String status; public Long getDictId() { return dictId; } public void setDictId(Long dictId) { this.dictId = dictId; } @NotBlank(message = "字典名称不能为空") @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符") public String getDictName() { return dictName; } public void setDictName(String dictName) { this.dictName = dictName; } @NotBlank(message = "字典类型不能为空") @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)") public String getDictType() { return dictType; } public void setDictType(String dictType) { this.dictType = dictType; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("dictId", getDictId()) .append("dictName", getDictName()) .append("dictType", getDictType()) .append("status", getStatus()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysFile.java
New file @@ -0,0 +1,50 @@ package com.ruoyi.system.api.domain; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 文件信息 * * @author ruoyi */ public class SysFile { /** * 文件名称 */ private String name; /** * 文件地址 */ private String url; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("name", getName()) .append("url", getUrl()) .toString(); } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysLoginLog.java
New file @@ -0,0 +1,91 @@ package com.ruoyi.system.api.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.time.LocalDateTime; /** * @author zhibing.pu * @Date 2024/8/12 15:38 */ @Data @TableName("sys_login_log") @ApiModel public class SysLoginLog { /** * 主键 */ @ApiModelProperty(value = "数据id") @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 用户id */ @TableField("user_id") private Integer userId; /** * 登录账号 */ @TableField("username") @ApiModelProperty(value = "用户账号") private String username; /** * 登录IP地址 */ @TableField("ip_address") @ApiModelProperty(value = "登录IP地址") private String ipAddress; /** * 登录地址 */ @TableField("address") @ApiModelProperty(value = "登录地址") private String address; /** * 浏览器类型 */ @TableField("browser_type") @ApiModelProperty(value = "浏览器类型") private String browserType; /** * 操作系统 */ @TableField("operating_system") @ApiModelProperty(value = "操作系统") private String operatingSystem; /** * 登录时间 */ @TableField("login_time") @ApiModelProperty(value = "登录时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime loginTime; /** * 登录状态(1=成功,2=失败) */ @TableField("login_status") private Integer loginStatus; /** * 提示消息 */ @TableField("message") private String message; /** * 添加时间 */ @TableField("create_time") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime createTime; /** * 删除状态(0=否,1=是) */ @TableField("del_flag") private Integer delFlag; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysLogininfor.java
New file @@ -0,0 +1,103 @@ package com.ruoyi.system.api.domain; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.annotation.Excel.ColumnType; import com.ruoyi.common.core.web.domain.BaseEntity; import java.util.Date; /** * 系统访问记录表 sys_logininfor * * @author ruoyi */ public class SysLogininfor extends BaseEntity { private static final long serialVersionUID = 1L; /** ID */ @Excel(name = "序号", cellType = ColumnType.NUMERIC) private Long infoId; /** 用户账号 */ @Excel(name = "用户账号") private String userName; /** 状态 0成功 1失败 */ @Excel(name = "状态", readConverterExp = "0=成功,1=失败") private String status; /** 地址 */ @Excel(name = "地址") private String ipaddr; /** 描述 */ @Excel(name = "描述") private String msg; /** 访问时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date accessTime; public Long getInfoId() { return infoId; } public void setInfoId(Long infoId) { this.infoId = infoId; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getIpaddr() { return ipaddr; } public void setIpaddr(String ipaddr) { this.ipaddr = ipaddr; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public Date getAccessTime() { return accessTime; } public void setAccessTime(Date accessTime) { this.accessTime = accessTime; } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysOperLog.java
New file @@ -0,0 +1,158 @@ package com.ruoyi.system.api.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.annotation.Excel.ColumnType; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; /** * 操作日志记录表 oper_log * * @author ruoyi */ @Data @ApiModel @TableName("sys_oper_log") public class SysOperLog { private static final long serialVersionUID = 1L; /** * 日志主键 */ @Excel(name = "操作序号", cellType = ColumnType.NUMERIC) @ApiModelProperty("数据id") @TableId(value = "oper_id", type = IdType.AUTO) private Long operId; /** * 操作模块 */ @Excel(name = "操作模块") @ApiModelProperty("操作模块") private String title; /** * 业务类型(0其它 1新增 2修改 3删除) */ @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据") @ApiModelProperty("0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据") @TableField("business_type") private Integer businessType; /** * 业务类型数组 */ @TableField(exist = false) private Integer[] businessTypes; /** * 请求方法 */ @Excel(name = "请求方法") @ApiModelProperty("请求方法") private String method; /** * 请求方式 */ @Excel(name = "请求方式") @ApiModelProperty("请求方式") @TableField("request_method") private String requestMethod; /** * 操作类别(0其它 1后台用户 2手机端用户) */ @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户") @ApiModelProperty("0=其它,1=后台用户,2=手机端用户") @TableField("operator_type") private Integer operatorType; /** * 操作人员 */ @Excel(name = "操作人员") @ApiModelProperty("操作人员") @TableField("oper_name") private String operName; /** * 部门名称 */ @Excel(name = "部门名称") @ApiModelProperty("部门名称") @TableField("dept_name") private String deptName; /** * 请求url */ @Excel(name = "请求地址") @ApiModelProperty("请求地址") @TableField("oper_url") private String operUrl; /** * 操作地址 */ @Excel(name = "操作地址") @ApiModelProperty("操作地址") @TableField("oper_ip") private String operIp; /** * 请求参数 */ @Excel(name = "请求参数") @ApiModelProperty("请求参数") @TableField("oper_param") private String operParam; /** * 返回参数 */ @Excel(name = "返回参数") @ApiModelProperty("返回参数") @TableField("json_result") private String jsonResult; /** * 操作状态(0正常 1异常) */ @Excel(name = "状态", readConverterExp = "0=正常,1=异常") @ApiModelProperty("0=正常,1=异常") private Integer status; /** * 错误消息 */ @Excel(name = "错误消息") @ApiModelProperty("错误消息") @TableField("error_msg") private String errorMsg; /** * 操作时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty("操作时间") @TableField("oper_time") private Date operTime; /** * 消耗时间 */ @Excel(name = "消耗时间", suffix = "毫秒") @ApiModelProperty("消耗时间") @TableField("cost_time") private Long costTime; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java
New file @@ -0,0 +1,233 @@ package com.ruoyi.system.api.domain; import com.baomidou.mybatisplus.annotation.TableField; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.annotation.Excel.ColumnType; import com.ruoyi.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; import java.util.List; import java.util.Set; /** * 角色表 sys_role * * @author ruoyi */ public class SysRole extends BaseEntity { private static final long serialVersionUID = 1L; /** 角色ID */ @Excel(name = "角色序号", cellType = ColumnType.NUMERIC) @TableField("role_id") private Long roleId; /** 角色名称 */ @Excel(name = "角色名称") @TableField("role_name") private String roleName; /** 角色权限 */ @Excel(name = "角色权限") @TableField("role_key") private String roleKey; /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") @TableField("data_scope") private String dataScope; /** 角色状态(0正常 1停用) */ @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") private String status; /** 删除标志(0代表存在 2代表删除) */ @TableField("del_flag") private String delFlag; /** 用户是否存在此角色标识 默认不存在 */ @TableField(exist = false) private boolean flag = false; /** 菜单组 */ @TableField(exist = false) private Long[] menuIds; /** 部门组(数据权限) */ @TableField(exist = false) private Long[] deptIds; /** 角色菜单权限 */ @TableField(exist = false) private Set<String> permissions; @ApiModelProperty(value = "站点名称") @TableField(exist = false) private List<String> siteNames; @TableField(exist = false) private Long number; public SysRole() { } public SysRole(Long roleId) { this.roleId = roleId; } public Long getRoleId() { return roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } public boolean isAdmin() { return isAdmin(this.roleId); } public static boolean isAdmin(Long roleId) { return roleId != null && 1L == roleId; } @NotBlank(message = "角色名称不能为空") @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") public String getRoleName() { return roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } @NotBlank(message = "权限字符不能为空") @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") public String getRoleKey() { return roleKey; } public void setRoleKey(String roleKey) { this.roleKey = roleKey; } public String getDataScope() { return dataScope; } public void setDataScope(String dataScope) { this.dataScope = dataScope; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getDelFlag() { return delFlag; } public void setDelFlag(String delFlag) { this.delFlag = delFlag; } public boolean isFlag() { return flag; } public void setFlag(boolean flag) { this.flag = flag; } public Long[] getMenuIds() { return menuIds; } public void setMenuIds(Long[] menuIds) { this.menuIds = menuIds; } public Long[] getDeptIds() { return deptIds; } public void setDeptIds(Long[] deptIds) { this.deptIds = deptIds; } public Set<String> getPermissions() { return permissions; } public void setPermissions(Set<String> permissions) { this.permissions = permissions; } public List<String> getSiteNames() { return siteNames; } public void setSiteNames(List<String> siteNames) { this.siteNames = siteNames; } public Long getNumber() { return number; } public void setNumber(Long number) { this.number = number; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("roleId", getRoleId()) .append("roleName", getRoleName()) .append("roleKey", getRoleKey()) .append("dataScope", getDataScope()) .append("status", getStatus()) .append("delFlag", getDelFlag()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
New file @@ -0,0 +1,446 @@ package com.ruoyi.system.api.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.annotation.Excel.ColumnType; import com.ruoyi.common.core.annotation.Excel.Type; import com.ruoyi.common.core.annotation.Excels; import com.ruoyi.common.core.web.domain.BaseEntity; import com.ruoyi.common.core.xss.Xss; import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; import java.util.Date; import java.util.List; /** * 用户对象 sys_user * * @author ruoyi */ public class SysUser extends BaseEntity { private static final long serialVersionUID = 1L; /** 用户ID */ @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") @TableId(value = "user_id", type = IdType.AUTO) private Long userId; /** 部门ID */ @Excel(name = "部门编号", type = Type.IMPORT) @TableField("dept_id") private Long deptId; /** 用户账号 */ @Excel(name = "登录名称") @TableField("user_name") private String userName; /** 用户昵称 */ @Excel(name = "用户名称") @NotBlank(message = "姓名不能为空") @TableField("nick_name") private String nickName; /** 用户邮箱 */ @Excel(name = "用户邮箱") private String email; /** 手机号码 */ @Excel(name = "手机号码") @NotBlank(message = "请输入账号") private String phonenumber; /** 用户性别 */ @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") private String sex; /** 用户头像 */ private String avatar; /** 密码 */ private String password; /** 帐号状态(0正常 1停用) */ @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") private String status; /** 删除标志(0代表存在 2代表删除) */ @TableField("del_flag") private String delFlag; /** 最后登录IP */ @Excel(name = "最后登录IP", type = Type.EXPORT) @TableField("login_ip") private String loginIp; /** 最后登录时间 */ @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField("login_date") private Date loginDate; /** 部门对象 */ @Excels({ @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) }) @TableField(exist = false) private SysDept dept; /** 角色对象 */ @TableField(exist = false) private List<SysRole> roles; /** 角色组 */ @TableField(exist = false) private Long[] roleIds; /** 岗位组 */ @TableField(exist = false) private Long[] postIds; /** 角色ID */ @TableField(exist = false) private Long roleId; /** * 角色类型 1=平台 2=公司 3=门店 4=修理厂 */ @ApiModelProperty(value = "角色类型 1=平台 2=合作商") private Integer roleType; @Excel(name = "密码修改时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) private Date passWordUpdate; @ApiModelProperty(value = "对象ID") private Integer objectId; @ApiModelProperty(value = "备注") private String remark; @ApiModelProperty(value = "禁用账户备注") @TableField("forbidden_remark") private String forbiddenRemark; @ApiModelProperty(value = "充电站") @TableField(exist = false) private List<String> siteNames; @ApiModelProperty(value = "充电站id", required = true) @TableField(exist = false) private List<Integer> siteIds; @ApiModelProperty(value = "角色") @TableField(exist = false) private List<String> roleNames; @Override public String getRemark() { return remark; } @Override public void setRemark(String remark) { this.remark = remark; } public SysUser() { } public SysUser(Long userId) { this.userId = userId; } public Integer getRoleType() { return roleType; } public void setRoleType(Integer roleType) { this.roleType = roleType; } public Date getPassWordUpdate() { return passWordUpdate; } public void setPassWordUpdate(Date passWordUpdate) { this.passWordUpdate = passWordUpdate; } public Integer getObjectId() { return objectId; } public void setObjectId(Integer objectId) { this.objectId = objectId; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public boolean isAdmin() { return isAdmin(this.userId); } public static boolean isAdmin(Long userId) { return userId != null && 1L == userId; } public Long getDeptId() { return deptId; } public void setDeptId(Long deptId) { this.deptId = deptId; } @Xss(message = "用户昵称不能包含脚本字符") @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") public String getNickName() { return nickName; } public void setNickName(String nickName) { this.nickName = nickName; } @Xss(message = "用户账号不能包含脚本字符") @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } @Email(message = "邮箱格式不正确") @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") public String getPhonenumber() { return phonenumber; } public void setPhonenumber(String phonenumber) { this.phonenumber = phonenumber; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getAvatar() { return avatar; } public void setAvatar(String avatar) { this.avatar = avatar; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getDelFlag() { return delFlag; } public void setDelFlag(String delFlag) { this.delFlag = delFlag; } public String getLoginIp() { return loginIp; } public void setLoginIp(String loginIp) { this.loginIp = loginIp; } public Date getLoginDate() { return loginDate; } public void setLoginDate(Date loginDate) { this.loginDate = loginDate; } public SysDept getDept() { return dept; } public void setDept(SysDept dept) { this.dept = dept; } public List<SysRole> getRoles() { return roles; } public void setRoles(List<SysRole> roles) { this.roles = roles; } public Long[] getRoleIds() { return roleIds; } public void setRoleIds(Long[] roleIds) { this.roleIds = roleIds; } public Long[] getPostIds() { return postIds; } public void setPostIds(Long[] postIds) { this.postIds = postIds; } public Long getRoleId() { return roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } public List<String> getSiteNames() { return siteNames; } public void setSiteNames(List<String> siteNames) { this.siteNames = siteNames; } public List<String> getRoleNames() { return roleNames; } public List<Integer> getSiteIds() { return siteIds; } public void setSiteIds(List<Integer> siteIds) { this.siteIds = siteIds; } public void setRoleNames(List<String> roleNames) { this.roleNames = roleNames; } public String getForbiddenRemark() { return forbiddenRemark; } public void setForbiddenRemark(String forbiddenRemark) { this.forbiddenRemark = forbiddenRemark; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("userId", getUserId()) .append("deptId", getDeptId()) .append("userName", getUserName()) .append("nickName", getNickName()) .append("email", getEmail()) .append("phonenumber", getPhonenumber()) .append("sex", getSex()) .append("avatar", getAvatar()) .append("password", getPassword()) .append("status", getStatus()) .append("delFlag", getDelFlag()) .append("loginIp", getLoginIp()) .append("loginDate", getLoginDate()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .append("dept", getDept()) .toString(); } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteFileFallbackFactory.java
New file @@ -0,0 +1,35 @@ package com.ruoyi.system.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.RemoteFileService; import com.ruoyi.system.api.domain.SysFile; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; /** * 文件服务降级处理 * * @author ruoyi */ @Component public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileService> { private static final Logger log = LoggerFactory.getLogger(RemoteFileFallbackFactory.class); @Override public RemoteFileService create(Throwable throwable) { log.error("文件服务调用失败:{}", throwable.getMessage()); return new RemoteFileService() { @Override public R<SysFile> upload(MultipartFile file) { return R.fail("上传文件失败:" + throwable.getMessage()); } }; } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteLogFallbackFactory.java
New file @@ -0,0 +1,35 @@ package com.ruoyi.system.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.RemoteLogService; import com.ruoyi.system.api.domain.SysOperLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; /** * 日志服务降级处理 * * @author ruoyi */ @Component public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogService> { private static final Logger log = LoggerFactory.getLogger(RemoteLogFallbackFactory.class); @Override public RemoteLogService create(Throwable throwable) { log.error("日志服务调用失败:{}", throwable.getMessage()); return new RemoteLogService() { @Override public R<Boolean> saveLog(SysOperLog sysOperLog, String source) { return null; } }; } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteUserFallbackFactory.java
New file @@ -0,0 +1,41 @@ package com.ruoyi.system.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.RemoteUserService; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.model.LoginUser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; /** * 用户服务降级处理 * * @author ruoyi */ @Component public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserService> { private static final Logger log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class); @Override public RemoteUserService create(Throwable throwable) { log.error("用户服务调用失败:{}", throwable.getMessage()); return new RemoteUserService() { @Override public R<LoginUser> getUserInfo(String username, String source) { return R.fail("获取用户失败:" + throwable.getMessage()); } @Override public R<Boolean> registerUserInfo(SysUser sysUser, String source) { return R.fail("注册用户失败:" + throwable.getMessage()); } }; } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysLoginLogFallbackFactory.java
New file @@ -0,0 +1,22 @@ package com.ruoyi.system.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysLoginLog; import com.ruoyi.system.api.feignClient.SysLoginLogClient; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; @Component public class SysLoginLogFallbackFactory implements FallbackFactory<SysLoginLogClient> { @Override public SysLoginLogClient create(Throwable cause) { return new SysLoginLogClient(){ @Override public R saveLoginLog(SysLoginLog loginLog) { return R.fail("添加登录日志失败!" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysRoleFallbackFactory.java
New file @@ -0,0 +1,27 @@ package com.ruoyi.system.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.feignClient.SysRoleClient; import com.ruoyi.system.api.model.GetSysRoleByIds; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; import java.util.List; /** * @author Pu Zhibing */ @Component public class SysRoleFallbackFactory implements FallbackFactory<SysRoleClient> { @Override public SysRoleClient create(Throwable cause) { return new SysRoleClient(){ @Override public R<List<SysRole>> getSysRoleByIds(GetSysRoleByIds ids) { return R.fail("获取角色失败:" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysUserFallbackFactory.java
New file @@ -0,0 +1,78 @@ package com.ruoyi.system.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.feignClient.SysUserClient; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; import java.util.List; @Component public class SysUserFallbackFactory implements FallbackFactory<SysUserClient> { @Override public SysUserClient create(Throwable cause) { return new SysUserClient(){ @Override public R<SysUser> getSysUser(Long userId) { return R.fail("获取用户失败:" + cause.getMessage()); } @Override public R<Boolean> updateSysUser(SysUser sysUser) { return R.fail("更新用户失败:" + cause.getMessage()); } @Override public R<List<SysUser>> getUserList(List<Integer> userIds) { return R.fail("通过用户id集合查询用户失败:" + cause.getMessage()); } @Override public R<Integer> isAdmin(Long userId) { return R.fail("获取角色信息失败:" + cause.getMessage()); } @Override public R<Boolean> updateUser(SysUser sysUser) { return R.fail("修改用户信息失败:" + cause.getMessage()); } @Override public R<SysRole> queryRoleByUserId(Long userId) { return R.fail("通过用户id查询角色对象失败:" + cause.getMessage()); } @Override public R<SysRole> queryRoleByRoleId(Long roleId) { return R.fail("通过角色id查询角色对象失败:" + cause.getMessage()); } @Override public R<List<SysUser>> queryUserByPhoneList(List<String> phoneList) { return R.fail("通过手机号集合查询用户失败:" + cause.getMessage()); } @Override public R<SysUser> queryUserByPhone(String phone) { return R.fail("通过手机号查询用户失败:" + cause.getMessage()); } @Override public R<SysUser> queryUserByUserName(String userName) { return R.fail("通过账号查询用户失败:" + cause.getMessage()); } @Override public R addSysUser(SysUser user) { return R.fail("添加用户失败:" + cause.getMessage()); } @Override public R resetPassword(SysUser user) { return R.fail("重置用户密码失败:" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysUserRoleFallbackFactory.java
New file @@ -0,0 +1,23 @@ package com.ruoyi.system.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.feignClient.SysUserRoleClient; import com.ruoyi.system.api.model.SysUserRoleVo; import org.springframework.stereotype.Component; import java.util.List; @Component public class SysUserRoleFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<SysUserRoleClient> { @Override public SysUserRoleClient create(Throwable cause) { return new SysUserRoleClient(){ @Override public R<List<SysUserRoleVo>> getRoleByUserId(Long userId) { return R.fail("根据用户id获取角色失败:" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysLoginLogClient.java
New file @@ -0,0 +1,26 @@ package com.ruoyi.system.api.feignClient; import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysLoginLog; import com.ruoyi.system.api.factory.SysLoginLogFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; /** * @author zhibing.pu * @Date 2024/8/12 16:30 */ @FeignClient(contextId = "SysLoginLogClient", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = SysLoginLogFallbackFactory.class) public interface SysLoginLogClient { /** * 添加登陆日志 * @param loginLog * @return */ @PostMapping("/sysLoginLog/saveLoginLog") R saveLoginLog(@RequestBody SysLoginLog loginLog); } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysRoleClient.java
New file @@ -0,0 +1,23 @@ package com.ruoyi.system.api.feignClient; import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.factory.SysRoleFallbackFactory; import com.ruoyi.system.api.model.GetSysRoleByIds; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import java.util.List; /** * @author zhibing.pu * @Date 2024/8/7 15:14 */ @FeignClient(contextId = "SysRoleClient", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = SysRoleFallbackFactory.class) public interface SysRoleClient { @PostMapping("/role/getSysRoleByIds") public R<List<SysRole>> getSysRoleByIds(GetSysRoleByIds ids); } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysUserClient.java
New file @@ -0,0 +1,91 @@ package com.ruoyi.system.api.feignClient; import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.factory.SysUserFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; 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 = "sysUserClient", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = SysUserFallbackFactory.class) public interface SysUserClient { @PostMapping("/user/getSysUser") R<SysUser> getSysUser(@RequestParam("userId")Long userId); @PostMapping("/user/updateSysUser") R<Boolean> updateSysUser(@RequestBody SysUser sysUser); @PostMapping("/user/getUserList") R<List<SysUser>> getUserList(@RequestBody List<Integer> userIds); @PostMapping("/user/isAdmin") R<Integer> isAdmin(Long userId); @PostMapping("/user/updateUser") R<Boolean> updateUser(@RequestBody SysUser sysUser); /** * 通过用户id查询角色对象 * @param userId * @return */ @PostMapping("/user/queryRoleByUserId/{userId}") R<SysRole> queryRoleByUserId(@PathVariable("userId") Long userId); /** * 通过角色id查询角色对象 * @param roleId * @return */ @PostMapping("/user/queryRoleByRoleId/{roleId}") R<SysRole> queryRoleByRoleId(@PathVariable("roleId") Long roleId); /** * 通过手机号集合查询用户 * @param phoneList * @return */ @PostMapping("/user/queryUserByPhoneList") R<List<SysUser>> queryUserByPhoneList(@RequestBody List<String> phoneList); /** * 通过手机号查询用户 * @param phone * @return */ @PostMapping("/user/queryUserByPhone") R<SysUser> queryUserByPhone(@RequestBody String phone); /** * 通过账号查询用户 * @param userName * @return */ @PostMapping("/user/queryUserByUserName") R<SysUser> queryUserByUserName(@RequestBody String userName); /** * 新增加用户信息 * @param user */ @PostMapping("/user/addSysUser") R<Long> addSysUser(@RequestBody SysUser user); /** * 重置密码 * @param user * @return */ @PostMapping("/user/resetPassword") R resetPassword(@RequestBody SysUser user); } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysUserRoleClient.java
New file @@ -0,0 +1,28 @@ package com.ruoyi.system.api.feignClient; import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.factory.SysUserRoleFallbackFactory; import com.ruoyi.system.api.model.SysUserRoleVo; 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 zhibing.pu * @date 2024/9/4 9:49 */ @FeignClient(contextId = "SysUserRoleClient", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = SysUserRoleFallbackFactory.class) public interface SysUserRoleClient { /** * 根据用户id获取角色 * @param userId * @return */ @PostMapping("/userRole/getRoleByUserId") R<List<SysUserRoleVo>> getRoleByUserId(@RequestParam("userId") Long userId); } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/CompanyAddSysUserDto.java
New file @@ -0,0 +1,13 @@ package com.ruoyi.system.api.model; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data public class CompanyAddSysUserDto { List<CompanyUserListVo> list; @ApiModelProperty("公司id") private Integer companyId; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/CompanySysUserReq.java
New file @@ -0,0 +1,17 @@ package com.ruoyi.system.api.model; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; @Data @AllArgsConstructor @NoArgsConstructor public class CompanySysUserReq { private Integer companyId; private String name; private List<Integer> userIds; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/CompanyUserListVo.java
New file @@ -0,0 +1,16 @@ package com.ruoyi.system.api.model; import lombok.Data; @Data public class CompanyUserListVo { private Long id; private String userName; private String phoneNumber; private String password; private String nickName; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/GenTable.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/GenTableColumn.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/GetSysRoleByIds.java
New file @@ -0,0 +1,17 @@ package com.ruoyi.system.api.model; import lombok.Data; import java.util.List; /** * @author zhibing.pu * @Date 2024/8/7 15:06 */ @Data public class GetSysRoleByIds { /** * ids */ private List<Integer> ids; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/LoginUser.java
@@ -1,5 +1,6 @@ package com.ruoyi.system.api.model; import com.ruoyi.system.api.domain.SysUser; import java.io.Serializable; import java.util.Set; ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysConfig.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysDept.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysDictData.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysDictType.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysJob.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysJobLog.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysLoginLog.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysMenu.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysNotice.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysOperLog.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysPost.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysRole.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysRoleDept.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysRoleMenu.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysUser.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysUserPost.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysUserRole.java
File was deleted ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysUserRoleDTO.java
New file @@ -0,0 +1,18 @@ package com.ruoyi.system.api.model; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; @Data @ApiModel(value = "自动关联修理厂角色DTO") public class SysUserRoleDTO implements Serializable { @ApiModelProperty(value = "用户id") private Long userId; @ApiModelProperty(value = "角色id") private Long roleId; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/SysUserRoleVo.java
New file @@ -0,0 +1,49 @@ package com.ruoyi.system.api.model; import com.baomidou.mybatisplus.annotation.TableField; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 用户和角色关联 sys_user_role * * @author ruoyi */ public class SysUserRoleVo { /** 用户ID */ @TableField("user_id") private Long userId; /** 角色ID */ @TableField("role_id") private Long roleId; public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public Long getRoleId() { return roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("userId", getUserId()) .append("roleId", getRoleId()) .toString(); } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/TAppUserLoginInfo.java
New file @@ -0,0 +1,77 @@ package com.ruoyi.system.api.model; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.web.domain.BasePojo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.time.LocalDateTime; /** * <p> * * </p> * * @author luodangjia * @since 2024-08-06 */ @Data public class TAppUserLoginInfo extends BasePojo { private static final long serialVersionUID = 1L; private Long id; @ApiModelProperty(value = "用户") private String name; @ApiModelProperty(value = "手机号") private String phone; @ApiModelProperty(value = "头像") private String avatar; @ApiModelProperty(value = "会员id") private Integer vipId; @ApiModelProperty(value = "会员到期时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime vipEndTime; @ApiModelProperty(value = "单位id") private Integer companyId; @ApiModelProperty(value = "身份证号") private String idCard; @ApiModelProperty(value = "认证状态(0=否,1=是)") private Integer authStatus; @ApiModelProperty(value = "微信openid") private String wxOpenid; @ApiModelProperty(value = "支付宝openid") private String aliOpenid; @ApiModelProperty(value = "积分") private Integer points; @ApiModelProperty(value = "省名称") private String province; @ApiModelProperty(value = "省区划代码") private String provinceCode; @ApiModelProperty(value = "市名称") private String city; @ApiModelProperty(value = "市区划代码") private String cityCode; @ApiModelProperty(value = "状态(1=正常,2=冻结,3=注销)") private Integer status; @ApiModelProperty(value = "最后一次登录时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime lastLoginTime; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/TRepairShopAdd.java
New file @@ -0,0 +1,17 @@ package com.ruoyi.system.api.model; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; @Data public class TRepairShopAdd { @ApiModelProperty("账号") @NotBlank(message = "账号不能为空") private String phonenumber; @ApiModelProperty("密码") @NotBlank(message = "密码不能为空") private String pwd; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/model/TRepairShopAddDto.java
New file @@ -0,0 +1,14 @@ package com.ruoyi.system.api.model; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.List; @Data public class TRepairShopAddDto { private List<TRepairShopAdd> list; @ApiModelProperty("修理场id") @NotNull(message = "修理厂id不能为空") private Integer repairId; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/query/ChangeUserQuery.java
New file @@ -0,0 +1,15 @@ package com.ruoyi.system.api.query; import com.ruoyi.common.core.web.page.BasePage; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "用户选择列表Query") public class ChangeUserQuery extends BasePage { @ApiModelProperty(value = "用户名称") private String nickName; } ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java
@@ -5,6 +5,7 @@ import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.feignClient.SysUserClient; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/GeodesyUtil.java
@@ -36,14 +36,14 @@ double WGS72 = getDistanceMeter(source, target, Ellipsoid.WGS72); double Clarke1858 = getDistanceMeter(source, target, Ellipsoid.Clarke1858); double Clarke1880 = getDistanceMeter(source, target, Ellipsoid.Clarke1880); // System.out.println("Sphere坐标系计算结果:"+Sphere + "米"); // System.out.println("WGS84坐标系计算结果:"+WGS84 + "米"); // System.out.println("GRS80坐标系计算结果:"+GRS80 + "米"); // System.out.println("GRS67坐标系计算结果:"+GRS67 + "米"); // System.out.println("ANS坐标系计算结果:"+ANS + "米"); // System.out.println("WGS72坐标系计算结果:"+WGS72 + "米"); // System.out.println("Clarke1858坐标系计算结果:"+Clarke1858 + "米"); // System.out.println("Clarke1880坐标系计算结果:"+Clarke1880 + "米"); System.out.println("Sphere坐标系计算结果:"+Sphere + "米"); System.out.println("WGS84坐标系计算结果:"+WGS84 + "米"); System.out.println("GRS80坐标系计算结果:"+GRS80 + "米"); System.out.println("GRS67坐标系计算结果:"+GRS67 + "米"); System.out.println("ANS坐标系计算结果:"+ANS + "米"); System.out.println("WGS72坐标系计算结果:"+WGS72 + "米"); System.out.println("Clarke1858坐标系计算结果:"+Clarke1858 + "米"); System.out.println("Clarke1880坐标系计算结果:"+Clarke1880 + "米"); map.put("Sphere", Sphere); map.put("WGS84", WGS84); map.put("GRS80", GRS80); @@ -67,7 +67,7 @@ public static void main(String[] ages){ GeodesyUtil geodesyUtil = new GeodesyUtil(); Map<String, Double> distance = geodesyUtil.getDistance("115.481028,39.989643", "114.465302,40.004717"); Map<String, Double> distance = geodesyUtil.getDistance("104.063855,30.575442", "104.679931,31.471814"); System.err.println(distance); } } ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/AjaxResult.java
@@ -4,24 +4,28 @@ import java.util.Objects; import com.ruoyi.common.core.constant.HttpStatus; import com.ruoyi.common.core.utils.StringUtils; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** * 操作消息提醒 * * @author ruoyi */ public class AjaxResult<T> extends HashMap<String, Object> { private static final long serialVersionUID = 1L; @ApiModel public class AjaxResult<T> extends HashMap { /** 状态码 */ public static final String CODE_TAG = "code"; @ApiModelProperty("状态码") private int code; /** 返回内容 */ public static final String MSG_TAG = "msg"; @ApiModelProperty("描述内容") private String msg = ""; /** 数据对象 */ public static final String DATA_TAG = "data"; @ApiModelProperty("结果集") private T data; /** * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 @@ -38,8 +42,8 @@ */ public AjaxResult(int code, String msg) { super.put(CODE_TAG, code); super.put(MSG_TAG, msg); this.code = code; this.msg = msg; } /** @@ -49,12 +53,12 @@ * @param msg 返回内容 * @param data 数据对象 */ public AjaxResult(int code, String msg, Object data) public AjaxResult(int code, String msg, T data) { super.put(CODE_TAG, code); super.put(MSG_TAG, msg); this.code = code; this.msg = msg; if (StringUtils.isNotNull(data)) { super.put(DATA_TAG, data); this.data = data; } } @@ -181,7 +185,7 @@ */ public boolean isSuccess() { return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG)); return Objects.equals(HttpStatus.SUCCESS, this.code); } /** @@ -195,19 +199,4 @@ } /** * 方便链式调用 * * @param key * @param value * @return */ @Override public AjaxResult put(String key, Object value) { super.put(key, value); return this; } } ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/BaseTable.java
File was deleted ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/TableDataInfo.java
@@ -8,7 +8,7 @@ * * @author ruoyi */ public class TableDataInfo implements Serializable public class TableDataInfo<T> implements Serializable { private static final long serialVersionUID = 1L; @@ -16,7 +16,7 @@ private long total; /** 列表数据 */ private List<?> rows; private List<T> rows; /** 消息状态码 */ private int code; @@ -37,7 +37,7 @@ * @param list 列表数据 * @param total 总记录数 */ public TableDataInfo(List<?> list, int total) public TableDataInfo(List<T> list, int total) { this.rows = list; this.total = total; @@ -58,7 +58,7 @@ return rows; } public void setRows(List<?> rows) public void setRows(List<T> rows) { this.rows = rows; } ruoyi-common/ruoyi-common-redis/pom.xml
@@ -22,6 +22,12 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> <version>3.10.1</version> </dependency> <!-- RuoYi Common Core--> <dependency> ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/annotation/DistributedLock.java
New file @@ -0,0 +1,34 @@ package com.ruoyi.common.redis.annotation; import java.lang.annotation.*; /** * @Descreption: 分布式锁注解 * @Author: luofl * @Date: 2024/11/26 16:43 */ @Target({ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface DistributedLock { /** * 锁名字(没有EL解析) */ String lockName() default ""; /** * 锁前缀(有EL解析) */ String lockNamePre() default ""; /** * 锁后缀(有EL解析) */ String lockNamePost() default ""; /** * 锁前后缀拼接分隔符 */ String separator() default "_"; } ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/aspectj/DistributedLockAspect.java
New file @@ -0,0 +1,142 @@ package com.ruoyi.common.redis.aspectj; import com.ruoyi.common.redis.annotation.DistributedLock; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.redisson.api.RLock; import org.redisson.api.RedissonClient; import org.springframework.core.LocalVariableTableParameterNameDiscoverer; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.GetMapping; import javax.annotation.Resource; import java.lang.reflect.Method; import java.util.Objects; /** * @Description 分布式锁切面 * 注意!!!分布式锁不能加在事务方法当中:因为当锁释放,事务还没有提交 * @Author luofl * @Date 2024/11/26 16:42 */ @Aspect @Component @Slf4j public class DistributedLockAspect { @Resource private RedissonClient redissonClient; /** * @Descreption: 定义切面:以注解为切面 * @Author: luofl * @Date: 2024/11/26 16:44 */ @Pointcut("@annotation(com.ruoyi.common.redis.annotation.DistributedLock)") public void distributedLockAspect() { } @Around(value = "distributedLockAspect()") public Object doAround(ProceedingJoinPoint pjp) throws Throwable { //切点所在的类 MethodSignature methodSignature = (MethodSignature) pjp.getSignature(); Method method = methodSignature.getMethod(); // DistributedLock annotation = method.getAnnotation(DistributedLock.class); String lockName = getLockName(annotation, pjp.getArgs(), method); log.info("lockName:"+lockName); RLock lock = redissonClient.getLock(lockName); lock.lock(); try { return pjp.proceed(); } finally { if (lock.isLocked() && lock.isHeldByCurrentThread()) { //释放锁 lock.unlock(); } } } /** * @Descreption: 获取锁名字,优先获取注解中锁名 * @Author: luofl * @Date: 2024/11/26 16:45 */ private String getLockName(DistributedLock distributedLock, Object[] args, Method method) { //优先获取注解名称 if (StringUtils.isNotBlank(distributedLock.lockName())) { return distributedLock.lockName(); } //根据参数匹配有参数就使用动态参数,没有就使用定义参数 String lockNamePre = distributedLock.lockNamePre(); String lockNamePost = distributedLock.lockNamePost(); String separator = distributedLock.separator(); String preExpression = parseExpression(lockNamePre, method, args); String postExpression = parseExpression(lockNamePost, method, args); StringBuilder sb = new StringBuilder(); if (StringUtils.isNotBlank(preExpression)) { sb.append(preExpression); } else { sb.append(lockNamePre); } sb.append(separator); if (StringUtils.isNotBlank(postExpression)) { sb.append(postExpression); } else { sb.append(lockNamePost); } return sb.toString(); } /** * el表达式解析 * * @param expressionString 解析值 * @param method 方法 * @param args 参数 */ private String parseExpression(String expressionString, Method method, Object[] args) { //获取被拦截方法参数名列表 LocalVariableTableParameterNameDiscoverer discoverer = new LocalVariableTableParameterNameDiscoverer(); String[] paramNameArr = discoverer.getParameterNames(method); //SPEL解析 ExpressionParser parser = new SpelExpressionParser(); StandardEvaluationContext context = new StandardEvaluationContext(); for (int i = 0; i < Objects.requireNonNull(paramNameArr).length; i++) { context.setVariable(paramNameArr[i], args[i]); } return parser.parseExpression(expressionString).getValue(context, String.class); } // ==========================示例============================= //固定静态参数锁:product_lock @DistributedLock(lockName = "product_lock") @GetMapping(value = "/test1") public void test1() { System.out.println("执行事务"); } //未匹配到参数,因此仍然是静态参数锁:#param1_#param2 @DistributedLock(lockNamePre = "#param1", lockNamePost = "#param2") @GetMapping(value = "/test2") public void test2() { System.out.println("执行事务"); } //匹配到参数,动态参数锁:hello_world @DistributedLock(lockNamePre = "#order", lockNamePost = "#param2") @GetMapping(value = "/test3") public void test3(String param1, String param2) { System.out.println("执行事务"); } } ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/service/TokenService.java
@@ -5,9 +5,7 @@ import java.util.concurrent.TimeUnit; import javax.servlet.http.HttpServletRequest; import com.ruoyi.common.core.exception.user.UserAppletException; import com.ruoyi.system.api.model.LoginUser; import com.ruoyi.system.api.model.LoginUserApplet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.ruoyi.common.core.constant.CacheConstants; @@ -49,8 +47,6 @@ Long userId = loginUser.getSysUser().getUserId(); String userName = loginUser.getSysUser().getUserName(); loginUser.setToken(token); loginUser.setUserid(userId); loginUser.setUsername(userName); loginUser.setIpaddr(IpUtils.getIpAddr()); refreshToken(loginUser); @@ -71,10 +67,10 @@ /** * 创建小程序令牌 */ public Map<String, Object> createTokenApplet(LoginUserApplet loginUser) { public Map<String, Object> createTokenApplet(LoginUser loginUser) { String token = IdUtils.fastUUID(); Long userId = loginUser.getUserId(); String name = loginUser.getName(); Long userId = loginUser.getUserid(); String name = loginUser.getUsername(); loginUser.setToken(token); loginUser.setIpaddr(IpUtils.getIpAddr()); refreshToken1(loginUser); @@ -91,15 +87,15 @@ return rspMap; } public LoginUserApplet getLoginUserApplet() { LoginUserApplet loginUserAppletToken = getLoginUserAppletToken(ServletUtils.getRequest()); public LoginUser getLoginUserApplet() { LoginUser loginUserAppletToken = getLoginUserAppletToken(ServletUtils.getRequest()); if (loginUserAppletToken == null) { throw new RuntimeException("令牌已过期,请重新登录!"); } return loginUserAppletToken; } public LoginUserApplet getLoginUserAppletToken(HttpServletRequest request) { public LoginUser getLoginUserAppletToken(HttpServletRequest request) { // 获取请求携带的令牌 String token = SecurityUtils.getToken(request); return getLoginUserApplet(token); @@ -110,8 +106,8 @@ * * @return 用户信息 */ public LoginUserApplet getLoginUserApplet(String token) { LoginUserApplet user = null; public LoginUser getLoginUserApplet(String token) { LoginUser user = null; try { if (StringUtils.isNotEmpty(token)) { String userKey = JwtUtils.getUserKeyApplet(token); @@ -211,7 +207,7 @@ redisService.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES); } public void refreshToken1(LoginUserApplet dto) { public void refreshToken1(LoginUser dto) { dto.setLoginTime(System.currentTimeMillis()); dto.setExpireTime(dto.getLoginTime() + expireAppletTime * MILLIS_MINUTE); // 根据uuid将loginUser缓存 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysConfigController.java
@@ -1,20 +1,109 @@ package com.ruoyi.system.controller; import com.ruoyi.common.core.utils.poi.ExcelUtil; 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.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.domain.SysConfig; import com.ruoyi.system.service.ISysConfigService; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * <p> * 前端控制器 * </p> * 参数配置 信息操作处理 * * @author luodangjia * @since 2024-11-21 * @author ruoyi */ @RestController @RequestMapping("/sys-config") public class SysConfigController { @RequestMapping("/config") public class SysConfigController extends BaseController { @Resource private ISysConfigService configService; /** * 获取参数配置列表 */ @GetMapping("/list") public TableDataInfo list(SysConfig config) { startPage(); List<SysConfig> list = configService.selectConfigList(config); return getDataTable(list); } @Log(title = "参数管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SysConfig config) { List<SysConfig> list = configService.selectConfigList(config); ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); util.exportExcel(response, list, "参数数据"); } /** * 根据参数编号获取详细信息 */ @GetMapping(value = "/{configId}") public AjaxResult getInfo(@PathVariable Long configId) { return success(configService.selectConfigById(configId)); } /** * 根据参数键名查询参数值 */ @GetMapping(value = "/configKey/{configKey}") public AjaxResult getConfigKey(@PathVariable String configKey) { return success(configService.selectConfigByKey(configKey)); } /** * 新增参数配置 */ @Log(title = "参数管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysConfig config) { if (!configService.checkConfigKeyUnique(config)) { return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); } config.setCreateBy(SecurityUtils.getUsername()); return toAjax(configService.insertConfig(config)); } /** * 修改参数配置 */ @Log(title = "参数管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysConfig config) { if (!configService.checkConfigKeyUnique(config)) { return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); } config.setUpdateBy(SecurityUtils.getUsername()); return toAjax(configService.updateConfig(config)); } /** * 删除参数配置 */ @Log(title = "参数管理", businessType = BusinessType.DELETE) @DeleteMapping("/{configIds}") public AjaxResult remove(@PathVariable Long[] configIds) { configService.deleteConfigByIds(configIds); return success(); } /** * 刷新参数缓存 */ @Log(title = "参数管理", businessType = BusinessType.CLEAN) @DeleteMapping("/refreshCache") public AjaxResult refreshCache() { configService.resetConfigCache(); return success(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDeptController.java
@@ -1,20 +1,120 @@ package com.ruoyi.system.controller; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.domain.SysDept; import com.ruoyi.system.service.ISysDeptService; import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * <p> * 前端控制器 * </p> * * @author luodangjia * @since 2024-11-21 * 部门信息 * * @author ruoyi */ @RestController @RequestMapping("/sys-dept") public class SysDeptController { @RequestMapping("/dept") public class SysDeptController extends BaseController { @Autowired private ISysDeptService deptService; /** * 获取部门列表 */ @GetMapping("/list") public AjaxResult list(SysDept dept) { List<SysDept> depts = deptService.selectDeptList(dept); return success(depts); } /** * 查询部门列表(排除节点) */ @GetMapping("/list/exclude/{deptId}") public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { List<SysDept> depts = deptService.selectDeptList(new SysDept()); depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); return success(depts); } /** * 根据部门编号获取详细信息 */ @GetMapping(value = "/{deptId}") public AjaxResult getInfo(@PathVariable Long deptId) { deptService.checkDeptDataScope(deptId); return success(deptService.selectDeptById(deptId)); } /** * 新增部门 */ @Log(title = "部门管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysDept dept) { if (!deptService.checkDeptNameUnique(dept)) { return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } dept.setCreateBy(SecurityUtils.getUsername()); return toAjax(deptService.insertDept(dept)); } /** * 修改部门 */ @Log(title = "部门管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysDept dept) { Long deptId = dept.getDeptId(); deptService.checkDeptDataScope(deptId); if (!deptService.checkDeptNameUnique(dept)) { return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } else if (dept.getParentId().equals(deptId)) { return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); } else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) { return error("该部门包含未停用的子部门!"); } dept.setUpdateBy(SecurityUtils.getUsername()); return toAjax(deptService.updateDept(dept)); } /** * 删除部门 */ @Log(title = "部门管理", businessType = BusinessType.DELETE) @DeleteMapping("/{deptId}") public AjaxResult remove(@PathVariable Long deptId) { if (deptService.hasChildByDeptId(deptId)) { return warn("存在下级部门,不允许删除"); } if (deptService.checkDeptExistUser(deptId)) { return warn("部门存在用户,不允许删除"); } deptService.checkDeptDataScope(deptId); return toAjax(deptService.deleteDeptById(deptId)); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java
@@ -1,20 +1,109 @@ package com.ruoyi.system.controller; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.poi.ExcelUtil; 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.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.domain.SysDictData; import com.ruoyi.system.service.ISysDictDataService; import com.ruoyi.system.service.ISysDictTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; /** * <p> * 前端控制器 * </p> * * @author luodangjia * @since 2024-11-21 * 数据字典信息 * * @author ruoyi */ @RestController @RequestMapping("/sys-dict-data") public class SysDictDataController { @RequestMapping("/dict/data") public class SysDictDataController extends BaseController { @Autowired private ISysDictDataService dictDataService; @Autowired private ISysDictTypeService dictTypeService; @GetMapping("/list") public TableDataInfo list(SysDictData dictData) { startPage(); List<SysDictData> list = dictDataService.selectDictDataList(dictData); return getDataTable(list); } @Log(title = "字典数据", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SysDictData dictData) { List<SysDictData> list = dictDataService.selectDictDataList(dictData); ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); util.exportExcel(response, list, "字典数据"); } /** * 查询字典数据详细 */ @GetMapping(value = "/{dictCode}") public AjaxResult getInfo(@PathVariable Long dictCode) { return success(dictDataService.selectDictDataById(dictCode)); } /** * 根据字典类型查询字典数据信息 */ @GetMapping(value = "/type/{dictType}") public AjaxResult dictType(@PathVariable String dictType) { List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); if (StringUtils.isNull(data)) { data = new ArrayList<SysDictData>(); } return success(data); } /** * 新增字典类型 */ @Log(title = "字典数据", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysDictData dict) { dict.setCreateBy(SecurityUtils.getUsername()); return toAjax(dictDataService.insertDictData(dict)); } /** * 修改保存字典类型 */ @Log(title = "字典数据", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysDictData dict) { dict.setUpdateBy(SecurityUtils.getUsername()); return toAjax(dictDataService.updateDictData(dict)); } /** * 删除字典类型 */ @Log(title = "字典类型", businessType = BusinessType.DELETE) @DeleteMapping("/{dictCodes}") public AjaxResult remove(@PathVariable Long[] dictCodes) { dictDataService.deleteDictDataByIds(dictCodes); return success(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictTypeController.java
@@ -1,20 +1,118 @@ package com.ruoyi.system.controller; import com.ruoyi.common.core.utils.poi.ExcelUtil; 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.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.domain.SysDictType; import com.ruoyi.system.service.ISysDictTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * <p> * 前端控制器 * </p> * * @author luodangjia * @since 2024-11-21 * 数据字典信息 * * @author ruoyi */ @RestController @RequestMapping("/sys-dict-type") public class SysDictTypeController { @RequestMapping("/dict/type") public class SysDictTypeController extends BaseController { @Autowired private ISysDictTypeService dictTypeService; @GetMapping("/list") public TableDataInfo list(SysDictType dictType) { startPage(); List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); return getDataTable(list); } @Log(title = "字典类型", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SysDictType dictType) { List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); util.exportExcel(response, list, "字典类型"); } /** * 查询字典类型详细 */ @GetMapping(value = "/{dictId}") public AjaxResult getInfo(@PathVariable Long dictId) { return success(dictTypeService.selectDictTypeById(dictId)); } /** * 新增字典类型 */ @Log(title = "字典类型", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysDictType dict) { if (!dictTypeService.checkDictTypeUnique(dict)) { return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); } dict.setCreateBy(SecurityUtils.getUsername()); return toAjax(dictTypeService.insertDictType(dict)); } /** * 修改字典类型 */ @Log(title = "字典类型", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysDictType dict) { if (!dictTypeService.checkDictTypeUnique(dict)) { return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); } dict.setUpdateBy(SecurityUtils.getUsername()); return toAjax(dictTypeService.updateDictType(dict)); } /** * 删除字典类型 */ @Log(title = "字典类型", businessType = BusinessType.DELETE) @DeleteMapping("/{dictIds}") public AjaxResult remove(@PathVariable Long[] dictIds) { dictTypeService.deleteDictTypeByIds(dictIds); return success(); } /** * 刷新字典缓存 */ @Log(title = "字典类型", businessType = BusinessType.CLEAN) @DeleteMapping("/refreshCache") public AjaxResult refreshCache() { dictTypeService.resetDictCache(); return success(); } /** * 获取字典选择框列表 */ @GetMapping("/optionselect") public AjaxResult optionselect() { List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); return success(dictTypes); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysLoginLogController.java
@@ -1,20 +1,58 @@ package com.ruoyi.system.controller; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.BasePage; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.system.api.domain.SysLoginLog; import com.ruoyi.system.service.ISysLoginLogService; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.time.LocalDateTime; /** * <p> * 前端控制器 * </p> * * @author luodangjia * @since 2024-11-21 * @author zhibing.pu * @Date 2024/8/12 15:48 */ @RestController @RequestMapping("/sys-login-log") @RequestMapping("/sysLoginLog") public class SysLoginLogController { @Resource private ISysLoginLogService sysLoginLogService; @GetMapping("/pageList") @ApiOperation(value = "获取登录日志列表", tags = {"管理后台-登录日志"}) public AjaxResult<PageInfo<SysLoginLog>> pageList(String name, BasePage basePage){ PageInfo<SysLoginLog> pageInfo = sysLoginLogService.pageList(name, basePage); return AjaxResult.success(pageInfo); } @PostMapping("/addLoginLog") @ApiOperation(value = "添加登录日志", tags = {"管理后台-登录日志"}) public AjaxResult addLoginLog(@RequestBody SysLoginLog loginLog){ return sysLoginLogService.addLoginLog(loginLog); } /** * 添加登陆日志 * @param loginLog * @return */ @PostMapping("/saveLoginLog") public R saveLoginLog(@RequestBody SysLoginLog loginLog){ loginLog.setCreateTime(LocalDateTime.now()); loginLog.setDelFlag(0); sysLoginLogService.save(loginLog); return R.ok(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysMenuController.java
@@ -1,20 +1,160 @@ package com.ruoyi.system.controller; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.domain.SysMenu; import com.ruoyi.system.domain.SysMenus; import com.ruoyi.system.service.ISysMenuService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; import java.util.List; /** * <p> * 前端控制器 * </p> * * @author luodangjia * @since 2024-11-21 * 菜单信息 * * @author ruoyi */ @RestController @RequestMapping("/sys-menu") public class SysMenuController { @RequestMapping("/menu") @Api(tags = "菜单模块") public class SysMenuController extends BaseController { @Autowired private ISysMenuService menuService; } /** * 获取菜单列表 */ @GetMapping("/list") @ApiOperation("所有菜单列表") public AjaxResult list() { List<SysMenus> list= menuService.getAllMenu(); return success(list); } /** * 根据菜单编号获取详细信息 */ @GetMapping(value = "/{menuId}") public AjaxResult getInfo(@PathVariable Long menuId) { return success(menuService.selectMenuById(menuId)); } /** * 获取菜单下拉树列表 */ @GetMapping("/treeselect") public AjaxResult treeselect(SysMenu menu) { Long userId = SecurityUtils.getUserId(); List<SysMenu> menus = menuService.selectMenuList(menu, userId); ArrayList<SysMenus> sysMenus = new ArrayList<>(); for (SysMenu sysMenu : menus) { SysMenus sysMenus1 = new SysMenus(); BeanUtils.copyProperties(sysMenu,sysMenus1); sysMenus.add(sysMenus1); } return success(menuService.buildMenuTreeSelect(menus)); } /** * 加载对应角色菜单列表树 */ @GetMapping(value = "/roleMenuTreeselect/{roleId}") public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) { Long userId = SecurityUtils.getUserId(); List<SysMenu> menus = menuService.selectMenuList(userId); AjaxResult ajax = AjaxResult.success(); ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); ajax.put("menus", menuService.buildMenuTreeSelect(menus)); return ajax; } /** * 新增菜单 */ @Log(title = "菜单管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysMenu menu) { if (!menuService.checkMenuNameUnique(menu)) { return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); } menu.setCreateBy(SecurityUtils.getUsername()); return toAjax(menuService.insertMenu(menu)); } /** * 修改菜单 */ @Log(title = "菜单管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysMenu menu) { if (!menuService.checkMenuNameUnique(menu)) { return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); } else if (menu.getMenuId().equals(menu.getParentId())) { return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); } menu.setUpdateBy(SecurityUtils.getUsername()); return toAjax(menuService.updateMenu(menu)); } /** * 删除菜单 */ @Log(title = "菜单管理", businessType = BusinessType.DELETE) @DeleteMapping("/{menuId}") public AjaxResult remove(@PathVariable("menuId") Long menuId) { if (menuService.hasChildByMenuId(menuId)) { return warn("存在子菜单,不允许删除"); } if (menuService.checkMenuExistRole(menuId)) { return warn("菜单已分配,不允许删除"); } return toAjax(menuService.deleteMenuById(menuId)); } /** * 获取路由信息 * * @return 路由信息 */ @GetMapping("getRouters") public AjaxResult getRouters() { Long userId = SecurityUtils.getUserId(); List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); return success(menuService.buildMenus(menus)); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysNoticeController.java
@@ -1,20 +1,80 @@ package com.ruoyi.system.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.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.domain.SysNotice; import com.ruoyi.system.service.ISysNoticeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * <p> * 前端控制器 * </p> * * @author luodangjia * @since 2024-11-21 * 公告 信息操作处理 * * @author ruoyi */ @RestController @RequestMapping("/sys-notice") public class SysNoticeController { @RequestMapping("/notice") public class SysNoticeController extends BaseController { @Autowired private ISysNoticeService noticeService; /** * 获取通知公告列表 */ @GetMapping("/list") public TableDataInfo list(SysNotice notice) { startPage(); List<SysNotice> list = noticeService.selectNoticeList(notice); return getDataTable(list); } /** * 根据通知公告编号获取详细信息 */ @GetMapping(value = "/{noticeId}") public AjaxResult getInfo(@PathVariable Long noticeId) { return success(noticeService.selectNoticeById(noticeId)); } /** * 新增通知公告 */ @Log(title = "通知公告", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysNotice notice) { notice.setCreateBy(SecurityUtils.getUsername()); return toAjax(noticeService.insertNotice(notice)); } /** * 修改通知公告 */ @Log(title = "通知公告", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysNotice notice) { notice.setUpdateBy(SecurityUtils.getUsername()); return toAjax(noticeService.updateNotice(notice)); } /** * 删除通知公告 */ @Log(title = "通知公告", businessType = BusinessType.DELETE) @DeleteMapping("/{noticeIds}") public AjaxResult remove(@PathVariable Long[] noticeIds) { return toAjax(noticeService.deleteNoticeByIds(noticeIds)); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysOperLogController.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysOperlogController.java
New file @@ -0,0 +1,82 @@ package com.ruoyi.system.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.poi.ExcelUtil; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.annotation.InnerAuth; import com.ruoyi.system.api.domain.SysOperLog; import com.ruoyi.system.query.SysOperLogQuery; import com.ruoyi.system.service.ISysOperLogService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 操作日志记录 * * @author ruoyi */ @RestController @RequestMapping("/operlog") public class SysOperlogController extends BaseController { @Autowired private ISysOperLogService operLogService; @GetMapping("/list") @ApiOperation(value = "获取操作日志列表", tags = {"管理后台-操作日志"}) public AjaxResult<PageInfo<SysOperLog>> list(SysOperLogQuery query) { PageInfo<SysOperLog> pageInfo = new PageInfo(query.getPageCurr(), query.getPageSize()); LambdaQueryWrapper<SysOperLog> wrapper = new LambdaQueryWrapper<>(); if(StringUtils.isNotEmpty(query.getOperName())){ wrapper.like(SysOperLog::getOperName, query.getOperName()); } if(StringUtils.isNotEmpty(query.getTitle())){ wrapper.like(SysOperLog::getTitle, query.getTitle()); } if(null != query.getStatus()){ wrapper.eq(SysOperLog::getStatus, query.getStatus()); } if(null != query.getStartTime() && null != query.getEndTime()){ wrapper.between(SysOperLog::getOperTime, query.getStartTime(), query.getEndTime()); } PageInfo<SysOperLog> page = operLogService.page(pageInfo, wrapper.orderByDesc(SysOperLog::getOperTime)); return AjaxResult.success(page); } @Log(title = "操作日志", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SysOperLog operLog) { List<SysOperLog> list = operLogService.selectOperLogList(operLog); ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class); util.exportExcel(response, list, "操作日志"); } @Log(title = "操作日志", businessType = BusinessType.DELETE) @DeleteMapping("/{operIds}") public AjaxResult remove(@PathVariable Long[] operIds) { return toAjax(operLogService.deleteOperLogByIds(operIds)); } @Log(title = "操作日志", businessType = BusinessType.CLEAN) @DeleteMapping("/clean") public AjaxResult clean() { operLogService.cleanOperLog(); return success(); } @InnerAuth @PostMapping public AjaxResult add(@RequestBody SysOperLog operLog) { return toAjax(operLogService.insertOperlog(operLog)); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysPostController.java
@@ -1,20 +1,117 @@ package com.ruoyi.system.controller; import com.ruoyi.common.core.utils.poi.ExcelUtil; 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.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.domain.SysPost; import com.ruoyi.system.service.ISysPostService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * <p> * 前端控制器 * </p> * * @author luodangjia * @since 2024-11-21 * 岗位信息操作处理 * * @author ruoyi */ @RestController @RequestMapping("/sys-post") public class SysPostController { @RequestMapping("/post") public class SysPostController extends BaseController { @Autowired private ISysPostService postService; /** * 获取岗位列表 */ @GetMapping("/list") public TableDataInfo list(SysPost post) { startPage(); List<SysPost> list = postService.selectPostList(post); return getDataTable(list); } @Log(title = "岗位管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SysPost post) { List<SysPost> list = postService.selectPostList(post); ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class); util.exportExcel(response, list, "岗位数据"); } /** * 根据岗位编号获取详细信息 */ @GetMapping(value = "/{postId}") public AjaxResult getInfo(@PathVariable Long postId) { return success(postService.selectPostById(postId)); } /** * 新增岗位 */ @Log(title = "岗位管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysPost post) { if (!postService.checkPostNameUnique(post)) { return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); } else if (!postService.checkPostCodeUnique(post)) { return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); } post.setCreateBy(SecurityUtils.getUsername()); return toAjax(postService.insertPost(post)); } /** * 修改岗位 */ @Log(title = "岗位管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysPost post) { if (!postService.checkPostNameUnique(post)) { return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); } else if (!postService.checkPostCodeUnique(post)) { return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); } post.setUpdateBy(SecurityUtils.getUsername()); return toAjax(postService.updatePost(post)); } /** * 删除岗位 */ @Log(title = "岗位管理", businessType = BusinessType.DELETE) @DeleteMapping("/{postIds}") public AjaxResult remove(@PathVariable Long[] postIds) { return toAjax(postService.deletePostByIds(postIds)); } /** * 获取岗位选择框列表 */ @GetMapping("/optionselect") public AjaxResult optionselect() { List<SysPost> posts = postService.selectPostAll(); return success(posts); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysProfileController.java
New file @@ -0,0 +1,160 @@ package com.ruoyi.system.controller; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.file.FileTypeUtils; import com.ruoyi.common.core.utils.file.MimeTypeUtils; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.RemoteFileService; import com.ruoyi.system.api.domain.SysFile; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.model.LoginUser; import com.ruoyi.system.service.ISysUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.util.Arrays; /** * 个人信息 业务处理 * * @author ruoyi */ @Api(tags = "个人信息") @RestController @RequestMapping("/user/profile") public class SysProfileController extends BaseController { @Autowired private ISysUserService userService; @Autowired private TokenService tokenService; @Autowired private RemoteFileService remoteFileService; /** * 个人信息 */ @GetMapping public AjaxResult profile() { String username = SecurityUtils.getUsername(); SysUser user = userService.selectUserByUserName(username); AjaxResult ajax = AjaxResult.success(user); ajax.put("roleGroup", userService.selectUserRoleGroup(username)); ajax.put("postGroup", userService.selectUserPostGroup(username)); return ajax; } /** * 修改用户 */ @Log(title = "个人信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult updateProfile(@RequestBody SysUser user) { LoginUser loginUser = SecurityUtils.getLoginUser(); SysUser sysUser = loginUser.getSysUser(); user.setUserName(sysUser.getUserName()); if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } user.setUserId(sysUser.getUserId()); user.setPassword(null); user.setAvatar(null); user.setDeptId(null); if (userService.updateUserProfile(user) > 0) { // 更新缓存用户信息 loginUser.getSysUser().setNickName(user.getNickName()); loginUser.getSysUser().setPhonenumber(user.getPhonenumber()); loginUser.getSysUser().setEmail(user.getEmail()); loginUser.getSysUser().setSex(user.getSex()); tokenService.setLoginUser(loginUser); return success(); } return error("修改个人信息异常,请联系管理员"); } /** * 重置密码 */ @ApiOperation(value = "个人信息-修改密码") @Log(title = "个人信息", businessType = BusinessType.UPDATE) @PostMapping("/updatePwd") public AjaxResult updatePwd(String oldPassword, String newPassword) { System.err.println(oldPassword); System.err.println(newPassword); String username = SecurityUtils.getUsername(); SysUser user = userService.selectUserByUserName(username); String password = user.getPassword(); if (!SecurityUtils.matchesPassword(oldPassword, password)) { return error("修改密码失败,旧密码错误"); } if (SecurityUtils.matchesPassword(newPassword, password)) { return error("新密码不能与旧密码相同"); } if (userService.resetUserPwd(username, SecurityUtils.encryptPassword(newPassword)) > 0) { // 更新缓存用户密码 // LoginUser loginUser = SecurityUtils.getLoginUser(); // SysUser sysUser = loginUser.getSysUser(); // loginUser.getSysUser().setPassword(SecurityUtils.encryptPassword(newPassword)); // tokenService.setLoginUser(loginUser); return success(); } return error("修改密码异常,请联系管理员"); } /** * 头像上传 */ @Log(title = "用户头像", businessType = BusinessType.UPDATE) @PostMapping("/avatar") public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) { if (!file.isEmpty()) { LoginUser loginUser = SecurityUtils.getLoginUser(); String extension = FileTypeUtils.getExtension(file); if (!StringUtils.equalsAnyIgnoreCase(extension, MimeTypeUtils.IMAGE_EXTENSION)) { return error("文件格式不正确,请上传" + Arrays.toString(MimeTypeUtils.IMAGE_EXTENSION) + "格式"); } R<SysFile> fileResult = remoteFileService.upload(file); if (StringUtils.isNull(fileResult) || StringUtils.isNull(fileResult.getData())) { return error("文件服务异常,请联系管理员"); } String url = fileResult.getData().getUrl(); if (userService.updateUserAvatar(loginUser.getUsername(), url)) { AjaxResult ajax = AjaxResult.success(); ajax.put("imgUrl", url); // 更新缓存用户头像 loginUser.getSysUser().setAvatar(url); tokenService.setLoginUser(loginUser); return ajax; } } return error("上传图片异常,请联系管理员"); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java
@@ -1,20 +1,260 @@ package com.ruoyi.system.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.BasePage; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.domain.SysDept; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.model.GetSysRoleByIds; import com.ruoyi.system.domain.SysMenus; import com.ruoyi.system.domain.SysRoleMenu; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.domain.dto.RoleAddDto; import com.ruoyi.system.domain.dto.RoleUpdateDto; import com.ruoyi.system.domain.vo.RoleInfoVo; import com.ruoyi.system.mapper.SysMenuMapper; import com.ruoyi.system.mapper.SysRoleMenuMapper; import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysUserRoleService; import com.ruoyi.system.service.ISysUserService; import io.seata.spring.annotation.GlobalTransactional; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.util.CollectionUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; /** * <p> * 前端控制器 * </p> * 角色信息 * * @author luodangjia * @since 2024-11-21 * @author ruoyi */ @RestController @RequestMapping("/sys-role") public class SysRoleController { @RequestMapping("/role") @Api(tags = "角色模块") public class SysRoleController extends BaseController { @Resource private ISysRoleService roleService; @Resource private ISysUserService userService; @Resource private ISysDeptService deptService; @Resource private SysRoleMenuMapper sysRoleMenuMapper; @Resource private ISysUserRoleService sysUserRoleService; @Resource private SysMenuMapper menuMapper; @ApiOperation(value = "获取角色列表", tags = {"管理后台-系统用户管理"}) @GetMapping("/list") public AjaxResult list() { List<SysRole> list = roleService.list(new LambdaQueryWrapper<SysRole>().eq(SysRole::getDelFlag, 0).eq(SysRole::getStatus, 0)); return AjaxResult.success(list); } @ResponseBody @GetMapping("/listPage") @ApiOperation(value = "获取角色列表", tags = {"管理后台-角色管理"}) public AjaxResult listPage(String name, BasePage basePage) { PageInfo<SysRole> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize()); LambdaQueryWrapper<SysRole> wrapper = new LambdaQueryWrapper<SysRole>().eq(SysRole::getStatus, 0).eq(SysRole::getDelFlag, 0); if (StringUtils.isNotEmpty(name)) { wrapper.like(SysRole::getRoleName, name); } PageInfo<SysRole> page = roleService.page(pageInfo, wrapper.orderByDesc(SysRole::getCreateTime)); for (SysRole record : page.getRecords()) { long count = sysUserRoleService.count(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getRoleId, record.getRoleId())); record.setNumber(count); } return AjaxResult.success(page); } @ResponseBody @PostMapping("/roleAdd") @ApiOperation(value = "添加角色", tags = {"管理后台-角色管理"}) @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult roleAdd(@Validated @RequestBody RoleAddDto dto) { SysRole role = new SysRole(); role.setRoleName(dto.getRoleName()); long count = roleService.count(Wrappers.lambdaQuery(SysRole.class) .eq(SysRole::getRoleName, dto.getRoleName())); if (count > 0) { return AjaxResult.error("角色已存在,请重新输入"); } List<Long> menuIds1 = dto.getMenuIds(); if (CollectionUtils.isEmpty(menuIds1)) { return AjaxResult.error("菜单id不能为空"); } role.setMenuIds(dto.getMenuIds().toArray((new Long[dto.getMenuIds().size()]))); // 添加角色 role.setRemark(dto.getRemark()); role.setCreateBy(SecurityUtils.getUsername()); role.setCreateTime(new Date()); roleService.insertRole(role); return AjaxResult.success(); } @GetMapping("/roleInfo") @ApiOperation(value = "角色详情", tags = {"管理后台-角色管理"}) public AjaxResult roleInfo(@RequestParam Long id) { SysRole role = roleService.selectRoleById(id); RoleInfoVo roleInfoVo = new RoleInfoVo(); roleInfoVo.setRoleId(role.getRoleId()); roleInfoVo.setRoleName(role.getRoleName()); // 获取当前角色的菜单id List<Long> menusId = sysRoleMenuMapper.selectList(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getRoleId, id)).stream().map(SysRoleMenu::getMenuId).collect(Collectors.toList()); if (menusId.size() == 0) { return AjaxResult.success(new ArrayList<>()); } //获取当前的权限菜单 List<SysMenus> all = menuMapper.getAllInIds(menusId); // 第三级 List<SysMenus> s3 = all.stream().filter(e -> e.getMenuType().equals("F")).collect(Collectors.toList()); // 第二级 List<SysMenus> s2 = all.stream().filter(e -> e.getMenuType().equals("C")).collect(Collectors.toList()); // 第一级 List<SysMenus> s1 = all.stream().filter(e -> e.getMenuType().equals("M")).collect(Collectors.toList()); for (SysMenus menus : s2) { List<SysMenus> collect = s3.stream().filter(e -> e.getParentId().equals(menus.getMenuId())).collect(Collectors.toList()); menus.setChildren(collect); } for (SysMenus menus : s1) { List<SysMenus> collect = s2.stream().filter(e -> e.getParentId().equals(menus.getMenuId())).collect(Collectors.toList()); menus.setChildren(collect); } roleInfoVo.setMenus(menusId); roleInfoVo.setRemark(role.getRemark()); return AjaxResult.success(roleInfoVo); } @PostMapping("/roleUpdate") @ApiOperation(value = "编辑角色", tags = {"管理后台-角色管理"}) @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult roleUpdate(@Validated @RequestBody RoleUpdateDto dto) { SysRole role = new SysRole(); role.setRoleName(dto.getRoleName()); SysRole one = roleService.getOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleName, dto.getRoleName())); if (null != one && !one.getRoleId().equals(dto.getRoleId())) { return AjaxResult.error("角色已存在,请重新输入"); } role.setRemark(dto.getRemark()); role.setUpdateBy(SecurityUtils.getUsername()); role.setUpdateTime(new Date()); role.setRoleId(dto.getRoleId()); roleService.updateRole(role); ArrayList<SysRoleMenu> sysRoleMenus = new ArrayList<>(); List<Long> menuIds = dto.getMenuIds(); // 移除原来的权限菜单 if (menuIds.contains(1061L)) { sysRoleMenuMapper.delete(new LambdaQueryWrapper<SysRoleMenu>() .eq(SysRoleMenu::getRoleId, dto.getRoleId())); } else { sysRoleMenuMapper.delete(new LambdaQueryWrapper<SysRoleMenu>() .eq(SysRoleMenu::getRoleId, dto.getRoleId()) .ne(SysRoleMenu::getMenuId, 1061L) .ne(SysRoleMenu::getMenuId, 1062L) .ne(SysRoleMenu::getMenuId, 1065L) .ne(SysRoleMenu::getMenuId, 1073L) .ne(SysRoleMenu::getMenuId, 1161L) .ne(SysRoleMenu::getMenuId, 1203L) ); } for (Long menuId : menuIds) { SysRoleMenu sysRoleMenu = new SysRoleMenu(); sysRoleMenu.setMenuId(menuId); sysRoleMenu.setRoleId(role.getRoleId()); sysRoleMenus.add(sysRoleMenu); } sysRoleMenuMapper.batchRoleMenu(sysRoleMenus); return AjaxResult.success(); } /** * 删除角色 */ @Log(title = "角色管理", businessType = BusinessType.DELETE) @DeleteMapping("/{roleIds}") @ApiOperation(value = "删除角色", tags = {"管理后台-角色管理"}) public AjaxResult remove(@PathVariable Long[] roleIds) { return toAjax(roleService.deleteRoleByIds(roleIds)); } /** * 查询已分配用户角色列表 */ @GetMapping("/authUser/allocatedList") public TableDataInfo allocatedList(SysUser user) { startPage(); List<SysUser> list = userService.selectAllocatedList(user); return getDataTable(list); } /** * 查询未分配用户角色列表 */ @GetMapping("/authUser/unallocatedList") public TableDataInfo unallocatedList(SysUser user) { startPage(); List<SysUser> list = userService.selectUnallocatedList(user); return getDataTable(list); } /** * 获取对应角色部门树列表 */ @GetMapping(value = "/deptTree/{roleId}") public AjaxResult deptTree(@PathVariable("roleId") Long roleId) { AjaxResult ajax = AjaxResult.success(); ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); ajax.put("depts", deptService.selectDeptTreeList(new SysDept())); return ajax; } /** * 根据id集合获取数据 * * @param ids * @return */ @ResponseBody @PostMapping(value = "/getSysRoleByIds") public R<List<SysRole>> getSysRoleByIds(@RequestBody GetSysRoleByIds ids) { List<SysRole> sysRoleByIds = roleService.getSysRoleByIds(ids.getIds()); return R.ok(sysRoleByIds); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
@@ -1,20 +1,531 @@ package com.ruoyi.system.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.annotation.InnerAuth; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.domain.SysDept; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.model.LoginUser; import com.ruoyi.system.api.query.ChangeUserQuery; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.query.GetSysUserList; import com.ruoyi.system.query.ShopUserStart; import com.ruoyi.system.service.*; import io.seata.spring.annotation.GlobalTransactional; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ArrayUtils; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; /** * <p> * 前端控制器 * </p> * 用户信息 * * @author luodangjia * @since 2024-11-21 * @author ruoyi */ @RestController @RequestMapping("/sys-user") public class SysUserController { @RequestMapping("/user") @Api(tags = "用户信息") public class SysUserController extends BaseController { @Resource private ISysUserService userService; @Resource private ISysRoleService roleService; @Resource private ISysDeptService deptService; @Resource private ISysPostService postService; @Resource private ISysPermissionService permissionService; @Resource private ISysConfigService configService; @Resource private ISysUserRoleService userRoleService; @Resource private ISysUserRoleService sysUserRoleService; /** * 获取用户列表 */ @GetMapping("/list") @ApiOperation(value = "获取系统用户列表", tags = {"管理后台-系统用户管理", "管理后台-角色管理"}) public AjaxResult list(GetSysUserList getSysUserList) { PageInfo<SysUser> pageInfo = new PageInfo<>(getSysUserList.getPageCurr(), getSysUserList.getPageSize()); PageInfo<SysUser> page = userService.getList(pageInfo, getSysUserList); return AjaxResult.success(page); } /** * 获取用户选择列表 */ @PostMapping("/getChangeUserList") @ApiOperation(value = "获取用户选择列表", tags = {"管理后台-获取用户选择列表"}) public AjaxResult<PageInfo<SysUser>> getChangeUserList(@RequestBody ChangeUserQuery query) { return AjaxResult.success(userService.getChangeUserList(query)); } /** * 新增用户 */ @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping("/add") @ApiOperation(value = "添加系统用户", tags = {"管理后台-系统用户管理"}) @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult add(@RequestBody SysUser user) { user.setUserName(user.getPhonenumber()); if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ user.setNickName(user.getPhonenumber()); } if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return error("手机号已开通账号"); } if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user)) { return error("登录账号重复"); } user.setCreateBy(SecurityUtils.getUsername()); user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); user.setRoleType(1); userService.insertUser(user); SysUserRole sysUserRole = new SysUserRole(); sysUserRole.setRoleId(user.getRoleId()); sysUserRole.setUserId(user.getUserId()); userRoleService.insertSysUserRole(sysUserRole); return AjaxResult.success(); } @GetMapping("/verifyUserNameRepeat/{username}") @ApiOperation(value = "校验账号是否重复", tags = {"管理后台-系统用户管理"}) public AjaxResult verifyUserNameRepeat(@PathVariable String username){ SysUser user = new SysUser(); user.setUserName(username); if (StringUtils.isNotEmpty(username) && !userService.checkUserNameUnique(user)) { return error("账号不可重复"); } return success(); } /** * 根据用户编号获取详细信息 */ @ApiOperation(value = "获取用户详情", tags = {"管理后台-系统用户管理"}) @GetMapping("/getInfo/{userId}") public AjaxResult getInfo(@PathVariable Long userId) { userService.checkUserDataScope(userId); AjaxResult ajax = AjaxResult.success(); List<SysRole> roles = roleService.selectRoleAll(); ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); ajax.put("posts", postService.selectPostAll()); if (StringUtils.isNotNull(userId)) { SysUser sysUser = userService.selectUserById(userId); ajax.put("data", sysUser); ajax.put("postIds", postService.selectPostListByUserId(userId)); ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); } return AjaxResult.success(ajax); } /** * 修改用户 */ @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/update") @ApiOperation(value = "编辑系统用户", tags = {"管理后台-系统用户管理"}) @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult edit(@Validated @RequestBody SysUser user) { user.setUserName(user.getPhonenumber()); if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ user.setNickName(user.getPhonenumber()); } R<Integer> admin = this.isAdmin(user.getUserId()); Integer data = admin.getData(); if(data == null || data != 1){ SysUserRole one = sysUserRoleService.getOne(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, user.getUserId())); one.setRoleId(user.getRoleId()); sysUserRoleService.updateSysUserRole(one); } userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); SysUser sysUser = userService.getOne(Wrappers.lambdaQuery(SysUser.class) .eq(SysUser::getPhonenumber, user.getPhonenumber()) .eq(SysUser::getDelFlag,0) .last("LIMIT 1")); if (StringUtils.isNotEmpty(user.getPhonenumber()) && (Objects.nonNull(sysUser) && !user.getUserId().equals(sysUser.getUserId()) )) { return error("手机号已开通账号"); } sysUser = userService.getOne(Wrappers.lambdaQuery(SysUser.class) .eq(SysUser::getUserName, user.getUserName()) .eq(SysUser::getDelFlag,0) .last("LIMIT 1")); if (StringUtils.isNotEmpty(user.getUserName()) && (Objects.nonNull(sysUser) && !user.getUserId().equals(sysUser.getUserId()) )) { return error("登录账号重复"); } user.setUpdateBy(SecurityUtils.getUsername()); if (user.getPassword() != null && !"".equals(user.getPassword())) { user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); user.setPassWordUpdate(new Date()); } if (user.getPhonenumber() != null) { user.setUserName(user.getPhonenumber()); } user.setUpdateBy(SecurityUtils.getUsername()); user.setUpdateTime(new Date()); userService.updateUser(user); return success(); } /** * 删除用户 */ @Log(title = "用户管理", businessType = BusinessType.DELETE) @DeleteMapping("/{userIds}") @ApiOperation(value = "删除系统用户", tags = {"管理后台-系统用户管理"}) public AjaxResult remove(@PathVariable Long[] userIds) { if (ArrayUtils.contains(userIds, SecurityUtils.getUserId())) { return error("当前用户不能删除"); } return toAjax(userService.deleteUserByIds(userIds)); } @PostMapping("/shopUserStart") @ApiOperation(value = "账号管理--禁用/启用", tags = {"管理后台-系统用户管理"}) public AjaxResult shopUserStart(@RequestBody ShopUserStart shopUserStart) { if (shopUserStart.getUserId() == null) { return AjaxResult.error("userId不能为空"); } SysUser sysUser = userService.selectUserById(shopUserStart.getUserId()); if (sysUser.getStatus().equals("0")) { sysUser.setStatus("1"); sysUser.setForbiddenRemark(shopUserStart.getRemark()); } else { sysUser.setStatus("0"); sysUser.setForbiddenRemark(""); } return toAjax(userService.updateUser(sysUser)); } @PostMapping("/getUserList") public R<List<SysUser>> getUserList(@RequestBody List<Integer> userIds) { List<SysUser> list = userService.list(new LambdaQueryWrapper<SysUser>().in(SysUser::getUserId, userIds)); return R.ok(list); } @PostMapping("/isAdmin") public R<Integer> isAdmin(@RequestBody Long userId){ SysUserRole one = sysUserRoleService.getOne(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, userId)); Long id =one.getRoleId(); return R.ok(id.intValue()); } @PostMapping("/getSysUser") public R<SysUser> getSysUser(@RequestParam("userId") Long userId) { try { SysUser sysUser = userService.selectUserById(userId); return R.ok(sysUser); } catch (Exception e) { e.printStackTrace(); return R.ok(); } } @PostMapping("/updateSysUser") @Transactional(rollbackFor = Exception.class) public R<Boolean> updateSysUser(@RequestBody SysUser sysUser) { try { sysUser.setUpdateBy(SecurityUtils.getUsername()); sysUser.setUpdateTime(new Date()); userService.updateUser(sysUser); if(null != sysUser.getRoleId()){ userRoleService.deleteSysUserRoleByUserId(sysUser.getUserId()); SysUserRole sysUserRole = new SysUserRole(); sysUserRole.setRoleId(sysUser.getRoleId()); sysUserRole.setUserId(sysUser.getUserId()); userRoleService.insertSysUserRole(sysUserRole); } return R.ok(true); } catch (Exception e) { e.printStackTrace(); return R.fail(); } } /** * 获取当前用户信息 */ @InnerAuth @GetMapping("/info/{username}") public R<LoginUser> info(@PathVariable("username") String username) { SysUser sysUser = userService.selectUserByUserName(username); if (StringUtils.isNull(sysUser)) { return R.fail("用户名或密码错误"); } // 角色集合 Set<String> roles = permissionService.getRolePermission(sysUser); // 权限集合 Set<String> permissions = permissionService.getMenuPermission(sysUser); LoginUser sysUserVo = new LoginUser(); sysUserVo.setSysUser(sysUser); sysUserVo.setRoles(roles); sysUserVo.setPermissions(permissions); return R.ok(sysUserVo); } /** * 注册用户信息 */ @PostMapping("/register") public R<Boolean> register(@RequestBody SysUser sysUser) { String username = sysUser.getUserName(); if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) { return R.fail("当前系统没有开启注册功能!"); } if (!userService.checkUserNameUnique(sysUser)) { return R.fail("保存用户'" + username + "'失败,注册账号已存在"); } return R.ok(userService.registerUser(sysUser)); } /** * 获取用户信息 * * @return 用户信息 */ @GetMapping("/getInfo") public AjaxResult getInfo() { SysUser user = userService.selectUserById(SecurityUtils.getUserId()); // 角色集合 Set<String> roles = permissionService.getRolePermission(user); // 权限集合 Set<String> permissions = permissionService.getMenuPermission(user); AjaxResult ajax = AjaxResult.success(); ajax.put("user", user); ajax.put("roles", roles); ajax.put("permissions", permissions); return ajax; } /** * 重置密码 */ @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/resetPwd") @ApiOperation(value = "重置密码", tags = {"管理后台-系统用户管理"}) public AjaxResult resetPwd(@RequestBody SysUser user) { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); user.setUpdateBy(SecurityUtils.getUsername()); return toAjax(userService.resetPwd(user)); } /** * 状态修改 */ @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") public AjaxResult changeStatus(@RequestBody SysUser user) { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); user.setUpdateBy(SecurityUtils.getUsername()); return toAjax(userService.updateUserStatus(user)); } /** * 根据用户编号获取授权角色 */ @GetMapping("/authRole/{userId}") public AjaxResult authRole(@PathVariable("userId") Long userId) { AjaxResult ajax = AjaxResult.success(); SysUser user = userService.selectUserById(userId); List<SysRole> roles = roleService.selectRolesByUserId(userId); ajax.put("user", user); ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); return ajax; } /** * 用户授权角色 */ @Log(title = "用户管理", businessType = BusinessType.GRANT) @PutMapping("/authRole") public AjaxResult insertAuthRole(Long userId, Long[] roleIds) { userService.checkUserDataScope(userId); userService.insertUserAuth(userId, roleIds); return success(); } /** * 获取部门树列表 */ @GetMapping("/deptTree") public AjaxResult deptTree(SysDept dept) { return success(deptService.selectDeptTreeList(dept)); } @PostMapping("/updateUser") public R<Boolean> updateUser(@RequestBody SysUser sysUser){ return R.ok(userService.updateById(sysUser)); } /** * 通过用户id查询角色对象 * @param userId * @return */ @PostMapping("/queryRoleByUserId/{userId}") public R<SysRole> queryRoleByUserId(@PathVariable("userId") Long userId){ SysUserRole one = sysUserRoleService.getOne(Wrappers.lambdaQuery(SysUserRole.class) .eq(SysUserRole::getUserId, userId) .last("LIMIT 1")); System.out.println("通过用户id查询角色对象"+one); if(Objects.nonNull(one)){ SysRole byId = roleService.getOne(Wrappers.lambdaQuery(SysRole.class) .eq(SysRole::getRoleId,one.getRoleId()) .last("LIMIT 1")); return R.ok(byId); } return R.ok(); } @PostMapping("/queryRoleByRoleId/{roleId}") public R<SysRole> queryRoleByRoleId(@PathVariable("roleId") Long roleId){ return R.ok( roleService.getOne(Wrappers.lambdaQuery(SysRole.class) .eq(SysRole::getRoleId, roleId) .last("LIMIT 1"))); } /** * 通过手机号集合查询用户 * @param phoneList * @return */ @PostMapping("/queryUserByPhoneList") public R<List<SysUser>> queryUserByPhoneList(@RequestBody List<String> phoneList){ List<SysUser> list = userService.list(Wrappers.lambdaQuery(SysUser.class) .in(SysUser::getPhonenumber, phoneList) .ne(SysUser::getDelFlag,2)); return R.ok(list); } /** * 通过手机号查询用户 * @param phone * @return */ @PostMapping("/queryUserByPhone") public R<SysUser> queryUserByPhone(@RequestBody String phone){ SysUser user = userService.getOne(Wrappers.lambdaQuery(SysUser.class) .eq(SysUser::getPhonenumber, phone) .last("LIMIT 1")); return R.ok(user); } /** * 通过账号查询用户 * @param userName * @return */ @ResponseBody @PostMapping("/queryUserByUserName") public R<SysUser> queryUserByUserName(@RequestBody String userName){ SysUser user = userService.getOne(Wrappers.lambdaQuery(SysUser.class) .eq(SysUser::getUserName, userName) .last("LIMIT 1")); return R.ok(user); } /** * 添加管理员 * @param user */ @ResponseBody @PostMapping("/addSysUser") @Transactional(rollbackFor = Exception.class) public R<Long> addSysUser(@RequestBody SysUser user) { if(StringUtils.isEmpty(user.getUserName())){ user.setUserName(user.getPhonenumber()); } if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ user.setNickName(user.getPhonenumber()); } // if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { // throw new RuntimeException("手机号已开通账号"); // } if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user)) { throw new RuntimeException("登录账号已存在"); } user.setCreateBy(SecurityUtils.getUsername()); user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); if(null == user.getRoleType()){ user.setRoleType(1); } userService.insertUser(user); SysUserRole sysUserRole = new SysUserRole(); sysUserRole.setRoleId(user.getRoleId()); sysUserRole.setUserId(user.getUserId()); userRoleService.insertSysUserRole(sysUserRole); return R.ok(user.getUserId()); } @ResponseBody @PostMapping("/resetPassword") public R resetPassword(@RequestBody SysUser user) { user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); user.setUpdateBy(SecurityUtils.getUsername()); userService.resetPwd(user); return R.ok(); } @ResponseBody @PostMapping("/getSysUserById") public SysUser getSysUserById(@RequestParam("userId") Long userId){ return userService.getById(userId); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserOnlineController.java
New file @@ -0,0 +1,77 @@ package com.ruoyi.system.controller; import com.ruoyi.common.core.constant.CacheConstants; import com.ruoyi.common.core.utils.StringUtils; 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.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.redis.service.RedisService; import com.ruoyi.system.api.model.LoginUser; import com.ruoyi.system.domain.SysUserOnline; import com.ruoyi.system.service.ISysUserOnlineService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; /** * 在线用户监控 * * @author ruoyi */ @RestController @RequestMapping("/online") public class SysUserOnlineController extends BaseController { @Autowired private ISysUserOnlineService userOnlineService; @Autowired private RedisService redisService; @GetMapping("/list") public TableDataInfo list(String ipaddr, String userName) { Collection<String> keys = redisService.keys(CacheConstants.LOGIN_TOKEN_KEY + "*"); List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>(); for (String key : keys) { LoginUser user = redisService.getCacheObject(key); if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) { userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); } else if (StringUtils.isNotEmpty(ipaddr)) { userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); } else if (StringUtils.isNotEmpty(userName)) { userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); } else { userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); } } Collections.reverse(userOnlineList); userOnlineList.removeAll(Collections.singleton(null)); return getDataTable(userOnlineList); } /** * 强退用户 */ @Log(title = "在线用户", businessType = BusinessType.FORCE) @DeleteMapping("/{tokenId}") public AjaxResult forceLogout(@PathVariable String tokenId) { redisService.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId); return success(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserRoleController.java
@@ -1,20 +1,107 @@ package com.ruoyi.system.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.poi.ExcelUtil; 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.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.system.api.model.SysUserRoleVo; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.service.ISysUserRoleService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; /** * <p> * 前端控制器 * </p> * 用户和角色关联Controller * * @author luodangjia * @since 2024-11-21 * @author xiaochen * @date 2023-06-12 */ @RestController @RequestMapping("/sys-user-role") public class SysUserRoleController { @RequestMapping("/userRole") public class SysUserRoleController extends BaseController { @Autowired private ISysUserRoleService sysUserRoleService; /** * 查询用户和角色关联列表 */ @GetMapping("/list") public TableDataInfo list(SysUserRole sysUserRole) { startPage(); List<SysUserRole> list = sysUserRoleService.selectSysUserRoleList(sysUserRole); return getDataTable(list); } /** * 导出用户和角色关联列表 */ @Log(title = "用户和角色关联", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SysUserRole sysUserRole) { List<SysUserRole> list = sysUserRoleService.selectSysUserRoleList(sysUserRole); ExcelUtil<SysUserRole> util = new ExcelUtil<SysUserRole>(SysUserRole.class); util.exportExcel(response, list, "用户和角色关联数据"); } /** * 获取用户和角色关联详细信息 */ @GetMapping(value = "/{userId}") public AjaxResult getInfo(@PathVariable("userId") Long userId) { return success(sysUserRoleService.selectSysUserRoleByUserId(userId)); } /** * 新增用户和角色关联 */ @Log(title = "用户和角色关联", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody SysUserRole sysUserRole) { return toAjax(sysUserRoleService.insertSysUserRole(sysUserRole)); } /** * 修改用户和角色关联 */ @Log(title = "用户和角色关联", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody SysUserRole sysUserRole) { return toAjax(sysUserRoleService.updateSysUserRole(sysUserRole)); } /** * 删除用户和角色关联 */ @Log(title = "用户和角色关联", businessType = BusinessType.DELETE) @DeleteMapping("/{userIds}") public AjaxResult remove(@PathVariable Long[] userIds) { return toAjax(sysUserRoleService.deleteSysUserRoleByUserIds(userIds)); } /** * 根据用户id获取角色 * @param userId * @return */ @PostMapping("/getRoleByUserId") public R<List<SysUserRoleVo>> getRoleByUserId(@RequestParam("userId") Long userId){ List<SysUserRole> list = sysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, userId)); List<SysUserRoleVo> data = new ArrayList<>(); for (SysUserRole sysUserRole : list) { SysUserRoleVo vo = new SysUserRoleVo(); BeanUtils.copyProperties(sysUserRole, vo); data.add(vo); } return R.ok(data); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java
New file @@ -0,0 +1,125 @@ package com.ruoyi.system.domain; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.annotation.Excel.ColumnType; import com.ruoyi.common.core.web.domain.BaseModel; import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; /** * 参数配置表 sys_config * * @author ruoyi */ public class SysConfig extends BaseModel { private static final long serialVersionUID = 1L; /** * 参数主键 */ @Excel(name = "参数主键", cellType = ColumnType.NUMERIC) private Long configId; /** * 参数名称 */ @Excel(name = "参数名称") private String configName; /** * 参数键名 */ @Excel(name = "参数键名") private String configKey; /** * 参数键值 */ @Excel(name = "参数键值") private String configValue; /** * 系统内置(Y是 N否) */ @Excel(name = "系统内置", readConverterExp = "Y=是,N=否") private String configType; public Long getConfigId() { return configId; } public void setConfigId(Long configId) { this.configId = configId; } @NotBlank(message = "参数名称不能为空") @Size(min = 0, max = 100, message = "参数名称不能超过100个字符") public String getConfigName() { return configName; } public void setConfigName(String configName) { this.configName = configName; } @NotBlank(message = "参数键名长度不能为空") @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符") public String getConfigKey() { return configKey; } public void setConfigKey(String configKey) { this.configKey = configKey; } @NotBlank(message = "参数键值不能为空") @Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符") public String getConfigValue() { return configValue; } public void setConfigValue(String configValue) { this.configValue = configValue; } public String getConfigType() { return configType; } public void setConfigType(String configType) { this.configType = configType; } @ApiModelProperty(value = "备注说明") @Excel(name = "备注说明") private String remark; public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("configId", getConfigId()) .append("configName", getConfigName()) .append("configKey", getConfigKey()) .append("configValue", getConfigValue()) .append("configType", getConfigType()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysMenu.java
New file @@ -0,0 +1,270 @@ package com.ruoyi.system.domain; import com.baomidou.mybatisplus.annotation.TableField; import com.ruoyi.common.core.web.domain.BaseEntity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.ArrayList; import java.util.List; /** * 菜单权限表 sys_menu * * @author ruoyi */ public class SysMenu extends BaseEntity { private static final long serialVersionUID = 1L; /** 菜单ID */ @TableField("menu_id") private Long menuId; /** 菜单名称 */ @TableField("menu_name") private String menuName; /** 父菜单名称 */ @TableField(exist = false) private String parentName; /** 父菜单ID */ @TableField("parent_id") private Long parentId; /** 显示顺序 */ @TableField("order_num") private Integer orderNum; /** 路由地址 */ private String path; /** 组件路径 */ private String component; /** 路由参数 */ private String query; /** 是否为外链(0是 1否) */ @TableField("is_frame") private String isFrame; /** 是否缓存(0缓存 1不缓存) */ @TableField("is_cache") private String isCache; /** 类型(M目录 C菜单 F按钮) */ @TableField("menu_type") private String menuType; /** 显示状态(0显示 1隐藏) */ private String visible; /** 菜单状态(0正常 1停用) */ private String status; /** 权限字符串 */ private String perms; /** 菜单图标 */ private String icon; /** 子菜单 */ @TableField(exist = false) private List<SysMenu> children = new ArrayList<SysMenu>(); public Long getMenuId() { return menuId; } public void setMenuId(Long menuId) { this.menuId = menuId; } @NotBlank(message = "菜单名称不能为空") @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") public String getMenuName() { return menuName; } public void setMenuName(String menuName) { this.menuName = menuName; } public String getParentName() { return parentName; } public void setParentName(String parentName) { this.parentName = parentName; } public Long getParentId() { return parentId; } public void setParentId(Long parentId) { this.parentId = parentId; } @NotNull(message = "显示顺序不能为空") public Integer getOrderNum() { return orderNum; } public void setOrderNum(Integer orderNum) { this.orderNum = orderNum; } @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") public String getPath() { return path; } public void setPath(String path) { this.path = path; } @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") public String getComponent() { return component; } public void setComponent(String component) { this.component = component; } public String getQuery() { return query; } public void setQuery(String query) { this.query = query; } public String getIsFrame() { return isFrame; } public void setIsFrame(String isFrame) { this.isFrame = isFrame; } public String getIsCache() { return isCache; } public void setIsCache(String isCache) { this.isCache = isCache; } @NotBlank(message = "菜单类型不能为空") public String getMenuType() { return menuType; } public void setMenuType(String menuType) { this.menuType = menuType; } public String getVisible() { return visible; } public void setVisible(String visible) { this.visible = visible; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") public String getPerms() { return perms; } public void setPerms(String perms) { this.perms = perms; } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public List<SysMenu> getChildren() { return children; } public void setChildren(List<SysMenu> children) { this.children = children; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("menuId", getMenuId()) .append("menuName", getMenuName()) .append("parentId", getParentId()) .append("orderNum", getOrderNum()) .append("path", getPath()) .append("component", getComponent()) .append("isFrame", getIsFrame()) .append("IsCache", getIsCache()) .append("menuType", getMenuType()) .append("visible", getVisible()) .append("status ", getStatus()) .append("perms", getPerms()) .append("icon", getIcon()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysMenus.java
New file @@ -0,0 +1,103 @@ package com.ruoyi.system.domain; import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * 菜单权限表 sys_menu * * @author ruoyi */ @Data public class SysMenus extends BaseEntity { private static final long serialVersionUID = 1L; /** 菜单ID */ @TableField("menu_id") private Long menuId; /** 菜单名称 */ @TableField("menu_name") private String menuName; /** 父菜单名称 */ @TableField(exist = false) private String parentName; /** 父菜单ID */ @TableField("parent_id") private Long parentId; /** 显示顺序 */ @TableField("order_num") private Integer orderNum; /** 路由地址 */ private String path; /** 组件路径 */ private String component; /** 路由参数 */ private String query; /** 是否为外链(0是 1否) */ @TableField("is_frame") private String isFrame; /** 是否缓存(0缓存 1不缓存) */ @TableField("is_cache") private String isCache; /** 类型(M目录 C菜单 F按钮) */ @TableField("menu_type") private String menuType; /** 显示状态(0显示 1隐藏) */ private String visible; /** 菜单状态(0正常 1停用) */ private Boolean status=false; /** 权限字符串 */ private String perms; /** 菜单图标 */ private String icon; @TableField("create_by") private String createBy; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField("create_time") private Date createTime; /** 更新者 */ @ApiModelProperty(value = "记录修改人,前端忽略") //@JsonIgnore @TableField("update_by") private String updateBy; /** 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField("update_time") private Date updateTime; /** 备注 */ private String remark; /** 子菜单 */ @TableField(exist = false) private List<SysMenus> children = new ArrayList<SysMenus>(); @ApiModelProperty("1 拥有 2未拥有") private Integer isHave; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java
New file @@ -0,0 +1,116 @@ package com.ruoyi.system.domain; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.web.domain.BaseModel; import com.ruoyi.common.core.xss.Xss; import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; /** * 通知公告表 sys_notice * * @author ruoyi */ public class SysNotice extends BaseModel { private static final long serialVersionUID = 1L; /** 公告ID */ private Long noticeId; /** 公告标题 */ private String noticeTitle; /** 公告类型(1通知 2公告) */ private String noticeType; /** 公告内容 */ private String noticeContent; /** 公告状态(0正常 1关闭) */ private String status; public Long getNoticeId() { return noticeId; } public void setNoticeId(Long noticeId) { this.noticeId = noticeId; } public void setNoticeTitle(String noticeTitle) { this.noticeTitle = noticeTitle; } @Xss(message = "公告标题不能包含脚本字符") @NotBlank(message = "公告标题不能为空") @Size(min = 0, max = 50, message = "公告标题不能超过50个字符") public String getNoticeTitle() { return noticeTitle; } public void setNoticeType(String noticeType) { this.noticeType = noticeType; } public String getNoticeType() { return noticeType; } public void setNoticeContent(String noticeContent) { this.noticeContent = noticeContent; } public String getNoticeContent() { return noticeContent; } public void setStatus(String status) { this.status = status; } public String getStatus() { return status; } @ApiModelProperty(value = "备注说明") @Excel(name = "备注说明") private String remark; public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("noticeId", getNoticeId()) .append("noticeTitle", getNoticeTitle()) .append("noticeType", getNoticeType()) .append("noticeContent", getNoticeContent()) .append("status", getStatus()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java
New file @@ -0,0 +1,137 @@ package com.ruoyi.system.domain; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.annotation.Excel.ColumnType; import com.ruoyi.common.core.web.domain.BaseModel; import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; /** * 岗位表 sys_post * * @author ruoyi */ public class SysPost extends BaseModel { private static final long serialVersionUID = 1L; /** 岗位序号 */ @Excel(name = "岗位序号", cellType = ColumnType.NUMERIC) private Long postId; /** 岗位编码 */ @Excel(name = "岗位编码") private String postCode; /** 岗位名称 */ @Excel(name = "岗位名称") private String postName; /** 岗位排序 */ @Excel(name = "岗位排序") private Integer postSort; /** 状态(0正常 1停用) */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用") private String status; /** 用户是否存在此岗位标识 默认不存在 */ private boolean flag = false; public Long getPostId() { return postId; } public void setPostId(Long postId) { this.postId = postId; } @NotBlank(message = "岗位编码不能为空") @Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符") public String getPostCode() { return postCode; } public void setPostCode(String postCode) { this.postCode = postCode; } @NotBlank(message = "岗位名称不能为空") @Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符") public String getPostName() { return postName; } public void setPostName(String postName) { this.postName = postName; } @NotNull(message = "显示顺序不能为空") public Integer getPostSort() { return postSort; } public void setPostSort(Integer postSort) { this.postSort = postSort; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public boolean isFlag() { return flag; } public void setFlag(boolean flag) { this.flag = flag; } @ApiModelProperty(value = "备注说明") @Excel(name = "备注说明") private String remark; public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("postId", getPostId()) .append("postCode", getPostCode()) .append("postName", getPostName()) .append("postSort", getPostSort()) .append("status", getStatus()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java
New file @@ -0,0 +1,46 @@ package com.ruoyi.system.domain; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 角色和部门关联 sys_role_dept * * @author ruoyi */ public class SysRoleDept { /** 角色ID */ private Long roleId; /** 部门ID */ private Long deptId; public Long getRoleId() { return roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } public Long getDeptId() { return deptId; } public void setDeptId(Long deptId) { this.deptId = deptId; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("roleId", getRoleId()) .append("deptId", getDeptId()) .toString(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java
New file @@ -0,0 +1,49 @@ package com.ruoyi.system.domain; import com.baomidou.mybatisplus.annotation.TableField; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 角色和菜单关联 sys_role_menu * * @author ruoyi */ public class SysRoleMenu { /** 角色ID */ @TableField("role_id") private Long roleId; /** 菜单ID */ @TableField("menu_id") private Long menuId; public Long getRoleId() { return roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } public Long getMenuId() { return menuId; } public void setMenuId(Long menuId) { this.menuId = menuId; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("roleId", getRoleId()) .append("menuId", getMenuId()) .toString(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java
New file @@ -0,0 +1,100 @@ package com.ruoyi.system.domain; /** * 当前在线会话 * * @author ruoyi */ public class SysUserOnline { /** 会话编号 */ private String tokenId; /** 用户名称 */ private String userName; /** 登录IP地址 */ private String ipaddr; /** 登录地址 */ private String loginLocation; /** 浏览器类型 */ private String browser; /** 操作系统 */ private String os; /** 登录时间 */ private Long loginTime; public String getTokenId() { return tokenId; } public void setTokenId(String tokenId) { this.tokenId = tokenId; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getIpaddr() { return ipaddr; } public void setIpaddr(String ipaddr) { this.ipaddr = ipaddr; } public String getLoginLocation() { return loginLocation; } public void setLoginLocation(String loginLocation) { this.loginLocation = loginLocation; } public String getBrowser() { return browser; } public void setBrowser(String browser) { this.browser = browser; } public String getOs() { return os; } public void setOs(String os) { this.os = os; } public Long getLoginTime() { return loginTime; } public void setLoginTime(Long loginTime) { this.loginTime = loginTime; } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java
New file @@ -0,0 +1,46 @@ package com.ruoyi.system.domain; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 用户和岗位关联 sys_user_post * * @author ruoyi */ public class SysUserPost { /** 用户ID */ private Long userId; /** 岗位ID */ private Long postId; public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public Long getPostId() { return postId; } public void setPostId(Long postId) { this.postId = postId; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("userId", getUserId()) .append("postId", getPostId()) .toString(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java
New file @@ -0,0 +1,49 @@ package com.ruoyi.system.domain; import com.baomidou.mybatisplus.annotation.TableField; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 用户和角色关联 sys_user_role * * @author ruoyi */ public class SysUserRole { /** 用户ID */ @TableField("user_id") private Long userId; /** 角色ID */ @TableField("role_id") private Long roleId; public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public Long getRoleId() { return roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("userId", getUserId()) .append("roleId", getRoleId()) .toString(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/AddCompanyUserDto.java
New file @@ -0,0 +1,19 @@ package com.ruoyi.system.domain.dto; import com.ruoyi.system.api.domain.SysUser; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.List; @Data public class AddCompanyUserDto { private SysUser sysUser; private Integer companyId; @NotNull(message = "请选择角色") private Long roleId; @NotNull(message = "请选择关联门店") private List<Integer> shopIds; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/IndexDto.java
New file @@ -0,0 +1,11 @@ package com.ruoyi.system.domain.dto; import lombok.Data; import java.util.List; @Data public class IndexDto { private Integer companyId; private List<Integer> shopIds; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/RoleAddDto.java
New file @@ -0,0 +1,22 @@ package com.ruoyi.system.domain.dto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.util.List; @Data public class RoleAddDto { @ApiModelProperty(value = "角色名称", required = true) @NotBlank(message = "角色名称不能为空") private String roleName; @ApiModelProperty(value = "站点id", required = true) private List<Integer> siteIds; @ApiModelProperty(value = "备注") private String remark; @ApiModelProperty(value = "菜单id", required = true) @NotNull(message = "菜单id不能为空") private List<Long> menuIds; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/RoleUpdateDto.java
New file @@ -0,0 +1,22 @@ package com.ruoyi.system.domain.dto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; import java.util.List; @Data public class RoleUpdateDto { @ApiModelProperty("角色id") private Long roleId; @ApiModelProperty(value = "角色名称",required = true) @NotBlank(message = "角色名称不能为空") private String roleName; @ApiModelProperty(value = "站点id", required = true) private List<Integer> siteIds; @ApiModelProperty(value = "备注") private String remark; @ApiModelProperty(value = "菜单id", required = true) private List<Long> menuIds; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CompanyUserVo.java
New file @@ -0,0 +1,21 @@ package com.ruoyi.system.domain.vo; //import com.ruoyi.management.api.model.TCompanyShop; import com.ruoyi.system.api.domain.SysUser; import lombok.Data; import javax.validation.constraints.NotBlank; import java.util.List; @Data public class CompanyUserVo { private SysUser sysUser; @NotBlank(message = "请选择角色") private Long roleId; @NotBlank(message = "请选择关联门店") private List<Integer> shopIds; // @NotBlank(message = "关联门店") // private List<TCompanyShop> shopList; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java
New file @@ -0,0 +1,106 @@ package com.ruoyi.system.domain.vo; import com.ruoyi.common.core.utils.StringUtils; /** * 路由显示信息 * * @author ruoyi */ public class MetaVo { /** * 设置该路由在侧边栏和面包屑中展示的名字 */ private String title; /** * 设置该路由的图标,对应路径src/assets/icons/svg */ private String icon; /** * 设置为true,则不会被 <keep-alive>缓存 */ private boolean noCache; /** * 内链地址(http(s)://开头) */ private String link; public MetaVo() { } public MetaVo(String title, String icon) { this.title = title; this.icon = icon; } public MetaVo(String title, String icon, boolean noCache) { this.title = title; this.icon = icon; this.noCache = noCache; } public MetaVo(String title, String icon, String link) { this.title = title; this.icon = icon; this.link = link; } public MetaVo(String title, String icon, boolean noCache, String link) { this.title = title; this.icon = icon; this.noCache = noCache; if (StringUtils.ishttp(link)) { this.link = link; } } public boolean isNoCache() { return noCache; } public void setNoCache(boolean noCache) { this.noCache = noCache; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public String getLink() { return link; } public void setLink(String link) { this.link = link; } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RoleInfoVo.java
New file @@ -0,0 +1,23 @@ package com.ruoyi.system.domain.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data public class RoleInfoVo { private Long roleId; private String roleName; @ApiModelProperty("菜单id") private List<Long> menus; @ApiModelProperty(value = "备注") private String remark; @ApiModelProperty("站点id") private List<Integer> siteIds; @ApiModelProperty(value = "站点名称") private List<String> siteNames; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java
New file @@ -0,0 +1,149 @@ package com.ruoyi.system.domain.vo; import com.fasterxml.jackson.annotation.JsonInclude; import java.util.List; /** * 路由配置信息 * * @author ruoyi */ @JsonInclude(JsonInclude.Include.NON_EMPTY) public class RouterVo { /** * 路由名字 */ private String name; /** * 路由地址 */ private String path; /** * 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现 */ private boolean hidden; /** * 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 */ private String redirect; /** * 组件地址 */ private String component; /** * 路由参数:如 {"id": 1, "name": "ry"} */ private String query; /** * 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 */ private Boolean alwaysShow; /** * 其他元素 */ private MetaVo meta; /** * 子路由 */ private List<RouterVo> children; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public boolean getHidden() { return hidden; } public void setHidden(boolean hidden) { this.hidden = hidden; } public String getRedirect() { return redirect; } public void setRedirect(String redirect) { this.redirect = redirect; } public String getComponent() { return component; } public void setComponent(String component) { this.component = component; } public String getQuery() { return query; } public void setQuery(String query) { this.query = query; } public Boolean getAlwaysShow() { return alwaysShow; } public void setAlwaysShow(Boolean alwaysShow) { this.alwaysShow = alwaysShow; } public MetaVo getMeta() { return meta; } public void setMeta(MetaVo meta) { this.meta = meta; } public List<RouterVo> getChildren() { return children; } public void setChildren(List<RouterVo> children) { this.children = children; } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TCompanyToUserVo.java
New file @@ -0,0 +1,28 @@ package com.ruoyi.system.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; import java.util.List; @Data public class TCompanyToUserVo { @ApiModelProperty("用户id") private Long id; private String phonenumber; private String roleName; private String status; private List<String> shopName; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date loginDate; private String userName; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TreeSelect.java
New file @@ -0,0 +1,78 @@ package com.ruoyi.system.domain.vo; import com.fasterxml.jackson.annotation.JsonInclude; import com.ruoyi.system.api.domain.SysDept; import com.ruoyi.system.domain.SysMenu; import java.io.Serializable; import java.util.List; import java.util.stream.Collectors; /** * Treeselect树结构实体类 * * @author ruoyi */ public class TreeSelect implements Serializable { private static final long serialVersionUID = 1L; /** 节点ID */ private Long id; /** 节点名称 */ private String label; /** 子节点 */ @JsonInclude(JsonInclude.Include.NON_EMPTY) private List<TreeSelect> children; public TreeSelect() { } public TreeSelect(SysDept dept) { this.id = dept.getDeptId(); this.label = dept.getDeptName(); this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); } public TreeSelect(SysMenu menu) { this.id = menu.getMenuId(); this.label = menu.getMenuName(); this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } public List<TreeSelect> getChildren() { return children; } public void setChildren(List<TreeSelect> children) { this.children = children; } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/UserRoleVO.java
New file @@ -0,0 +1,22 @@ package com.ruoyi.system.domain.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; @Data @ApiModel(value = "司管用户VO") public class UserRoleVO implements Serializable { @ApiModelProperty(value = "司管用户id") private Integer manageId; @ApiModelProperty(value = "司管用户名称") private String manageName; @ApiModelProperty(value = "司管账号") private String userName; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/ViolationListExportVo.java
New file @@ -0,0 +1,44 @@ package com.ruoyi.system.domain.vo; import cn.afterturn.easypoi.excel.annotation.Excel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.Date; @Data public class ViolationListExportVo { @ApiModelProperty("违章id") private Integer id; @ApiModelProperty("车id") private Integer carId; @Excel(name = "车牌号") @ApiModelProperty("车牌号") private String carNumber; @Excel(name = "所属门店") @ApiModelProperty("所属店铺") private String shopName; @Excel(name = "车辆状态",replace = {"待上户_1","待办证_2","待整备_3","待租_4","已租_5","已处置_6"}) @ApiModelProperty("车辆状态1= 待上户、2=待办证、3=待整备、4=待租、5=已租、6=已处置") private Integer state; @Excel(name = "承租方") @ApiModelProperty("承租方") private String name; @Excel(name = "违章条数") @ApiModelProperty("违章条数") private Integer violationNum; @Excel(name = "罚款合计") @ApiModelProperty("罚款合计") private BigDecimal allMoney; @Excel(name = "扣分合计") @ApiModelProperty("扣分合计") private Integer score; @Excel(name = "滞纳金") @ApiModelProperty("滞纳金") private BigDecimal overMoney; @Excel(name = "更新时间",exportFormat = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty("更新时间") private Date updateTime; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/filter/AuthFilter.java
@@ -53,7 +53,7 @@ } String userType = request.getHeader("user_type"); //管理后台用户 if ("system".equals(userType)) { if ("mapping/system".equals(userType)) { SysUser sysUser = sysUserService.getById(userid); if(null == sysUser || "2".equals(sysUser.getDelFlag())){ log.error("[账户异常处理]请求账户id:{}", userid); @@ -69,7 +69,7 @@ //小程序用户 if ("applet".equals(userType)) { AppUser appUser = appUserClient.getAppUserById(Long.valueOf(userid)); if(null == appUser || 1 == appUser.getDelFlag() || 3 == appUser.getStatus()){ if(null == appUser || appUser.getDelFlag() || 3 == appUser.getStatus()){ log.error("[账户异常处理]请求账户id:{}", userid); unauthorizedResponse(response,"无效的账户"); return; ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/GenTableColumnMapper.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/GenTableMapper.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java
@@ -1,16 +1,79 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysConfig; import com.ruoyi.system.domain.SysConfig; import org.apache.ibatis.annotations.Mapper; import java.util.List; /** * <p> * Mapper 接口 * </p> * 参数配置 数据层 * * @author luodangjia * @since 2024-11-21 * @author ruoyi */ @Mapper public interface SysConfigMapper extends BaseMapper<SysConfig> { } /** * 查询参数配置信息 * * @param config 参数配置信息 * @return 参数配置信息 */ public SysConfig selectConfig(SysConfig config); /** * 通过ID查询配置 * * @param configId 参数ID * @return 参数配置信息 */ public SysConfig selectConfigById(Long configId); /** * 查询参数配置列表 * * @param config 参数配置信息 * @return 参数配置集合 */ public List<SysConfig> selectConfigList(SysConfig config); /** * 根据键名查询参数配置信息 * * @param configKey 参数键名 * @return 参数配置信息 */ public SysConfig checkConfigKeyUnique(String configKey); /** * 新增参数配置 * * @param config 参数配置信息 * @return 结果 */ public int insertConfig(SysConfig config); /** * 修改参数配置 * * @param config 参数配置信息 * @return 结果 */ public int updateConfig(SysConfig config); /** * 删除参数配置 * * @param configId 参数ID * @return 结果 */ public int deleteConfigById(Long configId); /** * 批量删除参数信息 * * @param configIds 需要删除的参数ID * @return 结果 */ public int deleteConfigByIds(Long[] configIds); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
@@ -1,16 +1,119 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysDept; import com.ruoyi.system.api.domain.SysDept; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 部门管理 数据层 * * @author ruoyi */ public interface SysDeptMapper extends BaseMapper<SysDept> { public interface SysDeptMapper { /** * 查询部门管理数据 * * @param dept 部门信息 * @return 部门信息集合 */ public List<SysDept> selectDeptList(SysDept dept); /** * 根据角色ID查询部门树信息 * * @param roleId 角色ID * @param deptCheckStrictly 部门树选择项是否关联显示 * @return 选中部门列表 */ public List<Long> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); /** * 根据部门ID查询信息 * * @param deptId 部门ID * @return 部门信息 */ public SysDept selectDeptById(Long deptId); /** * 根据ID查询所有子部门 * * @param deptId 部门ID * @return 部门列表 */ public List<SysDept> selectChildrenDeptById(Long deptId); /** * 根据ID查询所有子部门(正常状态) * * @param deptId 部门ID * @return 子部门数 */ public int selectNormalChildrenDeptById(Long deptId); /** * 是否存在子节点 * * @param deptId 部门ID * @return 结果 */ public int hasChildByDeptId(Long deptId); /** * 查询部门是否存在用户 * * @param deptId 部门ID * @return 结果 */ public int checkDeptExistUser(Long deptId); /** * 校验部门名称是否唯一 * * @param deptName 部门名称 * @param parentId 父部门ID * @return 结果 */ public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId); /** * 新增部门信息 * * @param dept 部门信息 * @return 结果 */ public int insertDept(SysDept dept); /** * 修改部门信息 * * @param dept 部门信息 * @return 结果 */ public int updateDept(SysDept dept); /** * 修改所在部门正常状态 * * @param deptIds 部门ID组 */ public void updateDeptStatusNormal(Long[] deptIds); /** * 修改子元素关系 * * @param depts 子元素 * @return 结果 */ public int updateDeptChildren(@Param("depts") List<SysDept> depts); /** * 删除部门管理信息 * * @param deptId 部门ID * @return 结果 */ public int deleteDeptById(Long deptId); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java
@@ -1,16 +1,96 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysDictData; import com.ruoyi.system.api.domain.SysDictData; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 字典表 数据层 * * @author ruoyi */ public interface SysDictDataMapper extends BaseMapper<SysDictData> { public interface SysDictDataMapper { /** * 根据条件分页查询字典数据 * * @param dictData 字典数据信息 * @return 字典数据集合信息 */ public List<SysDictData> selectDictDataList(SysDictData dictData); /** * 根据字典类型查询字典数据 * * @param dictType 字典类型 * @return 字典数据集合信息 */ public List<SysDictData> selectDictDataByType(String dictType); /** * 根据字典类型和字典键值查询字典数据信息 * * @param dictType 字典类型 * @param dictValue 字典键值 * @return 字典标签 */ public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue); /** * 根据字典数据ID查询信息 * * @param dictCode 字典数据ID * @return 字典数据 */ public SysDictData selectDictDataById(Long dictCode); /** * 查询字典数据 * * @param dictType 字典类型 * @return 字典数据 */ public int countDictDataByType(String dictType); /** * 通过字典ID删除字典数据信息 * * @param dictCode 字典数据ID * @return 结果 */ public int deleteDictDataById(Long dictCode); /** * 批量删除字典数据信息 * * @param dictCodes 需要删除的字典数据ID * @return 结果 */ public int deleteDictDataByIds(Long[] dictCodes); /** * 新增字典数据信息 * * @param dictData 字典数据信息 * @return 结果 */ public int insertDictData(SysDictData dictData); /** * 修改字典数据信息 * * @param dictData 字典数据信息 * @return 结果 */ public int updateDictData(SysDictData dictData); /** * 同步修改字典类型 * * @param oldDictType 旧字典类型 * @param newDictType 新旧字典类型 * @return 结果 */ public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java
@@ -1,16 +1,84 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysDictType; import com.ruoyi.system.api.domain.SysDictType; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 字典表 数据层 * * @author ruoyi */ public interface SysDictTypeMapper extends BaseMapper<SysDictType> { public interface SysDictTypeMapper { /** * 根据条件分页查询字典类型 * * @param dictType 字典类型信息 * @return 字典类型集合信息 */ public List<SysDictType> selectDictTypeList(SysDictType dictType); /** * 根据所有字典类型 * * @return 字典类型集合信息 */ public List<SysDictType> selectDictTypeAll(); /** * 根据字典类型ID查询信息 * * @param dictId 字典类型ID * @return 字典类型 */ public SysDictType selectDictTypeById(Long dictId); /** * 根据字典类型查询信息 * * @param dictType 字典类型 * @return 字典类型 */ public SysDictType selectDictTypeByType(String dictType); /** * 通过字典ID删除字典信息 * * @param dictId 字典ID * @return 结果 */ public int deleteDictTypeById(Long dictId); /** * 批量删除字典类型信息 * * @param dictIds 需要删除的字典ID * @return 结果 */ public int deleteDictTypeByIds(Long[] dictIds); /** * 新增字典类型信息 * * @param dictType 字典类型信息 * @return 结果 */ public int insertDictType(SysDictType dictType); /** * 修改字典类型信息 * * @param dictType 字典类型信息 * @return 结果 */ public int updateDictType(SysDictType dictType); /** * 校验字典类型称是否唯一 * * @param dictType 字典类型 * @return 结果 */ public SysDictType checkDictTypeUnique(String dictType); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysJobLogMapper.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysJobMapper.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLoginLogMapper.java
@@ -1,16 +1,23 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysLoginLog; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.system.api.domain.SysLoginLog; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * @author zhibing.pu * @Date 2024/8/12 15:44 */ public interface SysLoginLogMapper extends BaseMapper<SysLoginLog> { /** * 获取列表数据 * @param pageInfo * @param name * @return */ List<SysLoginLog> pageList(PageInfo<SysLoginLog> pageInfo, @Param("name") String name); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java
@@ -1,16 +1,137 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysMenu; import com.ruoyi.system.domain.SysMenu; import com.ruoyi.system.domain.SysMenus; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 菜单表 数据层 * * @author ruoyi */ public interface SysMenuMapper extends BaseMapper<SysMenu> { public interface SysMenuMapper extends BaseMapper<SysMenu> { /** * 查询系统菜单列表 * * @param menu 菜单信息 * @return 菜单列表 */ public List<SysMenu> selectMenuList(SysMenu menu); /** * 根据用户所有权限 * * @return 权限列表 */ public List<String> selectMenuPerms(); /** * 根据用户查询系统菜单列表 * * @param menu 菜单信息 * @return 菜单列表 */ public List<SysMenu> selectMenuListByUserId(SysMenu menu); /** * 根据角色ID查询权限 * * @param roleId 角色ID * @return 权限列表 */ public List<String> selectMenuPermsByRoleId(Long roleId); /** * 根据用户ID查询权限 * * @param userId 用户ID * @return 权限列表 */ public List<String> selectMenuPermsByUserId(Long userId); /** * 根据用户ID查询菜单 * * @return 菜单列表 */ public List<SysMenu> selectMenuTreeAll(); /** * 根据用户ID查询菜单 * * @param userId 用户ID * @return 菜单列表 */ public List<SysMenu> selectMenuTreeByUserId(Long userId); /** * 根据角色ID查询菜单树信息 * * @param roleId 角色ID * @param menuCheckStrictly 菜单树选择项是否关联显示 * @return 选中菜单列表 */ public List<Long> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly); /** * 根据菜单ID查询信息 * * @param menuId 菜单ID * @return 菜单信息 */ public SysMenu selectMenuById(Long menuId); /** * 是否存在菜单子节点 * * @param menuId 菜单ID * @return 结果 */ public int hasChildByMenuId(Long menuId); /** * 新增菜单信息 * * @param menu 菜单信息 * @return 结果 */ public int insertMenu(SysMenu menu); /** * 修改菜单信息 * * @param menu 菜单信息 * @return 结果 */ public int updateMenu(SysMenu menu); /** * 删除菜单管理信息 * * @param menuId 菜单ID * @return 结果 */ public int deleteMenuById(Long menuId); /** * 校验菜单名称是否唯一 * * @param menuName 菜单名称 * @param parentId 父菜单ID * @return 结果 */ public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId); List<SysMenus> getAll(); List<SysMenus> getAllInIds(@Param("menusId") List<Long> menusId); List<SysMenus> getAllOne(); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java
@@ -1,16 +1,60 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysNotice; import com.ruoyi.system.domain.SysNotice; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 通知公告表 数据层 * * @author ruoyi */ public interface SysNoticeMapper extends BaseMapper<SysNotice> { public interface SysNoticeMapper { /** * 查询公告信息 * * @param noticeId 公告ID * @return 公告信息 */ public SysNotice selectNoticeById(Long noticeId); } /** * 查询公告列表 * * @param notice 公告信息 * @return 公告集合 */ public List<SysNotice> selectNoticeList(SysNotice notice); /** * 新增公告 * * @param notice 公告信息 * @return 结果 */ public int insertNotice(SysNotice notice); /** * 修改公告 * * @param notice 公告信息 * @return 结果 */ public int updateNotice(SysNotice notice); /** * 批量删除公告 * * @param noticeId 公告ID * @return 结果 */ public int deleteNoticeById(Long noticeId); /** * 批量删除公告信息 * * @param noticeIds 需要删除的公告ID * @return 结果 */ public int deleteNoticeByIds(Long[] noticeIds); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
@@ -1,16 +1,49 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysOperLog; import com.ruoyi.system.api.domain.SysOperLog; import java.util.List; /** * <p> * Mapper 接口 * </p> * 操作日志 数据层 * * @author luodangjia * @since 2024-11-21 * @author ruoyi */ public interface SysOperLogMapper extends BaseMapper<SysOperLog> { /** * 新增操作日志 * * @param operLog 操作日志对象 */ public int insertOperlog(SysOperLog operLog); /** * 查询系统操作日志集合 * * @param operLog 操作日志对象 * @return 操作日志集合 */ public List<SysOperLog> selectOperLogList(SysOperLog operLog); /** * 批量删除系统操作日志 * * @param operIds 需要删除的操作日志ID * @return 结果 */ public int deleteOperLogByIds(Long[] operIds); /** * 查询操作日志详细 * * @param operId 操作ID * @return 操作日志对象 */ public SysOperLog selectOperLogById(Long operId); /** * 清空操作日志 */ public void cleanOperLog(); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java
@@ -1,16 +1,100 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysPost; import com.ruoyi.system.domain.SysPost; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 岗位信息 数据层 * * @author ruoyi */ public interface SysPostMapper extends BaseMapper<SysPost> { public interface SysPostMapper { /** * 查询岗位数据集合 * * @param post 岗位信息 * @return 岗位数据集合 */ public List<SysPost> selectPostList(SysPost post); /** * 查询所有岗位 * * @return 岗位列表 */ public List<SysPost> selectPostAll(); /** * 通过岗位ID查询岗位信息 * * @param postId 岗位ID * @return 角色对象信息 */ public SysPost selectPostById(Long postId); /** * 根据用户ID获取岗位选择框列表 * * @param userId 用户ID * @return 选中岗位ID列表 */ public List<Long> selectPostListByUserId(Long userId); /** * 查询用户所属岗位组 * * @param userName 用户名 * @return 结果 */ public List<SysPost> selectPostsByUserName(String userName); /** * 删除岗位信息 * * @param postId 岗位ID * @return 结果 */ public int deletePostById(Long postId); /** * 批量删除岗位信息 * * @param postIds 需要删除的岗位ID * @return 结果 */ public int deletePostByIds(Long[] postIds); /** * 修改岗位信息 * * @param post 岗位信息 * @return 结果 */ public int updatePost(SysPost post); /** * 新增岗位信息 * * @param post 岗位信息 * @return 结果 */ public int insertPost(SysPost post); /** * 校验岗位名称 * * @param postName 岗位名称 * @return 结果 */ public SysPost checkPostNameUnique(String postName); /** * 校验岗位编码 * * @param postCode 岗位编码 * @return 结果 */ public SysPost checkPostCodeUnique(String postCode); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java
@@ -1,16 +1,45 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysRoleDept; import com.ruoyi.system.domain.SysRoleDept; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 角色与部门关联表 数据层 * * @author ruoyi */ public interface SysRoleDeptMapper extends BaseMapper<SysRoleDept> { public interface SysRoleDeptMapper { /** * 通过角色ID删除角色和部门关联 * * @param roleId 角色ID * @return 结果 */ public int deleteRoleDeptByRoleId(Long roleId); /** * 批量删除角色部门关联信息 * * @param ids 需要删除的数据ID * @return 结果 */ public int deleteRoleDept(Long[] ids); /** * 查询部门使用数量 * * @param deptId 部门ID * @return 结果 */ public int selectCountRoleDeptByDeptId(Long deptId); /** * 批量新增角色部门信息 * * @param roleDeptList 角色部门列表 * @return 结果 */ public int batchRoleDept(List<SysRoleDept> roleDeptList); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
@@ -1,16 +1,120 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysRole; import com.ruoyi.system.api.domain.SysRole; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 角色表 数据层 * * @author ruoyi */ public interface SysRoleMapper extends BaseMapper<SysRole> { public interface SysRoleMapper extends BaseMapper<SysRole> { /** * 根据条件分页查询角色数据 * * @param role 角色信息 * @return 角色数据集合信息 */ public List<SysRole> selectRoleList(SysRole role); /** * 根据用户ID查询角色 * * @param userId 用户ID * @return 角色列表 */ public List<SysRole> selectRolePermissionByUserId(Long userId); /** * 查询所有角色 * * @return 角色列表 */ public List<SysRole> selectRoleAll(); /** * 根据用户ID获取角色选择框列表 * * @param userId 用户ID * @return 选中角色ID列表 */ public List<Long> selectRoleListByUserId(Long userId); /** * 通过角色ID查询角色 * * @param roleId 角色ID * @return 角色对象信息 */ public SysRole selectRoleById(Long roleId); /** * 根据用户ID查询角色 * * @param userName 用户名 * @return 角色列表 */ public List<SysRole> selectRolesByUserName(String userName); /** * 校验角色名称是否唯一 * * @param roleName 角色名称 * @return 角色信息 */ public SysRole checkRoleNameUnique(String roleName); /** * 校验角色权限是否唯一 * * @param roleKey 角色权限 * @return 角色信息 */ public SysRole checkRoleKeyUnique(String roleKey); /** * 修改角色信息 * * @param role 角色信息 * @return 结果 */ public int updateRole(SysRole role); /** * 新增角色信息 * * @param role 角色信息 * @return 结果 */ public int insertRole(SysRole role); /** * 通过角色ID删除角色 * * @param roleId 角色ID * @return 结果 */ public int deleteRoleById(Long roleId); /** * 批量删除角色信息 * * @param roleIds 需要删除的角色ID * @return 结果 */ public int deleteRoleByIds(Long[] roleIds); List<SysRole> isExitUpdate(@Param("roleName") String roleName, @Param("roleId") Long roleId, @Param("companyId") Integer companyId); /** * 根据id获取数据 * @param ids * @return */ List<SysRole> getSysRoleByIds(@Param("ids") List<Integer> ids); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java
@@ -1,16 +1,46 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysRoleMenu; import com.ruoyi.system.domain.SysRoleMenu; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 角色与菜单关联表 数据层 * * @author ruoyi */ public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> { public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> { /** * 查询菜单使用数量 * * @param menuId 菜单ID * @return 结果 */ public int checkMenuExistRole(Long menuId); /** * 通过角色ID删除角色和菜单关联 * * @param roleId 角色ID * @return 结果 */ public int deleteRoleMenuByRoleId(Long roleId); /** * 批量删除角色菜单关联信息 * * @param ids 需要删除的数据ID * @return 结果 */ public int deleteRoleMenu(Long[] ids); /** * 批量新增角色菜单信息 * * @param roleMenuList 角色菜单列表 * @return 结果 */ public int batchRoleMenu(List<SysRoleMenu> roleMenuList); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
@@ -1,16 +1,151 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysUser; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.query.ChangeUserQuery; import com.ruoyi.system.query.GetSysUserList; import org.apache.ibatis.annotations.Param; import java.util.ArrayList; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 用户表 数据层 * * @author ruoyi */ public interface SysUserMapper extends BaseMapper<SysUser> { public interface SysUserMapper extends BaseMapper<SysUser> { /** * 根据条件分页查询用户列表 * * @param sysUser 用户信息 * @return 用户信息集合信息 */ public List<SysUser> selectUserList(SysUser sysUser); /** * 根据条件分页查询已配用户角色列表 * * @param user 用户信息 * @return 用户信息集合信息 */ public List<SysUser> selectAllocatedList(SysUser user); /** * 根据条件分页查询未分配用户角色列表 * * @param user 用户信息 * @return 用户信息集合信息 */ public List<SysUser> selectUnallocatedList(SysUser user); /** * 通过用户名查询用户 * * @param userName 用户名 * @return 用户对象信息 */ public SysUser selectUserByUserName(String userName); /** * 通过用户ID查询用户 * * @param userId 用户ID * @return 用户对象信息 */ public SysUser selectUserById(Long userId); /** * 新增用户信息 * * @param user 用户信息 * @return 结果 */ public int insertUser(SysUser user); /** * 修改用户信息 * * @param user 用户信息 * @return 结果 */ public int updateUser(SysUser user); /** * 修改用户头像 * * @param userName 用户名 * @param avatar 头像地址 * @return 结果 */ public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); /** * 重置用户密码 * * @param userName 用户名 * @param password 密码 * @return 结果 */ public int resetUserPwd(@Param("userName") String userName, @Param("password") String password); /** * 通过用户ID删除用户 * * @param userId 用户ID * @return 结果 */ public int deleteUserById(Long userId); /** * 批量删除用户信息 * * @param userIds 需要删除的用户ID * @return 结果 */ public int deleteUserByIds(Long[] userIds); /** * 校验用户名称是否唯一 * * @param userName 用户名称 * @return 结果 */ public SysUser checkUserNameUnique(String userName); /** * 校验手机号码是否唯一 * * @param phonenumber 手机号码 * @return 结果 */ public SysUser checkPhoneUnique(String phonenumber); /** * 校验email是否唯一 * * @param email 用户邮箱 * @return 结果 */ public SysUser checkEmailUnique(String email); List<SysUser> getList(@Param("pageInfo") PageInfo<SysUser> pageInfo, @Param("req") GetSysUserList getSysUserList); PageInfo<SysUser> getAllList(@Param("pageInfo") PageInfo<SysUser> pageInfo, @Param("ids") List<Integer> collect); List<Long> getSysUserFromPhone(@Param("phoneNumber") String phoneNumber); void deleteSysUser(@Param("userIds") ArrayList<Integer> userIds); /** * 获取用户选择列表 * @param pageInfo * @param query * @return */ List<SysUser> getChangeUserList(@Param("pageInfo")PageInfo<SysUser> pageInfo,@Param("query") ChangeUserQuery query); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java
@@ -1,16 +1,45 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysUserPost; import com.ruoyi.system.domain.SysUserPost; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 用户与岗位关联表 数据层 * * @author ruoyi */ public interface SysUserPostMapper extends BaseMapper<SysUserPost> { public interface SysUserPostMapper { /** * 通过用户ID删除用户和岗位关联 * * @param userId 用户ID * @return 结果 */ public int deleteUserPostByUserId(Long userId); /** * 通过岗位ID查询岗位使用数量 * * @param postId 岗位ID * @return 结果 */ public int countUserPostById(Long postId); /** * 批量删除用户和岗位关联 * * @param ids 需要删除的数据ID * @return 结果 */ public int deleteUserPost(Long[] ids); /** * 批量新增用户岗位信息 * * @param userPostList 用户角色列表 * @return 结果 */ public int batchUserPost(List<SysUserPost> userPostList); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
@@ -1,16 +1,114 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.model.SysUserRole; import com.ruoyi.system.domain.SysUserRole; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> * Mapper 接口 * </p> * * @author luodangjia * @since 2024-11-21 * 用户与角色关联表 数据层 * * @author ruoyi */ public interface SysUserRoleMapper extends BaseMapper<SysUserRole> { public interface SysUserRoleMapper extends BaseMapper<SysUserRole> { /** * 通过用户ID删除用户和角色关联 * * @param userId 用户ID * @return 结果 */ public int deleteUserRoleByUserId(Long userId); /** * 批量删除用户和角色关联 * * @param ids 需要删除的数据ID * @return 结果 */ public int deleteUserRole(Long[] ids); /** * 通过角色ID查询角色使用数量 * * @param roleId 角色ID * @return 结果 */ public int countUserRoleByRoleId(Long roleId); /** * 批量新增用户角色信息 * * @param userRoleList 用户角色列表 * @return 结果 */ public int batchUserRole(List<SysUserRole> userRoleList); /** * 删除用户和角色关联信息 * * @param userRole 用户和角色关联信息 * @return 结果 */ public int deleteUserRoleInfo(SysUserRole userRole); /** * 批量取消授权用户角色 * * @param roleId 角色ID * @param userIds 需要删除的用户数据ID * @return 结果 */ public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); /** * 查询用户和角色关联 * * @param userId 用户和角色关联主键 * @return 用户和角色关联 */ public SysUserRole selectSysUserRoleByUserId(Long userId); /** * 查询用户和角色关联列表 * * @param sysUserRole 用户和角色关联 * @return 用户和角色关联集合 */ public List<SysUserRole> selectSysUserRoleList(SysUserRole sysUserRole); /** * 新增用户和角色关联 * * @param sysUserRole 用户和角色关联 * @return 结果 */ public int insertSysUserRole(SysUserRole sysUserRole); /** * 修改用户和角色关联 * * @param sysUserRole 用户和角色关联 * @return 结果 */ public int updateSysUserRole(SysUserRole sysUserRole); /** * 删除用户和角色关联 * * @param userId 用户和角色关联主键 * @return 结果 */ public int deleteSysUserRoleByUserId(Long userId); /** * 批量删除用户和角色关联 * * @param userIds 需要删除的数据主键集合 * @return 结果 */ public int deleteSysUserRoleByUserIds(Long[] userIds); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/query/GetSysUserList.java
New file @@ -0,0 +1,25 @@ package com.ruoyi.system.query; import com.ruoyi.common.core.web.page.BasePage; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; /** * @author zhibing.pu * @Date 2024/8/10 14:10 */ @Data @ApiModel public class GetSysUserList extends BasePage { @ApiModelProperty(value = "人员搜索") private String search; @ApiModelProperty(value = "充电站id") private Integer siteId; @ApiModelProperty(value = "角色id") private List<Integer> roleIds; @ApiModelProperty(value = "账户状态(0=正常,1=禁用)") private Integer status; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/query/ShopUserStart.java
New file @@ -0,0 +1,18 @@ package com.ruoyi.system.query; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author zhibing.pu * @date 2024/8/21 20:24 */ @Data @ApiModel public class ShopUserStart { @ApiModelProperty("用户id") private Long userId; @ApiModelProperty("注释") private String remark; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/query/SysOperLogQuery.java
New file @@ -0,0 +1,30 @@ package com.ruoyi.system.query; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.web.page.BasePage; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; @Data @ApiModel() public class SysOperLogQuery extends BasePage { @ApiModelProperty(value = "操作人员") private String operName; @ApiModelProperty(value = "操作标题") private String title; @ApiModelProperty(value = "状态(0=正常,1=异常)") private Integer status; @ApiModelProperty(value = "操作开始时间", notes = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime startTime; @ApiModelProperty(value = "操作结束时间", notes = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime endTime; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/GenTableColumnService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/GenTableService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java
New file @@ -0,0 +1,83 @@ package com.ruoyi.system.service; import com.ruoyi.system.domain.SysConfig; import java.util.List; /** * 参数配置 服务层 * * @author ruoyi */ public interface ISysConfigService { /** * 查询参数配置信息 * * @param configId 参数配置ID * @return 参数配置信息 */ public SysConfig selectConfigById(Long configId); /** * 根据键名查询参数配置信息 * * @param configKey 参数键名 * @return 参数键值 */ public String selectConfigByKey(String configKey); /** * 查询参数配置列表 * * @param config 参数配置信息 * @return 参数配置集合 */ public List<SysConfig> selectConfigList(SysConfig config); /** * 新增参数配置 * * @param config 参数配置信息 * @return 结果 */ public int insertConfig(SysConfig config); /** * 修改参数配置 * * @param config 参数配置信息 * @return 结果 */ public int updateConfig(SysConfig config); /** * 批量删除参数信息 * * @param configIds 需要删除的参数ID */ public void deleteConfigByIds(Long[] configIds); /** * 加载参数缓存数据 */ public void loadingConfigCache(); /** * 清空参数缓存数据 */ public void clearConfigCache(); /** * 重置参数缓存数据 */ public void resetConfigCache(); /** * 校验参数键名是否唯一 * * @param config 参数信息 * @return 结果 */ public boolean checkConfigKeyUnique(SysConfig config); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
New file @@ -0,0 +1,125 @@ package com.ruoyi.system.service; import com.ruoyi.system.api.domain.SysDept; import com.ruoyi.system.domain.vo.TreeSelect; import java.util.List; /** * 部门管理 服务层 * * @author ruoyi */ public interface ISysDeptService { /** * 查询部门管理数据 * * @param dept 部门信息 * @return 部门信息集合 */ public List<SysDept> selectDeptList(SysDept dept); /** * 查询部门树结构信息 * * @param dept 部门信息 * @return 部门树信息集合 */ public List<TreeSelect> selectDeptTreeList(SysDept dept); /** * 构建前端所需要树结构 * * @param depts 部门列表 * @return 树结构列表 */ public List<SysDept> buildDeptTree(List<SysDept> depts); /** * 构建前端所需要下拉树结构 * * @param depts 部门列表 * @return 下拉树结构列表 */ public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts); /** * 根据角色ID查询部门树信息 * * @param roleId 角色ID * @return 选中部门列表 */ public List<Long> selectDeptListByRoleId(Long roleId); /** * 根据部门ID查询信息 * * @param deptId 部门ID * @return 部门信息 */ public SysDept selectDeptById(Long deptId); /** * 根据ID查询所有子部门(正常状态) * * @param deptId 部门ID * @return 子部门数 */ public int selectNormalChildrenDeptById(Long deptId); /** * 是否存在部门子节点 * * @param deptId 部门ID * @return 结果 */ public boolean hasChildByDeptId(Long deptId); /** * 查询部门是否存在用户 * * @param deptId 部门ID * @return 结果 true 存在 false 不存在 */ public boolean checkDeptExistUser(Long deptId); /** * 校验部门名称是否唯一 * * @param dept 部门信息 * @return 结果 */ public boolean checkDeptNameUnique(SysDept dept); /** * 校验部门是否有数据权限 * * @param deptId 部门id */ public void checkDeptDataScope(Long deptId); /** * 新增保存部门信息 * * @param dept 部门信息 * @return 结果 */ public int insertDept(SysDept dept); /** * 修改保存部门信息 * * @param dept 部门信息 * @return 结果 */ public int updateDept(SysDept dept); /** * 删除部门管理信息 * * @param deptId 部门ID * @return 结果 */ public int deleteDeptById(Long deptId); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java
New file @@ -0,0 +1,61 @@ package com.ruoyi.system.service; import com.ruoyi.system.api.domain.SysDictData; import java.util.List; /** * 字典 业务层 * * @author ruoyi */ public interface ISysDictDataService { /** * 根据条件分页查询字典数据 * * @param dictData 字典数据信息 * @return 字典数据集合信息 */ public List<SysDictData> selectDictDataList(SysDictData dictData); /** * 根据字典类型和字典键值查询字典数据信息 * * @param dictType 字典类型 * @param dictValue 字典键值 * @return 字典标签 */ public String selectDictLabel(String dictType, String dictValue); /** * 根据字典数据ID查询信息 * * @param dictCode 字典数据ID * @return 字典数据 */ public SysDictData selectDictDataById(Long dictCode); /** * 批量删除字典数据信息 * * @param dictCodes 需要删除的字典数据ID */ public void deleteDictDataByIds(Long[] dictCodes); /** * 新增保存字典数据信息 * * @param dictData 字典数据信息 * @return 结果 */ public int insertDictData(SysDictData dictData); /** * 修改保存字典数据信息 * * @param dictData 字典数据信息 * @return 结果 */ public int updateDictData(SysDictData dictData); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java
New file @@ -0,0 +1,99 @@ package com.ruoyi.system.service; import com.ruoyi.system.api.domain.SysDictData; import com.ruoyi.system.api.domain.SysDictType; import java.util.List; /** * 字典 业务层 * * @author ruoyi */ public interface ISysDictTypeService { /** * 根据条件分页查询字典类型 * * @param dictType 字典类型信息 * @return 字典类型集合信息 */ public List<SysDictType> selectDictTypeList(SysDictType dictType); /** * 根据所有字典类型 * * @return 字典类型集合信息 */ public List<SysDictType> selectDictTypeAll(); /** * 根据字典类型查询字典数据 * * @param dictType 字典类型 * @return 字典数据集合信息 */ public List<SysDictData> selectDictDataByType(String dictType); /** * 根据字典类型ID查询信息 * * @param dictId 字典类型ID * @return 字典类型 */ public SysDictType selectDictTypeById(Long dictId); /** * 根据字典类型查询信息 * * @param dictType 字典类型 * @return 字典类型 */ public SysDictType selectDictTypeByType(String dictType); /** * 批量删除字典信息 * * @param dictIds 需要删除的字典ID */ public void deleteDictTypeByIds(Long[] dictIds); /** * 加载字典缓存数据 */ public void loadingDictCache(); /** * 清空字典缓存数据 */ public void clearDictCache(); /** * 重置字典缓存数据 */ public void resetDictCache(); /** * 新增保存字典类型信息 * * @param dictType 字典类型信息 * @return 结果 */ public int insertDictType(SysDictType dictType); /** * 修改保存字典类型信息 * * @param dictType 字典类型信息 * @return 结果 */ public int updateDictType(SysDictType dictType); /** * 校验字典类型称是否唯一 * * @param dictType 字典类型 * @return 结果 */ public boolean checkDictTypeUnique(SysDictType dictType); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLoginLogService.java
New file @@ -0,0 +1,31 @@ package com.ruoyi.system.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.BasePage; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.system.api.domain.SysLoginLog; /** * @author zhibing.pu * @Date 2024/8/12 15:47 */ public interface ISysLoginLogService extends IService<SysLoginLog> { /** * 获取列表数据 * @param name * @param basePage * @return */ PageInfo<SysLoginLog> pageList(String name, BasePage basePage); /** * 添加登录日志 * @param loginLog * @return */ AjaxResult addLoginLog(SysLoginLog loginLog); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java
New file @@ -0,0 +1,153 @@ package com.ruoyi.system.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.system.domain.SysMenu; import com.ruoyi.system.domain.SysMenus; import com.ruoyi.system.domain.vo.RouterVo; import com.ruoyi.system.domain.vo.TreeSelect; import java.util.List; import java.util.Set; /** * 菜单 业务层 * * @author ruoyi */ public interface ISysMenuService extends IService<SysMenu> { /** * 根据用户查询系统菜单列表 * * @param userId 用户ID * @return 菜单列表 */ public List<SysMenu> selectMenuList(Long userId); /** * 根据用户查询系统菜单列表 * * @param menu 菜单信息 * @param userId 用户ID * @return 菜单列表 */ public List<SysMenu> selectMenuList(SysMenu menu, Long userId); /** * 根据用户ID查询权限 * * @param userId 用户ID * @return 权限列表 */ public Set<String> selectMenuPermsByUserId(Long userId); /** * 根据角色ID查询权限 * * @param roleId 角色ID * @return 权限列表 */ public Set<String> selectMenuPermsByRoleId(Long roleId); /** * 根据用户ID查询菜单树信息 * * @param userId 用户ID * @return 菜单列表 */ public List<SysMenu> selectMenuTreeByUserId(Long userId); /** * 根据角色ID查询菜单树信息 * * @param roleId 角色ID * @return 选中菜单列表 */ public List<Long> selectMenuListByRoleId(Long roleId); /** * 构建前端路由所需要的菜单 * * @param menus 菜单列表 * @return 路由列表 */ public List<RouterVo> buildMenus(List<SysMenu> menus); /** * 构建前端所需要树结构 * * @param menus 菜单列表 * @return 树结构列表 */ public List<SysMenu> buildMenuTree(List<SysMenu> menus); /** * 构建前端所需要下拉树结构 * * @param menus 菜单列表 * @return 下拉树结构列表 */ public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus); /** * 根据菜单ID查询信息 * * @param menuId 菜单ID * @return 菜单信息 */ public SysMenu selectMenuById(Long menuId); /** * 是否存在菜单子节点 * * @param menuId 菜单ID * @return 结果 true 存在 false 不存在 */ public boolean hasChildByMenuId(Long menuId); /** * 查询菜单是否存在角色 * * @param menuId 菜单ID * @return 结果 true 存在 false 不存在 */ public boolean checkMenuExistRole(Long menuId); /** * 新增保存菜单信息 * * @param menu 菜单信息 * @return 结果 */ public int insertMenu(SysMenu menu); /** * 修改保存菜单信息 * * @param menu 菜单信息 * @return 结果 */ public int updateMenu(SysMenu menu); /** * 删除菜单管理信息 * * @param menuId 菜单ID * @return 结果 */ public int deleteMenuById(Long menuId); /** * 校验菜单名称是否唯一 * * @param menu 菜单信息 * @return 结果 */ public boolean checkMenuNameUnique(SysMenu menu); List<SysMenus> getAllMenu(); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java
New file @@ -0,0 +1,60 @@ package com.ruoyi.system.service; import com.ruoyi.system.domain.SysNotice; import java.util.List; /** * 公告 服务层 * * @author ruoyi */ public interface ISysNoticeService { /** * 查询公告信息 * * @param noticeId 公告ID * @return 公告信息 */ public SysNotice selectNoticeById(Long noticeId); /** * 查询公告列表 * * @param notice 公告信息 * @return 公告集合 */ public List<SysNotice> selectNoticeList(SysNotice notice); /** * 新增公告 * * @param notice 公告信息 * @return 结果 */ public int insertNotice(SysNotice notice); /** * 修改公告 * * @param notice 公告信息 * @return 结果 */ public int updateNotice(SysNotice notice); /** * 删除公告信息 * * @param noticeId 公告ID * @return 结果 */ public int deleteNoticeById(Long noticeId); /** * 批量删除公告信息 * * @param noticeIds 需要删除的公告ID * @return 结果 */ public int deleteNoticeByIds(Long[] noticeIds); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java
New file @@ -0,0 +1,50 @@ package com.ruoyi.system.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.system.api.domain.SysOperLog; import java.util.List; /** * 操作日志 服务层 * * @author ruoyi */ public interface ISysOperLogService extends IService<SysOperLog> { /** * 新增操作日志 * * @param operLog 操作日志对象 * @return 结果 */ public int insertOperlog(SysOperLog operLog); /** * 查询系统操作日志集合 * * @param operLog 操作日志对象 * @return 操作日志集合 */ public List<SysOperLog> selectOperLogList(SysOperLog operLog); /** * 批量删除系统操作日志 * * @param operIds 需要删除的操作日志ID * @return 结果 */ public int deleteOperLogByIds(Long[] operIds); /** * 查询操作日志详细 * * @param operId 操作ID * @return 操作日志对象 */ public SysOperLog selectOperLogById(Long operId); /** * 清空操作日志 */ public void cleanOperLog(); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPermissionService.java
New file @@ -0,0 +1,29 @@ package com.ruoyi.system.service; import com.ruoyi.system.api.domain.SysUser; import java.util.Set; /** * 权限信息 服务层 * * @author ruoyi */ public interface ISysPermissionService { /** * 获取角色数据权限 * * @param userId 用户Id * @return 角色权限信息 */ public Set<String> getRolePermission(SysUser user); /** * 获取菜单数据权限 * * @param userId 用户Id * @return 菜单权限信息 */ public Set<String> getMenuPermission(SysUser user); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java
New file @@ -0,0 +1,100 @@ package com.ruoyi.system.service; import com.ruoyi.system.domain.SysPost; import java.util.List; /** * 岗位信息 服务层 * * @author ruoyi */ public interface ISysPostService { /** * 查询岗位信息集合 * * @param post 岗位信息 * @return 岗位列表 */ public List<SysPost> selectPostList(SysPost post); /** * 查询所有岗位 * * @return 岗位列表 */ public List<SysPost> selectPostAll(); /** * 通过岗位ID查询岗位信息 * * @param postId 岗位ID * @return 角色对象信息 */ public SysPost selectPostById(Long postId); /** * 根据用户ID获取岗位选择框列表 * * @param userId 用户ID * @return 选中岗位ID列表 */ public List<Long> selectPostListByUserId(Long userId); /** * 校验岗位名称 * * @param post 岗位信息 * @return 结果 */ public boolean checkPostNameUnique(SysPost post); /** * 校验岗位编码 * * @param post 岗位信息 * @return 结果 */ public boolean checkPostCodeUnique(SysPost post); /** * 通过岗位ID查询岗位使用数量 * * @param postId 岗位ID * @return 结果 */ public int countUserPostById(Long postId); /** * 删除岗位信息 * * @param postId 岗位ID * @return 结果 */ public int deletePostById(Long postId); /** * 批量删除岗位信息 * * @param postIds 需要删除的岗位ID * @return 结果 */ public int deletePostByIds(Long[] postIds); /** * 新增保存岗位信息 * * @param post 岗位信息 * @return 结果 */ public int insertPost(SysPost post); /** * 修改保存岗位信息 * * @param post 岗位信息 * @return 结果 */ public int updatePost(SysPost post); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
New file @@ -0,0 +1,185 @@ package com.ruoyi.system.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.domain.SysUserRole; import java.util.List; import java.util.Set; /** * 角色业务层 * * @author ruoyi */ public interface ISysRoleService extends IService<SysRole> { /** * 根据条件分页查询角色数据 * * @param role 角色信息 * @return 角色数据集合信息 */ public List<SysRole> selectRoleList(SysRole role); /** * 根据用户ID查询角色列表 * * @param userId 用户ID * @return 角色列表 */ public List<SysRole> selectRolesByUserId(Long userId); /** * 根据用户ID查询角色权限 * * @param userId 用户ID * @return 权限列表 */ public Set<String> selectRolePermissionByUserId(Long userId); /** * 查询所有角色 * * @return 角色列表 */ public List<SysRole> selectRoleAll(); /** * 根据用户ID获取角色选择框列表 * * @param userId 用户ID * @return 选中角色ID列表 */ public List<Long> selectRoleListByUserId(Long userId); /** * 通过角色ID查询角色 * * @param roleId 角色ID * @return 角色对象信息 */ public SysRole selectRoleById(Long roleId); /** * 校验角色名称是否唯一 * * @param role 角色信息 * @return 结果 */ public boolean checkRoleNameUnique(SysRole role); /** * 校验角色权限是否唯一 * * @param role 角色信息 * @return 结果 */ public boolean checkRoleKeyUnique(SysRole role); /** * 校验角色是否允许操作 * * @param role 角色信息 */ public void checkRoleAllowed(SysRole role); /** * 校验角色是否有数据权限 * * @param roleId 角色id */ public void checkRoleDataScope(Long roleId); /** * 通过角色ID查询角色使用数量 * * @param roleId 角色ID * @return 结果 */ public int countUserRoleByRoleId(Long roleId); /** * 新增保存角色信息 * * @param role 角色信息 * @return 结果 */ public int insertRole(SysRole role); /** * 修改保存角色信息 * * @param role 角色信息 * @return 结果 */ public int updateRole(SysRole role); /** * 修改角色状态 * * @param role 角色信息 * @return 结果 */ public int updateRoleStatus(SysRole role); /** * 修改数据权限信息 * * @param role 角色信息 * @return 结果 */ public int authDataScope(SysRole role); /** * 通过角色ID删除角色 * * @param roleId 角色ID * @return 结果 */ public int deleteRoleById(Long roleId); /** * 批量删除角色信息 * * @param roleIds 需要删除的角色ID * @return 结果 */ public int deleteRoleByIds(Long[] roleIds); /** * 取消授权用户角色 * * @param userRole 用户和角色关联信息 * @return 结果 */ public int deleteAuthUser(SysUserRole userRole); /** * 批量取消授权用户角色 * * @param roleId 角色ID * @param userIds 需要取消授权的用户数据ID * @return 结果 */ public int deleteAuthUsers(Long roleId, Long[] userIds); /** * 批量选择授权用户角色 * * @param roleId 角色ID * @param userIds 需要删除的用户数据ID * @return 结果 */ public int insertAuthUsers(Long roleId, Long[] userIds); List<SysRole> isExitUpdate(String roleName, Long roleId,Integer companyId); /** * 根据id获取数据 * @param ids 数据id集合 * @return */ List<SysRole> getSysRoleByIds(List<Integer> ids); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java
New file @@ -0,0 +1,48 @@ package com.ruoyi.system.service; import com.ruoyi.system.api.model.LoginUser; import com.ruoyi.system.domain.SysUserOnline; /** * 在线用户 服务层 * * @author ruoyi */ public interface ISysUserOnlineService { /** * 通过登录地址查询信息 * * @param ipaddr 登录地址 * @param user 用户信息 * @return 在线用户信息 */ public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user); /** * 通过用户名称查询信息 * * @param userName 用户名称 * @param user 用户信息 * @return 在线用户信息 */ public SysUserOnline selectOnlineByUserName(String userName, LoginUser user); /** * 通过登录地址/用户名称查询信息 * * @param ipaddr 登录地址 * @param userName 用户名称 * @param user 用户信息 * @return 在线用户信息 */ public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user); /** * 设置在线用户信息 * * @param user 用户信息 * @return 在线用户 */ public SysUserOnline loginUserToUserOnline(LoginUser user); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserRoleService.java
New file @@ -0,0 +1,64 @@ package com.ruoyi.system.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.system.domain.SysUserRole; import java.util.List; /** * 用户和角色关联Service接口 * * @author xiaochen * @date 2023-06-12 */ public interface ISysUserRoleService extends IService<SysUserRole> { /** * 查询用户和角色关联 * * @param userId 用户和角色关联主键 * @return 用户和角色关联 */ public SysUserRole selectSysUserRoleByUserId(Long userId); /** * 查询用户和角色关联列表 * * @param sysUserRole 用户和角色关联 * @return 用户和角色关联集合 */ public List<SysUserRole> selectSysUserRoleList(SysUserRole sysUserRole); /** * 新增用户和角色关联 * * @param sysUserRole 用户和角色关联 * @return 结果 */ public int insertSysUserRole(SysUserRole sysUserRole); /** * 修改用户和角色关联 * * @param sysUserRole 用户和角色关联 * @return 结果 */ public int updateSysUserRole(SysUserRole sysUserRole); /** * 批量删除用户和角色关联 * * @param userIds 需要删除的用户和角色关联主键集合 * @return 结果 */ public int deleteSysUserRoleByUserIds(Long[] userIds); /** * 删除用户和角色关联信息 * * @param userId 用户和角色关联主键 * @return 结果 */ public int deleteSysUserRoleByUserId(Long userId); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
New file @@ -0,0 +1,228 @@ package com.ruoyi.system.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.query.ChangeUserQuery; import com.ruoyi.system.query.GetSysUserList; import java.util.ArrayList; import java.util.List; /** * 用户 业务层 * * @author ruoyi */ public interface ISysUserService extends IService<SysUser> { /** * 根据条件分页查询用户列表 * * @param user 用户信息 * @return 用户信息集合信息 */ public List<SysUser> selectUserList(SysUser user); /** * 根据条件分页查询已分配用户角色列表 * * @param user 用户信息 * @return 用户信息集合信息 */ public List<SysUser> selectAllocatedList(SysUser user); /** * 根据条件分页查询未分配用户角色列表 * * @param user 用户信息 * @return 用户信息集合信息 */ public List<SysUser> selectUnallocatedList(SysUser user); /** * 通过用户名查询用户 * * @param userName 用户名 * @return 用户对象信息 */ public SysUser selectUserByUserName(String userName); /** * 通过用户ID查询用户 * * @param userId 用户ID * @return 用户对象信息 */ public SysUser selectUserById(Long userId); /** * 根据用户ID查询用户所属角色组 * * @param userName 用户名 * @return 结果 */ public String selectUserRoleGroup(String userName); /** * 根据用户ID查询用户所属岗位组 * * @param userName 用户名 * @return 结果 */ public String selectUserPostGroup(String userName); /** * 校验用户名称是否唯一 * * @param user 用户信息 * @return 结果 */ public boolean checkUserNameUnique(SysUser user); /** * 校验手机号码是否唯一 * * @param user 用户信息 * @return 结果 */ public boolean checkPhoneUnique(SysUser user); /** * 校验email是否唯一 * * @param user 用户信息 * @return 结果 */ public boolean checkEmailUnique(SysUser user); /** * 校验用户是否允许操作 * * @param user 用户信息 */ public void checkUserAllowed(SysUser user); /** * 校验用户是否有数据权限 * * @param userId 用户id */ public void checkUserDataScope(Long userId); /** * 新增用户信息 * * @param user 用户信息 * @return 结果 */ public int insertUser(SysUser user); /** * 注册用户信息 * * @param user 用户信息 * @return 结果 */ public boolean registerUser(SysUser user); /** * 修改用户信息 * * @param user 用户信息 * @return 结果 */ public int updateUser(SysUser user); /** * 用户授权角色 * * @param userId 用户ID * @param roleIds 角色组 */ public void insertUserAuth(Long userId, Long[] roleIds); /** * 修改用户状态 * * @param user 用户信息 * @return 结果 */ public int updateUserStatus(SysUser user); /** * 修改用户基本信息 * * @param user 用户信息 * @return 结果 */ public int updateUserProfile(SysUser user); /** * 修改用户头像 * * @param userName 用户名 * @param avatar 头像地址 * @return 结果 */ public boolean updateUserAvatar(String userName, String avatar); /** * 重置用户密码 * * @param user 用户信息 * @return 结果 */ public int resetPwd(SysUser user); /** * 重置用户密码 * * @param userName 用户名 * @param password 密码 * @return 结果 */ public int resetUserPwd(String userName, String password); /** * 通过用户ID删除用户 * * @param userId 用户ID * @return 结果 */ public int deleteUserById(Long userId); /** * 批量删除用户信息 * * @param userIds 需要删除的用户ID * @return 结果 */ public int deleteUserByIds(Long[] userIds); /** * 导入用户数据 * * @param userList 用户数据列表 * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 * @param operName 操作用户 * @return 结果 */ public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName); PageInfo<SysUser> getList(PageInfo<SysUser> pageInfo, GetSysUserList getSysUserList); PageInfo<SysUser> getAllList(PageInfo<SysUser> pageInfo, List<Integer> collect); List<Long> getSysUserFromPhone(String phoneNumber); void deleteSysUser(ArrayList<Integer> userIds); /** * 获取用户选择列表 * @param query * @return */ PageInfo<SysUser> getChangeUserList(ChangeUserQuery query); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysConfigService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysDeptService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysDictDataService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysDictTypeService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysJobLogService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysJobService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginLogService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysMenuService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysNoticeService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysOperLogService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPostService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRoleDeptService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRoleMenuService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRoleService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysUserPostService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysUserRoleService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/SysUserService.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/GenTableColumnServiceImpl.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/GenTableServiceImpl.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java
@@ -1,20 +1,193 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysConfigMapper; import com.ruoyi.system.api.model.SysConfig; import com.ruoyi.account.service.SysConfigService; import com.ruoyi.common.core.constant.CacheConstants; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.redis.service.RedisService; import com.ruoyi.system.domain.SysConfig; import com.ruoyi.system.mapper.SysConfigMapper; import com.ruoyi.system.service.ISysConfigService; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import javax.annotation.Resource; import java.util.Collection; import java.util.List; /** * <p> * 服务实现类 * </p> * 参数配置 服务层实现 * * @author luodangjia * @since 2024-11-21 * @author ruoyi */ @Service public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements SysConfigService { public class SysConfigServiceImpl implements ISysConfigService { @Resource private SysConfigMapper configMapper; @Resource private RedisService redisService; /** * 项目启动时,初始化参数到缓存 */ @PostConstruct public void init() { // TODO // loadingConfigCache(); } /** * 查询参数配置信息 * * @param configId 参数配置ID * @return 参数配置信息 */ @Override public SysConfig selectConfigById(Long configId) { SysConfig config = new SysConfig(); config.setConfigId(configId); return configMapper.selectConfig(config); } /** * 根据键名查询参数配置信息 * * @param configKey 参数key * @return 参数键值 */ @Override public String selectConfigByKey(String configKey) { String configValue = Convert.toStr(redisService.getCacheObject(getCacheKey(configKey))); if (StringUtils.isNotEmpty(configValue)) { return configValue; } SysConfig config = new SysConfig(); config.setConfigKey(configKey); SysConfig retConfig = configMapper.selectConfig(config); if (StringUtils.isNotNull(retConfig)) { redisService.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); return retConfig.getConfigValue(); } return StringUtils.EMPTY; } /** * 查询参数配置列表 * * @param config 参数配置信息 * @return 参数配置集合 */ @Override public List<SysConfig> selectConfigList(SysConfig config) { return configMapper.selectConfigList(config); } /** * 新增参数配置 * * @param config 参数配置信息 * @return 结果 */ @Override public int insertConfig(SysConfig config) { int row = configMapper.insertConfig(config); if (row > 0) { redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); } return row; } /** * 修改参数配置 * * @param config 参数配置信息 * @return 结果 */ @Override public int updateConfig(SysConfig config) { SysConfig temp = configMapper.selectConfigById(config.getConfigId()); if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) { redisService.deleteObject(getCacheKey(temp.getConfigKey())); } int row = configMapper.updateConfig(config); if (row > 0) { redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); } return row; } /** * 批量删除参数信息 * * @param configIds 需要删除的参数ID */ @Override public void deleteConfigByIds(Long[] configIds) { for (Long configId : configIds) { SysConfig config = selectConfigById(configId); if (StringUtils.equals(UserConstants.YES, config.getConfigType())) { throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); } configMapper.deleteConfigById(configId); redisService.deleteObject(getCacheKey(config.getConfigKey())); } } /** * 加载参数缓存数据 */ @Override public void loadingConfigCache() { List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig()); for (SysConfig config : configsList) { redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); } } /** * 清空参数缓存数据 */ @Override public void clearConfigCache() { Collection<String> keys = redisService.keys(CacheConstants.SYS_CONFIG_KEY + "*"); redisService.deleteObject(keys); } /** * 重置参数缓存数据 */ @Override public void resetConfigCache() { clearConfigCache(); loadingConfigCache(); } /** * 校验参数键名是否唯一 * * @param config 参数配置信息 * @return 结果 */ @Override public boolean checkConfigKeyUnique(SysConfig config) { Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } /** * 设置cache key * * @param configKey 参数键 * @return 缓存键key */ private String getCacheKey(String configKey) { return CacheConstants.SYS_CONFIG_KEY + configKey; } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
@@ -1,20 +1,339 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysDeptMapper; import com.ruoyi.system.api.model.SysDept; import com.ruoyi.account.service.SysDeptService; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.utils.SpringUtils; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.datascope.annotation.DataScope; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.domain.SysDept; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.domain.vo.TreeSelect; import com.ruoyi.system.mapper.SysDeptMapper; import com.ruoyi.system.mapper.SysRoleMapper; import com.ruoyi.system.service.ISysDeptService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; /** * <p> * 服务实现类 * </p> * * @author luodangjia * @since 2024-11-21 * 部门管理 服务实现 * * @author ruoyi */ @Service public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements SysDeptService { public class SysDeptServiceImpl implements ISysDeptService { @Autowired private SysDeptMapper deptMapper; @Autowired private SysRoleMapper roleMapper; /** * 查询部门管理数据 * * @param dept 部门信息 * @return 部门信息集合 */ @Override @DataScope(deptAlias = "d") public List<SysDept> selectDeptList(SysDept dept) { return deptMapper.selectDeptList(dept); } /** * 查询部门树结构信息 * * @param dept 部门信息 * @return 部门树信息集合 */ @Override public List<TreeSelect> selectDeptTreeList(SysDept dept) { List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept); return buildDeptTreeSelect(depts); } /** * 构建前端所需要树结构 * * @param depts 部门列表 * @return 树结构列表 */ @Override public List<SysDept> buildDeptTree(List<SysDept> depts) { List<SysDept> returnList = new ArrayList<SysDept>(); List<Long> tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList()); for (SysDept dept : depts) { // 如果是顶级节点, 遍历该父节点的所有子节点 if (!tempList.contains(dept.getParentId())) { recursionFn(depts, dept); returnList.add(dept); } } if (returnList.isEmpty()) { returnList = depts; } return returnList; } /** * 构建前端所需要下拉树结构 * * @param depts 部门列表 * @return 下拉树结构列表 */ @Override public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts) { List<SysDept> deptTrees = buildDeptTree(depts); return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); } /** * 根据角色ID查询部门树信息 * * @param roleId 角色ID * @return 选中部门列表 */ @Override public List<Long> selectDeptListByRoleId(Long roleId) { SysRole role = roleMapper.selectRoleById(roleId); return deptMapper.selectDeptListByRoleId(roleId, false); } /** * 根据部门ID查询信息 * * @param deptId 部门ID * @return 部门信息 */ @Override public SysDept selectDeptById(Long deptId) { return deptMapper.selectDeptById(deptId); } /** * 根据ID查询所有子部门(正常状态) * * @param deptId 部门ID * @return 子部门数 */ @Override public int selectNormalChildrenDeptById(Long deptId) { return deptMapper.selectNormalChildrenDeptById(deptId); } /** * 是否存在子节点 * * @param deptId 部门ID * @return 结果 */ @Override public boolean hasChildByDeptId(Long deptId) { int result = deptMapper.hasChildByDeptId(deptId); return result > 0; } /** * 查询部门是否存在用户 * * @param deptId 部门ID * @return 结果 true 存在 false 不存在 */ @Override public boolean checkDeptExistUser(Long deptId) { int result = deptMapper.checkDeptExistUser(deptId); return result > 0; } /** * 校验部门名称是否唯一 * * @param dept 部门信息 * @return 结果 */ @Override public boolean checkDeptNameUnique(SysDept dept) { Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } /** * 校验部门是否有数据权限 * * @param deptId 部门id */ @Override public void checkDeptDataScope(Long deptId) { if (!SysUser.isAdmin(SecurityUtils.getUserId())) { SysDept dept = new SysDept(); dept.setDeptId(deptId); List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept); if (StringUtils.isEmpty(depts)) { throw new ServiceException("没有权限访问部门数据!"); } } } /** * 新增保存部门信息 * * @param dept 部门信息 * @return 结果 */ @Override public int insertDept(SysDept dept) { SysDept info = deptMapper.selectDeptById(dept.getParentId()); // 如果父节点不为正常状态,则不允许新增子节点 if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) { throw new ServiceException("部门停用,不允许新增"); } dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); return deptMapper.insertDept(dept); } /** * 修改保存部门信息 * * @param dept 部门信息 * @return 结果 */ @Override public int updateDept(SysDept dept) { SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId()); SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId()); if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) { String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId(); String oldAncestors = oldDept.getAncestors(); dept.setAncestors(newAncestors); updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); } int result = deptMapper.updateDept(dept); if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) && !StringUtils.equals("0", dept.getAncestors())) { // 如果该部门是启用状态,则启用该部门的所有上级部门 updateParentDeptStatusNormal(dept); } return result; } /** * 修改该部门的父级部门状态 * * @param dept 当前部门 */ private void updateParentDeptStatusNormal(SysDept dept) { String ancestors = dept.getAncestors(); Long[] deptIds = Convert.toLongArray(ancestors); deptMapper.updateDeptStatusNormal(deptIds); } /** * 修改子元素关系 * * @param deptId 被修改的部门ID * @param newAncestors 新的父ID集合 * @param oldAncestors 旧的父ID集合 */ public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) { List<SysDept> children = deptMapper.selectChildrenDeptById(deptId); for (SysDept child : children) { child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); } if (children.size() > 0) { deptMapper.updateDeptChildren(children); } } /** * 删除部门管理信息 * * @param deptId 部门ID * @return 结果 */ @Override public int deleteDeptById(Long deptId) { return deptMapper.deleteDeptById(deptId); } /** * 递归列表 */ private void recursionFn(List<SysDept> list, SysDept t) { // 得到子节点列表 List<SysDept> childList = getChildList(list, t); t.setChildren(childList); for (SysDept tChild : childList) { if (hasChild(list, tChild)) { recursionFn(list, tChild); } } } /** * 得到子节点列表 */ private List<SysDept> getChildList(List<SysDept> list, SysDept t) { List<SysDept> tlist = new ArrayList<SysDept>(); Iterator<SysDept> it = list.iterator(); while (it.hasNext()) { SysDept n = (SysDept) it.next(); if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) { tlist.add(n); } } return tlist; } /** * 判断是否有子节点 */ private boolean hasChild(List<SysDept> list, SysDept t) { return getChildList(list, t).size() > 0 ? true : false; } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
@@ -1,20 +1,112 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysDictDataMapper; import com.ruoyi.system.api.model.SysDictData; import com.ruoyi.account.service.SysDictDataService; import com.ruoyi.common.security.utils.DictUtils; import com.ruoyi.system.api.domain.SysDictData; import com.ruoyi.system.mapper.SysDictDataMapper; import com.ruoyi.system.service.ISysDictDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * <p> * 服务实现类 * </p> * * @author luodangjia * @since 2024-11-21 * 字典 业务层处理 * * @author ruoyi */ @Service public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements SysDictDataService { public class SysDictDataServiceImpl implements ISysDictDataService { @Autowired private SysDictDataMapper dictDataMapper; /** * 根据条件分页查询字典数据 * * @param dictData 字典数据信息 * @return 字典数据集合信息 */ @Override public List<SysDictData> selectDictDataList(SysDictData dictData) { return dictDataMapper.selectDictDataList(dictData); } /** * 根据字典类型和字典键值查询字典数据信息 * * @param dictType 字典类型 * @param dictValue 字典键值 * @return 字典标签 */ @Override public String selectDictLabel(String dictType, String dictValue) { return dictDataMapper.selectDictLabel(dictType, dictValue); } /** * 根据字典数据ID查询信息 * * @param dictCode 字典数据ID * @return 字典数据 */ @Override public SysDictData selectDictDataById(Long dictCode) { return dictDataMapper.selectDictDataById(dictCode); } /** * 批量删除字典数据信息 * * @param dictCodes 需要删除的字典数据ID */ @Override public void deleteDictDataByIds(Long[] dictCodes) { for (Long dictCode : dictCodes) { SysDictData data = selectDictDataById(dictCode); dictDataMapper.deleteDictDataById(dictCode); List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); DictUtils.setDictCache(data.getDictType(), dictDatas); } } /** * 新增保存字典数据信息 * * @param data 字典数据信息 * @return 结果 */ @Override public int insertDictData(SysDictData data) { int row = dictDataMapper.insertDictData(data); if (row > 0) { List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); DictUtils.setDictCache(data.getDictType(), dictDatas); } return row; } /** * 修改保存字典数据信息 * * @param data 字典数据信息 * @return 结果 */ @Override public int updateDictData(SysDictData data) { int row = dictDataMapper.updateDictData(data); if (row > 0) { List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); DictUtils.setDictCache(data.getDictType(), dictDatas); } return row; } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
@@ -1,20 +1,225 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysDictTypeMapper; import com.ruoyi.system.api.model.SysDictType; import com.ruoyi.account.service.SysDictTypeService; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.security.utils.DictUtils; import com.ruoyi.system.api.domain.SysDictData; import com.ruoyi.system.api.domain.SysDictType; import com.ruoyi.system.mapper.SysDictDataMapper; import com.ruoyi.system.mapper.SysDictTypeMapper; import com.ruoyi.system.service.ISysDictTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * <p> * 服务实现类 * </p> * * @author luodangjia * @since 2024-11-21 * 字典 业务层处理 * * @author ruoyi */ @Service public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements SysDictTypeService { public class SysDictTypeServiceImpl implements ISysDictTypeService { @Autowired private SysDictTypeMapper dictTypeMapper; @Autowired private SysDictDataMapper dictDataMapper; /** * 项目启动时,初始化字典到缓存 */ @PostConstruct public void init() { // TODO // loadingDictCache(); } /** * 根据条件分页查询字典类型 * * @param dictType 字典类型信息 * @return 字典类型集合信息 */ @Override public List<SysDictType> selectDictTypeList(SysDictType dictType) { return dictTypeMapper.selectDictTypeList(dictType); } /** * 根据所有字典类型 * * @return 字典类型集合信息 */ @Override public List<SysDictType> selectDictTypeAll() { return dictTypeMapper.selectDictTypeAll(); } /** * 根据字典类型查询字典数据 * * @param dictType 字典类型 * @return 字典数据集合信息 */ @Override public List<SysDictData> selectDictDataByType(String dictType) { List<SysDictData> dictDatas = DictUtils.getDictCache(dictType); if (StringUtils.isNotEmpty(dictDatas)) { return dictDatas; } dictDatas = dictDataMapper.selectDictDataByType(dictType); if (StringUtils.isNotEmpty(dictDatas)) { DictUtils.setDictCache(dictType, dictDatas); return dictDatas; } return null; } /** * 根据字典类型ID查询信息 * * @param dictId 字典类型ID * @return 字典类型 */ @Override public SysDictType selectDictTypeById(Long dictId) { return dictTypeMapper.selectDictTypeById(dictId); } /** * 根据字典类型查询信息 * * @param dictType 字典类型 * @return 字典类型 */ @Override public SysDictType selectDictTypeByType(String dictType) { return dictTypeMapper.selectDictTypeByType(dictType); } /** * 批量删除字典类型信息 * * @param dictIds 需要删除的字典ID */ @Override public void deleteDictTypeByIds(Long[] dictIds) { for (Long dictId : dictIds) { SysDictType dictType = selectDictTypeById(dictId); if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) { throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); } dictTypeMapper.deleteDictTypeById(dictId); DictUtils.removeDictCache(dictType.getDictType()); } } /** * 加载字典缓存数据 */ @Override public void loadingDictCache() { SysDictData dictData = new SysDictData(); dictData.setStatus("0"); Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType)); for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet()) { DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList())); } } /** * 清空字典缓存数据 */ @Override public void clearDictCache() { DictUtils.clearDictCache(); } /** * 重置字典缓存数据 */ @Override public void resetDictCache() { clearDictCache(); loadingDictCache(); } /** * 新增保存字典类型信息 * * @param dict 字典类型信息 * @return 结果 */ @Override public int insertDictType(SysDictType dict) { int row = dictTypeMapper.insertDictType(dict); if (row > 0) { DictUtils.setDictCache(dict.getDictType(), null); } return row; } /** * 修改保存字典类型信息 * * @param dict 字典类型信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int updateDictType(SysDictType dict) { SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId()); dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType()); int row = dictTypeMapper.updateDictType(dict); if (row > 0) { List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType()); DictUtils.setDictCache(dict.getDictType(), dictDatas); } return row; } /** * 校验字典类型称是否唯一 * * @param dict 字典类型 * @return 结果 */ @Override public boolean checkDictTypeUnique(SysDictType dict) { Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysJobLogServiceImpl.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysJobServiceImpl.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLoginLogServiceImpl.java
@@ -1,20 +1,65 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysLoginLogMapper; import com.ruoyi.system.api.model.SysLoginLog; import com.ruoyi.account.service.SysLoginLogService; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.BasePage; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.system.api.domain.SysLoginLog; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.mapper.SysLoginLogMapper; import com.ruoyi.system.service.ISysLoginLogService; import com.ruoyi.system.service.ISysUserService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.List; /** * <p> * 服务实现类 * </p> * * @author luodangjia * @since 2024-11-21 * @author zhibing.pu * @Date 2024/8/12 15:47 */ @Service public class SysLoginLogServiceImpl extends ServiceImpl<SysLoginLogMapper, SysLoginLog> implements SysLoginLogService { public class SysLoginLogServiceImpl extends ServiceImpl<SysLoginLogMapper, SysLoginLog> implements ISysLoginLogService { @Resource private ISysUserService sysUserService; /** * 获取列表数据 * @param name * @param basePage * @return */ @Override public PageInfo<SysLoginLog> pageList(String name, BasePage basePage) { PageInfo<SysLoginLog> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize()); List<SysLoginLog> list = this.baseMapper.pageList(pageInfo, name); return pageInfo.setRecords(list); } /** * 添加登录日志 * @param loginLog * @return */ @Override public AjaxResult addLoginLog(SysLoginLog loginLog) { String username = loginLog.getUsername(); SysUser sysUser = sysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, username).eq(SysUser::getDelFlag, 0)); if(null == sysUser){ return AjaxResult.error("用户账号无效"); } loginLog.setUserId(sysUser.getUserId().intValue()); loginLog.setCreateTime(LocalDateTime.now()); loginLog.setDelFlag(0); this.save(loginLog); return AjaxResult.success(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
@@ -1,20 +1,574 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysMenuMapper; import com.ruoyi.system.api.model.SysMenu; import com.ruoyi.account.service.SysMenuService; import com.ruoyi.common.core.constant.Constants; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.domain.SysMenu; import com.ruoyi.system.domain.SysMenus; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.domain.vo.MetaVo; import com.ruoyi.system.domain.vo.RouterVo; import com.ruoyi.system.domain.vo.TreeSelect; import com.ruoyi.system.mapper.*; import com.ruoyi.system.service.ISysMenuService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; /** * <p> * 服务实现类 * </p> * * @author luodangjia * @since 2024-11-21 * 菜单 业务层处理 * * @author ruoyi */ @Service public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService { public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService { public static final String PREMISSION_STRING = "perms[\"{0}\"]"; @Autowired private SysMenuMapper menuMapper; @Autowired private SysRoleMapper roleMapper; @Autowired private SysRoleMenuMapper roleMenuMapper; @Autowired private TokenService tokenService; @Autowired private SysUserRoleMapper sysUserRoleMapper; @Resource private SysUserMapper sysUserMapper; /** * 根据用户查询系统菜单列表 * * @param userId 用户ID * @return 菜单列表 */ @Override public List<SysMenu> selectMenuList(Long userId) { return selectMenuList(new SysMenu(), userId); } /** * 查询系统菜单列表 * * @param menu 菜单信息 * @return 菜单列表 */ @Override public List<SysMenu> selectMenuList(SysMenu menu, Long userId) { List<SysMenu> menuList = null; // 管理员显示所有菜单信息 { menu.getParams().put("userId", userId); menuList = menuMapper.selectMenuListByUserId(menu); } return menuList; } /** * 根据用户ID查询权限 * * @param userId 用户ID * @return 权限列表 */ @Override public Set<String> selectMenuPermsByUserId(Long userId) { List<String> perms = menuMapper.selectMenuPermsByUserId(userId); Set<String> permsSet = new HashSet<>(); for (String perm : perms) { if (StringUtils.isNotEmpty(perm)) { permsSet.add(perm); } } return permsSet; } /** * 根据角色ID查询权限 * * @param roleId 角色ID * @return 权限列表 */ @Override public Set<String> selectMenuPermsByRoleId(Long roleId) { List<String> perms = menuMapper.selectMenuPermsByRoleId(roleId); Set<String> permsSet = new HashSet<>(); for (String perm : perms) { if (StringUtils.isNotEmpty(perm)) { permsSet.add(perm); } } return permsSet; } /** * 根据用户ID查询菜单 * * @param userId 用户名称 * @return 菜单列表 */ @Override public List<SysMenu> selectMenuTreeByUserId(Long userId) { List<SysMenu> menus = null; if (SecurityUtils.isAdmin(userId)) { menus = menuMapper.selectMenuTreeAll(); } else { menus = menuMapper.selectMenuTreeByUserId(userId); } return getChildPerms(menus, 0); } /** * 根据角色ID查询菜单树信息 * * @param roleId 角色ID * @return 选中菜单列表 */ @Override public List<Long> selectMenuListByRoleId(Long roleId) { SysRole role = roleMapper.selectRoleById(roleId); return menuMapper.selectMenuListByRoleId(roleId, false); } /** * 构建前端路由所需要的菜单 * * @param menus 菜单列表 * @return 路由列表 */ @Override public List<RouterVo> buildMenus(List<SysMenu> menus) { List<RouterVo> routers = new LinkedList<RouterVo>(); for (SysMenu menu : menus) { RouterVo router = new RouterVo(); router.setHidden("1".equals(menu.getVisible())); router.setName(getRouteName(menu)); router.setPath(getRouterPath(menu)); router.setComponent(getComponent(menu)); router.setQuery(menu.getQuery()); router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); List<SysMenu> cMenus = menu.getChildren(); if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { router.setAlwaysShow(true); router.setRedirect("noRedirect"); router.setChildren(buildMenus(cMenus)); } else if (isMenuFrame(menu)) { router.setMeta(null); List<RouterVo> childrenList = new ArrayList<RouterVo>(); RouterVo children = new RouterVo(); children.setPath(menu.getPath()); children.setComponent(menu.getComponent()); children.setName(StringUtils.capitalize(menu.getPath())); children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); children.setQuery(menu.getQuery()); childrenList.add(children); router.setChildren(childrenList); } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) { router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); router.setPath("/"); List<RouterVo> childrenList = new ArrayList<RouterVo>(); RouterVo children = new RouterVo(); String routerPath = innerLinkReplaceEach(menu.getPath()); children.setPath(routerPath); children.setComponent(UserConstants.INNER_LINK); children.setName(StringUtils.capitalize(routerPath)); children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath())); childrenList.add(children); router.setChildren(childrenList); } routers.add(router); } return routers; } /** * 构建前端所需要树结构 * * @param menus 菜单列表 * @return 树结构列表 */ @Override public List<SysMenu> buildMenuTree(List<SysMenu> menus) { List<SysMenu> returnList = new ArrayList<SysMenu>(); List<Long> tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList()); for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();) { SysMenu menu = (SysMenu) iterator.next(); // 如果是顶级节点, 遍历该父节点的所有子节点 if (!tempList.contains(menu.getParentId())) { recursionFn(menus, menu); returnList.add(menu); } } if (returnList.isEmpty()) { returnList = menus; } return returnList; } /** * 构建前端所需要下拉树结构 * * @param menus 菜单列表 * @return 下拉树结构列表 */ @Override public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) { List<SysMenu> menuTrees = buildMenuTree(menus); return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); } /** * 根据菜单ID查询信息 * * @param menuId 菜单ID * @return 菜单信息 */ @Override public SysMenu selectMenuById(Long menuId) { return menuMapper.selectMenuById(menuId); } /** * 是否存在菜单子节点 * * @param menuId 菜单ID * @return 结果 */ @Override public boolean hasChildByMenuId(Long menuId) { int result = menuMapper.hasChildByMenuId(menuId); return result > 0; } /** * 查询菜单使用数量 * * @param menuId 菜单ID * @return 结果 */ @Override public boolean checkMenuExistRole(Long menuId) { int result = roleMenuMapper.checkMenuExistRole(menuId); return result > 0; } /** * 新增保存菜单信息 * * @param menu 菜单信息 * @return 结果 */ @Override public int insertMenu(SysMenu menu) { return menuMapper.insertMenu(menu); } /** * 修改保存菜单信息 * * @param menu 菜单信息 * @return 结果 */ @Override public int updateMenu(SysMenu menu) { return menuMapper.updateMenu(menu); } /** * 删除菜单管理信息 * * @param menuId 菜单ID * @return 结果 */ @Override public int deleteMenuById(Long menuId) { return menuMapper.deleteMenuById(menuId); } /** * 校验菜单名称是否唯一 * * @param menu 菜单信息 * @return 结果 */ @Override public boolean checkMenuNameUnique(SysMenu menu) { Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } @Override public List<SysMenus> getAllMenu() { Long userid = tokenService.getLoginUser().getUserid(); SysUserRole sysUserRole = sysUserRoleMapper.selectSysUserRoleByUserId(userid); Long roleId = sysUserRole.getRoleId(); List<SysMenus> list=null; if(roleId!=1){ list = menuMapper.getAllOne(); }else { list = menuMapper.getAll(); } // 获取所有 // 第三级 List<SysMenus> s3 = list.stream().filter(e -> e.getMenuType().equals("F")).collect(Collectors.toList()); // 第二级 List<SysMenus> s2 = list.stream().filter(e -> e.getMenuType().equals("C") && e.getMenuId() != 1196 && e.getMenuId() != 1197 && e.getMenuId() != 1198 && e.getMenuId() != 1199 && e.getMenuId() != 1201 && e.getMenuId() != 1205).collect(Collectors.toList()); // 第一级 List<SysMenus> s1 = list.stream().filter(e -> e.getMenuType().equals("M")).collect(Collectors.toList()); for (SysMenus menus : s2) { List<SysMenus> collect = s3.stream().filter(e -> e.getParentId().equals(menus.getMenuId())).collect(Collectors.toList()); menus.setChildren(collect); } for (SysMenus menus : s1) { List<SysMenus> collect = s2.stream().filter(e -> e.getParentId().equals(menus.getMenuId())).collect(Collectors.toList()); menus.setChildren(collect); } return s1; } /** * 获取路由名称 * * @param menu 菜单信息 * @return 路由名称 */ public String getRouteName(SysMenu menu) { String routerName = StringUtils.capitalize(menu.getPath()); // 非外链并且是一级目录(类型为目录) if (isMenuFrame(menu)) { routerName = StringUtils.EMPTY; } return routerName; } /** * 获取路由地址 * * @param menu 菜单信息 * @return 路由地址 */ public String getRouterPath(SysMenu menu) { String routerPath = menu.getPath(); // 内链打开外网方式 if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) { routerPath = innerLinkReplaceEach(routerPath); } // 非外链并且是一级目录(类型为目录) if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) && UserConstants.NO_FRAME.equals(menu.getIsFrame())) { routerPath = "/" + menu.getPath(); } // 非外链并且是一级目录(类型为菜单) else if (isMenuFrame(menu)) { routerPath = "/"; } return routerPath; } /** * 获取组件信息 * * @param menu 菜单信息 * @return 组件信息 */ public String getComponent(SysMenu menu) { String component = UserConstants.LAYOUT; if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) { component = menu.getComponent(); } else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) { component = UserConstants.INNER_LINK; } else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) { component = UserConstants.PARENT_VIEW; } return component; } /** * 是否为菜单内部跳转 * * @param menu 菜单信息 * @return 结果 */ public boolean isMenuFrame(SysMenu menu) { return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) && menu.getIsFrame().equals(UserConstants.NO_FRAME); } /** * 是否为内链组件 * * @param menu 菜单信息 * @return 结果 */ public boolean isInnerLink(SysMenu menu) { return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath()); } /** * 是否为parent_view组件 * * @param menu 菜单信息 * @return 结果 */ public boolean isParentView(SysMenu menu) { return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()); } /** * 根据父节点的ID获取所有子节点 * * @param list 分类表 * @param parentId 传入的父节点ID * @return String */ public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) { List<SysMenu> returnList = new ArrayList<SysMenu>(); for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();) { SysMenu t = (SysMenu) iterator.next(); // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点 if (t.getParentId() == parentId) { recursionFn(list, t); returnList.add(t); } } return returnList; } /** * 递归列表 * * @param list * @param t */ private void recursionFn(List<SysMenu> list, SysMenu t) { // 得到子节点列表 List<SysMenu> childList = getChildList(list, t); t.setChildren(childList); for (SysMenu tChild : childList) { if (hasChild(list, tChild)) { recursionFn(list, tChild); } } } /** * 得到子节点列表 */ private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) { List<SysMenu> tlist = new ArrayList<SysMenu>(); Iterator<SysMenu> it = list.iterator(); while (it.hasNext()) { SysMenu n = (SysMenu) it.next(); if (n.getParentId().longValue() == t.getMenuId().longValue()) { tlist.add(n); } } return tlist; } /** * 判断是否有子节点 */ private boolean hasChild(List<SysMenu> list, SysMenu t) { return getChildList(list, t).size() > 0; } /** * 内链域名特殊字符替换 * * @return */ public String innerLinkReplaceEach(String path) { return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." }, new String[] { "", "", "", "/" }); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java
@@ -1,20 +1,92 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysNoticeMapper; import com.ruoyi.system.api.model.SysNotice; import com.ruoyi.account.service.SysNoticeService; import com.ruoyi.system.domain.SysNotice; import com.ruoyi.system.mapper.SysNoticeMapper; import com.ruoyi.system.service.ISysNoticeService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; /** * <p> * 服务实现类 * </p> * * @author luodangjia * @since 2024-11-21 * 公告 服务层实现 * * @author ruoyi */ @Service public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService { public class SysNoticeServiceImpl implements ISysNoticeService { @Resource private SysNoticeMapper noticeMapper; /** * 查询公告信息 * * @param noticeId 公告ID * @return 公告信息 */ @Override public SysNotice selectNoticeById(Long noticeId) { return noticeMapper.selectNoticeById(noticeId); } /** * 查询公告列表 * * @param notice 公告信息 * @return 公告集合 */ @Override public List<SysNotice> selectNoticeList(SysNotice notice) { return noticeMapper.selectNoticeList(notice); } /** * 新增公告 * * @param notice 公告信息 * @return 结果 */ @Override public int insertNotice(SysNotice notice) { return noticeMapper.insertNotice(notice); } /** * 修改公告 * * @param notice 公告信息 * @return 结果 */ @Override public int updateNotice(SysNotice notice) { return noticeMapper.updateNotice(notice); } /** * 删除公告对象 * * @param noticeId 公告ID * @return 结果 */ @Override public int deleteNoticeById(Long noticeId) { return noticeMapper.deleteNoticeById(noticeId); } /** * 批量删除公告信息 * * @param noticeIds 需要删除的公告ID * @return 结果 */ @Override public int deleteNoticeByIds(Long[] noticeIds) { return noticeMapper.deleteNoticeByIds(noticeIds); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
@@ -1,20 +1,75 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysOperLogMapper; import com.ruoyi.system.api.model.SysOperLog; import com.ruoyi.account.service.SysOperLogService; import com.ruoyi.system.api.domain.SysOperLog; import com.ruoyi.system.mapper.SysOperLogMapper; import com.ruoyi.system.service.ISysOperLogService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; /** * <p> * 服务实现类 * </p> * 操作日志 服务层处理 * * @author luodangjia * @since 2024-11-21 * @author ruoyi */ @Service public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements SysOperLogService { public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService { @Resource private SysOperLogMapper operLogMapper; /** * 新增操作日志 * * @param operLog 操作日志对象 * @return 结果 */ @Override public int insertOperlog(SysOperLog operLog) { return operLogMapper.insertOperlog(operLog); } /** * 查询系统操作日志集合 * * @param operLog 操作日志对象 * @return 操作日志集合 */ @Override public List<SysOperLog> selectOperLogList(SysOperLog operLog) { return operLogMapper.selectOperLogList(operLog); } /** * 批量删除系统操作日志 * * @param operIds 需要删除的操作日志ID * @return 结果 */ @Override public int deleteOperLogByIds(Long[] operIds) { return operLogMapper.deleteOperLogByIds(operIds); } /** * 查询操作日志详细 * * @param operId 操作ID * @return 操作日志对象 */ @Override public SysOperLog selectOperLogById(Long operId) { return operLogMapper.selectOperLogById(operId); } /** * 清空操作日志 */ @Override public void cleanOperLog() { operLogMapper.cleanOperLog(); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java
New file @@ -0,0 +1,86 @@ package com.ruoyi.system.service.impl; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.service.ISysMenuService; import com.ruoyi.system.service.ISysPermissionService; import com.ruoyi.system.service.ISysRoleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.HashSet; import java.util.List; import java.util.Set; /** * 用户权限处理 * * @author ruoyi */ @Service public class SysPermissionServiceImpl implements ISysPermissionService { @Autowired private ISysRoleService roleService; @Autowired private ISysMenuService menuService; /** * 获取角色数据权限 * * @param userId 用户Id * @return 角色权限信息 */ @Override public Set<String> getRolePermission(SysUser user) { Set<String> roles = new HashSet<String>(); // 管理员拥有所有权限 if (user.isAdmin()) { roles.add("admin"); } else { roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); } return roles; } /** * 获取菜单数据权限 * * @param userId 用户Id * @return 菜单权限信息 */ @Override public Set<String> getMenuPermission(SysUser user) { Set<String> perms = new HashSet<String>(); // 管理员拥有所有权限 if (user.isAdmin()) { perms.add("*:*:*"); } else { List<SysRole> roles = user.getRoles(); if (!roles.isEmpty() && roles.size() > 1) { // 多角色设置permissions属性,以便数据权限匹配权限 for (SysRole role : roles) { Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId()); role.setPermissions(rolePerms); perms.addAll(rolePerms); } } else { perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); } } return perms; } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java
@@ -1,20 +1,179 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysPostMapper; import com.ruoyi.system.api.model.SysPost; import com.ruoyi.account.service.SysPostService; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.system.domain.SysPost; import com.ruoyi.system.mapper.SysPostMapper; import com.ruoyi.system.mapper.SysUserPostMapper; import com.ruoyi.system.service.ISysPostService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * <p> * 服务实现类 * </p> * * @author luodangjia * @since 2024-11-21 * 岗位信息 服务层处理 * * @author ruoyi */ @Service public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> implements SysPostService { public class SysPostServiceImpl implements ISysPostService { @Autowired private SysPostMapper postMapper; @Autowired private SysUserPostMapper userPostMapper; /** * 查询岗位信息集合 * * @param post 岗位信息 * @return 岗位信息集合 */ @Override public List<SysPost> selectPostList(SysPost post) { return postMapper.selectPostList(post); } /** * 查询所有岗位 * * @return 岗位列表 */ @Override public List<SysPost> selectPostAll() { return postMapper.selectPostAll(); } /** * 通过岗位ID查询岗位信息 * * @param postId 岗位ID * @return 角色对象信息 */ @Override public SysPost selectPostById(Long postId) { return postMapper.selectPostById(postId); } /** * 根据用户ID获取岗位选择框列表 * * @param userId 用户ID * @return 选中岗位ID列表 */ @Override public List<Long> selectPostListByUserId(Long userId) { return postMapper.selectPostListByUserId(userId); } /** * 校验岗位名称是否唯一 * * @param post 岗位信息 * @return 结果 */ @Override public boolean checkPostNameUnique(SysPost post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); SysPost info = postMapper.checkPostNameUnique(post.getPostName()); if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } /** * 校验岗位编码是否唯一 * * @param post 岗位信息 * @return 结果 */ @Override public boolean checkPostCodeUnique(SysPost post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } /** * 通过岗位ID查询岗位使用数量 * * @param postId 岗位ID * @return 结果 */ @Override public int countUserPostById(Long postId) { return userPostMapper.countUserPostById(postId); } /** * 删除岗位信息 * * @param postId 岗位ID * @return 结果 */ @Override public int deletePostById(Long postId) { return postMapper.deletePostById(postId); } /** * 批量删除岗位信息 * * @param postIds 需要删除的岗位ID * @return 结果 */ @Override public int deletePostByIds(Long[] postIds) { for (Long postId : postIds) { SysPost post = selectPostById(postId); if (countUserPostById(postId) > 0) { throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName())); } } return postMapper.deletePostByIds(postIds); } /** * 新增保存岗位信息 * * @param post 岗位信息 * @return 结果 */ @Override public int insertPost(SysPost post) { return postMapper.insertPost(post); } /** * 修改保存岗位信息 * * @param post 岗位信息 * @return 结果 */ @Override public int updatePost(SysPost post) { return postMapper.updatePost(post); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleDeptServiceImpl.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleMenuServiceImpl.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
@@ -1,20 +1,413 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysRoleMapper; import com.ruoyi.system.api.model.SysRole; import com.ruoyi.account.service.SysRoleService; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.core.utils.SpringUtils; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.datascope.annotation.DataScope; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.domain.SysRoleDept; import com.ruoyi.system.domain.SysRoleMenu; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.mapper.SysRoleDeptMapper; import com.ruoyi.system.mapper.SysRoleMapper; import com.ruoyi.system.mapper.SysRoleMenuMapper; import com.ruoyi.system.mapper.SysUserRoleMapper; import com.ruoyi.system.service.ISysRoleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; /** * <p> * 服务实现类 * </p> * 角色 业务层处理 * * @author luodangjia * @since 2024-11-21 * @author ruoyi */ @Service public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService { public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService { @Autowired private SysRoleMapper roleMapper; @Autowired private SysRoleMenuMapper roleMenuMapper; @Autowired private SysUserRoleMapper userRoleMapper; @Autowired private SysRoleDeptMapper roleDeptMapper; /** * 根据条件分页查询角色数据 * * @param role 角色信息 * @return 角色数据集合信息 */ @Override @DataScope(deptAlias = "d") public List<SysRole> selectRoleList(SysRole role) { return roleMapper.selectRoleList(role); } /** * 根据用户ID查询角色 * * @param userId 用户ID * @return 角色列表 */ @Override public List<SysRole> selectRolesByUserId(Long userId) { List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId); List<SysRole> roles = selectRoleAll(); for (SysRole role : roles) { for (SysRole userRole : userRoles) { if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) { role.setFlag(true); break; } } } return roles; } /** * 根据用户ID查询权限 * * @param userId 用户ID * @return 权限列表 */ @Override public Set<String> selectRolePermissionByUserId(Long userId) { List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId); Set<String> permsSet = new HashSet<>(); for (SysRole perm : perms) { if (StringUtils.isNotNull(perm)) { permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); } } return permsSet; } /** * 查询所有角色 * * @return 角色列表 */ @Override public List<SysRole> selectRoleAll() { return SpringUtils.getAopProxy(this).selectRoleList(new SysRole()); } /** * 根据用户ID获取角色选择框列表 * * @param userId 用户ID * @return 选中角色ID列表 */ @Override public List<Long> selectRoleListByUserId(Long userId) { return roleMapper.selectRoleListByUserId(userId); } /** * 通过角色ID查询角色 * * @param roleId 角色ID * @return 角色对象信息 */ @Override public SysRole selectRoleById(Long roleId) { return roleMapper.selectRoleById(roleId); } /** * 校验角色名称是否唯一 * * @param role 角色信息 * @return 结果 */ @Override public boolean checkRoleNameUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName()); if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } /** * 校验角色权限是否唯一 * * @param role 角色信息 * @return 结果 */ @Override public boolean checkRoleKeyUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } /** * 校验角色是否允许操作 * * @param role 角色信息 */ @Override public void checkRoleAllowed(SysRole role) { if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) { throw new ServiceException("不允许操作超级管理员角色"); } } /** * 校验角色是否有数据权限 * * @param roleId 角色id */ @Override public void checkRoleDataScope(Long roleId) { if (!SysUser.isAdmin(SecurityUtils.getUserId())) { SysRole role = new SysRole(); role.setRoleId(roleId); List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role); if (StringUtils.isEmpty(roles)) { throw new ServiceException("没有权限访问角色数据!"); } } } /** * 通过角色ID查询角色使用数量 * * @param roleId 角色ID * @return 结果 */ @Override public int countUserRoleByRoleId(Long roleId) { return userRoleMapper.countUserRoleByRoleId(roleId); } /** * 新增保存角色信息 * * @param role 角色信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int insertRole(SysRole role) { // 新增角色信息 roleMapper.insertRole(role); return insertRoleMenu(role); } /** * 修改保存角色信息 * * @param role 角色信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int updateRole(SysRole role) { // 修改角色信息 // roleMapper.updateRole(role); // 删除角色与菜单关联 // roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId()); return roleMapper.updateRole(role); } /** * 修改角色状态 * * @param role 角色信息 * @return 结果 */ @Override public int updateRoleStatus(SysRole role) { return roleMapper.updateRole(role); } /** * 修改数据权限信息 * * @param role 角色信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int authDataScope(SysRole role) { // 修改角色信息 roleMapper.updateRole(role); // 删除角色与部门关联 roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId()); // 新增角色和部门信息(数据权限) return insertRoleDept(role); } /** * 新增角色菜单信息 * * @param role 角色对象 */ public int insertRoleMenu(SysRole role) { int rows = 1; // 新增用户与角色管理 List<SysRoleMenu> list = new ArrayList<SysRoleMenu>(); Long[] menuIds = role.getMenuIds(); // List<Long> longs = Arrays.asList(menuIds); List<Long> longs = new ArrayList<>(); for (Long menuId : menuIds) { longs.add(menuId); } if (!longs.contains(1061L)) { longs.add(1061L); longs.add(1062L); longs.add(1065L); longs.add(1073L); longs.add(1161L); longs.add(1203L); } for (Long menuId : longs) { SysRoleMenu rm = new SysRoleMenu(); rm.setRoleId(role.getRoleId()); rm.setMenuId(menuId); list.add(rm); } if (list.size() > 0) { rows = roleMenuMapper.batchRoleMenu(list); } return rows; } /** * 新增角色部门信息(数据权限) * * @param role 角色对象 */ public int insertRoleDept(SysRole role) { int rows = 1; // 新增角色与部门(数据权限)管理 List<SysRoleDept> list = new ArrayList<SysRoleDept>(); for (Long deptId : role.getDeptIds()) { SysRoleDept rd = new SysRoleDept(); rd.setRoleId(role.getRoleId()); rd.setDeptId(deptId); list.add(rd); } if (list.size() > 0) { rows = roleDeptMapper.batchRoleDept(list); } return rows; } /** * 通过角色ID删除角色 * * @param roleId 角色ID * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int deleteRoleById(Long roleId) { // 删除角色与菜单关联 roleMenuMapper.deleteRoleMenuByRoleId(roleId); // 删除角色与部门关联 roleDeptMapper.deleteRoleDeptByRoleId(roleId); return roleMapper.deleteRoleById(roleId); } /** * 批量删除角色信息 * * @param roleIds 需要删除的角色ID * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int deleteRoleByIds(Long[] roleIds) { for (Long roleId : roleIds) { checkRoleAllowed(new SysRole(roleId)); checkRoleDataScope(roleId); SysRole role = selectRoleById(roleId); if (countUserRoleByRoleId(roleId) > 0) { throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName())); } } // 删除角色与菜单关联 roleMenuMapper.deleteRoleMenu(roleIds); // 删除角色与部门关联 roleDeptMapper.deleteRoleDept(roleIds); return roleMapper.deleteRoleByIds(roleIds); } /** * 取消授权用户角色 * * @param userRole 用户和角色关联信息 * @return 结果 */ @Override public int deleteAuthUser(SysUserRole userRole) { return userRoleMapper.deleteUserRoleInfo(userRole); } /** * 批量取消授权用户角色 * * @param roleId 角色ID * @param userIds 需要取消授权的用户数据ID * @return 结果 */ @Override public int deleteAuthUsers(Long roleId, Long[] userIds) { return userRoleMapper.deleteUserRoleInfos(roleId, userIds); } /** * 批量选择授权用户角色 * * @param roleId 角色ID * @param userIds 需要授权的用户数据ID * @return 结果 */ @Override public int insertAuthUsers(Long roleId, Long[] userIds) { // 新增用户与角色管理 List<SysUserRole> list = new ArrayList<SysUserRole>(); for (Long userId : userIds) { SysUserRole ur = new SysUserRole(); ur.setUserId(userId); ur.setRoleId(roleId); list.add(ur); } return userRoleMapper.batchUserRole(list); } @Override public List<SysRole> isExitUpdate(String roleName, Long roleId, Integer companyId) { return roleMapper.isExitUpdate(roleName, roleId, companyId); } /** * 根据id获取数据 * * @param ids 数据id集合 * @return */ @Override public List<SysRole> getSysRoleByIds(List<Integer> ids) { return this.baseMapper.getSysRoleByIds(ids); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java
New file @@ -0,0 +1,89 @@ package com.ruoyi.system.service.impl; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.system.api.model.LoginUser; import com.ruoyi.system.domain.SysUserOnline; import com.ruoyi.system.service.ISysUserOnlineService; import org.springframework.stereotype.Service; /** * 在线用户 服务层处理 * * @author ruoyi */ @Service public class SysUserOnlineServiceImpl implements ISysUserOnlineService { /** * 通过登录地址查询信息 * * @param ipaddr 登录地址 * @param user 用户信息 * @return 在线用户信息 */ @Override public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) { if (StringUtils.equals(ipaddr, user.getIpaddr())) { return loginUserToUserOnline(user); } return null; } /** * 通过用户名称查询信息 * * @param userName 用户名称 * @param user 用户信息 * @return 在线用户信息 */ @Override public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) { if (StringUtils.equals(userName, user.getUsername())) { return loginUserToUserOnline(user); } return null; } /** * 通过登录地址/用户名称查询信息 * * @param ipaddr 登录地址 * @param userName 用户名称 * @param user 用户信息 * @return 在线用户信息 */ @Override public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) { if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) { return loginUserToUserOnline(user); } return null; } /** * 设置在线用户信息 * * @param user 用户信息 * @return 在线用户 */ @Override public SysUserOnline loginUserToUserOnline(LoginUser user) { if (StringUtils.isNull(user)) { return null; } SysUserOnline sysUserOnline = new SysUserOnline(); sysUserOnline.setTokenId(user.getToken()); sysUserOnline.setUserName(user.getUsername()); sysUserOnline.setIpaddr(user.getIpaddr()); sysUserOnline.setLoginTime(user.getLoginTime()); return sysUserOnline; } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserPostServiceImpl.java
File was deleted ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserRoleServiceImpl.java
@@ -1,20 +1,88 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysUserRoleMapper; import com.ruoyi.system.api.model.SysUserRole; import com.ruoyi.account.service.SysUserRoleService; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.mapper.SysUserRoleMapper; import com.ruoyi.system.service.ISysUserRoleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * <p> * 服务实现类 * </p> * 用户和角色关联Service业务层处理 * * @author luodangjia * @since 2024-11-21 * @author xiaochen * @date 2023-06-12 */ @Service public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements SysUserRoleService { public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements ISysUserRoleService { @Autowired private SysUserRoleMapper sysUserRoleMapper; /** * 查询用户和角色关联 * * @param userId 用户和角色关联主键 * @return 用户和角色关联 */ @Override public SysUserRole selectSysUserRoleByUserId(Long userId) { return sysUserRoleMapper.selectSysUserRoleByUserId(userId); } /** * 查询用户和角色关联列表 * * @param sysUserRole 用户和角色关联 * @return 用户和角色关联 */ @Override public List<SysUserRole> selectSysUserRoleList(SysUserRole sysUserRole) { return sysUserRoleMapper.selectSysUserRoleList(sysUserRole); } /** * 新增用户和角色关联 * * @param sysUserRole 用户和角色关联 * @return 结果 */ @Override public int insertSysUserRole(SysUserRole sysUserRole) { return sysUserRoleMapper.insertSysUserRole(sysUserRole); } /** * 修改用户和角色关联 * * @param sysUserRole 用户和角色关联 * @return 结果 */ @Override public int updateSysUserRole(SysUserRole sysUserRole) { return sysUserRoleMapper.updateSysUserRole(sysUserRole); } /** * 批量删除用户和角色关联 * * @param userIds 需要删除的用户和角色关联主键 * @return 结果 */ @Override public int deleteSysUserRoleByUserIds(Long[] userIds) { return sysUserRoleMapper.deleteSysUserRoleByUserIds(userIds); } /** * 删除用户和角色关联信息 * * @param userId 用户和角色关联主键 * @return 结果 */ @Override public int deleteSysUserRoleByUserId(Long userId) { return sysUserRoleMapper.deleteSysUserRoleByUserId(userId); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -1,20 +1,549 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.SysUserMapper; import com.ruoyi.system.api.model.SysUser; import com.ruoyi.account.service.SysUserService; import com.ruoyi.common.core.constant.UserConstants; import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.core.utils.SpringUtils; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.bean.BeanValidators; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.datascope.annotation.DataScope; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.query.ChangeUserQuery; import com.ruoyi.system.domain.SysPost; import com.ruoyi.system.domain.SysUserPost; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.mapper.*; import com.ruoyi.system.query.GetSysUserList; import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysUserRoleService; import com.ruoyi.system.service.ISysUserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import javax.validation.Validator; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; /** * <p> * 服务实现类 * </p> * 用户 业务层处理 * * @author luodangjia * @since 2024-11-21 * @author ruoyi */ @Service public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService { public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService { private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); @Resource private SysUserMapper userMapper; @Resource private SysRoleMapper roleMapper; @Resource private SysPostMapper postMapper; @Resource private SysUserRoleMapper userRoleMapper; @Resource private SysUserPostMapper userPostMapper; @Resource private ISysConfigService configService; @Resource protected Validator validator; @Resource private ISysUserRoleService sysUserRoleService; @Resource private ISysRoleService sysRoleService; @Resource private TokenService tokenService; /** * 根据条件分页查询用户列表 * * @param user 用户信息 * @return 用户信息集合信息 */ @Override @DataScope(deptAlias = "d", userAlias = "u") public List<SysUser> selectUserList(SysUser user) { return userMapper.selectUserList(user); } /** * 根据条件分页查询已分配用户角色列表 * * @param user 用户信息 * @return 用户信息集合信息 */ @Override @DataScope(deptAlias = "d", userAlias = "u") public List<SysUser> selectAllocatedList(SysUser user) { return userMapper.selectAllocatedList(user); } /** * 根据条件分页查询未分配用户角色列表 * * @param user 用户信息 * @return 用户信息集合信息 */ @Override @DataScope(deptAlias = "d", userAlias = "u") public List<SysUser> selectUnallocatedList(SysUser user) { return userMapper.selectUnallocatedList(user); } /** * 通过用户名查询用户 * * @param userName 用户名 * @return 用户对象信息 */ @Override public SysUser selectUserByUserName(String userName) { return userMapper.selectUserByUserName(userName); } /** * 通过用户ID查询用户 * * @param userId 用户ID * @return 用户对象信息 */ @Override public SysUser selectUserById(Long userId) { return userMapper.selectUserById(userId); } /** * 查询用户所属角色组 * * @param userName 用户名 * @return 结果 */ @Override public String selectUserRoleGroup(String userName) { List<SysRole> list = roleMapper.selectRolesByUserName(userName); if (CollectionUtils.isEmpty(list)) { return StringUtils.EMPTY; } return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(",")); } /** * 查询用户所属岗位组 * * @param userName 用户名 * @return 结果 */ @Override public String selectUserPostGroup(String userName) { List<SysPost> list = postMapper.selectPostsByUserName(userName); if (CollectionUtils.isEmpty(list)) { return StringUtils.EMPTY; } return list.stream().map(SysPost::getPostName).collect(Collectors.joining(",")); } /** * 校验用户名称是否唯一 * * @param user 用户信息 * @return 结果 */ @Override public boolean checkUserNameUnique(SysUser user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); SysUser info = userMapper.checkUserNameUnique(user.getUserName()); if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } /** * 校验手机号码是否唯一 * * @param user 用户信息 * @return */ @Override public boolean checkPhoneUnique(SysUser user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber()); if (StringUtils.isNotNull(info)) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } /** * 校验email是否唯一 * * @param user 用户信息 * @return */ @Override public boolean checkEmailUnique(SysUser user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); SysUser info = userMapper.checkEmailUnique(user.getEmail()); if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } /** * 校验用户是否允许操作 * * @param user 用户信息 */ @Override public void checkUserAllowed(SysUser user) { Long userid = tokenService.getLoginUser().getUserid(); if (StringUtils.isNotNull(user.getUserId()) && !userid.equals(user.getUserId()) && user.isAdmin()) { throw new ServiceException("不允许操作超级管理员用户"); } } /** * 校验用户是否有数据权限 * * @param userId 用户id */ @Override public void checkUserDataScope(Long userId) { if (!SysUser.isAdmin(SecurityUtils.getUserId())) { SysUser user = new SysUser(); user.setUserId(userId); List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user); if (StringUtils.isEmpty(users)) { throw new ServiceException("没有权限访问用户数据!"); } } } /** * 新增保存用户信息 * * @param user 用户信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int insertUser(SysUser user) { // 新增用户信息 int rows = userMapper.insertUser(user); // // 新增用户岗位关联 // insertUserPost(user); // // 新增用户与角色管理 // insertUserRole(user); return rows; } /** * 注册用户信息 * * @param user 用户信息 * @return 结果 */ @Override public boolean registerUser(SysUser user) { return userMapper.insertUser(user) > 0; } /** * 修改保存用户信息 * * @param user 用户信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int updateUser(SysUser user) { // Long userId = user.getUserId(); // // 删除用户与角色关联 // userRoleMapper.deleteUserRoleByUserId(userId); // // 新增用户与角色管理 // insertUserRole(user); // // 删除用户与岗位关联 // userPostMapper.deleteUserPostByUserId(userId); // // 新增用户与岗位管理 // insertUserPost(user); return userMapper.updateUser(user); } /** * 用户授权角色 * * @param userId 用户ID * @param roleIds 角色组 */ @Override @Transactional(rollbackFor = Exception.class) public void insertUserAuth(Long userId, Long[] roleIds) { userRoleMapper.deleteUserRoleByUserId(userId); insertUserRole(userId, roleIds); } /** * 修改用户状态 * * @param user 用户信息 * @return 结果 */ @Override public int updateUserStatus(SysUser user) { return userMapper.updateUser(user); } /** * 修改用户基本信息 * * @param user 用户信息 * @return 结果 */ @Override public int updateUserProfile(SysUser user) { return userMapper.updateUser(user); } /** * 修改用户头像 * * @param userName 用户名 * @param avatar 头像地址 * @return 结果 */ @Override public boolean updateUserAvatar(String userName, String avatar) { return userMapper.updateUserAvatar(userName, avatar) > 0; } /** * 重置用户密码 * * @param user 用户信息 * @return 结果 */ @Override public int resetPwd(SysUser user) { return userMapper.updateUser(user); } /** * 重置用户密码 * * @param userName 用户名 * @param password 密码 * @return 结果 */ @Override public int resetUserPwd(String userName, String password) { return userMapper.resetUserPwd(userName, password); } /** * 新增用户角色信息 * * @param user 用户对象 */ public void insertUserRole(SysUser user) { this.insertUserRole(user.getUserId(), user.getRoleIds()); } /** * 新增用户岗位信息 * * @param user 用户对象 */ public void insertUserPost(SysUser user) { Long[] posts = user.getPostIds(); if (StringUtils.isNotEmpty(posts)) { // 新增用户与岗位管理 List<SysUserPost> list = new ArrayList<SysUserPost>(); for (Long postId : posts) { SysUserPost up = new SysUserPost(); up.setUserId(user.getUserId()); up.setPostId(postId); list.add(up); } userPostMapper.batchUserPost(list); } } /** * 新增用户角色信息 * * @param userId 用户ID * @param roleIds 角色组 */ public void insertUserRole(Long userId, Long[] roleIds) { if (StringUtils.isNotEmpty(roleIds)) { // 新增用户与角色管理 List<SysUserRole> list = new ArrayList<SysUserRole>(); for (Long roleId : roleIds) { SysUserRole ur = new SysUserRole(); ur.setUserId(userId); ur.setRoleId(roleId); list.add(ur); } userRoleMapper.batchUserRole(list); } } /** * 通过用户ID删除用户 * * @param userId 用户ID * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int deleteUserById(Long userId) { // 删除用户与角色关联 userRoleMapper.deleteUserRoleByUserId(userId); // 删除用户与岗位表 userPostMapper.deleteUserPostByUserId(userId); return userMapper.deleteUserById(userId); } /** * 批量删除用户信息 * * @param userIds 需要删除的用户ID * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int deleteUserByIds(Long[] userIds) { for (Long userId : userIds) { checkUserAllowed(new SysUser(userId)); // checkUserDataScope(userId); } // 删除用户与角色关联 // userRoleMapper.deleteUserRole(userIds); // // 删除用户与岗位关联 // userPostMapper.deleteUserPost(userIds); return userMapper.deleteUserByIds(userIds); } /** * 导入用户数据 * * @param userList 用户数据列表 * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 * @param operName 操作用户 * @return 结果 */ @Override public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) { if (StringUtils.isNull(userList) || userList.size() == 0) { throw new ServiceException("导入用户数据不能为空!"); } int successNum = 0; int failureNum = 0; StringBuilder successMsg = new StringBuilder(); StringBuilder failureMsg = new StringBuilder(); String password = configService.selectConfigByKey("sys.user.initPassword"); for (SysUser user : userList) { try { // 验证是否存在这个用户 SysUser u = userMapper.selectUserByUserName(user.getUserName()); if (StringUtils.isNull(u)) { BeanValidators.validateWithException(validator, user); user.setPassword(SecurityUtils.encryptPassword(password)); user.setCreateBy(operName); userMapper.insertUser(user); successNum++; successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功"); } else if (isUpdateSupport) { BeanValidators.validateWithException(validator, user); checkUserAllowed(u); checkUserDataScope(u.getUserId()); user.setUserId(u.getUserId()); user.setUpdateBy(operName); userMapper.updateUser(user); successNum++; successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功"); } else { failureNum++; failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在"); } } catch (Exception e) { failureNum++; String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:"; failureMsg.append(msg + e.getMessage()); log.error(msg, e); } } if (failureNum > 0) { failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); throw new ServiceException(failureMsg.toString()); } else { successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); } return successMsg.toString(); } @Override public PageInfo<SysUser> getList(PageInfo<SysUser> pageInfo, GetSysUserList getSysUserList) { List<SysUser> list = this.baseMapper.getList(pageInfo, getSysUserList); for (SysUser sysUser : list) { List<SysUserRole> list1 = sysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, sysUser.getUserId())); List<String> roleNames = new ArrayList<>(); for (SysUserRole sysUserRole : list1) { SysRole sysRole = sysRoleService.selectRoleById(sysUserRole.getRoleId()); roleNames.add(sysRole.getRoleName()); } Long[] roleIds = new Long[]{}; sysUser.setRoleIds(list1.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()).toArray(roleIds)); sysUser.setRoleNames(roleNames); } return pageInfo.setRecords(list); } @Override public PageInfo<SysUser> getAllList(PageInfo<SysUser> pageInfo, List<Integer> collect) { return this.baseMapper.getAllList(pageInfo, collect); } @Override public List<Long> getSysUserFromPhone(String phoneNumber) { return this.baseMapper.getSysUserFromPhone(phoneNumber); } @Override public void deleteSysUser(ArrayList<Integer> userIds) { this.baseMapper.deleteSysUser(userIds); } @Override public PageInfo<SysUser> getChangeUserList(ChangeUserQuery query) { PageInfo<SysUser> pageInfo = new PageInfo<>(query.getPageCurr(), query.getPageSize()); List<SysUser> list = this.baseMapper.getChangeUserList(pageInfo, query); return pageInfo.setRecords(list); } } ruoyi-modules/ruoyi-system/src/main/resources/mapping/GenTableColumnMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/GenTableMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysConfigMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysDeptMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysDictDataMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysDictTypeMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysJobLogMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysJobMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysLoginLogMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysMenuMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysNoticeMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysOperLogMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysPostMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysRoleDeptMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysRoleMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysRoleMenuMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysUserMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysUserPostMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/SysUserRoleMapper.xml
File was deleted ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysConfigMapper.xml
New file @@ -0,0 +1,117 @@ <?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.system.mapper.SysConfigMapper"> <resultMap type="com.ruoyi.system.domain.SysConfig" id="SysConfigResult"> <id property="configId" column="config_id" /> <result property="configName" column="config_name" /> <result property="configKey" column="config_key" /> <result property="configValue" column="config_value" /> <result property="configType" column="config_type" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> </resultMap> <sql id="selectConfigVo"> select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config </sql> <!-- 查询条件 --> <sql id="sqlwhereSearch"> <where> <if test="configId !=null"> and config_id = #{configId} </if> <if test="configKey !=null and configKey != ''"> and config_key = #{configKey} </if> </where> </sql> <select id="selectConfig" parameterType="com.ruoyi.system.domain.SysConfig" resultMap="SysConfigResult"> <include refid="selectConfigVo"/> <include refid="sqlwhereSearch"/> </select> <select id="selectConfigList" parameterType="com.ruoyi.system.domain.SysConfig" resultMap="SysConfigResult"> <include refid="selectConfigVo"/> <where> <if test="configName != null and configName != ''"> AND config_name like concat('%', #{configName}, '%') </if> <if test="configType != null and configType != ''"> AND config_type = #{configType} </if> <if test="configKey != null and configKey != ''"> AND config_key like concat('%', #{configKey}, '%') </if> <if test="params.beginTime != null and params.beginTime != ''"> and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') </if> <if test="params.endTime != null and params.endTime != ''"> and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') </if> </where> </select> <select id="selectConfigById" parameterType="Long" resultMap="SysConfigResult"> <include refid="selectConfigVo"/> where config_id = #{configId} </select> <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult"> <include refid="selectConfigVo"/> where config_key = #{configKey} limit 1 </select> <insert id="insertConfig" parameterType="com.ruoyi.system.domain.SysConfig"> insert into sys_config ( <if test="configName != null and configName != '' ">config_name,</if> <if test="configKey != null and configKey != '' ">config_key,</if> <if test="configValue != null and configValue != '' ">config_value,</if> <if test="configType != null and configType != '' ">config_type,</if> <if test="createBy != null and createBy != ''">create_by,</if> <if test="remark != null and remark != ''">remark,</if> create_time )values( <if test="configName != null and configName != ''">#{configName},</if> <if test="configKey != null and configKey != ''">#{configKey},</if> <if test="configValue != null and configValue != ''">#{configValue},</if> <if test="configType != null and configType != ''">#{configType},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> <if test="remark != null and remark != ''">#{remark},</if> sysdate() ) </insert> <update id="updateConfig" parameterType="com.ruoyi.system.domain.SysConfig"> update sys_config <set> <if test="configName != null and configName != ''">config_name = #{configName},</if> <if test="configKey != null and configKey != ''">config_key = #{configKey},</if> <if test="configValue != null and configValue != ''">config_value = #{configValue},</if> <if test="configType != null and configType != ''">config_type = #{configType},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="remark != null">remark = #{remark},</if> update_time = sysdate() </set> where config_id = #{configId} </update> <delete id="deleteConfigById" parameterType="Long"> delete from sys_config where config_id = #{configId} </delete> <delete id="deleteConfigByIds" parameterType="Long"> delete from sys_config where config_id in <foreach item="configId" collection="array" open="(" separator="," close=")"> #{configId} </foreach> </delete> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysDeptMapper.xml
New file @@ -0,0 +1,157 @@ <?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.system.mapper.SysDeptMapper"> <resultMap type="com.ruoyi.system.api.domain.SysDept" id="SysDeptResult"> <id property="deptId" column="dept_id" /> <result property="parentId" column="parent_id" /> <result property="ancestors" column="ancestors" /> <result property="deptName" column="dept_name" /> <result property="orderNum" column="order_num" /> <result property="leader" column="leader" /> <result property="phone" column="phone" /> <result property="email" column="email" /> <result property="status" column="status" /> <result property="delFlag" column="del_flag" /> <result property="parentName" column="parent_name" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> </resultMap> <sql id="selectDeptVo"> select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time from sys_dept d </sql> <select id="selectDeptList" parameterType="com.ruoyi.system.api.domain.SysDept" resultMap="SysDeptResult"> <include refid="selectDeptVo"/> where d.del_flag = '0' <if test="deptId != null and deptId != 0"> AND dept_id = #{deptId} </if> <if test="parentId != null and parentId != 0"> AND parent_id = #{parentId} </if> <if test="deptName != null and deptName != ''"> AND dept_name like concat('%', #{deptName}, '%') </if> <if test="status != null and status != ''"> AND status = #{status} </if> <!-- 数据范围过滤 --> ${params.dataScope} order by d.parent_id, d.order_num </select> <select id="selectDeptListByRoleId" resultType="Long"> select d.dept_id from sys_dept d left join sys_role_dept rd on d.dept_id = rd.dept_id where rd.role_id = #{roleId} <if test="deptCheckStrictly"> and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId}) </if> order by d.parent_id, d.order_num </select> <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult"> <include refid="selectDeptVo"/> where dept_id = #{deptId} </select> <select id="checkDeptExistUser" parameterType="Long" resultType="int"> select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0' </select> <select id="hasChildByDeptId" parameterType="Long" resultType="int"> select count(1) from sys_dept where del_flag = '0' and parent_id = #{deptId} limit 1 </select> <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult"> select * from sys_dept where find_in_set(#{deptId}, ancestors) </select> <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int"> select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors) </select> <select id="checkDeptNameUnique" resultMap="SysDeptResult"> <include refid="selectDeptVo"/> where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 </select> <insert id="insertDept" parameterType="com.ruoyi.system.api.domain.SysDept"> insert into sys_dept( <if test="deptId != null and deptId != 0">dept_id,</if> <if test="parentId != null and parentId != 0">parent_id,</if> <if test="deptName != null and deptName != ''">dept_name,</if> <if test="ancestors != null and ancestors != ''">ancestors,</if> <if test="orderNum != null">order_num,</if> <if test="leader != null and leader != ''">leader,</if> <if test="phone != null and phone != ''">phone,</if> <if test="email != null and email != ''">email,</if> <if test="status != null">status,</if> <if test="createBy != null and createBy != ''">create_by,</if> create_time )values( <if test="deptId != null and deptId != 0">#{deptId},</if> <if test="parentId != null and parentId != 0">#{parentId},</if> <if test="deptName != null and deptName != ''">#{deptName},</if> <if test="ancestors != null and ancestors != ''">#{ancestors},</if> <if test="orderNum != null">#{orderNum},</if> <if test="leader != null and leader != ''">#{leader},</if> <if test="phone != null and phone != ''">#{phone},</if> <if test="email != null and email != ''">#{email},</if> <if test="status != null">#{status},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> sysdate() ) </insert> <update id="updateDept" parameterType="com.ruoyi.system.api.domain.SysDept"> update sys_dept <set> <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if> <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if> <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if> <if test="orderNum != null">order_num = #{orderNum},</if> <if test="leader != null">leader = #{leader},</if> <if test="phone != null">phone = #{phone},</if> <if test="email != null">email = #{email},</if> <if test="status != null and status != ''">status = #{status},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> update_time = sysdate() </set> where dept_id = #{deptId} </update> <update id="updateDeptChildren" parameterType="java.util.List"> update sys_dept set ancestors = <foreach collection="depts" item="item" index="index" separator=" " open="case dept_id" close="end"> when #{item.deptId} then #{item.ancestors} </foreach> where dept_id in <foreach collection="depts" item="item" index="index" separator="," open="(" close=")"> #{item.deptId} </foreach> </update> <update id="updateDeptStatusNormal" parameterType="Long"> update sys_dept set status = '0' where dept_id in <foreach collection="array" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </update> <delete id="deleteDeptById" parameterType="Long"> update sys_dept set del_flag = '2' where dept_id = #{deptId} </delete> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysDictDataMapper.xml
New file @@ -0,0 +1,124 @@ <?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.system.mapper.SysDictDataMapper"> <resultMap type="com.ruoyi.system.api.domain.SysDictData" id="SysDictDataResult"> <id property="dictCode" column="dict_code" /> <result property="dictSort" column="dict_sort" /> <result property="dictLabel" column="dict_label" /> <result property="dictValue" column="dict_value" /> <result property="dictType" column="dict_type" /> <result property="cssClass" column="css_class" /> <result property="listClass" column="list_class" /> <result property="isDefault" column="is_default" /> <result property="status" column="status" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> </resultMap> <sql id="selectDictDataVo"> select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark from sys_dict_data </sql> <select id="selectDictDataList" parameterType="com.ruoyi.system.api.domain.SysDictData" resultMap="SysDictDataResult"> <include refid="selectDictDataVo"/> <where> <if test="dictType != null and dictType != ''"> AND dict_type = #{dictType} </if> <if test="dictLabel != null and dictLabel != ''"> AND dict_label like concat('%', #{dictLabel}, '%') </if> <if test="status != null and status != ''"> AND status = #{status} </if> </where> order by dict_sort asc </select> <select id="selectDictDataByType" parameterType="com.ruoyi.system.api.domain.SysDictData" resultMap="SysDictDataResult"> <include refid="selectDictDataVo"/> where status = '0' and dict_type = #{dictType} order by dict_sort asc </select> <select id="selectDictLabel" resultType="String"> select dict_label from sys_dict_data where dict_type = #{dictType} and dict_value = #{dictValue} </select> <select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult"> <include refid="selectDictDataVo"/> where dict_code = #{dictCode} </select> <select id="countDictDataByType" resultType="Integer"> select count(1) from sys_dict_data where dict_type=#{dictType} </select> <delete id="deleteDictDataById" parameterType="Long"> delete from sys_dict_data where dict_code = #{dictCode} </delete> <delete id="deleteDictDataByIds" parameterType="Long"> delete from sys_dict_data where dict_code in <foreach collection="array" item="dictCode" open="(" separator="," close=")"> #{dictCode} </foreach> </delete> <update id="updateDictData" parameterType="com.ruoyi.system.api.domain.SysDictData"> update sys_dict_data <set> <if test="dictSort != null">dict_sort = #{dictSort},</if> <if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if> <if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if> <if test="dictType != null and dictType != ''">dict_type = #{dictType},</if> <if test="cssClass != null">css_class = #{cssClass},</if> <if test="listClass != null">list_class = #{listClass},</if> <if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if> <if test="status != null">status = #{status},</if> <if test="remark != null">remark = #{remark},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> update_time = sysdate() </set> where dict_code = #{dictCode} </update> <update id="updateDictDataType" parameterType="String"> update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} </update> <insert id="insertDictData" parameterType="com.ruoyi.system.api.domain.SysDictData"> insert into sys_dict_data( <if test="dictSort != null">dict_sort,</if> <if test="dictLabel != null and dictLabel != ''">dict_label,</if> <if test="dictValue != null and dictValue != ''">dict_value,</if> <if test="dictType != null and dictType != ''">dict_type,</if> <if test="cssClass != null and cssClass != ''">css_class,</if> <if test="listClass != null and listClass != ''">list_class,</if> <if test="isDefault != null and isDefault != ''">is_default,</if> <if test="status != null">status,</if> <if test="remark != null and remark != ''">remark,</if> <if test="createBy != null and createBy != ''">create_by,</if> create_time )values( <if test="dictSort != null">#{dictSort},</if> <if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if> <if test="dictValue != null and dictValue != ''">#{dictValue},</if> <if test="dictType != null and dictType != ''">#{dictType},</if> <if test="cssClass != null and cssClass != ''">#{cssClass},</if> <if test="listClass != null and listClass != ''">#{listClass},</if> <if test="isDefault != null and isDefault != ''">#{isDefault},</if> <if test="status != null">#{status},</if> <if test="remark != null and remark != ''">#{remark},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> sysdate() ) </insert> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysDictTypeMapper.xml
New file @@ -0,0 +1,105 @@ <?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.system.mapper.SysDictTypeMapper"> <resultMap type="com.ruoyi.system.api.domain.SysDictType" id="SysDictTypeResult"> <id property="dictId" column="dict_id" /> <result property="dictName" column="dict_name" /> <result property="dictType" column="dict_type" /> <result property="status" column="status" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> </resultMap> <sql id="selectDictTypeVo"> select dict_id, dict_name, dict_type, status, create_by, create_time, remark from sys_dict_type </sql> <select id="selectDictTypeList" parameterType="com.ruoyi.system.api.domain.SysDictType" resultMap="SysDictTypeResult"> <include refid="selectDictTypeVo"/> <where> <if test="dictName != null and dictName != ''"> AND dict_name like concat('%', #{dictName}, '%') </if> <if test="status != null and status != ''"> AND status = #{status} </if> <if test="dictType != null and dictType != ''"> AND dict_type like concat('%', #{dictType}, '%') </if> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') </if> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') </if> </where> </select> <select id="selectDictTypeAll" resultMap="SysDictTypeResult"> <include refid="selectDictTypeVo"/> </select> <select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult"> <include refid="selectDictTypeVo"/> where dict_id = #{dictId} </select> <select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult"> <include refid="selectDictTypeVo"/> where dict_type = #{dictType} </select> <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> <include refid="selectDictTypeVo"/> where dict_type = #{dictType} limit 1 </select> <delete id="deleteDictTypeById" parameterType="Long"> delete from sys_dict_type where dict_id = #{dictId} </delete> <delete id="deleteDictTypeByIds" parameterType="Long"> delete from sys_dict_type where dict_id in <foreach collection="array" item="dictId" open="(" separator="," close=")"> #{dictId} </foreach> </delete> <update id="updateDictType" parameterType="com.ruoyi.system.api.domain.SysDictType"> update sys_dict_type <set> <if test="dictName != null and dictName != ''">dict_name = #{dictName},</if> <if test="dictType != null and dictType != ''">dict_type = #{dictType},</if> <if test="status != null">status = #{status},</if> <if test="remark != null">remark = #{remark},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> update_time = sysdate() </set> where dict_id = #{dictId} </update> <insert id="insertDictType" parameterType="com.ruoyi.system.api.domain.SysDictType"> insert into sys_dict_type( <if test="dictName != null and dictName != ''">dict_name,</if> <if test="dictType != null and dictType != ''">dict_type,</if> <if test="status != null">status,</if> <if test="remark != null and remark != ''">remark,</if> <if test="createBy != null and createBy != ''">create_by,</if> create_time )values( <if test="dictName != null and dictName != ''">#{dictName},</if> <if test="dictType != null and dictType != ''">#{dictType},</if> <if test="status != null">#{status},</if> <if test="remark != null and remark != ''">#{remark},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> sysdate() ) </insert> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysLoginLogMapper.xml
New file @@ -0,0 +1,35 @@ <?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.system.mapper.SysLoginLogMapper"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.ruoyi.system.api.domain.SysLoginLog"> <id column="id" property="id" /> <result column="user_id" property="userId" /> <result column="user_name" property="username" /> <result column="ip_address" property="ipAddress"/> <result column="address" property="address"/> <result column="browser_type" property="browserType"/> <result column="operating_system" property="operatingSystem"/> <result column="login_time" property="loginTime"/> <result column="login_status" property="loginStatus"/> <result column="message" property="message"/> <result column="create_time" property="createTime"/> <result column="del_flag" property="delFlag"/> </resultMap> <select id="pageList" resultMap="BaseResultMap"> select a.*, b.user_name from sys_login_log a left join sys_user b on (a.user_id = b.user_id) where a.del_flag = 0 <if test="null != name and '' != name"> and b.user_name like CONCAT('%', #{name}, '%') </if> order by a.create_time desc </select> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysMenuMapper.xml
New file @@ -0,0 +1,275 @@ <?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.system.mapper.SysMenuMapper"> <resultMap type="com.ruoyi.system.domain.SysMenu" id="SysMenuResult"> <id property="menuId" column="menu_id" /> <result property="menuName" column="menu_name" /> <result property="parentName" column="parent_name" /> <result property="parentId" column="parent_id" /> <result property="orderNum" column="order_num" /> <result property="path" column="path" /> <result property="component" column="component" /> <result property="query" column="query" /> <result property="isFrame" column="is_frame" /> <result property="isCache" column="is_cache" /> <result property="menuType" column="menu_type" /> <result property="visible" column="visible" /> <result property="status" column="status" /> <result property="perms" column="perms" /> <result property="icon" column="icon" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateTime" column="update_time" /> <result property="updateBy" column="update_by" /> <result property="remark" column="remark" /> </resultMap> <sql id="selectMenuVo"> select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time from sys_menu </sql> <select id="selectMenuList" parameterType="com.ruoyi.system.domain.SysMenu" resultMap="SysMenuResult"> <include refid="selectMenuVo"/> <where> <if test="menuName != null and menuName != ''"> AND menu_name like concat('%', #{menuName}, '%') </if> <if test="visible != null and visible != ''"> AND visible = #{visible} </if> <if test="status != null and status != ''"> AND status = #{status} </if> </where> order by parent_id, order_num </select> <select id="selectMenuTreeAll" resultMap="SysMenuResult"> select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 order by m.parent_id, m.order_num </select> <select id="selectMenuListByUserId" parameterType="com.ruoyi.system.domain.SysMenu" resultMap="SysMenuResult"> select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time from sys_menu m left join sys_role_menu rm on m.menu_id = rm.menu_id left join sys_user_role ur on rm.role_id = ur.role_id left join sys_role ro on ur.role_id = ro.role_id where ur.user_id = #{params.userId} <if test="menuName != null and menuName != ''"> AND m.menu_name like concat('%', #{menuName}, '%') </if> <if test="visible != null and visible != ''"> AND m.visible = #{visible} </if> <if test="status != null and status != ''"> AND m.status = #{status} </if> order by m.parent_id, m.order_num </select> <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult"> select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time from sys_menu m left join sys_role_menu rm on m.menu_id = rm.menu_id left join sys_user_role ur on rm.role_id = ur.role_id left join sys_role ro on ur.role_id = ro.role_id left join sys_user u on ur.user_id = u.user_id where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 order by m.parent_id, m.order_num </select> <select id="selectMenuListByRoleId" resultType="Long"> select m.menu_id from sys_menu m left join sys_role_menu rm on m.menu_id = rm.menu_id where rm.role_id = #{roleId} <if test="menuCheckStrictly"> and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId}) </if> order by m.parent_id, m.order_num </select> <select id="selectMenuPerms" resultType="String"> select distinct m.path from sys_menu m left join sys_role_menu rm on m.menu_id = rm.menu_id left join sys_user_role ur on rm.role_id = ur.role_id </select> <select id="selectMenuPermsByUserId" parameterType="Long" resultType="String"> select distinct m.path from sys_menu m left join sys_role_menu rm on m.menu_id = rm.menu_id left join sys_user_role ur on rm.role_id = ur.role_id left join sys_role r on r.role_id = ur.role_id where m.status = '0' and r.status = '0' and ur.user_id = #{userId} </select> <select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String"> select distinct m.path from sys_menu m left join sys_role_menu rm on m.menu_id = rm.menu_id where m.status = '0' and rm.role_id = #{roleId} </select> <select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult"> <include refid="selectMenuVo"/> where menu_id = #{menuId} </select> <select id="hasChildByMenuId" resultType="Integer"> select count(1) from sys_menu where parent_id = #{menuId} </select> <select id="checkMenuNameUnique" parameterType="com.ruoyi.system.domain.SysMenu" resultMap="SysMenuResult"> <include refid="selectMenuVo"/> where menu_name=#{menuName} and parent_id = #{parentId} limit 1 </select> <select id="getAll" resultType="com.ruoyi.system.domain.SysMenus"> select menu_id menuId, menu_name menuName, parent_id parentId, order_num orderNum, path, component, query, is_frame isFram, is_cache isCache, menu_type menuType, visible, status, perms, icon, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime, remark from sys_menu order by create_time desc </select> <select id="getAllInIds" resultType="com.ruoyi.system.domain.SysMenus"> select menu_id menuId, menu_name menuName, parent_id parentId, order_num orderNum, path, component, query, is_frame isFram, is_cache isCache, menu_type menuType, visible, status, perms, icon, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime, remark from sys_menu where menu_id in <foreach collection="menusId" close=")" index="index" item="id" open="(" separator=","> #{id} </foreach> </select> <select id="getAllOne" resultType="com.ruoyi.system.domain.SysMenus"> select menu_id menuId, menu_name menuName, parent_id parentId, order_num orderNum, path, component, query, is_frame isFram, is_cache isCache, menu_type menuType, visible, status, perms, icon, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime, remark from sys_menu where menu_id !=1074 and menu_id !=1075 and menu_id !=1193 and menu_id !=1194 order by create_time desc </select> <update id="updateMenu" parameterType="com.ruoyi.system.domain.SysMenu"> update sys_menu <set> <if test="menuName != null and menuName != ''">menu_name = #{menuName},</if> <if test="parentId != null">parent_id = #{parentId},</if> <if test="orderNum != null">order_num = #{orderNum},</if> <if test="path != null and path != ''">path = #{path},</if> <if test="component != null">component = #{component},</if> <if test="query != null">`query` = #{query},</if> <if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if> <if test="isCache != null and isCache != ''">is_cache = #{isCache},</if> <if test="menuType != null and menuType != ''">menu_type = #{menuType},</if> <if test="visible != null">visible = #{visible},</if> <if test="status != null">status = #{status},</if> <if test="perms !=null">perms = #{perms},</if> <if test="icon !=null and icon != ''">icon = #{icon},</if> <if test="remark != null and remark != ''">remark = #{remark},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> update_time = sysdate() </set> where menu_id = #{menuId} </update> <insert id="insertMenu" parameterType="com.ruoyi.system.domain.SysMenu"> insert into sys_menu( <if test="menuId != null and menuId != 0">menu_id,</if> <if test="parentId != null and parentId != 0">parent_id,</if> <if test="menuName != null and menuName != ''">menu_name,</if> <if test="orderNum != null">order_num,</if> <if test="path != null and path != ''">path,</if> <if test="component != null and component != ''">component,</if> <if test="query != null and query != ''">`query`,</if> <if test="isFrame != null and isFrame != ''">is_frame,</if> <if test="isCache != null and isCache != ''">is_cache,</if> <if test="menuType != null and menuType != ''">menu_type,</if> <if test="visible != null">visible,</if> <if test="status != null">status,</if> <if test="perms !=null and perms != ''">perms,</if> <if test="icon != null and icon != ''">icon,</if> <if test="remark != null and remark != ''">remark,</if> <if test="createBy != null and createBy != ''">create_by,</if> create_time )values( <if test="menuId != null and menuId != 0">#{menuId},</if> <if test="parentId != null and parentId != 0">#{parentId},</if> <if test="menuName != null and menuName != ''">#{menuName},</if> <if test="orderNum != null">#{orderNum},</if> <if test="path != null and path != ''">#{path},</if> <if test="component != null and component != ''">#{component},</if> <if test="query != null and query != ''">#{query},</if> <if test="isFrame != null and isFrame != ''">#{isFrame},</if> <if test="isCache != null and isCache != ''">#{isCache},</if> <if test="menuType != null and menuType != ''">#{menuType},</if> <if test="visible != null">#{visible},</if> <if test="status != null">#{status},</if> <if test="perms !=null and perms != ''">#{perms},</if> <if test="icon != null and icon != ''">#{icon},</if> <if test="remark != null and remark != ''">#{remark},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> sysdate() ) </insert> <delete id="deleteMenuById" parameterType="Long"> delete from sys_menu where menu_id = #{menuId} </delete> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysNoticeMapper.xml
New file @@ -0,0 +1,89 @@ <?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.system.mapper.SysNoticeMapper"> <resultMap type="com.ruoyi.system.domain.SysNotice" id="SysNoticeResult"> <result property="noticeId" column="notice_id" /> <result property="noticeTitle" column="notice_title" /> <result property="noticeType" column="notice_type" /> <result property="noticeContent" column="notice_content" /> <result property="status" column="status" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> <result property="remark" column="remark" /> </resultMap> <sql id="selectNoticeVo"> select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark from sys_notice </sql> <select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult"> <include refid="selectNoticeVo"/> where notice_id = #{noticeId} </select> <select id="selectNoticeList" parameterType="com.ruoyi.system.domain.SysNotice" resultMap="SysNoticeResult"> <include refid="selectNoticeVo"/> <where> <if test="noticeTitle != null and noticeTitle != ''"> AND notice_title like concat('%', #{noticeTitle}, '%') </if> <if test="noticeType != null and noticeType != ''"> AND notice_type = #{noticeType} </if> <if test="createBy != null and createBy != ''"> AND create_by like concat('%', #{createBy}, '%') </if> </where> </select> <insert id="insertNotice" parameterType="com.ruoyi.system.domain.SysNotice"> insert into sys_notice ( <if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if> <if test="noticeType != null and noticeType != '' ">notice_type, </if> <if test="noticeContent != null and noticeContent != '' ">notice_content, </if> <if test="status != null and status != '' ">status, </if> <if test="remark != null and remark != ''">remark,</if> <if test="createBy != null and createBy != ''">create_by,</if> create_time )values( <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if> <if test="noticeType != null and noticeType != ''">#{noticeType}, </if> <if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if> <if test="status != null and status != ''">#{status}, </if> <if test="remark != null and remark != ''">#{remark},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> sysdate() ) </insert> <update id="updateNotice" parameterType="com.ruoyi.system.domain.SysNotice"> update sys_notice <set> <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if> <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if> <if test="noticeContent != null">notice_content = #{noticeContent}, </if> <if test="status != null and status != ''">status = #{status}, </if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> update_time = sysdate() </set> where notice_id = #{noticeId} </update> <delete id="deleteNoticeById" parameterType="Long"> delete from sys_notice where notice_id = #{noticeId} </delete> <delete id="deleteNoticeByIds" parameterType="Long"> delete from sys_notice where notice_id in <foreach item="noticeId" collection="array" open="(" separator="," close=")"> #{noticeId} </foreach> </delete> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysOperLogMapper.xml
New file @@ -0,0 +1,83 @@ <?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.system.mapper.SysOperLogMapper"> <resultMap type="com.ruoyi.system.api.domain.SysOperLog" id="SysOperLogResult"> <id property="operId" column="oper_id" /> <result property="title" column="title" /> <result property="businessType" column="business_type" /> <result property="method" column="method" /> <result property="requestMethod" column="request_method" /> <result property="operatorType" column="operator_type" /> <result property="operName" column="oper_name" /> <result property="deptName" column="dept_name" /> <result property="operUrl" column="oper_url" /> <result property="operIp" column="oper_ip" /> <result property="operParam" column="oper_param" /> <result property="jsonResult" column="json_result" /> <result property="status" column="status" /> <result property="errorMsg" column="error_msg" /> <result property="operTime" column="oper_time" /> <result property="costTime" column="cost_time" /> </resultMap> <sql id="selectOperLogVo"> select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, oper_time, cost_time from sys_oper_log </sql> <insert id="insertOperlog" parameterType="com.ruoyi.system.api.domain.SysOperLog"> insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, cost_time, oper_time) values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate()) </insert> <select id="selectOperLogList" parameterType="com.ruoyi.system.api.domain.SysOperLog" resultMap="SysOperLogResult"> <include refid="selectOperLogVo"/> <where> <if test="title != null and title != ''"> AND title like concat('%', #{title}, '%') </if> <if test="businessType != null"> AND business_type = #{businessType} </if> <if test="businessTypes != null and businessTypes.length > 0"> AND business_type in <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")"> #{businessType} </foreach> </if> <if test="status != null"> AND status = #{status} </if> <if test="operName != null and operName != ''"> AND oper_name like concat('%', #{operName}, '%') </if> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> AND oper_time >= #{params.beginTime} </if> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> AND oper_time <= #{params.endTime} </if> </where> order by oper_id desc </select> <delete id="deleteOperLogByIds" parameterType="Long"> delete from sys_oper_log where oper_id in <foreach collection="array" item="operId" open="(" separator="," close=")"> #{operId} </foreach> </delete> <select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult"> <include refid="selectOperLogVo"/> where oper_id = #{operId} </select> <update id="cleanOperLog"> truncate table sys_oper_log </update> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysPostMapper.xml
New file @@ -0,0 +1,122 @@ <?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.system.mapper.SysPostMapper"> <resultMap type="com.ruoyi.system.domain.SysPost" id="SysPostResult"> <id property="postId" column="post_id" /> <result property="postCode" column="post_code" /> <result property="postName" column="post_name" /> <result property="postSort" column="post_sort" /> <result property="status" column="status" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> <result property="remark" column="remark" /> </resultMap> <sql id="selectPostVo"> select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark from sys_post </sql> <select id="selectPostList" parameterType="com.ruoyi.system.domain.SysPost" resultMap="SysPostResult"> <include refid="selectPostVo"/> <where> <if test="postCode != null and postCode != ''"> AND post_code like concat('%', #{postCode}, '%') </if> <if test="status != null and status != ''"> AND status = #{status} </if> <if test="postName != null and postName != ''"> AND post_name like concat('%', #{postName}, '%') </if> </where> </select> <select id="selectPostAll" resultMap="SysPostResult"> <include refid="selectPostVo"/> </select> <select id="selectPostById" parameterType="Long" resultMap="SysPostResult"> <include refid="selectPostVo"/> where post_id = #{postId} </select> <select id="selectPostListByUserId" parameterType="Long" resultType="Long"> select p.post_id from sys_post p left join sys_user_post up on up.post_id = p.post_id left join sys_user u on u.user_id = up.user_id where u.user_id = #{userId} </select> <select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult"> select p.post_id, p.post_name, p.post_code from sys_post p left join sys_user_post up on up.post_id = p.post_id left join sys_user u on u.user_id = up.user_id where u.user_name = #{userName} </select> <select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult"> <include refid="selectPostVo"/> where post_name=#{postName} limit 1 </select> <select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult"> <include refid="selectPostVo"/> where post_code=#{postCode} limit 1 </select> <update id="updatePost" parameterType="com.ruoyi.system.domain.SysPost"> update sys_post <set> <if test="postCode != null and postCode != ''">post_code = #{postCode},</if> <if test="postName != null and postName != ''">post_name = #{postName},</if> <if test="postSort != null">post_sort = #{postSort},</if> <if test="status != null and status != ''">status = #{status},</if> <if test="remark != null">remark = #{remark},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> update_time = sysdate() </set> where post_id = #{postId} </update> <insert id="insertPost" parameterType="com.ruoyi.system.domain.SysPost" useGeneratedKeys="true" keyProperty="postId"> insert into sys_post( <if test="postId != null and postId != 0">post_id,</if> <if test="postCode != null and postCode != ''">post_code,</if> <if test="postName != null and postName != ''">post_name,</if> <if test="postSort != null">post_sort,</if> <if test="status != null and status != ''">status,</if> <if test="remark != null and remark != ''">remark,</if> <if test="createBy != null and createBy != ''">create_by,</if> create_time )values( <if test="postId != null and postId != 0">#{postId},</if> <if test="postCode != null and postCode != ''">#{postCode},</if> <if test="postName != null and postName != ''">#{postName},</if> <if test="postSort != null">#{postSort},</if> <if test="status != null and status != ''">#{status},</if> <if test="remark != null and remark != ''">#{remark},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> sysdate() ) </insert> <delete id="deletePostById" parameterType="Long"> delete from sys_post where post_id = #{postId} </delete> <delete id="deletePostByIds" parameterType="Long"> delete from sys_post where post_id in <foreach collection="array" item="postId" open="(" separator="," close=")"> #{postId} </foreach> </delete> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysRoleDeptMapper.xml
New file @@ -0,0 +1,34 @@ <?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.system.mapper.SysRoleDeptMapper"> <resultMap type="com.ruoyi.system.domain.SysRoleDept" id="SysRoleDeptResult"> <result property="roleId" column="role_id" /> <result property="deptId" column="dept_id" /> </resultMap> <delete id="deleteRoleDeptByRoleId" parameterType="Long"> delete from sys_role_dept where role_id=#{roleId} </delete> <select id="selectCountRoleDeptByDeptId" resultType="Integer"> select count(1) from sys_role_dept where dept_id=#{deptId} </select> <delete id="deleteRoleDept" parameterType="Long"> delete from sys_role_dept where role_id in <foreach collection="array" item="roleId" open="(" separator="," close=")"> #{roleId} </foreach> </delete> <insert id="batchRoleDept"> insert into sys_role_dept(role_id, dept_id) values <foreach item="item" index="index" collection="list" separator=","> (#{item.roleId},#{item.deptId}) </foreach> </insert> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysRoleMapper.xml
New file @@ -0,0 +1,153 @@ <?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.system.mapper.SysRoleMapper"> <resultMap type="com.ruoyi.system.api.domain.SysRole" id="SysRoleResult"> <id property="roleId" column="role_id" /> <result property="roleName" column="role_name" /> <result property="roleKey" column="role_key" /> <result property="dataScope" column="data_scope" /> <result property="status" column="status" /> <result property="delFlag" column="del_flag" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> <result property="remark" column="remark" /> </resultMap> <sql id="selectRoleVo"> select distinct r.role_id, r.role_name, r.role_key, r.data_scope, r.status, r.del_flag, r.create_time, r.remark from sys_role r left join sys_user_role ur on ur.role_id = r.role_id left join sys_user u on u.user_id = ur.user_id left join sys_dept d on u.dept_id = d.dept_id </sql> <select id="selectRoleList" parameterType="com.ruoyi.system.api.domain.SysRole" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> where r.del_flag = '0' <if test="roleId != null and roleId != 0"> AND r.role_id = #{roleId} </if> <if test="roleName != null and roleName != ''"> AND r.role_name like concat('%', #{roleName}, '%') </if> <if test="status != null and status != ''"> AND r.status = #{status} </if> <if test="roleKey != null and roleKey != ''"> AND r.role_key like concat('%', #{roleKey}, '%') </if> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') </if> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') </if> <!-- 数据范围过滤 --> ${params.dataScope} </select> <select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> WHERE r.del_flag = '0' and ur.user_id = #{userId} </select> <select id="selectRoleAll" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> </select> <select id="selectRoleListByUserId" parameterType="Long" resultType="Long"> select r.role_id from sys_role r left join sys_user_role ur on ur.role_id = r.role_id left join sys_user u on u.user_id = ur.user_id where u.user_id = #{userId} </select> <select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> where r.role_id = #{roleId} </select> <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> WHERE r.del_flag = '0' and u.user_name = #{userName} </select> <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> where r.role_name=#{roleName} and r.del_flag = '0' limit 1 </select> <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 </select> <select id="isExitUpdate" resultType="com.ruoyi.system.api.domain.SysRole"> select role_name romeName from sys_role where role_name=#{roleName} and role_id != #{roleId} </select> <insert id="insertRole" parameterType="com.ruoyi.system.api.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId"> insert into sys_role( <if test="roleId != null and roleId != 0">role_id,</if> <if test="roleName != null and roleName != ''">role_name,</if> <if test="roleKey != null and roleKey != ''">role_key,</if> <if test="dataScope != null and dataScope != ''">data_scope,</if> <if test="status != null and status != ''">status,</if> <if test="remark != null and remark != ''">remark,</if> <if test="createBy != null and createBy != ''">create_by,</if> create_time )values( <if test="roleId != null and roleId != 0">#{roleId},</if> <if test="roleName != null and roleName != ''">#{roleName},</if> <if test="roleKey != null and roleKey != ''">#{roleKey},</if> <if test="dataScope != null and dataScope != ''">#{dataScope},</if> <if test="status != null and status != ''">#{status},</if> <if test="remark != null and remark != ''">#{remark},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> sysdate() ) </insert> <update id="updateRole" parameterType="com.ruoyi.system.api.domain.SysRole"> update sys_role <set> <if test="roleName != null and roleName != ''">role_name = #{roleName},</if> <if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if> <if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if> <if test="status != null and status != ''">status = #{status},</if> <if test="remark != null">remark = #{remark},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> update_time = sysdate() </set> where role_id = #{roleId} </update> <delete id="deleteRoleById" parameterType="Long"> update sys_role set del_flag = '2' where role_id = #{roleId} </delete> <delete id="deleteRoleByIds" parameterType="Long"> update sys_role set del_flag = '2' where role_id in <foreach collection="array" item="roleId" open="(" separator="," close=")"> #{roleId} </foreach> </delete> <select id="getSysRoleByIds" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> <if test="null != ids and ids.size() > 0"> where r.role_id in <foreach collection="ids" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </if> </select> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysRoleMenuMapper.xml
New file @@ -0,0 +1,34 @@ <?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.system.mapper.SysRoleMenuMapper"> <resultMap type="com.ruoyi.system.domain.SysRoleMenu" id="SysRoleMenuResult"> <result property="roleId" column="role_id" /> <result property="menuId" column="menu_id" /> </resultMap> <select id="checkMenuExistRole" resultType="Integer"> select count(1) from sys_role_menu where menu_id = #{menuId} </select> <delete id="deleteRoleMenuByRoleId" parameterType="Long"> delete from sys_role_menu where role_id=#{roleId} </delete> <delete id="deleteRoleMenu" parameterType="Long"> delete from sys_role_menu where role_id in <foreach collection="array" item="roleId" open="(" separator="," close=")"> #{roleId} </foreach> </delete> <insert id="batchRoleMenu"> insert into sys_role_menu(role_id, menu_id) values <foreach item="item" index="index" collection="list" separator=","> (#{item.roleId},#{item.menuId}) </foreach> </insert> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml
New file @@ -0,0 +1,264 @@ <?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.system.mapper.SysUserMapper"> <resultMap type="com.ruoyi.system.api.domain.SysUser" id="SysUserResult"> <id property="userId" column="user_id" /> <result property="deptId" column="dept_id" /> <result property="userName" column="user_name" /> <result property="nickName" column="nick_name" /> <result property="email" column="email" /> <result property="phonenumber" column="phonenumber" /> <result property="sex" column="sex" /> <result property="avatar" column="avatar" /> <result property="password" column="password" /> <result property="status" column="status" /> <result property="delFlag" column="del_flag" /> <result property="loginIp" column="login_ip" /> <result property="loginDate" column="login_date" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> <result property="forbiddenRemark" column="forbidden_remark"/> <result property="remark" column="remark" /> <result property="roleType" column="roleType" /> <result property="objectId" column="objectId" /> <association property="dept" column="dept_id" javaType="com.ruoyi.system.api.domain.SysDept" resultMap="deptResult" /> <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> </resultMap> <resultMap id="deptResult" type="com.ruoyi.system.api.domain.SysDept"> <id property="deptId" column="dept_id" /> <result property="parentId" column="parent_id" /> <result property="deptName" column="dept_name" /> <result property="ancestors" column="ancestors" /> <result property="orderNum" column="order_num" /> <result property="leader" column="leader" /> <result property="status" column="dept_status" /> </resultMap> <resultMap id="RoleResult" type="com.ruoyi.system.api.domain.SysRole"> <id property="roleId" column="role_id" /> <result property="roleName" column="role_name" /> <result property="roleKey" column="role_key" /> <result property="dataScope" column="data_scope" /> <result property="status" column="role_status" /> </resultMap> <sql id="selectUserVo"> select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.data_scope, r.status as role_status ,u.roleType as roleType,u.objectId AS objectId from sys_user u left join sys_dept d on u.dept_id = d.dept_id left join sys_user_role ur on u.user_id = ur.user_id left join sys_role r on r.role_id = ur.role_id </sql> <select id="selectUserList" parameterType="com.ruoyi.system.api.domain.SysUser" resultMap="SysUserResult"> select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u left join sys_dept d on u.dept_id = d.dept_id where u.del_flag = '0' <if test="phonenumber != null and phonenumber != ''"> AND u.phonenumber like concat('%', #{phonenumber}, '%') </if> </select> <select id="selectAllocatedList" parameterType="com.ruoyi.system.api.domain.SysUser" resultMap="SysUserResult"> select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time from sys_user u left join sys_dept d on u.dept_id = d.dept_id left join sys_user_role ur on u.user_id = ur.user_id left join sys_role r on r.role_id = ur.role_id where u.del_flag = '0' and r.role_id = #{roleId} <if test="userName != null and userName != ''"> AND u.user_name like concat('%', #{userName}, '%') </if> <if test="phonenumber != null and phonenumber != ''"> AND u.phonenumber like concat('%', #{phonenumber}, '%') </if> <!-- 数据范围过滤 --> ${params.dataScope} </select> <select id="selectUnallocatedList" parameterType="com.ruoyi.system.api.domain.SysUser" resultMap="SysUserResult"> select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time from sys_user u left join sys_dept d on u.dept_id = d.dept_id left join sys_user_role ur on u.user_id = ur.user_id left join sys_role r on r.role_id = ur.role_id where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL) and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId}) <if test="userName != null and userName != ''"> AND u.user_name like concat('%', #{userName}, '%') </if> <if test="phonenumber != null and phonenumber != ''"> AND u.phonenumber like concat('%', #{phonenumber}, '%') </if> <!-- 数据范围过滤 --> ${params.dataScope} </select> <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> <include refid="selectUserVo"/> where u.user_name = #{userName} and u.del_flag = '0' </select> <select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> <include refid="selectUserVo"/> where u.user_id = #{userId} </select> <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1 </select> <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1 </select> <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 </select> <select id="getList" resultMap="SysUserResult"> select * from sys_user where 1=1 <if test="req.search !=null and req.search !=''"> and (phonenumber like concat("%", #{req.search},"%") or nick_name like concat("%", #{req.search},"%")) </if> <if test="null != req.siteId"> and user_id in (select user_id from t_user_site where site_id = #{req.siteId}) and user_id in (select user_id from sys_user_role where role_id in (select role_id from t_role_site where site_id = #{req.siteId})) </if> <if test="null != req.roleIds and req.roleIds.size() > 0"> and user_id in (select user_id from sys_user_role where role_id in <foreach collection="req.roleIds" item="item" index="index" open="(" separator="," close=")"> #{item} </foreach> ) </if> <if test="null != req.status"> and status = #{req.status} </if> and del_flag = '0' and roleType =1 order by create_time desc </select> <select id="getAllList" resultType="com.ruoyi.system.api.domain.SysUser"> select *,user_id userId,nick_name userName ,create_time createTime ,login_date loginDate from sys_user where roleType=3 and user_id in <foreach collection="ids" separator="," open="(" item="id" index="index" close=")" > #{id} </foreach> order by create_time desc </select> <select id="getSysUserFromPhone" resultType="java.lang.Long"> select user_id from sys_user where phonenumber =#{phoneNumber} </select> <select id="getChangeUserList" resultType="com.ruoyi.system.api.domain.SysUser"> select user_id AS userId, nick_name AS nickName, user_name AS userName, create_time AS createTime, remark AS remark from sys_user <where> <if test="query.nickName != null and query.nickName != ''"> AND nick_name LIKE concat('%',#{query.nickName},'%') </if> AND del_flag = '0' AND roleType = 1 </where> ORDER BY create_time DESC </select> <insert id="insertUser" parameterType="com.ruoyi.system.api.domain.SysUser" useGeneratedKeys="true" keyProperty="userId"> insert into sys_user( <if test="userId != null and userId != 0">user_id,</if> <if test="deptId != null and deptId != 0">dept_id,</if> <if test="userName != null and userName != ''">user_name,</if> <if test="nickName != null and nickName != ''">nick_name,</if> <if test="email != null and email != ''">email,</if> <if test="avatar != null and avatar != ''">avatar,</if> <if test="phonenumber != null and phonenumber != ''">phonenumber,</if> <if test="sex != null and sex != ''">sex,</if> <if test="password != null and password != ''">password,</if> <if test="status != null and status != ''">status,</if> <if test="createBy != null and createBy != ''">create_by,</if> <if test="roleType != null and roleType != ''">roleType,</if> <if test="remark != null and remark != ''">remark,</if> <if test="objectId != null and objectId != ''">objectId,</if> create_time )values( <if test="userId != null and userId != ''">#{userId},</if> <if test="deptId != null and deptId != ''">#{deptId},</if> <if test="userName != null and userName != ''">#{userName},</if> <if test="nickName != null and nickName != ''">#{nickName},</if> <if test="email != null and email != ''">#{email},</if> <if test="avatar != null and avatar != ''">#{avatar},</if> <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if> <if test="sex != null and sex != ''">#{sex},</if> <if test="password != null and password != ''">#{password},</if> <if test="status != null and status != ''">#{status},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> <if test="roleType != null and roleType != ''">#{roleType},</if> <if test="remark != null and remark != ''">#{remark},</if> <if test="objectId != null and objectId != ''">#{objectId},</if> sysdate() ) </insert> <update id="updateUser" parameterType="com.ruoyi.system.api.domain.SysUser"> update sys_user <set> <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if> <if test="userName != null and userName != ''">user_name = #{userName},</if> <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> <if test="email != null ">email = #{email},</if> <if test="phonenumber != null ">phonenumber = #{phonenumber},</if> <if test="sex != null and sex != ''">sex = #{sex},</if> <if test="avatar != null and avatar != ''">avatar = #{avatar},</if> <if test="password != null and password != ''">password = #{password},</if> <if test="status != null and status != ''">status = #{status},</if> <if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if> <if test="loginDate != null">login_date = #{loginDate},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="remark != null">remark = #{remark},</if> <if test="forbiddenRemark != null">forbidden_remark = #{forbiddenRemark},</if> update_time = sysdate() </set> where user_id = #{userId} </update> <update id="updateUserStatus" parameterType="com.ruoyi.system.api.domain.SysUser"> update sys_user set status = #{status} where user_id = #{userId} </update> <update id="updateUserAvatar" parameterType="com.ruoyi.system.api.domain.SysUser"> update sys_user set avatar = #{avatar} where user_name = #{userName} </update> <update id="resetUserPwd" parameterType="com.ruoyi.system.api.domain.SysUser"> update sys_user set password = #{password} where user_name = #{userName} </update> <delete id="deleteUserById" parameterType="Long"> update sys_user set del_flag = '2' where user_id = #{userId} </delete> <delete id="deleteUserByIds" parameterType="Long"> update sys_user set del_flag = '2' where user_id in <foreach collection="array" item="userId" open="(" separator="," close=")"> #{userId} </foreach> </delete> <delete id="deleteSysUser"> delete from sys_user where user_id in <foreach collection="userIds" separator="," open="(" item="id" close=")" > #{id} </foreach> </delete> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserPostMapper.xml
New file @@ -0,0 +1,34 @@ <?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.system.mapper.SysUserPostMapper"> <resultMap type="com.ruoyi.system.domain.SysUserPost" id="SysUserPostResult"> <result property="userId" column="user_id" /> <result property="postId" column="post_id" /> </resultMap> <delete id="deleteUserPostByUserId" parameterType="Long"> delete from sys_user_post where user_id=#{userId} </delete> <select id="countUserPostById" resultType="Integer"> select count(1) from sys_user_post where post_id=#{postId} </select> <delete id="deleteUserPost" parameterType="Long"> delete from sys_user_post where user_id in <foreach collection="array" item="userId" open="(" separator="," close=")"> #{userId} </foreach> </delete> <insert id="batchUserPost"> insert into sys_user_post(user_id, post_id) values <foreach item="item" index="index" collection="list" separator=","> (#{item.userId},#{item.postId}) </foreach> </insert> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserRoleMapper.xml
New file @@ -0,0 +1,90 @@ <?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.system.mapper.SysUserRoleMapper"> <resultMap type="com.ruoyi.system.domain.SysUserRole" id="SysUserRoleResult"> <result property="userId" column="user_id" /> <result property="roleId" column="role_id" /> </resultMap> <sql id="selectSysUserRoleVo"> select user_id, role_id from sys_user_role </sql> <delete id="deleteUserRoleByUserId" parameterType="Long"> delete from sys_user_role where user_id=#{userId} </delete> <select id="countUserRoleByRoleId" resultType="Integer"> select count(1) from sys_user_role where role_id=#{roleId} </select> <delete id="deleteUserRole" parameterType="Long"> delete from sys_user_role where user_id in <foreach collection="array" item="userId" open="(" separator="," close=")"> #{userId} </foreach> </delete> <insert id="batchUserRole"> insert into sys_user_role(user_id, role_id) values <foreach item="item" index="index" collection="list" separator=","> (#{item.userId},#{item.roleId}) </foreach> </insert> <delete id="deleteUserRoleInfo" parameterType="com.ruoyi.system.domain.SysUserRole"> delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} </delete> <delete id="deleteUserRoleInfos"> delete from sys_user_role where role_id=#{roleId} and user_id in <foreach collection="userIds" item="userId" open="(" separator="," close=")"> #{userId} </foreach> </delete> <select id="selectSysUserRoleList" parameterType="com.ruoyi.system.domain.SysUserRole" resultMap="SysUserRoleResult"> <include refid="selectSysUserRoleVo"/> <where> </where> </select> <select id="selectSysUserRoleByUserId" parameterType="Long" resultMap="SysUserRoleResult"> <include refid="selectSysUserRoleVo"/> where user_id = #{userId} </select> <insert id="insertSysUserRole" parameterType="com.ruoyi.system.domain.SysUserRole"> insert into sys_user_role <trim prefix="(" suffix=")" suffixOverrides=","> <if test="userId != null">user_id,</if> <if test="roleId != null">role_id,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="userId != null">#{userId},</if> <if test="roleId != null">#{roleId},</if> </trim> </insert> <update id="updateSysUserRole" parameterType="com.ruoyi.system.domain.SysUserRole"> update sys_user_role <trim prefix="SET" suffixOverrides=","> <if test="roleId != null">role_id = #{roleId},</if> </trim> where user_id = #{userId} </update> <delete id="deleteSysUserRoleByUserId" parameterType="Long"> delete from sys_user_role where user_id = #{userId} </delete> <delete id="deleteSysUserRoleByUserIds" parameterType="String"> delete from sys_user_role where user_id in <foreach item="userId" collection="array" open="(" separator="," close=")"> #{userId} </foreach> </delete> </mapper> ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/WithdrawalAuditStatus.java
New file @@ -0,0 +1,16 @@ package com.ruoyi.account; import lombok.Getter; @Getter public enum WithdrawalAuditStatus { WAIT_AUDIT(1, "待审核"), AUDIT_SUCCESS(2, "审核通过"), AUDIT_FAIL(3, "审核拒绝"); private final Integer code; private final String desc; WithdrawalAuditStatus(Integer code, String desc) { this.code = code; this.desc = desc; } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserBankController.java
New file @@ -0,0 +1,37 @@ package com.ruoyi.account.controller; import com.ruoyi.account.api.model.AppUserBank; import com.ruoyi.common.core.web.domain.AjaxResult; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; /** * @author zhibing.pu * @Date 2024/11/25 15:07 */ @Api(tags = {"个人中心-我的银行卡-小程序"}) @RestController @RequestMapping("/appUserBank") public class AppUserBankController { @ResponseBody @PostMapping("/saveAppUserBank") @ApiOperation(value = "保存银行卡") public AjaxResult saveAppUserBank(@RequestBody AppUserBank appUserBank){ return AjaxResult.success(); } @ResponseBody @GetMapping("/getAppUserBank") @ApiOperation(value = "获取银行卡信息") public AjaxResult<AppUserBank> getAppUserBank(){ return AjaxResult.success(); } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -20,13 +20,18 @@ import javax.annotation.Resource; import java.util.List; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.account.service.AppUserService; import com.ruoyi.account.vo.*; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.BaseTable; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; /** * <p> @@ -36,6 +41,7 @@ * @author luodangjia * @since 2024-11-21 */ @Api(tags = {"登录注册-小程序"}) @RestController @RequestMapping("/app-user") public class AppUserController { @@ -53,61 +59,59 @@ @ResponseBody @PostMapping("/appletLogin") @ApiOperation(value = "小程序一键登录", tags = {"登录注册-小程序"}) @ApiOperation(value = "小程序一键登录") public AjaxResult<LoginVo> appletLogin(@RequestBody AppletLogin appletLogin){ // todo 待完善 pu return AjaxResult.success(); return appUserService.appletLogin(appletLogin); } @ResponseBody @PostMapping("/mobileLogin") @ApiOperation(value = "手机号登录", tags = {"登录注册-小程序"}) @ApiOperation(value = "手机号登录") public AjaxResult<LoginVo> mobileLogin(@RequestBody MobileLogin mobileLogin){ // todo 待完善 pu return AjaxResult.success(); return appUserService.mobileLogin(mobileLogin); } @ResponseBody @PostMapping("/getSMSCode") @ApiOperation(value = "获取短信验证码", tags = {"登录注册-小程序"}) @ApiOperation(value = "获取短信验证码") public AjaxResult getSMSCode(@RequestBody SMSCode smsCode){ // todo 待完善 pu return AjaxResult.success(); return appUserService.getSMSCode(smsCode); } @ResponseBody @PostMapping("/registerAccount") @ApiOperation(value = "注册新账号", tags = {"登录注册-小程序"}) @ApiOperation(value = "注册新账号") public AjaxResult<LoginVo> registerAccount(@RequestBody RegisterAccount registerAccount){ // todo 待完善 pu return AjaxResult.success(); return appUserService.registerAccount(registerAccount); } @ResponseBody @GetMapping("/getReferrer/{id}") @ApiOperation(value = "获取推荐人信息", tags = {"登录注册-小程序"}) @ApiOperation(value = "获取推荐人信息") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "推荐人id", required = true, dataType = "long") }) public AjaxResult<String> getReferrer(@PathVariable("id") Long id){ // todo 待完善 pu return AjaxResult.success(); AppUser appUser = appUserService.getById(id); String phone = appUser.getPhone(); phone = phone.substring(0, 3) + "****" + phone.substring(7); return AjaxResult.success(appUser.getName() + "-" + phone); } @ResponseBody @GetMapping("/getNearbyReferrer") @ApiOperation(value = "获取附近推荐人列表", tags = {"登录注册-小程序"}) @ApiOperation(value = "获取附近推荐人列表") public AjaxResult<BaseTable<NearbyReferrerVo>> getNearbyReferrer(NearbyReferrer nearbyReferrer){ // todo 待完善 pu return AjaxResult.success(); BaseTable<NearbyReferrerVo> baseTable = appUserService.getNearbyReferrer(nearbyReferrer); return AjaxResult.success(baseTable); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
@@ -1,6 +1,7 @@ package com.ruoyi.account.controller; import com.ruoyi.common.core.web.domain.AjaxResult; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -16,5 +17,9 @@ @RequestMapping("/user-coupon") public class UserCouponController { } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java
@@ -1,8 +1,23 @@ package com.ruoyi.account.controller; import com.ruoyi.account.service.UserPointService; import com.ruoyi.account.vo.UserPointDetailVO; import com.ruoyi.account.vo.UserPointVO; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; 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.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDateTime; /** * <p> @@ -14,7 +29,40 @@ */ @RestController @RequestMapping("/user-point") public class UserPointController { @Api("用户积分") public class UserPointController extends BaseController { @Resource private UserPointService userPointService; /** * 获取个人积分 */ @GetMapping("/getUserPoint") @ApiOperation("获取个人积分") public R<UserPointVO> getUserPoint(){ return R.ok(userPointService.getUserPoint(SecurityUtils.getUserId())); } /** * 获取变更明细 */ @GetMapping("/getUserPointDetail") @ApiOperation("获取变更明细") public R<UserPointDetailVO> getUserPointDetail(@ApiParam("指定日期") LocalDateTime date, @ApiParam("变动类型(1=消费积分,2=返佣积分,3=拉新人积分,4=兑换商品 " + "5 = 门店业绩积分 6 =门店返佣积分7=技师业绩积分8 =转赠积分 9 =做工积分 " + "10 =注册积分)") Integer type){ return R.ok(); } /** * 转赠积分 */ @PostMapping("/transferPoint") @ApiOperation("转赠积分") public R<Void> transferPoint(@ApiParam("积分") BigDecimal point, @ApiParam("手机号") Long phone){ return R.ok(); } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java
@@ -3,10 +3,13 @@ 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.service.WalletService; import com.ruoyi.account.vo.WalletVO; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.model.LoginUser; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.GetMapping; @@ -14,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.List; @Api("钱包") @RestController @@ -21,17 +25,20 @@ public class WalletController extends BaseController { @Resource private BalanceChangeRecordService balanceChangeRecordService; @Resource private TokenService tokenService; @Resource private WalletService walletService; /** * 钱包详情 */ @GetMapping("detail") @ApiOperation(value = "钱包详情", notes = "钱包详情", tags = {"小程序-个人中心-我的钱包-钱包详情"}) public AjaxResult detail() { Long userId = SecurityUtils.getUserId(); // TODO 查询钱包详情 WalletVO walletVO = new WalletVO(); return AjaxResult.success(walletVO); public R<WalletVO> detail() { LoginUser loginUserApplet = tokenService.getLoginUserApplet(); WalletVO walletVO = walletService.getWalletByUserId(loginUserApplet.getUserid()); return R.ok(walletVO); } /** @@ -39,9 +46,9 @@ */ @ApiOperation(value = "变更明细", notes = "变更明细", tags = {"小程序-个人中心-我的钱包-变更记录"}) @GetMapping("change") public AjaxResult change() { public R<List<BalanceChangeRecord>> change() { Long userId = SecurityUtils.getUserId(); return AjaxResult.success(balanceChangeRecordService.list(new LambdaQueryWrapper<BalanceChangeRecord>() return R.ok(balanceChangeRecordService.list(new LambdaQueryWrapper<BalanceChangeRecord>() .eq(BalanceChangeRecord::getAppUserId, userId))); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/filter/AuthFilter.java
@@ -2,9 +2,12 @@ import com.alibaba.fastjson.JSON; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.account.service.AppUserService; import com.ruoyi.common.core.constant.TokenConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.feignClient.SysUserClient; import org.apache.logging.log4j.core.config.Order; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,7 +35,7 @@ @Lazy @Resource private IAppUserService appUserService; private AppUserService appUserService; @Lazy @Resource @@ -71,7 +74,7 @@ //小程序用户 if ("applet".equals(userType)) { AppUser appUser = appUserService.getById(userid); if(null == appUser || appUser.getDelFlag() == 1 || 3 == appUser.getStatus()){ if(null == appUser || appUser.getDelFlag() || 3 == appUser.getStatus()){ log.error("[账户异常处理]请求账户id:{}", userid); unauthorizedResponse(response,"无效的账户"); return; ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/AppUserMapper.java
@@ -2,6 +2,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.account.vo.NearbyReferrer; import com.ruoyi.account.vo.NearbyReferrerVo; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> @@ -12,5 +17,15 @@ * @since 2024-11-21 */ public interface AppUserMapper extends BaseMapper<AppUser> { /** * 获取附件推广人 * @param cityCode * @return */ List<NearbyReferrerVo> getNearbyReferrer(@Param("cityCode") String cityCode, @Param("nearbyReferrer") NearbyReferrer nearbyReferrer); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/AppUserService.java
@@ -2,6 +2,10 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.account.vo.*; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.BaseTable; import org.springframework.web.bind.annotation.RequestBody; /** * <p> @@ -12,5 +16,44 @@ * @since 2024-11-21 */ public interface AppUserService extends IService<AppUser> { /** * 小程序一键登录 * @param appletLogin * @return */ AjaxResult appletLogin(AppletLogin appletLogin); /** * 手机号码登录 * @param mobileLogin * @return */ AjaxResult<LoginVo> mobileLogin(MobileLogin mobileLogin); /** * 获取短信验证码 * @param smsCode * @return */ AjaxResult getSMSCode(SMSCode smsCode); /** * 注册账号 * @param registerAccount * @return */ AjaxResult<LoginVo> registerAccount(RegisterAccount registerAccount); /** * 获取附近的推广人 * @param nearbyReferrer * @return */ BaseTable<NearbyReferrerVo> getNearbyReferrer(NearbyReferrer nearbyReferrer); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/UserPointService.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.account.api.model.UserPoint; import com.ruoyi.account.vo.UserPointVO; /** * <p> @@ -13,4 +14,5 @@ */ public interface UserPointService extends IService<UserPoint> { UserPointVO getUserPoint(Long userId); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/WalletService.java
New file @@ -0,0 +1,8 @@ package com.ruoyi.account.service; import com.ruoyi.account.vo.WalletVO; public interface WalletService { WalletVO getWalletByUserId(Long userId); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java
@@ -1,10 +1,25 @@ package com.ruoyi.account.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.AppUserMapper; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.account.service.AppUserService; import com.ruoyi.account.util.weChat.WeChatUtil; import com.ruoyi.account.vo.*; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.BaseTable; import com.ruoyi.common.redis.service.RedisService; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.system.api.model.LoginUser; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; /** * <p> @@ -16,5 +31,256 @@ */ @Service public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> implements AppUserService { @Resource private WeChatUtil weChatUtil; @Resource private TokenService tokenService; @Resource private RedisService redisService; /** * 小程序一键登录 * @param appletLogin * @return */ @Override public AjaxResult appletLogin(AppletLogin appletLogin) { //使用jscode获取微信openid Map<String, Object> map = weChatUtil.code2Session(appletLogin.getJscode()); Integer errcode = Integer.valueOf(map.get("errcode").toString()); if(0 != errcode){ return AjaxResult.error(map.get("msg").toString()); } String openid = map.get("openid").toString(); //查询用户是否注册,没有注册则跳转到注册页面 AppUser appUser = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getWxOpenid, openid).ne(AppUser::getStatus, 3).eq(AppUser::getDelFlag, 0)); if(null == appUser){ LoginVo loginVo = new LoginVo(); loginVo.setSkipPage(2); return AjaxResult.success(loginVo); } //账户被冻结,给出提示 if(2 == appUser.getStatus()){ return AjaxResult.error("账户已被冻结,请联系管理员!"); } LoginVo loginVo = new LoginVo(); loginVo.setSkipPage(1); loginVo.setFirstTime(false); loginVo.setPhone(appUser.getPhone()); //构建token LoginUser loginUser = new LoginUser(); loginUser.setUserid(appUser.getId()); loginUser.setUsername(appUser.getName()); Map<String, Object> tokenApplet = tokenService.createTokenApplet(loginUser); loginVo.setToken(tokenApplet.get("access_token").toString()); loginVo.setFailureTime(Long.valueOf(tokenApplet.get("expires_in").toString())); return AjaxResult.success(loginVo); } /** * 手机号码登录 * @param mobileLogin * @return */ @Override public AjaxResult<LoginVo> mobileLogin(MobileLogin mobileLogin) { //校验验证码 String code = redisService.getCacheObject(mobileLogin.getPhone()); if(null == code || !code.equals(mobileLogin.getCode())){ return AjaxResult.error("验证码错误"); } //查询用户是否注册,没有注册则跳转到注册页面 AppUser appUser = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, mobileLogin.getPhone()).ne(AppUser::getStatus, 3).eq(AppUser::getDelFlag, 0)); if(null == appUser){ LoginVo loginVo = new LoginVo(); loginVo.setSkipPage(2); return AjaxResult.success(loginVo); } //账户被冻结,给出提示 if(2 == appUser.getStatus()){ return AjaxResult.error("账户已被冻结,请联系管理员!"); } LoginVo loginVo = new LoginVo(); loginVo.setSkipPage(1); loginVo.setFirstTime(false); loginVo.setPhone(appUser.getPhone()); //构建token LoginUser loginUser = new LoginUser(); loginUser.setUserid(appUser.getId()); loginUser.setUsername(appUser.getName()); Map<String, Object> tokenApplet = tokenService.createTokenApplet(loginUser); loginVo.setToken(tokenApplet.get("access_token").toString()); loginVo.setFailureTime(Long.valueOf(tokenApplet.get("expires_in").toString())); return AjaxResult.success(loginVo); } /** * 获取短信验证码 * @param smsCode * @return */ @Override public AjaxResult getSMSCode(SMSCode smsCode) { //校验验证码获取评率(1分钟5次) String key = smsCode.getType() + "&" + smsCode.getPhone(); Map<String, Object> cacheMap = redisService.getCacheMap(key); if(null != cacheMap){ Integer number = Integer.valueOf(cacheMap.get("number").toString()) + 1; Long startTime = Long.valueOf(cacheMap.get("startTime").toString()); if(number > 5 && (System.currentTimeMillis() - startTime) < 60000){ return AjaxResult.error("获取验证码太频繁,请稍后重试!"); } if(number <= 5){ cacheMap.put("number", number); }else{ cacheMap.put("number", 1); cacheMap.put("startTime", System.currentTimeMillis()); } }else{ cacheMap = new HashMap<>(); cacheMap.put("number", 1); cacheMap.put("startTime", System.currentTimeMillis()); } //存储计数器到缓存中,5分钟有效期 redisService.setCacheMap(key, cacheMap, 300); //开始构建验证码内容 String code = ""; for (int i = 0; i < 6; i++) { code += Double.valueOf(Math.random() * 10).intValue(); } //发送短信 todo 待对接短信 return AjaxResult.success(); } /** * 注册账号 * @param registerAccount * @return */ @Override public AjaxResult<LoginVo> registerAccount(RegisterAccount registerAccount) { //校验验证码 String code = redisService.getCacheObject(registerAccount.getPhone()); if(null == code || !code.equals(registerAccount.getCode())){ return AjaxResult.error("验证码错误"); } //使用jscode获取微信openid Map<String, Object> map = weChatUtil.code2Session(registerAccount.getJscode()); Integer errcode = Integer.valueOf(map.get("errcode").toString()); if(0 != errcode){ return AjaxResult.error(map.get("msg").toString()); } String openid = map.get("openid").toString(); //查询用户是否注册 AppUser appUser = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getWxOpenid, openid).ne(AppUser::getStatus, 3).eq(AppUser::getDelFlag, 0)); if(null != appUser){ return AjaxResult.error("此微信号已注册,请直接登录!"); } AppUser appUser1 = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, registerAccount.getPhone()).ne(AppUser::getStatus, 3).eq(AppUser::getDelFlag, 0)); if(null != appUser1){ return AjaxResult.error("手机号已注册,请直接登录!"); } if(null == appUser){ appUser = new AppUser(); appUser.setName(registerAccount.getName()); appUser.setPhone(registerAccount.getPhone()); appUser.setWxOpenid(openid); //注册默认为普通会员 appUser.setVipId(1); appUser.setStatus(1); appUser.setCreateTime(LocalDateTime.now()); appUser.setDelFlag(false); appUser.setFirstAdd(1); appUser.setLastLoginTime(LocalDateTime.now()); //顶级推广人 AppUser topAppUser = getTopAppUser(registerAccount.getPromoter()); appUser.setTopInviteId(topAppUser.getId()); //绑定门店为推荐人绑定的门店 AppUser appUser2 = this.getById(registerAccount.getPromoter()); appUser.setInviteUserId(registerAccount.getPromoter()); appUser.setShopId(appUser2.getShopId()); appUser.setPartPoint(BigDecimal.ZERO); appUser.setPartGrowPoint(BigDecimal.ZERO); appUser.setShopPoint(BigDecimal.ZERO); appUser.setSharePoint(BigDecimal.ZERO); appUser.setShopAmount(BigDecimal.ZERO); appUser.setWithdrawableAmount(BigDecimal.ZERO); appUser.setWithdrawnAmount(BigDecimal.ZERO); appUser.setTotalRechargeAmount(BigDecimal.ZERO); appUser.setTotalRedPacketAmount(BigDecimal.ZERO); appUser.setTotalDistributionAmount(BigDecimal.ZERO); appUser.setLavePoint(BigDecimal.ZERO); //根据平台的配置未达标,则标注为可修改推广人 appUser.setChangePromoter(0); appUser.setLongitude(registerAccount.getLongitude()); appUser.setLatitude(registerAccount.getLatitude()); //调用地图获取省市区数据 appUser.setProvince(); appUser.setProvinceCode(); appUser.setCity(); appUser.setCityCode(); appUser.setDistrict(); appUser.setDistrictCode(); this.save(appUser); } LoginVo loginVo = new LoginVo(); loginVo.setSkipPage(1); loginVo.setFirstTime(false); loginVo.setPhone(appUser.getPhone()); //构建token LoginUser loginUser = new LoginUser(); loginUser.setUserid(appUser.getId()); loginUser.setUsername(appUser.getName()); Map<String, Object> tokenApplet = tokenService.createTokenApplet(loginUser); loginVo.setToken(tokenApplet.get("access_token").toString()); loginVo.setFailureTime(Long.valueOf(tokenApplet.get("expires_in").toString())); return AjaxResult.success(loginVo); } /** * 递归查询顶级推广人 * @param id * @return */ public AppUser getTopAppUser(Long id){ List<AppUser> list = this.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getDelFlag, 0)); return getTopAppUser(list, id); } public AppUser getTopAppUser(List<AppUser> list, Long id){ AppUser appUser = list.stream().filter(s -> s.getInviteUserId().equals(id)).findFirst().get(); if(null == appUser.getInviteUserId()){ return appUser; } return getTopAppUser(list, appUser.getId()); } /** * 获取附近推广人 * @param nearbyReferrer * @return */ @Override public BaseTable<NearbyReferrerVo> getNearbyReferrer(NearbyReferrer nearbyReferrer) { //使用地图获取省市区数据 String longitude = nearbyReferrer.getLongitude(); String latitude = nearbyReferrer.getLatitude(); String cityCode = ""; List<NearbyReferrerVo> list = this.baseMapper.getNearbyReferrer(cityCode, nearbyReferrer); BaseTable baseTable = new BaseTable(); baseTable.setRows(list); baseTable.setTotal(list.size()); return baseTable; } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java
@@ -4,6 +4,7 @@ import com.ruoyi.account.mapper.UserPointMapper; import com.ruoyi.account.api.model.UserPoint; import com.ruoyi.account.service.UserPointService; import com.ruoyi.account.vo.UserPointVO; import org.springframework.stereotype.Service; /** @@ -17,4 +18,8 @@ @Service public class UserPointServiceImpl extends ServiceImpl<UserPointMapper, UserPoint> implements UserPointService { @Override public UserPointVO getUserPoint(Long userId) { return null; } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/WalletServiceImpl.java
New file @@ -0,0 +1,64 @@ package com.ruoyi.account.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.account.WithdrawalAuditStatus; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.account.api.model.WithdrawalRequests; import com.ruoyi.account.service.AppUserService; import com.ruoyi.account.service.WalletService; import com.ruoyi.account.service.WithdrawalRequestsService; import com.ruoyi.account.vo.WalletVO; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.VipSetting; import com.ruoyi.other.api.feignClient.RemoteVipSettingClient; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.List; @Service public class WalletServiceImpl implements WalletService { @Resource private AppUserService appUserService; @Resource private RemoteVipSettingClient remoteVipSettingClient; @Resource private WithdrawalRequestsService withdrawalRequestsService; @Override public WalletVO getWalletByUserId(Long userId) { AppUser appUser = appUserService.getById(userId); if (appUser == null) { throw new RuntimeException("用户不存在"); } Integer vipId = appUser.getVipId(); R<VipSetting> r = remoteVipSettingClient.getVipSettingById(vipId); if (r == null || r.getCode() != R.SUCCESS) { throw new RuntimeException("获取会员设置信息失败"); } VipSetting data = r.getData(); if (data == null) { throw new RuntimeException("会员设置信息为空"); } // 获取提现审核中的金额 List<WithdrawalRequests> waitAuditList = withdrawalRequestsService.list(new LambdaQueryWrapper<WithdrawalRequests>() .eq(WithdrawalRequests::getAppUserId, userId) .eq(WithdrawalRequests::getAuditStatus, WithdrawalAuditStatus.WAIT_AUDIT)); WalletVO walletVO = new WalletVO(); walletVO.setWithdrawalAmount(appUser.getWithdrawalAmount()); walletVO.setWithdrawnAmount(appUser.getWithdrawnAmount()); walletVO.setVipWithdrawalMinAmount(data.getVipWithdrawalMinAmount()); walletVO.setTotalRechargeAmount(appUser.getTotalRechargeAmount()); walletVO.setTotalRedPacketAmount(appUser.getTotalRedPacketAmount()); walletVO.setTotalDistributionAmount(appUser.getTotalDistributionAmount()); walletVO.setAuditAmount(waitAuditList.stream() .map(WithdrawalRequests::getWithdrawalAmount) .reduce(BigDecimal.ZERO, BigDecimal::add)); return walletVO; } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/weChat/WeChatUtil.java
@@ -1,203 +1,200 @@ //package com.ruoyi.account.util.weChat; // //import cn.hutool.http.HttpRequest; //import cn.hutool.http.HttpResponse; //import cn.hutool.http.HttpUtil; //import com.alibaba.fastjson.JSON; //import com.alibaba.fastjson.JSONObject; //import lombok.extern.slf4j.Slf4j; //import org.springframework.beans.factory.annotation.Value; //import org.springframework.stereotype.Component; //import java.util.HashMap; //import java.util.Map; // ///** // * 微信工具类 // */ //@Slf4j //@Component //public class WeChatUtil { // // @Value("${wx.appletsAppid}") // private String wxAppletsAppid; // // @Value("${wx.appletsAppSecret}") // private String wxAppletsAppSecret; // // @Value("{wx.officialAccountAppSecret}") // private String officialAccountAppSecret; // package com.ruoyi.account.util.weChat; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.util.HashMap; import java.util.Map; /** * 微信工具类 */ @Slf4j @Component public class WeChatUtil { @Value("${wx.appletsAppid}") private String wxAppletsAppid; @Value("${wx.appletsAppSecret}") private String wxAppletsAppSecret; // @Value("${wx.appid}") // private String webAppId; // private String webAppId; // @Value("${wx.appSecret}") // private String webAppSecret; // // private String webAppSecret; /** * 小程序使用jscode获取openid * @param jscode * @return */ public Map<String, Object> code2Session(String jscode) { String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret + "&js_code=" + jscode + "&grant_type=authorization_code"; HttpRequest get = HttpUtil.createGet(url); HttpResponse response = get.execute(); int status = response.getStatus(); if(200 != status){ throw new RuntimeException(response.body()); } JSONObject jsonObject = JSON.parseObject(response.body()); int errcode = jsonObject.getIntValue("errcode"); Map<String, Object> map = new HashMap<>(); map.put("errcode", errcode); if(errcode == 0){//成功 map.put("openid", jsonObject.getString("openid")); map.put("sessionKey", jsonObject.getString("session_key")); map.put("unionid", jsonObject.getString("unionid")); return map; } if(errcode == -1){//系统繁忙,此时请开发者稍候再试 map.put("msg", jsonObject.getString("errmsg")); return map; } if(errcode == 40029){//code 无效 map.put("msg", jsonObject.getString("errmsg")); return map; } if(errcode == 45011){//频率限制,每个用户每分钟100次 map.put("msg", jsonObject.getString("errmsg")); return map; } return null; } /** * 获取微信小程序token * @return */ public String getWxAppletsAccessToken() throws Exception{ String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret; HttpRequest get = HttpUtil.createGet(url); HttpResponse response = get.execute(); if(response.getStatus() != 200){ return ""; } JSONObject jsonObject = JSON.parseObject(response.body()); return jsonObject.getString("access_token"); } /** * 网站应用登录 * @param code * @return */ public Map<String, String> webAccessToken(String code) throws Exception{ String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + webAppId + "&secret=" + webAppSecret + "&code=" + code + "&grant_type=authorization_code"; HttpRequest get = HttpUtil.createGet(url); HttpResponse response = get.execute(); if(response.getStatus() != 200){ return null; } JSONObject jsonObject = JSON.parseObject(response.body()); int errcode = jsonObject.getIntValue("errcode"); Map<String, String> map = new HashMap<>(); if(errcode == 0){//成功 map.put("access_token", jsonObject.getString("access_token")); map.put("openid", jsonObject.getString("openid")); map.put("refresh_token", jsonObject.getString("refresh_token")); map.put("unionid", jsonObject.getString("unionid")); return map; } if(errcode == -1){//系统繁忙,此时请开发者稍候再试 map.put("msg", jsonObject.getString("errmsg")); return map; } if(errcode == 40029){//code 无效 map.put("msg", jsonObject.getString("errmsg")); return map; } if(errcode == 45011){//频率限制,每个用户每分钟100次 map.put("msg", jsonObject.getString("errmsg")); return map; } return map; } /** * 获取微信个人信息 * @param access_token * @param openid * @return */ public Map<String, Object> getUserInfo(String access_token, String openid) throws Exception{ String url = "https://api.weixin.qq.com/sns/userinfo?access_token=" + access_token + "&openid=" + openid; HttpRequest get = HttpUtil.createGet(url); HttpResponse response = get.execute(); if(response.getStatus() != 200){ return null; } JSONObject jsonObject = JSON.parseObject(response.body()); int errcode = jsonObject.getIntValue("errcode"); Map<String, Object> map = new HashMap<>(); if(errcode == 0){//成功 map.put("nickname", jsonObject.getString("nickname")); map.put("openid", jsonObject.getString("openid")); map.put("sex", jsonObject.getString("sex")); map.put("headimgurl", jsonObject.getString("headimgurl")); return map; } if(errcode == -1){//系统繁忙,此时请开发者稍候再试 map.put("msg", jsonObject.getString("errmsg")); return map; } if(errcode == 40029){//code 无效 map.put("msg", jsonObject.getString("errmsg")); return map; } if(errcode == 45011){//频率限制,每个用户每分钟100次 map.put("msg", jsonObject.getString("errmsg")); return map; } return map; } // /** // * 小程序使用jscode获取openid // * @param jscode // * @return // * 获取小程序二维码 // * @param page 跳转页 例如 pages/index/index // * @param scene 参数 a=1&b=2 // */ // public Map<String, Object> code2Session(String jscode) throws Exception{ // String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret // + "&js_code=" + jscode + "&grant_type=authorization_code"; // HttpRequest get = HttpUtil.createGet(url); // HttpResponse response = get.execute(); // int status = response.getStatus(); // if(200 != status){ // throw new RuntimeException(response.body()); // } // JSONObject jsonObject = JSON.parseObject(response.body()); // int errcode = jsonObject.getIntValue("errcode"); // Map<String, Object> map = new HashMap<>(); // map.put("errcode", errcode); // if(errcode == 0){//成功 // map.put("openid", jsonObject.getString("openid")); // map.put("sessionKey", jsonObject.getString("session_key")); // map.put("unionid", jsonObject.getString("unionid")); // return map; // } // if(errcode == -1){//系统繁忙,此时请开发者稍候再试 // map.put("msg", jsonObject.getString("errmsg")); // return map; // } // if(errcode == 40029){//code 无效 // map.put("msg", jsonObject.getString("errmsg")); // return map; // } // if(errcode == 45011){//频率限制,每个用户每分钟100次 // map.put("msg", jsonObject.getString("errmsg")); // return map; // public InputStream getwxacodeunlimit(String page, String scene){ // try { // String token = getWxAppletsAccessToken(); // if(StringUtils.isEmpty(token)){ // System.err.println("获取接口调用凭证失败"); // } // String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + token; // Map<String, Object> param = new HashMap<>(); // param.put("scene", scene); // param.put("page", page); // HttpHeaders httpHeaders = new HttpHeaders(); // MediaType type=MediaType.parseMediaType("application/json;charset=UTF-8"); // httpHeaders.setContentType(type); // HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(param, httpHeaders); // ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class, new Object[0]); // String body1 = exchange.getBody(); //// System.err.println(body1); // ResponseEntity<byte[]> entity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class, new Object[0]); // byte[] body = entity.getBody(); //// System.err.println(Base64.encodeBase64String(body)); // return new ByteArrayInputStream(body); // }catch (Exception e){ // e.printStackTrace(); // } // return null; // } // // // /** // * 获取微信小程序token // * @return // */ // public String getWxAppletsAccessToken() throws Exception{ // String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret; // HttpRequest get = HttpUtil.createGet(url); // HttpResponse response = get.execute(); // if(response.getStatus() != 200){ // return ""; // } // JSONObject jsonObject = JSON.parseObject(response.body()); // return jsonObject.getString("access_token"); // } // // // /** // * 网站应用登录 // * @param code // * @return // */ // public Map<String, String> webAccessToken(String code) throws Exception{ // String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + webAppId + "&secret=" + webAppSecret + "&code=" + code + "&grant_type=authorization_code"; // HttpRequest get = HttpUtil.createGet(url); // HttpResponse response = get.execute(); // if(response.getStatus() != 200){ // return null; // } // JSONObject jsonObject = JSON.parseObject(response.body()); // int errcode = jsonObject.getIntValue("errcode"); // Map<String, String> map = new HashMap<>(); // if(errcode == 0){//成功 // map.put("access_token", jsonObject.getString("access_token")); // map.put("openid", jsonObject.getString("openid")); // map.put("refresh_token", jsonObject.getString("refresh_token")); // map.put("unionid", jsonObject.getString("unionid")); // return map; // } // if(errcode == -1){//系统繁忙,此时请开发者稍候再试 // map.put("msg", jsonObject.getString("errmsg")); // return map; // } // if(errcode == 40029){//code 无效 // map.put("msg", jsonObject.getString("errmsg")); // return map; // } // if(errcode == 45011){//频率限制,每个用户每分钟100次 // map.put("msg", jsonObject.getString("errmsg")); // return map; // } // return map; // } // // // /** // * 获取微信个人信息 // * @param access_token // * @param openid // * @return // */ // public Map<String, Object> getUserInfo(String access_token, String openid) throws Exception{ // String url = "https://api.weixin.qq.com/sns/userinfo?access_token=" + access_token + "&openid=" + openid; // HttpRequest get = HttpUtil.createGet(url); // HttpResponse response = get.execute(); // if(response.getStatus() != 200){ // return null; // } // JSONObject jsonObject = JSON.parseObject(response.body()); // int errcode = jsonObject.getIntValue("errcode"); // Map<String, Object> map = new HashMap<>(); // if(errcode == 0){//成功 // map.put("nickname", jsonObject.getString("nickname")); // map.put("openid", jsonObject.getString("openid")); // map.put("sex", jsonObject.getString("sex")); // map.put("headimgurl", jsonObject.getString("headimgurl")); // return map; // } // if(errcode == -1){//系统繁忙,此时请开发者稍候再试 // map.put("msg", jsonObject.getString("errmsg")); // return map; // } // if(errcode == 40029){//code 无效 // map.put("msg", jsonObject.getString("errmsg")); // return map; // } // if(errcode == 45011){//频率限制,每个用户每分钟100次 // map.put("msg", jsonObject.getString("errmsg")); // return map; // } // return map; // } // // // // //// /** //// * 获取小程序二维码 //// * @param page 跳转页 例如 pages/index/index //// * @param scene 参数 a=1&b=2 //// */ //// public InputStream getwxacodeunlimit(String page, String scene){ //// try { //// String token = getWxAppletsAccessToken(); //// if(StringUtils.isEmpty(token)){ //// System.err.println("获取接口调用凭证失败"); //// } //// String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + token; //// Map<String, Object> param = new HashMap<>(); //// param.put("scene", scene); //// param.put("page", page); //// HttpHeaders httpHeaders = new HttpHeaders(); //// MediaType type=MediaType.parseMediaType("application/json;charset=UTF-8"); //// httpHeaders.setContentType(type); //// HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(param, httpHeaders); //// ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class, new Object[0]); //// String body1 = exchange.getBody(); ////// System.err.println(body1); //// ResponseEntity<byte[]> entity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class, new Object[0]); //// byte[] body = entity.getBody(); ////// System.err.println(Base64.encodeBase64String(body)); //// return new ByteArrayInputStream(body); //// }catch (Exception e){ //// e.printStackTrace(); //// } //// return null; //// } //} } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/RegisterAccount.java
@@ -11,7 +11,9 @@ @Data @ApiModel public class RegisterAccount { @ApiModelProperty(value = "推广人id", required = false) @ApiModelProperty(value = "微信jscode", required = true) private String jscode; @ApiModelProperty(value = "推广人id", required = true) private Long promoter; @ApiModelProperty(value = "头像", required = true) private String avatar; @@ -21,4 +23,8 @@ private String phone; @ApiModelProperty(value = "短信验证码", required = true) private String code; @ApiModelProperty(value = "经度", required = true) private String longitude; @ApiModelProperty(value = "纬度", required = true) private String latitude; } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointDetailVO.java
New file @@ -0,0 +1,23 @@ package com.ruoyi.account.vo; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.time.LocalDateTime; @Data @ApiModel(value="UserPointDetail对象", description="") public class UserPointDetailVO { @ApiModelProperty(value = "变动类型(1=消费积分,2=返佣积分,3=拉新人积分,4=兑换商品 5 = 门店业绩积分 6 =门店返佣积分7=技师业绩积分8 =转赠积分 9 =做工积分 10 =注册积分)") private Integer type; @ApiModelProperty(value = "变动金额") private BigDecimal variablePoint; @ApiModelProperty(value = "变动时间") private LocalDateTime createTime; } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointVO.java
New file @@ -0,0 +1,31 @@ package com.ruoyi.account.vo; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; @Data @ApiModel(value="UserPoint对象", description="") public class UserPointVO { @ApiModelProperty(value = "总积分") private Integer totalPoint; @ApiModelProperty(value = "消费积分数") private BigDecimal shopPoint; @ApiModelProperty(value = "返佣积分数") private BigDecimal sharePoint; @ApiModelProperty(value = "拉新积分") private BigDecimal pullNewPoint; @ApiModelProperty(value = "门店业绩积分") private BigDecimal shopAchievementPoint; @ApiModelProperty(value = "门店返佣积分") private BigDecimal shopSharePoint; } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/WalletVO.java
@@ -11,23 +11,23 @@ public class WalletVO { @ApiModelProperty(value = "可提现金额") private BigDecimal withdrawal_amount; private BigDecimal withdrawalAmount; @ApiModelProperty(value = "已提现金额") private BigDecimal withdrawn_amount; private BigDecimal withdrawnAmount; @ApiModelProperty(value = "最低提现门槛") private BigDecimal vipWithdrawalMinAmount; @ApiModelProperty(value = "提现审核中金额") private BigDecimal audit_amount; private BigDecimal auditAmount; @ApiModelProperty(value = "充值总金额") private BigDecimal total_recharge_amount; private BigDecimal totalRechargeAmount; @ApiModelProperty(value = "红包总金额") private BigDecimal total_red_packet_amount; private BigDecimal totalRedPacketAmount; @ApiModelProperty(value = "分销总金额") private BigDecimal total_distribution_amount; private BigDecimal totalDistributionAmount; } ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AgentApplicationMapper.xml
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml
File was renamed from ruoyi-service/ruoyi-account/src/main/resources/mapping/AppUserMapper.xml @@ -31,4 +31,24 @@ id, name, phone, avatar, vip_id, wx_openid, ali_openid, status, create_time, del_flag, first_add, last_login_time, invite_user_id, shop_id, part_point, part_grow_point, shop_point, share_point, shop_amount, last_shop_time </sql> <select id="getNearbyReferrer" resultType="com.ruoyi.account.vo.NearbyReferrerVo"> select * from ( select id, avatar, `name`, vip_id as vip, ST_Distance_Sphere( point(#{nearbyReferrer.longitude},#{nearbyReferrer.latitude}), point(longitude, latitude) ) as distance from t_app_user where city_code = #{cityCode} and del_flag = 0 and status = 1 <if test="null != nearbyReferrer.name and '' != nearbyReferrer.name"> and `name` like CONCAT('%', #{nearbyReferrer.name}, '%') </if> ) as aa order by aa.distance </select> </mapper> ruoyi-service/ruoyi-account/src/main/resources/mapper/account/BalanceChangeRecordMapper.xml
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserAddressMapper.xml
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserCancellationLogMapper.xml
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserChangeLogMapper.xml
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserClickLogMapper.xml
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserCouponMapper.xml
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserPointMapper.xml
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserSignRecordMapper.xml
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/WithdrawalRequestsMapper.xml
ruoyi-service/ruoyi-order/pom.xml
@@ -58,11 +58,6 @@ <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> </dependency> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-seata</artifactId> </dependency> <!-- SpringBoot Actuator --> <dependency> ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -1,8 +1,10 @@ package com.ruoyi.order.controller; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.domain.R; import com.ruoyi.order.service.OrderService; import com.ruoyi.order.vo.OrderDetailVO; import com.ruoyi.order.vo.OrderVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.List; /** * <p> @@ -22,7 +25,7 @@ * @author luodangjia * @since 2024-11-21 */ @Api("订单") @Api(tags = "订单") @RestController @RequestMapping("/order") public class OrderController { @@ -31,28 +34,66 @@ /** * 扫码校验 * 我的订单列表 */ @ApiOperation(value = "扫码校验", tags = {"小程序-个人中心-门店管理-扫码核销校验"}) @ApiOperation(value = "我的订单列表", tags = {"小程序-个人中心-我的订单"}) @ApiImplicitParams({ @ApiImplicitParam(value = "分享id", name = "shareId", required = true, dataType = "int"), @ApiImplicitParam(value = "订单状态", name = "status", required = true, dataType = "int"), }) @GetMapping("/check/{orderId}/{shopId}") public AjaxResult check(@PathVariable("orderId") Integer orderId, @PathVariable("shopId") Integer shopId){ return AjaxResult.ok(orderService.check(orderId, shopId)); @GetMapping("/list/{status}") public R<List<OrderVO>> list(@PathVariable("status") Integer status){ return R.ok(orderService.getOrderList(status)); } /** * 订单详情 */ @ApiOperation(value = "订单详情", tags = {"订单详情"}) @ApiOperation(value = "订单详情", tags = {"小程序-订单详情"}) @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), }) @GetMapping("/detail/{orderId}") public AjaxResult detail(@PathVariable("orderId") Integer orderId){ return AjaxResult.success(orderService.getById(orderId)); public R<OrderDetailVO> detail(@PathVariable("orderId") Long orderId){ return R.ok(orderService.getOrderDetail(orderId)); } /** * 扫码校验 */ @ApiOperation(value = "扫码校验", tags = {"小程序-个人中心-门店管理-扫码核销校验"}) @ApiImplicitParams({ @ApiImplicitParam(value = "分享id", name = "shareId", required = true, dataType = "int", paramType="query"), }) @GetMapping("/check/{orderNumber}/{shopId}") public R<Boolean> check(@PathVariable("orderNumber") String orderNumber, @PathVariable("shopId") Long shopId){ return R.ok(orderService.check(orderNumber, shopId)); } /** * 订单核销 */ @ApiOperation(value = "订单核销", tags = {"小程序-个人中心-门店管理-扫码核销"}) @ApiImplicitParams({ @ApiImplicitParam(value = "核销码", name = "code", required = true, dataType = "String"), }) @GetMapping("/writeOff/{code}") public R<Void> writeOff(@PathVariable("code") String code){ return R.ok(); } /** * 取消订单 */ @ApiOperation(value = "取消订单", tags = {"小程序-个人中心-我的订单-取消订单"}) @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), }) @GetMapping("/cancel/{orderId}") public R<Void> cancel(@PathVariable("orderId") Long orderId){ return R.ok(); } } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java
New file @@ -0,0 +1,74 @@ package com.ruoyi.order.controller; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.order.service.ShoppingCartService; import com.ruoyi.order.vo.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import model.ShoppingCart; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @RestController @RequestMapping("/shopping-cart") @Api(tags = "购物车") public class ShoppingCartController extends BaseController { @Resource private ShoppingCartService shoppingCartService; @ResponseBody @GetMapping("/getMyShoppingCart/{type}/{shopId}") @ApiOperation(value = "获取购物车列表", tags = {"商城-购物车-小程序"}) @ApiImplicitParams({ @ApiImplicitParam(name = "type", value = "商品类型(1=服务商品,2=单品商品)", required = true, dataType = "int"), @ApiImplicitParam(name = "shopId", value = "核销门店id", required = true, dataType = "int") }) public TableDataInfo<MyShoppingCartVo> getMyShoppingCart(@PathVariable("type") Integer type, @PathVariable("shopId") Integer shopId){ startPage(); return getDataTable(shoppingCartService.getMyShoppingCart(type, shopId)); } @PostMapping("/addGoods") @ApiOperation(value = "添加购物车", tags = {"商城-购物车-小程序"}) public R<Void> addGoods(@RequestBody ShoppingCart shoppingCart) { shoppingCartService.addGoods(shoppingCart); return R.ok(); } @ResponseBody @PostMapping("/setGoodsNumber") @ApiOperation(value = "修改购物车数量", tags = {"商城-购物车-小程序"}) public AjaxResult setGoodsNumber(@RequestBody SetGoodsNumber setGoodsNumber){ return shoppingCartService.setGoodsNumber(setGoodsNumber); } @ResponseBody @PostMapping("/confirmOrder") @ApiOperation(value = "确定购物车订单", tags = {"商城-购物车-小程序"}) public AjaxResult<ConfirmOrderVo> confirmOrder(@RequestBody ConfirmOrder confirmOrder){ // todo 待完善 pu return AjaxResult.success(); } @ResponseBody @PostMapping("/shoppingCartPayment") @ApiOperation(value = "购物车订单支付", tags = {"商城-购物车-小程序"}) public AjaxResult<Void> shoppingCartPayment(@RequestBody ShoppingCartPayment shoppingCartPayment){ // todo 待完善 pu return AjaxResult.success(); } } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/filter/AuthFilter.java
@@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.feignClient.SysUserClient; import org.apache.logging.log4j.core.config.Order; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -31,16 +32,16 @@ @Component public class AuthFilter implements Filter { private static final Logger log = LoggerFactory.getLogger(AuthFilter.class); @Lazy @Resource private AppUserClient appUserClient; @Lazy @Resource private SysUserClient sysUserClient; @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) servletRequest; @@ -68,7 +69,7 @@ //小程序用户 if ("applet".equals(userType)) { AppUser appUser = appUserClient.getAppUserById(Long.valueOf(userid)); if(null == appUser || appUser.getDelFlag() == 1 || 3 == appUser.getStatus()){ if(null == appUser || appUser.getDelFlag() || 3 == appUser.getStatus()){ log.error("[账户异常处理]请求账户id:{}", userid); unauthorizedResponse(response,"无效的账户"); return; @@ -81,9 +82,9 @@ } filterChain.doFilter(servletRequest, servletResponse); } private void unauthorizedResponse(HttpServletResponse response, String msg) { response.setStatus(HttpStatus.OK.value()); response.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE); @@ -97,9 +98,9 @@ writer.flush(); writer.close(); } /** * 获取请求token */ @@ -111,6 +112,6 @@ } return token; } } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderGoodMapper.java
@@ -1,7 +1,7 @@ package com.ruoyi.order.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import model.RefundPassOrderGood; import model.OrderGood; /** * <p> ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/RefundPassMapper.java
@@ -1,7 +1,7 @@ package com.ruoyi.order.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import model.RefundPassRefundPass; import model.RefundPass; /** * <p> ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/ShoppingCartMapper.java
File was renamed from ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShoppingCartMapper.java @@ -1,7 +1,8 @@ package com.ruoyi.other.mapper; package com.ruoyi.order.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.ShoppingCart; import model.ShoppingCart; public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> { } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderGoodService.java
@@ -2,7 +2,6 @@ import com.baomidou.mybatisplus.extension.service.IService; import model.OrderGood; import model.RefundPassOrderGood; /** * <p> ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java
@@ -1,7 +1,11 @@ package com.ruoyi.order.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.order.vo.OrderDetailVO; import com.ruoyi.order.vo.OrderVO; import model.Order; import java.util.List; /** * <p> @@ -12,5 +16,9 @@ * @since 2024-11-21 */ public interface OrderService extends IService<Order> { boolean check(Integer orderId, Integer shopId); List<OrderVO> getOrderList(Integer status); OrderDetailVO getOrderDetail(Long orderId); boolean check(String orderNumber, Long shopId); } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/ShoppingCartService.java
New file @@ -0,0 +1,36 @@ package com.ruoyi.order.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.order.vo.MyShoppingCartVo; import com.ruoyi.order.vo.SetGoodsNumber; import model.ShoppingCart; import org.springframework.web.bind.annotation.RequestBody; import java.util.List; public interface ShoppingCartService extends IService<ShoppingCart> { /** * 获取购物车列表数据 * @param type * @param shopId * @return */ List<MyShoppingCartVo> getMyShoppingCart(Integer type, Integer shopId); /** * 添加商品 * @param shoppingCart */ void addGoods(ShoppingCart shoppingCart); /** * 修改购物车数量 * @param setGoodsNumber * @return */ AjaxResult setGoodsNumber(SetGoodsNumber setGoodsNumber); } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderGoodServiceImpl.java
@@ -1,9 +1,9 @@ package com.ruoyi.order.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.OrderGoodMapper; import model.RefundPassOrderGood; import com.ruoyi.account.service.OrderGoodService; import com.ruoyi.order.mapper.OrderGoodMapper; import com.ruoyi.order.service.OrderGoodService; import model.OrderGood; import org.springframework.stereotype.Service; /** ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -1,10 +1,16 @@ package com.ruoyi.order.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.order.mapper.OrderMapper; import com.ruoyi.order.service.OrderService; import com.ruoyi.order.vo.OrderDetailVO; import com.ruoyi.order.vo.OrderVO; import model.Order; import org.springframework.stereotype.Service; import java.util.Collections; import java.util.List; /** * <p> @@ -18,7 +24,22 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService { @Override public boolean check(Integer orderId, Integer shopId) { return false; public List<OrderVO> getOrderList(Integer status) { // TODO 待实现 return Collections.emptyList(); } @Override public OrderDetailVO getOrderDetail(Long orderId) { // TODO 待实现 return null; } @Override public boolean check(String orderNumber, Long shopId) { Order order = getOne(new LambdaQueryWrapper<Order>() .eq(Order::getOrderNumber, orderNumber) .eq(Order::getShopId, shopId)); return order != null; } } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java
@@ -1,9 +1,9 @@ package com.ruoyi.order.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.mapper.RefundPassMapper; import model.RefundPassRefundPass; import com.ruoyi.account.service.RefundPassService; import com.ruoyi.order.mapper.RefundPassMapper; import com.ruoyi.order.service.RefundPassService; import model.RefundPass; import org.springframework.stereotype.Service; /** ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
New file @@ -0,0 +1,229 @@ package com.ruoyi.order.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.api.feignClient.AppUserClient; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.order.mapper.ShoppingCartMapper; import com.ruoyi.order.service.ShoppingCartService; import com.ruoyi.order.vo.MyShoppingCartVo; import com.ruoyi.order.vo.SetGoodsNumber; import com.ruoyi.other.api.domain.*; import com.ruoyi.other.api.feignClient.*; import com.ruoyi.other.api.vo.GetGoodsBargainPrice; import com.ruoyi.other.api.vo.GetSeckillActivityInfo; import lombok.Data; import model.ShoppingCart; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @Service public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, ShoppingCart> implements ShoppingCartService { @Resource private TokenService tokenService; @Resource private GoodsClient goodsClient; @Resource private GoodsShopClient goodsShopClient; @Resource private AppUserClient appUserClient; @Resource private GoodsAreaClient goodsAreaClient; @Resource private GoodsVipClient goodsVipClient; @Resource private SeckillActivityInfoClient seckillActivityInfoClient; @Resource private GoodsBargainPriceClient goodsBargainPriceClient; /** * 获取购物车列表 * @param type * @param shopId * @return */ @Override public List<MyShoppingCartVo> getMyShoppingCart(Integer type, Integer shopId) { Long userid = tokenService.getLoginUserApplet().getUserid(); AppUser appUser = appUserClient.getAppUserById(userid); //获取对应类型的商品数据 List<Goods> data = goodsClient.getGoodsByType(type).getData(); if(null == data){ throw new RuntimeException("根据类型(1=服务商品,2=单品商品)获取商品数据失败"); } List<Long> goodsIds = data.stream().map(Goods::getId).collect(Collectors.toList()); //查询符合商品类型的商品数据 List<ShoppingCart> list = this.list(new LambdaQueryWrapper<ShoppingCart>().eq(ShoppingCart::getAppUserId, userid).in(ShoppingCart::getGoodsId, goodsIds)); List<MyShoppingCartVo> page = new ArrayList<>(); //构建返回数据 for (ShoppingCart shoppingCart : list) { Goods goods = data.stream().filter(s -> s.getId().equals(shoppingCart.getGoodsId())).findFirst().get(); MyShoppingCartVo vo = new MyShoppingCartVo(); vo.setId(shoppingCart.getId()); vo.setHomePicture(goods.getHomePagePicture()); vo.setName(goods.getName()); //获取支付价格 Price price = getPrice(appUser, shoppingCart.getGoodsId(), shopId); if(null == price){ //使用商品的基础价格 price.setCash(1 == goods.getCashPayment() ? goods.getSellingPrice() : null); price.setPoint(1 == goods.getPointPayment() ? goods.getIntegral() : null); } //构建价格展示内容 String sellingPrice = ""; if(null != price.getCash() && null != price.getPoint()){ sellingPrice = price.getCash() + "或" + price.getPoint() + "积分"; } if(null != price.getCash() && null == price.getPoint()){ sellingPrice = price.getCash() + ""; } if(null == price.getCash() && null != price.getPoint()){ sellingPrice = price.getPoint() + "积分"; } vo.setSellingPrice(sellingPrice); vo.setEndTime(price.getEndTime()); vo.setOriginalPrice(goods.getOriginalPrice().toString()); vo.setNumber(shoppingCart.getNumber()); GoodsShop goodsShop = new GoodsShop(); goodsShop.setGoodsId(shoppingCart.getGoodsId()); goodsShop.setShopId(shopId); GoodsShop goodsShop1 = goodsShopClient.getGoodsShop(goodsShop).getData(); vo.setVerifiable(null == goodsShop1 ? false : true); page.add(vo); } return page; } /** * 获取支付价格 * @param appUser * @param goodsId * @param shopId * @return */ public Price getPrice(AppUser appUser, Integer goodsId, Integer shopId){ //获取支付价格 //秒杀活动>门店特价>地区价格>会员价格 //判断是否有秒杀活动 Price price = new Price(); GetSeckillActivityInfo info = new GetSeckillActivityInfo(); info.setGoodsId(goodsId); info.setVip(appUser.getVipId()); GoodsSeckill goodsSeckill = seckillActivityInfoClient.getSeckillActivityInfo(info).getData(); if(null == goodsSeckill){ //没有秒杀价,则判断门店特价 GetGoodsBargainPrice goodsBargainPrice = new GetGoodsBargainPrice(); goodsBargainPrice.setGoodsId(goodsId); goodsBargainPrice.setVip(appUser.getVipId()); goodsBargainPrice.setShopId(shopId); GoodsBargainPriceDetail bargainPriceDetail = goodsBargainPriceClient.getGoodsBargainPrice(goodsBargainPrice).getData(); if(null == bargainPriceDetail){ //没有门店特价,判断地区价格配置 GoodsArea area = new GoodsArea(); area.setDistrictsCode(appUser.getDistrictCode()); area.setCityCode(appUser.getCityCode()); area.setProvinceCode(appUser.getProvinceCode()); area.setVip(appUser.getVipId()); GoodsArea goodsArea = goodsAreaClient.getGoodsArea(area).getData(); if(null == goodsArea){ //没有地区价格,则使用会员价格 GoodsVip goodsVip = goodsVipClient.getGoodsVip(appUser.getVipId()).getData(); if(null == goodsVip){ //没有配置价格,直接使用原始基础价格 return null; }else{ price.setCash(goodsVip.getSellingPrice()); price.setPoint(goodsVip.getIntegral()); } }else{ price.setCash(goodsArea.getSellingPrice()); price.setPoint(goodsArea.getIntegral()); } }else{ price.setCash(bargainPriceDetail.getSellingPrice()); price.setPoint(bargainPriceDetail.getIntegral()); } }else{ //构建价格数据 if(goodsSeckill.getCashPayment() == 1 && goodsSeckill.getPointPayment() == 1){ price.setCash(goodsSeckill.getSellingPrice()); price.setPoint(goodsSeckill.getIntegral()); } if(goodsSeckill.getCashPayment() == 1 && goodsSeckill.getPointPayment() == 0){ price.setCash(goodsSeckill.getSellingPrice()); } if(goodsSeckill.getCashPayment() == 0 && goodsSeckill.getPointPayment() == 1){ price.setPoint(goodsSeckill.getIntegral()); } price.setEndTime(goodsSeckill.getEndTime()); } return price; } @Data class Price { /** * 现金 */ private BigDecimal cash; /** * 积分 */ private Integer point; /** * 获取结束时间 */ private Long endTime; } @Override public void addGoods(ShoppingCart shoppingCart) { Long userid = tokenService.getLoginUserApplet().getUserid(); shoppingCart.setAppUserId(userid); this.save(shoppingCart); } /** * 修改购物车数量 * @param setGoodsNumber * @return */ @Override public AjaxResult setGoodsNumber(SetGoodsNumber setGoodsNumber) { if(0 >= setGoodsNumber.getNumber()){ return AjaxResult.error("修改数量不能小于等于0"); } ShoppingCart shoppingCart = this.getById(setGoodsNumber.getId()); if(null != shoppingCart){ shoppingCart.setNumber(setGoodsNumber.getNumber()); this.updateById(shoppingCart); } return AjaxResult.success(); } } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/ConfirmOrder.java
New file @@ -0,0 +1,20 @@ package com.ruoyi.order.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author zhibing.pu * @Date 2024/11/25 12:12 */ @Data @ApiModel public class ConfirmOrder { @ApiModelProperty(value = "购物商品id JSON", required = true) private String goodsJson; @ApiModelProperty(value = "支付方式(1=现金,2=积分)", required = true) private Integer paymentType; @ApiModelProperty(value = "核销门店id", required = true) private Integer shopId; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/ConfirmOrderVo.java
New file @@ -0,0 +1,44 @@ package com.ruoyi.order.vo; import com.ruoyi.account.api.model.UserAddress; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.List; /** * @author zhibing.pu * @Date 2024/11/25 14:05 */ @Data @ApiModel public class ConfirmOrderVo { @ApiModelProperty("商品列表") private List<MyShoppingCartVo> goodsList; @ApiModelProperty("核销门店") private String shopName; @ApiModelProperty("核销门店id") private Integer shopId; @ApiModelProperty("订单金额") private BigDecimal orderMoney; @ApiModelProperty("优惠活动") private String activityName; @ApiModelProperty("优惠金额") private BigDecimal discountAmount; @ApiModelProperty("获得积分") private Integer earnPoint; @ApiModelProperty("支付金额") private BigDecimal payMoney; @ApiModelProperty("订单总金额") private Integer orderPoint; @ApiModelProperty("剩余积分") private Integer residualPoint; @ApiModelProperty("收货地址") private UserAddress userAddress; @ApiModelProperty("支付方式(1=现金,2=积分)") private Integer paymentType; @ApiModelProperty("优惠券列表") private List<CouponInfoVo> coupon; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/CouponInfoVo.java
New file @@ -0,0 +1,36 @@ package com.ruoyi.order.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; /** * @author zhibing.pu * @Date 2024/11/25 17:59 */ @Data @ApiModel public class CouponInfoVo { @ApiModelProperty("优惠券id") private Long id; @ApiModelProperty("优惠券名称") private String name; @ApiModelProperty("优惠券类型 1=满减券,2=代金券,3=折扣券,4=商品券") private Integer couponType; @ApiModelProperty("满x元") private BigDecimal conditionAmount; @ApiModelProperty("减x元") private BigDecimal discountAmount; @ApiModelProperty("代金x元") private BigDecimal moneyAmount; @ApiModelProperty("折扣") private BigDecimal discount; @ApiModelProperty("有效期开始时间") private String periodStartTime; @ApiModelProperty("有效期结束时间") private String periodEndTime; @ApiModelProperty("是否可用") private Boolean available; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/MyShoppingCartVo.java
New file @@ -0,0 +1,30 @@ package com.ruoyi.order.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author zhibing.pu * @Date 2024/11/25 11:51 */ @Data @ApiModel public class MyShoppingCartVo { @ApiModelProperty("数据id") private Long id; @ApiModelProperty("封面图") private String homePicture; @ApiModelProperty("商品名称") private String name; @ApiModelProperty("售价") private String sellingPrice; @ApiModelProperty("原价") private String originalPrice; @ApiModelProperty("购买数量") private Integer number; @ApiModelProperty("结束时间") private Long endTime; @ApiModelProperty("是否可核销(0=否,1=是)") private Boolean verifiable; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java
New file @@ -0,0 +1,61 @@ package com.ruoyi.order.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.List; @Data @ApiModel(value = "订单明细") public class OrderDetailVO { @ApiModelProperty(value = "订单id") private Long id; @ApiModelProperty(value = "订单商品") private List<OrderGoodsVO> goodsList; @ApiModelProperty(value = "使用积分") private BigDecimal point; @ApiModelProperty(value = "收货地址id") private Long addressId; @ApiModelProperty(value = "收货联系人") private String recieveName; @ApiModelProperty(value = "收货联系电话") private String recievePhone; @ApiModelProperty(value = "收货地址") private String recieveAddress; @ApiModelProperty(value = "订单编号") private String orderNumber; @ApiModelProperty("下单时间") private String createTime; @ApiModelProperty(value = "订单总金额") private BigDecimal totalAmount; @ApiModelProperty(value = "优惠券名称") private String couponName; @ApiModelProperty(value = "参与活动名称") private String activityName; @ApiModelProperty(value = "抵扣金额") private BigDecimal couponAmount; @ApiModelProperty(value = "快递费") private BigDecimal expressAmount; @ApiModelProperty(value = "可获得积分") private BigDecimal pointAmount; @ApiModelProperty(value = "实际支付价格") private BigDecimal paymentAmount; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/OrderGoodsVO.java
New file @@ -0,0 +1,32 @@ package com.ruoyi.order.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; @Data @ApiModel(value = "订单商品") public class OrderGoodsVO { @ApiModelProperty(value = "商品id") private Long goodsId; @ApiModelProperty(value = "商品名称") private String goodsName; @ApiModelProperty(value = "类型(1=服务商品,2=单品商品)") private Integer type; @ApiModelProperty(value = "数量") private Integer num; @ApiModelProperty(value = "商品图片") private String goodsPic; @ApiModelProperty(value = "基础售价") private BigDecimal sellingPrice; @ApiModelProperty(value = "划线价") private BigDecimal originalPrice; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/OrderVO.java
New file @@ -0,0 +1,34 @@ package com.ruoyi.order.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.List; @Data public class OrderVO { @ApiModelProperty(value = "订单id") private Long id; @ApiModelProperty(value = "订单编号") private String orderNumber; @ApiModelProperty(value = "1待发货2待收货3待使用4已完成待评论5已取消6已退款7售后中8已完成已评论") private Integer orderStatus; @ApiModelProperty(value = "商品图片") private List<String> goodsPics; @ApiModelProperty(value = "商品名称") private String goodsName; @ApiModelProperty(value = "使用积分") private BigDecimal point; @ApiModelProperty(value = "实际支付价格") private BigDecimal paymentAmount; @ApiModelProperty(value = "商品数量") private Integer num; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/SetGoodsNumber.java
New file @@ -0,0 +1,18 @@ package com.ruoyi.order.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author zhibing.pu * @Date 2024/11/25 12:04 */ @Data @ApiModel public class SetGoodsNumber { @ApiModelProperty(value = "购物车数据id", required = true) private Integer id; @ApiModelProperty(value = "修改数量", required = true) private Integer number; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/ShoppingCartPayment.java
New file @@ -0,0 +1,22 @@ package com.ruoyi.order.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author zhibing.pu * @Date 2024/11/25 14:33 */ @Data @ApiModel public class ShoppingCartPayment { @ApiModelProperty(value = "购物商品id JSON", required = true) private String goodsJson; @ApiModelProperty(value = "支付方式(1=现金,2=积分)", required = true) private Integer paymentType; @ApiModelProperty(value = "核销门店id", required = true) private Integer shopId; @ApiModelProperty(value = "优惠券id", required = false) private String userCouponId; } ruoyi-service/ruoyi-order/src/main/resources/bootstrap.yml
@@ -43,70 +43,6 @@ shared-configs: - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} --- seata: enabled: true application-id: ${spring.application.name} tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 enable-auto-data-source-proxy: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default data-source-proxy-mode: AT config: type: nacos nacos: # 开发环境 server-addr: 192.168.110.169:8848 namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 group: DEFAULT_GROUP data-id: seata-server.properties username: nacos password: nacos # 生产环境 # server-addr: 192.168.0.137:8848,192.168.0.123:8848 # namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a # group: DEFAULT_GROUP # data-id: seata-server.properties # username: nacos # password: nacos registry: type: nacos nacos: application: seata-server # 开发环境 server-addr: 192.168.110.169:8848 namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 group: DEFAULT_GROUP username: nacos password: nacos # 生产环境 # server-addr: 192.168.0.137:8848,192.168.0.123:8848 # namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a # group: DEFAULT_GROUP # username: nacos # password: nacos cloud: nacos: discovery: # 开发环境 server-addr: 192.168.110.169:8848 namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 # 命名空间 group: DEFAULT_GROUP application: seata-server #Nacos 中 Seata 名称 username: nacos password: nacos # 生产环境 # server-addr: 192.168.0.137:8848,192.168.0.123:8848 # namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a # group: DEFAULT_GROUP # application: seata-server #Nacos 中 Seata 名称 # username: nacos # password: nacos sentinel: transport: dashboard: 127.0.0.1:8080 # Sentinel控制台地址 eager: true --- spring: config: activate: ruoyi-service/ruoyi-order/src/main/resources/mapper/order/OrderGoodMapper.xml
New file @@ -0,0 +1,7 @@ <?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.OrderGoodMapper"> </mapper> ruoyi-service/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
New file @@ -0,0 +1,7 @@ <?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.OrderMapper"> </mapper> ruoyi-service/ruoyi-order/src/main/resources/mapper/order/RefundPassMapper.xml
New file @@ -0,0 +1,7 @@ <?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.RefundPassMapper"> </mapper> ruoyi-service/ruoyi-order/src/main/resources/mapper/order/ShoppingCartMapper.xml
New file @@ -0,0 +1,4 @@ <?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.order.mapper.ShoppingCartMapper"> </mapper> ruoyi-service/ruoyi-order/src/main/resources/mapping/OrderGoodMapper.xml
File was deleted ruoyi-service/ruoyi-order/src/main/resources/mapping/OrderMapper.xml
File was deleted ruoyi-service/ruoyi-order/src/main/resources/mapping/RefundPassMapper.xml
File was deleted ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/AgreementController.java
@@ -1,8 +1,8 @@ package com.ruoyi.other.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.other.api.model.Agreement; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.Agreement; import com.ruoyi.other.service.IAgreementService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -34,8 +34,8 @@ @ApiImplicitParams({ @ApiImplicitParam(value = "类型(1=用户协议,2=隐私协议,3=技师上门免责声明,4=注销协议,5门店提现免责声明)", name = "type", required = true, dataType = "int"), }) public AjaxResult<String> getAgreement(@PathVariable("type") Integer type){ public R<String> getAgreement(@PathVariable("type") Integer type){ Agreement one = agreementService.getOne(new LambdaQueryWrapper<Agreement>().eq(Agreement::getType, type)); return AjaxResult.success(null == one ? "" : one.getContent()); return R.ok(null == one ? "" : one.getContent()); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java
@@ -24,12 +24,12 @@ */ @RestController @RequestMapping("/banner") @Api("轮播图") @Api(tags = "轮播图") public class BannerController { @Resource private BannerService bannerService; @PostMapping("/index/list") @ApiOperation(value = "banner列表", tags = {"小程序-首页"}) @GetMapping("/list") @ApiOperation(value = "banner列表", tags = {"小程序-banner"}) public R<List<Banner>> list(String name, Integer jumpType, Integer position){ List<Banner> list = bannerService.lambdaQuery().like(StringUtils.isNotEmpty(name), Banner::getName, name) .eq(Banner::getJumpType, jumpType) ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsAreaController.java
New file @@ -0,0 +1,45 @@ package com.ruoyi.other.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.GoodsArea; import com.ruoyi.other.service.GoodsAreaService; 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; /** * @author zhibing.pu * @Date 2024/11/28 9:35 */ @RestController @RequestMapping("/goodsArea") public class GoodsAreaController { @Resource private GoodsAreaService goodsAreaService; /** * 根据省市区获取地区价格配置 * @param area * @return */ @PostMapping("/getGoodsArea") public R<GoodsArea> getGoodsArea(@RequestBody GoodsArea area){ GoodsArea one = goodsAreaService.getOne(new LambdaQueryWrapper<GoodsArea>().eq(GoodsArea::getDistrictsCode, area.getDistrictsCode()).eq(GoodsArea::getVip, area.getVip())); if(null == one){ one = goodsAreaService.getOne(new LambdaQueryWrapper<GoodsArea>().eq(GoodsArea::getCityCode, area.getCityCode()).eq(GoodsArea::getVip, area.getVip())); if(null == one){ one = goodsAreaService.getOne(new LambdaQueryWrapper<GoodsArea>().eq(GoodsArea::getProvinceCode, area.getProvinceCode()).eq(GoodsArea::getVip, area.getVip())); } } return R.ok(one); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsBargainPriceController.java
@@ -1,8 +1,19 @@ package com.ruoyi.other.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.GoodsBargainPrice; import com.ruoyi.other.api.domain.GoodsBargainPriceDetail; import com.ruoyi.other.api.vo.GetGoodsBargainPrice; import com.ruoyi.other.service.GoodsBargainPriceDetailService; import com.ruoyi.other.service.GoodsBargainPriceService; 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> @@ -15,6 +26,33 @@ @RestController @RequestMapping("/goods-bargain-price") public class GoodsBargainPriceController { @Resource private GoodsBargainPriceService goodsBargainPriceService; @Resource private GoodsBargainPriceDetailService goodsBargainPriceDetailService; /** * 根据商品id和会员等级获取门店特价 * @param goodsBargainPrice * @return */ @PostMapping("/getGoodsBargainPrice") public R<GoodsBargainPriceDetail> getGoodsBargainPrice(@RequestBody GetGoodsBargainPrice goodsBargainPrice){ GoodsBargainPrice one = goodsBargainPriceService.getOne(new LambdaQueryWrapper<GoodsBargainPrice>().eq(GoodsBargainPrice::getGoodsId, goodsBargainPrice.getGoodsId()) .eq(GoodsBargainPrice::getShopId, goodsBargainPrice.getShopId()).eq(GoodsBargainPrice::getAuditStatus, 1).eq(GoodsBargainPrice::getDelFlag, 0) .orderByDesc(GoodsBargainPrice::getCreateTime).last(" limit 0,1")); if(null == one){ return R.ok(); } GoodsBargainPriceDetail detailServiceOne = goodsBargainPriceDetailService.getOne(new LambdaQueryWrapper<GoodsBargainPriceDetail>() .eq(GoodsBargainPriceDetail::getGoodsBargainPriceId, one.getId()).eq(GoodsBargainPriceDetail::getVip, goodsBargainPrice.getVip())); return R.ok(detailServiceOne); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java
@@ -6,6 +6,8 @@ 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; @@ -40,12 +42,12 @@ .last("limit 8") .list() ; return R.ok(list); return R.ok(indexlist); } @GetMapping("/list") @ApiOperation(value = "商品分类列表", tags = {"小程序-商城-商城-首页-筛选"}) public AjaxResult list(){ return AjaxResult.success(goodsCategoryService.list()); public R<List<GoodsCategory>> list(){ return R.ok(goodsCategoryService.list()); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
@@ -1,19 +1,21 @@ package com.ruoyi.other.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.service.GoodsService; import com.ruoyi.other.vo.GoodsVO; 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 io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; /** * <p> @@ -25,7 +27,7 @@ */ @RestController @RequestMapping("/goods") @Api("商品") @Api(tags = "商品") public class GoodsController extends BaseController { @Resource private GoodsService goodsService; @@ -34,21 +36,46 @@ * 商品列表 */ @GetMapping("/goodsList") @ApiOperation(value = "商品列表", tags = {"小程序-商城-首页-热门商品列表"}) @ApiOperation(value = "商品列表", tags = {"小程序-商城-首页-热门商品列表", "首页热门商品-小程序"}) public TableDataInfo goodsList(Goods goods){ startPage(); return getDataTable(goodsService.goodsList(goods)); } /** * 指定门店商品 */ @GetMapping("/getGoodsListByShopId") @ApiOperation(value = "商品列表", tags = {"小程序-首页-门店详情-商品购买列表"}) public TableDataInfo getGoodsListByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { startPage(); List<Goods> goods = goodsService.getGoodsListByShopId(shopId); return getDataTable(goods); } /** * 商品详情 */ @GetMapping("/goodsDetail/{goodsId}") @ApiOperation(value = "商品详情", tags = {"小程序-商城-首页-商品详情"}) public AjaxResult goodsDetail(@PathVariable("goodsId") Long goodsId){ return success(goodsService.goodsDetail(goodsId)); public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId){ return R.ok(goodsService.goodsDetail(goodsId)); } /** * 根据类型(1=服务商品,2=单品商品)获取商品数据 * @param type * @return */ @ResponseBody @PostMapping("/getGoodsByType") public R<List<Goods>> getGoodsByType(@RequestParam("type") Integer type){ List<Goods> list = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, type).eq(Goods::getDelFlag, 0).eq(Goods::getStatus, 2)); return R.ok(list); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsShopController.java
@@ -1,8 +1,13 @@ package com.ruoyi.other.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.other.api.domain.GoodsShop; import com.ruoyi.other.service.GoodsShopService; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; /** * <p> @@ -16,5 +21,23 @@ @RequestMapping("/goods-shop") public class GoodsShopController { @Resource private GoodsShopService goodsShopService; /** * 获取商品门店关系数据 * @param goodsShop * @return */ @ResponseBody @PostMapping("/getGoodsShop") public R<GoodsShop> getGoodsShop(@RequestBody GoodsShop goodsShop){ GoodsShop one = goodsShopService.getOne(new LambdaQueryWrapper<GoodsShop>().eq(GoodsShop::getGoodsId, goodsShop.getGoodsId()) .eq(GoodsShop::getShopId, goodsShop.getShopId())); return R.ok(one); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsVipController.java
@@ -1,8 +1,13 @@ package com.ruoyi.other.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.other.api.domain.GoodsVip; import com.ruoyi.other.service.GoodsVipService; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; /** * <p> @@ -16,5 +21,20 @@ @RequestMapping("/goods-vip") public class GoodsVipController { @Resource private GoodsVipService goodsVipService; /** * 获取会员价格配置 * @param vip * @return */ @PostMapping("/getGoodsVip") public R<GoodsVip> getGoodsVip(@RequestParam("vip") Integer vip){ GoodsVip one = goodsVipService.getOne(new LambdaQueryWrapper<GoodsVip>().eq(GoodsVip::getVip, vip)); return R.ok(one); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PersonalCenterController.java
File was deleted ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PhoneController.java
@@ -1,8 +1,22 @@ package com.ruoyi.other.controller; 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.other.api.domain.Phone; import com.ruoyi.other.enums.PhoneType; import com.ruoyi.other.service.PhoneService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.List; /** * <p> @@ -14,7 +28,20 @@ */ @RestController @RequestMapping("/phone") public class PhoneController { @Api("手机") public class PhoneController extends BaseController { @Resource private PhoneService phoneService; /** * 查询指定门店手机号 */ @GetMapping("/selectPhoneByShopId") @ApiOperation(value = "查询指定门店手机号", tags = {"小程序-门店详情"}) public R<List<Phone>> getPhoneByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { return R.ok(phoneService.list(new LambdaQueryWrapper<Phone>() .eq(Phone::getType, PhoneType.SHOP.getCode()) .eq(Phone::getShopId, shopId))); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RegionController.java
New file @@ -0,0 +1,44 @@ package com.ruoyi.other.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.Region; import com.ruoyi.other.service.RegionService; 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; @RestController @RequestMapping("/region") @Api("地区") public class RegionController { @Resource private RegionService regionService; /** * 获取省份列表 */ @GetMapping("/getProvinceList") @ApiOperation("获取省份列表") public R<List<Region>> getProvinceList() { return R.ok(regionService.list(new LambdaQueryWrapper<Region>() .eq(Region::getParentId, 0))); } /** * 获取下级地区列表 */ @GetMapping("/getNextRegionList") @ApiOperation("获取下级地区列表") public R<List<Region>> getNextRegionList(@ApiParam("父级id") @RequestParam Long id) { return R.ok(regionService.list(new LambdaQueryWrapper<Region>() .eq(Region::getParentId, id))); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SeckillActivityInfoController.java
@@ -1,18 +1,26 @@ package com.ruoyi.other.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.GoodsSeckill; import com.ruoyi.other.api.domain.SeckillActivityInfo; import com.ruoyi.other.api.vo.GetSeckillActivityInfo; import com.ruoyi.other.service.GoodsSeckillService; 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 org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalUnit; import java.util.List; /** * <p> @@ -28,6 +36,13 @@ public class SeckillActivityInfoController extends BaseController { @Resource private SeckillActivityInfoService seckillActivityInfoService; @Resource private GoodsSeckillService goodsSeckillService; /** * 秒杀活动列表 @@ -49,6 +64,26 @@ { return AjaxResult.success(seckillActivityInfoService.detail(id)); } /** * 根据商品id和会员等级获取对应的秒杀活动 * @param info * @return */ @PostMapping("/getSeckillActivityInfo") public R<GoodsSeckill> getSeckillActivityInfo(@RequestBody GetSeckillActivityInfo info){ SeckillActivityInfo one = seckillActivityInfoService.getOne(new LambdaQueryWrapper<SeckillActivityInfo>().eq(SeckillActivityInfo::getGoodId, info.getGoodsId()) .eq(SeckillActivityInfo::getDelFlag, 0).last(" and now() between start_time and end_time order by create_time limit 0,1")); if(null == one){ return R.ok(); } GoodsSeckill goodsSeckill = goodsSeckillService.getOne(new LambdaQueryWrapper<GoodsSeckill>().eq(GoodsSeckill::getSeckillActivityInfoId, one.getGoodId()).eq(GoodsSeckill::getVip, info.getVip())); if(null != goodsSeckill){ goodsSeckill.setEndTime(one.getEndTime().toEpochSecond(ZoneOffset.UTC) * 1000); } return R.ok(goodsSeckill); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java
@@ -2,10 +2,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.other.enums.ShareAddType; import com.ruoyi.other.api.domain.Share; import com.ruoyi.other.enums.ShareAddType; import com.ruoyi.other.enums.ShareAuditStatus; import com.ruoyi.other.service.ShareService; import io.swagger.annotations.Api; @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; /** * <p> @@ -24,7 +25,7 @@ * @author luodangjia * @since 2024-11-20 */ @Api("分享") @Api(tags = "分享") @RestController @RequestMapping("/share") public class ShareController extends BaseController { @@ -39,8 +40,8 @@ @ApiImplicitParam(value = "对象id(addType=1:平台添加,addType=2:推广人添加,addType=3:门店添加)", name = "objectId", required = true, dataType = "int"), }) @GetMapping("/list") public AjaxResult list(@RequestParam Integer objectId){ return AjaxResult.success(shareService.list(new LambdaQueryWrapper<Share>() public R<List<Share>> list(@RequestParam Integer objectId){ return R.ok(shareService.list(new LambdaQueryWrapper<Share>() .eq(Share::getObjectId, objectId))); } @@ -48,14 +49,15 @@ /** * 分享添加 */ @ApiOperation(value = "小程序-个人中心-门店管理-分享添加", tags = {"分享添加-小程序"}) @ApiOperation(value = "分享添加", tags = {"小程序-个人中心-门店管理-分享添加"}) @PostMapping public AjaxResult add(@RequestBody Share share){ public R<Void> 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)); shareService.save(share); return R.ok(); } /** @@ -63,8 +65,9 @@ */ @ApiOperation(value = "分享删除", tags = {"小程序-个人中心-门店管理-分享删除-小程序"}) @DeleteMapping public AjaxResult delete(@RequestBody Share share){ return toAjax(shareService.removeById(share)); public R<Void> delete(@RequestBody Share share){ shareService.removeById(share); return R.ok(); } /** @@ -72,9 +75,10 @@ */ @ApiOperation(value = "分享编辑", tags = {"小程序-个人中心-门店管理-分享编辑-小程序"}) @PutMapping public AjaxResult edit(@RequestBody Share share){ public R<Void> edit(@RequestBody Share share){ share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); return toAjax(shareService.updateById(share)); shareService.updateById(share); return R.ok(); } /** @@ -82,8 +86,8 @@ */ @ApiOperation(value = "分享详情", tags = {"小程序-个人中心-门店管理-分享详情-小程序"}) @GetMapping("/detail/{id}") public AjaxResult detail(@PathVariable("id") Integer id){ return AjaxResult.success(shareService.getById(id)); public R<Share> detail(@PathVariable("id") Integer id){ return R.ok(shareService.getById(id)); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -6,10 +6,8 @@ import com.ruoyi.account.api.model.AppUser; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.security.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; @@ -17,13 +15,18 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.*; import com.ruoyi.other.vo.NearbyShopVO; import com.ruoyi.other.vo.ShopDetailVO; import com.ruoyi.other.vo.VerifiableShopVo; import io.swagger.annotations.*; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; /** * <p> * 前端控制器 * 前端控制器 * </p> * * @author luodangjia @@ -31,7 +34,7 @@ */ @RestController @RequestMapping("/shop") @Api("门店") @Api(tags = "门店") public class ShopController extends BaseController { @Resource private TechnicianService technicianService; @@ -53,14 +56,13 @@ */ @GetMapping("/nearbyShopList") @ApiOperation(value = "附近门店列表", tags = {"小程序-首页-附近门店列表"}) public AjaxResult nearbyShopList(@ApiParam("经度") @RequestParam String longitude, @ApiParam("纬度") @RequestParam String latitude){ return success(shopService.nearbyShopList(longitude,latitude)); public R<List<NearbyShopVO>> nearbyShopList(@ApiParam("经度") @RequestParam String longitude, @ApiParam("纬度") @RequestParam String latitude) { return R.ok(shopService.nearbyShopList(longitude, latitude)); } /** * 指定门店技师列表 * 门店详情 */ @GetMapping("/technicianList") @ApiOperation(value = "技师列表", tags = {"技师列表-小程序"}) @@ -71,16 +73,24 @@ .eq(Technician::getSubscribeStatus,1))); } @GetMapping("/shopDetail") @ApiOperation(value = "门店详情", tags = {"小程序-首页-门店详情"}) public R<ShopDetailVO> shopDetail(@ApiParam("门店id") @RequestParam Integer shopId, @ApiParam("经度") @RequestParam String longitude, @ApiParam("纬度") @RequestParam String latitude) { return R.ok(shopService.getShopDetail(shopId, longitude, latitude)); } /** * 查询当前店长所属门店 */ @GetMapping("/shopByUser") @ApiOperation(value = "查询当前店长所属门店", tags = {"小程序-个人中心-首页-关联门店列表"}) public AjaxResult shopByUser(){ @ApiOperation(value = "查询当前店长所属门店", tags = {"小程序-个人中心-首页"}, notes = "可绑定的门店列表") public R<List<Shop>> 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); return R.ok(list); } /** @@ -88,13 +98,21 @@ */ @GetMapping("/bindShop") @ApiOperation(value = "绑定门店", tags = {"小程序-个人中心-绑定门店"}) public AjaxResult bindShop(@ApiParam("门店id") @RequestParam Long shopId){ public R<Void> bindShop(@ApiParam("门店id") @RequestParam Long shopId) { AppUser appUser = appUserClient.getAppUserById(SecurityUtils.getUserId()); appUser.setShopId(shopId); appUserClient.editAppUserById(appUser); return success(); return R.ok(); } @ResponseBody @GetMapping("/getVerifiableShop") @ApiOperation(value = "获取可核销门店列表", tags = {"购物车-小程序"}) public R<List<VerifiableShopVo>> getVerifiableShop(){ // todo 待完善 pu return R.ok(); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShoppingCartController.java
File was deleted ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
@@ -18,6 +18,20 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.other.service.TechnicianService; import com.ruoyi.other.vo.TechnicianDetailVO; import com.ruoyi.other.vo.TechnicianVO; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.List; /** * <p> @@ -97,5 +111,22 @@ } /** * 指定门店技师列表 */ @GetMapping("/technicianListByShopId") @ApiOperation(value = "技师列表", tags = {"技师列表-小程序"}) public R<List<TechnicianVO>> technicianListByShopId(@ApiParam("门店id") @RequestParam Long shopId) { return R.ok(technicianService.getTechnicianListByShopId(shopId)); } /** * 技师详情 */ @GetMapping("/technicianDetail") @ApiOperation(value = "技师详情", tags = {"技师详情-小程序"}) public R<TechnicianDetailVO> technicianDetail(@ApiParam("技师id") @RequestParam Long technicianId) { return R.ok(technicianService.technicianDetail(technicianId)); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java
@@ -2,8 +2,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.other.api.domain.TechnicianSubscribe; @@ -12,10 +12,7 @@ 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 org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; @@ -49,21 +46,31 @@ } /** * 预约技师 */ @PostMapping("/subscribe") @ApiOperation(value = "预约技师", notes = "预约技师", tags = {"小程序-个人中心-门店管理-预约列表-预约技师"}) public R<Void> subscribe(@RequestBody TechnicianSubscribe technicianSubscribe){ technicianSubscribeService.subscribe(technicianSubscribe); return R.ok(); } /** * 取消服务 */ @GetMapping("/cancel") @ApiOperation(value = "取消服务", notes = "取消服务", tags = {"小程序-个人中心-门店管理-预约列表-取消服务","小程序-个人中心-我的预约"}) public AjaxResult cancel(@ApiParam(value = "预约id") @RequestParam Long id){ @ApiOperation(value = "取消服务", notes = "取消服务", tags = {"小程序-个人中心-门店管理-预约列表-取消服务"}) public R<Void> 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("不满足取消条件"); return R.fail("不满足取消条件"); } subscribe.setStatus(2); technicianSubscribeService.updateById(subscribe); return success(); return R.ok(); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java
@@ -7,11 +7,20 @@ 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; 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.RestController; import javax.annotation.Resource; import java.util.List; import javax.annotation.Resource; /** * <p> @@ -23,6 +32,7 @@ */ @RestController @RequestMapping("/vip-setting") @Api("会员设置") public class VipSettingController { @Resource private VipSettingService vipSettingService; @@ -32,5 +42,12 @@ List<VipSetting> list = vipSettingService.list(); return R.ok(list); } @GetMapping("getVipSettingById") @ApiOperation(value = "获取会员设置") public R<VipSetting> getVipSettingById(@ApiParam(value = "会员id") Integer id){ return R.ok(vipSettingService.getById(id)); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/GoodsStatus.java
@@ -1,22 +1,18 @@ package com.ruoyi.other.enums; import lombok.Getter; @Getter public enum GoodsStatus { DOWN(0, "下架"), UP(1, "上架"); private Integer code; private String desc; private final Integer code; private final String desc; GoodsStatus(Integer code, String desc) { this.code = code; this.desc = desc; } public Integer getCode() { return code; } public String getDesc() { return desc; } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/PhoneType.java
New file @@ -0,0 +1,18 @@ package com.ruoyi.other.enums; import lombok.Getter; @Getter public enum PhoneType { PLATFORM(1, "平台"), SHOP(2, "门店"); private final Integer code; private final String desc; PhoneType(Integer code, String desc) { this.code = code; this.desc = desc; } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/ShareAuditStatus.java
@@ -1,5 +1,8 @@ package com.ruoyi.other.enums; import lombok.Getter; @Getter public enum ShareAuditStatus { WAIT(0, "待审核"), SUCCESS(1, "审核通过"), @@ -13,11 +16,4 @@ this.message = message; } public Integer getCode() { return code; } public String getMessage() { return message; } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/TechnicianErrorCode.java
New file @@ -0,0 +1,18 @@ package com.ruoyi.other.enums; import lombok.Getter; @Getter public enum TechnicianErrorCode { TECHNICIAN_ALREADY_SUBSCRIBED(1001, "该技师已被预约"), ; private final int code; private final String message; TechnicianErrorCode(int code, String message) { this.code = code; this.message = message; } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/filter/AuthFilter.java
@@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.feignClient.SysUserClient; import org.apache.logging.log4j.core.config.Order; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -68,7 +69,7 @@ //小程序用户 if ("applet".equals(userType)) { AppUser appUser = appUserClient.getAppUserById(Long.valueOf(userid)); if(null == appUser || 1 == appUser.getDelFlag() || 3 == appUser.getStatus()){ if(null == appUser || appUser.getDelFlag() || 3 == appUser.getStatus()){ log.error("[账户异常处理]请求账户id:{}", userid); unauthorizedResponse(response,"无效的账户"); return; ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/AgreementMapper.java
@@ -1,7 +1,7 @@ package com.ruoyi.other.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.model.Agreement; import com.ruoyi.other.api.domain.Agreement; /** * @author zhibing.pu ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsAreaMapper.java
New file @@ -0,0 +1,7 @@ package com.ruoyi.other.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.GoodsArea; public interface GoodsAreaMapper extends BaseMapper<GoodsArea> { } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsMapper.java
@@ -3,6 +3,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.Goods; import java.util.List; /** * <p> * Mapper 接口 @@ -12,5 +14,5 @@ * @since 2024-11-20 */ public interface GoodsMapper extends BaseMapper<Goods> { List<Goods> selectListByShopId(Integer shopId, String vip); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/RegionMapper.java
New file @@ -0,0 +1,7 @@ package com.ruoyi.other.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.Region; public interface RegionMapper extends BaseMapper<Region> { } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.Shop; import com.ruoyi.other.vo.NearbyShopVO; import com.ruoyi.other.vo.ShopDetailVO; import java.util.List; @@ -17,4 +18,7 @@ public interface ShopMapper extends BaseMapper<Shop> { List<NearbyShopVO> selectNearbyShopList(String longitude, String latitude); ShopDetailVO selectShopDetail(Integer shopId); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianMapper.java
@@ -2,6 +2,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.Technician; import com.ruoyi.other.vo.TechnicianDetailVO; import com.ruoyi.other.vo.TechnicianVO; import java.util.List; /** * <p> @@ -13,4 +17,8 @@ */ public interface TechnicianMapper extends BaseMapper<Technician> { List<TechnicianVO> selectTechnicianListByShopId(Long shopId); TechnicianDetailVO selectTechnicianDetail(Long technicianId); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/VipGoodMapper.java
@@ -13,4 +13,9 @@ */ public interface VipGoodMapper extends BaseMapper<VipGood> { /** * 查询指定商品的指定会员价格 */ VipGood selectVipGood(Long goodsId, Integer vipId); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsAreaService.java
New file @@ -0,0 +1,7 @@ package com.ruoyi.other.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.other.api.domain.GoodsArea; public interface GoodsAreaService extends IService<GoodsArea> { } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java
@@ -19,4 +19,6 @@ List<GoodsVO> goodsList(Goods goods); GoodsVO goodsDetail(Long goodsId); List<Goods> getGoodsListByShopId(Integer shopId); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/IAgreementService.java
@@ -1,7 +1,7 @@ package com.ruoyi.other.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.other.api.model.Agreement; import com.ruoyi.other.api.domain.Agreement; /** * @author zhibing.pu ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/RegionService.java
New file @@ -0,0 +1,7 @@ package com.ruoyi.other.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.other.api.domain.Region; public interface RegionService extends IService<Region> { } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java
@@ -1,8 +1,10 @@ package com.ruoyi.other.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.Shop; import com.ruoyi.other.vo.NearbyShopVO; import com.ruoyi.other.vo.ShopDetailVO; import java.util.List; @@ -17,4 +19,6 @@ public interface ShopService extends IService<Shop> { List<NearbyShopVO> nearbyShopList(String longitude, String latitude); ShopDetailVO getShopDetail(Integer shopId,String longitude, String latitude); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShoppingCartService.java
File was deleted ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianService.java
@@ -2,6 +2,10 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.other.api.domain.Technician; import com.ruoyi.other.vo.TechnicianDetailVO; import com.ruoyi.other.vo.TechnicianVO; import java.util.List; /** * <p> @@ -12,5 +16,7 @@ * @since 2024-11-20 */ public interface TechnicianService extends IService<Technician> { List<TechnicianVO> getTechnicianListByShopId(Long shopId); TechnicianDetailVO technicianDetail(Long technicianId); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java
@@ -22,4 +22,5 @@ List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long userId, Long shopId); List<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Long userId, Integer status); void subscribe(TechnicianSubscribe technicianSubscribe); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/VipSettingService.java
@@ -13,4 +13,5 @@ */ public interface VipSettingService extends IService<VipSetting> { VipSetting getVipSettingByUserId(Long userId); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/AgreementServiceImpl.java
@@ -1,7 +1,7 @@ package com.ruoyi.other.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.other.api.model.Agreement; import com.ruoyi.other.api.domain.Agreement; import com.ruoyi.other.mapper.AgreementMapper; import com.ruoyi.other.service.IAgreementService; import org.springframework.stereotype.Service; ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsAreaServiceImpl.java
New file @@ -0,0 +1,16 @@ package com.ruoyi.other.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.other.api.domain.GoodsArea; import com.ruoyi.other.mapper.GoodsAreaMapper; import com.ruoyi.other.service.GoodsAreaService; import org.springframework.stereotype.Service; import javax.annotation.Resource; @Service public class GoodsAreaServiceImpl extends ServiceImpl<GoodsAreaMapper, GoodsArea> implements GoodsAreaService { @Resource private GoodsAreaMapper goodsAreaMapper; } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -1,23 +1,27 @@ package com.ruoyi.other.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.json.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.common.security.service.TokenService; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.VipSetting; import com.ruoyi.other.enums.GoodsStatus; import com.ruoyi.other.mapper.GoodsAreaMapper; import com.ruoyi.other.mapper.GoodsMapper; import com.ruoyi.other.service.GoodsService; import com.ruoyi.other.service.GoodsVipService; import com.ruoyi.other.service.VipSettingService; import com.ruoyi.other.vo.GoodsVO; import feignClient.RemoteOrderGoodsClient; import model.OrderGood; import com.ruoyi.system.api.model.LoginUser; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** * <p> @@ -30,7 +34,15 @@ @Service public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService { @Resource private RemoteOrderGoodsClient orderGoodsClient; private GoodsMapper goodsMapper; @Resource private TokenService tokenService; @Resource private VipSettingService vipSettingService; @Resource private GoodsAreaMapper goodsAreaMapper; @Resource private GoodsVipService goodsVipService; @Override public List<GoodsVO> goodsList(Goods search) { @@ -50,7 +62,11 @@ @Override public GoodsVO goodsDetail(Long goodsId) { // TODO 根据会员等级展示价格 // TODO 根据会员等级计算价格、积分 LoginUser loginUserApplet = tokenService.getLoginUserApplet(); VipSetting vipSetting = vipSettingService.getVipSettingByUserId(loginUserApplet.getUserid()); // ... Goods goods = this.getById(goodsId); if (Objects.nonNull(goods)){ GoodsVO goodsVO = new GoodsVO(); @@ -59,4 +75,14 @@ } return new GoodsVO(); } @Override public List<Goods> getGoodsListByShopId(Integer shopId) { LoginUser loginUserApplet = tokenService.getLoginUserApplet(); VipSetting vipSetting = vipSettingService.getVipSettingByUserId(loginUserApplet.getUserid()); JSONArray array = new JSONArray(); array.add(vipSetting.getId()); return goodsMapper.selectListByShopId(shopId,array.toString()); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/RegionServiceImpl.java
New file @@ -0,0 +1,11 @@ package com.ruoyi.other.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.other.api.domain.Region; import com.ruoyi.other.mapper.RegionMapper; import com.ruoyi.other.service.RegionService; import org.springframework.stereotype.Service; @Service public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements RegionService { } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
@@ -1,14 +1,22 @@ package com.ruoyi.other.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.core.utils.GeodesyUtil; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.mapper.GoodsMapper; import com.ruoyi.other.mapper.ShopMapper; import com.ruoyi.other.api.domain.Shop; import com.ruoyi.other.service.ShopService; import com.ruoyi.other.vo.NearbyShopVO; import com.ruoyi.other.vo.ShopDetailVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; /** * <p> @@ -27,4 +35,22 @@ public List<NearbyShopVO> nearbyShopList(String longitude, String latitude) { return shopMapper.selectNearbyShopList(longitude,latitude); } @Override public ShopDetailVO getShopDetail(Integer shopId, String longitude, String latitude) { // 查询店铺详情 ShopDetailVO shopDetailVO = shopMapper.selectShopDetail(shopId); if (shopDetailVO == null) { throw new ServiceException("查询店铺不存在"); } // 计算距离 String shopLocation = String.format("%s,%s", shopDetailVO.getLongitude(), shopDetailVO.getLatitude()); String userLocation = String.format("%s,%s", longitude, latitude); Map<String, Double> distanceMap = GeodesyUtil.getDistance(userLocation, shopLocation); Double wGs84 = distanceMap.get("WGs84"); shopDetailVO.setDistance(wGs84); return shopDetailVO; } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShoppingCartServiceImpl.java
File was deleted ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianServiceImpl.java
@@ -4,7 +4,13 @@ import com.ruoyi.other.mapper.TechnicianMapper; import com.ruoyi.other.api.domain.Technician; import com.ruoyi.other.service.TechnicianService; import com.ruoyi.other.vo.TechnicianDetailVO; import com.ruoyi.other.vo.TechnicianVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Collections; import java.util.List; /** * <p> @@ -16,5 +22,16 @@ */ @Service public class TechnicianServiceImpl extends ServiceImpl<TechnicianMapper, Technician> implements TechnicianService { @Resource private TechnicianMapper technicianMapper; @Override public List<TechnicianVO> getTechnicianListByShopId(Long shopId) { return technicianMapper.selectTechnicianListByShopId(shopId); } @Override public TechnicianDetailVO technicianDetail(Long technicianId) { return technicianMapper.selectTechnicianDetail(technicianId); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -1,19 +1,26 @@ package com.ruoyi.other.service.impl; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.other.mapper.TechnicianSubscribeMapper; import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.other.api.domain.Technician; import com.ruoyi.other.api.domain.TechnicianSubscribe; import com.ruoyi.other.enums.TechnicianErrorCode; import com.ruoyi.other.mapper.TechnicianMapper; import com.ruoyi.other.mapper.TechnicianSubscribeMapper; import com.ruoyi.other.service.TechnicianSubscribeService; import com.ruoyi.other.vo.TechnicianSubscribeVO; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.Collections; import java.time.LocalDateTime; import java.util.List; /** * <p> * 服务实现类 * 服务实现类 * </p> * * @author luodangjia @@ -23,6 +30,8 @@ public class TechnicianSubscribeServiceImpl extends ServiceImpl<TechnicianSubscribeMapper, TechnicianSubscribe> implements TechnicianSubscribeService { @Resource private TechnicianSubscribeMapper technicianSubscribeMapper; @Resource private TechnicianMapper technicianMapper; @Override public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long userId, Long shopId) { @@ -32,4 +41,28 @@ public List<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Long userId, Integer status) { return technicianSubscribeMapper.getTechnicianSubscribeByUser(userId, status); } @Override @Transactional(rollbackFor = Exception.class) public void subscribe(TechnicianSubscribe technicianSubscribe) { // 创建技师预约单 Long technicianId = technicianSubscribe.getTechnicianId(); Long userId = SecurityUtils.getUserId(); TechnicianSubscribe subscribe = new TechnicianSubscribe(); subscribe.setAppUserId(userId); subscribe.setDelFlag(0); subscribe.setCreateTime(LocalDateTime.now()); technicianSubscribeMapper.insert(subscribe); // 更新技师状态 UpdateWrapper<Technician> updateWrapper = new UpdateWrapper<>(); updateWrapper.eq("id", technicianId); updateWrapper.eq("subscribe_status", 1); updateWrapper.eq("status", 2); updateWrapper.set("subscribe_status", 2); updateWrapper.set("create_time", LocalDateTime.now()); int update = technicianMapper.update(null, updateWrapper); if (update == 0){ throw new ServiceException("该技师已被预约", TechnicianErrorCode.TECHNICIAN_ALREADY_SUBSCRIBED.getCode()); } } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/VipSettingServiceImpl.java
@@ -1,10 +1,15 @@ package com.ruoyi.other.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.api.feignClient.AppUserClient; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.other.mapper.VipSettingMapper; import com.ruoyi.other.api.domain.VipSetting; import com.ruoyi.other.service.VipSettingService; import org.springframework.stereotype.Service; import javax.annotation.Resource; /** * <p> @@ -16,5 +21,15 @@ */ @Service public class VipSettingServiceImpl extends ServiceImpl<VipSettingMapper, VipSetting> implements VipSettingService { @Resource private AppUserClient appUserClient; @Override public VipSetting getVipSettingByUserId(Long userId) { AppUser appUser = appUserClient.getAppUserById(userId); if(null == appUser){ throw new ServiceException("用户不存在"); } return this.getById(appUser.getVipId()); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/Home.java
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; @Data @ApiModel(value="首页用户信息", description="") public class Home { @@ -80,7 +82,7 @@ * 评分 */ @ApiModelProperty(value = "评分") private Integer score; private BigDecimal score; /** * 经度 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java
@@ -18,7 +18,4 @@ @ApiModelProperty(value = "详细地址") private String address; @ApiModelProperty(value = "距离") private String distance; } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopDetailVO.java
New file @@ -0,0 +1,70 @@ package com.ruoyi.other.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.List; @Data @ApiModel(value = "门店详情") public class ShopDetailVO { /** * 主键 */ @ApiModelProperty(value = "主键") private Integer id; /** * 门店名称 */ @ApiModelProperty(value = "门店名称") private String name; @ApiModelProperty(value = "详情图,多个逗号分隔") private String detailsPicture; @ApiModelProperty(value = "资质证书图片") private String certification; @ApiModelProperty(value = "营业星期(1,2,3,4,5,6,7)") private String businessDate; @ApiModelProperty(value = "开始时间(HH:mm)") private String startTime; @ApiModelProperty(value = "结束时间(HH:mm)") private String endTime; /** * 联系电话 */ @ApiModelProperty(value = "联系电话") private List<String> phones; /** * 评分 */ @ApiModelProperty(value = "评分") private BigDecimal score; /** * 地址 */ @ApiModelProperty(value = "地址") private String address; /** * 距离 */ @ApiModelProperty(value = "距离") private Double distance; @ApiModelProperty(value = "经度") private String longitude; @ApiModelProperty(value = "纬度") private String latitude; } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianDetailVO.java
New file @@ -0,0 +1,50 @@ package com.ruoyi.other.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; @Data public class TechnicianDetailVO { /** * 主键 */ @ApiModelProperty(value = "主键") private Long id; /** * 技师姓名 */ @ApiModelProperty(value = "技师姓名") private String name; /** * 服务次数 */ @ApiModelProperty(value = "服务次数") private Integer serviceCount; /** * 评分 */ @ApiModelProperty(value = "评分") private BigDecimal score; /** * 简介 */ @ApiModelProperty(value = "简介") private String introduction; /** * 技师封面图 */ @ApiModelProperty(value = "技师封面图") private String homePicture; @ApiModelProperty(value = "技师详情图") private String infoPicture; } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianVO.java
New file @@ -0,0 +1,28 @@ package com.ruoyi.other.vo; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; @Data public class TechnicianVO { @ApiModelProperty(value = "主键") private Long id; @ApiModelProperty(value = "技师姓名") private String name; @ApiModelProperty(value = "简介") private String introduction; @ApiModelProperty(value = "服务次数") private Integer serviceCount; @ApiModelProperty(value = "技师封面图") private String homePicture; @ApiModelProperty(value = "评分") private BigDecimal score; } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/VerifiableShopVo.java
New file @@ -0,0 +1,18 @@ package com.ruoyi.other.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author zhibing.pu * @Date 2024/11/25 12:08 */ @Data @ApiModel public class VerifiableShopVo { @ApiModelProperty("门店id") private Integer id; @ApiModelProperty("门店名称") private String name; } ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsAreaMapper.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.other.mapper.GoodsAreaMapper"> </mapper> ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml
@@ -2,4 +2,24 @@ <!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"> <select id="selectListByShopId" resultType="com.ruoyi.other.api.domain.Goods"> SELECT tg.id, tg.`name`, tg.type, tg.introduction, tg.selling_price, tg.original_price, tg.sale_num, tg.home_page_picture FROM t_shop ts LEFT JOIN t_goods_shop tgs ON ts.id = tgs.shop_id LEFT JOIN t_goods tg ON tg.id = tgs.goods_id where ts.id = #{shopId} <if test="vip != null"> and JSON_CONTAINS(commodity_authority, #{vip}) </if> ORDER BY tg.sale_num DESC </select> </mapper> ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml
@@ -3,6 +3,49 @@ <mapper namespace="com.ruoyi.other.mapper.ShopMapper"> <select id="selectNearbyShopList" resultType="com.ruoyi.other.vo.NearbyShopVO"> SELECT id, home_picture, name, address, ( 6371 * acos( cos( radians(#{latitude})) * cos( radians(latitude)) * cos( radians(longitude) - radians(#{longitude})) + sin( radians(#{latitude})) * sin( radians(latitude)) )) AS distance FROM t_shop where del_flag = 0 and status = 1 ORDER BY distance </select> <select id="selectShopDetail" resultType="com.ruoyi.other.vo.ShopDetailVO"> SELECT ts.id, ts.details_picture, ts.certification, ts.`name`, ts.address, ts.business_date, ts.start_time, ts.end_time, AVG( tss.score ) score FROM t_shop ts LEFT JOIN t_shop_score tss ON ts.id = tss.shop_id WHERE ts.del_flag = 0 AND ts.`status` = 1 AND id = #{id} GROUP BY ts.id, ts.details_picture, ts.certification, ts.`name`, ts.address, ts.business_date, ts.start_time, ts.end_time </select> </mapper> ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShoppingCartMapper.xml
File was deleted ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianMapper.xml
New file @@ -0,0 +1,54 @@ <?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.TechnicianMapper"> <select id="selectTechnicianListByShopId" resultType="com.ruoyi.other.vo.TechnicianVO"> SELECT tt.id, tt.`name`, tt.introduction, tt.home_picture, COUNT(tts.id) AS serviceCount, AVG(ttsc.score) AS score FROM t_technician tt LEFT JOIN t_technician_subscribe tts ON tt.id = tts.technician_id LEFT JOIN t_technician_score ttsc ON ttsc.technician_id = tt.id WHERE tts.`status` != 0 AND tt.`status` = 2 AND tt.del_flag = 0 AND tt.subscribe_status = 1 AND tt.shop_id = #{shopId} GROUP BY tt.id, tt.`name`, tt.introduction, tt.home_picture </select> <select id="selectTechnicianDetail" resultType="com.ruoyi.other.vo.TechnicianDetailVO"> SELECT tt.id, tt.`name`, tt.introduction, tt.home_picture, COUNT(tts.id) AS serviceCount, AVG(ttsc.score) AS score, tt.info_picture FROM t_technician tt LEFT JOIN t_technician_subscribe tts ON tt.id = tts.technician_id LEFT JOIN t_technician_score ttsc ON ttsc.technician_id = tt.id WHERE tts.`status` != 0 AND tt.`status` = 2 AND tt.del_flag = 0 AND tt.subscribe_status = 1 AND tt.id = #{technicianId} GROUP BY tt.id, tt.`name`, tt.introduction, tt.home_picture, tt.introduction </select> </mapper> ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
@@ -1,10 +1,8 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.other.mapper.TechnicianSubscribeMapper"> <select id="getTechnicianSubscribeByUserAndShop" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO"> <select id="getTechnicianSubscribeByUserAndShop" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO"> SELECT tts.user_address, ts.`name` shopName, sql/qijisheng_account.sql
New file Diff too large sql/qijisheng_order.sql
New file @@ -0,0 +1,3880 @@ /* Navicat Premium Data Transfer Source Server : 192.168.110.169 Source Server Type : MySQL Source Server Version : 80036 Source Host : 192.168.110.169:3306 Source Schema : qijisheng_order Target Server Type : MySQL Target Server Version : 80036 File Encoding : 65001 Date: 25/11/2024 18:29:53 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for t_order_0 -- ---------------------------- DROP TABLE IF EXISTS `t_order_0`; CREATE TABLE `t_order_0` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_0 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_1 -- ---------------------------- DROP TABLE IF EXISTS `t_order_1`; CREATE TABLE `t_order_1` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_1 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_10 -- ---------------------------- DROP TABLE IF EXISTS `t_order_10`; CREATE TABLE `t_order_10` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_10 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_11 -- ---------------------------- DROP TABLE IF EXISTS `t_order_11`; CREATE TABLE `t_order_11` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_11 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_12 -- ---------------------------- DROP TABLE IF EXISTS `t_order_12`; CREATE TABLE `t_order_12` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_12 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_13 -- ---------------------------- DROP TABLE IF EXISTS `t_order_13`; CREATE TABLE `t_order_13` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_13 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_14 -- ---------------------------- DROP TABLE IF EXISTS `t_order_14`; CREATE TABLE `t_order_14` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_14 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_15 -- ---------------------------- DROP TABLE IF EXISTS `t_order_15`; CREATE TABLE `t_order_15` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_15 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_16 -- ---------------------------- DROP TABLE IF EXISTS `t_order_16`; CREATE TABLE `t_order_16` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_16 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_17 -- ---------------------------- DROP TABLE IF EXISTS `t_order_17`; CREATE TABLE `t_order_17` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_17 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_18 -- ---------------------------- DROP TABLE IF EXISTS `t_order_18`; CREATE TABLE `t_order_18` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_18 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_19 -- ---------------------------- DROP TABLE IF EXISTS `t_order_19`; CREATE TABLE `t_order_19` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_19 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_2 -- ---------------------------- DROP TABLE IF EXISTS `t_order_2`; CREATE TABLE `t_order_2` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_2 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_20 -- ---------------------------- DROP TABLE IF EXISTS `t_order_20`; CREATE TABLE `t_order_20` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_20 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_21 -- ---------------------------- DROP TABLE IF EXISTS `t_order_21`; CREATE TABLE `t_order_21` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_21 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_22 -- ---------------------------- DROP TABLE IF EXISTS `t_order_22`; CREATE TABLE `t_order_22` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_22 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_23 -- ---------------------------- DROP TABLE IF EXISTS `t_order_23`; CREATE TABLE `t_order_23` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_23 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_24 -- ---------------------------- DROP TABLE IF EXISTS `t_order_24`; CREATE TABLE `t_order_24` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_24 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_25 -- ---------------------------- DROP TABLE IF EXISTS `t_order_25`; CREATE TABLE `t_order_25` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_25 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_26 -- ---------------------------- DROP TABLE IF EXISTS `t_order_26`; CREATE TABLE `t_order_26` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_26 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_27 -- ---------------------------- DROP TABLE IF EXISTS `t_order_27`; CREATE TABLE `t_order_27` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_27 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_28 -- ---------------------------- DROP TABLE IF EXISTS `t_order_28`; CREATE TABLE `t_order_28` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_28 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_29 -- ---------------------------- DROP TABLE IF EXISTS `t_order_29`; CREATE TABLE `t_order_29` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_29 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_3 -- ---------------------------- DROP TABLE IF EXISTS `t_order_3`; CREATE TABLE `t_order_3` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_3 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_30 -- ---------------------------- DROP TABLE IF EXISTS `t_order_30`; CREATE TABLE `t_order_30` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_30 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_31 -- ---------------------------- DROP TABLE IF EXISTS `t_order_31`; CREATE TABLE `t_order_31` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_31 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_32 -- ---------------------------- DROP TABLE IF EXISTS `t_order_32`; CREATE TABLE `t_order_32` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_32 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_33 -- ---------------------------- DROP TABLE IF EXISTS `t_order_33`; CREATE TABLE `t_order_33` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_33 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_34 -- ---------------------------- DROP TABLE IF EXISTS `t_order_34`; CREATE TABLE `t_order_34` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_34 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_35 -- ---------------------------- DROP TABLE IF EXISTS `t_order_35`; CREATE TABLE `t_order_35` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_35 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_36 -- ---------------------------- DROP TABLE IF EXISTS `t_order_36`; CREATE TABLE `t_order_36` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_36 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_37 -- ---------------------------- DROP TABLE IF EXISTS `t_order_37`; CREATE TABLE `t_order_37` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_37 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_38 -- ---------------------------- DROP TABLE IF EXISTS `t_order_38`; CREATE TABLE `t_order_38` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_38 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_39 -- ---------------------------- DROP TABLE IF EXISTS `t_order_39`; CREATE TABLE `t_order_39` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_39 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_4 -- ---------------------------- DROP TABLE IF EXISTS `t_order_4`; CREATE TABLE `t_order_4` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_4 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_40 -- ---------------------------- DROP TABLE IF EXISTS `t_order_40`; CREATE TABLE `t_order_40` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_40 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_41 -- ---------------------------- DROP TABLE IF EXISTS `t_order_41`; CREATE TABLE `t_order_41` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_41 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_42 -- ---------------------------- DROP TABLE IF EXISTS `t_order_42`; CREATE TABLE `t_order_42` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_42 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_43 -- ---------------------------- DROP TABLE IF EXISTS `t_order_43`; CREATE TABLE `t_order_43` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_43 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_44 -- ---------------------------- DROP TABLE IF EXISTS `t_order_44`; CREATE TABLE `t_order_44` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_44 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_45 -- ---------------------------- DROP TABLE IF EXISTS `t_order_45`; CREATE TABLE `t_order_45` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_45 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_46 -- ---------------------------- DROP TABLE IF EXISTS `t_order_46`; CREATE TABLE `t_order_46` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_46 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_47 -- ---------------------------- DROP TABLE IF EXISTS `t_order_47`; CREATE TABLE `t_order_47` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_47 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_48 -- ---------------------------- DROP TABLE IF EXISTS `t_order_48`; CREATE TABLE `t_order_48` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_48 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_49 -- ---------------------------- DROP TABLE IF EXISTS `t_order_49`; CREATE TABLE `t_order_49` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_49 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_5 -- ---------------------------- DROP TABLE IF EXISTS `t_order_5`; CREATE TABLE `t_order_5` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_5 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_6 -- ---------------------------- DROP TABLE IF EXISTS `t_order_6`; CREATE TABLE `t_order_6` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_6 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_7 -- ---------------------------- DROP TABLE IF EXISTS `t_order_7`; CREATE TABLE `t_order_7` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_7 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_8 -- ---------------------------- DROP TABLE IF EXISTS `t_order_8`; CREATE TABLE `t_order_8` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_8 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_9 -- ---------------------------- DROP TABLE IF EXISTS `t_order_9`; CREATE TABLE `t_order_9` ( `id` bigint NOT NULL, `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `order_type` int NULL DEFAULT NULL COMMENT '订单类型1服务单2商品', `order_status` int NOT NULL COMMENT '1待发货2待收货3待使用4已完成5已取消6已退款7售后中', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '核销时间', `technician_id` int NULL DEFAULT NULL COMMENT '技师id', `order_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '订单编号', `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单总金额', `payment_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '实际支付价格', `point` decimal(10, 2) NULL DEFAULT NULL COMMENT '使用积分', `pay_method` int NULL DEFAULT NULL COMMENT '1wx2积分', `coupon_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '使用的优惠劵json', `express_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '运费', `express_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '第三方快递信息', `share_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '平台分佣', `get_point` decimal(10, 2) NULL DEFAULT NULL COMMENT '本单获取的积分', `serial_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '微信支付号', `pay_status` int NULL DEFAULT NULL COMMENT '1待支付2已支付', `shop_id` int NULL DEFAULT NULL COMMENT '对应门店id', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_9 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_0 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_0`; CREATE TABLE `t_order_good_0` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_0 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_1 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_1`; CREATE TABLE `t_order_good_1` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_1 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_10 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_10`; CREATE TABLE `t_order_good_10` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_10 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_11 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_11`; CREATE TABLE `t_order_good_11` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_11 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_12 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_12`; CREATE TABLE `t_order_good_12` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_12 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_13 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_13`; CREATE TABLE `t_order_good_13` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_13 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_14 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_14`; CREATE TABLE `t_order_good_14` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_14 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_15 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_15`; CREATE TABLE `t_order_good_15` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_15 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_16 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_16`; CREATE TABLE `t_order_good_16` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_16 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_17 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_17`; CREATE TABLE `t_order_good_17` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_17 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_18 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_18`; CREATE TABLE `t_order_good_18` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_18 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_19 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_19`; CREATE TABLE `t_order_good_19` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_19 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_2 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_2`; CREATE TABLE `t_order_good_2` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_2 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_20 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_20`; CREATE TABLE `t_order_good_20` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_20 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_21 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_21`; CREATE TABLE `t_order_good_21` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_21 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_22 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_22`; CREATE TABLE `t_order_good_22` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_22 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_23 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_23`; CREATE TABLE `t_order_good_23` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_23 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_24 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_24`; CREATE TABLE `t_order_good_24` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_24 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_25 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_25`; CREATE TABLE `t_order_good_25` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_25 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_26 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_26`; CREATE TABLE `t_order_good_26` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_26 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_27 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_27`; CREATE TABLE `t_order_good_27` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_27 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_28 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_28`; CREATE TABLE `t_order_good_28` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_28 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_29 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_29`; CREATE TABLE `t_order_good_29` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_29 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_3 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_3`; CREATE TABLE `t_order_good_3` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_3 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_30 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_30`; CREATE TABLE `t_order_good_30` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_30 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_31 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_31`; CREATE TABLE `t_order_good_31` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_31 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_32 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_32`; CREATE TABLE `t_order_good_32` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_32 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_33 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_33`; CREATE TABLE `t_order_good_33` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_33 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_34 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_34`; CREATE TABLE `t_order_good_34` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_34 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_35 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_35`; CREATE TABLE `t_order_good_35` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_35 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_36 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_36`; CREATE TABLE `t_order_good_36` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_36 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_37 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_37`; CREATE TABLE `t_order_good_37` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_37 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_38 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_38`; CREATE TABLE `t_order_good_38` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_38 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_39 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_39`; CREATE TABLE `t_order_good_39` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_39 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_4 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_4`; CREATE TABLE `t_order_good_4` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_4 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_40 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_40`; CREATE TABLE `t_order_good_40` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_40 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_41 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_41`; CREATE TABLE `t_order_good_41` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_41 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_42 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_42`; CREATE TABLE `t_order_good_42` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_42 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_43 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_43`; CREATE TABLE `t_order_good_43` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_43 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_44 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_44`; CREATE TABLE `t_order_good_44` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_44 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_45 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_45`; CREATE TABLE `t_order_good_45` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_45 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_46 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_46`; CREATE TABLE `t_order_good_46` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_46 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_47 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_47`; CREATE TABLE `t_order_good_47` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_47 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_48 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_48`; CREATE TABLE `t_order_good_48` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_48 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_49 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_49`; CREATE TABLE `t_order_good_49` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_49 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_5 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_5`; CREATE TABLE `t_order_good_5` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_5 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_6 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_6`; CREATE TABLE `t_order_good_6` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_6 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_7 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_7`; CREATE TABLE `t_order_good_7` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_7 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_8 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_8`; CREATE TABLE `t_order_good_8` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_8 -- ---------------------------- -- ---------------------------- -- Table structure for t_order_good_9 -- ---------------------------- DROP TABLE IF EXISTS `t_order_good_9`; CREATE TABLE `t_order_good_9` ( `id` bigint NOT NULL AUTO_INCREMENT, `goods_id` bigint NULL DEFAULT NULL COMMENT '商品id', `order_id` int NULL DEFAULT NULL COMMENT '订单id', `good_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '购买商品的json快照', `num` int NULL DEFAULT NULL COMMENT '数量', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '订单表—关联商品信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_order_good_9 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_0 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_0`; CREATE TABLE `t_refund_pass_0` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_0 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_1 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_1`; CREATE TABLE `t_refund_pass_1` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_1 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_10 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_10`; CREATE TABLE `t_refund_pass_10` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_10 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_11 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_11`; CREATE TABLE `t_refund_pass_11` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_11 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_12 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_12`; CREATE TABLE `t_refund_pass_12` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_12 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_13 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_13`; CREATE TABLE `t_refund_pass_13` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_13 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_14 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_14`; CREATE TABLE `t_refund_pass_14` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_14 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_15 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_15`; CREATE TABLE `t_refund_pass_15` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_15 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_16 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_16`; CREATE TABLE `t_refund_pass_16` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_16 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_17 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_17`; CREATE TABLE `t_refund_pass_17` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_17 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_18 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_18`; CREATE TABLE `t_refund_pass_18` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_18 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_19 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_19`; CREATE TABLE `t_refund_pass_19` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_19 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_2 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_2`; CREATE TABLE `t_refund_pass_2` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_2 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_3 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_3`; CREATE TABLE `t_refund_pass_3` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_3 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_4 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_4`; CREATE TABLE `t_refund_pass_4` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_4 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_5 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_5`; CREATE TABLE `t_refund_pass_5` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_5 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_6 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_6`; CREATE TABLE `t_refund_pass_6` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_6 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_7 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_7`; CREATE TABLE `t_refund_pass_7` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_7 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_8 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_8`; CREATE TABLE `t_refund_pass_8` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_8 -- ---------------------------- -- ---------------------------- -- Table structure for t_refund_pass_9 -- ---------------------------- DROP TABLE IF EXISTS `t_refund_pass_9`; CREATE TABLE `t_refund_pass_9` ( `id` bigint NOT NULL, `order_id` bigint NULL DEFAULT NULL COMMENT '订单id', `status` int NULL DEFAULT NULL COMMENT '1待审核2已完成3已拒绝4待退货5待平台收货', `refund_method` int NULL DEFAULT NULL COMMENT '1退货退款2仅退款', `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请原因', `user_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户申请备注', `pics` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '申请图片', `pass_status` int NULL DEFAULT NULL COMMENT '1待审核2同意3拒绝', `pass_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '后台审核备注', `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0=否,1=是)', `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '售后管理' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_refund_pass_9 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_0 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_0`; CREATE TABLE `t_shopping_cart_0` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_0 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_1 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_1`; CREATE TABLE `t_shopping_cart_1` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_1 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_10 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_10`; CREATE TABLE `t_shopping_cart_10` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_10 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_11 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_11`; CREATE TABLE `t_shopping_cart_11` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_11 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_12 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_12`; CREATE TABLE `t_shopping_cart_12` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_12 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_13 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_13`; CREATE TABLE `t_shopping_cart_13` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_13 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_14 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_14`; CREATE TABLE `t_shopping_cart_14` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_14 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_15 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_15`; CREATE TABLE `t_shopping_cart_15` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_15 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_16 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_16`; CREATE TABLE `t_shopping_cart_16` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_16 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_17 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_17`; CREATE TABLE `t_shopping_cart_17` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_17 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_18 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_18`; CREATE TABLE `t_shopping_cart_18` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_18 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_19 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_19`; CREATE TABLE `t_shopping_cart_19` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_19 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_2 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_2`; CREATE TABLE `t_shopping_cart_2` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_2 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_20 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_20`; CREATE TABLE `t_shopping_cart_20` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_20 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_21 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_21`; CREATE TABLE `t_shopping_cart_21` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_21 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_22 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_22`; CREATE TABLE `t_shopping_cart_22` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_22 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_23 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_23`; CREATE TABLE `t_shopping_cart_23` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_23 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_24 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_24`; CREATE TABLE `t_shopping_cart_24` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_24 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_25 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_25`; CREATE TABLE `t_shopping_cart_25` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_25 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_26 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_26`; CREATE TABLE `t_shopping_cart_26` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_26 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_27 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_27`; CREATE TABLE `t_shopping_cart_27` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_27 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_28 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_28`; CREATE TABLE `t_shopping_cart_28` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_28 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_29 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_29`; CREATE TABLE `t_shopping_cart_29` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_29 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_3 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_3`; CREATE TABLE `t_shopping_cart_3` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_3 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_30 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_30`; CREATE TABLE `t_shopping_cart_30` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_30 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_31 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_31`; CREATE TABLE `t_shopping_cart_31` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_31 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_32 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_32`; CREATE TABLE `t_shopping_cart_32` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_32 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_33 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_33`; CREATE TABLE `t_shopping_cart_33` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_33 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_34 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_34`; CREATE TABLE `t_shopping_cart_34` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_34 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_35 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_35`; CREATE TABLE `t_shopping_cart_35` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_35 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_36 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_36`; CREATE TABLE `t_shopping_cart_36` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_36 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_37 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_37`; CREATE TABLE `t_shopping_cart_37` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_37 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_38 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_38`; CREATE TABLE `t_shopping_cart_38` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_38 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_39 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_39`; CREATE TABLE `t_shopping_cart_39` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_39 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_4 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_4`; CREATE TABLE `t_shopping_cart_4` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_4 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_40 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_40`; CREATE TABLE `t_shopping_cart_40` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_40 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_41 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_41`; CREATE TABLE `t_shopping_cart_41` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_41 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_42 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_42`; CREATE TABLE `t_shopping_cart_42` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_42 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_43 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_43`; CREATE TABLE `t_shopping_cart_43` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_43 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_44 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_44`; CREATE TABLE `t_shopping_cart_44` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_44 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_45 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_45`; CREATE TABLE `t_shopping_cart_45` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_45 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_46 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_46`; CREATE TABLE `t_shopping_cart_46` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_46 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_47 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_47`; CREATE TABLE `t_shopping_cart_47` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_47 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_48 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_48`; CREATE TABLE `t_shopping_cart_48` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_48 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_49 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_49`; CREATE TABLE `t_shopping_cart_49` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_49 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_5 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_5`; CREATE TABLE `t_shopping_cart_5` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_5 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_6 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_6`; CREATE TABLE `t_shopping_cart_6` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_6 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_7 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_7`; CREATE TABLE `t_shopping_cart_7` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_7 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_8 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_8`; CREATE TABLE `t_shopping_cart_8` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_8 -- ---------------------------- -- ---------------------------- -- Table structure for t_shopping_cart_9 -- ---------------------------- DROP TABLE IF EXISTS `t_shopping_cart_9`; CREATE TABLE `t_shopping_cart_9` ( `id` bigint NOT NULL COMMENT '主键', `app_user_id` bigint NULL DEFAULT NULL COMMENT '用户id', `goods_id` int NULL DEFAULT NULL COMMENT '商品id', `number` int NULL DEFAULT 1 COMMENT '数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '购物车' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of t_shopping_cart_9 -- ---------------------------- SET FOREIGN_KEY_CHECKS = 1; Diff truncated after the above file
sql/qijisheng_other.sql sql/qijisheng_system.sql