Merge remote-tracking branch 'origin/master'
# Conflicts:
# ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/PaylogServiceImpl.java
2 文件已重命名
142个文件已修改
1个文件已删除
45个文件已添加
| | |
| | | String SECKILL = "seckill"; |
| | | String GROUP_PURCHASE = "group_purchase"; |
| | | String AUCTION_GOODS = "auction_goods"; |
| | | |
| | | String AUCTION_SALESROOM = "auction_salesroom"; |
| | | |
| | | String AUCTION_SALESROOM_GOODS = "auction_salesroom_goods"; |
| | | } |
| | |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "成团时间") |
| | | private LocalDateTime groupTime; |
| | | |
| | | |
| | | } |
| | |
| | | private OrderFromEnum orderFrom; |
| | | |
| | | @ApiModelProperty(value = "拍卖订单类型 1=普通拍品 2=拍卖会拍品") |
| | | private AuctionOrderTypeEnum auctionType; |
| | | private AuctionOrderTypeEnum auctionOrderType; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | private Long memberId; |
| | |
| | | @ApiModelProperty(value = "支付合计") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty(value = "订单状态 1=待支付 2=待发货 3=待收货 4=已完成 5=已取消,6 售后") |
| | | @ApiModelProperty(value = "订单状态 1=待支付 2=待发货 3=待收货 4=已完成 5=已取消 6=售后中 7=已退款 8=已退款退货") |
| | | private OrderStatusEnum orderStatus; |
| | | |
| | | @ApiModelProperty(value = "支付时间") |
| | |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | |
| | | @ApiModelProperty(value = "快递单号") |
| | | private String courierNumber; |
| | | |
| | |
| | | private String receiverName; |
| | | |
| | | @ApiModelProperty(value = "收货人电话") |
| | | private String receiverphone; |
| | | private String receiverPhone; |
| | | |
| | | @ApiModelProperty(value = "城市") |
| | | private String receiverCity; |
| | | |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | private String receiverDetailAddress; |
| | | |
| | | |
| | | @ApiModelProperty(value = "保证金") |
| | | private BigDecimal bound; |
| | |
| | | @ApiModelProperty(value = "积分") |
| | | private Integer points; |
| | | |
| | | @ApiModelProperty("发货快递") |
| | | private String logisticsNum; |
| | | |
| | | @ApiModelProperty(value = "实际商品价格") |
| | | private BigDecimal sjPrice; |
| | | |
| | | @ApiModelProperty("拍卖会id") |
| | | private Long auctionSalesroomId; |
| | | } |
| | |
| | | private Integer type; |
| | | |
| | | |
| | | @ApiModelProperty(value = "电话") |
| | | private String phone; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsSkuName; |
| | | |
| | | @ApiModelProperty(value = "1是普通商品,2 团购商品,3 秒杀商品") |
| | | private Integer type; |
| | | |
| | | } |
File was renamed from ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/dto/AuctionSalesroomGoodsDTO.java |
| | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "拍卖商品数据传输对象", description = "拍卖商品数据传输对象") |
| | | public class AuctionSalesroomGoodsDTO extends BasePage { |
| | | @ApiModel(value = "拍卖场数据对象", description = "拍卖场数据对象") |
| | | public class AuctionSalesroomDTO extends BasePage { |
| | | @ApiModelProperty(value = "拍卖场id") |
| | | private Long auctionSalesroomId; |
| | | |
New file |
| | |
| | | package com.ruoyi.system.api.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "Baaner数据传输对象", description = "Baaner数据传输对象") |
| | | public class BaanerListDTO { |
| | | @ApiModelProperty(value = "轮播图类型 1=商城首页 2=资讯首页") |
| | | private Integer bannerType; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "物流订单查询", description = "物流订单查询") |
| | | public class LogisticsDTO { |
| | | @ApiModelProperty(value = "快递公司编号") |
| | | private String company ; |
| | | @ApiModelProperty(value = "物流订单号") |
| | | private String postid ; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "敏感词判断", description = "敏感词判断") |
| | | public class judgeSensitiveWordsDTO { |
| | | @ApiModelProperty(value = "输入文本") |
| | | private String text; |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | @Data |
| | | public class AuctionBidRecordVO { |
| | | @ApiModelProperty("排序") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer sort; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "会员名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String memberName; |
| | | |
| | | @ApiModelProperty(value = "最终出价时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime lastBidTime; |
| | | |
| | | @ApiModelProperty(value = "最终出价金额") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal lastBidAmount; |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.AuctionStartStatusEnum; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private AuctionStartStatusEnum startStatus; |
| | | |
| | | @ApiModelProperty(value = "单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "规格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String spec; |
| | | |
| | | @ApiModelProperty(value = "规格单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String specUnit; |
| | | |
| | | @ApiModelProperty(value = "是中标 1未中标,2中标") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isStatus; |
| | | |
| | | @ApiModelProperty(value = "商品年份") |
| | | private String years; |
| | | @ApiModelProperty(value = "商品描述") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "商品说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String detail; |
| | | |
| | | @ApiModelProperty(value = "是收藏 1未收藏,2收藏") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isCollection; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.AuctionStartStatusEnum; |
| | | import com.ruoyi.common.core.enums.AuthenticationEnum; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | public class AuctionGoodsinfoVO { |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String goodsSkuName; |
| | | |
| | | @ApiModelProperty(value = "起拍价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal startingPrice; |
| | | |
| | | @ApiModelProperty(value = "拍品数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer salesroomStock; |
| | | |
| | | @ApiModelProperty(value = "开始状态 0=预展中 1=拍卖中 2=已结束") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private AuctionStartStatusEnum startStatus; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "商品描述") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "商品说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String detail; |
| | | |
| | | @ApiModelProperty(value = "商品年份") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String years; |
| | | |
| | | @ApiModelProperty(value = "商品分类") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String category; |
| | | |
| | | @ApiModelProperty(value = "商品系列") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String series; |
| | | |
| | | @ApiModelProperty(value = "商品品牌") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value = "商品香型") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String flavorType; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "详情图,不超过五张图片") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String album; |
| | | |
| | | @ApiModelProperty(value = "是否出价 1未出价,2出价") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isBond; |
| | | |
| | | @ApiModelProperty(value = "是中标 1未中标,2中标") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isStatus; |
| | | |
| | | @ApiModelProperty(value = "是收藏 1未收藏,2收藏") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isCollection; |
| | | |
| | | @ApiModelProperty(value = "实名认证 0=不需实名 1=需要实名") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private AuthenticationEnum authentication; |
| | | |
| | | @ApiModelProperty("是否报名 1未报名,2 已报名") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isApply; |
| | | |
| | | @ApiModelProperty(value = "当前出价") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal presentBid; |
| | | |
| | | @ApiModelProperty(value = "最低加价金额") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal minimumMarkupAmount; |
| | | |
| | | |
| | | @ApiModelProperty(value = "规格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String spec; |
| | | |
| | | @ApiModelProperty(value = "规格单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String specUnit; |
| | | |
| | | |
| | | @ApiModelProperty(value = "分享标题") |
| | | @TableField("share_title") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String shareTitle; |
| | | |
| | | @ApiModelProperty(value = "分享图片") |
| | | @TableField("share_pic") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String sharePic; |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | private Long SalesroomId; |
| | | |
| | | @ApiModelProperty(value = "拍卖场名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String salesroomName; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String goodsSkuName; |
| | | |
| | | @ApiModelProperty(value = "起拍价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal startingPrice; |
| | | |
| | | @ApiModelProperty(value = "拍品数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer salesroomStock; |
| | | |
| | | @ApiModelProperty(value = "拍卖时间 0=线下拍卖 1=线上线下结合") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer SalesroomType; |
| | | |
| | | @ApiModelProperty(value = "状态 0=预展中 1=拍卖中 2=已结束") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer goodsSkustatus; |
| | | |
| | | @ApiModelProperty(value = "拍卖时间(分钟)") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer listingDuration; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "商品描述") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "商品年份") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String years; |
| | | |
| | | @ApiModelProperty(value = "商品分类") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String category; |
| | | |
| | | @ApiModelProperty(value = "商品系列") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String series; |
| | | |
| | | @ApiModelProperty(value = "商品品牌") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value = "商品香型") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String flavorType; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "详情图,不超过五张图片") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String album; |
| | | |
| | | @ApiModelProperty(value = "是否出价 1未出价,2出价") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isBond; |
| | | |
| | | @ApiModelProperty(value = "是中标 1未中标,2中标") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isStatus; |
| | | |
| | | @ApiModelProperty(value = "当前出价") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal presentBid; |
| | | |
| | | @ApiModelProperty(value = "最低加价金额") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal minimumMarkupAmount; |
| | | |
| | | |
| | | @ApiModelProperty(value = "规格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String spec; |
| | | |
| | | @ApiModelProperty(value = "规格单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String specUnit; |
| | | @ApiModelProperty(value = "商品说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String detail; |
| | | |
| | | |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | @Data |
| | | public class AuctionSalesroomVO { |
| | | @ApiModelProperty(value = "拍卖场id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long SalesroomId; |
| | | |
| | | @ApiModelProperty(value = "拍卖场名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String salesroomName; |
| | | |
| | | @ApiModelProperty(value = "拍卖状态 0=预展中 1=拍卖中 2=已结束") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "拍卖场说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "拍卖场封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "当前拍卖的商品") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private ForepartAuctionSalesroomGoodsVO currentAuctionSalesroomGoods; |
| | | |
| | | @ApiModelProperty(value = "下拍卖的商品") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private ForepartAuctionSalesroomGoodsVO nextAuctionSalesroomGoods; |
| | | |
| | | |
| | | @ApiModelProperty(value = "其他的商品") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private List<ForepartAuctionSalesroomGoodsVO> elseAuctionSalesroomGoods; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class Express100VO { |
| | | private String message; |
| | | private String nu; |
| | | private String ischeck; |
| | | private String com; |
| | | private String state; |
| | | private String status; |
| | | private List<LogisticsInfoVO> data; |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.AuctionGoodsStatusEnum; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | public class ForepartAuctionSalesroomGoodsVO { |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "拍卖场id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long SalesroomId; |
| | | |
| | | @ApiModelProperty(value = "拍卖场名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String salesroomName; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String goodsSkuName; |
| | | |
| | | @ApiModelProperty(value = "起拍价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal startingPrice; |
| | | |
| | | @ApiModelProperty(value = "拍品数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer salesroomStock; |
| | | |
| | | @ApiModelProperty(value = "拍卖时间 0=线下拍卖 1=线上线下结合") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer SalesroomType; |
| | | |
| | | @ApiModelProperty(value = "状态 0=预展中 1=拍卖中 2=已结束") |
| | | private Integer goodsSkustatus; |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private AuctionGoodsStatusEnum goodsSkustatus; |
| | | |
| | | @ApiModelProperty(value = "拍卖时间(分钟)") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer listingDuration; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "商品描述") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "商品说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String detail; |
| | | |
| | | @ApiModelProperty(value = "下一个商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String nextGoodsSkuName; |
| | | |
| | | @ApiModelProperty(value = "是否出价 1未出价,2出价") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isBond; |
| | | |
| | | @ApiModelProperty(value = "是中标 1未中标,2中标") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isStatus; |
| | | |
| | | @ApiModelProperty(value = "规格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String spec; |
| | | @ApiModelProperty(value = "规格单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String specUnit; |
| | | |
| | | @ApiModelProperty(value = "商品年份") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String years; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ForepartAuctionSalesroomVO { |
| | | @ApiModelProperty(value = "暖场视频or封面海报") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String url; |
| | | |
| | | @ApiModelProperty(value = "拍卖状态 0=预展中 1=拍卖中 2=已结束") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer auctionSalesroomStatus; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.GroupStatusEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.common.core.enums.StartStatusEnum; |
| | |
| | | @Data |
| | | public class GoodsGroupPurchaseInfoVO { |
| | | @ApiModelProperty(value = "团购商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String goodsSkuName; |
| | | @ApiModelProperty(value = "商品年份") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String years; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal price; |
| | | |
| | | |
| | | @ApiModelProperty(value = "分享标题") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String shareTitle; |
| | | |
| | | @ApiModelProperty(value = "分享图片") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String sharePic; |
| | | |
| | | @ApiModelProperty(value = "团购价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal groupPurchasePrice; |
| | | |
| | | @ApiModelProperty(value = "成团人数") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer groupSize; |
| | | |
| | | @ApiModelProperty(value = "限购数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer limitNumber; |
| | | |
| | | @ApiModelProperty(value = "当前人数") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer currentNumber; |
| | | |
| | | @ApiModelProperty(value = "团购开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "团购结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "参团说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "开始状态 0=未开始 1=已开始 2=已结束 ") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private StartStatusEnum startStatus; |
| | | |
| | | @ApiModelProperty(value = "上架状态 0=已上架 1=已下架") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private ListingStatusEnum listingStatus; |
| | | |
| | | @ApiModelProperty(value = "成团状态 0=待成团 1=已成团 2=成团失败") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private GroupStatusEnum groupStatus; |
| | | |
| | | @ApiModelProperty(value = "是团购 1没有团购,2有团购") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isGoodsGroupPurchase; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.StartStatusEnum; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @Data |
| | | public class HomeGoodsSeckillInfoVO { |
| | | @ApiModelProperty(value = "秒杀商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String skuName; |
| | | |
| | | @ApiModelProperty(value = "商品年份") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String years; |
| | | |
| | | @ApiModelProperty(value = "商品分类") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String category; |
| | | |
| | | @ApiModelProperty(value = "商品系列") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String series; |
| | | |
| | | @ApiModelProperty(value = "商品品牌") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value = "商品香型") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String flavorType; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "已售数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer soldQuantity; |
| | | |
| | | @ApiModelProperty(value = "单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "规格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String spec; |
| | | |
| | | @ApiModelProperty(value = "规格单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String specUnit; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "详情图,不超过五张图片") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String album; |
| | | |
| | | @ApiModelProperty(value = "分享标题") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String shareTitle; |
| | | |
| | | @ApiModelProperty(value = "分享图片") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String sharePic; |
| | | |
| | | @ApiModelProperty(value = "商品描述") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "商品说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String detail; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "限购数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer limitNumber; |
| | | |
| | | @ApiModelProperty(value = "秒杀价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal seckillPrice; |
| | | |
| | | @ApiModelProperty(value = "秒杀开始时间") |
| | |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "开始状态 0=未开始 1= 已开始 2=已结束") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private StartStatusEnum startStatus; |
| | | |
| | | @ApiModelProperty(value = "是收藏 1未收藏,2收藏") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isCollection; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | @Data |
| | | public class HomeGoodsSeckillVO { |
| | | @ApiModelProperty(value = "秒杀商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String skuName; |
| | | |
| | | @ApiModelProperty(value = "商品年份") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String years; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "秒杀价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal seckillPrice; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "已售数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer soldQuantity; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "秒杀开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "秒杀结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime endTime; |
| | | |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String skuName; |
| | | |
| | | @ApiModelProperty(value = "商品年份") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String years; |
| | | |
| | | @ApiModelProperty(value = "商品分类") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String category; |
| | | |
| | | @ApiModelProperty(value = "商品系列") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String series; |
| | | |
| | | @ApiModelProperty(value = "商品品牌") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value = "商品香型") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String flavorType; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "库存") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer stock; |
| | | |
| | | @ApiModelProperty(value = "已售数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer soldQuantity; |
| | | |
| | | @ApiModelProperty(value = "单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "规格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String spec; |
| | | |
| | | @ApiModelProperty(value = "规格单位") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String specUnit; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "详情图,不超过五张图片") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String album; |
| | | |
| | | @ApiModelProperty(value = "分享标题") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String shareTitle; |
| | | |
| | | @ApiModelProperty(value = "分享图片") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String sharePic; |
| | | |
| | | @ApiModelProperty(value = "商品描述") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "商品说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String detail; |
| | | |
| | | @ApiModelProperty(value = "排序") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer sortNum; |
| | | |
| | | @ApiModelProperty(value = "是收藏 1未收藏,2收藏") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isCollection; |
| | | |
| | | @ApiModelProperty(value = "是团购 1没有团购,2有团购") |
| | | private Integer isGoodsGroupPurchase; |
| | | |
| | | @ApiModelProperty(value = "是团购 1没有团购商品,2有团购商品") |
| | | private Integer GroupPurchaseGoods; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.StartStatusEnum; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class HomeGoodsSkuListVO { |
| | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String skuName; |
| | | |
| | | @ApiModelProperty(value = "商品年份") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String years; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal price; |
| | | |
| | | |
| | | @ApiModelProperty(value = "已售数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer soldQuantity; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "是收藏 1未收藏,2收藏") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isCollection; |
| | | |
| | | @ApiModelProperty(value = "1是普通商品,2 秒杀商品,3 团购商品") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "开始状态 0=未开始 1= 已开始 2=已结束") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private StartStatusEnum startStatus; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = " 销售价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal xiaosPrice; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class LogisticsInfoVO { |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String time; |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String ftime; |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String context; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.AuctionStartStatusEnum; |
| | | import com.ruoyi.common.core.enums.AuctionTypeEnum; |
| | | import com.ruoyi.common.core.enums.AuthenticationEnum; |
| | |
| | | @Data |
| | | public class MemberAuctionSalesroomInfoVO { |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "拍卖场名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String salesroomName; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "拍卖时间 0=线下拍卖 1=线上线下结合") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private AuctionTypeEnum type; |
| | | |
| | | @ApiModelProperty(value = "保证金") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal bound; |
| | | |
| | | @ApiModelProperty(value = "实名认证 0=不需认证 1=需要实名") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private AuthenticationEnum authentication; |
| | | |
| | | @ApiModelProperty(value = "拍卖场说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "拍卖场封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "拍卖状态 0=预展中 1=拍卖中 2=已结束") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private AuctionStartStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "分享标题") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String shareTitle; |
| | | |
| | | @ApiModelProperty(value = "分享图片") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String sharePic; |
| | | |
| | | @ApiModelProperty("是否报名 1未报名,2 已报名") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isApply; |
| | | |
| | | @ApiModelProperty(value = "拍卖会的商品") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | List<ForepartAuctionSalesroomGoodsVO> forepartAuctionSalesroomGoodsVO; |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.AuthenticationEnum; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class MemberAuctionSalesroomVO { |
| | | @ApiModelProperty(value = "拍卖场id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long SalesroomId; |
| | | |
| | | @ApiModelProperty(value = "拍卖场名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String salesroomName; |
| | | |
| | | @ApiModelProperty(value = "拍卖状态 0=预展中 1=拍卖中 2=已结束") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "拍卖场说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "拍卖场封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty("是否报名 1未报名,2 已报名") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isApply; |
| | | |
| | | @ApiModelProperty("报名人数") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer applyNum; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "保证金") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal bond; |
| | | |
| | | @ApiModelProperty(value = "实名认证 0=不需认证 1=需要实名") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private AuthenticationEnum authentication; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.OrderFromEnum; |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | | import com.ruoyi.common.core.enums.ReturnRequestStatusEnum; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class MemberOrderListVO { |
| | | @ApiModelProperty(value = "订单id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long goodsSkuId; |
| | | @ApiModelProperty(value = "会员id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "支付合计") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal totalAmount; |
| | | |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String skuName; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "商品数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer goodsQuantity; |
| | | |
| | | @ApiModelProperty(value = "订单状态 1=待支付 2=待发货 3=待收货 4=已完成 5=已取消, 6售后订单") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private OrderStatusEnum orderStatus; |
| | | |
| | | |
| | | @ApiModelProperty(value = "订单来源 1=商品订单 2=秒杀订单 3=团购订单 4=拍卖订单") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private OrderFromEnum orderFrom; |
| | | |
| | | @ApiModelProperty(value = "下单时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime orderTime; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "是否退保证金 1没有退,2 已退") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isAuctionBond; |
| | | |
| | | @ApiModelProperty(value = "售后状态 1=待审核 2=待退货 3=待平台收货 4=已完成 5=已拒绝") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private ReturnRequestStatusEnum status; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class MemberOrderNumVO { |
| | | @ApiModelProperty(value = "待支付") |
| | | private Integer dzforderNo; |
| | | @ApiModelProperty(value = "待发货") |
| | | private Integer dfhorderNo; |
| | | @ApiModelProperty(value = "待收货") |
| | | private Integer dshorderNo; |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.AuctionOrderTypeEnum; |
| | | import com.ruoyi.common.core.enums.OrderFromEnum; |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | |
| | | @Data |
| | | public class MemberTiOrderVO { |
| | | @ApiModelProperty(value = "订单id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "下单时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime orderTime; |
| | | |
| | | @ApiModelProperty(value = "订单来源 1=商品订单 2=秒杀订单 3=团购订单 4=拍卖订单") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private OrderFromEnum orderFrom; |
| | | |
| | | @ApiModelProperty(value = "拍卖订单类型 1=普通拍品 2=拍卖会拍品") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private AuctionOrderTypeEnum auctionType; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "支付方式 1=微信 2=支付宝") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private PaymentMethodEnum paymentMethod; |
| | | |
| | | @ApiModelProperty(value = "支付合计") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty(value = "订单状态 1=待支付 2=待发货 3=待收货 4=已完成 5=已取消") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private OrderStatusEnum orderStatus; |
| | | |
| | | @ApiModelProperty(value = "优惠金额") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal discountMoney; |
| | | |
| | | @ApiModelProperty(value = "商品数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer goodsQuantity; |
| | | |
| | | @ApiModelProperty(value = "收货人姓名") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String receiverName; |
| | | |
| | | @ApiModelProperty(value = "收货人电话") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String receiverphone; |
| | | |
| | | @ApiModelProperty(value = "城市") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String receiverCity; |
| | | |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String receiverDetailAddress; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal price; |
| | | |
| | | |
| | | @ApiModelProperty(value = "优惠的价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal youhiPrice; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String skuName; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "实际商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal sjPrice; |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import com.ruoyi.common.core.enums.RequestTypeEnum; |
| | | import com.ruoyi.common.core.enums.ReturnRequestStatusEnum; |
| | |
| | | |
| | | @ApiModelProperty(value = "售后id") |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long orderId; |
| | | |
| | | @ApiModelProperty(value = "申请时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime requestTime; |
| | | |
| | | @ApiModelProperty(value = "售后类型 1=退款 2=退款退货") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private RequestTypeEnum requestType; |
| | | |
| | | @ApiModelProperty(value = "申请原因") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String requestReason; |
| | | |
| | | @ApiModelProperty(value = "售后状态 1=待审核 2=待退货 3=待平台收货 4=已完成 5=已拒绝") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private ReturnRequestStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "拒绝理由") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String refuseReason; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0代表存在 1代表删除)") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "详情图,不超过五张图片") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String album; |
| | | |
| | | @ApiModelProperty(value = "收件人姓名") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String recipientName; |
| | | |
| | | @ApiModelProperty(value = "收件人电话") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String recipientPhone; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String detailedAddress; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "快递单号") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String courierNumber; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.enums.AuctionOrderTypeEnum; |
| | | import com.ruoyi.common.core.enums.OrderFromEnum; |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | | import com.ruoyi.common.core.enums.PaymentMethodEnum; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.core.annotation.Order; |
| | |
| | | @Data |
| | | public class OrderVO { |
| | | @ApiModelProperty(value = "订单id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "下单时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime orderTime; |
| | | |
| | | @ApiModelProperty(value = "订单来源 1=商品订单 2=秒杀订单 3=团购订单 4=拍卖订单") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private OrderFromEnum orderFrom; |
| | | |
| | | @ApiModelProperty(value = "拍卖订单类型 1=普通拍品 2=拍卖会拍品") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private AuctionOrderTypeEnum auctionType; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "支付方式 1=微信 2=支付宝") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private PaymentMethodEnum paymentMethod; |
| | | |
| | | @ApiModelProperty(value = "支付合计") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty(value = "订单状态 1=待支付 2=待发货 3=待收货 4=已完成 5=已取消") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private OrderStatusEnum orderStatus; |
| | | |
| | | @ApiModelProperty(value = "支付时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime payTime; |
| | | |
| | | @ApiModelProperty(value = "取消时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime cancelTime; |
| | | |
| | | @ApiModelProperty(value = "订单备注") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String orderRemark; |
| | | |
| | | @ApiModelProperty(value = "发货时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime deliveryTime; |
| | | |
| | | @ApiModelProperty(value = "确认收货时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime receiveTime; |
| | | |
| | | @ApiModelProperty(value = "优惠金额") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal discountMoney; |
| | | |
| | | @ApiModelProperty(value = "商品数量") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer goodsQuantity; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @ApiModelProperty(value = "快递单号") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String courierNumber; |
| | | |
| | | @ApiModelProperty(value = "收货人姓名") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String receiverName; |
| | | |
| | | @ApiModelProperty(value = "收货人电话") |
| | | private String receiverphone; |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String receiverPhone; |
| | | |
| | | @ApiModelProperty(value = "城市") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String receiverCity; |
| | | |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String receiverDetailAddress; |
| | | |
| | | |
| | | @ApiModelProperty(value = "保证金") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal bound; |
| | | |
| | | @ApiModelProperty(value = "开票状态 开票状态 1 待开票,2待审核,3 已开票,4 拒绝") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer invoiceStatus; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String skuName; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal price; |
| | | |
| | | |
| | | @ApiModelProperty(value = "积分") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer points; |
| | | |
| | | @ApiModelProperty(value = "实际商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal sjPrice; |
| | | |
| | | @ApiModelProperty(value = "成团时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime purchase; |
| | | |
| | | @ApiModelProperty(value = "是否售后") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isRequest; |
| | | |
| | | @ApiModelProperty(value = "售后状态 1=待审核 2=待退货 3=待平台收货 4=已完成 5=已拒绝") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private ReturnRequestStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "成团时间") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime groupTime; |
| | | |
| | | @ApiModelProperty(value = "是否退保证金 1没有退,2 已退") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isAuctionBond; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | public class PayInfoVO { |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "1 支付宝支付,2 微信支付") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String orderNO; |
| | | |
| | | @ApiModelProperty(value = "题目") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String subject; |
| | | |
| | | @ApiModelProperty(value = "内容") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String body; |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.enums.GroupStatusEnum; |
| | | import com.ruoyi.common.core.enums.StartStatusEnum; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | public class WdGoodsGroupPurchaseVO { |
| | | |
| | | @ApiModelProperty(value = "团购商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long Id; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String goodsSkuName; |
| | | @ApiModelProperty(value = "商品年份") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String years; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "团购价格") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal groupPurchasePrice; |
| | | |
| | | @ApiModelProperty(value = "成团人数") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer groupSize; |
| | | |
| | | @ApiModelProperty(value = "当前人数") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer currentNumber; |
| | | |
| | | @ApiModelProperty(value = "团购开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "团购结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "开始状态 0=未开始 1=已开始 2=已结束 ") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private StartStatusEnum startStatus; |
| | | |
| | | |
| | | @ApiModelProperty(value = "成团状态 0=待成团 1=已成团 2=成团失败") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private GroupStatusEnum groupStatus; |
| | | |
| | | @ApiModelProperty(value = "是团购 1没有团购,2有团购") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isGoodsGroupPurchase; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | @Data |
| | | public class WdMemberAuctionSalesroomVO { |
| | | @ApiModelProperty(value = "拍卖场id") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Long SalesroomId; |
| | | |
| | | @ApiModelProperty(value = "拍卖场名称") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String salesroomName; |
| | | |
| | | @ApiModelProperty(value = "拍卖状态 0=预展中 1=拍卖中 2=已结束") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "拍卖场说明") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "拍卖场封面图") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "加入时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private LocalDateTime BondTime; |
| | | |
| | | @ApiModelProperty(value = "保证金") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private BigDecimal bond; |
| | | |
| | | |
| | | @ApiModelProperty(value = "人数") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer bondNum; |
| | | |
| | | @ApiModelProperty(value = "是否参加, 1否,2 是") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer isBond; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class getHomeGoodsSkuXxiVO { |
| | | |
| | | @ApiModelProperty(value = "标题名称") |
| | | private String titleName; |
| | | |
| | | @ApiModelProperty(value = "内容") |
| | | @TableField("content") |
| | | private String content; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class judgeSensitiveWordsVO { |
| | | @ApiModelProperty(value = "1是有包含敏感词,2 没有") |
| | | @JsonInclude(JsonInclude.Include.ALWAYS) |
| | | private Integer type; |
| | | } |
| | |
| | | import com.ruoyi.system.api.domain.AppMiniLoginVO; |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import com.ruoyi.system.api.domain.OrderAuctionBond; |
| | | import com.ruoyi.system.api.domain.dto.AppMiniLoginDTO; |
| | | import com.ruoyi.system.api.domain.dto.AuctionGoodsListDTO; |
| | | import com.ruoyi.system.api.domain.dto.BondDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import com.ruoyi.system.api.feignClient.AuctionClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | return new AuctionClient() { |
| | | |
| | | @Override |
| | | public R<AuctionSalesroom> getauctionSalesroomOne(Long auctionSalesroomId, String source) { |
| | | public R<AuctionSalesroom> getauctionSalesroomOne(MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO, String source) { |
| | | return R.fail("获取普通拍卖场失败" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<AuctionGoods> getauctionGoodsOne(Long auctionGoodsId, String source) { |
| | | public R<AuctionGoods> getauctionGoodsOne(MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO, String source) { |
| | | return R.fail("获取普通拍卖商品失败" + cause.getMessage()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<OrderAuctionBond>> getAuctionGoodsOrderAuctionBondList(AuctionGoodsListDTO auctionGoodsListDTO, String source) { |
| | | return R.fail("普通拍卖获取保证金失败" + cause.getMessage()); |
| | | public R<List<AuctionSalesroom>> getAuctionSalesroomByIds( |
| | | Collection<Long> auctionSalesroomGoodsIdSet, String source) { |
| | | return R.fail("获取拍卖场列表失败" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | |
| | | import com.ruoyi.common.core.enums.BondStatusEnum; |
| | | import com.ruoyi.system.api.domain.Order; |
| | | import com.ruoyi.system.api.domain.OrderAuctionBond; |
| | | import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderAuctionBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderUpdDTO; |
| | | import com.ruoyi.system.api.domain.dto.RefundDTO; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | import com.ruoyi.system.api.domain.vo.OrderVO; |
| | | import com.ruoyi.system.api.domain.vo.PayInfoVO; |
| | | import com.ruoyi.system.api.feignClient.OrderClient; |
| | |
| | | |
| | | @Override |
| | | public R<?> updateOrderAuctionBondStatus(List<Long> ids, |
| | | BondStatusEnum bondStatusEnum) { |
| | | BondStatusEnum bondStatusEnum, String source) { |
| | | return R.fail("批量更新保证金订单状态失败" + cause.getMessage()); |
| | | } |
| | | |
| | |
| | | public R<List<Order>> getOrderByCouponIds(Collection<Long> couponIds, String source) { |
| | | return R.fail("根据优惠券id列表获取订单列表失败" + cause.getMessage()); |
| | | } |
| | | @Override |
| | | public R<List<OrderAuctionBond>> getAuctionGoodsOrderAuctionBondList(AuctionGoodsListDTO auctionGoodsListDTO, String source) { |
| | | return R.fail("普通拍卖获取保证金失败" + cause.getMessage()); |
| | | } |
| | | |
| | | }; |
| | | |
| | | } |
| | |
| | | public R<CustomConfig> getconfig(String configId) { |
| | | return R.fail("获取系统配置失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<SysUser>> getUserListByName(SysUser sysUser, String source) { |
| | | return R.fail("获取系统用户失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.system.api.domain.AppMiniLoginVO; |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import com.ruoyi.system.api.domain.OrderAuctionBond; |
| | | import com.ruoyi.system.api.domain.dto.AppMiniLoginDTO; |
| | | import com.ruoyi.system.api.domain.dto.AuctionGoodsListDTO; |
| | | import com.ruoyi.system.api.domain.dto.BondDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import com.ruoyi.system.api.factory.AuctionFallbackFactory; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | 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.RequestHeader; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient(contextId = "auctionClient", value = ServiceNameConstants.RUOYI_AUCTION, fallbackFactory = AuctionFallbackFactory.class) |
| | | public interface AuctionClient { |
| | | @PostMapping("/forepart/auction-salesroom/getAuctionSalesroomOne") |
| | | R<AuctionSalesroom> getauctionSalesroomOne(@RequestBody Long auctionSalesroomId, |
| | | @PostMapping("/auction-salesroom/getAuctionSalesroomOne") |
| | | R<AuctionSalesroom> getauctionSalesroomOne(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO, |
| | | @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | |
| | | @PostMapping("/forepart/auction-goods/getAuctionGoodsOne") |
| | | R<AuctionGoods> getauctionGoodsOne(@RequestBody Long auctionGoodsId, |
| | | @PostMapping("/auction-goods/getAuctionGoodsOne") |
| | | R<AuctionGoods> getauctionGoodsOne(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO, |
| | | @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | |
| | | @PutMapping("/auction-goods/end/{id}") |
| | |
| | | @PostMapping("/order-auction-bond/UpdateBond") |
| | | R<?> UpdateBond(@RequestBody BondDTO BondVO, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | |
| | | |
| | | @PostMapping("/order-auction-bond/getAuctionGoodsOrderAuctionBondList") |
| | | R<List<OrderAuctionBond>> getAuctionGoodsOrderAuctionBondList(@RequestBody AuctionGoodsListDTO auctionGoodsListDTO, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | @PostMapping("/auction-salesroom/list-by-ids") |
| | | R<List<AuctionSalesroom>> getAuctionSalesroomByIds( |
| | | @RequestBody Collection<Long> auctionSalesroomGoodsIdSet, |
| | | @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | } |
| | |
| | | import com.ruoyi.common.core.enums.BondStatusEnum; |
| | | import com.ruoyi.system.api.domain.Order; |
| | | import com.ruoyi.system.api.domain.OrderAuctionBond; |
| | | import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderAuctionBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderUpdDTO; |
| | | import com.ruoyi.system.api.domain.dto.RefundDTO; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | import com.ruoyi.system.api.domain.vo.OrderVO; |
| | | import com.ruoyi.system.api.domain.vo.PayInfoVO; |
| | | import com.ruoyi.system.api.factory.OrderFallbackFactory; |
| | |
| | | R<List<OrderAuctionBond>> getOrderAuctionBondList1(@RequestBody MemberAuctionSalesroomDTO memberAuctionSalesroomDTO, |
| | | @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | |
| | | @PostMapping("/order-auction-bond/getAuctionGoodsOrderAuctionBondList") |
| | | R<List<OrderAuctionBond>> getAuctionGoodsOrderAuctionBondList(@RequestBody AuctionGoodsListDTO auctionGoodsListDTO, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | @PostMapping("/order-auction-bond/getOrderAuctionBondone") |
| | | R<OrderAuctionBond> getOrderAuctionBondone(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO, |
| | | @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | |
| | | * @param ids 保证金订单id列表 |
| | | * @param bondStatusEnum 保证金状态 |
| | | */ |
| | | @PutMapping("/order-auction-bond") |
| | | @PutMapping("/order-auction-bond/updateOrderAuctionBondStatus") |
| | | R<?> updateOrderAuctionBondStatus(@RequestParam("ids") List<Long> ids, |
| | | @RequestParam("bondStatusEnum") BondStatusEnum bondStatusEnum); |
| | | @RequestParam("bondStatusEnum") BondStatusEnum bondStatusEnum, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | |
| | | /** |
| | | * 批量更新订单状态 |
| | |
| | | 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.*; |
| | | import com.ruoyi.system.api.domain.CustomConfig; |
| | | import com.ruoyi.system.api.domain.DelayTask; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.factory.SysUserFallbackFactory; |
| | | import java.util.List; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | |
| | | |
| | | @GetMapping("/custom-config/{configId}") |
| | | R<CustomConfig> getconfig(@PathVariable("configId") String configId); |
| | | |
| | | @GetMapping("/user/list-by-name") |
| | | R<List<SysUser>> getUserListByName(@RequestBody SysUser sysUser, |
| | | @RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | } |
| | |
| | | */ |
| | | public class WebSocketUsers |
| | | { |
| | | /** |
| | | * WebSocketUsers 日志控制器 |
| | | */ |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketUsers.class); |
| | | |
| | | /** |
| | | * 用户集 |
| | | */ |
| | | private static Map<String, Session> USERS = new ConcurrentHashMap<String, Session>(); |
| | | private static Map<String, Session> USERS = new ConcurrentHashMap<>(); |
| | | private static Map<String, Integer> USER_TYPES = new ConcurrentHashMap<>(); |
| | | |
| | | /** |
| | | * 存储用户 |
| | | * |
| | | * @param key 唯一键 |
| | | * @param session 用户信息 |
| | | */ |
| | | public static void put(String key, Session session) |
| | | public static void put(String key, Session session, Integer clientType) |
| | | { |
| | | USERS.put(key, session); |
| | | USER_TYPES.put(key, clientType); |
| | | } |
| | | |
| | | /** |
| | | * 移除用户 |
| | | * |
| | | * @param session 用户信息 |
| | | * |
| | | * @return 移除结果 |
| | | */ |
| | | public static boolean remove(Session session) |
| | | { |
| | | String key = null; |
| | |
| | | return remove(key); |
| | | } |
| | | |
| | | /** |
| | | * 移出用户 |
| | | * |
| | | * @param key 键 |
| | | */ |
| | | public static boolean remove(String key) |
| | | { |
| | | LOGGER.info("\n 正在移出用户 - {}", key); |
| | | Session remove = USERS.remove(key); |
| | | USER_TYPES.remove(key); |
| | | if (remove != null) |
| | | { |
| | | boolean containsValue = USERS.containsValue(remove); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取在线用户列表 |
| | | * |
| | | * @return 返回用户集合 |
| | | */ |
| | | public static Map<String, Session> getUsers() |
| | | { |
| | | return USERS; |
| | | } |
| | | |
| | | /** |
| | | * 群发消息文本消息 |
| | | * |
| | | * @param message 消息内容 |
| | | */ |
| | | public static Integer getUserType(String key) { |
| | | return USER_TYPES.get(key); |
| | | } |
| | | |
| | | public static void sendMessageToUsersByText(String message) |
| | | { |
| | | Collection<Session> values = USERS.values(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 发送文本消息 |
| | | * |
| | | * @param session 自己的用户名 |
| | | * @param message 消息内容 |
| | | */ |
| | | public static void sendMessageToUserByText(Session session, String message) |
| | | { |
| | | if (session != null) |
| | |
| | | LOGGER.info("\n[你已离线]"); |
| | | } |
| | | } |
| | | |
| | | public static void sendMessageToUsersByType(Integer clientType, String message) { |
| | | for (Map.Entry<String, Session> entry : USERS.entrySet()) { |
| | | String key = entry.getKey(); |
| | | Session session = entry.getValue(); |
| | | if (clientType.equals(USER_TYPES.get(key))) { |
| | | sendMessageToUserByText(session, message); |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.util; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Collection; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import javax.websocket.Session; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | /** |
| | | * websocket 客户端用户集 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class WebSocketUsers_Bak { |
| | | |
| | | /** |
| | | * WebSocketUsers 日志控制器 |
| | | */ |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketUsers_Bak.class); |
| | | |
| | | /** |
| | | * 用户集 |
| | | */ |
| | | private static Map<String, Session> USERS = new ConcurrentHashMap<String, Session>(); |
| | | |
| | | /** |
| | | * 存储用户 |
| | | * |
| | | * @param key 唯一键 |
| | | * @param session 用户信息 |
| | | */ |
| | | public static void put(String key, Session session) { |
| | | USERS.put(key, session); |
| | | } |
| | | |
| | | /** |
| | | * 移除用户 |
| | | * |
| | | * @param session 用户信息 |
| | | * @return 移除结果 |
| | | */ |
| | | public static boolean remove(Session session) { |
| | | String key = null; |
| | | boolean flag = USERS.containsValue(session); |
| | | if (flag) { |
| | | Set<Map.Entry<String, Session>> entries = USERS.entrySet(); |
| | | for (Map.Entry<String, Session> entry : entries) { |
| | | Session value = entry.getValue(); |
| | | if (value.equals(session)) { |
| | | key = entry.getKey(); |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | return true; |
| | | } |
| | | return remove(key); |
| | | } |
| | | |
| | | /** |
| | | * 移出用户 |
| | | * |
| | | * @param key 键 |
| | | */ |
| | | public static boolean remove(String key) { |
| | | LOGGER.info("\n 正在移出用户 - {}", key); |
| | | Session remove = USERS.remove(key); |
| | | if (remove != null) { |
| | | boolean containsValue = USERS.containsValue(remove); |
| | | LOGGER.info("\n 移出结果 - {}", containsValue ? "失败" : "成功"); |
| | | return containsValue; |
| | | } else { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取在线用户列表 |
| | | * |
| | | * @return 返回用户集合 |
| | | */ |
| | | public static Map<String, Session> getUsers() { |
| | | return USERS; |
| | | } |
| | | |
| | | /** |
| | | * 群发消息文本消息 |
| | | * |
| | | * @param message 消息内容 |
| | | */ |
| | | public static void sendMessageToUsersByText(String message) { |
| | | Collection<Session> values = USERS.values(); |
| | | for (Session value : values) { |
| | | sendMessageToUserByText(value, message); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 发送文本消息 |
| | | * |
| | | * @param session 自己的用户名 |
| | | * @param message 消息内容 |
| | | */ |
| | | public static void sendMessageToUserByText(Session session, String message) { |
| | | if (session != null) { |
| | | try { |
| | | session.getBasicRemote().sendText(message); |
| | | } catch (IOException e) { |
| | | LOGGER.error("\n[发送消息异常]", e); |
| | | } |
| | | } else { |
| | | LOGGER.info("\n[你已离线]"); |
| | | } |
| | | } |
| | | } |
| | |
| | | * 秒杀活动商品key前缀 |
| | | */ |
| | | public static final String SECKILL_GOODS = "seckill_goods:"; |
| | | /** |
| | | * 订单延时任务-自动关闭","超时订单自动关闭 |
| | | */ |
| | | |
| | | public static final String ORDER_AUTOMATIC_CANCEL = "oroer_automatic_cancel:"; |
| | | |
| | | } |
| | |
| | | @AllArgsConstructor |
| | | public enum ArticleStatusEnum { |
| | | |
| | | /*状态 1=待审核 2=已通过 3=已拒绝 4被举报*/ |
| | | /*状态 1=待审核 2=已通过 3=已拒绝 */ |
| | | |
| | | TO_BE_REVIEWED(1, "待审核"), |
| | | PASSED(2, "已通过"), |
New file |
| | |
| | | package com.ruoyi.common.core.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ClientTypeEnum { |
| | | MEMBER(1, "会员小程序"), |
| | | AUCTIONEER(2, "拍卖师小程序"); |
| | | |
| | | private final Integer code; |
| | | private final String desc; |
| | | |
| | | public static ClientTypeEnum getEnumByCode(Integer code) { |
| | | for (ClientTypeEnum e : ClientTypeEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | /* 订单来源 1=商品订单 2=秒杀订单 3=团购订单 4=保证金 5=拍卖订单*/ |
| | | |
| | | COMMODITY_ORDER(1, "商品订单"), |
| | | SNAP_ORDERS(2, "秒杀订单"), |
| | | GROUP_PURCHASE_ORDERS(3, "团购订单"), |
| | | AUCTION_ORDERS(4, "拍卖订单"); |
| | | COMMODITY_ORDER(1, "商品"), |
| | | SNAP_ORDERS(2, "秒杀"), |
| | | GROUP_PURCHASE_ORDERS(3, "团购"), |
| | | AUCTION_ORDERS(4, "拍卖"); |
| | | @EnumValue |
| | | private final int code; |
| | | @JsonValue |
| | |
| | | @AllArgsConstructor |
| | | public enum OrderStatusEnum { |
| | | |
| | | /*订单状态 1=待发货 2=待收货 3=已完成 4=已取消*/ |
| | | /*订单状态 1=待发货 2=待收货 3=已完成 4=已取消 5=售后中 6=售后中 7=已退款 8=已退货退款*/ |
| | | TO_PLAY(1, "待支付"), |
| | | TO_BE_SHIPPED(2, "待发货"), |
| | | GOODS_TO_BE_RECEIVED(3, "待收货"), |
| | | FINISHED(4, "已完成"), |
| | | CANCELED(5, "已取消"), |
| | | AFTER_SALE(6, "售后"); |
| | | AFTER_SALE(6, "售后中"), |
| | | REFUNDED(7, "已退款"), |
| | | REFUNDED_AND_RETURNED(8, "已退货退款"); |
| | | |
| | | @EnumValue |
| | | private final int code; |
New file |
| | |
| | | package com.ruoyi.common.core.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum OrderTypeEnum { |
| | | |
| | | /* 拍卖类型 1=商城订单 1=拍卖订单*/ |
| | | |
| | | MALL_ODER(1, "商城订单"), |
| | | AUCTION_ORDER(2, "拍卖订单"); |
| | | @EnumValue |
| | | private final int code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static OrderTypeEnum fromCode(Integer code) { |
| | | OrderTypeEnum[] resultTypes = OrderTypeEnum.values(); |
| | | for (OrderTypeEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.common.security.utils; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.constant.TokenConstants; |
| | | import com.ruoyi.common.core.context.SecurityContextHolder; |
| | | import com.ruoyi.common.core.utils.ServletUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | |
| | | /** |
| | | * 权限获取工具类 |
| | |
| | | { |
| | | // 从header获取token标识 |
| | | String token = request.getHeader(TokenConstants.AUTHENTICATION); |
| | | if (StringUtils.isBlank(token)) { |
| | | // 如果Authorization为空,那么尝试读取Sec-Websocket-Protocol的内容 |
| | | token = request.getHeader("Sec-Websocket-Protocol"); |
| | | } |
| | | return replaceTokenPrefix(token); |
| | | } |
| | | |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <!-- 分布式事务 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-seata</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | @PostMapping("/judgeSensitiveWordsList") |
| | | @ApiOperation(value = "用户端-判断敏感词") |
| | | public R<judgeSensitiveWordsVO> judgeSensitiveWordsList(@RequestBody judgeSensitiveWordsDTO SensitiveWordsDTO) { |
| | | SensitiveWordsService.judgeSensitiveWordsList(SensitiveWordsDTO); |
| | | return R.ok(); |
| | | return R.ok( SensitiveWordsService.judgeSensitiveWordsList(SensitiveWordsDTO)); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "1 评论,2 是回复") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "评论等级") |
| | | private Integer state; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "资讯图片") |
| | | private String rticleImageUrl; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("是否点赞 1 点赞, 2 未点赞") |
| | | private Integer islike; |
| | | |
| | | @ApiModelProperty(value = "评论等级") |
| | | private Integer state; |
| | | |
| | | List<ArticleCommentsVO> articleCommentsVOList; |
| | | } |
| | |
| | | @ApiModelProperty(value = "头像") |
| | | private String memberAvatar; |
| | | |
| | | @ApiModelProperty("是否收藏 1收藏, 2 未收藏") |
| | | @ApiModelProperty("是否收藏 1未收藏, 2 收藏") |
| | | private Integer isCollect; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
New file |
| | |
| | | package com.ruoyi.article.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleCommentsQuery; |
| | | import com.ruoyi.article.controller.management.vo.MgtArticleCommentsVO; |
| | | import com.ruoyi.article.service.IArticleCommentsService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 资讯评论回复表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/mgt/article-comments") |
| | | @Api(value = "管理后台-资讯评论回复相关接口", tags = "管理后台-资讯评论回复相关接口") |
| | | public class MgtArticleCommentsController { |
| | | |
| | | private final IArticleCommentsService articleCommentsService; |
| | | |
| | | /** |
| | | * 查看详情-评论详情 |
| | | * |
| | | * @param query 资讯评论回复查询对象 |
| | | * @return PageDTO<MgtArticleCommentsVO> |
| | | */ |
| | | @ApiOperation(value = "查看详情-评论详情") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MgtArticleCommentsVO>> getArticleCommentsPage( |
| | | @Validated @RequestBody MgtArticleCommentsQuery query) { |
| | | return R.ok(articleCommentsService.getArticleCommentsPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 删除评论 |
| | | * |
| | | * @param id 评论id |
| | | */ |
| | | @ApiOperation("删除评论") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delArticleComments( |
| | | @ApiParam(name = "id", value = "评论id", required = true) @PathVariable("id") Long id) { |
| | | articleCommentsService.delArticleComments(id); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleAuditDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleQuery; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleUpdDTO; |
| | | import com.ruoyi.article.controller.management.vo.MgtArticleVO; |
| | | import com.ruoyi.article.service.IArticleService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 资讯表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/mgt/article") |
| | | @RequiredArgsConstructor |
| | | @Api(value = "管理后台-资讯管理相关接口", tags = "管理后台-资讯管理相关接口") |
| | | public class MgtArticleController { |
| | | |
| | | private final IArticleService articleService; |
| | | |
| | | /** |
| | | * 获取资讯列表的分页数据 |
| | | * |
| | | * @param query 资讯管理查询条件 |
| | | * @return PageDTO<ArticleVO> |
| | | */ |
| | | @ApiOperation(value = "获取资讯列表的分页数据", notes = "获取资讯列表的分页数据,资讯审核列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MgtArticleVO>> getArticlePage(@Validated @RequestBody MgtArticleQuery query) { |
| | | return R.ok(articleService.getArticlePage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加/编辑资讯 |
| | | * |
| | | * @param dto 管理后台-资讯传输对象 |
| | | */ |
| | | @ApiOperation(value = "添加/编辑资讯") |
| | | @PostMapping("/save") |
| | | public R<?> saveArticle(@Validated @RequestBody MgtArticleDTO dto) { |
| | | articleService.saveArticle(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 处理举报 |
| | | * |
| | | * @param id 资讯id |
| | | */ |
| | | @ApiOperation(value = "处理举报") |
| | | @PutMapping("/handle-report/{id}") |
| | | public R<?> handleReport( |
| | | @ApiParam(name = "id", value = "资讯id", required = true) @PathVariable("id") Long id) { |
| | | articleService.handleReport(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * |
| | | * @param id 资讯id |
| | | * @return MgtArticleVO |
| | | */ |
| | | @ApiOperation(value = "查看详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<MgtArticleVO> getDetail( |
| | | @ApiParam(name = "id", value = "资讯id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(articleService.getDetail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 资讯审核 |
| | | * |
| | | * @param dto 管理后台-资讯审核传输对象 |
| | | */ |
| | | @ApiOperation("资讯审核") |
| | | @PutMapping("/audit") |
| | | public R<?> audit(@Validated @RequestBody MgtArticleAuditDTO dto) { |
| | | articleService.audit(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架 |
| | | * |
| | | * @param dto 资讯上下架数据传输对象 |
| | | */ |
| | | @ApiOperation("上架/下架") |
| | | @PutMapping("/upd-status") |
| | | public R<?> updStatus(@Validated @RequestBody MgtArticleUpdDTO dto) { |
| | | articleService.updStatus(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除资讯 |
| | | * |
| | | * @param id 资讯id |
| | | */ |
| | | @ApiOperation("删除资讯") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> removeById( |
| | | @ApiParam(name = "id", value = "资讯id", required = true) @PathVariable("id") Long id) { |
| | | articleService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.article.controller.management.dto.MgtSensitiveWordsDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtSensitiveWordsQuery; |
| | | import com.ruoyi.article.controller.management.vo.MgtSensitiveWordsVO; |
| | | import com.ruoyi.article.service.ISensitiveWordsService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 敏感词管理 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/mgt/sensitive-words") |
| | | @RequiredArgsConstructor |
| | | @Api(value = "管理后台-敏感词管理相关接口", tags = "管理后台-敏感词管理相关接口") |
| | | public class MgtSensitiveWordsController { |
| | | |
| | | private final ISensitiveWordsService sensitiveWordsService; |
| | | |
| | | /** |
| | | * 获取敏感词列表的分页数据 |
| | | * |
| | | * @param query 管理后台-敏感词查询对象 |
| | | * @return PageDTO<MgtSensitiveWordsVO> |
| | | */ |
| | | @ApiOperation("获取敏感词列表的分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MgtSensitiveWordsVO>> getSensitiveWordsPage( |
| | | @Validated @RequestBody MgtSensitiveWordsQuery query) { |
| | | return R.ok(sensitiveWordsService.getSensitiveWordsPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加敏感词 |
| | | * |
| | | * @param dto 敏感词数据传输对象 |
| | | */ |
| | | @ApiOperation("添加敏感词") |
| | | @PostMapping("/save") |
| | | public R<?> saveSensitiveWords(@Validated @RequestBody MgtSensitiveWordsDTO dto) { |
| | | sensitiveWordsService.saveSensitiveWords(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 上传敏感词 |
| | | * |
| | | * @param id 敏感词id |
| | | */ |
| | | @ApiOperation("删除敏感词") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delSensitiveWords( |
| | | @ApiParam(name = "id", value = "敏感词id", required = true) @PathVariable("id") Long id) { |
| | | sensitiveWordsService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台-资讯审核传输对象", description = "管理后台-资讯审核传输对象") |
| | | public class MgtArticleAuditDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -8029337933255222034L; |
| | | @ApiModelProperty(value = "资讯id") |
| | | @NotNull(message = "资讯id不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "审核状态 已通过 已拒绝") |
| | | @NotNull(message = "审核状态不能为空") |
| | | private AuditStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "拒绝原因") |
| | | private String refuseComment; |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "资讯评论回复查询对象", description = "资讯评论回复查询对象") |
| | | public class MgtArticleCommentsQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = -5273257330099726767L; |
| | | @ApiModelProperty(value = "资讯id") |
| | | @NotNull(message = "资讯id不能为空") |
| | | private Long articleId; |
| | | |
| | | @ApiModelProperty(value = "发布人") |
| | | private String nickname; |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台-资讯传输对象", description = "管理后台-资讯传输对象") |
| | | public class MgtArticleDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 5753062638043360603L; |
| | | |
| | | @ApiModelProperty(value = "资讯id", notes = "更新必传,添加不传") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "资讯标题") |
| | | @NotBlank(message = "资讯标题不能为空") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "资讯内容") |
| | | @NotBlank(message = "资讯内容不能为空") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "资讯图片 ['a','b','c','d','e']") |
| | | @NotBlank(message = "资讯图片不能为空") |
| | | private String images; |
| | | |
| | | @ApiModelProperty(value = "资讯视频") |
| | | private String videoUrl; |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.enums.ArticleTypeEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/11 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "资讯管理查询条件") |
| | | public class MgtArticleQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = 2287510627683906596L; |
| | | |
| | | @ApiModelProperty(value = "资讯标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "发布人") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "资讯类型 1=平台发布 2=用户发布") |
| | | private ArticleTypeEnum articleType; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "上架状态 上架中 已下架") |
| | | private ListingStatusEnum listingStatus; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/13 |
| | | */ |
| | | @Data |
| | | @ApiModel("资讯上下架数据传输对象") |
| | | public class MgtArticleUpdDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -3392887724191574253L; |
| | | |
| | | @ApiModelProperty(value = "资讯id") |
| | | @NotNull(message = "资讯id不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "上架状态 上架中 已下架") |
| | | @NotNull(message = "上架状态不能为空") |
| | | private ListingStatusEnum listingStatus; |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "敏感词数据传输对象", description = "敏感词数据传输对象") |
| | | public class MgtSensitiveWordsDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 8439052498356527062L; |
| | | |
| | | @ApiModelProperty(value = "敏感词") |
| | | @NotBlank(message = "敏感词不能为空") |
| | | private String word; |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "管理后台-敏感词查询对象", description = "管理后台-敏感词查询对象") |
| | | public class MgtSensitiveWordsQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = 821139236744918828L; |
| | | |
| | | @ApiModelProperty(value = "敏感词") |
| | | private String word; |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "资讯评论视图对象", description = "资讯评论视图对象") |
| | | public class MgtArticleCommentsVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -1559372355057590070L; |
| | | |
| | | @ApiModelProperty(value = "资讯评论id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "评论id") |
| | | private Long replyId; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "发布人") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "评论内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "发布时间") |
| | | private LocalDateTime createTime; |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management.vo; |
| | | |
| | | import com.ruoyi.common.core.enums.ArticleTypeEnum; |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/11 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "资讯管理视图对象", description = "资讯管理视图对象") |
| | | public class MgtArticleVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -7968138995698584864L; |
| | | |
| | | @ApiModelProperty(value = "资讯id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "资讯类型 1=平台发布 2=用户发布") |
| | | private ArticleTypeEnum articleType; |
| | | |
| | | @ApiModelProperty(value = "资讯标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "资讯内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "资讯图片 ['a','b','c','d','e']") |
| | | private String images; |
| | | |
| | | @ApiModelProperty(value = "资讯视频") |
| | | private String videoUrl; |
| | | |
| | | @ApiModelProperty(value = "状态 1=待审核 2=已通过 3=已拒绝") |
| | | private AuditStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "举报用户") |
| | | private String reportBy; |
| | | |
| | | @ApiModelProperty(value = "举报时间") |
| | | private LocalDateTime reportedTime; |
| | | |
| | | @ApiModelProperty(value = "点赞数") |
| | | private Integer likeCount; |
| | | |
| | | @ApiModelProperty(value = "发布人") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "收藏数") |
| | | private Integer collectCount; |
| | | |
| | | @ApiModelProperty(value = "评论数") |
| | | private Integer commentCount; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "拒绝原因") |
| | | private String refuseComment; |
| | | |
| | | @ApiModelProperty(value = "上架状态 上架中 已下架") |
| | | private ListingStatusEnum listingStatus; |
| | | |
| | | @ApiModelProperty(value = "是否被举报") |
| | | private Boolean reported; |
| | | } |
New file |
| | |
| | | package com.ruoyi.article.controller.management.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台-敏感词视图对象", description = "管理后台-敏感词视图对象") |
| | | public class MgtSensitiveWordsVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -4798653916602479053L; |
| | | @ApiModelProperty(value = "敏感词id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "敏感词") |
| | | private String word; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.enums.ArticleTypeEnum; |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | |
| | | @ApiModelProperty(value = "资讯视频") |
| | | private String videoUrl; |
| | | |
| | | @ApiModelProperty(value = "状态 1=待审核 2=已通过 3=已拒绝 4被举报") |
| | | @ApiModelProperty(value = "状态 1=待审核 2=已通过 3=已拒绝") |
| | | private AuditStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "举报用户") |
| | | private String reportBy; |
| | | @ApiModelProperty(value = "举报用户id") |
| | | private Long reportBy; |
| | | |
| | | @ApiModelProperty(value = "举报时间") |
| | | private LocalDateTime reportedTime; |
| | |
| | | @ApiModelProperty(value = "拒绝原因") |
| | | private String refuseComment; |
| | | |
| | | @ApiModelProperty(value = "上架状态 上架中 已下架") |
| | | private ListingStatusEnum listingStatus; |
| | | |
| | | @ApiModelProperty(value = "是否被举报") |
| | | private Boolean reported; |
| | | } |
| | |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField(value = "create_by", fill = FieldFill.INSERT) |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) |
| | | @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE) |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "1 评论,2 是回复") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "点赞数") |
| | | private Integer likeCount; |
| | | |
| | | @ApiModelProperty(value = "评论等级") |
| | | private Integer state; |
| | | |
| | | } |
| | |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("createBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("createBy", userId.toString(), metaObject); |
| | | fillValue("createTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("updateBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("updateBy", userId.toString(), metaObject); |
| | | fillValue("updateTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.article.controller.forepart.dto.ArticleCommentsDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleCommentsQuery; |
| | | import com.ruoyi.article.controller.management.vo.MgtArticleCommentsVO; |
| | | import com.ruoyi.article.domain.ArticleComments; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | void delMemberArticleComments(ArticleCommentsDTO articleCommentsDTO); |
| | | |
| | | /** |
| | | * 查看详情-评论详情 |
| | | * |
| | | * @param query 资讯评论回复查询对象 |
| | | * @return PageDTO<MgtArticleCommentsVO> |
| | | */ |
| | | PageDTO<MgtArticleCommentsVO> getArticleCommentsPage(MgtArticleCommentsQuery query); |
| | | |
| | | void delArticleComments(Long id); |
| | | } |
| | |
| | | package com.ruoyi.article.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.article.domain.Article; |
| | | import com.ruoyi.article.controller.forepart.dto.ArticleDTO; |
| | | import com.ruoyi.article.controller.forepart.vo.ArticleCommentsVO; |
| | | import com.ruoyi.article.controller.forepart.vo.ArticleVO; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleAuditDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleQuery; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleUpdDTO; |
| | | import com.ruoyi.article.controller.management.vo.MgtArticleVO; |
| | | import com.ruoyi.article.domain.Article; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | |
| | | /** |
| | |
| | | PageDTO<ArticleCommentsVO> getArticleCommentsList(ArticleDTO articleDTO); |
| | | void getReport(ArticleDTO articleDTO); |
| | | |
| | | /** |
| | | * 获取资讯列表的分页数据 |
| | | * |
| | | * @param query 资讯管理查询条件 |
| | | * @return PageDTO<ArticleVO> |
| | | */ |
| | | PageDTO<MgtArticleVO> getArticlePage(MgtArticleQuery query); |
| | | |
| | | /** |
| | | * "添加/编辑资讯 |
| | | * |
| | | * @param dto 管理后台-资讯传输对象 |
| | | */ |
| | | void saveArticle(MgtArticleDTO dto); |
| | | |
| | | /** |
| | | * 处理举报 |
| | | * |
| | | * @param id 资讯id |
| | | */ |
| | | void handleReport(Long id); |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * |
| | | * @param id 资讯id |
| | | * @return MgtArticleVO |
| | | */ |
| | | MgtArticleVO getDetail(Long id); |
| | | |
| | | /** |
| | | * 资讯审核 |
| | | * |
| | | * @param dto 管理后台-资讯审核传输对象 |
| | | */ |
| | | void audit(MgtArticleAuditDTO dto); |
| | | |
| | | /** |
| | | * 上架/下架 |
| | | * |
| | | * @param dto 资讯上下架数据传输对象 |
| | | */ |
| | | void updStatus(MgtArticleUpdDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.article.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.article.controller.management.dto.MgtSensitiveWordsDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtSensitiveWordsQuery; |
| | | import com.ruoyi.article.controller.management.vo.MgtSensitiveWordsVO; |
| | | import com.ruoyi.article.domain.SensitiveWords; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.system.api.domain.dto.judgeSensitiveWordsDTO; |
| | | import com.ruoyi.system.api.domain.vo.judgeSensitiveWordsVO; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | judgeSensitiveWordsVO judgeSensitiveWordsList(@RequestBody judgeSensitiveWordsDTO SensitiveWordsDTO); |
| | | |
| | | /** |
| | | * 获取敏感词列表的分页数据 |
| | | * |
| | | * @param query 管理后台-敏感词查询对象 |
| | | * @return PageDTO<MgtSensitiveWordsVO> |
| | | */ |
| | | PageDTO<MgtSensitiveWordsVO> getSensitiveWordsPage(MgtSensitiveWordsQuery query); |
| | | |
| | | /** |
| | | * 添加敏感词 |
| | | * |
| | | * @param dto 敏感词数据传输对象 |
| | | */ |
| | | void saveSensitiveWords(MgtSensitiveWordsDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.article.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.article.controller.forepart.dto.ArticleCommentsDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleCommentsQuery; |
| | | import com.ruoyi.article.controller.management.vo.MgtArticleCommentsVO; |
| | | import com.ruoyi.article.domain.Article; |
| | | import com.ruoyi.article.domain.ArticleComments; |
| | | import com.ruoyi.article.controller.forepart.dto.ArticleCommentsDTO; |
| | | import com.ruoyi.article.mapper.ArticleCommentsMapper; |
| | | import com.ruoyi.article.mapper.ArticleMapper; |
| | | import com.ruoyi.article.service.IArticleCommentsService; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import com.ruoyi.system.api.domain.dto.MemberDTO; |
| | | import com.ruoyi.system.api.feignClient.MemberClient; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Resource |
| | | private ArticleMapper articleMapper; |
| | | |
| | | @Resource |
| | | private MemberClient memberClient; |
| | | @Override |
| | | public void saveMemberArticleComments(ArticleCommentsDTO articleCommentsDTO) { |
| | | ArticleComments articleComments=new ArticleComments(); |
| | |
| | | articleComments.setMemberId(articleCommentsDTO.getMemberId()); |
| | | articleComments.setArticleId(articleCommentsDTO.getArticleId()); |
| | | articleComments.setContent(articleCommentsDTO.getContent()); |
| | | articleComments.setState(articleCommentsDTO.getState()); |
| | | articleComments.setType(1); |
| | | }else{ |
| | | articleComments.setMemberId(articleCommentsDTO.getMemberId()); |
| | |
| | | articleComments.setReplyId(articleCommentsDTO.getReplyId()); |
| | | articleComments.setContent(articleCommentsDTO.getContent()); |
| | | articleComments.setBmemberId(articleCommentsDTO.getBmemberId()); |
| | | articleComments.setState(articleCommentsDTO.getState()); |
| | | articleComments.setType(2); |
| | | } |
| | | Article byId = articleMapper.selectById(articleCommentsDTO.getArticleId()); |
| | |
| | | |
| | | this.removeById(articleCommentsDTO.getId()); |
| | | } |
| | | |
| | | /** |
| | | * 查看详情-评论详情 |
| | | * |
| | | * @param query 资讯评论回复查询对象 |
| | | * @return PageDTO<MgtArticleCommentsVO> |
| | | */ |
| | | @Override |
| | | public PageDTO<MgtArticleCommentsVO> getArticleCommentsPage(MgtArticleCommentsQuery query) { |
| | | PageDTO<MgtArticleCommentsVO> result; |
| | | Set<Long> memberIdSet = null; |
| | | Page<ArticleComments> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | if (StringUtils.isNotBlank(query.getNickname())) { |
| | | MemberDTO memberDTO = new MemberDTO(); |
| | | memberDTO.setNickname(query.getNickname()); |
| | | List<Member> data = memberClient.getMemberListByCondition(memberDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isEmpty(data)) { |
| | | // 搜索结果为空,直接返回空 |
| | | return PageDTO.empty(page); |
| | | } |
| | | memberIdSet = data.stream().map(Member::getId).collect(Collectors.toSet()); |
| | | } |
| | | page = this.lambdaQuery() |
| | | .eq(ArticleComments::getArticleId, query.getArticleId()) |
| | | .in(StringUtils.isNotEmpty(memberIdSet), ArticleComments::getMemberId, memberIdSet) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | result = PageDTO.empty(page); |
| | | } else { |
| | | PageDTO<MgtArticleCommentsVO> pageVO = PageDTO.of(page, |
| | | MgtArticleCommentsVO.class);// 获取会员信息 |
| | | Set<Long> memIdSet = pageVO.getList().stream().map(MgtArticleCommentsVO::getMemberId) |
| | | .collect(Collectors.toSet()); |
| | | List<Member> memberList = memberClient.getMemberListByIds(memIdSet, |
| | | SecurityConstants.INNER).getData(); |
| | | Map<Long, Member> memberMap = memberList.stream() |
| | | .collect(Collectors.toMap(Member::getId, Function.identity())); |
| | | pageVO.getList().forEach(item -> { |
| | | Member member = memberMap.get(item.getMemberId()); |
| | | if (StringUtils.isNotNull(member)) { |
| | | item.setNickname(member.getNickname()); |
| | | item.setPhone(member.getPhone()); |
| | | } |
| | | }); |
| | | result = pageVO; |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public void delArticleComments(Long id) { |
| | | ArticleComments articleComments = this.getById(id); |
| | | if (StringUtils.isNull(articleComments)) { |
| | | throw new ServiceException("评论不存在"); |
| | | } |
| | | // 查询资讯 |
| | | Article article = articleMapper.selectById(articleComments.getArticleId()); |
| | | |
| | | if (articleComments.getType() == 2) { |
| | | this.removeById(id); |
| | | article.setCommentCount(Math.max(article.getCommentCount() - 1, 0)); |
| | | } else if (articleComments.getType() == 1) { |
| | | List<ArticleComments> list = this.lambdaQuery().eq(ArticleComments::getReplyId, id) |
| | | .list(); |
| | | List<Long> commentsIds = list.stream().map(ArticleComments::getId) |
| | | .collect(Collectors.toList()); |
| | | commentsIds.add(articleComments.getId()); |
| | | this.removeByIds(commentsIds); |
| | | article.setCommentCount(Math.max((article.getCommentCount() - list.size()), 0)); |
| | | } |
| | | articleMapper.updateById(article); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.article.controller.forepart.dto.ArticleDTO; |
| | | import com.ruoyi.article.controller.forepart.vo.ArticleCommentsVO; |
| | | import com.ruoyi.article.controller.forepart.vo.ArticleVO; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleAuditDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleQuery; |
| | | import com.ruoyi.article.controller.management.dto.MgtArticleUpdDTO; |
| | | import com.ruoyi.article.controller.management.vo.MgtArticleVO; |
| | | import com.ruoyi.article.domain.Article; |
| | | import com.ruoyi.article.domain.ArticleComments; |
| | | import com.ruoyi.article.domain.MemberArticleCollection; |
| | | import com.ruoyi.article.domain.MemberLike; |
| | | import com.ruoyi.article.controller.forepart.dto.ArticleDTO; |
| | | import com.ruoyi.article.mapper.ArticleMapper; |
| | | import com.ruoyi.article.service.IArticleCommentsService; |
| | | import com.ruoyi.article.service.IArticleService; |
| | | import com.ruoyi.article.service.IMemberArticleCollectionService; |
| | | import com.ruoyi.article.service.IMemberLikeService; |
| | | import com.ruoyi.article.controller.forepart.vo.ArticleCommentsVO; |
| | | import com.ruoyi.article.controller.forepart.vo.ArticleVO; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.enums.ArticleTypeEnum; |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.domain.dto.MemberDTO; |
| | | import com.ruoyi.system.api.feignClient.MemberClient; |
| | | import com.ruoyi.system.api.util.HuaWeiOBSUtil; |
| | | import java.io.IOException; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private IMemberArticleCollectionService memberArticleCollectionService; |
| | | |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | @Override |
| | | public PageDTO<ArticleVO> getArticleList(ArticleDTO articleDTO) { |
| | | Page<Article> page = new Page<>(articleDTO.getPageCurr(), articleDTO.getPageSize()); |
| | |
| | | if (articleDTO.getTitle()!=null){ |
| | | wrapper.like(Article::getTitle,articleDTO.getTitle()); |
| | | } |
| | | wrapper.eq(Article::getListingStatus,0); |
| | | wrapper.eq(Article::getStatus,2); |
| | | wrapper.eq( Article::getDelFlag,0); |
| | | wrapper.orderByDesc(Article::getCreateTime); |
| | |
| | | @Override |
| | | public ArticleVO getMemberArticleInfo(ArticleDTO articleDTO) { |
| | | Article article=this.getById(articleDTO.getId()); |
| | | ArticleVO articleVO=new ArticleVO(); |
| | | |
| | | BeanUtils.copyProperties(article, articleVO); |
| | | |
| | | ArticleVO articleVO = BeanUtils.copyBean(article, |
| | | ArticleVO.class); |
| | | R<Member> membeOne = memberClient.getMembeOne(articleVO.getMemberId(), |
| | | SecurityConstants.INNER); |
| | | Member data = membeOne.getData(); |
| | |
| | | Page<ArticleComments> page1 = articleCommentsService.page(page, wrapper); |
| | | PageDTO<ArticleCommentsVO> articleCommentsVOPageDTO = PageDTO.of(page1, ArticleCommentsVO.class); |
| | | List<ArticleCommentsVO> list2 = articleCommentsVOPageDTO.getList(); |
| | | for(ArticleCommentsVO articleCommentsVO:list2){ |
| | | R<Member> membeOne = memberClient.getMembeOne(articleCommentsVO.getMemberId(), |
| | | SecurityConstants.INNER); |
| | | Member data = membeOne.getData(); |
| | | articleCommentsVO.setMemberNickname(data.getNickname()); |
| | | articleCommentsVO.setBmemberNickavatar(data.getAvatar()); |
| | | LambdaQueryWrapper<MemberLike> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.eq(MemberLike::getMemberId,articleCommentsVO.getMemberId()); |
| | | wrapper1.eq(MemberLike::getArticleId,articleCommentsVO.getArticleId()); |
| | | wrapper1.eq(MemberLike::getType,2); |
| | | wrapper1.eq( MemberLike::getDelFlag,0); |
| | | List<MemberLike> list = memberLikeService.list(wrapper1); |
| | | if (list.size()>0){ |
| | | articleCommentsVO.setIslike(1); |
| | | }else { |
| | | articleCommentsVO.setIslike(2); |
| | | } |
| | | |
| | | |
| | | List<ArticleCommentsVO> articleCommentsVOList1=new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper< ArticleComments> wrapper2= Wrappers.lambdaQuery(); |
| | | wrapper2.eq(ArticleComments::getReplyId,articleCommentsVO.getArticleId()); |
| | | wrapper2.eq( ArticleComments::getDelFlag,0); |
| | | wrapper2.eq( ArticleComments::getType,2); |
| | | List<ArticleComments> list1 = articleCommentsService.list(wrapper2); |
| | | for (ArticleComments articleComments1:list1){ |
| | | ArticleCommentsVO articleCommentsVO1=new ArticleCommentsVO(); |
| | | |
| | | R<Member> membeOne1 = memberClient.getMembeOne(articleCommentsVO.getMemberId(), |
| | | if (list2!=null){ |
| | | for(int i=0;i<list2.size();i++){ |
| | | ArticleCommentsVO articleCommentsVO=list2.get(i); |
| | | R<Member> membeOne = memberClient.getMembeOne(articleCommentsVO.getMemberId(), |
| | | SecurityConstants.INNER); |
| | | Member data1 = membeOne1.getData(); |
| | | |
| | | R<Member> membeOne2 = memberClient.getMembeOne(articleCommentsVO.getBmemberId(), |
| | | SecurityConstants.INNER); |
| | | Member data2 = membeOne2.getData(); |
| | | |
| | | articleCommentsVO1.setArticleId(articleComments1.getArticleId()); |
| | | articleCommentsVO1.setContent(articleComments1.getContent()); |
| | | articleCommentsVO1.setMemberId(articleComments1.getMemberId()); |
| | | articleCommentsVO1.setId(articleComments1.getId()); |
| | | articleCommentsVO1.setMemberNickname(data1.getNickname()); |
| | | articleCommentsVO1.setBmemberNickavatar(data1.getAvatar()); |
| | | articleCommentsVO1.setLikeCount(articleComments1.getLikeCount()); |
| | | articleCommentsVO1.setCreateTime(articleComments1.getCreateTime()); |
| | | articleCommentsVO1.setBmemberNickavatar(data2.getAvatar()); |
| | | articleCommentsVO1.setBmemberNickname(data2.getNickname()); |
| | | |
| | | LambdaQueryWrapper<MemberLike> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(MemberLike::getMemberId,articleCommentsVO.getMemberId()); |
| | | wrapper3.eq(MemberLike::getArticleId,articleCommentsVO.getArticleId()); |
| | | wrapper3.eq(MemberLike::getType,2); |
| | | wrapper3.eq( MemberLike::getDelFlag,0); |
| | | List<MemberLike> list3 = memberLikeService.list(wrapper3); |
| | | if (list3.size()>0){ |
| | | articleCommentsVO1.setIslike(1); |
| | | Member data = membeOne.getData(); |
| | | articleCommentsVO.setMemberNickname(data.getNickname()); |
| | | articleCommentsVO.setMemberNickavatar(data.getAvatar()); |
| | | LambdaQueryWrapper<MemberLike> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.eq(MemberLike::getMemberId,articleCommentsVO.getMemberId()); |
| | | wrapper1.eq(MemberLike::getArticleId,articleCommentsVO.getId()); |
| | | wrapper1.eq(MemberLike::getType,2); |
| | | wrapper1.eq( MemberLike::getDelFlag,0); |
| | | List<MemberLike> list = memberLikeService.list(wrapper1); |
| | | if (list.size()>0){ |
| | | articleCommentsVO.setIslike(1); |
| | | }else { |
| | | articleCommentsVO1.setIslike(2); |
| | | articleCommentsVO.setIslike(2); |
| | | } |
| | | articleCommentsVOList1.add(articleCommentsVO1); |
| | | |
| | | |
| | | List<ArticleCommentsVO> articleCommentsVOList1=new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper< ArticleComments> wrapper2= Wrappers.lambdaQuery(); |
| | | wrapper2.eq(ArticleComments::getReplyId,articleCommentsVO.getId()); |
| | | wrapper2.eq( ArticleComments::getDelFlag,0); |
| | | wrapper2.eq( ArticleComments::getType,2); |
| | | List<ArticleComments> list1 = articleCommentsService.list(wrapper2); |
| | | for (ArticleComments articleComments1:list1){ |
| | | ArticleCommentsVO articleCommentsVO1=new ArticleCommentsVO(); |
| | | |
| | | R<Member> membeOne1 = memberClient.getMembeOne(articleComments1.getMemberId(), |
| | | SecurityConstants.INNER); |
| | | Member data1 = membeOne1.getData(); |
| | | |
| | | |
| | | |
| | | R<Member> membeOne2 = memberClient.getMembeOne(articleComments1.getBmemberId(), |
| | | SecurityConstants.INNER); |
| | | Member data2 = membeOne2.getData(); |
| | | |
| | | articleCommentsVO1.setArticleId(articleComments1.getArticleId()); |
| | | articleCommentsVO1.setContent(articleComments1.getContent()); |
| | | articleCommentsVO1.setMemberId(articleComments1.getMemberId()); |
| | | articleCommentsVO1.setId(articleComments1.getId()); |
| | | articleCommentsVO1.setMemberNickname(data1.getNickname()); |
| | | articleCommentsVO1.setMemberNickavatar(data1.getAvatar()); |
| | | articleCommentsVO1.setBmemberNickavatar(data1.getAvatar()); |
| | | articleCommentsVO1.setLikeCount(articleComments1.getLikeCount()); |
| | | articleCommentsVO1.setCreateTime(articleComments1.getCreateTime()); |
| | | articleCommentsVO1.setBmemberNickname(data2.getNickname()); |
| | | articleCommentsVO1.setState(articleComments1.getState()); |
| | | articleCommentsVO1.setBmemberId(data2.getId()); |
| | | |
| | | LambdaQueryWrapper<MemberLike> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(MemberLike::getMemberId,articleCommentsVO.getMemberId()); |
| | | wrapper3.eq(MemberLike::getArticleId,articleComments1.getId()); |
| | | wrapper3.eq(MemberLike::getType,2); |
| | | wrapper3.eq( MemberLike::getDelFlag,0); |
| | | List<MemberLike> list3 = memberLikeService.list(wrapper3); |
| | | if (list3.size()>0){ |
| | | articleCommentsVO1.setIslike(1); |
| | | }else { |
| | | articleCommentsVO1.setIslike(2); |
| | | } |
| | | articleCommentsVOList1.add(articleCommentsVO1); |
| | | } |
| | | |
| | | articleCommentsVO.setArticleCommentsVOList(articleCommentsVOList1); |
| | | |
| | | } |
| | | |
| | | articleCommentsVO.setArticleCommentsVOList(articleCommentsVOList1); |
| | | |
| | | list2.add(articleCommentsVO); |
| | | } |
| | | |
| | | |
| | | return articleCommentsVOPageDTO; |
| | | } |
| | |
| | | R<Member> membeOne = memberClient.getMembeOne(articleDTO.getMemberId(), |
| | | SecurityConstants.INNER); |
| | | Member data = membeOne.getData(); |
| | | article.setReportBy(data.getNickname()); |
| | | article.setReportBy(data.getId()); |
| | | article.setReportedTime(LocalDateTime.now()); |
| | | article.setReported(Boolean.TRUE); |
| | | this.saveOrUpdate(article); |
| | | } |
| | | |
| | | /** |
| | | * 获取资讯列表的分页数据 |
| | | * |
| | | * @param query 资讯管理查询条件 |
| | | * @return PageDTO<ArticleVO> |
| | | */ |
| | | @Override |
| | | public PageDTO<MgtArticleVO> getArticlePage(MgtArticleQuery query) { |
| | | // 构建查询条件 |
| | | Set<Long> sysUserIdSet = null; |
| | | Set<Long> memberIdSet = null; |
| | | Page<Article> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | if (StringUtils.isNotBlank(query.getCreateBy()) || StringUtils.isNotBlank( |
| | | query.getPhone())) { |
| | | SysUser user = new SysUser(); |
| | | user.setNickName(query.getCreateBy()); |
| | | user.setPhonenumber(query.getPhone()); |
| | | List<SysUser> sysUserList = sysUserClient.getUserListByName(user, |
| | | SecurityConstants.INNER).getData(); |
| | | sysUserIdSet = sysUserList.stream().map(SysUser::getUserId) |
| | | .collect(Collectors.toSet()); |
| | | MemberDTO memberDTO = new MemberDTO(); |
| | | memberDTO.setNickname(query.getCreateBy()); |
| | | memberDTO.setPhone(query.getPhone()); |
| | | List<Member> memberlist = memberClient.getMemberListByCondition(memberDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | memberIdSet = memberlist.stream().map(Member::getId) |
| | | .collect(Collectors.toSet()); |
| | | if (StringUtils.isEmpty(sysUserIdSet) && StringUtils.isEmpty(memberIdSet)) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | } |
| | | // 分页查询 |
| | | page = this.lambdaQuery() |
| | | .in(StringUtils.isNotEmpty(sysUserIdSet), Article::getCreateBy, |
| | | sysUserIdSet) |
| | | .in(StringUtils.isNotEmpty(memberIdSet), Article::getMemberId, memberIdSet) |
| | | .eq(StringUtils.isNotNull(query.getListingStatus()), Article::getListingStatus, |
| | | query.getListingStatus()) |
| | | .like(StringUtils.isNotBlank(query.getTitle()), Article::getTitle, query.getTitle()) |
| | | .orderByDesc(Article::getReported) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | |
| | | // 若为空直接返回 |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | /*根据资讯的发布类型分别从系统用户表和会员表中查询发布人信息并封装VO*/ |
| | | PageDTO<MgtArticleVO> pageVO = PageDTO.of(page, MgtArticleVO.class); |
| | | List<MgtArticleVO> voList = pageVO.getList(); |
| | | Set<Integer> sysUserIds = voList.stream().filter(articleVO -> articleVO.getArticleType() |
| | | .equals(ArticleTypeEnum.PLATFORM_RELEASE)).map(MgtArticleVO::getCreateBy) |
| | | .map(Integer::valueOf).collect( |
| | | Collectors.toSet()); |
| | | |
| | | Map<Long, SysUser> userMap; |
| | | Map<Long, Member> memberMap; |
| | | if (StringUtils.isNotEmpty(sysUserIds)) { |
| | | List<SysUser> userList = sysUserClient.getUserList(Lists.newArrayList(sysUserIds)) |
| | | .getData(); |
| | | userMap = userList.stream().collect( |
| | | Collectors.toMap(SysUser::getUserId, Function.identity())); |
| | | } else { |
| | | userMap = null; |
| | | } |
| | | Set<Long> memIds = voList.stream().filter(articleVO -> articleVO.getArticleType() |
| | | .equals(ArticleTypeEnum.USER_POSTING)).map(MgtArticleVO::getMemberId).collect( |
| | | Collectors.toSet()); |
| | | if (StringUtils.isNotEmpty(memIds)) { |
| | | List<Member> memberList = memberClient.getMemberListByIds(memIds, |
| | | SecurityConstants.INNER).getData(); |
| | | memberMap = memberList.stream().collect( |
| | | Collectors.toMap(Member::getId, Function.identity())); |
| | | } else { |
| | | memberMap = null; |
| | | } |
| | | if (StringUtils.isNotNull(userMap)) { |
| | | voList.stream().filter(articleVO -> articleVO.getArticleType() |
| | | .equals(ArticleTypeEnum.PLATFORM_RELEASE)).forEach(articleVO -> { |
| | | SysUser sysUser = userMap.get(Long.valueOf(articleVO.getCreateBy())); |
| | | if (StringUtils.isNotNull(sysUser)) { |
| | | articleVO.setCreateBy(sysUser.getNickName()); |
| | | articleVO.setPhone(sysUser.getPhonenumber()); |
| | | } |
| | | }); |
| | | } |
| | | if (StringUtils.isNotNull(memberMap)) { |
| | | voList.stream().filter(articleVO -> articleVO.getArticleType() |
| | | .equals(ArticleTypeEnum.USER_POSTING)).forEach(articleVO -> { |
| | | Member member = memberMap.get(articleVO.getMemberId()); |
| | | if (StringUtils.isNotNull(member)) { |
| | | articleVO.setCreateBy(member.getNickname()); |
| | | articleVO.setPhone(member.getPhone()); |
| | | } |
| | | }); |
| | | } |
| | | return pageVO; |
| | | } |
| | | |
| | | /** |
| | | * "添加/编辑资讯 |
| | | * |
| | | * @param dto 管理后台-资讯传输对象 |
| | | */ |
| | | @Override |
| | | public void saveArticle(MgtArticleDTO dto) { |
| | | Article article = BeanUtils.copyBean(dto, Article.class); |
| | | if (StringUtils.isNull(article.getId())) { |
| | | article.setStatus(AuditStatusEnum.PASSED); |
| | | article.setArticleType(ArticleTypeEnum.PLATFORM_RELEASE); |
| | | this.save(article); |
| | | } else { |
| | | Article articleById = this.getById(article.getId()); |
| | | if (StringUtils.isNull(articleById)) { |
| | | throw new ServiceException("资讯不存在"); |
| | | } |
| | | this.updateById(article); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理举报 |
| | | * |
| | | * @param id 资讯id |
| | | */ |
| | | @Override |
| | | public void handleReport(Long id) { |
| | | Article article = this.getById(id); |
| | | if (StringUtils.isNull(article)) { |
| | | throw new ServiceException("资讯不存在"); |
| | | } |
| | | if (Boolean.FALSE.equals(article.getReported())) { |
| | | throw new ServiceException("该资讯未举报"); |
| | | } |
| | | article.setReported(Boolean.FALSE); |
| | | this.updateById(article); |
| | | } |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * |
| | | * @param id 资讯id |
| | | * @return MgtArticleVO |
| | | */ |
| | | @Override |
| | | public MgtArticleVO getDetail(Long id) { |
| | | Article article = this.getById(id); |
| | | if (StringUtils.isNull(article)) { |
| | | throw new ServiceException("资讯不存在"); |
| | | } |
| | | return BeanUtils.copyBean(article, MgtArticleVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 资讯审核 |
| | | * |
| | | * @param dto 管理后台-资讯审核传输对象 |
| | | */ |
| | | @Override |
| | | public void audit(MgtArticleAuditDTO dto) { |
| | | Article article = this.getById(dto.getId()); |
| | | if (StringUtils.isNull(article)) { |
| | | throw new ServiceException("资讯不存在"); |
| | | } |
| | | article.setStatus(dto.getStatus()); |
| | | if (AuditStatusEnum.REJECTED.equals(dto.getStatus())) { |
| | | article.setRefuseComment(dto.getRefuseComment()); |
| | | } |
| | | this.updateById(article); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架 |
| | | * |
| | | * @param dto 资讯上下架数据传输对象 |
| | | */ |
| | | @Override |
| | | public void updStatus(MgtArticleUpdDTO dto) { |
| | | this.lambdaUpdate().set(Article::getListingStatus, dto.getListingStatus()) |
| | | .eq(Article::getId, dto.getId()).update(); |
| | | } |
| | | } |
| | |
| | | Member data = membeOne.getData(); |
| | | memberArticleCollectionVO.setMemberNickname(data.getNickname()); |
| | | memberArticleCollectionVO.setMemberAvatar(data.getAvatar()); |
| | | memberArticleCollectionVO.setIsCollect(1); |
| | | memberArticleCollectionVO.setIsCollect(2); |
| | | |
| | | } |
| | | return articleCommentsVOPageDTO; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.article.controller.management.dto.MgtSensitiveWordsDTO; |
| | | import com.ruoyi.article.controller.management.dto.MgtSensitiveWordsQuery; |
| | | import com.ruoyi.article.controller.management.vo.MgtSensitiveWordsVO; |
| | | import com.ruoyi.article.domain.SensitiveWords; |
| | | import com.ruoyi.article.mapper.SensitiveWordsMapper; |
| | | import com.ruoyi.article.service.ISensitiveWordsService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.regex.Pattern; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.system.api.domain.dto.judgeSensitiveWordsDTO; |
| | | import com.ruoyi.system.api.domain.vo.judgeSensitiveWordsVO; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.regex.Pattern; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | return SensitiveWordsVO; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取敏感词列表的分页数据 |
| | | * |
| | | * @param query 管理后台-敏感词查询对象 |
| | | * @return PageDTO<MgtSensitiveWordsVO> |
| | | */ |
| | | @Override |
| | | public PageDTO<MgtSensitiveWordsVO> getSensitiveWordsPage(MgtSensitiveWordsQuery query) { |
| | | PageDTO<MgtSensitiveWordsVO> pageVO; |
| | | Page<SensitiveWords> page = this.lambdaQuery() |
| | | .like(StringUtils.isNotBlank(query.getWord()), SensitiveWords::getWord, |
| | | query.getWord()).page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | pageVO = PageDTO.empty(page); |
| | | } else { |
| | | pageVO = PageDTO.of(page, MgtSensitiveWordsVO.class); |
| | | } |
| | | return pageVO; |
| | | } |
| | | |
| | | /** |
| | | * 添加敏感词 |
| | | * |
| | | * @param dto 敏感词数据传输对象 |
| | | */ |
| | | @Override |
| | | public void saveSensitiveWords(MgtSensitiveWordsDTO dto) { |
| | | this.save(BeanUtils.copyBean(dto, SensitiveWords.class)); |
| | | } |
| | | } |
| | |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 拍卖场表 前端控制器 |
| | |
| | | * 拍卖大屏获取拍卖信息 |
| | | * |
| | | */ |
| | | @PostMapping("getAuctionBidRecordList") |
| | | @PostMapping("/getAuctionBidRecordList") |
| | | @ApiOperation(value = "拍卖大屏-获取拍卖信息") |
| | | public R<PageDTO<AuctionSalesroom>> getAuctionBidRecordList(@RequestBody AuctionSalesroomDTO ctionSalesroomGoodsDTO) { |
| | | public R<List<AuctionSalesroom>> getAuctionBidRecordList(@RequestBody AuctionSalesroomDTO ctionSalesroomGoodsDTO) { |
| | | return R.ok(iAuctionSalesroomService.getAuctionBidRecordList(ctionSalesroomGoodsDTO)); |
| | | |
| | | } |
| | |
| | | return R.ok(iAuctionSalesroomService.getAuctionBidRecordOne(arepartAuctionBidRecordDTO)); |
| | | } |
| | | |
| | | @PostMapping("/actionMiniLogin") |
| | | @PostMapping("/actionMiniLogin") |
| | | @ApiOperation(value = "拍卖师端-第三方登陸") |
| | | public R<AppMiniLoginVO> actionMiniLogin(@RequestBody AppMiniLoginDTO appMiniLoginDto) { |
| | | return R.ok(iAuctionSalesroomService.actionMiniLogin(appMiniLoginDto)); |
| | | } |
| | | |
| | | @PostMapping("/isMiniLogin") |
| | | @ApiOperation(value = "拍卖师端-判断是否是拍卖师") |
| | | public R<AppMiniLoginVO> isMiniLogin(@RequestBody AppMiniLoginDTO appMiniLoginDto) { |
| | | return R.ok(iAuctionSalesroomService.isMiniLogin(appMiniLoginDto)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/getMemberAuctionSalesroomList") |
| | | @ApiOperation(value = "用户端-拍卖场信息列表") |
File was renamed from ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/MemberAuctionCollectionController.java |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.system.api.domain.dto.AuctionCollectionDTO; |
| | | import com.ruoyi.system.api.domain.dto.AuctionGoodsListDTO; |
| | | import com.ruoyi.system.api.domain.vo.AuctionGoodsListVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @RestController |
| | | @RequestMapping("/member-auction-collection") |
| | | @Api(value = "用户收藏的普通拍卖商品相关接口", tags = "用户收藏的普通拍卖商品相关接口", description = "用户收藏的普通拍卖商品相关接口") |
| | | public class MemberAuctionCollectionController { |
| | | public class ForepartMemberAuctionCollectionController { |
| | | |
| | | @Resource |
| | | private IMemberAuctionCollectionService memberAuctionCollectionService; |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.InnerAuth; |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | |
| | | @InnerAuth |
| | | @PostMapping("/getAuctionGoodsOne") |
| | | public R<AuctionGoods> getAuctionGoodsOne(@RequestBody Long auctionSalesroomId) { |
| | | AuctionGoods auctionGoods=auctionGoodsService.getById(auctionSalesroomId); |
| | | public R<AuctionGoods> getAuctionGoodsOne(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO) { |
| | | AuctionGoods auctionGoods=auctionGoodsService.getById(memberAuctionSalesroomBondDTO.getAuctionGoodsId()); |
| | | return R.ok(auctionGoods); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.InnerAuth; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import javax.annotation.Resource; |
| | | 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.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @InnerAuth |
| | | @PostMapping("/getAuctionSalesroomOne") |
| | | @ResponseBody |
| | | public R<AuctionSalesroom> getauctionSalesroomOne(@RequestBody Long auctionSalesroomId) { |
| | | AuctionSalesroom auctionSalesroomOne=iAuctionSalesroomService.getById(auctionSalesroomId); |
| | | public R<AuctionSalesroom> getauctionSalesroomOne(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO) { |
| | | AuctionSalesroom auctionSalesroomOne=iAuctionSalesroomService.getById(memberAuctionSalesroomBondDTO.getAuctionSalesroomId()); |
| | | return R.ok(auctionSalesroomOne); |
| | | |
| | | } |
| | | |
| | | @InnerAuth |
| | | @PostMapping("/list-by-ids") |
| | | R<List<AuctionSalesroom>> getAuctionSalesroomByIds( |
| | | @RequestBody Collection<Long> auctionSalesroomGoodsIdSet) { |
| | | |
| | | return R.ok(iAuctionSalesroomService.getAuctionSalesroomByIds(auctionSalesroomGoodsIdSet)); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.auction.controller.management; |
| | | |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomGoodsQuery; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomQuery; |
| | | import com.ruoyi.auction.controller.management.dto.MgtScreenBidPage; |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import java.util.List; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PutMapping("/add-backup-goods") |
| | | @ApiOperation(value = "选择备选商品", notes = "选择备选商品") |
| | | public R<?> addBackupGoods(@RequestBody List<Long> idList) { |
| | | auctionSalesroomService.addBackupGoods(idList); |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "idStr", value = "商品id集合", required = true) |
| | | }) |
| | | public R<?> addBackupGoods(@RequestParam("idStr") String idStr) { |
| | | auctionSalesroomService.addBackupGoods(idStr); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | public R<?> startCurrentAuctionSalesroom( |
| | | @ApiParam(name = "auctionSalesroomId", value = "拍卖场id", required = true) |
| | | @PathVariable("auctionSalesroomId") Long auctionSalesroomId) { |
| | | auctionSalesroomService.startCurrentAuctionSalesroom(auctionSalesroomId); |
| | | try { |
| | | auctionSalesroomService.startCurrentAuctionSalesroom(auctionSalesroomId); |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | public R<?> stopCurrentAuctionSalesroom( |
| | | @ApiParam(name = "auctionSalesroomId", value = "拍卖场id", required = true) |
| | | @PathVariable("auctionSalesroomId") Long auctionSalesroomId) { |
| | | auctionSalesroomService.stopCurrentAuctionSalesroom(auctionSalesroomId); |
| | | try { |
| | | auctionSalesroomService.stopCurrentAuctionSalesroom(auctionSalesroomId); |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | public class MgtAuctionSalesroomGoodsQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = 9040206486072802788L; |
| | | |
| | | @ApiModelProperty("拍卖场id") |
| | | private Long auctionSalesroomId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsName; |
| | | |
| | | } |
| | |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "用户名") |
| | | private String nickname; |
| | | |
| | | |
| | | } |
| | |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("createBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("createBy", userId.toString(), metaObject); |
| | | fillValue("createTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("updateBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("updateBy", userId.toString(), metaObject); |
| | | fillValue("updateTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.auction.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.google.zxing.WriterException; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSaleroomBidRecordQuery; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomDTO; |
| | |
| | | import com.ruoyi.system.api.domain.vo.PayInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.WdMemberAuctionSalesroomVO; |
| | | import java.io.IOException; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | |
| | | * 拍卖大屏获取拍卖信息 |
| | | * |
| | | */ |
| | | PageDTO<AuctionSalesroom> getAuctionBidRecordList(AuctionSalesroomDTO ationSalesroomGoodsDTO); |
| | | List<AuctionSalesroom> getAuctionBidRecordList(AuctionSalesroomDTO ationSalesroomGoodsDTO); |
| | | |
| | | /** |
| | | * 暖场视频or封面海报 |
| | |
| | | AuctionSalesroom getAuctionBidRecordOne(ForepartAuctionBidRecordDTO arepartAuctionBidRecordDTO); |
| | | |
| | | AppMiniLoginVO actionMiniLogin(@RequestBody AppMiniLoginDTO appMiniLoginDto); |
| | | |
| | | AppMiniLoginVO isMiniLogin(@RequestBody AppMiniLoginDTO appMiniLoginDto); |
| | | |
| | | |
| | | PageDTO<MemberAuctionSalesroomVO> getMemberAuctionSalesroomList(MemberAuctionSalesroomDTO MemberAuctionSalesroomDTO); |
| | |
| | | * |
| | | * @param idList 备选商品id集合 |
| | | */ |
| | | void addBackupGoods(List<Long> idList); |
| | | void addBackupGoods(String idStr); |
| | | |
| | | /** |
| | | * 结束当前拍卖商品 |
| | |
| | | * |
| | | * @param auctionSalesroomId 拍卖场id |
| | | */ |
| | | void startCurrentAuctionSalesroom(Long auctionSalesroomId); |
| | | void startCurrentAuctionSalesroom(Long auctionSalesroomId) throws JsonProcessingException; |
| | | |
| | | void stopCurrentAuctionSalesroom(Long auctionSalesroomId); |
| | | void stopCurrentAuctionSalesroom(Long auctionSalesroomId) throws JsonProcessingException; |
| | | |
| | | List<AuctionSalesroom> getAuctionSalesroomByIds(Collection<Long> auctionSalesroomGoodsIdSet); |
| | | } |
| | |
| | | auctionBidRecordList = this.list(wrapper); |
| | | //判断 |
| | | if (auctionBidRecordList.size()>=auctionSalesroomGoods.getSalesroomStock()){ |
| | | for (int i=0;i<=auctionSalesroomGoods.getSalesroomStock();i++){ |
| | | for (int i=0;i<auctionSalesroomGoods.getSalesroomStock();i++){ |
| | | AuctionBidRecord auctionBidRecord= auctionBidRecordList.get(i); |
| | | auctionBidRecord.setStatus(BidStatusEnum.LEAD); |
| | | } |
| | | }else{ |
| | | for (int i=0;i<=auctionBidRecordList.size();i++){ |
| | | AuctionBidRecord auctionBidRecord= auctionBidRecordList.get(i); |
| | | auctionBidRecord.setStatus(BidStatusEnum.LEAD); |
| | | if (auctionBidRecordList.size()>0){ |
| | | for (int i=0;i<auctionBidRecordList.size();i++){ |
| | | AuctionBidRecord auctionBidRecord= auctionBidRecordList.get(i); |
| | | auctionBidRecord.setStatus(BidStatusEnum.LEAD); |
| | | } |
| | | } |
| | | |
| | | } |
| | | }if (auctionSalesroomGoods.getStatus().getCode()==2){ |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper=Wrappers.lambdaQuery(); |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | |
| | | LocalDateTime newTime7 = now.minusDays(7); |
| | | LambdaQueryWrapper<AuctionBrowseRecord> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(AuctionBrowseRecord::getDelFlag,0); |
| | | wrapper3.eq(AuctionBrowseRecord::getTargetId,auctionGoodsListDTO.getGoodsSkuId()); |
| | | wrapper3.eq(AuctionBrowseRecord::getBrowseType,1); |
| | | wrapper3.eq(AuctionBrowseRecord::getMemberId,auctionGoodsListDTO.getMemberId()); |
| | | wrapper3.ge(AuctionBrowseRecord::getCreateTime, newTime7) |
| | | .le(AuctionBrowseRecord::getCreateTime, now); |
| | | |
| | | Set<Long> goodsSkuIdList = new HashSet<>(); |
| | | List<AuctionBrowseRecord> list = this.list(wrapper3); |
| | | Set<Long> goodsSkuIdList = null; |
| | | goodsSkuIdList = list.stream().map(AuctionBrowseRecord::getTargetId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | for (AuctionBrowseRecord auctionBrowseRecord:list){ |
| | | AuctionGoods auctionGoods = auctionGoodsMapper.selectById(auctionBrowseRecord.getTargetId()); |
| | | goodsSkuIdList.add(auctionGoods.getGoodsSkuId()); |
| | | } |
| | | Set<Long> goodsSkuIdList1 = null; |
| | | if (StringUtils.isNotEmpty(auctionGoodsListDTO.getGoodsSkuName())) { |
| | | List<GoodsSku> goodsSku = goodsSkuClient.getGoodsByName(auctionGoodsListDTO.getGoodsSkuName(), |
| | |
| | | .collect(Collectors.toSet()); |
| | | } |
| | | Set<Long> goodsSkuIdList2 =null; |
| | | if (goodsSkuIdList1.size()==0){ |
| | | if (StringUtils.isNotEmpty(goodsSkuIdList1)){ |
| | | goodsSkuIdList.retainAll(goodsSkuIdList1); |
| | | goodsSkuIdList2=goodsSkuIdList; |
| | | }else { |
| | | goodsSkuIdList2=goodsSkuIdList; |
| | | } |
| | | |
| | | |
| | | Page<AuctionGoodsListVO> page = new Page<>(); |
| | | page.setSize(auctionGoodsListDTO.getPageSize()); |
| | | page.setCurrent(auctionGoodsListDTO.getPageCurr()); |
| | | AuctionGoodsListPageDTO auctionGoodsListPageDTO=new AuctionGoodsListPageDTO(); |
| | | auctionGoodsListPageDTO.setGoodsSkuIdList(goodsSkuIdList2); |
| | | if (StringUtils.isNotEmpty(goodsSkuIdList2)){ |
| | | auctionGoodsListPageDTO.setGoodsSkuIdList(goodsSkuIdList2); |
| | | }else{ |
| | | goodsSkuIdList2=new HashSet<>(); |
| | | goodsSkuIdList2.add(0L); |
| | | auctionGoodsListPageDTO.setGoodsSkuIdList(goodsSkuIdList2); |
| | | } |
| | | List<AuctionGoods> auctionGoodsPgeList = auctionGoodsMapper.getAuctionGoodsPgeList(page, auctionGoodsListPageDTO); |
| | | List<AuctionGoodsListVO> auctionGoodsVOS=new ArrayList<>(); |
| | | for (AuctionGoods auctionGoods:auctionGoodsPgeList){ |
| | |
| | | wrapper3.eq(AuctionBrowseRecord::getDelFlag,0); |
| | | wrapper3.eq(AuctionBrowseRecord::getTargetId,MemberAuctionSalesroomDTO.getAuctionSalesroomId()); |
| | | wrapper3.eq(AuctionBrowseRecord::getMemberId,MemberAuctionSalesroomDTO.getMemberId()); |
| | | wrapper3.eq(AuctionBrowseRecord::getBrowseType,2); |
| | | wrapper3.ge(AuctionBrowseRecord::getCreateTime, newTime7) |
| | | .le(AuctionBrowseRecord::getCreateTime, now); |
| | | |
| | |
| | | memberAuctionSalesroomDTO1.setAuctionSalesroomId(auctionSalesroom.getId()); |
| | | memberAuctionSalesroomDTO1.setMemberId(MemberAuctionSalesroomDTO.getMemberId()); |
| | | List<OrderAuctionBond> data1 = orderClient.getOrderAuctionBondList1(memberAuctionSalesroomDTO1, SecurityConstants.INNER).getData(); |
| | | memberAuctionSalesroomVO.setBondTime(data1.get(0).getCreateTime()); |
| | | if (data1.size()>0){ |
| | | memberAuctionSalesroomVO.setIsBond(2); |
| | | }else{ |
| | | memberAuctionSalesroomVO.setIsBond(1); |
| | | } |
| | | MemberAuctionSalesroomDTO memberAuctionSalesroomDTO2=new MemberAuctionSalesroomDTO(); |
| | | memberAuctionSalesroomDTO2.setAuctionSalesroomId(auctionSalesroom.getId()); |
| | | List<OrderAuctionBond> data2 = orderClient.getOrderAuctionBondList1(memberAuctionSalesroomDTO2, SecurityConstants.INNER).getData(); |
| | | memberAuctionSalesroomVO.setBondNum(data2.size()); |
| | | memberAuctionSalesroomVO.setBond(auctionSalesroom.getBond()); |
| | | List.add(memberAuctionSalesroomVO); |
| | | } |
| | | page.setRecords(List); |
| | |
| | | import com.ruoyi.common.core.enums.AuctionStartStatusEnum; |
| | | import com.ruoyi.common.core.enums.BidStatusEnum; |
| | | import com.ruoyi.common.core.enums.BondStatusEnum; |
| | | import com.ruoyi.common.core.enums.ClientTypeEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderFromEnum; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | @Override |
| | | public PageDTO<MgtAuctionGoodsVO> getAuctionGoodsPage(MgtAuctionGoodsQuery query) { |
| | | Set<Long> goodsSkuIdList = null; |
| | | Page<AuctionGoods> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | if (StringUtils.isNotEmpty(query.getGoodsSkuName())) { |
| | | List<GoodsSku> goodsSku = goodsSkuClient.getGoodsByName(query.getGoodsSkuName(), |
| | | SecurityConstants.INNER) |
| | | .getData(); |
| | | SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isEmpty(goodsSku)) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | goodsSkuIdList = goodsSku.stream().map(GoodsSku::getId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | } |
| | | Page<AuctionGoods> page = this.lambdaQuery() |
| | | page = this.lambdaQuery() |
| | | .select(AuctionGoods::getId, AuctionGoods::getGoodsSkuId, |
| | | AuctionGoods::getListingStatus, AuctionGoods::getStartStatus, |
| | | AuctionGoods::getStartTime, AuctionGoods::getEndTime, |
| | |
| | | query.getStartStatus()) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page.getTotal(), page.getPages()); |
| | | return PageDTO.empty(page); |
| | | } |
| | | // 查询商品信息 |
| | | Set<Long> goodsIdList = page.getRecords().stream().map(AuctionGoods::getGoodsSkuId) |
| | |
| | | return null; |
| | | }).filter(Objects::nonNull).collect(Collectors.toList()); |
| | | // 远程调用订单服务修改订单状态 |
| | | orderClient.updateOrderAuctionBondStatus(ids, BondStatusEnum.PAID); |
| | | orderClient.updateOrderAuctionBondStatus(ids, BondStatusEnum.PAID,SecurityConstants.INNER); |
| | | } |
| | | } |
| | | } |
| | |
| | | auctionGoodsVO.setStartTime(auctionGoods.getStartTime()); |
| | | auctionGoodsVO.setStartingPrice(auctionGoods.getStartingPrice()); |
| | | auctionGoodsVO.setStartStatus(auctionGoods.getStartStatus()); |
| | | auctionGoodsVO.setAuctionStock(auctionGoods.getAuctionStock()); |
| | | GoodsSku goodsSkuOne = goodsSkuClient.getGoodsSkuOne(auctionGoods.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | auctionGoodsVO.setUnit(goodsSkuOne.getUnit()); |
| | | auctionGoodsVO.setSpec(goodsSkuOne.getSpec()); |
| | |
| | | }else { |
| | | auctionGoodsinfoVO.setIsCollection(1); |
| | | } |
| | | List<OrderAuctionBond> datas = auctionClient.getAuctionGoodsOrderAuctionBondList(auctionGoodsListDTO, SecurityConstants.INNER).getData(); |
| | | List<OrderAuctionBond> datas = orderClient.getAuctionGoodsOrderAuctionBondList(auctionGoodsListDTO, SecurityConstants.INNER).getData(); |
| | | if (datas.size()>0){ |
| | | auctionGoodsinfoVO.setIsApply(2); |
| | | }else{ |
| | |
| | | public PageDTO<AuctionGoodsListVO> getWdAuctionSalesList(AuctionGoodsListDTO auctionGoodsListDTO) { |
| | | MemberAuctionSalesroomDTO memberAuctionSalesroomDTO =new MemberAuctionSalesroomDTO(); |
| | | memberAuctionSalesroomDTO.setMemberId(auctionGoodsListDTO.getMemberId()); |
| | | List<OrderAuctionBond> data = auctionClient.getAuctionGoodsOrderAuctionBondList(auctionGoodsListDTO, SecurityConstants.INNER).getData(); |
| | | List<OrderAuctionBond> data = orderClient.getAuctionGoodsOrderAuctionBondList(auctionGoodsListDTO, SecurityConstants.INNER).getData(); |
| | | Set<Long> goodsSkuIdList = null; |
| | | goodsSkuIdList = data.stream().map(OrderAuctionBond::getAuctionSalesroomId) |
| | | .collect(Collectors.toSet()); |
| | | if (data!=null){ |
| | | goodsSkuIdList = data.stream().map(OrderAuctionBond::getAuctionSalesroomId) |
| | | .collect(Collectors.toSet()); |
| | | }else { |
| | | Set<Long> goodsSkuIdList1 =new HashSet<>(); |
| | | goodsSkuIdList1.add(0L); |
| | | goodsSkuIdList=goodsSkuIdList1; |
| | | } |
| | | |
| | | AuctionGoodsListPageDTO auctionGoodsListPageDTO=new AuctionGoodsListPageDTO(); |
| | | auctionGoodsListPageDTO.setGoodsSkuIdList(goodsSkuIdList); |
| | | if (goodsSkuIdList!=null){ |
| | | auctionGoodsListPageDTO.setGoodsSkuIdList(goodsSkuIdList); |
| | | } |
| | | |
| | | if (auctionGoodsListDTO.getStartStatus()!=4){ |
| | | auctionGoodsListPageDTO.setStartStatus(auctionGoodsListDTO.getStartStatus()); |
| | | } |
| | |
| | | .equals(AuctionStartStatusEnum.IN_AUCTION)) { |
| | | this.lambdaUpdate().set(AuctionGoods::getStartStatus, AuctionStartStatusEnum.ENDED) |
| | | .eq(AuctionGoods::getId, id); |
| | | // TODO 退保证金 |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_GOODS); |
| | | map.put("notification_time", LocalDateTime.now()); |
| | | map.put("target_id", id); |
| | | map.put("message_type", "end"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | WebSocketUsers.sendMessageToUsersByText(msg); |
| | | WebSocketUsers.sendMessageToUsersByType(1, msg); |
| | | log.info("===================>发送websocket通知,消息体{}", msg); |
| | | } |
| | | } |
| | |
| | | map.put("target_id", id); |
| | | map.put("message_type", "start"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | WebSocketUsers.sendMessageToUsersByText(msg); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), msg); |
| | | log.info("===================>发送websocket通知,消息体{}", msg); |
| | | } |
| | | } |
| | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.system.api.constants.NotificationTypeConstant; |
| | | import com.ruoyi.system.api.domain.*; |
| | | import com.ruoyi.system.api.domain.dto.AuctionSalesroomDTO; |
| | | import com.ruoyi.system.api.domain.dto.AuctionSalesroomGoodsInfoDTO; |
| | | import com.ruoyi.system.api.domain.vo.AuctionBidRecordVO; |
| | | import com.ruoyi.system.api.domain.vo.AuctionSalesroomGoodsInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.AuctionSalesroomVO; |
| | | import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomGoodsVO; |
| | | import com.ruoyi.auction.domain.AuctionBidRecord; |
| | | import com.ruoyi.auction.domain.AuctionBrowseRecord; |
| | | import com.ruoyi.auction.domain.AuctionSalesroomGoods; |
| | | import com.ruoyi.auction.mapper.AuctionBidRecordMapper; |
| | | import com.ruoyi.auction.mapper.AuctionSalesroomGoodsMapper; |
| | |
| | | import com.ruoyi.common.core.enums.AuctionOrderTypeEnum; |
| | | import com.ruoyi.common.core.enums.AuctionStartStatusEnum; |
| | | import com.ruoyi.common.core.enums.BidStatusEnum; |
| | | import com.ruoyi.common.core.enums.ClientTypeEnum; |
| | | import com.ruoyi.common.core.enums.OrderFromEnum; |
| | | import com.ruoyi.system.api.constants.NotificationTypeConstant; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import com.ruoyi.system.api.domain.CustomConfig; |
| | | import com.ruoyi.system.api.domain.GoodsBrand; |
| | | import com.ruoyi.system.api.domain.GoodsCategory; |
| | | import com.ruoyi.system.api.domain.GoodsFlavorType; |
| | | import com.ruoyi.system.api.domain.GoodsSeries; |
| | | import com.ruoyi.system.api.domain.GoodsSku; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import com.ruoyi.system.api.domain.MemberAddress; |
| | | import com.ruoyi.system.api.domain.dto.AuctionSalesroomDTO; |
| | | import com.ruoyi.system.api.domain.dto.AuctionSalesroomGoodsInfoDTO; |
| | | import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderAuctionBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import com.ruoyi.system.api.domain.vo.AuctionBidRecordVO; |
| | | import com.ruoyi.system.api.domain.vo.AuctionSalesroomGoodsInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.AuctionSalesroomVO; |
| | | import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomGoodsVO; |
| | | import com.ruoyi.system.api.feignClient.GoodsSkuClient; |
| | | import com.ruoyi.system.api.feignClient.MemberClient; |
| | | import com.ruoyi.system.api.feignClient.OrderClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.util.WebSocketUsers; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.util.WebSocketUsers; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | |
| | | wrapper.last("limit 1"); |
| | | AuctionSalesroomGoods auctionSalesroomGoods = this.getOne(wrapper); |
| | | ForepartAuctionSalesroomGoodsVO currentAuctionSalesroomGoods= new ForepartAuctionSalesroomGoodsVO(); |
| | | R<GoodsSku> goodsSkuOne = goodsSkuClient.getGoodsSkuOne( |
| | | auctionSalesroomGoods.getGoodsSkuId(), SecurityConstants.INNER); |
| | | GoodsSku goodsSku=goodsSkuOne.getData(); |
| | | currentAuctionSalesroomGoods.setGoodsSkuName(goodsSku.getSkuName()); |
| | | currentAuctionSalesroomGoods.setCoverPic(goodsSku.getCoverPic()); |
| | | currentAuctionSalesroomGoods.setStartTime(auctionSalesroomGoods.getStartTime()); |
| | | currentAuctionSalesroomGoods.setListingDuration(auctionSalesroomGoods.getListingDuration()); |
| | | auctionSalesroomVO.setCurrentAuctionSalesroomGoods(currentAuctionSalesroomGoods); |
| | | |
| | | list.add(auctionSalesroomGoods.getSortNum()); |
| | | |
| | | if (auctionSalesroomGoods!=null){ |
| | | R<GoodsSku> goodsSkuOne = goodsSkuClient.getGoodsSkuOne( |
| | | auctionSalesroomGoods.getGoodsSkuId(), SecurityConstants.INNER); |
| | | GoodsSku goodsSku=goodsSkuOne.getData(); |
| | | currentAuctionSalesroomGoods.setGoodsSkuName(goodsSku.getSkuName()); |
| | | currentAuctionSalesroomGoods.setGoodsSkuId(auctionSalesroomGoods.getGoodsSkuId()); |
| | | currentAuctionSalesroomGoods.setCoverPic(goodsSku.getCoverPic()); |
| | | currentAuctionSalesroomGoods.setStartTime(auctionSalesroomGoods.getStartTime()); |
| | | currentAuctionSalesroomGoods.setGoodsSkustatus(auctionSalesroomGoods.getStatus()); |
| | | currentAuctionSalesroomGoods.setListingDuration(auctionSalesroomGoods.getListingDuration()); |
| | | auctionSalesroomVO.setCurrentAuctionSalesroomGoods(currentAuctionSalesroomGoods); |
| | | list.add(auctionSalesroomGoods.getSortNum()); |
| | | } |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrapper1=Wrappers.lambdaQuery(); |
| | | wrapper1.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrapper1.eq(AuctionSalesroomGoods::getSortNum,auctionSalesroomGoods.getSortNum()+1); |
| | | wrapper1.eq(AuctionSalesroomGoods::getStatus,0); |
| | | if (auctionSalesroomGoods!=null) { |
| | | wrapper1.eq(AuctionSalesroomGoods::getSortNum, auctionSalesroomGoods.getSortNum() + 1); |
| | | list.add(auctionSalesroomGoods.getSortNum()+1); |
| | | }else{ |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrappers=Wrappers.lambdaQuery(); |
| | | wrappers.eq(AuctionSalesroomGoods::getStatus,0); |
| | | wrappers.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrappers.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | wrappers.orderByAsc(AuctionSalesroomGoods::getSortNum); |
| | | wrappers.last("limit 1"); |
| | | AuctionSalesroomGoods auctionSalesroomGoodss = this.getOne(wrappers); |
| | | if (auctionSalesroomGoodss!=null){ |
| | | R<GoodsSku> goodsSkuOne = goodsSkuClient.getGoodsSkuOne( |
| | | auctionSalesroomGoodss.getGoodsSkuId(), SecurityConstants.INNER); |
| | | GoodsSku goodsSku=goodsSkuOne.getData(); |
| | | currentAuctionSalesroomGoods.setGoodsSkuName(goodsSku.getSkuName()); |
| | | currentAuctionSalesroomGoods.setGoodsSkuId(auctionSalesroomGoodss.getGoodsSkuId()); |
| | | currentAuctionSalesroomGoods.setCoverPic(goodsSku.getCoverPic()); |
| | | currentAuctionSalesroomGoods.setStartTime(auctionSalesroomGoodss.getStartTime()); |
| | | currentAuctionSalesroomGoods.setGoodsSkustatus(auctionSalesroomGoodss.getStatus()); |
| | | currentAuctionSalesroomGoods.setListingDuration(auctionSalesroomGoodss.getListingDuration()); |
| | | auctionSalesroomVO.setCurrentAuctionSalesroomGoods(currentAuctionSalesroomGoods); |
| | | } |
| | | wrappers.eq(AuctionSalesroomGoods::getSortNum, auctionSalesroomGoodss.getSortNum()); |
| | | list.add(auctionSalesroomGoodss.getSortNum()); |
| | | } |
| | | wrapper1.last("limit 1"); |
| | | AuctionSalesroomGoods auctionSalesroomGoods1 = this.getOne(wrapper1); |
| | | ForepartAuctionSalesroomGoodsVO nextAuctionSalesroomGoods= new ForepartAuctionSalesroomGoodsVO(); |
| | | if (auctionSalesroomGoods1!=null){ |
| | | list.add(auctionSalesroomGoods.getSortNum()+1); |
| | | |
| | | R<GoodsSku> goodsSkuOne1 = goodsSkuClient.getGoodsSkuOne( |
| | | auctionSalesroomGoods.getGoodsSkuId(), SecurityConstants.INNER); |
| | | auctionSalesroomGoods1.getGoodsSkuId(), SecurityConstants.INNER); |
| | | GoodsSku goodsSku1=goodsSkuOne1.getData(); |
| | | nextAuctionSalesroomGoods.setNextGoodsSkuName(goodsSku1.getSkuName()); |
| | | nextAuctionSalesroomGoods.setCoverPic(goodsSku1.getCoverPic()); |
| | | nextAuctionSalesroomGoods.setGoodsSkustatus(auctionSalesroomGoods1.getStatus()); |
| | | nextAuctionSalesroomGoods.setGoodsSkuId(auctionSalesroomGoods1.getGoodsSkuId()); |
| | | auctionSalesroomVO.setNextAuctionSalesroomGoods(nextAuctionSalesroomGoods); |
| | | } |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery(); |
| | | wrapper2.notIn(AuctionSalesroomGoods::getSortNum,list); |
| | | wrapper2.notIn(AuctionSalesroomGoods::getSortNum,list); |
| | | wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | |
| | | GoodsSku goodsSku2=goodsSkuOne2.getData(); |
| | | forepartAuctionSalesroomGoodsVO1.setGoodsSkuName(goodsSku2.getSkuName()); |
| | | forepartAuctionSalesroomGoodsVO1.setCoverPic(goodsSku2.getCoverPic()); |
| | | forepartAuctionSalesroomGoodsVO1.setGoodsSkuId(salesroomGoods.getGoodsSkuId()); |
| | | forepartAuctionSalesroomGoodsVO1.setGoodsSkustatus(salesroomGoods.getStatus()); |
| | | auctionSalesroomGoodsVOS.add(forepartAuctionSalesroomGoodsVO1); |
| | | } |
| | |
| | | msg = objectMapper.writeValueAsString(map); |
| | | } catch (JsonProcessingException e) { |
| | | } |
| | | WebSocketUsers.sendMessageToUsersByText(msg); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.AUCTIONEER.getCode(), msg); |
| | | |
| | | } |
| | | |
| | |
| | | msg = objectMapper.writeValueAsString(map); |
| | | } catch (JsonProcessingException e) { |
| | | } |
| | | WebSocketUsers.sendMessageToUsersByText(msg); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.AUCTIONEER.getCode(), msg); |
| | | } |
| | | |
| | | |
| | |
| | | @Override |
| | | public List<AuctionSalesroomGoods> isAuctionSalesroom(AuctionSalesroomDTO ationSalesroomGoodsDTO) { |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery(); |
| | | wrapper2.eq(AuctionSalesroomGoods::getStatus,0); |
| | | wrapper2.eq(AuctionSalesroomGoods::getStatus,1); |
| | | wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | List<AuctionSalesroomGoods> auctionSalesroomGoods = this.list(wrapper2); |
| | |
| | | auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.IN_PROGRESS); |
| | | this.updateById(auctionSalesroomGoods); |
| | | |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | /* Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM_GOODS); |
| | | map.put("notification_time", LocalDateTime.now()); |
| | | map.put("goodsSkuId", auctionSalesroomGoods.getId()); |
| | |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | WebSocketUsers.sendMessageToUsersByText(msg); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.AUCTIONEER.getCode(), msg);*/ |
| | | } |
| | | |
| | | |
| | |
| | | wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,auctionSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrapper2.eq(AuctionSalesroomGoods::getGoodsSkuId,auctionSalesroomGoodsDTO.getGoodsSkuId()); |
| | | AuctionSalesroomGoods auctionSalesroomGood=this.getOne(wrapper2); |
| | | AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(auctionSalesroomGood.getAuctionSalesroomId()); |
| | | AuctionSalesroomGoods auctionSalesroomGoods=this.getOne(wrapper2); |
| | | AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(auctionSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | |
| | | AuctionSalesroomGoods auctionSalesroomGoods=this.getById(auctionSalesroomGoodsDTO.getGoodsSkuId()); |
| | | List<AuctionBidRecord> auctionBidRecordList=new ArrayList<>(); |
| | | |
| | | if (auctionSalesroomGoods.getStatus().getCode()==1) { |
| | |
| | | } |
| | | } |
| | | |
| | | auctionSalesroomGood.setStatus(AuctionGoodsStatusEnum.ENDED); |
| | | this.updateById(auctionSalesroomGood); |
| | | auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.ENDED); |
| | | this.updateById(auctionSalesroomGoods); |
| | | |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | /* Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM_GOODS); |
| | | map.put("notification_time", LocalDateTime.now()); |
| | | map.put("goodsSkuId", auctionSalesroomGoods.getId()); |
| | |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | WebSocketUsers.sendMessageToUsersByText(msg); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.AUCTIONEER.getCode(), msg);*/ |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.auction.service.impl; |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.alipay.api.AlipayClient; |
| | | import com.alipay.api.internal.util.AlipayEncrypt; |
| | | import com.alipay.api.internal.util.AlipaySignature; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.common.collect.Lists; |
| | | import com.google.zxing.WriterException; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSaleroomBidRecordQuery; |
| | |
| | | import com.ruoyi.common.core.enums.AuctionStartStatusEnum; |
| | | import com.ruoyi.common.core.enums.BidStatusEnum; |
| | | import com.ruoyi.common.core.enums.BondStatusEnum; |
| | | import com.ruoyi.common.core.enums.ClientTypeEnum; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.IDhelper; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | import com.ruoyi.common.core.utils.page.CollUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.constants.NotificationTypeConstant; |
| | | import com.ruoyi.system.api.domain.AppMiniLoginVO; |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | |
| | | import com.ruoyi.system.api.feignClient.OrderClient; |
| | | import com.ruoyi.system.api.feignClient.PromotionClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.util.WebSocketUsers; |
| | | import io.seata.spring.annotation.GlobalTransactional; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | |
| | | /** |
| | | * appID |
| | | **/ |
| | | private static final String APP_ID_PROD = "2021004147684313"; |
| | | private static final String APP_ID_PROD = "2021004150664294"; |
| | | /** |
| | | * 私钥 |
| | | */ |
| | | private static final String APP_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCg31tKXap7oTKKKDtfXc/hQjriSJkKopfRkh9j1UA/BpY+6GLkbJhg8kw9CRCILjfi5M0F3FCu+j1ogeDE1ivRGJlX1l/TGj+HuM1g8qLx/tD5D+9nJq5UHfaoKxXPko8H3AWcN1n/MAq3kRwUJRkeYJyYrZ7Sd6RU2taVLktWu92lqoUahjFkQSkdJoKi77v5i1T56PLRFfClt72tnvgol4OXBfFEjpGVrnuYoiHCgLV9eN5Qmvdas/04TtU396p+atYycU2P/dU9fdc8NFFFJo+eYH7astJXIQsowpLtTS7lavQuzCcLvC20pRBPhql5+5X96DVdnOLMbdUKwLQ9AgMBAAECggEAZLuXgVhnYSSN7f7FNrEaczWyg3DsC8HGCN9TsoKcyRpJyDhhfCEXxVTTMkDTzkIKkpOsYagUCYz+GMuCwB5Pr42Ur3C37gr4jvbD+5nTOG7T0bENumx5Kojco27fKGvgDg7SoH/0ZZtiipFdoKueL+xVAjFtSuLJzqx9Q0qKuFLJH0lrQfHYyGcq9ZzrPKLrMZb3Ve3upmpaLjIddZmqnzK7g5lx/OLHEujXIR9u0VWzzxqeaFkgCAMuyzkNYwlpqtiTJsEggbnG9YsLf0n156F0dXo2i44fUav+bKU2ksv7YmENx3R9gPDuPAKH+MwQlwVIc6tR8jKoz0cUbmaujQKBgQDhvaQd4jg9zszdVw1enPWKWViu4rsEFirIz3CUBRB3g2mkZ+tXpQQps7bL7KLBFfXmVYiVMu4EoOfZlkAjJPbFMj9aSPZ3pbx0VnHG8+3T9T2eJdzZp/CehG3MyycNHxAbbl2B04Chiiyf67R0b4ZLMHoElQgJP9jF1q3Xiloi0wKBgQC2b73S4LZWlWkyIsmHYHmXyWta64W2whlL4Nsy97tl4kZNfLCG7mgG5FhHhi16lT7J6Sw1D2FgFov2B1r9+yGBRxckGzWoY5m6FtBE/l+42+gxsB41+kEgirVjlEaX7YBXmnux2LntPVlJOG6HTizjcUnTesGIRvwbmbR2tuXCrwKBgQCMJwKq7xW+AhQdY/vP/yFPaRNvWSOFcQHVNT2PGOnVWciQI1jxTGmePo7CY0PVH35RKE+pWjp+syvfYrKlX0C6w+yjcGNde4/apwTy4eWJ0FwWQSmyFNuGf2/wUz0Gn3+PmGEDxr25DaGRFHUwSUGWkx1elOytWW+LvTKnfKVjswKBgGuh50MnskvI4IRkw7Mr9vDXM5AzjfLx9syuf4RFZflJEyMaImeo9hTC2VZxUhmVPbMP7zXqug9fnflsA4H+jJjh4UQ7DWAoSwTf+sYJsV211/qgpmJAH/Zb/4Idc7yksWh9yuZ1L9RIsomhUoxfUdpp9x1euhl1j72U5ER5yXofAoGAZNrIYFWk4S8mqFY8/h0YVGxT7Hj0ppLsq20N4OzglScoEEG+aYmWDOQU9kWcxsD44bMdzk2k0DyOhHbp8Tjd1hp0UFb03s8HgERcFHMZMzQ5oqtWQEoYiyQZxReXZZvWUbV+dg1HXXG8I26XAKb3OWFUIBBfKa2/Ig9ensY9m+M="; |
| | | private static final String APP_PRIVATE_KEY = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC3ap1qQ5GTe+syB8Tu/fH8nRdpjA7yNgLINR/kFq1VFzxDref7DQDUDWXt+s5QZyBjL1UfbQWtA96F+OpgmIiNMdZSn9FH/w5XSqSd7B4nAa1sgfdLdZDvm+crqzn8OzyEJTrO8tihF+9K+btBl37s3QfmmzCRl1PAAMGqfy/JcQ2aivY+hxb25V0kD5AAXM7mVC2zzcBrykzafQCXEnDC7ls4Hjy0agmq1bKSx8SLYTsXAzZiGk9E7yh76nDAB+P1+kKPEYJXociU3k4YRR7l+6tzBPd+/mVkL34nuV5IiAK/795CrP/9gC50nZK/6CqSPDlQlOaAaJ2uZvAOeKx3AgMBAAECggEAMzw5+swjJ0KvYYtgDK6tYTZ0qswwBKLnxgto/CsFgkZ6VCGJMszgFVwkxASSi00zc+Ft8thehIUXLO9qcU9Knb51MyFnsafi1qmIMIEbryO90RjA/rg5o2U2fzFWgkn9zqAjvFmEAAQSmSwHjfwGvZ3Erjtdpt3RzEmpz7m1nJxYuZ2JLdo8AIY+iYn1NeDxHMi27RtqsZje7RV5YXrqKtMMzW2atmj+Dbn/E1pxpF0Dz6l0TqQh5B+9j1XlPTZKcYOYHNI0ACV+dV1NZsqmdhX0lKtQbsj/Q67vhq7uCmQRKcEka/5Z0X/TOKbwJE6i2/YEuA4PUGLpBMZQXhSGYQKBgQD50IuUTG6fg1dqFt9bJXxq2i1lkIHvzaCkHqVnTMyTDs+VcO2S6YaAFy6BLSI933qvHLogkhqnHiN+BRHe/M5+4TAOx30SQlJYa5ojpNFwMnRSZgxLoEddwlfj6qTnCgDW3CsUPR85x85NjIhONy75muNnNG8GHdn3blk2Y7KhpwKBgQC79TQhz5eJ6cwiWPWMWnnSAVvFKW4iPZjkbk+Sl7JXuqzvsdE47gGN0Vk8iYWEc2WrnQY6vf7WnamQYi+Gr5ySfTSt9qwvRx0IRzHdSZkOsHJLBCnAt+Pf+pSBc2Z788iUXVbDRAIfF6YYG44P3jHspbnGPJt14PP0sHbPmh7YsQKBgGzGGYChJyndjpprCyYs1FfSWCH5IhrAdkn/7hVko08FC+4OFeP6Os5bSayFcntua4UEBSdZdrF9tgaRPo7RlTg55SsKQbNJnYFSmPMcOPWZgny+YmwrheeVT5+188eF24eypi9Rzd7i2Tl7D36/GH0mrA2sDwuiw92w9rdwAb/RAoGAf6RDZPqvNI87e8/h4RDITd9yTPCXxFUEcYygKTMvf/hb3ONq7DhlgcO70CqsK4iacPLP+jBw0Zp8PnsPP24e7DRvA/zSbcDjbG285URH1vvogh0vpZq7+60WENsnq+GgQ3EnrK+QqUDMIO8FiK0iRk09XexmvqSnx3HXHaDSdeECgYB9htO5mOn2/ugIeMw11g+JJkZ/hzE55/6fLf7zh3yel5EflmAdYRv0lHafjyXIzNrAnBgD95x4LKGLi9A5AMo9SJJu0ZOg1KujKPVY4ByCm9SO7ErJDuHI4AhtewdHhYDpnXMakoxm/medSjlt7GCVv7E/eDpNZs+MLi9MiTFx2g=="; |
| | | /** |
| | | * 支付宝公钥 |
| | | */ |
| | | private static final String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh+tCVKqUmlHDL8Ki1TUJtzE5IKV1irJuoHWZTvndJCKJJ8bdWxL9mu5xsy8KkfrnS6wJIKBMLTxMoYQHG7l2Gt07YyUCYHS5+yvbHtTkyFFy2KRPeUEWXz1Tm4juvInDvvr+n7v9ETepToGhC+UDlQcBvuSppw8N+463E+1GRrC4APwXYGLzaIvYvDHcQAULkWhXsjzxJSmeSi12kqWKlgnVJC1y0FT8xQtvhwShfaIqKwzErn9S2z7JjdXboJMUYQHoqF1A4SmWY8c0qawqvx2hGP36W3RDQ4cczzFwUHS1Cylhsbgh1COc4OdANCX4Np2NUzaRDCNzN0WVFKtK+QIDAQAB"; |
| | | private static final String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlW2RMACojdqTa8H+j6411Lm5UipGXXbQiswq50rUflwjTj843zNVaVpk8uJmbdmtUBJlmblgBS/a31O4L4LrHB8WxJ+w0f9DBNTq9T6b80MiAVnU/3gXK365DmbzPWS5pR9wEgJVHnfOFUbsB5AVFHV0m9hUZcPv7xveuEp3BEoD5smaDJByR+KgFw0Q0JgINhhE6bsEa3UgJ198af269LtQ5HJl1TWLI8aeqW14HrxyADIt49NB9KZ8MOdKP+66HWcrXlipKFHtccy3dff72DqPmFdESoXfLXKZyhU5w9v4Q5F6UoAGTPwl9KQwikTobNeJ/7su7X3AB6+C14J4sQIDAQAB"; |
| | | |
| | | |
| | | private static final ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | @Override |
| | | public PageDTO<AuctionSalesroom> getAuctionBidRecordList(AuctionSalesroomDTO ationSalesroomGoodsDTO) { |
| | | Page<AuctionSalesroom> page = new Page<>(ationSalesroomGoodsDTO.getPageCurr(), ationSalesroomGoodsDTO.getPageSize()); |
| | | public List<AuctionSalesroom> getAuctionBidRecordList(AuctionSalesroomDTO ationSalesroomGoodsDTO) { |
| | | LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionSalesroom::getSalesroomName,ationSalesroomGoodsDTO.getSalesroomName()); |
| | | wrapper.like(AuctionSalesroom::getSalesroomName,ationSalesroomGoodsDTO.getSalesroomName()); |
| | | wrapper.eq(AuctionSalesroom::getDelFlag,0); |
| | | Page<AuctionSalesroom> page1 = this.page(page, wrapper); |
| | | return PageDTO.of(page1); |
| | | List<AuctionSalesroom> page1 = this.list(wrapper); |
| | | return page1; |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public AppMiniLoginVO actionMiniLogin(AppMiniLoginDTO appMiniLoginDto) { |
| | | AppMiniLoginVO appMiniLoginVo = new AppMiniLoginVO(); |
| | | if (appMiniLoginDto.getType()==1) { |
| | | /*if (appMiniLoginDto.getType()==1) { |
| | | if (appMiniLoginDto.getAuth_code() == null || appMiniLoginDto.getAuth_code().length() == 0) { |
| | | } else { |
| | | //1. 获取验签和解密所需要的参数 |
| | | } else {*/ |
| | | /* //1. 获取验签和解密所需要的参数 |
| | | Map<String, String> openapiResult = JSON.parseObject(appMiniLoginDto.getAuth_code(), |
| | | new TypeReference<Map<String, String>>() { |
| | | }, Feature.OrderedField); |
| | |
| | | String plainData = null; |
| | | if (isDataEncrypted) { |
| | | try { |
| | | plainData = AlipayEncrypt.decryptContent(content, encryptType, "VSpPcLQjLSoTz6Yd7KNoyQ==", charset); |
| | | plainData = AlipayEncrypt.decryptContent(content, encryptType, "XABBSOeWDakvuG9TDez4Qg==", charset); |
| | | } catch (AlipayApiException e) { |
| | | //解密异常, 记录日志 |
| | | e.getMessage(); |
| | |
| | | Map<String, String> openapiResult1 = JSON.parseObject(plainData, |
| | | new TypeReference<Map<String, String>>() { |
| | | }, Feature.OrderedField); |
| | | |
| | | R<SysUser> sysUserR = sysUserClient.queryUserByPhone(openapiResult1.get("mobile")); |
| | | */ |
| | | /* R<SysUser> sysUserR = sysUserClient.queryUserByPhone(appMiniLoginDto.getAuth_code()); |
| | | SysUser data = sysUserR.getData(); |
| | | appMiniLoginVo.setSysUser(data); |
| | | appMiniLoginVo.setPhone(openapiResult1.get("mobile")); |
| | | appMiniLoginVo.setPhone(appMiniLoginDto.getAuth_code()); |
| | | } |
| | | }else{ |
| | | */ |
| | | |
| | | |
| | | String responseAccessToken = null; |
| | | /* String responseAccessToken = null; |
| | | try { |
| | | responseAccessToken = getAccessTokenByWX(); |
| | | } catch (Exception e) { |
| | |
| | | String phoneInfo = jsonUserPhoneNumber.getString("phone_info"); |
| | | JSONObject jsonUserPhoneInfo = JSONObject.parseObject(phoneInfo); |
| | | String mobile = jsonUserPhoneInfo.getString("purePhoneNumber"); |
| | | //获取用户 |
| | | R<SysUser> sysUserR = sysUserClient.queryUserByPhone(mobile); |
| | | //获取用户*/ |
| | | /* R<SysUser> sysUserR = sysUserClient.queryUserByPhone(appMiniLoginDto.getCode()); |
| | | SysUser data = sysUserR.getData(); |
| | | appMiniLoginVo.setSysUser(data); |
| | | appMiniLoginVo.setPhone(mobile); |
| | | } |
| | | appMiniLoginVo.setPhone(appMiniLoginDto.getCode()); |
| | | }*/ |
| | | |
| | | R<SysUser> sysUserR = sysUserClient.queryUserByPhone(appMiniLoginDto.getPhone()); |
| | | SysUser data = sysUserR.getData(); |
| | | appMiniLoginVo.setSysUser(data); |
| | | appMiniLoginVo.setPhone(appMiniLoginDto.getAuth_code()); |
| | | return appMiniLoginVo; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public AppMiniLoginVO isMiniLogin(AppMiniLoginDTO appMiniLoginDto) { |
| | | AppMiniLoginVO appMiniLoginVo = new AppMiniLoginVO(); |
| | | R<SysUser> sysUserR = sysUserClient.queryUserByPhone(appMiniLoginDto.getPhone()); |
| | | SysUser data = sysUserR.getData(); |
| | | appMiniLoginVo.setSysUser(data); |
| | | appMiniLoginVo.setPhone(appMiniLoginDto.getCode()); |
| | | return appMiniLoginVo; |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | memberAuctionSalesroomVO.setDescription(auctionSalesroom.getDescription()); |
| | | memberAuctionSalesroomVO.setStatus(auctionSalesroom.getStatus().getCode()); |
| | | memberAuctionSalesroomVO.setSalesroomId(auctionSalesroom.getId()); |
| | | memberAuctionSalesroomVO.setStartTime(auctionSalesroom.getStartTime()); |
| | | memberAuctionSalesroomVO.setEndTime(auctionSalesroom.getEndTime()); |
| | | memberAuctionSalesroomVO.setCoverPic(auctionSalesroom.getCoverPic()); |
| | | memberAuctionSalesroomVO.setBond(auctionSalesroom.getBond()); |
| | | memberAuctionSalesroomVO.setAuthentication(auctionSalesroom.getAuthentication()); |
| | | memberAuctionSalesroomDTO.setAuctionSalesroomId(auctionSalesroom.getId()); |
| | | List<OrderAuctionBond> data = orderClient.getOrderAuctionBondList1(memberAuctionSalesroomDTO, SecurityConstants.INNER).getData(); |
| | | if (data.size()>0){ |
| | | if (data!=null&&data.size()>0){ |
| | | memberAuctionSalesroomVO.setIsApply(2); |
| | | }else{ |
| | | memberAuctionSalesroomVO.setIsApply(1); |
| | |
| | | if (auctionBidRecord!=null){ |
| | | throw new ServiceException("当前拍卖场中标拍品订单未完成,请完成后再试。"); |
| | | } |
| | | |
| | | |
| | | // 远程调用订单服务进行退款 |
| | | Map<String, Object> data = orderClient.refund(refundDTOList, |
| | | SecurityConstants.INNER).getData(); |
| | |
| | | List<Long> ids = new ArrayList<>(); |
| | | ids.add(orderAuctionBond.getId()); |
| | | // 远程调用订单服务修改订单状态 |
| | | orderClient.updateOrderAuctionBondStatus(ids, BondStatusEnum.PAID); |
| | | orderClient.updateOrderAuctionBondStatus(ids, BondStatusEnum.REFUNDED,SecurityConstants.INNER); |
| | | |
| | | }else{ |
| | | OrderAuctionBond orderAuctionBond = orderClient.getOrderAuctionBondone1(memberAuctionSalesroomBondDTO, SecurityConstants.INNER).getData(); |
| | |
| | | List<Long> ids = new ArrayList<>(); |
| | | ids.add(orderAuctionBond.getId()); |
| | | // 远程调用订单服务修改订单状态 |
| | | orderClient.updateOrderAuctionBondStatus(ids, BondStatusEnum.PAID); |
| | | orderClient.updateOrderAuctionBondStatus(ids,BondStatusEnum.REFUNDED,SecurityConstants.INNER); |
| | | } |
| | | |
| | | |
| | |
| | | Member membeOne = memberClient.getMembeOne(bidVO.getMemberId(), SecurityConstants.INNER).getData(); |
| | | if (bidVO.getAuctionType()==2){ |
| | | AuctionSalesroomGoods byId = auctionSalesroomGoodsMapper.selectById(bidVO.getTargetId()); |
| | | if (byId.getStartingPrice().doubleValue()<bidVO.getLastBidAmount().doubleValue()){ |
| | | if (byId.getStartingPrice().doubleValue()>bidVO.getLastBidAmount().doubleValue()){ |
| | | throw new ServiceException("出价不能比起拍价低"); |
| | | } |
| | | BigDecimal bigDecimal=byId.getStartingPrice().add(byId.getMinimumMarkupAmount()); |
| | | if (bigDecimal.doubleValue()<bidVO.getLastBidAmount().doubleValue()){ |
| | | if (bigDecimal.doubleValue()>bidVO.getLastBidAmount().doubleValue()){ |
| | | throw new ServiceException("出价不能比每次最少加价低"); |
| | | } |
| | | |
| | |
| | | AuctionBidRecord one = auctionBidRecordService.getOne(wrapper1); |
| | | if (one!=null){ |
| | | BigDecimal bigDecimal1=one.getLastBidAmount().add(byId.getMinimumMarkupAmount()); |
| | | if (bigDecimal1.doubleValue()<bidVO.getLastBidAmount().doubleValue()){ |
| | | if (bigDecimal1.doubleValue()>bidVO.getLastBidAmount().doubleValue()){ |
| | | throw new ServiceException("出价不能比上次出价加每次最少加价低"); |
| | | } |
| | | one.setLastBidAmount(bidVO.getLastBidAmount()); |
| | |
| | | page.setSize(memberAuctionSalesroomDTO.getPageSize()); |
| | | page.setCurrent(memberAuctionSalesroomDTO.getPageCurr()); |
| | | MemberAuctionSalesroomWdDTO memberAuctionSalesroomWdDTO=new MemberAuctionSalesroomWdDTO(); |
| | | memberAuctionSalesroomWdDTO.setGoodsSkuIdList(goodsSkuIdList); |
| | | if(memberAuctionSalesroomWdDTO.getStatus()!=4){ |
| | | memberAuctionSalesroomWdDTO.setStatus(memberAuctionSalesroomWdDTO.getStatus()); |
| | | if (goodsSkuIdList.size()>0){ |
| | | memberAuctionSalesroomWdDTO.setGoodsSkuIdList(goodsSkuIdList); |
| | | }else{ |
| | | Set<Long> goodsSkuIdList1 = new HashSet<>(); |
| | | goodsSkuIdList1.add(0L); |
| | | memberAuctionSalesroomWdDTO.setGoodsSkuIdList(goodsSkuIdList1); |
| | | } |
| | | |
| | | if(MemberAuctionSalesroomDTO.getStatus()!=4){ |
| | | if (MemberAuctionSalesroomDTO.getStatus()==0){ |
| | | memberAuctionSalesroomWdDTO.setStatus(5); |
| | | }else{ |
| | | memberAuctionSalesroomWdDTO.setStatus(MemberAuctionSalesroomDTO.getStatus()); |
| | | } |
| | | |
| | | } |
| | | List<AuctionSalesroom> auctionSalesroomList=auctionSalesroomMapper.pageMemberAuctionSalesroomWdList(page,memberAuctionSalesroomWdDTO); |
| | | List<WdMemberAuctionSalesroomVO> List=new ArrayList<>(); |
| | |
| | | memberAuctionSalesroomDTO1.setAuctionSalesroomId(auctionSalesroom.getId()); |
| | | memberAuctionSalesroomDTO1.setMemberId(MemberAuctionSalesroomDTO.getMemberId()); |
| | | List<OrderAuctionBond> data1 = orderClient.getOrderAuctionBondList1(memberAuctionSalesroomDTO1, SecurityConstants.INNER).getData(); |
| | | memberAuctionSalesroomVO.setBondTime(data1.get(0).getCreateTime()); |
| | | if (data1.size()>0){ |
| | | memberAuctionSalesroomVO.setBondTime(data1.get(0).getCreateTime()); |
| | | } |
| | | |
| | | List.add(memberAuctionSalesroomVO); |
| | | } |
| | | page.setRecords(List); |
| | |
| | | mgtAuctionSalesroomVO, MgtAuctionSalesroomScreenVO.class); |
| | | if (vo.getStatus().equals(AuctionStartStatusEnum.IN_AUCTION)) { |
| | | List<MgtAuctionSalesroomGoodsVO> auctionSalesroomGoodsVOS = vo.getAuctionSalesroomGoodsVOS(); |
| | | List<MgtAuctionSalesroomGoodsVO> collect = auctionSalesroomGoodsVOS.stream() |
| | | .peek(goods -> { |
| | | List<AuctionBidRecord> list = auctionBidRecordService.lambdaQuery() |
| | | .eq(AuctionBidRecord::getTargetId, goods.getId()) |
| | | .eq(AuctionBidRecord::getAuctionType, |
| | | AuctionOrderTypeEnum.AUCTION_ITEMS) |
| | | .list(); |
| | | if (StringUtils.isNotEmpty(list)) { |
| | | long bidCount = list.stream() |
| | | .filter(item -> BidStatusEnum.SUCCESSFUL.equals( |
| | | item.getStatus())) |
| | | .count(); |
| | | goods.setBidCount((int) bidCount); |
| | | goods.setBidQuantity((int) bidCount); |
| | | goods.setBidPersonCount(list.size()); |
| | | } |
| | | if (goods.getStatus().equals(AuctionGoodsStatusEnum.IN_PROGRESS)) { |
| | | vo.setCurrentAuctionSalesroomGoods(goods); |
| | | } |
| | | }).collect(Collectors.toList()); |
| | | vo.setAuctionSalesroomGoodsVOS(collect); |
| | | if (StringUtils.isNotNull(vo.getCurrentAuctionSalesroomGoods())) { |
| | | int index = collect.indexOf(vo.getCurrentAuctionSalesroomGoods()); |
| | | vo.setNextAuctionSalesroomGoods(collect.get(index + 1)); |
| | | // 分页查询当前拍品出价信息 |
| | | List<AuctionBidRecord> list = auctionBidRecordService.lambdaQuery() |
| | | .eq(AuctionBidRecord::getTargetId, |
| | | vo.getCurrentAuctionSalesroomGoods().getId()) |
| | | .eq(AuctionBidRecord::getAuctionType, |
| | | AuctionOrderTypeEnum.AUCTION_ITEMS) |
| | | .list(); |
| | | if (StringUtils.isNotEmpty(list)) { |
| | | vo.setMgtAuctionBidRecordVOList(CollUtils.emptyList()); |
| | | if (StringUtils.isNotEmpty(auctionSalesroomGoodsVOS)) { |
| | | List<MgtAuctionSalesroomGoodsVO> collect = auctionSalesroomGoodsVOS.stream() |
| | | .peek(goods -> { |
| | | List<AuctionBidRecord> list = auctionBidRecordService.lambdaQuery() |
| | | .eq(AuctionBidRecord::getTargetId, goods.getId()) |
| | | .eq(AuctionBidRecord::getAuctionType, |
| | | AuctionOrderTypeEnum.AUCTION_ITEMS) |
| | | .list(); |
| | | if (StringUtils.isNotEmpty(list)) { |
| | | long bidCount = list.stream() |
| | | .filter(item -> BidStatusEnum.SUCCESSFUL.equals( |
| | | item.getStatus())) |
| | | .count(); |
| | | goods.setBidCount((int) bidCount); |
| | | goods.setBidQuantity((int) bidCount); |
| | | goods.setBidPersonCount(list.size()); |
| | | } |
| | | if (goods.getStatus().equals(AuctionGoodsStatusEnum.IN_PROGRESS)) { |
| | | vo.setCurrentAuctionSalesroomGoods(goods); |
| | | } |
| | | }).collect(Collectors.toList()); |
| | | vo.setAuctionSalesroomGoodsVOS(collect); |
| | | if (StringUtils.isNotNull(vo.getCurrentAuctionSalesroomGoods())) { |
| | | int index = collect.indexOf(vo.getCurrentAuctionSalesroomGoods()); |
| | | vo.setNextAuctionSalesroomGoods(collect.get(index + 1)); |
| | | // 分页查询当前拍品出价信息 |
| | | List<AuctionBidRecord> list = auctionBidRecordService.lambdaQuery() |
| | | .eq(AuctionBidRecord::getTargetId, |
| | | vo.getCurrentAuctionSalesroomGoods().getId()) |
| | | .eq(AuctionBidRecord::getAuctionType, |
| | | AuctionOrderTypeEnum.AUCTION_ITEMS) |
| | | .list(); |
| | | if (StringUtils.isNotEmpty(list)) { |
| | | vo.setMgtAuctionBidRecordVOList(CollUtils.emptyList()); |
| | | } |
| | | vo.setMgtAuctionBidRecordVOList( |
| | | BeanUtils.copyList(list, MgtAuctionBidRecordVO.class)); |
| | | } else { |
| | | vo.setNextAuctionSalesroomGoods(collect.get(0)); |
| | | } |
| | | vo.setMgtAuctionBidRecordVOList( |
| | | BeanUtils.copyList(list, MgtAuctionBidRecordVO.class)); |
| | | } else { |
| | | vo.setNextAuctionSalesroomGoods(collect.get(0)); |
| | | } |
| | | } |
| | | return vo; |
| | |
| | | */ |
| | | @Override |
| | | public PageDTO<MgtAuctionSalesroomGoodsVO> backupGoods(MgtAuctionSalesroomGoodsQuery query) { |
| | | Page<AuctionSalesroomGoods> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | Set<Long> goodsSkuIdSet = null; |
| | | if (StringUtils.isNotBlank(query.getGoodsName())) { |
| | | List<GoodsSku> data = goodsSkuClient.getGoodsByName(query.getGoodsName(), |
| | |
| | | if (StringUtils.isNotEmpty(data)) { |
| | | goodsSkuIdSet = data.stream().map(GoodsSku::getId) |
| | | .collect(Collectors.toSet()); |
| | | } else { |
| | | return PageDTO.empty(page); |
| | | } |
| | | } |
| | | Page<AuctionSalesroomGoods> page = auctionSalesroomGoodsMapper.selectPage( |
| | | page = auctionSalesroomGoodsMapper.selectPage( |
| | | new Page<>(query.getPageCurr(), query.getPageSize()), |
| | | Wrappers.<AuctionSalesroomGoods>lambdaQuery() |
| | | .eq(AuctionSalesroomGoods::getAuctionSalesroomId, |
| | | query.getAuctionSalesroomId()) |
| | | .eq(AuctionSalesroomGoods::getBackupStatus, Boolean.TRUE) |
| | | .in(StringUtils.isNotEmpty(goodsSkuIdSet), |
| | | AuctionSalesroomGoods::getGoodsSkuId, goodsSkuIdSet)); |
| | | if (StringUtils.isNotEmpty(page.getRecords())) { |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | Set<Long> skuIdList = page.getRecords().stream().map(AuctionSalesroomGoods::getGoodsSkuId) |
| | |
| | | /** |
| | | * 选择备选商品 |
| | | * |
| | | * @param idList 备选商品id集合 |
| | | * @param idStr 备选商品id集合 |
| | | */ |
| | | @Override |
| | | public void addBackupGoods(List<Long> idList) { |
| | | public void addBackupGoods(String idStr) { |
| | | String[] idArr = idStr.split(","); |
| | | List<Long> idList = Arrays.stream(idArr).map(Long::valueOf).collect(Collectors.toList()); |
| | | List<AuctionSalesroomGoods> auctionSalesroomGoods = auctionSalesroomGoodsMapper.selectList( |
| | | Wrappers.<AuctionSalesroomGoods>lambdaQuery() |
| | | .in(AuctionSalesroomGoods::getId, idList) |
| | |
| | | if (StringUtils.isNotEmpty(auctionSalesroomGoods)) { |
| | | auctionSalesroomGoods.forEach(item -> { |
| | | item.setStatus(AuctionGoodsStatusEnum.WAITING); |
| | | item.setBackupStatus(Boolean.FALSE); |
| | | }); |
| | | auctionSalesroomGoodsMapper.updateBatchById(auctionSalesroomGoods); |
| | | } |
| | |
| | | * @param auctionSalesroomId 拍卖场id |
| | | */ |
| | | @Override |
| | | public void startCurrentAuctionSalesroom(Long auctionSalesroomId) { |
| | | public void startCurrentAuctionSalesroom(Long auctionSalesroomId) |
| | | throws JsonProcessingException { |
| | | // 修改拍卖场开始状态 |
| | | AuctionSalesroom auctionSalesroom = this.getById(auctionSalesroomId); |
| | | auctionSalesroom.setStatus(AuctionStartStatusEnum.IN_AUCTION); |
| | |
| | | auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.IN_PROGRESS); |
| | | auctionSalesroomGoods.setStartTime(LocalDateTime.now()); |
| | | auctionSalesroomGoodsMapper.updateById(auctionSalesroomGoods); |
| | | |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM); |
| | | map.put("auctionSalesroomId", auctionSalesroom.getId()); |
| | | map.put("message_type", "start"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.AUCTIONEER.getCode(), msg); |
| | | } |
| | | |
| | | @Override |
| | | @GlobalTransactional(rollbackFor = Exception.class) |
| | | @Transactional |
| | | public void stopCurrentAuctionSalesroom(Long auctionSalesroomId) { |
| | | public void stopCurrentAuctionSalesroom(Long auctionSalesroomId) |
| | | throws JsonProcessingException { |
| | | // 修改拍卖场开始状态 |
| | | AuctionSalesroom auctionSalesroom = this.getById(auctionSalesroomId); |
| | | auctionSalesroom.setStatus(AuctionStartStatusEnum.ENDED); |
| | |
| | | orderAuctionBondDTO.setUserList(memberIdlist); |
| | | orderClient.getOrderAuctionBond(orderAuctionBondDTO, SecurityConstants.INNER); |
| | | } |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM); |
| | | map.put("auctionSalesroomId", auctionSalesroom.getId()); |
| | | map.put("message_type", "end"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.AUCTIONEER.getCode(), msg); |
| | | } |
| | | |
| | | @Override |
| | | public List<AuctionSalesroom> getAuctionSalesroomByIds( |
| | | Collection<Long> auctionSalesroomGoodsIdSet) { |
| | | List<AuctionSalesroomGoods> auctionSalesroomGoods = auctionSalesroomGoodsMapper.selectList( |
| | | Wrappers.lambdaQuery(AuctionSalesroomGoods.class) |
| | | .in(AuctionSalesroomGoods::getId, auctionSalesroomGoodsIdSet)); |
| | | Set<Long> auctionSalesroomIdSet = auctionSalesroomGoods.stream() |
| | | .map(AuctionSalesroomGoods::getAuctionSalesroomId).collect( |
| | | Collectors.toSet()); |
| | | return this.listByIds(auctionSalesroomIdSet); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.auction.domain.AuctionBidRecord; |
| | | import com.ruoyi.auction.domain.MemberAuctionCollection; |
| | | import com.ruoyi.auction.mapper.AuctionBidRecordMapper; |
| | | import com.ruoyi.auction.mapper.AuctionGoodsMapper; |
| | | import com.ruoyi.auction.mapper.MemberAuctionCollectionMapper; |
| | | import com.ruoyi.auction.service.IMemberAuctionCollectionService; |
| | |
| | | private GoodsSkuClient goodsSkuClient; |
| | | @Resource |
| | | private AuctionGoodsMapper auctionGoodsMapper; |
| | | |
| | | @Resource |
| | | private AuctionBidRecordMapper auctionBidRecordMapper; |
| | | |
| | | |
| | | @Override |
| | |
| | | GoodsSku goodsSkuOne = goodsSkuClient.getGoodsSkuOne(auctionGoods.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | auctionGoodsVO.setUnit(goodsSkuOne.getUnit()); |
| | | auctionGoodsVO.setSpec(goodsSkuOne.getSpec()); |
| | | auctionGoodsVO.setIsCollection(2); |
| | | auctionGoodsVO.setSpecUnit(goodsSkuOne.getSpecUnit()); |
| | | auctionGoodsVO.setGoodsSkuName(goodsSkuOne.getSkuName()); |
| | | auctionGoodsVO.setCoverPic(goodsSkuOne.getCoverPic()); |
| | | |
| | | |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper1=Wrappers.lambdaQuery(); |
| | | wrapper1.eq(AuctionBidRecord::getMemberId,auctionCollectionDTO.getMemberId()); |
| | | wrapper1.eq(AuctionBidRecord::getAuctionType,1); |
| | | wrapper1.eq(AuctionBidRecord::getTargetId,auctionGoods.getId()); |
| | | wrapper1.eq(AuctionBidRecord::getDelFlag,0); |
| | | AuctionBidRecord list1 = auctionBidRecordMapper.selectOne(wrapper1); |
| | | if (list1!=null){ |
| | | if (list1.getStatus().getCode()==2){ |
| | | auctionGoodsVO.setIsStatus(2); |
| | | }else{ |
| | | auctionGoodsVO.setIsStatus(1); |
| | | } |
| | | }else{ |
| | | auctionGoodsVO.setIsStatus(1); |
| | | } |
| | | |
| | | auctionGoodsVOS.add(auctionGoodsVO); |
| | | |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.auction.mapper.AuctionGoodsMapper"> |
| | | <select id="getAuctionGoodsPgeList" resultType="com.ruoyi.system.api.domain.AuctionGoods"> |
| | | SELECT * FROM t_auction_goods ta left join |
| | | WHERE ta.del_flag = 0 and ta.listing_status=0 |
| | | SELECT * FROM t_auction_goods ta |
| | | WHERE del_flag = 0 and listing_status=0 |
| | | <if test="param.startStatus!=null and param.startStatus != ''"> |
| | | AND ta.start_status=#{param.startStatus} |
| | | AND start_status=#{param.startStatus} |
| | | </if> |
| | | <if test="param.goodsSkuIdList != null and param.goodsSkuIdList.size()>0"> |
| | | OR ta.goods_sku_id IN |
| | | AND goods_sku_id IN |
| | | <foreach collection="param.goodsSkuIdList" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ORDER BY |
| | | CASE |
| | | WHEN status = 0 THEN 2 |
| | | WHEN status = 1 THEN 1 |
| | | WHEN status = 2 THEN 3 |
| | | END,status |
| | | WHEN start_status = 0 THEN 2 |
| | | WHEN start_status = 1 THEN 1 |
| | | WHEN start_status = 2 THEN 3 |
| | | END,start_status |
| | | </select> |
| | | </mapper> |
| | |
| | | <mapper namespace="com.ruoyi.auction.mapper.AuctionSalesroomGoodsMapper"> |
| | | <update id="updateBatchById" parameterType="java.util.List"> |
| | | UPDATE t_auction_salesroom_goods |
| | | SET status = CASE |
| | | SET |
| | | backup_status = CASE |
| | | <foreach collection="param" item="item" index="index"> |
| | | WHEN id = #{item.id} THEN #{item.backupStatus} |
| | | </foreach> |
| | | ELSE status END, |
| | | status = CASE |
| | | <foreach collection="param" item="item" index="index"> |
| | | WHEN id = #{item.id} THEN #{item.status} |
| | | </foreach> |
| | | END |
| | | ELSE status END |
| | | WHERE id IN |
| | | <foreach collection="param" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item.id} |
| | |
| | | <mapper namespace="com.ruoyi.auction.mapper.AuctionSalesroomMapper"> |
| | | |
| | | <select id="pageMemberAuctionSalesroomList" resultType="com.ruoyi.system.api.domain.AuctionSalesroom"> |
| | | SELECT * FROM t_auction_salesroom ta |
| | | WHERE ta.del_flag = 0 |
| | | SELECT * FROM t_auction_salesroom |
| | | WHERE del_flag = 0 |
| | | <if test="param.salesroomName!=null and param.salesroomName != ''"> |
| | | AND ta.salesroomName LIKE CONCAT('%',#{param.salesroomName},'%') |
| | | AND salesroom_name LIKE CONCAT('%',#{param.salesroomName},'%') |
| | | </if> |
| | | ORDER BY |
| | | CASE |
| | |
| | | <select id="pageMemberAuctionSalesroomWdList" resultType="com.ruoyi.system.api.domain.AuctionSalesroom"> |
| | | SELECT * FROM t_auction_salesroom ta |
| | | WHERE ta.del_flag = 0 |
| | | <if test="param.status!=null and param.status != ''"> |
| | | <if test="param.status!=null and param.salesroomName != 5"> |
| | | AND ta.status=#{param.status} |
| | | </if> |
| | | <if test="param.salesroomName == 5"> |
| | | AND ta.status=0 |
| | | </if> |
| | | <if test="param.salesroomName!=null and param.salesroomName != ''"> |
| | | AND ta.salesroomName LIKE CONCAT('%',#{param.salesroomName},'%') |
| | | AND ta.salesroom_name LIKE CONCAT('%',#{param.salesroomName},'%') |
| | | </if> |
| | | <if test="param.goodsSkuIdList != null and param.goodsSkuIdList.size()>0"> |
| | | OR ta.goods_sku_id IN |
| | | AND ta.id IN |
| | | <foreach collection="param.goodsSkuIdList" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | |
| | | server: |
| | | port: 9300 |
| | | # Spring |
| | | spring: |
| | | spring: |
| | | application: |
| | | # 应用名称 |
| | | name: ruoyi-file |
| | | profiles: |
| | | # 环境配置 |
| | | active: dev |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 100MB |
| | | max-request-size: 200MB |
| | | location: /data/tmp |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <!-- 分布式事务 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-seata</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.service.IGoodsSkuService; |
| | | import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO; |
| | | import com.ruoyi.system.api.domain.vo.HomeGoodsSkuListVO; |
| | | import com.ruoyi.system.api.domain.vo.HomeGoodsSkuInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.HomeGoodsSkuListVO; |
| | | import com.ruoyi.system.api.domain.vo.getHomeGoodsSkuXxiVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | 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 java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | return R.ok(iGoodsSkuService.getHomeGoodsSkuInfo(homeGoodsSkuDTO)); |
| | | } |
| | | |
| | | @PostMapping("/getHomeGoodsSkuXxi") |
| | | @ApiOperation(value = "用户端-普通商品信息") |
| | | public R<List<getHomeGoodsSkuXxiVO>> getHomeGoodsSkuXxi(@RequestBody HomeGoodsSkuDTO homeGoodsSkuDTO) { |
| | | return R.ok(iGoodsSkuService.getHomeGoodsSkuXxi(homeGoodsSkuDTO)); |
| | | } |
| | | |
| | | @PostMapping("/getMsHomeGoodsSkuXxi") |
| | | @ApiOperation(value = "用户端-秒杀普通商品信息") |
| | | public R<List<getHomeGoodsSkuXxiVO>> getMsHomeGoodsSkuXxi(@RequestBody HomeGoodsSkuDTO homeGoodsSkuDTO) { |
| | | return R.ok(iGoodsSkuService.getMsHomeGoodsSkuXxi(homeGoodsSkuDTO)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @InnerAuth |
| | | @PostMapping("/getGoodsSeckiGoodsGroupPurchaseOne") |
| | | @ResponseBody |
| | | public R<GoodsGroupPurchase> getGoodsSeckiGoodsGroupPurchaseOne(@RequestBody Integer goodsSkuId) { |
| | | public R<GoodsGroupPurchase> getGoodsSeckiGoodsGroupPurchaseOne(@RequestBody Long goodsSkuId) { |
| | | GoodsGroupPurchase GoodsSeckillOne = goodsGroupPurchaseService.getById(goodsSkuId); |
| | | return R.ok(GoodsSeckillOne); |
| | | } |
| | |
| | | @InnerAuth |
| | | @PostMapping("/getGoodsSeckillOne") |
| | | @ResponseBody |
| | | public R<GoodsSeckill> getGoodsSeckillOne(@RequestBody Integer goodsSkuId) { |
| | | public R<GoodsSeckill> getGoodsSeckillOne(@RequestBody Long goodsSkuId) { |
| | | GoodsSeckill GoodsSeckillOne = goodsSeckillService.getById(goodsSkuId); |
| | | return R.ok(GoodsSeckillOne); |
| | | } |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | import com.ruoyi.goods.controller.management.vo.GoodsInfoTitleValueVO; |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/5/20 |
| | |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "1是普通商品,2 团购商品,3 秒杀商品") |
| | | @ApiModelProperty(value = "1是普通商品,2秒杀商品,3 团购商品") |
| | | private Integer type; |
| | | |
| | | } |
| | |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("createBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("createBy", userId.toString(), metaObject); |
| | | fillValue("createTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("updateBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("updateBy", userId.toString(), metaObject); |
| | | fillValue("updateTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.system.api.domain.vo.HomeGoodsSkuInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.HomeGoodsSkuListVO; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.system.api.domain.vo.getHomeGoodsSkuXxiVO; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | |
| | | |
| | | HomeGoodsSkuInfoVO getHomeGoodsSkuInfo(@RequestBody HomeGoodsSkuDTO homeGoodsSkuDTO); |
| | | |
| | | List<getHomeGoodsSkuXxiVO> getHomeGoodsSkuXxi(@RequestBody HomeGoodsSkuDTO homeGoodsSkuDTO); |
| | | List<getHomeGoodsSkuXxiVO> getMsHomeGoodsSkuXxi(@RequestBody HomeGoodsSkuDTO homeGoodsSkuDTO); |
| | | GoodsSkuVO getGoodsDetail(Long id); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public PageDTO<HomeGoodsSkuListVO> geBrowseRecordList(AuctionCollectionDTO auctionCollectionDTO) { |
| | | |
| | | |
| | | Set<Long> goodsSkuIdList1 = null; |
| | | if (StringUtils.isNotEmpty(auctionCollectionDTO.getGoodsSkuName())) { |
| | | List<GoodsSku> goodsSku = goodsSkuClient.getGoodsByName(auctionCollectionDTO.getGoodsSkuName(), |
| | |
| | | page.setCurrent(auctionCollectionDTO.getPageCurr()); |
| | | LambdaQueryWrapper<GoodsBrowseRecord> wrapper= Wrappers.lambdaQuery(); |
| | | wrapper.eq(GoodsBrowseRecord::getMemberId,auctionCollectionDTO.getMemberId()); |
| | | wrapper.in(GoodsBrowseRecord::getGoodsSkuId,goodsSkuIdList1); |
| | | if (StringUtils.isNotEmpty(goodsSkuIdList1)){ |
| | | wrapper.in(GoodsBrowseRecord::getGoodsSkuId,goodsSkuIdList1); |
| | | } |
| | | List<GoodsBrowseRecord> list = this.list(wrapper); |
| | | |
| | | List<HomeGoodsSkuListVO> auctionGoodsVOS=new ArrayList<>(); |
| | |
| | | auctionGoodsVO.setCoverPic(goodsSku.getCoverPic()); |
| | | auctionGoodsVO.setSkuName(goodsSku.getSkuName()); |
| | | auctionGoodsVO.setSoldQuantity(goodsSku.getSoldQuantity()); |
| | | auctionGoodsVOS.add(auctionGoodsVO); |
| | | } |
| | | page.setRecords(auctionGoodsVOS); |
| | | return PageDTO.of(page); |
| | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.enums.ClientTypeEnum; |
| | | import com.ruoyi.common.core.enums.GroupStatusEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | |
| | | map.put("target_id", groupPurchaseId); |
| | | map.put("message_type", "start"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | WebSocketUsers.sendMessageToUsersByText(msg); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), msg); |
| | | log.info("===================>发送websocket通知,消息体{}", msg); |
| | | } |
| | | } |
| | |
| | | map.put("target_id", groupPurchaseId); |
| | | map.put("message_type", "end"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | WebSocketUsers.sendMessageToUsersByText(msg); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), msg); |
| | | log.info("===================>发送websocket通知,消息体{}", msg); |
| | | } |
| | | } |
| | |
| | | .collect(Collectors.toList()); |
| | | Page<GoodsGroupPurchase> page = new Page<>(homeGoodsSkuDTO.getPageCurr(), homeGoodsSkuDTO.getPageSize()); |
| | | LambdaQueryWrapper< GoodsGroupPurchase> wrapper= Wrappers.lambdaQuery(); |
| | | wrapper.in(GoodsGroupPurchase::getGoodsSkuId,goodsSkuIdList); |
| | | if (homeGoodsSkuDTO.getSkuName()!=null){ |
| | | wrapper.in(GoodsGroupPurchase::getId,goodsSkuIdList); |
| | | } |
| | | wrapper.eq(GoodsGroupPurchase::getListingStatus,0); |
| | | wrapper.eq( GoodsGroupPurchase::getDelFlag,0); |
| | | Page< GoodsGroupPurchase> page1 = this.page(page, wrapper); |
| | |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.enums.ClientTypeEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.common.core.enums.StartStatusEnum; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | |
| | | import com.ruoyi.goods.controller.management.dto.GoodsSeckillQuery; |
| | | import com.ruoyi.goods.controller.management.dto.GoodsSeckillUpd; |
| | | import com.ruoyi.goods.controller.management.vo.GoodsSeckillVO; |
| | | import com.ruoyi.goods.domain.MemberGoodsCollection; |
| | | import com.ruoyi.goods.mapper.GoodsSeckillMapper; |
| | | import com.ruoyi.goods.service.IGoodsSeckillService; |
| | | import com.ruoyi.goods.service.IGoodsSkuService; |
| | | import com.ruoyi.goods.service.IMemberGoodsCollectionService; |
| | | import com.ruoyi.goods.service.async.AsyncMethodService; |
| | | import com.ruoyi.system.api.constants.DelayTaskEnum; |
| | | import com.ruoyi.system.api.constants.NotificationTypeConstant; |
| | |
| | | import com.ruoyi.system.api.feignClient.OrderClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.util.WebSocketUsers; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final AsyncMethodService asyncMethodService; |
| | | // 创建一个静态共享的ObjectMapper实例以重用 |
| | | private static final ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | @Resource |
| | | private IMemberGoodsCollectionService iMemberGoodsCollectionService; |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addGoodsSeckill(GoodsSeckillDTO dto) { |
| | |
| | | Optional.of(goods).ifPresent(goodsSku -> vo.setGoodsSkuName(goodsSku.getSkuName())); |
| | | Integer num = orderClient.getSeckillMembers(goodsSeckill.getGoodsSkuId(), |
| | | SecurityConstants.INNER).getData(); |
| | | vo.setNumberOfPurchasedMembers(num); |
| | | vo.setNumberOfPurchasedMembers(StringUtils.isNull(num) ? 0 : num); |
| | | return vo; |
| | | } |
| | | |
| | |
| | | map.put("target_id", seckillId); |
| | | map.put("message_type", "start"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | WebSocketUsers.sendMessageToUsersByText(msg); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), msg); |
| | | log.info("===================>发送websocket通知,消息体{}", msg); |
| | | } |
| | | |
| | |
| | | map.put("target_id", seckillId); |
| | | map.put("message_type", "end"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | WebSocketUsers.sendMessageToUsersByText(msg); |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), msg); |
| | | log.info("===================>发送websocket通知,消息体{}", msg); |
| | | } |
| | | |
| | |
| | | LambdaQueryWrapper<GoodsSku> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(GoodsSku::getDelFlag,0); |
| | | wrapper3.eq(GoodsSku::getListingStatus,0); |
| | | wrapper3.like(GoodsSku::getSkuName,homeGoodsSkuDTO.getSkuName()); |
| | | wrapper3.eq(GoodsSku::getSkuName,homeGoodsSkuDTO.getSkuName()); |
| | | wrapper3.eq(GoodsSku::getBrandId,homeGoodsSkuDTO.getBrandId()); |
| | | wrapper3.eq(GoodsSku::getCategoryId,homeGoodsSkuDTO.getCategoryId()); |
| | | wrapper3.eq(GoodsSku::getSeriesId,homeGoodsSkuDTO.getSeriesId()); |
| | | wrapper3.eq(GoodsSku::getFlavorTypeId,homeGoodsSkuDTO.getFlavorTypeId()); |
| | | if (homeGoodsSkuDTO.getSkuName()!=null){ |
| | | wrapper3.like(GoodsSku::getSkuName,homeGoodsSkuDTO.getSkuName()); |
| | | } |
| | | if (homeGoodsSkuDTO.getBrandId()!=null){ |
| | | wrapper3.eq(GoodsSku::getBrandId,homeGoodsSkuDTO.getBrandId()); |
| | | } |
| | | if (homeGoodsSkuDTO.getCategoryId()!=null){ |
| | | wrapper3.eq(GoodsSku::getCategoryId,homeGoodsSkuDTO.getCategoryId()); |
| | | } |
| | | if (homeGoodsSkuDTO.getSeriesId()!=null){ |
| | | wrapper3.eq(GoodsSku::getSeriesId,homeGoodsSkuDTO.getSeriesId()); |
| | | } |
| | | if (homeGoodsSkuDTO.getFlavorTypeId()!=null){ |
| | | wrapper3.eq(GoodsSku::getFlavorTypeId,homeGoodsSkuDTO.getFlavorTypeId()); |
| | | } |
| | | if (homeGoodsSkuDTO.getSort()==2){ |
| | | wrapper3.orderByAsc(GoodsSku::getPrice); |
| | | } |
| | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime newTime7 = now.minusYears(30); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDateTime.parse(formattedDate7, formatter); |
| | | wrapper3.gt(GoodsSku::getYears,parseTime7); |
| | | LocalDateTime parseTime7 = LocalDate.parse(formattedDate7).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears,parseTime7); |
| | | } |
| | | if(homeGoodsSkuDTO.getYear()==3){ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime newTime7 = now.minusYears(30); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDateTime.parse(formattedDate7, formatter); |
| | | LocalDateTime parseTime7 = LocalDate.parse(formattedDate7).atStartOfDay(); |
| | | |
| | | LocalDateTime newTime15 = now.minusYears(15); |
| | | String formattedDate15 = newTime15.format(formatter); |
| | | LocalDateTime parseTime15= LocalDateTime.parse(formattedDate15, formatter); |
| | | wrapper3.gt(GoodsSku::getYears, parseTime15) |
| | | .le(GoodsSku::getYears, parseTime7); |
| | | LocalDateTime parseTime15= LocalDate.parse(formattedDate15).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears, parseTime15) |
| | | .gt(GoodsSku::getYears, parseTime7); |
| | | } |
| | | |
| | | if(homeGoodsSkuDTO.getYear()==3){ |
| | | if(homeGoodsSkuDTO.getYear()==4){ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime newTime7 = now.minusYears(5); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDateTime.parse(formattedDate7, formatter); |
| | | LocalDateTime parseTime7 = LocalDate.parse(formattedDate7).atStartOfDay(); |
| | | |
| | | LocalDateTime newTime15 = now.minusYears(15); |
| | | String formattedDate15 = newTime15.format(formatter); |
| | | LocalDateTime parseTime15= LocalDateTime.parse(formattedDate15, formatter); |
| | | wrapper3.ge(GoodsSku::getYears, parseTime7) |
| | | .le(GoodsSku::getYears, parseTime15); |
| | | LocalDateTime parseTime15= LocalDate.parse(formattedDate15).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears, parseTime7) |
| | | .gt(GoodsSku::getYears, parseTime15); |
| | | } |
| | | |
| | | if(homeGoodsSkuDTO.getYear()==5){ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime newTime7 = now.minusYears(1); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDate.parse(formattedDate7).atStartOfDay(); |
| | | |
| | | LocalDateTime newTime15 = now.minusYears(5); |
| | | String formattedDate15 = newTime15.format(formatter); |
| | | LocalDateTime parseTime15= LocalDate.parse(formattedDate15).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears, parseTime7) |
| | | .ge(GoodsSku::getYears, parseTime15); |
| | | } |
| | | |
| | | List<GoodsSku> page1 = goodsSkuService.list(wrapper3); |
| | | |
| | | Set<Long> goodsSkuIdList = null; |
| | |
| | | homeGoodsSeckillInfoVO.setStartTime(byId.getStartTime()); |
| | | homeGoodsSeckillInfoVO.setEndTime(byId.getEndTime()); |
| | | homeGoodsSeckillInfoVO.setStartStatus(byId.getStartStatus()); |
| | | |
| | | LambdaQueryWrapper<MemberGoodsCollection> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(MemberGoodsCollection::getDelFlag,0); |
| | | wrapper3.eq(MemberGoodsCollection::getMemberId,homeGoodsSkuDTO.getMemberId()); |
| | | wrapper3.eq(MemberGoodsCollection::getTargetId,homeGoodsSkuDTO.getGoodsSkuId()); |
| | | wrapper3.eq(MemberGoodsCollection::getType,3); |
| | | List<MemberGoodsCollection> list = iMemberGoodsCollectionService.list(wrapper3); |
| | | if (list.size()>0){ |
| | | homeGoodsSeckillInfoVO.setIsCollection(2); |
| | | }else{ |
| | | homeGoodsSeckillInfoVO.setIsCollection(1); |
| | | } |
| | | return homeGoodsSeckillInfoVO; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.goods.service.IGoodsInfoTitleValueService; |
| | | import com.ruoyi.goods.service.IGoodsSkuService; |
| | | import com.ruoyi.goods.service.IMemberGoodsCollectionService; |
| | | import com.ruoyi.system.api.domain.GoodsBrand; |
| | | import com.ruoyi.system.api.domain.GoodsCategory; |
| | | import com.ruoyi.system.api.domain.GoodsFlavorType; |
| | | import com.ruoyi.system.api.domain.GoodsGroupPurchase; |
| | | import com.ruoyi.system.api.domain.GoodsSeckill; |
| | | import com.ruoyi.system.api.domain.GoodsSeries; |
| | | import com.ruoyi.system.api.domain.GoodsSku; |
| | | import com.ruoyi.system.api.domain.*; |
| | | import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO; |
| | | import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO; |
| | | import com.ruoyi.system.api.domain.dto.ListStatusDTO; |
| | | import com.ruoyi.system.api.domain.vo.HomeGoodsSkuInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.HomeGoodsSkuListVO; |
| | | import com.ruoyi.system.api.domain.vo.getHomeGoodsSkuXxiVO; |
| | | import com.ruoyi.system.api.feignClient.GoodsSkuClient; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.ruoyi.system.api.feignClient.OrderClient; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.redisson.api.RLock; |
| | |
| | | private final GoodsSeckillMapper goodsSeckillMapper; |
| | | private final GoodsGroupPurchaseMapper goodsGroupPurchaseMapper; |
| | | private final RedissonClient redissonClient; |
| | | |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | |
| | | @Resource |
| | | private GoodsSkuClient goodsSkuClient; |
| | |
| | | LambdaQueryWrapper<GoodsSku> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(GoodsSku::getDelFlag,0); |
| | | wrapper3.eq(GoodsSku::getListingStatus,0); |
| | | wrapper3.like(GoodsSku::getSkuName,homeGoodsSkuDTO.getSkuName()); |
| | | wrapper3.eq(GoodsSku::getSkuName,homeGoodsSkuDTO.getSkuName()); |
| | | wrapper3.eq(GoodsSku::getBrandId,homeGoodsSkuDTO.getBrandId()); |
| | | wrapper3.eq(GoodsSku::getCategoryId,homeGoodsSkuDTO.getCategoryId()); |
| | | wrapper3.eq(GoodsSku::getSeriesId,homeGoodsSkuDTO.getSeriesId()); |
| | | wrapper3.eq(GoodsSku::getFlavorTypeId,homeGoodsSkuDTO.getFlavorTypeId()); |
| | | if (homeGoodsSkuDTO.getSkuName()!=null){ |
| | | wrapper3.like(GoodsSku::getSkuName,homeGoodsSkuDTO.getSkuName()); |
| | | } |
| | | if (homeGoodsSkuDTO.getBrandId()!=null){ |
| | | wrapper3.eq(GoodsSku::getBrandId,homeGoodsSkuDTO.getBrandId()); |
| | | } |
| | | if (homeGoodsSkuDTO.getCategoryId()!=null){ |
| | | wrapper3.eq(GoodsSku::getCategoryId,homeGoodsSkuDTO.getCategoryId()); |
| | | } |
| | | |
| | | if (homeGoodsSkuDTO.getSeriesId()!=null){ |
| | | wrapper3.eq(GoodsSku::getSeriesId,homeGoodsSkuDTO.getSeriesId()); |
| | | } |
| | | if (homeGoodsSkuDTO.getFlavorTypeId()!=null){ |
| | | wrapper3.eq(GoodsSku::getFlavorTypeId,homeGoodsSkuDTO.getFlavorTypeId()); |
| | | } |
| | | if (homeGoodsSkuDTO.getSort()==2){ |
| | | wrapper3.orderByAsc(GoodsSku::getPrice); |
| | | } |
| | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime newTime7 = now.minusYears(30); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDateTime.parse(formattedDate7, formatter); |
| | | wrapper3.gt(GoodsSku::getYears,parseTime7); |
| | | LocalDateTime parseTime7 = LocalDate.parse(formattedDate7).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears,parseTime7); |
| | | } |
| | | if(homeGoodsSkuDTO.getYear()==3){ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime newTime7 = now.minusYears(30); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDateTime.parse(formattedDate7, formatter); |
| | | LocalDateTime parseTime7 = LocalDate.parse(formattedDate7).atStartOfDay(); |
| | | |
| | | LocalDateTime newTime15 = now.minusYears(15); |
| | | String formattedDate15 = newTime15.format(formatter); |
| | | LocalDateTime parseTime15= LocalDateTime.parse(formattedDate15, formatter); |
| | | wrapper3.gt(GoodsSku::getYears, parseTime15) |
| | | .le(GoodsSku::getYears, parseTime7); |
| | | LocalDateTime parseTime15= LocalDate.parse(formattedDate15).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears, parseTime15) |
| | | .gt(GoodsSku::getYears, parseTime7); |
| | | } |
| | | |
| | | if(homeGoodsSkuDTO.getYear()==3){ |
| | | if(homeGoodsSkuDTO.getYear()==4){ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime newTime7 = now.minusYears(5); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDateTime.parse(formattedDate7, formatter); |
| | | LocalDateTime parseTime7 = LocalDate.parse(formattedDate7).atStartOfDay(); |
| | | |
| | | LocalDateTime newTime15 = now.minusYears(15); |
| | | String formattedDate15 = newTime15.format(formatter); |
| | | LocalDateTime parseTime15= LocalDateTime.parse(formattedDate15, formatter); |
| | | wrapper3.ge(GoodsSku::getYears, parseTime7) |
| | | .le(GoodsSku::getYears, parseTime15); |
| | | LocalDateTime parseTime15= LocalDate.parse(formattedDate15).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears, parseTime7) |
| | | .gt(GoodsSku::getYears, parseTime15); |
| | | } |
| | | |
| | | if(homeGoodsSkuDTO.getYear()==5){ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime newTime7 = now.minusYears(1); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDate.parse(formattedDate7).atStartOfDay(); |
| | | |
| | | LocalDateTime newTime15 = now.minusYears(5); |
| | | String formattedDate15 = newTime15.format(formatter); |
| | | LocalDateTime parseTime15= LocalDate.parse(formattedDate15).atStartOfDay(); |
| | | wrapper3.le(GoodsSku::getYears, parseTime7) |
| | | .ge(GoodsSku::getYears, parseTime15); |
| | | } |
| | | wrapper3.orderByAsc(GoodsSku::getSortNum); |
| | | Page<GoodsSku> page1 = this.page(page, wrapper3); |
| | |
| | | homeGoodsSkuInfoVO.setShareTitle(byId.getShareTitle()); |
| | | homeGoodsSkuInfoVO.setSharePic(byId.getSharePic()); |
| | | |
| | | LambdaQueryWrapper<GoodsGroupPurchase> queryWrapper1 =new LambdaQueryWrapper<>(); |
| | | queryWrapper1.eq(GoodsGroupPurchase::getListingStatus, |
| | | ListingStatusEnum.ON_SHELVES) |
| | | .eq(GoodsGroupPurchase::getGoodsSkuId, byId.getId()); |
| | | GoodsGroupPurchase goodsGroupPurchase = goodsGroupPurchaseMapper.selectOne(queryWrapper1); |
| | | if(goodsGroupPurchase!=null){ |
| | | HomeGoodsSkuDTO homeGoodsSkuDTO1 =new HomeGoodsSkuDTO(); |
| | | homeGoodsSkuDTO1.setGoodsSkuId(goodsGroupPurchase.getId()); |
| | | homeGoodsSkuDTO1.setMemberId(homeGoodsSkuDTO.getMemberId()); |
| | | Order data5 = orderClient.getOrderByGroupPurchaseMemberId(homeGoodsSkuDTO1, SecurityConstants.INNER).getData(); |
| | | if (data5!=null){ |
| | | homeGoodsSkuInfoVO.setIsGoodsGroupPurchase(2); |
| | | }else{ |
| | | homeGoodsSkuInfoVO.setIsGoodsGroupPurchase(1); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | LambdaQueryWrapper<MemberGoodsCollection> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(MemberGoodsCollection::getDelFlag,0); |
| | | wrapper3.eq(MemberGoodsCollection::getMemberId,homeGoodsSkuDTO.getMemberId()); |
| | | wrapper3.eq(MemberGoodsCollection::getTargetId,homeGoodsSkuDTO.getGoodsSkuId()); |
| | | wrapper3.eq(MemberGoodsCollection::getType,1); |
| | | List<MemberGoodsCollection> list = iMemberGoodsCollectionService.list(wrapper3); |
| | | if (list.size()>0){ |
| | | homeGoodsSkuInfoVO.setIsCollection(2); |
| | | }else{ |
| | | homeGoodsSkuInfoVO.setIsCollection(1); |
| | | } |
| | | LambdaQueryWrapper<GoodsGroupPurchase> queryWrapper1 =new LambdaQueryWrapper<>(); |
| | | queryWrapper1.eq(GoodsGroupPurchase::getListingStatus, |
| | | LambdaQueryWrapper<GoodsGroupPurchase> queryWrapper2 =new LambdaQueryWrapper<>(); |
| | | queryWrapper2.eq(GoodsGroupPurchase::getListingStatus, |
| | | ListingStatusEnum.ON_SHELVES) |
| | | .eq(GoodsGroupPurchase::getGoodsSkuId, byId.getId()); |
| | | GoodsGroupPurchase goodsGroupPurchase = goodsGroupPurchaseMapper.selectOne(queryWrapper1); |
| | | if (goodsGroupPurchase!=null){ |
| | | homeGoodsSkuInfoVO.setIsGoodsGroupPurchase(2); |
| | | GoodsGroupPurchase goodsGroupPurchase2 = goodsGroupPurchaseMapper.selectOne(queryWrapper2); |
| | | if (goodsGroupPurchase2!=null){ |
| | | homeGoodsSkuInfoVO.setGroupPurchaseGoods(2); |
| | | }else{ |
| | | homeGoodsSkuInfoVO.setIsGoodsGroupPurchase(1); |
| | | homeGoodsSkuInfoVO.setGroupPurchaseGoods(1); |
| | | } |
| | | return homeGoodsSkuInfoVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<getHomeGoodsSkuXxiVO> getHomeGoodsSkuXxi(HomeGoodsSkuDTO homeGoodsSkuDTO) { |
| | | List<getHomeGoodsSkuXxiVO> homeGoodsSkuXxiVOS=new ArrayList<>(); |
| | | GoodsSku byId = this.getById(homeGoodsSkuDTO.getGoodsSkuId()); |
| | | GoodsBrand data = goodsSkuClient.getBrandOne(byId.getBrandId(), SecurityConstants.INNER).getData(); |
| | | GoodsCategory data1 = goodsSkuClient.getCategoryOne(byId.getCategoryId(), SecurityConstants.INNER).getData(); |
| | | GoodsSeries data2 = goodsSkuClient.getSeriesOne(byId.getSeriesId(), SecurityConstants.INNER).getData(); |
| | | GoodsFlavorType data3 = goodsSkuClient.getFlavorTypeOne(byId.getFlavorTypeId(), SecurityConstants.INNER).getData(); |
| | | |
| | | |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVO1=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVO1.setContent(data1.getCategoryName()); |
| | | getHomeGoodsSkuXxiVO1.setTitleName("分类"); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVO1); |
| | | |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVO2=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVO2.setContent(data2.getSeriesName()); |
| | | getHomeGoodsSkuXxiVO2.setTitleName("系列"); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVO2); |
| | | |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVO=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVO.setContent(data.getBrandName()); |
| | | getHomeGoodsSkuXxiVO.setTitleName("品牌"); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVO); |
| | | |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVO3=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVO3.setContent(data3.getFlavorTypeName()); |
| | | getHomeGoodsSkuXxiVO3.setTitleName("香型"); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVO3); |
| | | |
| | | |
| | | List<GoodsInfoTitleValueVO> goodsInfoTitleValueVOList = goodsInfoTitleValueService.listByGoodsId(homeGoodsSkuDTO.getGoodsSkuId()); |
| | | Collections.sort(goodsInfoTitleValueVOList, Comparator.comparingInt(GoodsInfoTitleValueVO::getSortNum)); |
| | | for (GoodsInfoTitleValueVO goodsInfoTitleValueVO:goodsInfoTitleValueVOList){ |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVOs=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVOs.setContent(goodsInfoTitleValueVO.getContent()); |
| | | getHomeGoodsSkuXxiVOs.setTitleName(goodsInfoTitleValueVO.getTitleName()); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVOs); |
| | | } |
| | | |
| | | |
| | | return homeGoodsSkuXxiVOS; |
| | | } |
| | | |
| | | public List<getHomeGoodsSkuXxiVO> getMsHomeGoodsSkuXxi(HomeGoodsSkuDTO homeGoodsSkuDTO) { |
| | | List<getHomeGoodsSkuXxiVO> homeGoodsSkuXxiVOS=new ArrayList<>(); |
| | | GoodsSeckill goodsSeckill = goodsSeckillMapper.selectById(homeGoodsSkuDTO.getGoodsSkuId()); |
| | | GoodsSku byId = this.getById(goodsSeckill.getGoodsSkuId()); |
| | | GoodsBrand data = goodsSkuClient.getBrandOne(byId.getBrandId(), SecurityConstants.INNER).getData(); |
| | | GoodsCategory data1 = goodsSkuClient.getCategoryOne(byId.getCategoryId(), SecurityConstants.INNER).getData(); |
| | | GoodsSeries data2 = goodsSkuClient.getSeriesOne(byId.getSeriesId(), SecurityConstants.INNER).getData(); |
| | | GoodsFlavorType data3 = goodsSkuClient.getFlavorTypeOne(byId.getFlavorTypeId(), SecurityConstants.INNER).getData(); |
| | | |
| | | |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVO1=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVO1.setContent(data1.getCategoryName()); |
| | | getHomeGoodsSkuXxiVO1.setTitleName("分类"); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVO1); |
| | | |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVO2=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVO2.setContent(data2.getSeriesName()); |
| | | getHomeGoodsSkuXxiVO2.setTitleName("系列"); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVO2); |
| | | |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVO=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVO.setContent(data.getBrandName()); |
| | | getHomeGoodsSkuXxiVO.setTitleName("品牌"); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVO); |
| | | |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVO3=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVO3.setContent(data3.getFlavorTypeName()); |
| | | getHomeGoodsSkuXxiVO3.setTitleName("香型"); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVO3); |
| | | |
| | | |
| | | List<GoodsInfoTitleValueVO> goodsInfoTitleValueVOList = goodsInfoTitleValueService.listByGoodsId(homeGoodsSkuDTO.getGoodsSkuId()); |
| | | Collections.sort(goodsInfoTitleValueVOList, Comparator.comparingInt(GoodsInfoTitleValueVO::getSortNum)); |
| | | for (GoodsInfoTitleValueVO goodsInfoTitleValueVO:goodsInfoTitleValueVOList){ |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVOs=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVOs.setContent(goodsInfoTitleValueVO.getContent()); |
| | | getHomeGoodsSkuXxiVOs.setTitleName(goodsInfoTitleValueVO.getTitleName()); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVOs); |
| | | } |
| | | |
| | | |
| | | return homeGoodsSkuXxiVOS; |
| | | } |
| | | |
| | | private boolean updateGoodsStock(GoodsSku skus, Integer auctionStock) { |
| | | return this.lambdaUpdate() |
| | | .set(skus.getStock() + auctionStock > 0, GoodsSku::getStock, |
| | |
| | | LambdaQueryWrapper< MemberGoodsCollection> wrapper= Wrappers.lambdaQuery(); |
| | | wrapper.eq(MemberGoodsCollection::getMemberId,auctionCollectionDTO.getMemberId()); |
| | | wrapper.eq(MemberGoodsCollection::getTargetId,auctionCollectionDTO.getGoodsSkuId()); |
| | | wrapper.eq(MemberGoodsCollection::getType,auctionCollectionDTO.getType()); |
| | | if (auctionCollectionDTO.getState()==1){ |
| | | List<MemberGoodsCollection> list = this.list(wrapper); |
| | | if (list.size()==0){ |
| | | MemberGoodsCollection m =new MemberGoodsCollection(); |
| | | m.setMemberId(auctionCollectionDTO.getMemberId()); |
| | | m.setTargetId(auctionCollectionDTO.getGoodsSkuId()); |
| | | m.setType(auctionCollectionDTO.getType()); |
| | | this.save(m); |
| | | } |
| | | }else{ |
| | |
| | | auctionGoodsVO.setSkuName(goodsSku.getSkuName()); |
| | | auctionGoodsVO.setSoldQuantity(goodsSku.getSoldQuantity()); |
| | | auctionGoodsVO.setIsCollection(2); |
| | | auctionGoodsVO.setType(auctionCollection.getType()); |
| | | auctionGoodsVOS.add(auctionGoodsVO); |
| | | } if(auctionCollection.getType()==2){ |
| | | } if(auctionCollection.getType()==3){ |
| | | HomeGoodsSkuListVO auctionGoodsVO=new HomeGoodsSkuListVO(); |
| | | GoodsSeckill goodsSeckill = goodsSeckillMapper.selectById(auctionCollection.getTargetId()); |
| | | GoodsSku goodsSku = goodsSkuMapper.selectById(goodsSeckill.getGoodsSkuId()); |
| | | auctionGoodsVO.setId(auctionCollection.getTargetId()); |
| | | auctionGoodsVO.setPrice(goodsSku.getPrice()); |
| | | auctionGoodsVO.setPrice( goodsSeckill.getSeckillPrice()); |
| | | auctionGoodsVO.setCoverPic(goodsSku.getCoverPic()); |
| | | auctionGoodsVO.setSkuName(goodsSku.getSkuName()); |
| | | auctionGoodsVO.setSoldQuantity(goodsSku.getSoldQuantity()); |
| | |
| | | auctionGoodsVO.setStartStatus(goodsSeckill.getStartStatus()); |
| | | auctionGoodsVO.setStartTime(goodsSeckill.getStartTime()); |
| | | auctionGoodsVO.setEndTime(goodsSeckill.getEndTime()); |
| | | auctionGoodsVO.setXiaosPrice(goodsSeckill.getSeckillPrice()); |
| | | auctionGoodsVO.setXiaosPrice(goodsSku.getPrice()); |
| | | auctionGoodsVO.setType(auctionCollection.getType()); |
| | | auctionGoodsVOS.add(auctionGoodsVO); |
| | | } if(auctionCollection.getType()==1){ |
| | | } if(auctionCollection.getType()==2){ |
| | | GoodsGroupPurchase goodsGroupPurchase = goodsGroupPurchaseMapper.selectById(auctionCollection.getTargetId()); |
| | | HomeGoodsSkuListVO auctionGoodsVO=new HomeGoodsSkuListVO(); |
| | | GoodsSku goodsSku = goodsSkuMapper.selectById(goodsGroupPurchase.getGoodsSkuId()); |
| | | auctionGoodsVO.setId(auctionCollection.getTargetId()); |
| | | auctionGoodsVO.setPrice(goodsSku.getPrice()); |
| | | auctionGoodsVO.setPrice(goodsGroupPurchase.getGroupPurchasePrice()); |
| | | auctionGoodsVO.setCoverPic(goodsSku.getCoverPic()); |
| | | auctionGoodsVO.setSkuName(goodsSku.getSkuName()); |
| | | auctionGoodsVO.setSoldQuantity(goodsSku.getSoldQuantity()); |
| | | auctionGoodsVO.setIsCollection(2); |
| | | auctionGoodsVO.setXiaosPrice(goodsGroupPurchase.getGroupPurchasePrice()); |
| | | auctionGoodsVO.setXiaosPrice(goodsSku.getPrice()); |
| | | auctionGoodsVO.setStartTime(goodsGroupPurchase.getStartTime()); |
| | | auctionGoodsVO.setEndTime(goodsGroupPurchase.getEndTime()); |
| | | auctionGoodsVO.setXiaosPrice(goodsGroupPurchase.getGroupPurchasePrice()); |
| | | auctionGoodsVO.setType(auctionCollection.getType()); |
| | | auctionGoodsVOS.add(auctionGoodsVO); |
| | | } |
| | | |
| | |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <!-- 分布式事务 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-seata</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberPointsVO; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberVO; |
| | | import com.ruoyi.member.service.IMemberService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | @RestController |
| | | @RequestMapping("/mgt/member") |
| | | @RequiredArgsConstructor |
| | | @Api(value = "管理后台-会员管理相关接口", tags = "管理后台-会员管理相关接口") |
| | | public class MgtMemberController { |
| | | |
| | | private final IMemberService memberService; |
| | |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberLevelDTO; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberLevelVO; |
| | | import com.ruoyi.member.service.IMemberLevelService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping("/mgt/member-level") |
| | | @RequiredArgsConstructor |
| | | @Api(value = "管理后台-会员等级相关接口", tags = "管理后台-会员等级相关接口") |
| | | public class MgtMemberLevelController { |
| | | |
| | | private final IMemberLevelService memberLevelService; |
| | |
| | | /** |
| | | * 保存会员等级配置 |
| | | * |
| | | * @param memberLevelDTOList 会员等级配置列表 |
| | | * @param dto 会员等级配置列表 |
| | | */ |
| | | @ApiOperation("保存会员等级配置") |
| | | @PostMapping("/save") |
| | | public R<?> saveOrUpdateMemberLevel( |
| | | @RequestBody @NotEmpty(message = "会员等级不能为空") List<MgtMemberLevelDTO> memberLevelDTOList) { |
| | | memberLevelService.saveOrUpdateMemberLevel(memberLevelDTOList); |
| | | public R<?> saveOrUpdateMemberLevel(@Validated @RequestBody MgtMemberLevelDTO dto) { |
| | | memberLevelService.saveOrUpdateMemberLevel(dto); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.member.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberPointsQuery; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberPointsVO; |
| | | import com.ruoyi.member.service.IMemberPointsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 会员积分表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-23 |
| | | */ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/mgt/member-points") |
| | | @Api(value = "管理后台-会员积分管理相关接口", tags = "管理后台-会员积分管理相关接口") |
| | | public class MgtMemberPointsController { |
| | | |
| | | private final IMemberPointsService iMemberPointsService; |
| | | |
| | | /** |
| | | * 获取会员积分列表的分页数据 |
| | | * |
| | | * @param query 会员积分明细查询对象 |
| | | * @return PageDTO<MgtMemberPointsVO> |
| | | */ |
| | | @ApiOperation(value = "获取会员积分列表的分页数据", notes = "会员积分列表的分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MgtMemberPointsVO>> getMemberPointsPage( |
| | | @Validated @RequestBody MgtMemberPointsQuery query) { |
| | | return R.ok(iMemberPointsService.getMemberPointsPage(query)); |
| | | } |
| | | } |
| | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | import javax.validation.Valid; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @ApiModel("会员等级数据传输对象对象") |
| | | public class MgtMemberLevelDTO implements Serializable { |
| | | @ApiModel("会员等级数据传输对象") |
| | | public class MgtMemberLevelDTO { |
| | | |
| | | private static final long serialVersionUID = 841295965476674650L; |
| | | |
| | | @ApiModelProperty(value = "会员等级") |
| | | @NotNull(message = "会员等级不能为空") |
| | | private Integer level; |
| | | |
| | | @ApiModelProperty(value = "累计消费") |
| | | @NotNull(message = "累计消费不能为空") |
| | | private BigDecimal cumulativeConsumption; |
| | | |
| | | @ApiModelProperty("会员等级列表") |
| | | @Valid |
| | | List<MgtMemberLevelDetailDTO> memberLevelDTOList; |
| | | } |
New file |
| | |
| | | package com.ruoyi.member.controller.management.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("会员等级数据传输对象对象") |
| | | public class MgtMemberLevelDetailDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 841295965476674650L; |
| | | |
| | | @ApiModelProperty(value = "会员等级id") |
| | | @NotNull(message = "会员等级id不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "会员等级") |
| | | @NotNull(message = "会员等级不能为空") |
| | | private Integer level; |
| | | |
| | | @ApiModelProperty(value = "累计消费") |
| | | @NotNull(message = "累计消费不能为空") |
| | | private BigDecimal cumulativeConsumption; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.member.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.enums.PointStatusEnum; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | private static final long serialVersionUID = -5584030212572003337L; |
| | | |
| | | @ApiModelProperty(value = "积分id") |
| | | @ApiModelProperty(value = "会员id", notes = "会员管理-查看详情必传,积分管理不传") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "会员姓名") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "变动类型 增加 减少") |
| | | private PointStatusEnum pointsStatus; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "会员姓名") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | } |
| | |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("createBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("createBy", userId.toString(), metaObject); |
| | | fillValue("createTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("updateBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("updateBy", userId.toString(), metaObject); |
| | | fillValue("updateTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 保存会员等级配置 |
| | | * |
| | | * @param memberLevelDTOList 会员等级配置列表 |
| | | * @param dto 会员等级配置列表 |
| | | */ |
| | | void saveOrUpdateMemberLevel(List<MgtMemberLevelDTO> memberLevelDTOList); |
| | | void saveOrUpdateMemberLevel(MgtMemberLevelDTO dto); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberPointsQuery; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberPointsVO; |
| | | import com.ruoyi.system.api.domain.MemberPoints; |
| | | import com.ruoyi.system.api.domain.dto.MemberDTO; |
| | | |
| | |
| | | |
| | | PageDTO<MemberPoints> getMemberPoints(MemberDTO memberDTO); |
| | | |
| | | /** |
| | | * 获取会员积分列表的分页数据 |
| | | * |
| | | * @param query 会员积分明细查询对象 |
| | | * @return PageDTO<MgtMemberPointsVO> |
| | | */ |
| | | PageDTO<MgtMemberPointsVO> getMemberPointsPage(MgtMemberPointsQuery query); |
| | | } |
| | |
| | | package com.ruoyi.member.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberLevelVO; |
| | | import com.ruoyi.member.domain.MemberLevel; |
| | | import com.ruoyi.member.mapper.MemberLevelMapper; |
| | | import com.ruoyi.member.mapper.MemberMapper; |
| | | import com.ruoyi.member.service.IMemberLevelService; |
| | | import com.ruoyi.member.service.IMemberService; |
| | | import com.ruoyi.member.service.async.AsyncMethodService; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import java.util.List; |
| | |
| | | @RequiredArgsConstructor |
| | | public class MemberLevelServiceImpl extends ServiceImpl<MemberLevelMapper, MemberLevel> implements IMemberLevelService { |
| | | |
| | | private final IMemberService memberService; |
| | | private final MemberMapper memberMapper; |
| | | private final AsyncMethodService asyncMethodService; |
| | | /** |
| | | * 获取会员等级管理列表 |
| | |
| | | public List<MgtMemberLevelVO> getMemberLevelList() { |
| | | List<MemberLevel> list = this.lambdaQuery().orderByAsc(MemberLevel::getLevel).list(); |
| | | List<MgtMemberLevelVO> mgtMemberLevelVOS = BeanUtils.copyList(list, MgtMemberLevelVO.class); |
| | | List<Member> memberList = memberService.list(); |
| | | LambdaQueryWrapper<Member> wrapper= Wrappers.lambdaQuery(); |
| | | List<Member> memberList = memberMapper.selectList(wrapper); |
| | | Integer level = 0; |
| | | |
| | | if (StringUtils.isNotEmpty(mgtMemberLevelVOS)) { |
| | |
| | | /** |
| | | * 保存会员等级配置 |
| | | * |
| | | * @param memberLevelDTOList 会员等级配置列表 |
| | | * @param dto 会员等级配置列表 |
| | | */ |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public void saveOrUpdateMemberLevel(List<MgtMemberLevelDTO> memberLevelDTOList) { |
| | | List<MemberLevel> memberLevels = BeanUtils.copyList(memberLevelDTOList, MemberLevel.class); |
| | | public void saveOrUpdateMemberLevel(MgtMemberLevelDTO dto) { |
| | | List<MemberLevel> memberLevels = BeanUtils.copyList(dto.getMemberLevelDTOList(), |
| | | MemberLevel.class); |
| | | this.saveOrUpdateBatch(memberLevels); |
| | | asyncMethodService.handleMemberLevel(memberLevels); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.system.api.domain.MemberPoints; |
| | | import com.ruoyi.system.api.domain.dto.MemberDTO; |
| | | import com.ruoyi.member.controller.management.dto.MgtMemberPointsQuery; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberPointsVO; |
| | | import com.ruoyi.member.mapper.MemberPointsMapper; |
| | | import com.ruoyi.member.service.IMemberPointsService; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import com.ruoyi.system.api.domain.MemberPoints; |
| | | import com.ruoyi.system.api.domain.dto.MemberDTO; |
| | | import com.ruoyi.system.api.feignClient.MemberClient; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | * @since 2024-05-23 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class MemberPointsServiceImpl extends ServiceImpl<MemberPointsMapper, MemberPoints> implements IMemberPointsService { |
| | | |
| | | private final MemberClient memberClient; |
| | | |
| | | @Override |
| | | public PageDTO<MemberPoints> getMemberPoints(MemberDTO memberDTO) { |
| | |
| | | Page<MemberPoints> page1 = this.page(page, wrapper); |
| | | return PageDTO.of(page1); |
| | | } |
| | | |
| | | /** |
| | | * 获取会员积分列表的分页数据 |
| | | * |
| | | * @param query 会员积分明细查询对象 |
| | | * @return PageDTO<MgtMemberPointsVO> |
| | | */ |
| | | @Override |
| | | public PageDTO<MgtMemberPointsVO> getMemberPointsPage(MgtMemberPointsQuery query) { |
| | | Set<Long> memberIdSet = null; |
| | | Page<MemberPoints> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | MemberDTO memberDTO = getMemberQueryParam(query); |
| | | if (StringUtils.isNotNull(memberDTO)) { |
| | | memberIdSet = getMemberIdSet(memberDTO); |
| | | if (StringUtils.isEmpty(memberIdSet)) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | } |
| | | // 分页查询积分 |
| | | page = this.lambdaQuery() |
| | | .eq(StringUtils.isNotNull(query.getPointsStatus()), MemberPoints::getPointsStatus, |
| | | query.getPointsStatus()) |
| | | .in(StringUtils.isNotEmpty(memberIdSet), MemberPoints::getMemberId, memberIdSet) |
| | | .orderByDesc(MemberPoints::getCreateTime) |
| | | .page(page); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | // 封装VO |
| | | PageDTO<MgtMemberPointsVO> pageVO = PageDTO.of(page, |
| | | MgtMemberPointsVO.class); |
| | | List<MgtMemberPointsVO> list = pageVO.getList(); |
| | | Set<Long> memIdSet = list.stream().map(MgtMemberPointsVO::getMemberId) |
| | | .collect(Collectors.toSet()); |
| | | List<Member> memberList = memberClient.getMemberListByIds(memIdSet, SecurityConstants.INNER) |
| | | .getData(); |
| | | Map<Long, Member> memberMap = memberList.stream() |
| | | .collect(Collectors.toMap(Member::getId, Function.identity())); |
| | | if (StringUtils.isNotEmpty(memberList)) { |
| | | for (MgtMemberPointsVO mgtMemberPointsVO : list) { |
| | | Member member = memberMap.get(mgtMemberPointsVO.getMemberId()); |
| | | if (StringUtils.isNotNull(member)) { |
| | | mgtMemberPointsVO.setNickname(member.getNickname()); |
| | | mgtMemberPointsVO.setPhone(member.getPhone()); |
| | | } |
| | | } |
| | | } |
| | | return pageVO; |
| | | } |
| | | |
| | | private Set<Long> getMemberIdSet(MemberDTO memberDTO) { |
| | | Set<Long> memberIdSet = null; |
| | | if (StringUtils.isNotNull(memberDTO)) { |
| | | List<Member> data = memberClient.getMemberListByCondition(memberDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | memberIdSet = data.stream().map(Member::getId).collect(Collectors.toSet()); |
| | | } |
| | | return memberIdSet; |
| | | } |
| | | |
| | | private static MemberDTO getMemberQueryParam(MgtMemberPointsQuery query) { |
| | | MemberDTO memberDTO = null; |
| | | if (StringUtils.isNotBlank(query.getNickname()) || StringUtils.isNotBlank( |
| | | query.getPhone())) { |
| | | memberDTO = new MemberDTO(); |
| | | memberDTO.setNickname(query.getNickname()); |
| | | memberDTO.setPhone(query.getPhone()); |
| | | } |
| | | return memberDTO; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberPointsVO; |
| | | import com.ruoyi.member.controller.management.vo.MgtMemberVO; |
| | | import com.ruoyi.member.domain.MemberLevel; |
| | | import com.ruoyi.member.mapper.MemberLevelMapper; |
| | | import com.ruoyi.member.mapper.MemberMapper; |
| | | import com.ruoyi.member.service.IMemberLevelService; |
| | | import com.ruoyi.member.service.IMemberPointsService; |
| | |
| | | |
| | | public static RequestConfig config = RequestConfig.custom().setConnectTimeout(5000).setSocketTimeout(5000).build(); |
| | | // 配置您申请的KEY,在个人中心->我的数据,接口名称上方查看 |
| | | public static final String APPKEY = ""; |
| | | public static final String APPKEY = "61ad64e1ea78a24e00c449c346caa5d7"; |
| | | //明文查询地址 |
| | | public static String query_url = "http://op.juhe.cn/idcard/query?key=" + APPKEY; |
| | | |
| | |
| | | /** |
| | | * appID |
| | | **/ |
| | | private static final String APP_ID_PROD = "2021004147684313"; |
| | | private static final String APP_ID_PROD = "2021004150664294"; |
| | | /** |
| | | * 私钥 |
| | | */ |
| | | private static final String APP_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCg31tKXap7oTKKKDtfXc/hQjriSJkKopfRkh9j1UA/BpY+6GLkbJhg8kw9CRCILjfi5M0F3FCu+j1ogeDE1ivRGJlX1l/TGj+HuM1g8qLx/tD5D+9nJq5UHfaoKxXPko8H3AWcN1n/MAq3kRwUJRkeYJyYrZ7Sd6RU2taVLktWu92lqoUahjFkQSkdJoKi77v5i1T56PLRFfClt72tnvgol4OXBfFEjpGVrnuYoiHCgLV9eN5Qmvdas/04TtU396p+atYycU2P/dU9fdc8NFFFJo+eYH7astJXIQsowpLtTS7lavQuzCcLvC20pRBPhql5+5X96DVdnOLMbdUKwLQ9AgMBAAECggEAZLuXgVhnYSSN7f7FNrEaczWyg3DsC8HGCN9TsoKcyRpJyDhhfCEXxVTTMkDTzkIKkpOsYagUCYz+GMuCwB5Pr42Ur3C37gr4jvbD+5nTOG7T0bENumx5Kojco27fKGvgDg7SoH/0ZZtiipFdoKueL+xVAjFtSuLJzqx9Q0qKuFLJH0lrQfHYyGcq9ZzrPKLrMZb3Ve3upmpaLjIddZmqnzK7g5lx/OLHEujXIR9u0VWzzxqeaFkgCAMuyzkNYwlpqtiTJsEggbnG9YsLf0n156F0dXo2i44fUav+bKU2ksv7YmENx3R9gPDuPAKH+MwQlwVIc6tR8jKoz0cUbmaujQKBgQDhvaQd4jg9zszdVw1enPWKWViu4rsEFirIz3CUBRB3g2mkZ+tXpQQps7bL7KLBFfXmVYiVMu4EoOfZlkAjJPbFMj9aSPZ3pbx0VnHG8+3T9T2eJdzZp/CehG3MyycNHxAbbl2B04Chiiyf67R0b4ZLMHoElQgJP9jF1q3Xiloi0wKBgQC2b73S4LZWlWkyIsmHYHmXyWta64W2whlL4Nsy97tl4kZNfLCG7mgG5FhHhi16lT7J6Sw1D2FgFov2B1r9+yGBRxckGzWoY5m6FtBE/l+42+gxsB41+kEgirVjlEaX7YBXmnux2LntPVlJOG6HTizjcUnTesGIRvwbmbR2tuXCrwKBgQCMJwKq7xW+AhQdY/vP/yFPaRNvWSOFcQHVNT2PGOnVWciQI1jxTGmePo7CY0PVH35RKE+pWjp+syvfYrKlX0C6w+yjcGNde4/apwTy4eWJ0FwWQSmyFNuGf2/wUz0Gn3+PmGEDxr25DaGRFHUwSUGWkx1elOytWW+LvTKnfKVjswKBgGuh50MnskvI4IRkw7Mr9vDXM5AzjfLx9syuf4RFZflJEyMaImeo9hTC2VZxUhmVPbMP7zXqug9fnflsA4H+jJjh4UQ7DWAoSwTf+sYJsV211/qgpmJAH/Zb/4Idc7yksWh9yuZ1L9RIsomhUoxfUdpp9x1euhl1j72U5ER5yXofAoGAZNrIYFWk4S8mqFY8/h0YVGxT7Hj0ppLsq20N4OzglScoEEG+aYmWDOQU9kWcxsD44bMdzk2k0DyOhHbp8Tjd1hp0UFb03s8HgERcFHMZMzQ5oqtWQEoYiyQZxReXZZvWUbV+dg1HXXG8I26XAKb3OWFUIBBfKa2/Ig9ensY9m+M="; |
| | | private static final String APP_PRIVATE_KEY = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC3ap1qQ5GTe+syB8Tu/fH8nRdpjA7yNgLINR/kFq1VFzxDref7DQDUDWXt+s5QZyBjL1UfbQWtA96F+OpgmIiNMdZSn9FH/w5XSqSd7B4nAa1sgfdLdZDvm+crqzn8OzyEJTrO8tihF+9K+btBl37s3QfmmzCRl1PAAMGqfy/JcQ2aivY+hxb25V0kD5AAXM7mVC2zzcBrykzafQCXEnDC7ls4Hjy0agmq1bKSx8SLYTsXAzZiGk9E7yh76nDAB+P1+kKPEYJXociU3k4YRR7l+6tzBPd+/mVkL34nuV5IiAK/795CrP/9gC50nZK/6CqSPDlQlOaAaJ2uZvAOeKx3AgMBAAECggEAMzw5+swjJ0KvYYtgDK6tYTZ0qswwBKLnxgto/CsFgkZ6VCGJMszgFVwkxASSi00zc+Ft8thehIUXLO9qcU9Knb51MyFnsafi1qmIMIEbryO90RjA/rg5o2U2fzFWgkn9zqAjvFmEAAQSmSwHjfwGvZ3Erjtdpt3RzEmpz7m1nJxYuZ2JLdo8AIY+iYn1NeDxHMi27RtqsZje7RV5YXrqKtMMzW2atmj+Dbn/E1pxpF0Dz6l0TqQh5B+9j1XlPTZKcYOYHNI0ACV+dV1NZsqmdhX0lKtQbsj/Q67vhq7uCmQRKcEka/5Z0X/TOKbwJE6i2/YEuA4PUGLpBMZQXhSGYQKBgQD50IuUTG6fg1dqFt9bJXxq2i1lkIHvzaCkHqVnTMyTDs+VcO2S6YaAFy6BLSI933qvHLogkhqnHiN+BRHe/M5+4TAOx30SQlJYa5ojpNFwMnRSZgxLoEddwlfj6qTnCgDW3CsUPR85x85NjIhONy75muNnNG8GHdn3blk2Y7KhpwKBgQC79TQhz5eJ6cwiWPWMWnnSAVvFKW4iPZjkbk+Sl7JXuqzvsdE47gGN0Vk8iYWEc2WrnQY6vf7WnamQYi+Gr5ySfTSt9qwvRx0IRzHdSZkOsHJLBCnAt+Pf+pSBc2Z788iUXVbDRAIfF6YYG44P3jHspbnGPJt14PP0sHbPmh7YsQKBgGzGGYChJyndjpprCyYs1FfSWCH5IhrAdkn/7hVko08FC+4OFeP6Os5bSayFcntua4UEBSdZdrF9tgaRPo7RlTg55SsKQbNJnYFSmPMcOPWZgny+YmwrheeVT5+188eF24eypi9Rzd7i2Tl7D36/GH0mrA2sDwuiw92w9rdwAb/RAoGAf6RDZPqvNI87e8/h4RDITd9yTPCXxFUEcYygKTMvf/hb3ONq7DhlgcO70CqsK4iacPLP+jBw0Zp8PnsPP24e7DRvA/zSbcDjbG285URH1vvogh0vpZq7+60WENsnq+GgQ3EnrK+QqUDMIO8FiK0iRk09XexmvqSnx3HXHaDSdeECgYB9htO5mOn2/ugIeMw11g+JJkZ/hzE55/6fLf7zh3yel5EflmAdYRv0lHafjyXIzNrAnBgD95x4LKGLi9A5AMo9SJJu0ZOg1KujKPVY4ByCm9SO7ErJDuHI4AhtewdHhYDpnXMakoxm/medSjlt7GCVv7E/eDpNZs+MLi9MiTFx2g=="; |
| | | /** |
| | | * 支付宝公钥 |
| | | */ |
| | | private static final String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh+tCVKqUmlHDL8Ki1TUJtzE5IKV1irJuoHWZTvndJCKJJ8bdWxL9mu5xsy8KkfrnS6wJIKBMLTxMoYQHG7l2Gt07YyUCYHS5+yvbHtTkyFFy2KRPeUEWXz1Tm4juvInDvvr+n7v9ETepToGhC+UDlQcBvuSppw8N+463E+1GRrC4APwXYGLzaIvYvDHcQAULkWhXsjzxJSmeSi12kqWKlgnVJC1y0FT8xQtvhwShfaIqKwzErn9S2z7JjdXboJMUYQHoqF1A4SmWY8c0qawqvx2hGP36W3RDQ4cczzFwUHS1Cylhsbgh1COc4OdANCX4Np2NUzaRDCNzN0WVFKtK+QIDAQAB"; |
| | | private static final String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlW2RMACojdqTa8H+j6411Lm5UipGXXbQiswq50rUflwjTj843zNVaVpk8uJmbdmtUBJlmblgBS/a31O4L4LrHB8WxJ+w0f9DBNTq9T6b80MiAVnU/3gXK365DmbzPWS5pR9wEgJVHnfOFUbsB5AVFHV0m9hUZcPv7xveuEp3BEoD5smaDJByR+KgFw0Q0JgINhhE6bsEa3UgJ198af269LtQ5HJl1TWLI8aeqW14HrxyADIt49NB9KZ8MOdKP+66HWcrXlipKFHtccy3dff72DqPmFdESoXfLXKZyhU5w9v4Q5F6UoAGTPwl9KQwikTobNeJ/7su7X3AB6+C14J4sQIDAQAB"; |
| | | |
| | | |
| | | @Resource |
| | |
| | | private RedisService redisService; |
| | | |
| | | @Resource |
| | | private IMemberLevelService iMemberLevelService; |
| | | private MemberLevelMapper memberLevelMapper; |
| | | |
| | | |
| | | @Resource |
| | |
| | | public void authentificationMembe(MemberDTO memberDTO) { |
| | | Member member= this.getById(memberDTO.getMemberid()); |
| | | member.setPhone(memberDTO.getPhone()); |
| | | if(memberDTO.getIdNumber()==null){ |
| | | throw new ServiceException("身份证号不能为空"); |
| | | } |
| | | if(memberDTO.getRealName()==null){ |
| | | throw new ServiceException("姓名不能为空"); |
| | | } |
| | | member.setIdNumber(memberDTO.getIdNumber()); |
| | | member.setRealName(memberDTO.getRealName()); |
| | | String realname = "";// 姓名 |
| | | String idcard = "";// 身份证 |
| | | int type = 1;// 普通版,不需要加密 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("realname", realname); |
| | | params.put("idcard", idcard); |
| | | params.put("realname", memberDTO.getRealName()); |
| | | params.put("idcard", memberDTO.getIdNumber()); |
| | | CloseableHttpClient httpClient = HttpClients.createDefault(); |
| | | CloseableHttpResponse response = null; |
| | | String result = null; |
| | |
| | | } |
| | | } |
| | | JSONObject jsonObject= JSON.parseObject(result); |
| | | String object1= jsonObject.get("reason").toString(); |
| | | if(!object1.equals("成功")){ |
| | | throw new ServiceException(object1); |
| | | } |
| | | |
| | | |
| | | String object= jsonObject.get("result").toString(); |
| | | JSONObject jsonObject1= JSON.parseObject(object); |
| | | if (Integer.valueOf(jsonObject1.get("res").toString())==2){ |
| | | throw new ServiceException("实名认证失败"); |
| | | } |
| | | String sex=getGender(idcard); |
| | | String sex=getGender(memberDTO.getIdNumber()); |
| | | if (sex.equals("女")){ |
| | | member.setGender(GenderEnum.FEMALE); |
| | | } |
| | | if (sex.equals("男")){ |
| | | member.setGender(GenderEnum.MALE); |
| | | } |
| | | member.setIsAuthentication(2); |
| | | this.updateById(member); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | this.updateById(byId); |
| | | |
| | | List<MemberLevel> list = iMemberLevelService.list(); |
| | | LambdaQueryWrapper<MemberLevel> wrapper= Wrappers.lambdaQuery(); |
| | | List<MemberLevel> list = memberLevelMapper.selectList(wrapper); |
| | | for (int i=0;i<list.size();i++){ |
| | | if (i==0){ |
| | | int ia = byId.getMoney().compareTo(list.get(0).getCumulativeConsumption()); |
| | |
| | | <version>1.2.47</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.kuaidi100-api</groupId> |
| | | <artifactId>sdk</artifactId> |
| | | <version>1.0.11</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.binarywang</groupId> |
| | | <artifactId>weixin-java-common</artifactId> |
| | | <version>4.5.0</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.thoughtworks.xstream</groupId> |
| | | <artifactId>xstream</artifactId> |
| | | <version>1.4.8</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.47</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- 分布式事务 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-seata</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
New file |
| | |
| | | package com.ruoyi.order.controller.forepart; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.order.domain.MemberInvoice; |
| | | import com.ruoyi.order.dto.MemberInvoiceDTO; |
| | | import com.ruoyi.order.service.ILogisticsService; |
| | | import com.ruoyi.order.service.impl.LogisticsServiceImpl; |
| | | import com.ruoyi.system.api.domain.Logistics; |
| | | import com.ruoyi.system.api.domain.dto.LogisticsDTO; |
| | | import com.ruoyi.system.api.domain.vo.Express100VO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | | * 物流公司 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-06-07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/forepart/logistics") |
| | | @Api(value = "用户端-获取快递信息", tags = "用户端-获取快递信息", description = "用户端-获取快递信息") |
| | | public class ForepartLogisticsController { |
| | | @Resource |
| | | private ILogisticsService iLogisticsService; |
| | | @PostMapping("/getLogistics") |
| | | @ApiOperation(value = "用户端-获取快递公司") |
| | | public R<Logistics> getLogistics() { |
| | | iLogisticsService.list(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/getLogisticsList") |
| | | @ApiOperation(value = "用户端-获取快递信息") |
| | | public R<Express100VO> getLogisticsList(@RequestBody LogisticsDTO logisticsDTO) { |
| | | return R.ok(iLogisticsService.getLogisticsList(logisticsDTO)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.system.api.domain.dto.MemberOrderDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberOrderListDTO; |
| | | import com.ruoyi.system.api.domain.vo.MemberOrderListVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberOrderNumVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberTiOrderVO; |
| | | import com.ruoyi.system.api.domain.vo.OrderVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/forepart/order") |
| | | @Api(value = "用户端-用户订单相关接口", tags = "用户端--用户订单相关接口", description = "用户端--用户订单相关接口") |
| | | @RequiredArgsConstructor |
| | | public class ForepartOrderController { |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/MemberOrderNum") |
| | | @ApiOperation(value = "用户端-订单的數量") |
| | | public R<MemberOrderNumVO> MemberOrderNum(@RequestBody MemberOrderListDTO memberOrderListDTO) { |
| | | return R.ok(orderService.MemberOrderNum(memberOrderListDTO)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.order.service.IOrderReturnRequestService; |
| | | import com.ruoyi.system.api.domain.dto.OrderReturnDTO; |
| | | import com.ruoyi.system.api.domain.vo.OrderReturnVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/forepart/order-return-request") |
| | | @Api(value = "用户端-用户订单售后相关接口", tags = "用户端--用户订单售后相关接口", description = "用户端--用户订单售后相关接口") |
| | | public class ForepartOrderReturnRequestController { |
| | | @Resource |
| | | private IOrderReturnRequestService OrderReturnRequestService; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private PaylogServiceImpl paylogServiceImpl; |
| | | |
| | | Logger log = LoggerFactory.getLogger(getClass()); |
| | | @ResponseBody |
| | | @PostMapping("/getPayInfo") |
| | | @ApiOperation(value = "用户端-获取支付信息") |
| | | public R<Map<String, Object>> getPayInfo(PayInfoDTO payInfoDTO, |
| | | public R<Map<String, Object>> getPayInfo(@RequestBody PayInfoDTO payInfoDTO, |
| | | HttpServletRequest request) { |
| | | try { |
| | | return paylogServiceImpl.getPayInfo(Integer.valueOf(payInfoDTO.getMemberId().intValue()), payInfoDTO.getType(), payInfoDTO.getSubject(), payInfoDTO.getBody(), payInfoDTO.getOrderNO(), payInfoDTO.getOpenId(),request); |
| | | return paylogServiceImpl.getPayInfo(Integer.valueOf(payInfoDTO.getMemberId().intValue()), payInfoDTO.getType(), payInfoDTO.getOrderNO(), payInfoDTO.getOpenId(),request); |
| | | } catch (Exception e) { |
| | | return R.fail("获取异常"); |
| | | } |
| | |
| | | * @param bondStatusEnum 保证金状态 |
| | | */ |
| | | @InnerAuth |
| | | @PutMapping |
| | | @PutMapping("/updateOrderAuctionBondStatus") |
| | | R<?> updateOrderAuctionBondStatus(@RequestParam("ids") List<Long> ids, |
| | | @RequestParam("bondStatusEnum") BondStatusEnum bondStatusEnum) { |
| | | iOrderAuctionBondService.updateOrderAuctionBondStatus(ids, bondStatusEnum); |
| | |
| | | public R<List<OrderAuctionBond>> getOrderAuctionBondList1(@RequestBody MemberAuctionSalesroomDTO memberAuctionSalesroomDTO) { |
| | | LambdaQueryWrapper<OrderAuctionBond> wrapper= Wrappers.lambdaQuery(); |
| | | wrapper.eq(OrderAuctionBond::getMemberId,memberAuctionSalesroomDTO.getMemberId()); |
| | | wrapper.eq(OrderAuctionBond::getAuctionSalesroomId,memberAuctionSalesroomDTO.getAuctionSalesroomId()); |
| | | if (memberAuctionSalesroomDTO.getAuctionSalesroomId()!=null){ |
| | | wrapper.eq(OrderAuctionBond::getAuctionSalesroomId,memberAuctionSalesroomDTO.getAuctionSalesroomId()); |
| | | } |
| | | wrapper.eq(OrderAuctionBond::getBoundStatus,2); |
| | | wrapper.eq(OrderAuctionBond::getDelFlag,0); |
| | | List<OrderAuctionBond> list = iOrderAuctionBondService.list(wrapper); |
| | |
| | | public R<List<OrderAuctionBond>> getAuctionGoodsOrderAuctionBondList(@RequestBody AuctionGoodsListDTO auctionGoodsListDTO) { |
| | | LambdaQueryWrapper<OrderAuctionBond> wrapper= Wrappers.lambdaQuery(); |
| | | wrapper.eq(OrderAuctionBond::getMemberId,auctionGoodsListDTO.getMemberId()); |
| | | if (auctionGoodsListDTO.getGoodsSkuId()!=null){ |
| | | wrapper.eq(OrderAuctionBond::getAuctionGoodsId,auctionGoodsListDTO.getGoodsSkuId()); |
| | | } |
| | | wrapper.eq(OrderAuctionBond::getBoundStatus,1); |
| | | wrapper.eq(OrderAuctionBond::getDelFlag,0); |
| | | List<OrderAuctionBond> list = iOrderAuctionBondService.list(wrapper); |
New file |
| | |
| | | package com.ruoyi.order.controller.management; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 开票申请表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/mgt/invoicing-application") |
| | | public class MgtInvoicingApplicationController { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.service.ILogisticsService; |
| | | import com.ruoyi.system.api.domain.Logistics; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 物流公司 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-06-07 |
| | | */ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/mgt/logistics") |
| | | @Api(value = "管理后台-获取物流快递信息", tags = "管理后台-获取物流快递信息") |
| | | public class MgtLogisticsController { |
| | | |
| | | private final ILogisticsService iLogisticsService; |
| | | |
| | | /** |
| | | * 获取物流公司列表 |
| | | * |
| | | * @return List<Logistics> |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "物流公司列表") |
| | | public R<List<Logistics>> getLogistics() { |
| | | return R.ok(iLogisticsService.list()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtMemberInvoicingQuery; |
| | | import com.ruoyi.order.controller.management.vo.MgtMemberInvoicingVO; |
| | | import com.ruoyi.order.service.IMemberInvoiceService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 开票申请表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Api(tags = "管理后台-开票申请相关接口") |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/mgt/invoicing-application") |
| | | public class MgtMemberInvoicingController { |
| | | |
| | | private final IMemberInvoiceService memberInvoiceService; |
| | | |
| | | @ApiOperation("获取开票申请列表分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MgtMemberInvoicingVO>> getMemberInvoicingPage( |
| | | @Validated @RequestBody MgtMemberInvoicingQuery query) { |
| | | return R.ok(memberInvoiceService.getMemberInvoicingPage(query)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 拍卖订单表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/mgt/order-auction") |
| | | public class MgtOrderAuctionController { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderConfirmShipmentDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderQuery; |
| | | import com.ruoyi.order.controller.management.vo.MgtOrderVO; |
| | | import com.ruoyi.order.service.IOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/mgt/order") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "管理后台-订单管理相关接口", value = "管理后台-订单管理相关接口") |
| | | public class MgtOrderController { |
| | | |
| | | private final IOrderService orderService; |
| | | |
| | | /** |
| | | * 商城订单分页列表 |
| | | * |
| | | * @param query 商城订单查询对象 |
| | | * @return PageDTO<MgtMallOrderVO> |
| | | */ |
| | | @ApiOperation("订单分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MgtOrderVO>> getOrderPage( |
| | | @Validated @RequestBody MgtOrderQuery query) { |
| | | return R.ok(orderService.getOrderPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取商城订单详情 |
| | | * |
| | | * @param id 订单id |
| | | * @return MgtMallOrderVO |
| | | */ |
| | | @ApiOperation("查看详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<MgtOrderVO> getMallOrderDetail( |
| | | @ApiParam(name = "id", value = "订单id", required = true) |
| | | @Validated @PathVariable("id") Long id) { |
| | | return R.ok(orderService.getOrderDetail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 确认发货 |
| | | * |
| | | * @param dto 确认发货请求对象 |
| | | */ |
| | | @ApiOperation("确认发货") |
| | | @PutMapping("/confirm-shipment") |
| | | public R<?> confirmShipmentOrder(@Validated @RequestBody MgtOrderConfirmShipmentDTO dto) { |
| | | orderService.confirmShipmentOrder(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 已收货 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @ApiOperation("已收货") |
| | | @PutMapping("/received-goods/{id}") |
| | | public R<?> receivedGoods( |
| | | @ApiParam(name = "id", value = "订单id", required = true) @PathVariable("id") Long id) { |
| | | orderService.receivedGoods(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 退款 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @ApiOperation("退款") |
| | | @GetMapping("/refund/{id}") |
| | | public R<?> refund( |
| | | @ApiParam(name = "id", value = "订单id", required = true) @PathVariable("id") Long id) { |
| | | orderService.refund(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 退款退货 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @ApiOperation("退款退货") |
| | | @GetMapping("/refund-return/{id}") |
| | | public R<?> refundReturn( |
| | | @ApiParam(name = "id", value = "订单id", required = true) @PathVariable("id") Long id) { |
| | | orderService.refundReturn(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 拍卖订单退保证金 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @ApiOperation("拍卖订单退保证金") |
| | | @PutMapping("/refund-bond/{id}") |
| | | public R<?> refundBond( |
| | | @ApiParam(name = "id", value = "订单id", required = true) @PathVariable("id") Long id) { |
| | | orderService.refundBond(id); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderReturnRequestQuery; |
| | | import com.ruoyi.order.controller.management.dto.MgtReturnRequestAuditDTO; |
| | | import com.ruoyi.order.controller.management.vo.MgtOrderReturnRequestVO; |
| | | import com.ruoyi.order.service.IOrderReturnRequestService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 售后表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/mgt/order-return-request") |
| | | @Api(tags = {"管理后台-售后管理相关接口"}, value = "管理后台-售后管理相关接口") |
| | | public class MgtOrderReturnRequestController { |
| | | |
| | | private final IOrderReturnRequestService orderReturnRequestService; |
| | | |
| | | /** |
| | | * 获取售后管理列表分页数据 |
| | | * |
| | | * @param query 售后管理查询对象 |
| | | * @return PageDTO<MgtOrderReturnRequestVO> |
| | | */ |
| | | @ApiOperation("获取售后管理列表分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MgtOrderReturnRequestVO>> getOrderReturnRequestPage( |
| | | @Validated @RequestBody MgtOrderReturnRequestQuery query) { |
| | | return R.ok(orderReturnRequestService.getOrderReturnRequestPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * |
| | | * @param id 售后id |
| | | * @return MgtOrderReturnRequestVO |
| | | */ |
| | | @ApiOperation("查看详情") |
| | | @PostMapping("/detail/{id}") |
| | | public R<MgtOrderReturnRequestVO> getOrderReturnRequestDetail( |
| | | @ApiParam(name = "id", value = "售后id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(orderReturnRequestService.getOrderReturnRequestDetail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 审核 |
| | | * |
| | | * @param dto 管理后台-售后审核传输对象 |
| | | */ |
| | | @ApiOperation("审核") |
| | | @PutMapping("/audit") |
| | | public R<?> auditReturnRequest(@Validated @RequestBody MgtReturnRequestAuditDTO dto) { |
| | | orderReturnRequestService.auditReturnRequest(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("确认收货") |
| | | @PutMapping("/confirm/{id}") |
| | | public R<?> confirmReturnRequest( |
| | | @ApiParam(name = "id", value = "售后id", required = true) @PathVariable("id") Long id) { |
| | | orderReturnRequestService.confirmReturnRequest(id); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/15 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台-开票申请相关接口") |
| | | public class MgtMemberInvoicingQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = -2817314070304563106L; |
| | | |
| | | @ApiModelProperty(value = "下单会员") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "开票状态 1待审核,2 已开票,3 已拒绝", notes = "传数字") |
| | | private Integer invoiceStatus; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/13 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "确认收货请求对象", description = "确认收货请求对象") |
| | | public class MgtOrderConfirmShipmentDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -7033967657700963452L; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | @NotNull(message = "订单id不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("发货快递") |
| | | @NotBlank(message = "发货快递不能为空") |
| | | private String logisticsNum; |
| | | |
| | | @ApiModelProperty("发货快递") |
| | | @NotBlank(message = "发货快递单号不能为空") |
| | | private String courierNumber; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.enums.OrderFromEnum; |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderTypeEnum; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "订单查询对象") |
| | | public class MgtOrderQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = 7466073766154410614L; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "订单来源 1=商品订单 2=秒杀订单 3=团购订单 4=拍卖订单") |
| | | private OrderFromEnum orderFrom; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String skuName; |
| | | |
| | | @ApiModelProperty(value = "下单会员") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "订单状态 1=待支付 2=待发货 3=待收货 4=已完成 5=已取消,6 售后") |
| | | private OrderStatusEnum orderStatus; |
| | | |
| | | @ApiModelProperty(value = "订单类型 1=商城订单 2=拍卖订单") |
| | | @NotNull(message = "订单类型不能为空") |
| | | private OrderTypeEnum queryType; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderTypeEnum; |
| | | import com.ruoyi.common.core.enums.RequestTypeEnum; |
| | | import com.ruoyi.common.core.enums.ReturnRequestStatusEnum; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.util.Set; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/15 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "售后管理查询对象") |
| | | public class MgtOrderReturnRequestQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = -2488762912713305360L; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | |
| | | @ApiModelProperty(value = "售后类型 1=退款 2=退款退货") |
| | | private RequestTypeEnum requestType; |
| | | |
| | | @ApiModelProperty(value = "会员姓名") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "售后状态 1=待审核 2=待退货 3=待平台收货 4=已完成 5=已拒绝") |
| | | private ReturnRequestStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "审核状态 1=待审核 2=已通过 3=已拒绝") |
| | | private AuditStatusEnum auditStatus; |
| | | |
| | | @ApiModelProperty(value = "订单类型 1=商城订单 2=拍卖订单") |
| | | private OrderTypeEnum orderType; |
| | | |
| | | @ApiModelProperty(value = "会员id列表", hidden = true) |
| | | private Set<Long> memberIdSet; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management.dto; |
| | | |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "管理后台-售后审核传输对象", description = "管理后台-售后审核传输对象") |
| | | public class MgtReturnRequestAuditDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -8029337933255222034L; |
| | | |
| | | @ApiModelProperty(value = "售后id") |
| | | @NotNull(message = "售后id不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "审核状态 已通过 已拒绝") |
| | | @NotNull(message = "审核状态不能为空") |
| | | private AuditStatusEnum auditStatus; |
| | | |
| | | @ApiModelProperty(value = "拒绝原因") |
| | | private String refuseComment; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/15 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "开票申请视图对象", description = "开票申请视图对象") |
| | | public class MgtMemberInvoicingVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 8675136188843149666L; |
| | | |
| | | @ApiModelProperty(value = "开票申请id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "会员姓名") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "申请时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "开票状态 1待审核,2 已开票,3 已拒绝") |
| | | private Integer invoiceStatus; |
| | | |
| | | @ApiModelProperty(value = "申请金额") |
| | | private BigDecimal invoiceMoney; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderTypeEnum; |
| | | import com.ruoyi.common.core.enums.PaymentMethodEnum; |
| | | import com.ruoyi.common.core.enums.RequestTypeEnum; |
| | | import com.ruoyi.common.core.enums.ReturnRequestStatusEnum; |
| | | import com.ruoyi.system.api.domain.vo.Express100VO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "售后信息视图对象", description = "售后信息视图对象") |
| | | public class MgtOrderReturnRequestVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -8078959211637146770L; |
| | | |
| | | @ApiModelProperty(value = "售后id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | private Long orderId; |
| | | |
| | | @ApiModelProperty(value = "申请时间") |
| | | private LocalDateTime requestTime; |
| | | |
| | | @ApiModelProperty(value = "售后类型 1=退款 2=退款退货") |
| | | private RequestTypeEnum requestType; |
| | | |
| | | @ApiModelProperty(value = "申请原因") |
| | | private String requestReason; |
| | | |
| | | @ApiModelProperty(value = "售后状态 1=待审核 2=待退货 3=待平台收货 4=已完成 5=已拒绝") |
| | | private ReturnRequestStatusEnum status; |
| | | |
| | | @ApiModelProperty(value = "审核状态 1=待审核 2=已通过 3=已拒绝") |
| | | private AuditStatusEnum auditStatus; |
| | | |
| | | @ApiModelProperty(value = "拒绝理由") |
| | | private String refuseReason; |
| | | |
| | | @ApiModelProperty(value = "详情图,不超过五张图片") |
| | | private String album; |
| | | |
| | | @ApiModelProperty(value = "收件人姓名") |
| | | private String recipientName; |
| | | |
| | | @ApiModelProperty(value = "收件人电话") |
| | | private String recipientPhone; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | private String detailedAddress; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "退货快递单号") |
| | | private String courierNumber; |
| | | |
| | | @ApiModelProperty("退货时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime returnTime; |
| | | |
| | | @ApiModelProperty("平台收货时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime platformReceiptTime; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "下单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime orderTime; |
| | | |
| | | @ApiModelProperty(value = "会员姓名") |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "会员姓名") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "支付时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime payTime; |
| | | |
| | | @ApiModelProperty(value = "支付方式 1=微信 2=支付宝") |
| | | private PaymentMethodEnum paymentMethod; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "积分") |
| | | private Integer points; |
| | | |
| | | @ApiModelProperty(value = "支付合计") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty(value = "优惠金额") |
| | | private BigDecimal discountMoney; |
| | | |
| | | @ApiModelProperty(value = "订单类型 1=商城订单 2=拍卖订单") |
| | | private OrderTypeEnum orderType; |
| | | |
| | | @ApiModelProperty("发货快递") |
| | | private String logisticsNum; |
| | | |
| | | @ApiModelProperty("物流信息") |
| | | private Express100VO express100VO; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller.management.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.enums.AuctionOrderTypeEnum; |
| | | import com.ruoyi.common.core.enums.BondStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderFromEnum; |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | | import com.ruoyi.common.core.enums.PaymentMethodEnum; |
| | | import com.ruoyi.system.api.domain.vo.Express100VO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @Api(value = "商城订单视图对象") |
| | | public class MgtOrderVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -7047076906373189300L; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "下单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime orderTime; |
| | | |
| | | @ApiModelProperty(value = "拍卖订单类型 1=普通拍品 2=拍卖会拍品") |
| | | private AuctionOrderTypeEnum auctionType; |
| | | |
| | | @ApiModelProperty(value = "所属拍卖场") |
| | | private String salesroomName; |
| | | |
| | | @ApiModelProperty("拍卖会id") |
| | | private Long auctionSalesroomId; |
| | | |
| | | @ApiModelProperty(value = "保证金") |
| | | private BigDecimal bound; |
| | | |
| | | @ApiModelProperty(value = "保证金状态 1=待支付 2=已支付 3=已退款") |
| | | private BondStatusEnum boundStatus; |
| | | |
| | | @ApiModelProperty(value = "订单来源 1=商品订单 2=秒杀订单 3=团购订单 4=拍卖订单") |
| | | private OrderFromEnum orderFrom; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "会员姓名") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "支付方式 1=微信 2=支付宝") |
| | | private PaymentMethodEnum paymentMethod; |
| | | |
| | | @ApiModelProperty(value = "支付合计") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty(value = "订单状态 1=待支付 2=待发货 3=待收货 4=已完成 5=已取消,6 售后") |
| | | private OrderStatusEnum orderStatus; |
| | | |
| | | @ApiModelProperty(value = "支付时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime payTime; |
| | | |
| | | @ApiModelProperty(value = "取消时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime cancelTime; |
| | | |
| | | @ApiModelProperty(value = "订单备注") |
| | | private String orderRemark; |
| | | |
| | | @ApiModelProperty(value = "发货时间") |
| | | private LocalDateTime deliveryTime; |
| | | |
| | | @ApiModelProperty(value = "确认收货时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime receiveTime; |
| | | |
| | | @ApiModelProperty(value = "优惠金额") |
| | | private BigDecimal discountMoney; |
| | | |
| | | @ApiModelProperty("秒杀价格") |
| | | private BigDecimal seckillPrice; |
| | | |
| | | @ApiModelProperty("秒杀价格") |
| | | private BigDecimal groupPurchasesPrice; |
| | | |
| | | @ApiModelProperty(value = "商品数量") |
| | | private Integer goodsQuantity; |
| | | |
| | | @ApiModelProperty(value = "快递单号") |
| | | private String courierNumber; |
| | | |
| | | @ApiModelProperty(value = "收货人姓名") |
| | | private String receiverName; |
| | | |
| | | @ApiModelProperty(value = "收货人电话") |
| | | private String receiverPhone; |
| | | |
| | | @ApiModelProperty(value = "城市") |
| | | private String receiverCity; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | private String receiverDetailAddress; |
| | | |
| | | @ApiModelProperty(value = "开票状态 开票状态 1 待开票,2待审核,3 已开票,4 拒绝") |
| | | private Integer invoiceStatus; |
| | | |
| | | @ApiModelProperty(value = "优惠券id") |
| | | private Long couponId; |
| | | |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | private String couponName; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String skuName; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | private String coverPic; |
| | | |
| | | @ApiModelProperty(value = "商品价格") |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "积分") |
| | | private Integer points; |
| | | |
| | | @ApiModelProperty("售后信息") |
| | | private MgtOrderReturnRequestVO returnRequestVO; |
| | | |
| | | @ApiModelProperty("物流信息") |
| | | private Express100VO express100VO; |
| | | } |
| | |
| | | @ApiModelProperty(value = "快递单号") |
| | | private String courierNumber; |
| | | |
| | | @ApiModelProperty(value = "物流编码") |
| | | private String logisticsNum; |
| | | |
| | | @ApiModelProperty("退货时间") |
| | | private LocalDateTime returnTime; |
| | | |
| | | @ApiModelProperty("平台收货时间") |
| | | private LocalDateTime platformReceiptTime; |
| | | } |
| | |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("createBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("createBy", userId.toString(), metaObject); |
| | | fillValue("createTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("updateBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("updateBy", userId.toString(), metaObject); |
| | | fillValue("updateTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | |
| | | |
| | | Integer getSeckillMembers1(MemberOrderDTO memberOrderDTO); |
| | | |
| | | Integer getGoodsGroupPurchase(MemberOrderDTO memberOrderDTO); |
| | | |
| | | /** |
| | | * 根据团购商品id获取团购商品订单 |
| | | * |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderReturnRequestQuery; |
| | | import com.ruoyi.order.controller.management.vo.MgtOrderReturnRequestVO; |
| | | import com.ruoyi.order.domain.OrderReturnRequest; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface OrderReturnRequestMapper extends BaseMapper<OrderReturnRequest> { |
| | | |
| | | Page<MgtOrderReturnRequestVO> getOrderReturnRequestPage( |
| | | @Param("page") Page<MgtOrderReturnRequestVO> page, |
| | | @Param("query") MgtOrderReturnRequestQuery query); |
| | | |
| | | MgtOrderReturnRequestVO getOrderReturnRequestDetail(Long id); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.domain.Logistics; |
| | | import com.ruoyi.system.api.domain.dto.LogisticsDTO; |
| | | import com.ruoyi.system.api.domain.vo.Express100VO; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ILogisticsService extends IService<Logistics> { |
| | | |
| | | Express100VO getLogisticsList(@RequestBody LogisticsDTO logisticsDTO); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtMemberInvoicingQuery; |
| | | import com.ruoyi.order.controller.management.vo.MgtMemberInvoicingVO; |
| | | import com.ruoyi.order.domain.MemberInvoice; |
| | | import com.ruoyi.order.dto.MemberInvoiceDTO; |
| | | |
| | |
| | | |
| | | PageDTO<MemberInvoice> getMemberInvoiceList(MemberInvoiceDTO memberInvoiceDTO); |
| | | |
| | | PageDTO<MgtMemberInvoicingVO> getMemberInvoicingPage(MgtMemberInvoicingQuery query); |
| | | } |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderReturnRequestQuery; |
| | | import com.ruoyi.order.controller.management.dto.MgtReturnRequestAuditDTO; |
| | | import com.ruoyi.order.controller.management.vo.MgtOrderReturnRequestVO; |
| | | import com.ruoyi.order.domain.OrderReturnRequest; |
| | | import com.ruoyi.system.api.domain.dto.OrderReturnDTO; |
| | | import com.ruoyi.system.api.domain.vo.OrderReturnVO; |
| | |
| | | |
| | | OrderReturnVO OrderReturnRequestInfo(@RequestBody OrderReturnDTO OrderReturnDTO); |
| | | |
| | | /** |
| | | * 获取售后管理列表分页数据 |
| | | * |
| | | * @param query 售后管理查询对象 |
| | | * @return PageDTO<MgtOrderReturnRequestVO> |
| | | */ |
| | | PageDTO<MgtOrderReturnRequestVO> getOrderReturnRequestPage(MgtOrderReturnRequestQuery query); |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * |
| | | * @param id 售后id |
| | | * @return MgtOrderReturnRequestVO |
| | | */ |
| | | MgtOrderReturnRequestVO getOrderReturnRequestDetail(Long id); |
| | | |
| | | /** |
| | | * 审核 |
| | | * |
| | | * @param dto 管理后台-售后审核传输对象 |
| | | */ |
| | | void auditReturnRequest(MgtReturnRequestAuditDTO dto); |
| | | |
| | | void confirmReturnRequest(Long id); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderConfirmShipmentDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderQuery; |
| | | import com.ruoyi.order.controller.management.vo.MgtOrderVO; |
| | | import com.ruoyi.system.api.domain.Order; |
| | | import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberOrderDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberOrderListDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import com.ruoyi.system.api.domain.vo.MemberOrderListVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberOrderNumVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberTiOrderVO; |
| | | import com.ruoyi.system.api.domain.vo.OrderVO; |
| | | import java.util.Collection; |
| | |
| | | |
| | | void AffirmOrderOne(@RequestBody MemberOrderListDTO memberOrderListDTO); |
| | | |
| | | MemberOrderNumVO MemberOrderNum(@RequestBody MemberOrderListDTO memberOrderListDTO); |
| | | |
| | | /** |
| | | * 根据优惠券id集合查询订单列表 |
| | | * |
| | |
| | | * @return List<Order> |
| | | */ |
| | | List<Order> getOrderByCouponIds(Collection<Long> couponIds); |
| | | |
| | | /** |
| | | * 商城订单分页列表 |
| | | * |
| | | * @param query 商城订单查询对象 |
| | | * @return PageDTO<MgtMallOrderVO> |
| | | */ |
| | | PageDTO<MgtOrderVO> getOrderPage(MgtOrderQuery query); |
| | | |
| | | /** |
| | | * 获取商城订单详情 |
| | | * |
| | | * @param id 订单id |
| | | * @return MgtMallOrderVO |
| | | */ |
| | | MgtOrderVO getOrderDetail(Long id); |
| | | |
| | | /** |
| | | * 确认发货 |
| | | * |
| | | * @param dto 确认发货请求对象 |
| | | */ |
| | | void confirmShipmentOrder(MgtOrderConfirmShipmentDTO dto); |
| | | |
| | | /** |
| | | * 已收货 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | void receivedGoods(Long id); |
| | | |
| | | /** |
| | | * 退款 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | void refund(Long id); |
| | | |
| | | /** |
| | | * 退款退货 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | void refundReturn(Long id); |
| | | |
| | | /** |
| | | * 拍卖订单退保证金 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | void refundBond(Long id); |
| | | } |
| | |
| | | */ |
| | | public interface IPaylogService extends IService<Paylog> { |
| | | |
| | | R<Map<String, Object>> getPayInfo(Integer uid, Integer type, String subject, String body, String orderID,String openId, |
| | | R<Map<String, Object>> getPayInfo(Integer uid, Integer type, String orderID,String openId, |
| | | HttpServletRequest request); |
| | | |
| | | |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.alibaba.nacos.shaded.com.google.gson.Gson; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.kuaidi100.sdk.api.QueryTrack; |
| | | import com.kuaidi100.sdk.core.IBaseClient; |
| | | import com.kuaidi100.sdk.pojo.HttpResult; |
| | | import com.kuaidi100.sdk.request.QueryTrackParam; |
| | | import com.kuaidi100.sdk.request.QueryTrackReq; |
| | | import com.kuaidi100.sdk.utils.SignUtils; |
| | | import com.ruoyi.order.mapper.LogisticsMapper; |
| | | import com.ruoyi.order.service.ILogisticsService; |
| | | import com.ruoyi.system.api.domain.Logistics; |
| | | import com.ruoyi.system.api.domain.dto.LogisticsDTO; |
| | | import com.ruoyi.system.api.domain.vo.Express100VO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | public class LogisticsServiceImpl extends ServiceImpl<LogisticsMapper, Logistics> implements |
| | | ILogisticsService { |
| | | |
| | | private String key="BltjQodT7186"; |
| | | private String customer="56DE8E9E3D58CE73C60755C8B7483043"; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Express100VO getLogisticsList(LogisticsDTO logisticsDTO) { |
| | | QueryTrackReq queryTrackReq = new QueryTrackReq(); |
| | | QueryTrackParam queryTrackParam = new QueryTrackParam(); |
| | | queryTrackParam.setCom(logisticsDTO.getCompany()); |
| | | queryTrackParam.setNum(logisticsDTO.getPostid()); |
| | | String param = new Gson().toJson(queryTrackParam); |
| | | |
| | | queryTrackReq.setParam(param); |
| | | queryTrackReq.setCustomer(customer); |
| | | queryTrackReq.setSign(SignUtils.querySign(param ,key,customer)); |
| | | |
| | | IBaseClient baseClient = new QueryTrack(); |
| | | HttpResult execute = null; |
| | | try { |
| | | execute = baseClient.execute(queryTrackReq); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | // 对返回的数据进行反序列化处理 |
| | | Gson gson = new Gson(); |
| | | String responseBody = execute.getBody(); |
| | | Express100VO response = gson.fromJson(responseBody, Express100VO.class); |
| | | return response; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.enums.OrderFromEnum; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtMemberInvoicingQuery; |
| | | import com.ruoyi.order.controller.management.vo.MgtMemberInvoicingVO; |
| | | import com.ruoyi.order.domain.MemberInvoice; |
| | | import com.ruoyi.order.domain.MemberInvoiceOrder; |
| | | import com.ruoyi.order.domain.OrderAuction; |
| | | import com.ruoyi.order.dto.MemberInvoiceDTO; |
| | | import com.ruoyi.order.mapper.MemberInvoiceMapper; |
| | | import com.ruoyi.order.service.IMemberInvoiceOrderService; |
| | | import com.ruoyi.order.service.IMemberInvoiceService; |
| | | import com.ruoyi.order.service.IOrderAuctionService; |
| | | import com.ruoyi.order.service.IOrderService; |
| | | import com.ruoyi.system.api.domain.GoodsSeckill; |
| | | import com.ruoyi.system.api.domain.GoodsSku; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import com.ruoyi.system.api.domain.Order; |
| | | import com.ruoyi.system.api.domain.dto.MemberDTO; |
| | | import com.ruoyi.system.api.feignClient.GoodsSkuClient; |
| | | import com.ruoyi.system.api.feignClient.MemberClient; |
| | | import io.seata.common.util.StringUtils; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Resource |
| | | private IOrderAuctionService iOrderAuctionService; |
| | | |
| | | @Resource |
| | | private MemberClient memberClient; |
| | | @Override |
| | | public void saveMemberInvoice(MemberInvoiceDTO memberInvoiceDTO) { |
| | | MemberInvoice memberInvoice =new MemberInvoice(); |
| | |
| | | Page<MemberInvoice> page1 = this.page(page, wrapper); |
| | | return PageDTO.of(page1); |
| | | } |
| | | |
| | | @Override |
| | | public PageDTO<MgtMemberInvoicingVO> getMemberInvoicingPage(MgtMemberInvoicingQuery query) { |
| | | Page<MemberInvoice> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | Set<Long> memberIdSet = null; |
| | | if (StringUtils.isNotBlank(query.getNickname()) || StringUtils.isNotBlank( |
| | | query.getPhone())) { |
| | | MemberDTO memberDTO = new MemberDTO(); |
| | | memberDTO.setNickname(query.getNickname()); |
| | | memberDTO.setPhone(query.getPhone()); |
| | | List<Member> memberList = memberClient.getMemberListByCondition(memberDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | if (memberList.isEmpty()) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | memberIdSet = memberList.stream().map(Member::getId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | } |
| | | page = this.lambdaQuery() |
| | | .in(com.ruoyi.common.core.utils.StringUtils.isNotEmpty(memberIdSet), |
| | | MemberInvoice::getMemberId, memberIdSet) |
| | | .eq(query.getInvoiceStatus() != null, MemberInvoice::getInvoiceStatus, |
| | | query.getInvoiceStatus()).page(page); |
| | | if (page.getRecords().isEmpty()) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | PageDTO<MgtMemberInvoicingVO> pageVO = PageDTO.of(page, |
| | | MgtMemberInvoicingVO.class); |
| | | Set<Long> memberSet = pageVO.getList().stream().map(MgtMemberInvoicingVO::getMemberId) |
| | | .collect(Collectors.toSet()); |
| | | List<Member> memberList = memberClient.getMemberListByIds(memberSet, |
| | | SecurityConstants.INNER).getData(); |
| | | Map<Long, Member> memberMap = memberList.stream() |
| | | .collect(Collectors.toMap(Member::getId, member -> member)); |
| | | pageVO.getList().forEach(vo -> { |
| | | Member member = memberMap.get(vo.getMemberId()); |
| | | if (member != null) { |
| | | vo.setNickname(member.getNickname()); |
| | | vo.setPhone(member.getPhone()); |
| | | } |
| | | }); |
| | | return pageVO; |
| | | } |
| | | } |
| | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public void updateOrderAuctionBondStatus(List<Long> ids, BondStatusEnum bondStatusEnum) { |
| | | this.lambdaUpdate().set(OrderAuctionBond::getBoundStatus, bondStatusEnum) |
| | | .in(OrderAuctionBond::getId, ids).update(); |
| | | for (Long id:ids){ |
| | | OrderAuctionBond byId = this.getById(id); |
| | | byId.setBoundStatus(bondStatusEnum); |
| | | this.updateById(byId); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public PayInfoVO SaveOrderAuctionBond(MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO) { |
| | | PayInfoVO payInfoVO = new PayInfoVO(); |
| | | if (memberAuctionSalesroomBondDTO.getBondType() == 2) { |
| | | AuctionSalesroom data = auctionClient.getauctionSalesroomOne(memberAuctionSalesroomBondDTO.getAuctionSalesroomId(), SecurityConstants.INNER).getData(); |
| | | AuctionSalesroom data = auctionClient.getauctionSalesroomOne(memberAuctionSalesroomBondDTO, SecurityConstants.INNER).getData(); |
| | | if (data.getBond().intValue() == 0) { |
| | | OrderAuctionBond orderAuctionBond = new OrderAuctionBond(); |
| | | orderAuctionBond.setOrderNo(OrderUtil.getOrderNoForPrefix("BO")); |
| | |
| | | payInfoVO.setBody("保证金"); |
| | | } |
| | | } else { |
| | | AuctionGoods data = auctionClient.getauctionGoodsOne(memberAuctionSalesroomBondDTO.getAuctionGoodsId(), SecurityConstants.INNER).getData(); |
| | | AuctionGoods data = auctionClient.getauctionGoodsOne(memberAuctionSalesroomBondDTO, SecurityConstants.INNER).getData(); |
| | | if (data.getBond().intValue() == 0) { |
| | | OrderAuctionBond orderAuctionBond = new OrderAuctionBond(); |
| | | orderAuctionBond.setOrderNo(OrderUtil.getOrderNoForPrefix("BO")); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | | import com.ruoyi.common.core.enums.PaymentMethodEnum; |
| | | import com.ruoyi.common.core.enums.RequestTypeEnum; |
| | | import com.ruoyi.common.core.enums.ReturnRequestStatusEnum; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderReturnRequestQuery; |
| | | import com.ruoyi.order.controller.management.dto.MgtReturnRequestAuditDTO; |
| | | import com.ruoyi.order.controller.management.vo.MgtOrderReturnRequestVO; |
| | | import com.ruoyi.order.domain.OrderReturnRequest; |
| | | import com.ruoyi.order.domain.Paylog; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.mapper.OrderReturnRequestMapper; |
| | | import com.ruoyi.order.service.IOrderReturnRequestService; |
| | | import com.ruoyi.order.util.SinataUtil; |
| | | import com.ruoyi.system.api.domain.CustomConfig; |
| | | import com.ruoyi.system.api.domain.GoodsCategory; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import com.ruoyi.system.api.domain.Order; |
| | | import com.ruoyi.system.api.domain.dto.LogisticsDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderReturnDTO; |
| | | import com.ruoyi.system.api.domain.vo.Express100VO; |
| | | import com.ruoyi.system.api.domain.vo.OrderReturnVO; |
| | | import com.ruoyi.system.api.feignClient.MemberClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.util.HuaWeiOBSUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.function.Function; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Resource |
| | | private OrderMapper orderMapper; |
| | | |
| | | @Resource |
| | | private MemberClient memberClient; |
| | | @Resource |
| | | private LogisticsServiceImpl logisticsService; |
| | | @Resource |
| | | private PaylogServiceImpl paylogService; |
| | | @Override |
| | | public void saveOrderReturnRequest(OrderReturnDTO OrderReturnDTO) { |
| | | |
| | |
| | | OrderReturnVO orderReturnVO = BeanUtils.copyBean(one, OrderReturnVO.class); |
| | | return orderReturnVO; |
| | | } |
| | | |
| | | /** |
| | | * 获取售后管理列表分页数据 |
| | | * |
| | | * @param query 售后管理查询对象 |
| | | * @return PageDTO<MgtOrderReturnRequestVO> |
| | | */ |
| | | @Override |
| | | public PageDTO<MgtOrderReturnRequestVO> getOrderReturnRequestPage( |
| | | MgtOrderReturnRequestQuery query) { |
| | | Set<Long> memberIdSet; |
| | | Page<MgtOrderReturnRequestVO> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | if (StringUtils.isNotBlank(query.getNickname()) || StringUtils.isNotBlank( |
| | | query.getPhone())) { |
| | | MemberDTO memberDTO = new MemberDTO(); |
| | | memberDTO.setNickname(query.getNickname()); |
| | | memberDTO.setPhone(query.getPhone()); |
| | | List<Member> memberList = memberClient.getMemberListByCondition(memberDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isEmpty(memberList)) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | memberIdSet = memberList.stream().map(Member::getId) |
| | | .collect(Collectors.toSet()); |
| | | } |
| | | page = baseMapper.getOrderReturnRequestPage(page, query); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | Set<Long> memIdSet = page.getRecords().stream().map(MgtOrderReturnRequestVO::getMemberId) |
| | | .collect(Collectors.toSet()); |
| | | List<Member> members = memberClient.getMemberListByIds(memIdSet, SecurityConstants.INNER) |
| | | .getData(); |
| | | Map<Long, Member> memberMap = members.stream() |
| | | .collect(Collectors.toMap(Member::getId, Function.identity())); |
| | | page.getRecords().forEach(item -> { |
| | | Member member = memberMap.get(item.getMemberId()); |
| | | if (StringUtils.isNotNull(member)) { |
| | | item.setNickname(member.getNickname()); |
| | | item.setPhone(member.getPhone()); |
| | | } |
| | | }); |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * |
| | | * @param id 售后id |
| | | * @return MgtOrderReturnRequestVO |
| | | */ |
| | | @Override |
| | | public MgtOrderReturnRequestVO getOrderReturnRequestDetail(Long id) { |
| | | MgtOrderReturnRequestVO returnRequestVO = baseMapper.getOrderReturnRequestDetail(id); |
| | | // 远程调用member服务,获取会员信息 |
| | | Member member = memberClient.getMembeOne(returnRequestVO.getMemberId(), |
| | | SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isNotNull(member)) { |
| | | returnRequestVO.setNickname(member.getNickname()); |
| | | returnRequestVO.setPhone(member.getPhone()); |
| | | } |
| | | if (returnRequestVO.getRequestType() == RequestTypeEnum.REFUNDS_AND_RETURNS |
| | | && returnRequestVO.getStatus() |
| | | == ReturnRequestStatusEnum.TO_BE_RECEIVED_BY_THE_PLATFORM |
| | | && returnRequestVO.getAuditStatus() == AuditStatusEnum.PASSED) { |
| | | LogisticsDTO logisticsDTO = new LogisticsDTO(); |
| | | logisticsDTO.setCompany(returnRequestVO.getLogisticsNum()); |
| | | logisticsDTO.setPostid(returnRequestVO.getCourierNumber()); |
| | | Express100VO logisticsList = logisticsService.getLogisticsList(logisticsDTO); |
| | | if (StringUtils.isNotNull(logisticsList)) { |
| | | returnRequestVO.setExpress100VO(logisticsList); |
| | | } |
| | | } |
| | | return returnRequestVO; |
| | | } |
| | | |
| | | /** |
| | | * 审核 |
| | | * |
| | | * @param dto 管理后台-售后审核传输对象 |
| | | */ |
| | | @Override |
| | | public void auditReturnRequest(MgtReturnRequestAuditDTO dto) { |
| | | OrderReturnRequest orderReturnRequest = getOrderReturnRequest(dto.getId()); |
| | | if (orderReturnRequest.getAuditStatus() != AuditStatusEnum.TO_BE_REVIEWED) { |
| | | throw new ServiceException("该售后已被审核"); |
| | | } |
| | | if (dto.getAuditStatus() == AuditStatusEnum.PASSED) { |
| | | orderReturnRequest.setStatus(ReturnRequestStatusEnum.TO_BE_RETURNED); |
| | | orderReturnRequest.setAuditStatus(AuditStatusEnum.PASSED); |
| | | } else { |
| | | orderReturnRequest.setStatus(ReturnRequestStatusEnum.REJECTED); |
| | | orderReturnRequest.setAuditStatus(AuditStatusEnum.REJECTED); |
| | | orderReturnRequest.setRefuseReason(dto.getRefuseComment()); |
| | | } |
| | | this.updateById(orderReturnRequest); |
| | | } |
| | | |
| | | private OrderReturnRequest getOrderReturnRequest(Long id) { |
| | | OrderReturnRequest orderReturnRequest = this.getById(id); |
| | | if (StringUtils.isNull(orderReturnRequest)) { |
| | | throw new ServiceException("售后不存在"); |
| | | } |
| | | return orderReturnRequest; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void confirmReturnRequest(Long id) { |
| | | OrderReturnRequest orderReturnRequest = getOrderReturnRequest(id); |
| | | if (orderReturnRequest.getStatus() |
| | | != ReturnRequestStatusEnum.TO_BE_RECEIVED_BY_THE_PLATFORM |
| | | || orderReturnRequest.getAuditStatus() != AuditStatusEnum.PASSED) { |
| | | throw new ServiceException("该售后状态不允许确认收货"); |
| | | } |
| | | orderReturnRequest.setStatus(ReturnRequestStatusEnum.COMPLETED); |
| | | orderReturnRequest.setPlatformReceiptTime(LocalDateTime.now()); |
| | | this.updateById(orderReturnRequest); |
| | | // 退款 |
| | | Order order = orderMapper.selectById(orderReturnRequest.getOrderId()); |
| | | |
| | | if (StringUtils.isNull(order)) { |
| | | throw new ServiceException("订单不存在"); |
| | | } |
| | | String orderNo = order.getOrderNo(); |
| | | Paylog paylog = paylogService.lambdaQuery().eq(Paylog::getOutTradeNo, orderNo) |
| | | .last("limit 1").one(); |
| | | PaymentMethodEnum paymentMethod = order.getPaymentMethod(); |
| | | if (StringUtils.isNotNull(paylog)) { |
| | | boolean result = handleRefund(paymentMethod, paylog, orderNo); |
| | | if (result) { |
| | | paylog.setState(3);// 已退款 |
| | | order.setOrderStatus(OrderStatusEnum.REFUNDED); |
| | | paylogService.updateById(paylog); |
| | | orderMapper.updateById(order); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private boolean handleRefund(PaymentMethodEnum paymentMethod, Paylog paylog, String orderNo) { |
| | | boolean result = false; |
| | | if (paymentMethod == PaymentMethodEnum.WECHAT) { |
| | | String refundMoney = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100D); |
| | | int refundFee = Integer.parseInt( |
| | | refundMoney.substring(0, refundMoney.length() - 3)); |
| | | String money = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100D); |
| | | Integer totalFee = Integer.parseInt(money.substring(0, money.length() - 3)); |
| | | String regEx = "[^0-9]"; |
| | | Pattern p = Pattern.compile(regEx); |
| | | Matcher m = p.matcher(orderNo); |
| | | String ma = m.replaceAll("").trim(); |
| | | result = paylogService.refundForWxpay(2, paylog.getTradeNo(), |
| | | paylog.getOutTradeNo(), "R" + ma, totalFee, refundFee, "4"); |
| | | } else if (paymentMethod == PaymentMethodEnum.ALIPAY) { |
| | | result = paylogService.refundForAlipay(paylog.getOutTradeNo(), paylog.getTradeNo(), |
| | | paylog.getPayMoney()); |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.enums.AuctionOrderTypeEnum; |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import com.ruoyi.common.core.enums.BondStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderFromEnum; |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderTypeEnum; |
| | | import com.ruoyi.common.core.enums.PaymentMethodEnum; |
| | | import com.ruoyi.common.core.enums.RequestTypeEnum; |
| | | import com.ruoyi.common.core.enums.ReturnRequestStatusEnum; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderConfirmShipmentDTO; |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderQuery; |
| | | import com.ruoyi.order.controller.management.vo.MgtOrderReturnRequestVO; |
| | | import com.ruoyi.order.controller.management.vo.MgtOrderVO; |
| | | import com.ruoyi.order.domain.OrderReturnRequest; |
| | | import com.ruoyi.order.domain.Paylog; |
| | | import com.ruoyi.order.mapper.OrderAuctionBondMapper; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.service.ILogisticsService; |
| | | import com.ruoyi.order.service.IOrderReturnRequestService; |
| | | import com.ruoyi.order.service.IOrderService; |
| | | import com.ruoyi.order.service.IPaylogService; |
| | | import com.ruoyi.order.util.OrderUtil; |
| | | import com.ruoyi.order.util.SinataUtil; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import com.ruoyi.system.api.domain.CouponMember; |
| | | import com.ruoyi.system.api.domain.CustomConfig; |
| | | import com.ruoyi.system.api.domain.GoodsGroupPurchase; |
| | | import com.ruoyi.system.api.domain.GoodsSeckill; |
| | | import com.ruoyi.system.api.domain.GoodsSku; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import com.ruoyi.system.api.domain.MemberAddress; |
| | | import com.ruoyi.system.api.domain.Order; |
| | | import com.ruoyi.system.api.domain.OrderAuctionBond; |
| | | import com.ruoyi.system.api.domain.dto.CouponMemberDTO; |
| | | import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO; |
| | | import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO; |
| | | import com.ruoyi.system.api.domain.dto.LogisticsDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberOrderDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberOrderListDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import com.ruoyi.system.api.domain.dto.updMembeOneDTO; |
| | | import com.ruoyi.system.api.domain.vo.MemberOrderListVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberTiOrderVO; |
| | | import com.ruoyi.system.api.domain.vo.OrderVO; |
| | | import com.ruoyi.system.api.domain.vo.*; |
| | | import com.ruoyi.system.api.feignClient.AuctionClient; |
| | | import com.ruoyi.system.api.feignClient.GoodsSkuClient; |
| | | import com.ruoyi.system.api.feignClient.MemberClient; |
| | | import com.ruoyi.system.api.feignClient.PromotionClient; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.function.Function; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import org.apache.commons.beanutils.BeanUtils; |
| | | import lombok.Synchronized; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | @Resource |
| | | private IOrderReturnRequestService orderReturnRequestService; |
| | | |
| | | @Resource |
| | | private RedissonClient redissonClient; |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | @Resource |
| | | private ILogisticsService logisticsService; |
| | | |
| | | @Resource |
| | | private AuctionClient auctionClient; |
| | | |
| | | @Resource |
| | | private GoodsSkuClient GoodsSkuClient; |
| | | |
| | | |
| | | @Override |
| | | public void saveOrderOne(OrderDTO OrderDTO) { |
| | |
| | | } |
| | | order.setOrderTime(OrderDTO.getOrderTime()); |
| | | order.setOrderFrom(OrderDTO.getOrderFrom()); |
| | | order.setAuctionType(OrderDTO.getAuctionType()); |
| | | order.setAuctionOrderType(OrderDTO.getAuctionType()); |
| | | order.setGoodsSkuId(OrderDTO.getGoodsSkuId()); |
| | | order.setMemberId(OrderDTO.getMemberId()); |
| | | order.setTotalAmount(OrderDTO.getTotalAmount()); |
| | |
| | | order.setPoints(OrderDTO.getPoints()); |
| | | order.setGoodsQuantity(OrderDTO.getGoodsQuantity()); |
| | | order.setReceiverName(OrderDTO.getReceiverName()); |
| | | order.setReceiverphone(OrderDTO.getReceiverphone()); |
| | | order.setReceiverPhone(OrderDTO.getReceiverphone()); |
| | | order.setReceiverCity(OrderDTO.getReceiverCity()); |
| | | order.setReceiverDetailAddress(OrderDTO.getReceiverDetailAddress()); |
| | | order.setBound(OrderDTO.getBound()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Synchronized |
| | | public MemberTiOrderVO saveMemberOrder(MemberOrderDTO memberOrderDTO) { |
| | | |
| | | MemberTiOrderVO memberOrderVO=new MemberTiOrderVO(); |
| | |
| | | pice=goodsSku.getPrice(); |
| | | } |
| | | if (memberOrderDTO.getOrderFrom()==2){ |
| | | order.setOrderFrom(OrderFromEnum.SNAP_ORDERS); |
| | | GoodsSeckill data = goodsSkuClient.getGoodsSeckillOne(memberOrderDTO.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | /* String goodsLock = "goods_lock_" + CacheConstants.SECKILL_GOODS + data.getId(); |
| | | RLock redissonLock = redissonClient.getLock(goodsLock); |
| | | Integer surpNum = 0; |
| | | try { |
| | | redissonLock.lock(30, TimeUnit.SECONDS); |
| | | surpNum = redisService.getCacheObject(CacheConstants.SECKILL_GOODS + data.getId()); |
| | | if (surpNum == null || surpNum < memberOrderDTO.getGoodsQuantity()) { |
| | | throw new ServiceException("商品已被抢完"); |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | throw new ServiceException("reids 出错"); |
| | | }*/ |
| | | order.setOrderFrom(OrderFromEnum.SNAP_ORDERS); |
| | | |
| | | GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(data.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | memberOrderVO.setGoodsSkuId(memberOrderDTO.getGoodsSkuId()); |
| | | memberOrderVO.setPrice(goodsSku.getPrice()); |
| | | memberOrderVO.setPrice(data.getSeckillPrice()); |
| | | memberOrderVO.setSjPrice(goodsSku.getPrice()); |
| | | memberOrderVO.setCoverPic(goodsSku.getCoverPic()); |
| | | memberOrderVO.setSkuName(goodsSku.getSkuName()); |
| | | memberOrderVO.setYouhiPrice(data.getSeckillPrice()); |
| | |
| | | order.setSkuName(goodsSku.getSkuName()); |
| | | order.setPrice(data.getSeckillPrice()); |
| | | order.setCoverPic(goodsSku.getCoverPic()); |
| | | |
| | | order.setSjPrice(goodsSku.getPrice()); |
| | | /*redisService.setCacheObject(CacheConstants.SECKILL_GOODS + data.getId(), surpNum - memberOrderDTO.getGoodsQuantity());*/ |
| | | } |
| | | if (memberOrderDTO.getOrderFrom()==3){ |
| | | order.setOrderFrom(OrderFromEnum.GROUP_PURCHASE_ORDERS); |
| | | GoodsGroupPurchase data = goodsSkuClient.getGoodsSeckiGoodsGroupPurchaseOne(memberOrderDTO.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(data.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | memberOrderVO.setGoodsSkuId(memberOrderDTO.getGoodsSkuId()); |
| | | memberOrderVO.setPrice(goodsSku.getPrice()); |
| | | memberOrderVO.setPrice(data.getGroupPurchasePrice()); |
| | | memberOrderVO.setSjPrice(goodsSku.getPrice()); |
| | | memberOrderVO.setCoverPic(goodsSku.getCoverPic()); |
| | | memberOrderVO.setSkuName(goodsSku.getSkuName()); |
| | | memberOrderVO.setYouhiPrice(data.getGroupPurchasePrice()); |
| | |
| | | order.setSkuName(goodsSku.getSkuName()); |
| | | order.setPrice(data.getGroupPurchasePrice()); |
| | | order.setCoverPic(goodsSku.getCoverPic()); |
| | | order.setSjPrice(goodsSku.getPrice()); |
| | | } |
| | | order.setMemberId(memberOrderDTO.getMemberId()); |
| | | order.setGoodsQuantity(memberOrderDTO.getGoodsQuantity()); |
| | |
| | | order.setReceiverName(memberOrderDTO.getReceiverName()); |
| | | order.setReceiverCity(memberOrderDTO.getReceiverCity()); |
| | | order.setReceiverDetailAddress(memberOrderDTO.getReceiverDetailAddress()); |
| | | order.setReceiverphone(memberOrderDTO.getReceiverphone()); |
| | | order.setReceiverPhone(memberOrderDTO.getReceiverphone()); |
| | | }else{ |
| | | MemberAddress data = memberClient.getMemberAddressOne( |
| | | memberOrderDTO.getMemberId(), SecurityConstants.INNER).getData(); |
| | |
| | | order.setReceiverName(data.getRecipientName()); |
| | | order.setReceiverCity(data.getReceiverCity()); |
| | | order.setReceiverDetailAddress(data.getDetailedAddress()); |
| | | order.setReceiverphone(data.getRecipientPhone()); |
| | | order.setReceiverPhone(data.getRecipientPhone()); |
| | | } |
| | | } |
| | | |
| | |
| | | memberOrderVO.setReceiverName(order.getReceiverName()); |
| | | memberOrderVO.setReceiverCity(order.getReceiverCity()); |
| | | memberOrderVO.setReceiverDetailAddress(order.getReceiverDetailAddress()); |
| | | memberOrderVO.setReceiverphone(order.getReceiverphone()); |
| | | memberOrderVO.setReceiverphone(order.getReceiverPhone()); |
| | | Integer delayTime = 30; |
| | | redisService.setCacheObject(CacheConstants.ORDER_AUTOMATIC_CANCEL + "-" + order.getId(), order.getId() , delayTime.longValue(), TimeUnit.MINUTES); |
| | | |
| | | return memberOrderVO; |
| | | } |
| | |
| | | @Override |
| | | public MemberTiOrderVO updMemberOrder(MemberOrderDTO memberOrderDTO) { |
| | | Order order = baseMapper.selectById(memberOrderDTO.getId()); |
| | | |
| | | MemberTiOrderVO memberOrderVO=new MemberTiOrderVO(); |
| | | if (memberOrderDTO.getReceiverDetailAddress()!=null){ |
| | | order.setReceiverName(memberOrderDTO.getReceiverName()); |
| | | order.setReceiverCity(memberOrderDTO.getReceiverCity()); |
| | | order.setReceiverDetailAddress(memberOrderDTO.getReceiverDetailAddress()); |
| | | order.setReceiverphone(memberOrderDTO.getReceiverphone()); |
| | | order.setReceiverPhone(memberOrderDTO.getReceiverphone()); |
| | | } |
| | | if (memberOrderDTO.getOrderRemark()!=null){ |
| | | order.setOrderRemark(memberOrderDTO.getOrderRemark()); |
| | |
| | | SecurityConstants.INNER); |
| | | |
| | | order.setTotalAmount(goodsSku.getPrice().multiply(new BigDecimal(memberOrderDTO.getGoodsQuantity()))); |
| | | order.setGoodsQuantity(memberOrderDTO.getGoodsQuantity()); |
| | | memberOrderVO.setGoodsSkuId(memberOrderDTO.getGoodsSkuId()); |
| | | memberOrderVO.setPrice(goodsSku.getPrice()); |
| | | memberOrderVO.setCoverPic(goodsSku.getCoverPic()); |
| | |
| | | } |
| | | if (order.getOrderFrom().getCode()==2){ |
| | | MemberOrderDTO memberOrderDTO1=new MemberOrderDTO(); |
| | | memberOrderDTO1.setMemberId(memberOrderDTO.getMemberId()); |
| | | memberOrderDTO1.setGoodsSkuId(memberOrderDTO.getGoodsSkuId()); |
| | | memberOrderDTO1.setMemberId(order.getMemberId()); |
| | | memberOrderDTO1.setGoodsSkuId(order.getGoodsSkuId()); |
| | | Integer num=baseMapper.getSeckillMembers1(memberOrderDTO1); |
| | | GoodsSeckill data = goodsSkuClient.getGoodsSeckillOne(memberOrderDTO.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(memberOrderDTO.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | if (data.getLimitNumber()<=num){ |
| | | Integer num1=num+order.getGoodsQuantity(); |
| | | GoodsSeckill data = goodsSkuClient.getGoodsSeckillOne(order.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(data.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | if (data.getLimitNumber()<=num1){ |
| | | throw new ServiceException("对不起,大于商品购买数"); |
| | | }else{ |
| | | if (data.getSeckillStock()<memberOrderDTO.getGoodsQuantity()){ |
| | | throw new ServiceException("对不起,购买数大于库存"); |
| | | }else{ |
| | | order.setGoodsQuantity(memberOrderDTO.getGoodsQuantity()); |
| | | GoodsStockUpdDTO goodsStockUpdDTO = new GoodsStockUpdDTO(); |
| | | goodsStockUpdDTO.setGoodsSkuId(data.getId()); |
| | | goodsStockUpdDTO.setAuctionStock(data.getSeckillStock()+order.getGoodsQuantity()); |
| | |
| | | goodsStockUpdDTO1.setAuctionStock(data.getSeckillStock()-memberOrderDTO.getGoodsQuantity()); |
| | | goodsSkuClient.updGoodsSeckill(goodsStockUpdDTO,SecurityConstants.INNER); |
| | | |
| | | order.setTotalAmount(data.getSeckillPrice().multiply(new BigDecimal(memberOrderDTO.getGoodsQuantity()))); |
| | | order.setTotalAmount(data.getSeckillPrice().multiply(new BigDecimal(memberOrderDTO.getGoodsQuantity()))); |
| | | order.setGoodsQuantity(memberOrderDTO.getGoodsQuantity()); |
| | | order.setSkuName(goodsSku.getSkuName()); |
| | | order.setPrice(data.getSeckillPrice()); |
| | | order.setCoverPic(goodsSku.getCoverPic()); |
| | | order.setSjPrice(goodsSku.getPrice()); |
| | | |
| | | } |
| | | } |
| | |
| | | memberOrderVO.setCoverPic(goodsSku.getCoverPic()); |
| | | memberOrderVO.setSkuName(goodsSku.getSkuName()); |
| | | memberOrderVO.setYouhiPrice(data.getSeckillPrice()); |
| | | } |
| | | } |
| | | } if (order.getOrderFrom().getCode()==3){ |
| | | order.setOrderFrom(OrderFromEnum.GROUP_PURCHASE_ORDERS); |
| | | GoodsGroupPurchase data = goodsSkuClient.getGoodsSeckiGoodsGroupPurchaseOne(order.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(data.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | MemberOrderDTO memberOrderDTO1=new MemberOrderDTO(); |
| | | memberOrderDTO1.setMemberId(order.getMemberId()); |
| | | memberOrderDTO1.setGoodsSkuId(order.getGoodsSkuId()); |
| | | Integer num=baseMapper.getGoodsGroupPurchase(memberOrderDTO1); |
| | | Integer num1=num+order.getGoodsQuantity(); |
| | | if (data.getLimitNumber()<=num1){ |
| | | throw new ServiceException("对不起,大于商品购买数"); |
| | | }else{ |
| | | if (data.getLimitNumber()<memberOrderDTO.getGoodsQuantity()){ |
| | | throw new ServiceException("对不起,购买数大于库存"); |
| | | }else{ |
| | | memberOrderVO.setGoodsSkuId(memberOrderDTO.getGoodsSkuId()); |
| | | memberOrderVO.setPrice(data.getGroupPurchasePrice()); |
| | | memberOrderVO.setSjPrice(goodsSku.getPrice()); |
| | | memberOrderVO.setCoverPic(goodsSku.getCoverPic()); |
| | | memberOrderVO.setSkuName(goodsSku.getSkuName()); |
| | | memberOrderVO.setYouhiPrice(data.getGroupPurchasePrice()); |
| | | order.setGoodsQuantity(memberOrderDTO.getGoodsQuantity()); |
| | | order.setSkuName(goodsSku.getSkuName()); |
| | | order.setPrice(data.getGroupPurchasePrice()); |
| | | order.setCoverPic(goodsSku.getCoverPic()); |
| | | order.setSjPrice(goodsSku.getPrice()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | BigDecimal pice=order.getPrice().multiply(new BigDecimal(memberOrderDTO.getGoodsQuantity())); |
| | | if (memberOrderDTO.getCouponId()!=null){ |
| | | CouponMemberDTO couponMemberDTO=new CouponMemberDTO(); |
| | | couponMemberDTO.setId(memberOrderDTO.getCouponId()); |
| | |
| | | promotionClient.updCouponMember(couponMemberDTO1, SecurityConstants.INNER); |
| | | } |
| | | |
| | | BigDecimal pice=new BigDecimal(0); |
| | | |
| | | if (data.getCouponType().getCode()==1){ |
| | | pice= order.getTotalAmount(); |
| | | if (pice.doubleValue()>=data.getFullReductionAmount().doubleValue()){ |
| | | pice.subtract(data.getReductionAmount()); |
| | | order.setDiscountMoney(data.getReductionAmount()); |
| | |
| | | couponMemberDTO2.setCouponStatus(2); |
| | | promotionClient.updCouponMember(couponMemberDTO2, SecurityConstants.INNER); |
| | | |
| | | order.setTotalAmount(pice); |
| | | |
| | | CustomConfig memberPointsMoney = sysUserClient.getconfig("MEMBER_POINTS_MONEY").getData(); |
| | | CustomConfig memberPointsPoints = sysUserClient.getconfig("MEMBER_POINTS_POINTS").getData(); |
| | | |
| | | BigDecimal pic=pice.multiply(new BigDecimal(memberOrderDTO.getGoodsQuantity())); |
| | | Double aDouble= Double.valueOf(memberPointsMoney.getConfigValue()) * Double.valueOf(memberPointsPoints.getConfigValue()); |
| | | BigDecimal pi=pic.multiply(new BigDecimal(aDouble)); |
| | | order.setPoints(pi.intValue()); |
| | | |
| | | } |
| | | order.setTotalAmount(pice); |
| | | |
| | | CustomConfig memberPointsMoney = sysUserClient.getconfig("MEMBER_POINTS_MONEY").getData(); |
| | | CustomConfig memberPointsPoints = sysUserClient.getconfig("MEMBER_POINTS_POINTS").getData(); |
| | | |
| | | Double aDouble= Double.valueOf(memberPointsMoney.getConfigValue()) * Double.valueOf(memberPointsPoints.getConfigValue()); |
| | | BigDecimal pi=pice.multiply(new BigDecimal(aDouble)); |
| | | order.setPoints(pi.intValue()); |
| | | baseMapper.updateById(order); |
| | | |
| | | memberOrderVO.setId(order.getId()); |
| | |
| | | memberOrderVO.setReceiverName(order.getReceiverName()); |
| | | memberOrderVO.setReceiverCity(order.getReceiverCity()); |
| | | memberOrderVO.setReceiverDetailAddress(order.getReceiverDetailAddress()); |
| | | memberOrderVO.setReceiverphone(order.getReceiverphone()); |
| | | memberOrderVO.setReceiverphone(order.getReceiverPhone()); |
| | | memberOrderVO.setYouhiPrice(order.getDiscountMoney()); |
| | | |
| | | return memberOrderVO; |
| | |
| | | Page<Order> page = new Page<>(memberOrderListDTO.getPageCurr(), memberOrderListDTO.getPageSize()); |
| | | LambdaQueryWrapper<Order> wrapper= Wrappers.lambdaQuery(); |
| | | wrapper.eq(Order::getMemberId,memberOrderListDTO.getMemberId()); |
| | | wrapper.like(Order::getSkuName,memberOrderListDTO.getGoodsSkuName()); |
| | | wrapper.like(Order::getOrderNo,memberOrderListDTO.getOrderNo()); |
| | | wrapper.eq(Order::getOrderStatus,memberOrderListDTO.getOrderStatus()); |
| | | if(memberOrderListDTO.getGoodsSkuName()!=null){ |
| | | wrapper.like(Order::getSkuName,memberOrderListDTO.getGoodsSkuName()); |
| | | } |
| | | if(memberOrderListDTO.getOrderNo()!=null){ |
| | | wrapper.like(Order::getOrderNo,memberOrderListDTO.getOrderNo()); |
| | | } |
| | | if(memberOrderListDTO.getOrderStatus()!=null){ |
| | | wrapper.eq(Order::getOrderStatus,memberOrderListDTO.getOrderStatus().getCode()-1); |
| | | } |
| | | wrapper.eq(Order::getDelFlag,0); |
| | | wrapper.orderByDesc(Order::getCancelTime); |
| | | Page<Order> page1 = this.page(page, wrapper); |
| | | |
| | | PageDTO<MemberOrderListVO> memberOrderListVOPageDTO = PageDTO.of(page1, MemberOrderListVO.class); |
| | | List<MemberOrderListVO> list = memberOrderListVOPageDTO.getList(); |
| | | for (MemberOrderListVO MemberOrderList:list){ |
| | | OrderReturnRequest orderReturnRequest = orderReturnRequestService.getOne( |
| | | Wrappers.lambdaQuery(OrderReturnRequest.class) |
| | | .eq(OrderReturnRequest::getOrderId, |
| | | MemberOrderList.getId()).last("limit 1")); |
| | | if (StringUtils.isNotNull(orderReturnRequest)) { |
| | | MemberOrderList.setStatus(orderReturnRequest.getStatus()); |
| | | } |
| | | LambdaQueryWrapper<OrderAuctionBond> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(OrderAuctionBond::getOrderId,MemberOrderList.getId()); |
| | | OrderAuctionBond orderAuctionBond = orderAuctionBondMapper.selectOne(wrapper3); |
| | | if (orderAuctionBond!=null){ |
| | | if (orderAuctionBond.getBoundStatus().getCode()==1||orderAuctionBond.getBoundStatus().getCode()==2){ |
| | | MemberOrderList.setIsAuctionBond(1); |
| | | }else{ |
| | | MemberOrderList.setIsAuctionBond(2); |
| | | } |
| | | }else { |
| | | MemberOrderList.setIsAuctionBond(1); |
| | | } |
| | | } |
| | | |
| | | |
| | | return memberOrderListVOPageDTO; |
| | | } |
| | | |
| | |
| | | Order order = baseMapper.selectById(memberOrderListDTO.getId()); |
| | | OrderVO orderVO=new OrderVO(); |
| | | try { |
| | | BeanUtils.copyProperties(orderVO,order); |
| | | orderVO = BeanUtils.copyBean(order, OrderVO.class); |
| | | if (orderVO.getOrderFrom().getCode()==3){ |
| | | GoodsGroupPurchase data = GoodsSkuClient.getGoodsSeckiGoodsGroupPurchaseOne(order.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | orderVO.setGroupTime(data.getGroupTime()); |
| | | } |
| | | |
| | | OrderReturnRequest orderReturnRequest = orderReturnRequestService.getOne( |
| | | Wrappers.lambdaQuery(OrderReturnRequest.class) |
| | | .eq(OrderReturnRequest::getOrderId, |
| | | orderVO.getId()).last("limit 1")); |
| | | if (StringUtils.isNotNull(orderReturnRequest)) { |
| | | orderVO.setStatus(orderReturnRequest.getStatus()); |
| | | } |
| | | |
| | | LambdaQueryWrapper<OrderAuctionBond> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(OrderAuctionBond::getOrderId,order.getId()); |
| | | OrderAuctionBond orderAuctionBond = orderAuctionBondMapper.selectOne(wrapper3); |
| | | if (orderAuctionBond!=null){ |
| | | if (orderAuctionBond.getBoundStatus().getCode()==1||orderAuctionBond.getBoundStatus().getCode()==2){ |
| | | orderVO.setIsAuctionBond(1); |
| | | }else{ |
| | | orderVO.setIsAuctionBond(2); |
| | | } |
| | | }else { |
| | | orderVO.setIsAuctionBond(1); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | @Override |
| | | public void CancelOrderOne(MemberOrderListDTO memberOrderListDTO) { |
| | | Order order = baseMapper.selectById(memberOrderListDTO.getId()); |
| | | if (order.getOrderStatus().getCode()==1){ |
| | | if (order.getOrderStatus().getCode() == 1) { |
| | | order.setOrderStatus(OrderStatusEnum.CANCELED); |
| | | order.setCancelTime(LocalDateTime.now()); |
| | | baseMapper.updateById(order); |
| | | } |
| | | if (order.getOrderStatus().getCode()==2) { |
| | | if (order.getOrderStatus().getCode() == 2) { |
| | | order.setOrderStatus(OrderStatusEnum.CANCELED); |
| | | order.setCancelTime(LocalDateTime.now()); |
| | | baseMapper.updateById(order); |
| | | |
| | | updMembeOneDTO MembeOneDTO=new updMembeOneDTO(); |
| | | updMembeOneDTO MembeOneDTO = new updMembeOneDTO(); |
| | | MembeOneDTO.setType(2); |
| | | MembeOneDTO.setMemberId(order.getMemberId()); |
| | | MembeOneDTO.setMoney(order.getTotalAmount()); |
| | |
| | | LambdaQueryWrapper<Paylog> paylogEntityWrapper = Wrappers.lambdaQuery(); |
| | | paylogEntityWrapper.eq(Paylog::getOutTradeNo, order.getOrderNo()); |
| | | Paylog paylog = iPaylogService.getOne(paylogEntityWrapper); |
| | | boolean bo = paylogService.refundForAlipay(paylog.getOutTradeNo(), paylog.getTradeNo(), paylog.getPayMoney()); |
| | | if (!bo) { |
| | | System.out.println("支付宝退款失败"); |
| | | if (paylog != null) { |
| | | boolean bo = paylogService.refundForAlipay(paylog.getOutTradeNo(), paylog.getTradeNo(), paylog.getPayMoney()); |
| | | if (!bo) { |
| | | System.out.println("支付宝退款失败"); |
| | | } |
| | | } |
| | | |
| | | } else if (order.getPaymentMethod() != null && order.getPaymentMethod().getCode() == 2) {//微信 |
| | | //获取支付信息 |
| | | LambdaQueryWrapper<Paylog> paylogEntityWrapper = Wrappers.lambdaQuery(); |
| | | paylogEntityWrapper.eq(Paylog::getOutTradeNo, order.getOrderNo()); |
| | | Paylog paylog = iPaylogService.getOne(paylogEntityWrapper); |
| | | if (paylog != null) { |
| | | String refundMoney = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100d); |
| | | Integer refundFee = Integer.parseInt(refundMoney.substring(0, refundMoney.length() - 3)); |
| | | String money = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100d); |
| | | Integer totalFee = Integer.parseInt(money.substring(0, money.length() - 3)); |
| | | refundFee = 1; |
| | | |
| | | String refundMoney = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100d); |
| | | Integer refundFee = Integer.parseInt(refundMoney.substring(0, refundMoney.length() - 3)); |
| | | String money = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100d); |
| | | Integer totalFee = Integer.parseInt(money.substring(0, money.length() - 3)); |
| | | refundFee = 1; |
| | | String regEx = "[^0-9]"; |
| | | Pattern p = Pattern.compile(regEx); |
| | | Matcher m = p.matcher(order.getOrderNo()); |
| | | String ma = m.replaceAll("").trim(); |
| | | boolean bo = paylogService.refundForWxpay(4, paylog.getTradeNo(), paylog.getOutTradeNo(), "R" + ma, totalFee, refundFee, "2"); |
| | | if (!bo) { |
| | | System.out.println("微信退款失败"); |
| | | } |
| | | |
| | | String regEx = "[^0-9]"; |
| | | Pattern p = Pattern.compile(regEx); |
| | | Matcher m = p.matcher(order.getOrderNo()); |
| | | String ma = m.replaceAll("").trim(); |
| | | boolean bo = paylogService.refundForWxpay(4, paylog.getTradeNo(), paylog.getOutTradeNo(), "R" + ma, totalFee, refundFee, "2"); |
| | | if (!bo) { |
| | | System.out.println("微信退款失败"); |
| | | } |
| | | } |
| | | }} |
| | | |
| | | } |
| | | } |
| | | @Override |
| | | public void AffirmOrderOne(MemberOrderListDTO memberOrderListDTO) { |
| | | Order order = baseMapper.selectById(memberOrderListDTO.getId()); |
| | |
| | | Integer totalFee = Integer.parseInt(money.substring(0, money.length() - 3)); |
| | | refundFee = 1; |
| | | |
| | | String regEx = "[^0-9]"; |
| | | Pattern p = Pattern.compile(regEx); |
| | | Matcher m = p.matcher(order.getOrderNo()); |
| | | String ma = m.replaceAll("").trim(); |
| | | boolean bo = paylogService.refundForWxpay(4, paylog.getTradeNo(), paylog.getOutTradeNo(), "R" + ma, totalFee, refundFee, "2"); |
| | | if (!bo) { |
| | | System.out.println("微信退款失败"); |
| | | String regEx = "[^0-9]"; |
| | | Pattern p = Pattern.compile(regEx); |
| | | Matcher m = p.matcher(order.getOrderNo()); |
| | | String ma = m.replaceAll("").trim(); |
| | | boolean bo = paylogService.refundForWxpay(4, paylog.getTradeNo(), paylog.getOutTradeNo(), "R" + ma, totalFee, refundFee, "2"); |
| | | if (!bo) { |
| | | System.out.println("微信退款失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | order.setOrderStatus(OrderStatusEnum.FINISHED); |
| | | order.setReceiveTime(LocalDateTime.now()); |
| | | baseMapper.updateById(order); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public MemberOrderNumVO MemberOrderNum(MemberOrderListDTO memberOrderListDTO) { |
| | | MemberOrderNumVO vo=new MemberOrderNumVO(); |
| | | |
| | | LambdaQueryWrapper<Order> paylogEntityWrapper = Wrappers.lambdaQuery(); |
| | | paylogEntityWrapper.eq(Order::getMemberId, memberOrderListDTO.getMemberId()); |
| | | paylogEntityWrapper.eq(Order::getOrderStatus,1); |
| | | List<Order> list = this.list(paylogEntityWrapper); |
| | | vo.setDzforderNo(list.size()); |
| | | |
| | | LambdaQueryWrapper<Order> paylogEntityWrapper1 = Wrappers.lambdaQuery(); |
| | | paylogEntityWrapper1.eq(Order::getMemberId, memberOrderListDTO.getMemberId()); |
| | | paylogEntityWrapper1.eq(Order::getOrderStatus,2); |
| | | List<Order> list1 = this.list(paylogEntityWrapper1); |
| | | vo.setDfhorderNo(list1.size()); |
| | | |
| | | LambdaQueryWrapper<Order> paylogEntityWrapper2 = Wrappers.lambdaQuery(); |
| | | paylogEntityWrapper2.eq(Order::getMemberId, memberOrderListDTO.getMemberId()); |
| | | paylogEntityWrapper2.eq(Order::getOrderStatus,3); |
| | | List<Order> list2 = this.list(paylogEntityWrapper2); |
| | | vo.setDshorderNo(list2.size()); |
| | | |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | |
| | | return this.lambdaQuery().in(Order::getCouponId, couponIds) |
| | | .eq(Order::getOrderStatus, OrderStatusEnum.FINISHED).list(); |
| | | } |
| | | |
| | | /** |
| | | * 商城订单分页列表 |
| | | * |
| | | * @param query 商城订单查询对象 |
| | | * @return PageDTO<MgtMallOrderVO> |
| | | */ |
| | | @Override |
| | | public PageDTO<MgtOrderVO> getOrderPage(MgtOrderQuery query) { |
| | | PageDTO<MgtOrderVO> pageVO; |
| | | // 封装会员条件查询对象 |
| | | MemberDTO memberDTO = null; |
| | | Set<Long> memberIdSet = null; |
| | | Page<Order> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | if (StringUtils.isNotBlank(query.getNickname()) || StringUtils.isNotBlank( |
| | | query.getPhone())) { |
| | | memberDTO = new MemberDTO(); |
| | | memberDTO.setNickname(query.getNickname()); |
| | | memberDTO.setPhone(query.getPhone()); |
| | | } |
| | | if (StringUtils.isNotNull(memberDTO)) { |
| | | // 远程调用会员服务进行条件查询 |
| | | List<Member> memberList = memberClient.getMemberListByCondition(memberDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isEmpty(memberList)) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | memberIdSet = memberList.stream().map(Member::getId) |
| | | .collect(Collectors.toSet()); |
| | | } |
| | | page = this.lambdaQuery() |
| | | .in(StringUtils.isNotEmpty(memberIdSet), Order::getMemberId, memberIdSet) |
| | | .ne(query.getQueryType().equals(OrderTypeEnum.MALL_ODER), Order::getOrderFrom, |
| | | OrderFromEnum.AUCTION_ORDERS) |
| | | .eq(query.getQueryType().equals(OrderTypeEnum.AUCTION_ORDER), Order::getOrderFrom, |
| | | OrderFromEnum.AUCTION_ORDERS) |
| | | .like(StringUtils.isNotBlank(query.getOrderNo()), Order::getOrderNo, |
| | | query.getOrderNo()) |
| | | .eq(StringUtils.isNotNull(query.getOrderFrom()) && query.getQueryType() |
| | | .equals(OrderTypeEnum.MALL_ODER), Order::getOrderFrom, |
| | | query.getOrderFrom()) |
| | | .like(StringUtils.isNotBlank(query.getSkuName()), Order::getSkuName, |
| | | query.getSkuName()) |
| | | .eq(StringUtils.isNotNull(query.getOrderStatus()), Order::getOrderStatus, |
| | | query.getOrderStatus()) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | pageVO = PageDTO.empty(page); |
| | | } |
| | | pageVO = PageDTO.of(page, MgtOrderVO.class); |
| | | if (query.getOrderFrom() == OrderFromEnum.AUCTION_ORDERS) { |
| | | List<MgtOrderVO> list = pageVO.getList(); |
| | | // 封装参数查询拍卖会 |
| | | Set<Long> auctionSalesroomGoodsIdSet = list.stream() |
| | | .filter(order -> order.getAuctionType() == AuctionOrderTypeEnum.AUCTION_ITEMS) |
| | | .map(MgtOrderVO::getGoodsSkuId).collect(Collectors.toSet()); |
| | | List<AuctionSalesroom> auctionSalesroomList = auctionClient.getAuctionSalesroomByIds( |
| | | auctionSalesroomGoodsIdSet, SecurityConstants.INNER) |
| | | .getData(); |
| | | Map<Long, String> salesroomMap = auctionSalesroomList.stream() |
| | | .collect(Collectors.toMap(AuctionSalesroom::getId, |
| | | AuctionSalesroom::getSalesroomName)); |
| | | // 封装参数查询拍卖订单保证金 |
| | | Set<Long> auctionGoodsIdSet = list.stream() |
| | | .filter(order -> order.getAuctionType() == AuctionOrderTypeEnum.REGULAR_ITEMS) |
| | | .map(MgtOrderVO::getGoodsSkuId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | Set<Long> auctionSalesroomSet = auctionSalesroomList.stream() |
| | | .map(AuctionSalesroom::getId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | List<OrderAuctionBond> auctionBondList = orderAuctionBondMapper.selectList( |
| | | Wrappers.lambdaQuery(OrderAuctionBond.class) |
| | | .in(OrderAuctionBond::getAuctionGoodsId, auctionGoodsIdSet) |
| | | .in(OrderAuctionBond::getAuctionSalesroomId, auctionSalesroomSet) |
| | | .eq(OrderAuctionBond::getBoundStatus, |
| | | BondStatusEnum.PAID)); |
| | | Map<String, OrderAuctionBond> auctionSalesroomBondMap = auctionBondList.stream() |
| | | .filter(bond -> bond.getBondType() == AuctionOrderTypeEnum.AUCTION_ITEMS) |
| | | .collect(Collectors.toMap( |
| | | bond -> bond.getAuctionSalesroomId() + "-" + bond.getMemberId(), |
| | | Function.identity())); |
| | | Map<String, OrderAuctionBond> auctionSalesroomGoodsBondMap = auctionBondList.stream() |
| | | .filter(bond -> bond.getBondType() == AuctionOrderTypeEnum.REGULAR_ITEMS) |
| | | .collect(Collectors.toMap( |
| | | bond -> bond.getAuctionGoodsId() + "-" + bond.getMemberId(), |
| | | Function.identity())); |
| | | |
| | | list.forEach(order -> { |
| | | if (order.getAuctionType() == AuctionOrderTypeEnum.AUCTION_ITEMS) { |
| | | order.setSalesroomName( |
| | | StringUtils.isNotBlank(salesroomMap.get(order.getGoodsSkuId())) |
| | | ? salesroomMap.get(order.getAuctionSalesroomId()) : "无"); |
| | | order.setBoundStatus( |
| | | StringUtils.isNotNull(auctionSalesroomBondMap.get( |
| | | order.getAuctionSalesroomId() + "-" + order.getMemberId()) |
| | | .getBoundStatus()) |
| | | ? auctionSalesroomBondMap.get( |
| | | order.getAuctionSalesroomId() + "-" + order.getMemberId()) |
| | | .getBoundStatus() |
| | | : null); |
| | | } |
| | | if (order.getAuctionType() == AuctionOrderTypeEnum.REGULAR_ITEMS) { |
| | | order.setSalesroomName("无"); |
| | | order.setBoundStatus( |
| | | StringUtils.isNotNull(auctionSalesroomGoodsBondMap.get( |
| | | order.getGoodsSkuId() + "-" + order.getMemberId()) |
| | | .getBoundStatus()) |
| | | ? auctionSalesroomGoodsBondMap.get( |
| | | order.getGoodsSkuId() + "-" + order.getMemberId()) |
| | | .getBoundStatus() |
| | | : null); |
| | | } |
| | | }); |
| | | } |
| | | return pageVO; |
| | | } |
| | | |
| | | /** |
| | | * 获取商城订单详情 |
| | | * |
| | | * @param id 订单id |
| | | * @return MgtMallOrderVO |
| | | */ |
| | | @Override |
| | | public MgtOrderVO getOrderDetail(Long id) { |
| | | Order order = this.getById(id); |
| | | MgtOrderVO mgtOrderVO = BeanUtils.copyBean(order, MgtOrderVO.class); |
| | | // 查询用户信息 |
| | | Member member = memberClient.getMembeOne(order.getMemberId(), SecurityConstants.INNER) |
| | | .getData(); |
| | | if (StringUtils.isNotNull(member)) { |
| | | mgtOrderVO.setNickname(member.getNickname()); |
| | | mgtOrderVO.setPhone(member.getPhone()); |
| | | } |
| | | // 拍卖订单查询拍卖会信息 |
| | | if (order.getOrderFrom() == OrderFromEnum.AUCTION_ORDERS && (order.getAuctionOrderType() |
| | | == AuctionOrderTypeEnum.AUCTION_ITEMS)) { |
| | | List<AuctionSalesroom> auctionSalesroom = auctionClient.getAuctionSalesroomByIds( |
| | | Lists.newArrayList(order.getGoodsSkuId()) |
| | | , SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isNotNull(auctionSalesroom)) { |
| | | mgtOrderVO.setSalesroomName(auctionSalesroom.get(0).getSalesroomName()); |
| | | } |
| | | } |
| | | // 查询售后信息 |
| | | if (order.getOrderStatus() == OrderStatusEnum.AFTER_SALE) { |
| | | OrderReturnRequest orderReturnRequest = orderReturnRequestService.getOne( |
| | | Wrappers.lambdaQuery(OrderReturnRequest.class) |
| | | .eq(OrderReturnRequest::getOrderId, |
| | | order.getId()).last("limit 1")); |
| | | if (StringUtils.isNotNull(orderReturnRequest)) { |
| | | mgtOrderVO.setReturnRequestVO(BeanUtils.copyBean(orderReturnRequest, |
| | | MgtOrderReturnRequestVO.class)); |
| | | } |
| | | } |
| | | // 如果订单状态为已发货、已完成、售后, 查询物流信息 |
| | | if (order.getOrderStatus() == OrderStatusEnum.GOODS_TO_BE_RECEIVED |
| | | || order.getOrderStatus() == OrderStatusEnum.FINISHED |
| | | || order.getOrderStatus() == OrderStatusEnum.AFTER_SALE) { |
| | | LogisticsDTO logisticsDTO = new LogisticsDTO(); |
| | | logisticsDTO.setCompany(order.getLogisticsNum()); |
| | | logisticsDTO.setPostid(order.getCourierNumber()); |
| | | Express100VO logisticsList = logisticsService.getLogisticsList(logisticsDTO); |
| | | if (StringUtils.isNotNull(logisticsList)) { |
| | | mgtOrderVO.setExpress100VO(logisticsList); |
| | | } |
| | | } |
| | | if (order.getOrderFrom() == OrderFromEnum.SNAP_ORDERS) { |
| | | GoodsSeckill data = goodsSkuClient.getGoodsSeckillOne(order.getGoodsSkuId(), |
| | | SecurityConstants.INNER).getData(); |
| | | mgtOrderVO.setSeckillPrice(data.getSeckillPrice()); |
| | | } else if (order.getOrderFrom() == OrderFromEnum.GROUP_PURCHASE_ORDERS) { |
| | | GoodsGroupPurchase data = goodsSkuClient.getGoodsSeckiGoodsGroupPurchaseOne( |
| | | order.getGoodsSkuId(), |
| | | SecurityConstants.INNER).getData(); |
| | | mgtOrderVO.setGroupPurchasesPrice(data.getGroupPurchasePrice()); |
| | | } |
| | | return mgtOrderVO; |
| | | } |
| | | |
| | | /** |
| | | * 确认发货 |
| | | * |
| | | * @param dto 确认发货请求对象 |
| | | */ |
| | | @Override |
| | | public void confirmShipmentOrder(MgtOrderConfirmShipmentDTO dto) { |
| | | Order order = getOrder(dto.getId()); |
| | | order.setOrderStatus(OrderStatusEnum.GOODS_TO_BE_RECEIVED); |
| | | order.setDeliveryTime(LocalDateTime.now()); |
| | | order.setCourierNumber(dto.getCourierNumber()); |
| | | order.setLogisticsNum(dto.getLogisticsNum()); |
| | | this.updateById(order); |
| | | } |
| | | |
| | | /** |
| | | * 已收货 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @Override |
| | | public void receivedGoods(Long id) { |
| | | Order order = getOrder(id); |
| | | if (order.getOrderStatus() == OrderStatusEnum.GOODS_TO_BE_RECEIVED) { |
| | | order.setOrderStatus(OrderStatusEnum.FINISHED); |
| | | order.setReceiveTime(LocalDateTime.now()); |
| | | this.updateById(order); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 退款 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @Override |
| | | public void refund(Long id) { |
| | | Order order = getOrder(id); |
| | | String orderNo = order.getOrderNo(); |
| | | Paylog paylog = iPaylogService.lambdaQuery().eq(Paylog::getOutTradeNo, orderNo) |
| | | .last("limit 1").one(); |
| | | PaymentMethodEnum paymentMethod = order.getPaymentMethod(); |
| | | |
| | | if (StringUtils.isNotNull(paylog)) { |
| | | boolean result = handleRefund(paymentMethod, paylog, orderNo); |
| | | if (result) { |
| | | paylog.setState(3);// 已退款 |
| | | order.setOrderStatus(OrderStatusEnum.REFUNDED); |
| | | iPaylogService.updateById(paylog); |
| | | this.updateById(order); |
| | | } |
| | | OrderReturnRequest orderReturnRequest = new OrderReturnRequest(); |
| | | orderReturnRequest.setOrderId(id); |
| | | orderReturnRequest.setRequestTime(LocalDateTime.now()); |
| | | orderReturnRequest.setRequestType(RequestTypeEnum.REFUND); |
| | | orderReturnRequest.setRequestReason("管理后台退款"); |
| | | orderReturnRequest.setStatus(ReturnRequestStatusEnum.COMPLETED); |
| | | orderReturnRequest.setAuditStatus(AuditStatusEnum.PASSED); |
| | | orderReturnRequestService.save(orderReturnRequest); |
| | | } |
| | | } |
| | | |
| | | private boolean handleRefund(PaymentMethodEnum paymentMethod, Paylog paylog, String orderNo) { |
| | | boolean result = false; |
| | | if (paymentMethod == PaymentMethodEnum.WECHAT) { |
| | | String refundMoney = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100D); |
| | | int refundFee = Integer.parseInt( |
| | | refundMoney.substring(0, refundMoney.length() - 3)); |
| | | String money = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100D); |
| | | Integer totalFee = Integer.parseInt(money.substring(0, money.length() - 3)); |
| | | String regEx = "[^0-9]"; |
| | | Pattern p = Pattern.compile(regEx); |
| | | Matcher m = p.matcher(orderNo); |
| | | String ma = m.replaceAll("").trim(); |
| | | result = paylogService.refundForWxpay(2, paylog.getTradeNo(), |
| | | paylog.getOutTradeNo(), "R" + ma, totalFee, refundFee, "4"); |
| | | } else if (paymentMethod == PaymentMethodEnum.ALIPAY) { |
| | | result = paylogService.refundForAlipay(paylog.getOutTradeNo(), paylog.getTradeNo(), |
| | | paylog.getPayMoney()); |
| | | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 退款退货 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @Override |
| | | public void refundReturn(Long id) { |
| | | Order order = getOrder(id); |
| | | if (order.getOrderStatus() == OrderStatusEnum.TO_BE_SHIPPED |
| | | || order.getOrderStatus() == OrderStatusEnum.GOODS_TO_BE_RECEIVED |
| | | || order.getOrderStatus() == OrderStatusEnum.FINISHED) { |
| | | OrderReturnRequest orderReturnRequest = new OrderReturnRequest(); |
| | | order.setOrderStatus(OrderStatusEnum.AFTER_SALE); |
| | | this.updateById(order); |
| | | orderReturnRequest.setOrderId(id); |
| | | orderReturnRequest.setRequestTime(LocalDateTime.now()); |
| | | orderReturnRequest.setRequestType(RequestTypeEnum.REFUNDS_AND_RETURNS); |
| | | orderReturnRequest.setRequestReason("管理后台退款退货"); |
| | | orderReturnRequest.setStatus(ReturnRequestStatusEnum.TO_BE_RETURNED); |
| | | orderReturnRequest.setAuditStatus(AuditStatusEnum.PASSED); |
| | | orderReturnRequestService.save(orderReturnRequest); |
| | | } |
| | | |
| | | } |
| | | |
| | | private Order getOrder(Long id) { |
| | | Order order = this.getById(id); |
| | | if (StringUtils.isNull(order)) { |
| | | throw new ServiceException("订单不存在"); |
| | | } |
| | | return order; |
| | | } |
| | | |
| | | /** |
| | | * 拍卖订单退保证金 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @Override |
| | | public void refundBond(Long id) { |
| | | Order order = getOrder(id); |
| | | OrderAuctionBond orderAuctionBond; |
| | | if (order.getAuctionOrderType() == AuctionOrderTypeEnum.AUCTION_ITEMS) { |
| | | orderAuctionBond = orderAuctionBondMapper.selectOne( |
| | | Wrappers.lambdaQuery(OrderAuctionBond.class) |
| | | .eq(OrderAuctionBond::getAuctionSalesroomId, |
| | | order.getAuctionSalesroomId()) |
| | | .eq(OrderAuctionBond::getBoundStatus, BondStatusEnum.PAID)); |
| | | if (StringUtils.isNotNull(orderAuctionBond) |
| | | && orderAuctionBond.getBoundStatus() == BondStatusEnum.REFUNDED) { |
| | | throw new ServiceException("改拍卖会已退保证金"); |
| | | } |
| | | } else { |
| | | orderAuctionBond = orderAuctionBondMapper.selectOne( |
| | | Wrappers.lambdaQuery(OrderAuctionBond.class) |
| | | .eq(OrderAuctionBond::getAuctionGoodsId, |
| | | order.getGoodsSkuId()) |
| | | .eq(OrderAuctionBond::getBoundStatus, BondStatusEnum.PAID)); |
| | | } |
| | | Paylog paylog = iPaylogService.lambdaQuery() |
| | | .eq(Paylog::getOutTradeNo, orderAuctionBond.getOrderNo()) |
| | | .last("limit 1").one(); |
| | | if (StringUtils.isNull(paylog)) { |
| | | throw new ServiceException("支付记录不存在"); |
| | | } |
| | | PaymentMethodEnum paymentMethod = orderAuctionBond.getPaymentMethod(); |
| | | if (orderAuctionBond.getBoundStatus() == BondStatusEnum.PAID) { |
| | | boolean result = handleRefund(paymentMethod, paylog, orderAuctionBond.getOrderNo()); |
| | | if (result) { |
| | | paylog.setState(3);// 已退款 |
| | | orderAuctionBond.setBoundStatus(BondStatusEnum.REFUNDED); |
| | | iPaylogService.updateById(paylog); |
| | | this.updateById(order); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @Resource |
| | | private OrderMapper OrderMapper; |
| | | |
| | | @Resource |
| | | private AuctionClient auctionClient; |
| | | |
| | |
| | | private MemberClient memberClient; |
| | | |
| | | @Override |
| | | public R<Map<String, Object>> getPayInfo(Integer uid, Integer type, String subject, String body, String orderNO,String openId, HttpServletRequest request) { |
| | | public R<Map<String, Object>> getPayInfo(Integer uid, Integer type, String orderNO,String openId, HttpServletRequest request) { |
| | | Double price = 0.0; |
| | | |
| | | String subject; |
| | | String body; |
| | | try { |
| | | if(judgeContainsStr(orderNO)){ |
| | | price= Double.valueOf(1); |
| | | body = body; |
| | | subject = subject; |
| | | body = " 订单支付"; |
| | | subject = " 订单支付"; |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | if (type == 1) { |
| | | // 支付宝预下单 |
| | |
| | | try { |
| | | LambdaQueryWrapper<Paylog> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(Paylog::getOutTradeNo,paylog1.getOutTradeNo()); |
| | | Paylog paylog = this.getOne(wrapper); |
| | | if(SinataUtil.isEmpty(paylog)) { |
| | | Paylog one = this.getOne(wrapper); |
| | | if(SinataUtil.isEmpty(one)) { |
| | | this.save(paylog1); |
| | | if (paylog1.getOutTradeNo().contains("BO")) { |
| | | BondDTO bondVO=new BondDTO(); |
| | | bondVO.setOrderNO(paylog1.getOutTradeNo()); |
| | | auctionClient.UpdateBond(bondVO, SecurityConstants.INNER); |
| | | |
| | | }else{ |
| | | BondDTO bondVO=new BondDTO(); |
| | | |
| | | bondVO.setOrderNO(paylog.getOutTradeNo()); |
| | | auctionClient.UpdateBond(bondVO, SecurityConstants.INNER); |
| | | |
| | | LambdaQueryWrapper<Order> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.eq(Order::getOrderNo,paylog.getOutTradeNo()); |
| | | wrapper1.eq(Order::getOrderNo,paylog1.getOutTradeNo()); |
| | | wrapper1.eq(Order::getDelFlag,0); |
| | | Order page1 = OrderMapper.selectOne(wrapper1); |
| | | page1.setOrderStatus(OrderStatusEnum.GOODS_TO_BE_RECEIVED); |
| | | page1.setPayTime(LocalDateTime.now()); |
| | | OrderMapper.updateById(page1); |
| | | |
| | | MemberPointsDTO memberPointsDTO=new MemberPointsDTO(); |
| | | memberPointsDTO.setMemberId(page1.getMemberId()); |
| | | memberPointsDTO.setPointsType(1); |
| | | memberPointsDTO.setPointsStatus(PointStatusEnum.INCREASE); |
| | | memberPointsDTO.setPoints(page1.getPoints()); |
| | | memberClient.addMemberPoints(memberPointsDTO); |
| | | MemberPointsDTO memberPointsDTO=new MemberPointsDTO(); |
| | | memberPointsDTO.setMemberId(page1.getMemberId()); |
| | | memberPointsDTO.setPointsType(1); |
| | | memberPointsDTO.setPointsStatus(PointStatusEnum.INCREASE); |
| | | memberPointsDTO.setPoints(page1.getPoints()); |
| | | memberClient.addMemberPoints(memberPointsDTO); |
| | | updMembeOneDTO MembeOneDTO=new updMembeOneDTO(); |
| | | MembeOneDTO.setType(1); |
| | | MembeOneDTO.setMemberId(page1.getMemberId()); |
| | | MembeOneDTO.setMoney(page1.getTotalAmount()); |
| | | MembeOneDTO.setTotalPoints(page1.getPoints()); |
| | | memberClient.updMembeOne(MembeOneDTO); |
| | | |
| | | updMembeOneDTO MembeOneDTO=new updMembeOneDTO(); |
| | | MembeOneDTO.setType(1); |
| | | MembeOneDTO.setMemberId(page1.getMemberId()); |
| | | MembeOneDTO.setMoney(page1.getTotalAmount()); |
| | | MembeOneDTO.setTotalPoints(page1.getPoints()); |
| | | memberClient.updMembeOne(MembeOneDTO); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | System.out.println("支付完成时间" + time_end); |
| | | paylog.setAddTime(LocalDateTime.now()); |
| | | this.save(paylog); |
| | | if (paylog.getOutTradeNo().contains("BO")) { |
| | | BondDTO bondVO=new BondDTO(); |
| | | bondVO.setOrderNO(paylog.getOutTradeNo()); |
| | | auctionClient.UpdateBond(bondVO, SecurityConstants.INNER); |
| | | BondDTO bondVO=new BondDTO(); |
| | | |
| | | }else{ |
| | | BondDTO bondVO=new BondDTO(); |
| | | bondVO.setOrderNO(paylog.getOutTradeNo()); |
| | | auctionClient.UpdateBond(bondVO, SecurityConstants.INNER); |
| | | |
| | | bondVO.setOrderNO(paylog.getOutTradeNo()); |
| | | auctionClient.UpdateBond(bondVO, SecurityConstants.INNER); |
| | | LambdaQueryWrapper<Order> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.eq(Order::getOrderNo,paylog.getOutTradeNo()); |
| | | wrapper1.eq(Order::getDelFlag,0); |
| | | Order page1 = OrderMapper.selectOne(wrapper1); |
| | | page1.setOrderStatus(OrderStatusEnum.GOODS_TO_BE_RECEIVED); |
| | | page1.setPayTime(LocalDateTime.now()); |
| | | OrderMapper.updateById(page1); |
| | | |
| | | LambdaQueryWrapper<Order> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.eq(Order::getOrderNo,paylog.getOutTradeNo()); |
| | | wrapper1.eq(Order::getDelFlag,0); |
| | | Order page1 = OrderMapper.selectOne(wrapper1); |
| | | page1.setOrderStatus(OrderStatusEnum.GOODS_TO_BE_RECEIVED); |
| | | OrderMapper.updateById(page1); |
| | | MemberPointsDTO memberPointsDTO=new MemberPointsDTO(); |
| | | memberPointsDTO.setMemberId(page1.getMemberId()); |
| | | memberPointsDTO.setPointsType(1); |
| | | memberPointsDTO.setPointsStatus(PointStatusEnum.INCREASE); |
| | | memberPointsDTO.setPoints(page1.getPoints()); |
| | | memberClient.addMemberPoints(memberPointsDTO); |
| | | |
| | | MemberPointsDTO memberPointsDTO=new MemberPointsDTO(); |
| | | memberPointsDTO.setMemberId(page1.getMemberId()); |
| | | memberPointsDTO.setPointsType(1); |
| | | memberPointsDTO.setPointsStatus(PointStatusEnum.INCREASE); |
| | | memberPointsDTO.setPoints(page1.getPoints()); |
| | | memberClient.addMemberPoints(memberPointsDTO); |
| | | updMembeOneDTO MembeOneDTO=new updMembeOneDTO(); |
| | | MembeOneDTO.setType(1); |
| | | MembeOneDTO.setMemberId(page1.getMemberId()); |
| | | MembeOneDTO.setMoney(page1.getTotalAmount()); |
| | | MembeOneDTO.setTotalPoints(page1.getPoints()); |
| | | memberClient.updMembeOne(MembeOneDTO); |
| | | |
| | | updMembeOneDTO MembeOneDTO=new updMembeOneDTO(); |
| | | MembeOneDTO.setType(1); |
| | | MembeOneDTO.setMemberId(page1.getMemberId()); |
| | | MembeOneDTO.setMoney(page1.getTotalAmount()); |
| | | MembeOneDTO.setTotalPoints(page1.getPoints()); |
| | | memberClient.updMembeOne(MembeOneDTO); |
| | | |
| | | } |
| | | log.debug("WxpayController.notify__回调处理成功:SUCCESS"); |
| | | response.getOutputStream().print("success"); |
| | | } |
| | |
| | | ## 支付宝配置文件 ## |
| | | |
| | | # 商户收款支付宝账号 |
| | | seller_email = 962295261@qq.com |
| | | seller_email = tuodanchaowan@163.com |
| | | # 商户私钥 |
| | | private_key = MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCg31tKXap7oTKKKDtfXc/hQjriSJkKopfRkh9j1UA/BpY+6GLkbJhg8kw9CRCILjfi5M0F3FCu+j1ogeDE1ivRGJlX1l/TGj+HuM1g8qLx/tD5D+9nJq5UHfaoKxXPko8H3AWcN1n/MAq3kRwUJRkeYJyYrZ7Sd6RU2taVLktWu92lqoUahjFkQSkdJoKi77v5i1T56PLRFfClt72tnvgol4OXBfFEjpGVrnuYoiHCgLV9eN5Qmvdas/04TtU396p+atYycU2P/dU9fdc8NFFFJo+eYH7astJXIQsowpLtTS7lavQuzCcLvC20pRBPhql5+5X96DVdnOLMbdUKwLQ9AgMBAAECggEAZLuXgVhnYSSN7f7FNrEaczWyg3DsC8HGCN9TsoKcyRpJyDhhfCEXxVTTMkDTzkIKkpOsYagUCYz+GMuCwB5Pr42Ur3C37gr4jvbD+5nTOG7T0bENumx5Kojco27fKGvgDg7SoH/0ZZtiipFdoKueL+xVAjFtSuLJzqx9Q0qKuFLJH0lrQfHYyGcq9ZzrPKLrMZb3Ve3upmpaLjIddZmqnzK7g5lx/OLHEujXIR9u0VWzzxqeaFkgCAMuyzkNYwlpqtiTJsEggbnG9YsLf0n156F0dXo2i44fUav+bKU2ksv7YmENx3R9gPDuPAKH+MwQlwVIc6tR8jKoz0cUbmaujQKBgQDhvaQd4jg9zszdVw1enPWKWViu4rsEFirIz3CUBRB3g2mkZ+tXpQQps7bL7KLBFfXmVYiVMu4EoOfZlkAjJPbFMj9aSPZ3pbx0VnHG8+3T9T2eJdzZp/CehG3MyycNHxAbbl2B04Chiiyf67R0b4ZLMHoElQgJP9jF1q3Xiloi0wKBgQC2b73S4LZWlWkyIsmHYHmXyWta64W2whlL4Nsy97tl4kZNfLCG7mgG5FhHhi16lT7J6Sw1D2FgFov2B1r9+yGBRxckGzWoY5m6FtBE/l+42+gxsB41+kEgirVjlEaX7YBXmnux2LntPVlJOG6HTizjcUnTesGIRvwbmbR2tuXCrwKBgQCMJwKq7xW+AhQdY/vP/yFPaRNvWSOFcQHVNT2PGOnVWciQI1jxTGmePo7CY0PVH35RKE+pWjp+syvfYrKlX0C6w+yjcGNde4/apwTy4eWJ0FwWQSmyFNuGf2/wUz0Gn3+PmGEDxr25DaGRFHUwSUGWkx1elOytWW+LvTKnfKVjswKBgGuh50MnskvI4IRkw7Mr9vDXM5AzjfLx9syuf4RFZflJEyMaImeo9hTC2VZxUhmVPbMP7zXqug9fnflsA4H+jJjh4UQ7DWAoSwTf+sYJsV211/qgpmJAH/Zb/4Idc7yksWh9yuZ1L9RIsomhUoxfUdpp9x1euhl1j72U5ER5yXofAoGAZNrIYFWk4S8mqFY8/h0YVGxT7Hj0ppLsq20N4OzglScoEEG+aYmWDOQU9kWcxsD44bMdzk2k0DyOhHbp8Tjd1hp0UFb03s8HgERcFHMZMzQ5oqtWQEoYiyQZxReXZZvWUbV+dg1HXXG8I26XAKb3OWFUIBBfKa2/Ig9ensY9m+M= |
| | | private_key = MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC3ap1qQ5GTe+syB8Tu/fH8nRdpjA7yNgLINR/kFq1VFzxDref7DQDUDWXt+s5QZyBjL1UfbQWtA96F+OpgmIiNMdZSn9FH/w5XSqSd7B4nAa1sgfdLdZDvm+crqzn8OzyEJTrO8tihF+9K+btBl37s3QfmmzCRl1PAAMGqfy/JcQ2aivY+hxb25V0kD5AAXM7mVC2zzcBrykzafQCXEnDC7ls4Hjy0agmq1bKSx8SLYTsXAzZiGk9E7yh76nDAB+P1+kKPEYJXociU3k4YRR7l+6tzBPd+/mVkL34nuV5IiAK/795CrP/9gC50nZK/6CqSPDlQlOaAaJ2uZvAOeKx3AgMBAAECggEAMzw5+swjJ0KvYYtgDK6tYTZ0qswwBKLnxgto/CsFgkZ6VCGJMszgFVwkxASSi00zc+Ft8thehIUXLO9qcU9Knb51MyFnsafi1qmIMIEbryO90RjA/rg5o2U2fzFWgkn9zqAjvFmEAAQSmSwHjfwGvZ3Erjtdpt3RzEmpz7m1nJxYuZ2JLdo8AIY+iYn1NeDxHMi27RtqsZje7RV5YXrqKtMMzW2atmj+Dbn/E1pxpF0Dz6l0TqQh5B+9j1XlPTZKcYOYHNI0ACV+dV1NZsqmdhX0lKtQbsj/Q67vhq7uCmQRKcEka/5Z0X/TOKbwJE6i2/YEuA4PUGLpBMZQXhSGYQKBgQD50IuUTG6fg1dqFt9bJXxq2i1lkIHvzaCkHqVnTMyTDs+VcO2S6YaAFy6BLSI933qvHLogkhqnHiN+BRHe/M5+4TAOx30SQlJYa5ojpNFwMnRSZgxLoEddwlfj6qTnCgDW3CsUPR85x85NjIhONy75muNnNG8GHdn3blk2Y7KhpwKBgQC79TQhz5eJ6cwiWPWMWnnSAVvFKW4iPZjkbk+Sl7JXuqzvsdE47gGN0Vk8iYWEc2WrnQY6vf7WnamQYi+Gr5ySfTSt9qwvRx0IRzHdSZkOsHJLBCnAt+Pf+pSBc2Z788iUXVbDRAIfF6YYG44P3jHspbnGPJt14PP0sHbPmh7YsQKBgGzGGYChJyndjpprCyYs1FfSWCH5IhrAdkn/7hVko08FC+4OFeP6Os5bSayFcntua4UEBSdZdrF9tgaRPo7RlTg55SsKQbNJnYFSmPMcOPWZgny+YmwrheeVT5+188eF24eypi9Rzd7i2Tl7D36/GH0mrA2sDwuiw92w9rdwAb/RAoGAf6RDZPqvNI87e8/h4RDITd9yTPCXxFUEcYygKTMvf/hb3ONq7DhlgcO70CqsK4iacPLP+jBw0Zp8PnsPP24e7DRvA/zSbcDjbG285URH1vvogh0vpZq7+60WENsnq+GgQ3EnrK+QqUDMIO8FiK0iRk09XexmvqSnx3HXHaDSdeECgYB9htO5mOn2/ugIeMw11g+JJkZ/hzE55/6fLf7zh3yel5EflmAdYRv0lHafjyXIzNrAnBgD95x4LKGLi9A5AMo9SJJu0ZOg1KujKPVY4ByCm9SO7ErJDuHI4AhtewdHhYDpnXMakoxm/medSjlt7GCVv7E/eDpNZs+MLi9MiTFx2g== |
| | | # 支付宝公钥 |
| | | ali_public_key = MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh+tCVKqUmlHDL8Ki1TUJtzE5IKV1irJuoHWZTvndJCKJJ8bdWxL9mu5xsy8KkfrnS6wJIKBMLTxMoYQHG7l2Gt07YyUCYHS5+yvbHtTkyFFy2KRPeUEWXz1Tm4juvInDvvr+n7v9ETepToGhC+UDlQcBvuSppw8N+463E+1GRrC4APwXYGLzaIvYvDHcQAULkWhXsjzxJSmeSi12kqWKlgnVJC1y0FT8xQtvhwShfaIqKwzErn9S2z7JjdXboJMUYQHoqF1A4SmWY8c0qawqvx2hGP36W3RDQ4cczzFwUHS1Cylhsbgh1COc4OdANCX4Np2NUzaRDCNzN0WVFKtK+QIDAQAB |
| | | ali_public_key = MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlW2RMACojdqTa8H+j6411Lm5UipGXXbQiswq50rUflwjTj843zNVaVpk8uJmbdmtUBJlmblgBS/a31O4L4LrHB8WxJ+w0f9DBNTq9T6b80MiAVnU/3gXK365DmbzPWS5pR9wEgJVHnfOFUbsB5AVFHV0m9hUZcPv7xveuEp3BEoD5smaDJByR+KgFw0Q0JgINhhE6bsEa3UgJ198af269LtQ5HJl1TWLI8aeqW14HrxyADIt49NB9KZ8MOdKP+66HWcrXlipKFHtccy3dff72DqPmFdESoXfLXKZyhU5w9v4Q5F6UoAGTPwl9KQwikTobNeJ/7su7X3AB6+C14J4sQIDAQAB |
| | | |
| | | # 支付宝回调地址 |
| | | notify_url = http://116.63.172.131:8088/api/pay/alipay/notify |
| | | notify_url = http://116.63.172.131:8088/order/forepart/paylog/alipay/notify |
| | | # 签约的appid |
| | | app_id = 2021004147684313 |
| | | app_id = 2021004150664294 |
| | | |
| | | |
| | | ## 支付宝配置文件 ## |
| | |
| | | key = E10ADC3949BA59ABBE56E057F20F883E |
| | | |
| | | # 微信回调地址 |
| | | wx_notify_url = http://116.63.172.131:8088/api/pay/wxpay/notify |
| | | wx_notify_url = http://116.63.172.131:8088/order/forepart/paylog/wxpay/notify |
| | | |
| | | |
| | | # 小程序的APPID |
| | |
| | | o.goods_sku_id as goodsSkuId |
| | | FROM |
| | | t_order o |
| | | LEFT JOIN t_goods_sku tgs ON o.goods_sku_id = tgs.id |
| | | <where> |
| | | o.order_status = 2 |
| | | o.order_status = 2 |
| | | <if test="skuName != null and skuName != ''"> |
| | | AND tgs.goods_sku_name LIKE CONCAT('%',#{skuName},'%') |
| | | AND o.sku_name LIKE CONCAT('%',#{skuName},'%') |
| | | </if> |
| | | AND o.order_from = 3 |
| | | AND o.member_id=#{memberId} |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getOrderByGroupPurchaseMemberList" resultType="com.ruoyi.system.api.domain.vo.OrderVO"> |
| | | SELECT |
| | | o.*, |
| | | o.goods_sku_id as goodsSkuId |
| | | FROM |
| | | t_order o |
| | | <where> |
| | | o.order_status = 2 |
| | | <if test="skuName != null and skuName != ''"> |
| | | AND o.sku_name LIKE CONCAT('%',#{skuName},'%') |
| | | </if> |
| | | AND o.order_from = 3 |
| | | AND o.member_id=#{memberId} |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="getOrderByGroupPurchaseMemberId" resultType="com.ruoyi.system.api.domain.vo.OrderVO"> |
| | | SELECT |
| | | o.* |
| | | FROM |
| | | t_order o |
| | | <where> |
| | | o.goods_sku_id = #{goodsSkuId} |
| | | AND o.order_status = 2 or o.order_status =1 |
| | | AND o.order_from = 3 |
| | | AND o.member_id=#{memberId} |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.OrderReturnRequestMapper"> |
| | | |
| | | <select id="getOrderReturnRequestPage" |
| | | resultType="com.ruoyi.order.controller.management.vo.MgtOrderReturnRequestVO"> |
| | | SELECT |
| | | torr.*, |
| | | o.order_no, |
| | | o.member_id, |
| | | CASE |
| | | WHEN o.order_from = 4 THEN 2 -- 当order_from为拍卖订单时,orderType赋值为2 |
| | | ELSE 1 -- 其他情况下,orderType赋值为1 |
| | | END AS orderType, |
| | | o.order_from |
| | | FROM |
| | | t_order_return_request torr |
| | | LEFT JOIN t_order o ON torr.order_id = o.id |
| | | <where> |
| | | <if test="query.orderNo != null and query.orderNo != ''"> |
| | | AND o.order_no LIKE concat('%', #{query.orderNo}, '%') |
| | | </if> |
| | | <if test="query.requestType != null"> |
| | | AND torr.request_type = #{query.requestType} |
| | | </if> |
| | | <if test="query.memberIdSet!=null"> |
| | | <foreach collection="query.memberIdSet" item="memberId" separator="," |
| | | open="AND o.member_id in (" close=")"> |
| | | #{memberId} |
| | | </foreach> |
| | | </if> |
| | | <if test="query.auditStatus != null"> |
| | | AND torr.audit_status = #{query.auditStatus} |
| | | </if> |
| | | <if test="query.status != null"> |
| | | AND torr.status = #{query.status} |
| | | </if> |
| | | <if test="query.orderType != null and query.orderType== 1"> |
| | | AND o.order_from in (1,2,3) |
| | | </if> |
| | | <if test="query.orderType != null and query.orderType== 2"> |
| | | AND o.order_from = 4 |
| | | </if> |
| | | </where> |
| | | ORDER BY torr.create_time DESC |
| | | </select> |
| | | <select id="getOrderReturnRequestDetail" |
| | | resultType="com.ruoyi.order.controller.management.vo.MgtOrderReturnRequestVO" |
| | | parameterType="java.lang.Long"> |
| | | SELECT torr.*, |
| | | o.order_no, |
| | | o.member_id, |
| | | o.order_time, |
| | | o.pay_time, |
| | | o.paymemt_method, |
| | | o.price, |
| | | o.points, |
| | | o.total_amount, |
| | | o.discount_money, |
| | | CASE |
| | | WHEN o.order_from = 4 THEN 2 -- 当order_from为拍卖订单时,orderType赋值为2 |
| | | ELSE 1 -- 其他情况下,orderType赋值为1 |
| | | END AS orderType, |
| | | o.order_from |
| | | FROM t_order_return_request torr |
| | | LEFT JOIN t_order o |
| | | ON torr.order_id = o.id |
| | | WHERE torr.id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | <version>1.2.47</version> |
| | | </dependency> |
| | | |
| | | <!--EasyExcel--> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-spring-boot-starter</artifactId> |
| | | <version>4.0.0</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>guava</artifactId> |
| | | <groupId>com.google.guava</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>3.3.4</version> |
| | | </dependency> |
| | | |
| | | <!-- 分布式事务 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-seata</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券领取表 前端控制器 |
| | |
| | | return R.ok(iCouponMemberService.getCouponMemberList(couponMemberDTO)); |
| | | } |
| | | |
| | | @PostMapping("/getCouponMember") |
| | | @ApiOperation(value = "用户端-获取用户下单优惠卷") |
| | | public R<List<CouponMember>> getCouponMemberl(@RequestBody CouponMemberDTO couponMemberDTO) { |
| | | return R.ok(iCouponMemberService.getCouponMemberl(couponMemberDTO)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.promotion.domain.PromotionBanner; |
| | | import com.ruoyi.promotion.service.IPromotionBannerService; |
| | | import com.ruoyi.system.api.domain.dto.BaanerListDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | |
| | | private IPromotionBannerService iPromotionBannerService; |
| | | @PostMapping("/getBaanerList") |
| | | @ApiOperation(value = "用户端-商场或者资讯的轮播图") |
| | | public R<List<PromotionBanner>> getBaanerList(@PathVariable("bannerType") Integer bannerType) { |
| | | return R.ok(iPromotionBannerService.getBaanerList(bannerType)); |
| | | public R<List<PromotionBanner>> getBaanerList(@RequestBody BaanerListDTO bannerType) { |
| | | return R.ok(iPromotionBannerService.getBaanerList(bannerType.getBannerType())); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.promotion.controller.management; |
| | | |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.util.DateUtils; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.promotion.controller.management.dto.MgtCouponDTO; |
| | |
| | | import com.ruoyi.system.api.validate.ModifyGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @Validated @RequestBody MgtCouponReceiveQuery query) { |
| | | return R.ok(couponService.getReceiveDetail(query)); |
| | | } |
| | | |
| | | /** |
| | | * 导出优惠券领取详情 |
| | | * |
| | | * @param query 管理后台-优惠券领取详情查询对象 |
| | | */ |
| | | @ApiOperation("领取详情-导出") |
| | | @PostMapping("/receive-detail/export") |
| | | public void exportReceiveDetail(@RequestBody MgtCouponReceiveQuery query) { |
| | | List<CouponReceiveDetailVO> couponReceiveDetailVOList = couponService.getCouponReceiveDetailList( |
| | | query); |
| | | String fileName = |
| | | "优惠券领取明细" + DateUtils.format(new Date(), "yyyyMMddHHmmss") + ".xlsx"; |
| | | |
| | | try (ExcelWriter excelWriter = EasyExcel.write(fileName, CouponReceiveDetailVO.class) |
| | | .build()) { |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("优惠券领取详情").build(); |
| | | excelWriter.write(couponReceiveDetailVOList, writeSheet); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiOperation("轮播图 上架/下架") |
| | | @PostMapping("/upd-status") |
| | | public R<?> updStatus(MgtPromotionBannerUpdDTO dto) { |
| | | public R<?> updStatus(@Validated @RequestBody MgtPromotionBannerUpdDTO dto) { |
| | | promotionBannerService.updStatus(dto); |
| | | return R.ok(); |
| | | } |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("/mgt/promotion-wish-list") |
| | | @RequiredArgsConstructor |
| | | @Api(value = "管理后台-心愿求购管理相关接口", tags = "管理后台-心愿求购管理相关接口") |
| | | @Api(value = "管理后台-心愿求购管理相关接口", tags = "管理后台-心愿求购管理相关接口筛选条件为:用户发布") |
| | | public class MgtPromotionWishListController { |
| | | |
| | | private final IPromotionWishListService promotionWishListService; |
| | |
| | | promotionWishListService.reply(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id 心愿求购id |
| | | */ |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete( |
| | | @ApiParam(name = "id", value = "心愿求购id", required = true) @PathVariable("id") Long id) { |
| | | promotionWishListService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | |
| | | private Integer issuedQuantity; |
| | | |
| | | @ApiModelProperty(value = "会员id列表") |
| | | @NotEmpty(message = "会员id列表不能为空", groups = {InsertGroup.class}) |
| | | private List<Long> memberIdList; |
| | | |
| | | } |
| | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "会员姓名") |
| | | private String realName; |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | |
| | | package com.ruoyi.promotion.controller.management.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.enums.CouponUseEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "管理后台-优惠券领取详情视图对象", description = "管理后台-优惠券领取详情视图对象") |
| | | public class CouponReceiveDetailVO { |
| | | public class CouponReceiveDetailVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 7898162954825380293L; |
| | | |
| | | @ApiModelProperty(value = "优惠券id") |
| | | @ExcelIgnore |
| | | private Long couponId; |
| | | |
| | | @ApiModelProperty(value = "优惠券id") |
| | | @ExcelIgnore |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "会员姓名") |
| | | private String realName; |
| | | @ExcelProperty("会员姓名") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @ExcelProperty("联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | @ApiModelProperty(value = "使用订单") |
| | | @ExcelProperty("使用订单") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "使用时间") |
| | | @ExcelProperty("使用时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "优惠券状态 0:未使用, 1:已使用") |
| | | @ApiModelProperty(value = "使用状态 0:未使用, 1:已使用") |
| | | @ExcelProperty("使用状态") |
| | | private CouponUseEnum couponStatus; |
| | | |
| | | } |
| | |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("createBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("createBy", userId.toString(), metaObject); |
| | | fillValue("createTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 获取当前登录用户 |
| | | String userName = SecurityUtils.getUsername(); |
| | | fillValue("updateBy", userName, metaObject); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | fillValue("updateBy", userId.toString(), metaObject); |
| | | fillValue("updateTime", LocalDateTime.now(), metaObject); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.system.api.domain.CouponMember; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券领取表 服务类 |
| | |
| | | |
| | | void updCouponMember(@RequestBody CouponMemberDTO couponMemberDTO); |
| | | |
| | | List<CouponMember> getCouponMemberl(@RequestBody CouponMemberDTO couponMemberDTO); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.promotion.controller.management.vo.CouponReceiveDetailVO; |
| | | import com.ruoyi.promotion.controller.management.vo.MgtCouponVO; |
| | | import com.ruoyi.promotion.domain.Coupon; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return PageDTO<CouponReceiveDetailVO> |
| | | */ |
| | | PageDTO<CouponReceiveDetailVO> getReceiveDetail(MgtCouponReceiveQuery query); |
| | | |
| | | /** |
| | | * 查询领取详情列表 |
| | | * |
| | | * @param query 管理后台-优惠券领取详情查询对象 |
| | | * @return List<CouponReceiveDetailVO> |
| | | */ |
| | | List<CouponReceiveDetailVO> getCouponReceiveDetailList(MgtCouponReceiveQuery query); |
| | | } |
| | |
| | | Page<CouponMember> page = new Page<>(couponMemberDTO.getPageCurr(), couponMemberDTO.getPageSize()); |
| | | LambdaQueryWrapper<CouponMember> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.eq(CouponMember::getCouponStatus, |
| | | CouponUseEnum.getEnumByCode(couponMemberDTO.getCouponStatus())); |
| | | CouponUseEnum.getEnumByCode(couponMemberDTO.getCouponStatus()+1)); |
| | | wrapper1.eq(CouponMember::getMemberId,couponMemberDTO.getMemberId()); |
| | | wrapper1.eq(CouponMember::getDelFlag,0); |
| | | Page<CouponMember> page1 = this.page(page, wrapper); |
| | | Page<CouponMember> page1 = this.page(page, wrapper1); |
| | | return PageDTO.of(page1); |
| | | } |
| | | |
| | |
| | | byId.setCouponStatus(CouponUseEnum.getEnumByCode(couponMemberDTO.getCouponStatus())); |
| | | this.updateById(byId); |
| | | } |
| | | |
| | | @Override |
| | | public List<CouponMember> getCouponMemberl(CouponMemberDTO couponMemberDTO) { |
| | | LambdaQueryWrapper<CouponMember> wrapper= Wrappers.lambdaQuery(); |
| | | wrapper.eq(CouponMember::getCouponStatus, CouponUseEnum.UNUSED); |
| | | wrapper.eq(CouponMember::getDelFlag,0); |
| | | List<CouponMember> couponMemberList=this.list(wrapper); |
| | | /* for (CouponMember couponMember:couponMemberList){ |
| | | if(LocalDateTime.now().isAfter(couponMember.getEndDate())){ |
| | | couponMember.setCouponStatus(0); |
| | | this.updateById(couponMember); |
| | | } |
| | | }*/ |
| | | LambdaQueryWrapper<CouponMember> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.eq(CouponMember::getCouponStatus, |
| | | CouponUseEnum.getEnumByCode(couponMemberDTO.getCouponStatus()+1)); |
| | | wrapper1.eq(CouponMember::getMemberId,couponMemberDTO.getMemberId()); |
| | | wrapper1.eq(CouponMember::getDelFlag,0); |
| | | List<CouponMember> page1 = this.list(wrapper1); |
| | | return page1; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public PageDTO<CouponReceiveDetailVO> getReceiveDetail(MgtCouponReceiveQuery query) { |
| | | MemberDTO memberDTO = null; |
| | | Set<Long> memberIdSet = null; |
| | | if (StringUtils.isNotBlank(query.getRealName()) || StringUtils.isNotBlank( |
| | | query.getPhone())) { |
| | | memberDTO = new MemberDTO(); |
| | | memberDTO.setRealName(query.getRealName()); |
| | | memberDTO.setPhone(query.getPhone()); |
| | | } |
| | | if (StringUtils.isNotNull(memberDTO)) { |
| | | List<Member> data = memberClient.getMemberListByCondition(memberDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | memberIdSet = data.stream().map(Member::getId).collect(Collectors.toSet()); |
| | | } |
| | | MemberDTO memberDTO = getMemberQueryParam(query); |
| | | Set<Long> memberIdSet = getMemberIdSet(memberDTO); |
| | | Page<CouponMember> page = couponMemberService.lambdaQuery() |
| | | .eq(StringUtils.isNotNull(query.getCouponStatus()), |
| | | CouponMember::getCouponStatus, query.getCouponStatus()) |
| | |
| | | } |
| | | PageDTO<CouponReceiveDetailVO> couponReceiveDetailVOPageDTO = PageDTO.of(page, |
| | | CouponReceiveDetailVO.class); |
| | | // 远程调用会员服务,获取会员信息 |
| | | List<Long> memberIdList = page.getRecords().stream().map(CouponMember::getMemberId) |
| | | .collect(Collectors.toList()); |
| | | if (StringUtils.isNotEmpty(memberIdList)) { |
| | | List<Member> memberList = memberClient.getMemberListByIds(memberIdList, |
| | | SecurityConstants.INNER).getData(); |
| | | Map<Long, Member> memberMap = memberList.stream() |
| | | .collect(Collectors.toMap(Member::getId, Function.identity())); |
| | | couponReceiveDetailVOPageDTO.getList().forEach(item -> { |
| | | Member member = memberMap.get(item.getMemberId()); |
| | | item.setRealName(member.getRealName()); |
| | | item.setPhone(member.getPhone()); |
| | | }); |
| | | } |
| | | List<CouponReceiveDetailVO> couponReceiveDetailVOList = couponReceiveDetailVOPageDTO.getList(); |
| | | handleCouponReceiveDetailVO(couponReceiveDetailVOList); |
| | | return couponReceiveDetailVOPageDTO; |
| | | } |
| | | |
| | | private void handleCouponReceiveDetailVO( |
| | | List<CouponReceiveDetailVO> couponReceiveDetailVOList) { |
| | | // 远程调用订单服务,获取订单信息 |
| | | List<CouponReceiveDetailVO> usedCouponList = couponReceiveDetailVOPageDTO.getList().stream() |
| | | List<CouponReceiveDetailVO> usedCouponList = couponReceiveDetailVOList.stream() |
| | | .filter(item -> item.getCouponStatus().equals( |
| | | CouponUseEnum.USED)).collect(Collectors.toList()); |
| | | Set<Long> couponIdSet = usedCouponList.stream().map(CouponReceiveDetailVO::getCouponId) |
| | |
| | | Function.identity())); |
| | | |
| | | } |
| | | Set<Long> memberSet = couponReceiveDetailVOPageDTO.getList().stream() |
| | | // 远程调用会员服务,获取会员信息 |
| | | Set<Long> memberSet = couponReceiveDetailVOList.stream() |
| | | .map(CouponReceiveDetailVO::getMemberId).collect( |
| | | Collectors.toSet()); |
| | | if (StringUtils.isNotEmpty(memberSet)) { |
| | |
| | | Collectors.toMap(Member::getId, Function.identity())); |
| | | } |
| | | // 封装VO |
| | | for (CouponReceiveDetailVO couponReceiveDetailVO : couponReceiveDetailVOPageDTO.getList()) { |
| | | for (CouponReceiveDetailVO couponReceiveDetailVO : couponReceiveDetailVOList) { |
| | | if (StringUtils.isNotEmpty(memberMap)) { |
| | | Member member = memberMap.get(couponReceiveDetailVO.getMemberId()); |
| | | if (StringUtils.isNotNull(member)) { |
| | | couponReceiveDetailVO.setRealName(member.getRealName()); |
| | | couponReceiveDetailVO.setNickname(member.getNickname()); |
| | | couponReceiveDetailVO.setPhone(member.getPhone()); |
| | | } |
| | | } else if (StringUtils.isNotEmpty(orderMap)) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | return couponReceiveDetailVOPageDTO; |
| | | } |
| | | |
| | | private Set<Long> getMemberIdSet(MemberDTO memberDTO) { |
| | | Set<Long> memberIdSet = null; |
| | | if (StringUtils.isNotNull(memberDTO)) { |
| | | List<Member> data = memberClient.getMemberListByCondition(memberDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | memberIdSet = data.stream().map(Member::getId).collect(Collectors.toSet()); |
| | | } |
| | | return memberIdSet; |
| | | } |
| | | |
| | | private static MemberDTO getMemberQueryParam(MgtCouponReceiveQuery query) { |
| | | MemberDTO memberDTO = null; |
| | | if (StringUtils.isNotBlank(query.getNickname()) || StringUtils.isNotBlank( |
| | | query.getPhone())) { |
| | | memberDTO = new MemberDTO(); |
| | | memberDTO.setNickname(query.getNickname()); |
| | | memberDTO.setPhone(query.getPhone()); |
| | | } |
| | | return memberDTO; |
| | | } |
| | | |
| | | /** |
| | | * 查询领取详情列表 |
| | | * |
| | | * @param query 管理后台-优惠券领取详情查询对象 |
| | | * @return List<CouponReceiveDetailVO> |
| | | */ |
| | | @Override |
| | | public List<CouponReceiveDetailVO> getCouponReceiveDetailList(MgtCouponReceiveQuery query) { |
| | | MemberDTO memberDTO = getMemberQueryParam(query); |
| | | Set<Long> memberIdSet = getMemberIdSet(memberDTO); |
| | | List<CouponMember> couponMemberList = couponMemberService.lambdaQuery() |
| | | .eq(StringUtils.isNotNull(query.getCouponStatus()), |
| | | CouponMember::getCouponStatus, query.getCouponStatus()) |
| | | .in(StringUtils.isNotEmpty(memberIdSet), CouponMember::getMemberId, memberIdSet) |
| | | .eq(CouponMember::getCouponId, query.getId()) |
| | | .list(); |
| | | if (StringUtils.isEmpty(couponMemberList)) { |
| | | throw new ServiceException("没有符合条件的数据导出"); |
| | | } |
| | | List<CouponReceiveDetailVO> couponReceiveDetailVOList = BeanUtils.copyList(couponMemberList, |
| | | CouponReceiveDetailVO.class); |
| | | handleCouponReceiveDetailVO(couponReceiveDetailVOList); |
| | | return couponReceiveDetailVOList; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.enums.ReplyStatusEnum; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | |
| | | // 封装会员条件查询对象 |
| | | MemberDTO memberDTO = null; |
| | | Set<Long> memberIdSet = null; |
| | | Page<PromotionWishList> page = new Page<>(query.getPageCurr(), query |
| | | .getPageSize()); |
| | | if (StringUtils.isNotBlank(query.getNickname()) || StringUtils.isNotBlank( |
| | | query.getPhone())) { |
| | | memberDTO = new MemberDTO(); |
| | |
| | | // 远程调用会员服务进行条件查询 |
| | | List<Member> memberList = memberClient.getMemberListByCondition(memberDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isEmpty(memberList)) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | memberIdSet = memberList.stream().map(Member::getId) |
| | | .collect(Collectors.toSet()); |
| | | } |
| | | |
| | | // 分页查询心愿求购列表 |
| | | Page<PromotionWishList> page = this.lambdaQuery() |
| | | page = this.lambdaQuery() |
| | | .eq(StringUtils.isNotNull(query.getReplyStatus()), |
| | | PromotionWishList::getReplyStatus, query.getReplyStatus()) |
| | | .in(StringUtils.isNotEmpty(memberIdSet), PromotionWishList::getMemberId, |
| | | memberIdSet).page(new Page<>(query.getPageCurr(), query |
| | | .getPageSize())); |
| | | memberIdSet).page(page); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | |
| | | public void reply(MgtPromotionWishListDTO dto) { |
| | | PromotionWishList promotionWishList = this.getById(dto.getId()); |
| | | promotionWishList.setReplies(dto.getReplies()); |
| | | promotionWishList.setReplyStatus(ReplyStatusEnum.REPLIED); |
| | | this.updateById(promotionWishList); |
| | | } |
| | | } |
| | |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.47</version> |
| | | </dependency> |
| | | |
| | | <!-- 分布式事务 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-seata</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import com.ruoyi.system.domain.Agreement; |
| | | import com.ruoyi.system.service.IAgreementService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/agreement") |
| | | |
| | | public class AgreementController { |
| | | @Resource |
| | | private IAgreementService iAgreementService; |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.CustomConfig; |
| | | import com.ruoyi.system.domain.dto.MgtAfterSaleSettingDTO; |
| | | import com.ruoyi.system.domain.dto.PointsConfigDTO; |
| | | import com.ruoyi.system.domain.vo.CustomConfigVO; |
| | | import com.ruoyi.system.service.ICustomConfigService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/custom-config") |
| | | @Api(value = "系统配置接口", tags = "系统配置接口") |
| | | public class CustomConfigController { |
| | | @Resource |
| | | private ICustomConfigService iCustomConfigService; |
| | |
| | | CustomConfig one = iCustomConfigService.getOne(wrapper); |
| | | return R.ok(one); |
| | | } |
| | | |
| | | /** |
| | | * 获取积分设置 |
| | | * |
| | | * @return List<CustomConfig> |
| | | */ |
| | | @ApiOperation("获取积分设置") |
| | | @GetMapping("/points") |
| | | public R<List<CustomConfigVO>> getPointsConfig() { |
| | | return R.ok(iCustomConfigService.getPointsConfig()); |
| | | } |
| | | /** |
| | | * 保存积分设置 |
| | | * |
| | | * @param dto 积分配置数据传输对象 |
| | | */ |
| | | @ApiOperation(value = "保存积分设置") |
| | | @PostMapping("/save-points") |
| | | public R<?> savePointsSettings(@Validated @RequestBody PointsConfigDTO dto) { |
| | | iCustomConfigService.savePointsSettings(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取订单说明设置 |
| | | * |
| | | * @return CustomConfigVO |
| | | */ |
| | | @ApiOperation("获取订单说明设置") |
| | | @GetMapping("/order-desc") |
| | | public R<CustomConfigVO> getOrderDesc() { |
| | | return R.ok(iCustomConfigService.getOrderDesc()); |
| | | } |
| | | |
| | | /** |
| | | * 订单说明设置 |
| | | * |
| | | * @param description 订单说明 |
| | | */ |
| | | @ApiOperation(value = "订单说明设置") |
| | | @PostMapping("/save-order-desc") |
| | | public R<?> saveOrderDescription( |
| | | @RequestParam(value = "description", required = true) String description) { |
| | | iCustomConfigService.saveOrderDescription(description); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "售后设置") |
| | | @PostMapping("/save-after-sale-setting") |
| | | public R<?> saveAfterSaleSetting(@Validated @RequestBody MgtAfterSaleSettingDTO dto) { |
| | | iCustomConfigService.saveAfterSaleSetting(dto); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | userService.deleteSupplier(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @InnerAuth |
| | | @GetMapping("/list-by-name") |
| | | R<List<SysUser>> getUserListByName(@RequestBody SysUser sysUser) { |
| | | List<SysUser> list = userService.lambdaQuery() |
| | | .like(StringUtils.isNotBlank(sysUser.getNickName()), SysUser::getNickName, |
| | | sysUser.getNickName()) |
| | | .like(StringUtils.isNotBlank(sysUser.getPhonenumber()), SysUser::getPhonenumber, |
| | | sysUser.getPhonenumber()) |
| | | .eq(SysUser::getUserType, "00") |
| | | .eq(SysUser::getDelFlag, 0).list(); |
| | | return R.ok(list); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/15 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "售后设置对象") |
| | | public class MgtAfterSaleSettingDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 6993506291454436640L; |
| | | |
| | | @ApiModelProperty("退货地址-收货人姓名") |
| | | @NotBlank(message = "收货人姓名不能为空") |
| | | private String receiverName; |
| | | |
| | | @ApiModelProperty("退货地址-收货人电话") |
| | | @NotBlank(message = "收货人电话不能为空") |
| | | private String receiverPhone; |
| | | |
| | | @ApiModelProperty("退货地址-收获地址") |
| | | @NotBlank(message = "收获地址不能为空") |
| | | private String receiverAddress; |
| | | |
| | | @ApiModelProperty("售后周期") |
| | | @NotNull(message = "售后周期不能为空") |
| | | private Integer returnCycle; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/11 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "积分配置数据传输对象", description = "积分配置数据传输对象") |
| | | public class PointsConfigDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 8009805126467325247L; |
| | | |
| | | @ApiModelProperty(value = "消费金额") |
| | | @NotNull(message = "消费金额不能为空") |
| | | private BigDecimal consumeAmount; |
| | | |
| | | @ApiModelProperty(value = "积分") |
| | | @NotNull(message = "积分不能为空") |
| | | private Integer points; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/6/12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "系统配置视图对象", description = "系统配置视图对象") |
| | | public class CustomConfigVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -3924918944203960354L; |
| | | @ApiModelProperty(value = "配置id") |
| | | private Integer configId; |
| | | |
| | | @ApiModelProperty(value = "配置键") |
| | | private String configKey; |
| | | |
| | | @ApiModelProperty(value = "配置名") |
| | | private String configName; |
| | | |
| | | @ApiModelProperty(value = "配置值") |
| | | private String configValue; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.domain.CustomConfig; |
| | | import com.ruoyi.system.domain.dto.MgtAfterSaleSettingDTO; |
| | | import com.ruoyi.system.domain.dto.PointsConfigDTO; |
| | | import com.ruoyi.system.domain.vo.CustomConfigVO; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ICustomConfigService extends IService<CustomConfig> { |
| | | |
| | | /** |
| | | * 保存积分设置 |
| | | * |
| | | * @param dto 积分配置数据传输对象 |
| | | */ |
| | | void savePointsSettings(PointsConfigDTO dto); |
| | | |
| | | |
| | | /** |
| | | * 获取积分设置 |
| | | * |
| | | * @return List<CustomConfig> |
| | | */ |
| | | List<CustomConfigVO> getPointsConfig(); |
| | | |
| | | /** |
| | | * 获取订单说明设置 |
| | | * |
| | | * @return CustomConfigVO |
| | | */ |
| | | CustomConfigVO getOrderDesc(); |
| | | |
| | | /** |
| | | * 订单说明设置 |
| | | * |
| | | * @param description 订单说明 |
| | | */ |
| | | void saveOrderDescription(String description); |
| | | |
| | | void saveAfterSaleSetting(MgtAfterSaleSettingDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.system.api.constants.ConfigEnum; |
| | | import com.ruoyi.system.api.domain.CustomConfig; |
| | | import com.ruoyi.system.domain.dto.MgtAfterSaleSettingDTO; |
| | | import com.ruoyi.system.domain.dto.PointsConfigDTO; |
| | | import com.ruoyi.system.domain.vo.CustomConfigVO; |
| | | import com.ruoyi.system.mapper.CustomConfigMapper; |
| | | import com.ruoyi.system.service.ICustomConfigService; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class CustomConfigServiceImpl extends ServiceImpl<CustomConfigMapper, CustomConfig> implements ICustomConfigService { |
| | | |
| | | /** |
| | | * 保存积分设置 |
| | | * |
| | | * @param dto 积分配置数据传输对象 |
| | | */ |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public void savePointsSettings(PointsConfigDTO dto) { |
| | | Optional<CustomConfig> customConfigOptional = getCustomConfigByKey( |
| | | ConfigEnum.MEMBER_POINTS_MONEY.getKey()); |
| | | CustomConfig moneyConfig = customConfigOptional.orElseGet(() -> { |
| | | CustomConfig config = new CustomConfig(); |
| | | config.setConfigKey(ConfigEnum.MEMBER_POINTS_MONEY.getKey()); |
| | | config.setConfigType(ConfigEnum.MEMBER_POINTS_MONEY.getKeyType()); |
| | | config.setConfigName(ConfigEnum.MEMBER_POINTS_MONEY.getKeyName()); |
| | | return config; |
| | | }); |
| | | moneyConfig.setConfigValue(dto.getConsumeAmount().toString()); |
| | | Optional<CustomConfig> customConfigByKey = getCustomConfigByKey( |
| | | ConfigEnum.MEMBER_POINTS_POINTS.getKey()); |
| | | CustomConfig pointsConfig = customConfigByKey.orElseGet(() -> { |
| | | CustomConfig config = new CustomConfig(); |
| | | config.setConfigKey(ConfigEnum.MEMBER_POINTS_POINTS.getKey()); |
| | | config.setConfigType(ConfigEnum.MEMBER_POINTS_POINTS.getKeyType()); |
| | | config.setConfigName(ConfigEnum.MEMBER_POINTS_POINTS.getKeyName()); |
| | | return config; |
| | | }); |
| | | pointsConfig.setConfigValue(dto.getPoints().toString()); |
| | | this.saveOrUpdateBatch(Lists.newArrayList(moneyConfig, pointsConfig)); |
| | | } |
| | | |
| | | private Optional<CustomConfig> getCustomConfigByKey(String key) { |
| | | return this.lambdaQuery() |
| | | .eq(CustomConfig::getConfigType, key) |
| | | .eq(CustomConfig::getDelFlag, 0).oneOpt(); |
| | | } |
| | | |
| | | /** |
| | | * 获取积分设置 |
| | | * |
| | | * @return List<CustomConfigVO> |
| | | */ |
| | | @Override |
| | | public List<CustomConfigVO> getPointsConfig() { |
| | | List<CustomConfig> list = this.lambdaQuery() |
| | | .in(CustomConfig::getConfigType, ConfigEnum.MEMBER_POINTS_MONEY.getKey(), |
| | | ConfigEnum.MEMBER_POINTS_POINTS.getKey()) |
| | | .eq(CustomConfig::getDelFlag, 0).list(); |
| | | return BeanUtils.copyList(list, CustomConfigVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 获取订单说明设置 |
| | | * |
| | | * @return CustomConfigVO |
| | | */ |
| | | @Override |
| | | public CustomConfigVO getOrderDesc() { |
| | | CustomConfigVO vo; |
| | | CustomConfig customConfig = getCustomConfigByKey( |
| | | ConfigEnum.MALL_ORDER_DESCRIPTION.getKey()).orElse(new CustomConfig()); |
| | | vo = BeanUtils.copyBean(customConfig, CustomConfigVO.class); |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * 订单说明设置 |
| | | * |
| | | * @param description 订单说明 |
| | | */ |
| | | @Override |
| | | public void saveOrderDescription(String description) { |
| | | CustomConfig orderDescription = getCustomConfigByKey( |
| | | ConfigEnum.MALL_ORDER_DESCRIPTION.getKey()).orElseGet(() -> { |
| | | CustomConfig customConfig = new CustomConfig(); |
| | | customConfig.setConfigKey(ConfigEnum.MALL_ORDER_DESCRIPTION.getKey()); |
| | | customConfig.setConfigName(ConfigEnum.MALL_ORDER_DESCRIPTION.getKeyName()); |
| | | customConfig.setConfigType(ConfigEnum.MALL_ORDER_DESCRIPTION.getKeyType()); |
| | | return customConfig; |
| | | }); |
| | | orderDescription.setConfigValue(description); |
| | | this.saveOrUpdate(orderDescription); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) |
| | | public void saveAfterSaleSetting(MgtAfterSaleSettingDTO dto) { |
| | | handleConfigSetting(dto.getReceiverName(), ConfigEnum.RETURN_ADDRESS_USER_NAME); |
| | | handleConfigSetting(dto.getReceiverPhone(), ConfigEnum.RETURN_ADDRESS_USER_PHONE); |
| | | handleConfigSetting(dto.getReceiverAddress(), ConfigEnum.RETURN_ADDRESS_USER_ADDRESS); |
| | | handleConfigSetting(dto.getReturnCycle().toString(), ConfigEnum.RETURN_CYCLE); |
| | | } |
| | | |
| | | private void handleConfigSetting(String value, ConfigEnum configEnum) { |
| | | Optional<CustomConfig> receiverNameConfigOptional = getCustomConfigByKey( |
| | | ConfigEnum.RETURN_ADDRESS_USER_NAME.getKey()); |
| | | CustomConfig receiverNameConfig = receiverNameConfigOptional.orElseGet(() -> { |
| | | CustomConfig config = new CustomConfig(); |
| | | config.setConfigKey(ConfigEnum.RETURN_ADDRESS_USER_NAME.getKey()); |
| | | config.setConfigType(ConfigEnum.RETURN_ADDRESS_USER_NAME.getKeyType()); |
| | | config.setConfigName(ConfigEnum.RETURN_ADDRESS_USER_NAME.getKeyName()); |
| | | return config; |
| | | }); |
| | | receiverNameConfig.setConfigValue(value); |
| | | this.saveOrUpdate(receiverNameConfig); |
| | | } |
| | | } |
| | |
| | | import javax.websocket.OnMessage; |
| | | import javax.websocket.OnOpen; |
| | | import javax.websocket.Session; |
| | | import javax.websocket.server.PathParam; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | /** |
| | | * websocket 消息处理 |
| | | * |
| | | * @author ruoyi |
| | | * @作者 ruoyi |
| | | */ |
| | | @Component |
| | | @ServerEndpoint("/websocket/message") |
| | | @ServerEndpoint("/websocket/message/{clientType}") |
| | | public class WebSocketServer { |
| | | |
| | | /** |
| | | * WebSocketServer 日志控制器 |
| | | */ |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketServer.class); |
| | | |
| | | /** |
| | | * 默认最多允许同时在线人数100 |
| | | */ |
| | | public static int socketMaxOnlineCount = 100; |
| | | |
| | | public static int socketMaxOnlineCount = 1000; |
| | | private static Semaphore socketSemaphore = new Semaphore(socketMaxOnlineCount); |
| | | |
| | | /** |
| | | * 连接建立成功调用的方法 |
| | | */ |
| | | @OnOpen |
| | | public void onOpen(Session session) throws Exception { |
| | | public void onOpen(Session session, @PathParam("clientType") Integer clientType) |
| | | throws Exception { |
| | | boolean semaphoreFlag = false; |
| | | // 尝试获取信号量 |
| | | semaphoreFlag = SemaphoreUtils.tryAcquire(socketSemaphore); |
| | | if (!semaphoreFlag) { |
| | | // 未获取到信号量 |
| | | LOGGER.error("\n 当前在线人数超过限制数- {}", socketMaxOnlineCount); |
| | | WebSocketUsers.sendMessageToUserByText(session, |
| | | "当前在线人数超过限制数:" + socketMaxOnlineCount); |
| | | session.close(); |
| | | } else { |
| | | // 添加用户 |
| | | WebSocketUsers.put(session.getId(), session); |
| | | WebSocketUsers.put(session.getId(), session, clientType); |
| | | LOGGER.info("\n 建立连接 - {}", session); |
| | | LOGGER.info("\n 当前人数 - {}", WebSocketUsers.getUsers().size()); |
| | | WebSocketUsers.sendMessageToUserByText(session, "连接成功"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 连接关闭时处理 |
| | | */ |
| | | @OnClose |
| | | public void onClose(Session session) { |
| | | LOGGER.info("\n 关闭连接 - {}", session); |
| | | // 移除用户 |
| | | WebSocketUsers.remove(session.getId()); |
| | | // 获取到信号量则需释放 |
| | | SemaphoreUtils.release(socketSemaphore); |
| | | } |
| | | |
| | | /** |
| | | * 抛出异常时处理 |
| | | */ |
| | | @OnError |
| | | public void onError(Session session, Throwable exception) throws Exception { |
| | | if (session.isOpen()) { |
| | | // 关闭连接 |
| | | session.close(); |
| | | } |
| | | String sessionId = session.getId(); |
| | | LOGGER.info("\n 连接异常 - {}", sessionId); |
| | | LOGGER.info("\n 异常信息 - {}", exception); |
| | | // 移出用户 |
| | | WebSocketUsers.remove(sessionId); |
| | | // 获取到信号量则需释放 |
| | | SemaphoreUtils.release(socketSemaphore); |
| | | } |
| | | |
| | | /** |
| | | * 服务器接收到客户端消息时调用的方法 |
| | | */ |
| | | @OnMessage |
| | | public void onMessage(String message, Session session) { |
| | | String msg = message.replace("你", "我").replace("吗", ""); |
| | | String msg = message.replace("你", "我").replace("吗", "").replace("PING", "PONG") |
| | | .replace("ping", "pong"); |
| | | WebSocketUsers.sendMessageToUserByText(session, msg); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.websocket; |
| | | |
| | | import com.ruoyi.system.api.util.WebSocketUsers_Bak; |
| | | import java.util.concurrent.Semaphore; |
| | | import javax.websocket.OnClose; |
| | | import javax.websocket.OnError; |
| | | import javax.websocket.OnMessage; |
| | | import javax.websocket.OnOpen; |
| | | import javax.websocket.Session; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * websocket 消息处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | @ServerEndpoint("/websocket/message") |
| | | public class WebSocketServer_Bak { |
| | | |
| | | /** |
| | | * WebSocketServer 日志控制器 |
| | | */ |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketServer_Bak.class); |
| | | |
| | | /** |
| | | * 默认最多允许同时在线人数100 |
| | | */ |
| | | public static int socketMaxOnlineCount = 100; |
| | | |
| | | private static Semaphore socketSemaphore = new Semaphore(socketMaxOnlineCount); |
| | | |
| | | /** |
| | | * 连接建立成功调用的方法 |
| | | */ |
| | | @OnOpen |
| | | public void onOpen(Session session) throws Exception { |
| | | boolean semaphoreFlag = false; |
| | | // 尝试获取信号量 |
| | | semaphoreFlag = SemaphoreUtils.tryAcquire(socketSemaphore); |
| | | if (!semaphoreFlag) { |
| | | // 未获取到信号量 |
| | | LOGGER.error("\n 当前在线人数超过限制数- {}", socketMaxOnlineCount); |
| | | WebSocketUsers_Bak.sendMessageToUserByText(session, |
| | | "当前在线人数超过限制数:" + socketMaxOnlineCount); |
| | | session.close(); |
| | | } else { |
| | | // 添加用户 |
| | | WebSocketUsers_Bak.put(session.getId(), session); |
| | | LOGGER.info("\n 建立连接 - {}", session); |
| | | LOGGER.info("\n 当前人数 - {}", WebSocketUsers_Bak.getUsers().size()); |
| | | WebSocketUsers_Bak.sendMessageToUserByText(session, "连接成功"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 连接关闭时处理 |
| | | */ |
| | | @OnClose |
| | | public void onClose(Session session) { |
| | | LOGGER.info("\n 关闭连接 - {}", session); |
| | | // 移除用户 |
| | | WebSocketUsers_Bak.remove(session.getId()); |
| | | // 获取到信号量则需释放 |
| | | SemaphoreUtils.release(socketSemaphore); |
| | | } |
| | | |
| | | /** |
| | | * 抛出异常时处理 |
| | | */ |
| | | @OnError |
| | | public void onError(Session session, Throwable exception) throws Exception { |
| | | if (session.isOpen()) { |
| | | // 关闭连接 |
| | | session.close(); |
| | | } |
| | | String sessionId = session.getId(); |
| | | LOGGER.info("\n 连接异常 - {}", sessionId); |
| | | LOGGER.info("\n 异常信息 - {}", exception); |
| | | // 移出用户 |
| | | WebSocketUsers_Bak.remove(sessionId); |
| | | // 获取到信号量则需释放 |
| | | SemaphoreUtils.release(socketSemaphore); |
| | | } |
| | | |
| | | /** |
| | | * 服务器接收到客户端消息时调用的方法 |
| | | */ |
| | | @OnMessage |
| | | public void onMessage(String message, Session session) { |
| | | String msg = message.replace("你", "我").replace("吗", ""); |
| | | WebSocketUsers_Bak.sendMessageToUserByText(session, msg); |
| | | } |
| | | } |