yshop1.6发布:新增砍价功能,新增加锁功能,修复其他bug

This commit is contained in:
hupeng
2019-12-23 20:08:36 +08:00
parent e37cc2c952
commit a2942f608d
55 changed files with 2493 additions and 79 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId>
<version>1.5</version>
<version>1.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -20,12 +20,12 @@
<dependency>
<groupId>co.yixiang</groupId>
<artifactId>yshop-logging</artifactId>
<version>1.5</version>
<version>1.6</version>
</dependency>
<dependency>
<groupId>co.yixiang</groupId>
<artifactId>yshop-mp</artifactId>
<version>1.5</version>
<version>1.6</version>
</dependency>
</dependencies>

View File

@ -4,6 +4,8 @@ import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.io.Serializable;
@ -30,26 +32,32 @@ public class YxStoreBargain implements Serializable {
// 砍价活动名称
@Column(name = "title",nullable = false)
@NotBlank(message = "请输入砍价活动名称")
private String title;
// 砍价活动图片
@Column(name = "image",nullable = false)
@NotBlank(message = "请上传产品图片")
private String image;
// 单位名称
@Column(name = "unit_name")
@NotBlank(message = "单位名不能为空")
private String unitName;
// 库存
@Column(name = "stock")
@NotNull(message = "库存必填")
private Integer stock;
// 销量
@Column(name = "sales")
@NotNull(message = "销量必填")
private Integer sales;
// 砍价产品轮播图
@Column(name = "images",nullable = false)
@NotBlank(message = "请上传产品轮播图")
private String images;
// 砍价开启时间
@ -72,30 +80,39 @@ public class YxStoreBargain implements Serializable {
// 砍价金额
@Column(name = "price")
@NotNull(message = "砍价金额必填")
@Min(value = 0,message = "砍价金额必须大于等于0")
private BigDecimal price;
// 砍价商品最低价
@Column(name = "min_price")
@NotNull(message = "砍价商品最低价必填")
@Min(value = 0,message = "砍价商品最低价必须大于等于0")
private BigDecimal minPrice;
// 每次购买的砍价产品数量
@Column(name = "num")
@NotNull(message = "购买的砍价产品数量必填")
@Min(value = 0,message = "购买的砍价产品数量必须大于等于0")
private Integer num;
// 用户每次砍价的最大金额
@Column(name = "bargain_max_price")
@NotNull(message = "砍价的最大金额必填")
private BigDecimal bargainMaxPrice;
// 用户每次砍价的最小金额
@Column(name = "bargain_min_price")
@NotNull(message = "砍价的最小金额必填")
private BigDecimal bargainMinPrice;
// 用户每次砍价的次数
@Column(name = "bargain_num",nullable = false)
@Column(name = "bargain_num",insertable = false)
private Integer bargainNum;
// 砍价状态 0(到砍价时间不自动开启) 1(到砍价时间自动开启时间)
@Column(name = "status",nullable = false)
@NotNull(message = "请选择活动状态")
private Integer status;
// 砍价详情
@ -103,7 +120,7 @@ public class YxStoreBargain implements Serializable {
private String description;
// 反多少积分
@Column(name = "give_integral",nullable = false)
@Column(name = "give_integral",insertable = false)
private BigDecimal giveIntegral;
// 砍价活动简介
@ -112,18 +129,20 @@ public class YxStoreBargain implements Serializable {
// 成本价
@Column(name = "cost")
@NotNull(message = "成本价必填")
private BigDecimal cost;
// 排序
@Column(name = "sort",nullable = false)
@NotNull(message = "排序必填")
private Integer sort;
// 是否推荐0不推荐1推荐
@Column(name = "is_hot",nullable = false)
@Column(name = "is_hot",insertable = false)
private Integer isHot;
// 是否删除 0未删除 1删除
@Column(name = "is_del",nullable = false)
@Column(name = "is_del",insertable = false)
private Integer isDel;
// 添加时间
@ -132,6 +151,7 @@ public class YxStoreBargain implements Serializable {
// 是否包邮 0不包邮 1包邮
@Column(name = "is_postage",nullable = false)
@NotNull(message = "请选择是否包邮")
private Integer isPostage;
// 邮费
@ -143,11 +163,11 @@ public class YxStoreBargain implements Serializable {
private String rule;
// 砍价产品浏览量
@Column(name = "look")
@Column(name = "look",insertable = false)
private Integer look;
// 砍价产品分享量
@Column(name = "share")
@Column(name = "share",insertable = false)
private Integer share;
public void copy(YxStoreBargain source){

View File

@ -1,7 +1,9 @@
package co.yixiang.modules.activity.rest;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.aop.log.Log;
import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.activity.domain.YxStoreBargain;
import co.yixiang.modules.activity.service.YxStoreBargainService;
import co.yixiang.modules.activity.service.dto.YxStoreBargainQueryCriteria;
@ -65,6 +67,7 @@ public class YxStoreBargainController {
@DeleteMapping(value = "/yxStoreBargain/{id}")
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
yxStoreBargainService.delete(id);
return new ResponseEntity(HttpStatus.OK);
}