新增:erp、erp-spi
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao-dependencies</artifactId>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>zsw-spi</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>${project.artifactId}</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<!--<dependencies> <!– 5. 新增依赖,这里引入的都是比较常用的业务组件、技术组件 –>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>zsw-farm-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!– 业务组件 –>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!– Web 相关 –>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!– DB 相关 –>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!– Test 测试相关 –>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>-->
|
||||
</project>
|
||||
@@ -0,0 +1,224 @@
|
||||
package com.zsw.base;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.zsw.exception.BizException;
|
||||
import com.zsw.exception.code.BaseExceptionCode;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuppressWarnings("ALL")
|
||||
@Accessors(chain = true)
|
||||
public class R<T> implements Serializable {
|
||||
private static final long serialversionUID = 1L;
|
||||
public static final String DEF_ERROR_MESSAGE = "系统繁忙,请稍候再试";
|
||||
public static final String HYSTRIX_ERROR_MESSAGE = "请求超时,请稍候再试";
|
||||
public static final int SUCCESS_CODE = 200;
|
||||
public static final int FAIL_CODE = -1;
|
||||
public static final int TIMEOUT_CODE = -2;
|
||||
/**
|
||||
* 统一参数验证异常
|
||||
*/
|
||||
public static final int VALID_EX_CODE = -9;
|
||||
public static final int OPERATION_EX_CODE = -10;
|
||||
/**
|
||||
* 调用是否成功标识,0:成功,-1:系统繁忙,此时请开发者稍候再试 详情见[ExceptionCode]
|
||||
*/
|
||||
@ApiModelProperty(value = "响应编码:0/200-请求处理成功")
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* 是否执行默认操作
|
||||
*/
|
||||
@JsonIgnore
|
||||
private Boolean defExec = true;
|
||||
|
||||
/**
|
||||
* 调用结果
|
||||
*/
|
||||
@ApiModelProperty(value = "响应数据")
|
||||
private T data;
|
||||
|
||||
/**
|
||||
* 结果消息,如果调用成功,消息通常为空T
|
||||
*/
|
||||
@ApiModelProperty(value = "提示消息")
|
||||
private String msg = "ok";
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModelProperty(value = "请求路径")
|
||||
private String path;
|
||||
/**
|
||||
* 附加数据
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModelProperty(value = "附加数据")
|
||||
private Map<String, Object> extra;
|
||||
|
||||
/**
|
||||
* 响应时间
|
||||
*/
|
||||
@ApiModelProperty(value = "响应时间戳")
|
||||
private LocalDateTime time = LocalDateTime.now();
|
||||
|
||||
private R() {
|
||||
super();
|
||||
}
|
||||
|
||||
public R(int code, T data, String msg) {
|
||||
this.code = code;
|
||||
this.data = data;
|
||||
this.msg = msg;
|
||||
this.defExec = false;
|
||||
}
|
||||
|
||||
public R(int code, T data, String msg, boolean defExec) {
|
||||
this.code = code;
|
||||
this.data = data;
|
||||
this.msg = msg;
|
||||
this.defExec = defExec;
|
||||
}
|
||||
|
||||
public static <E> R<E> result(int code, E data, String msg) {
|
||||
return new R<E>(code, data, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求成功消息
|
||||
*
|
||||
* @param data 结果
|
||||
* @return RPC调用结果
|
||||
*/
|
||||
public static <E> R<E> success(E data) {
|
||||
return new R<E>(SUCCESS_CODE, data, "ok");
|
||||
}
|
||||
|
||||
public static R<Boolean> success() {
|
||||
return new R<Boolean>(SUCCESS_CODE, true, "ok");
|
||||
}
|
||||
|
||||
|
||||
public static <E> R<E> successDef(E data) {
|
||||
return new R<E>(SUCCESS_CODE, data, "ok", true);
|
||||
}
|
||||
|
||||
public static <E> R<E> successDef() {
|
||||
return new R<E>(SUCCESS_CODE, null, "ok", true);
|
||||
}
|
||||
|
||||
public static <E> R<E> successDef(E data, String msg) {
|
||||
return new R<E>(SUCCESS_CODE, data, msg, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求成功方法 ,data返回值,msg提示信息
|
||||
*
|
||||
* @param data 结果
|
||||
* @param msg 消息
|
||||
* @return RPC调用结果
|
||||
*/
|
||||
public static <E> R<E> success(E data, String msg) {
|
||||
return new R<E>(SUCCESS_CODE, data, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求失败消息
|
||||
*
|
||||
* @param msg
|
||||
* @return
|
||||
*/
|
||||
public static <E> R<E> fail(int code, String msg) {
|
||||
return new R<E>(code, null, (msg == null || msg.isEmpty()) ? DEF_ERROR_MESSAGE : msg);
|
||||
}
|
||||
|
||||
public static <E> R<E> fail(String msg) {
|
||||
return fail(OPERATION_EX_CODE, msg);
|
||||
}
|
||||
|
||||
public static <E> R<E> fail(String msg, Object... args) {
|
||||
String message = (msg == null || msg.isEmpty()) ? DEF_ERROR_MESSAGE : msg;
|
||||
return new R<E>(OPERATION_EX_CODE, null, String.format(message, args));
|
||||
}
|
||||
|
||||
public static <E> R<E> fail(BaseExceptionCode exceptionCode) {
|
||||
return validFail(exceptionCode);
|
||||
}
|
||||
|
||||
public static <E> R<E> fail(BizException exception) {
|
||||
if (exception == null) {
|
||||
return fail(DEF_ERROR_MESSAGE);
|
||||
}
|
||||
return new R<E>(exception.getCode(), null, exception.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求失败消息,根据异常类型,获取不同的提供消息
|
||||
*
|
||||
* @param throwable 异常
|
||||
* @return RPC调用结果
|
||||
*/
|
||||
public static <E> R<E> fail(Throwable throwable) {
|
||||
return fail(FAIL_CODE, throwable != null ? throwable.getMessage() : DEF_ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
public static <E> R<E> validFail(String msg) {
|
||||
return new R<E>(VALID_EX_CODE, null, (msg == null || msg.isEmpty()) ? DEF_ERROR_MESSAGE : msg);
|
||||
}
|
||||
|
||||
public static <E> R<E> validFail(String msg, Object... args) {
|
||||
String message = (msg == null || msg.isEmpty()) ? DEF_ERROR_MESSAGE : msg;
|
||||
return new R<E>(VALID_EX_CODE, null, String.format(message, args));
|
||||
}
|
||||
|
||||
public static <E> R<E> validFail(BaseExceptionCode exceptionCode) {
|
||||
return new R<E>(exceptionCode.getCode(), null,
|
||||
(exceptionCode.getMsg() == null || exceptionCode.getMsg().isEmpty()) ? DEF_ERROR_MESSAGE : exceptionCode.getMsg());
|
||||
}
|
||||
|
||||
public static <E> R<E> timeout() {
|
||||
return fail(TIMEOUT_CODE, HYSTRIX_ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
|
||||
public R<T> put(String key, Object value) {
|
||||
if (this.extra == null) {
|
||||
this.extra = new HashMap<String, Object>(10);
|
||||
}
|
||||
this.extra.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑处理是否成功
|
||||
*
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean getIsSuccess() {
|
||||
return this.code == SUCCESS_CODE || this.code == 200 || this.code == 0 || this.msg.equals("ok");
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑处理是否失败
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Boolean getIsError() {
|
||||
return !getIsSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSONUtil.toJsonStr(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.zsw.base.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 基础实体
|
||||
*
|
||||
* @author 云久
|
||||
* @date 2019/05/05
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@ToString(callSuper = true)
|
||||
public class Entity<T> extends SuperEntity<T> {
|
||||
|
||||
public static final String UPDATE_TIME = "updateTime";
|
||||
public static final String UPDATE_USER = "updateUser";
|
||||
private static final long serialVersionUID = 5169873634279173683L;
|
||||
|
||||
@ApiModelProperty(value = "最后修改时间",hidden = true)
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
protected LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(value = "最后修改人ID",hidden = true)
|
||||
@TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
|
||||
protected T updateUser;
|
||||
|
||||
public Entity(T id, LocalDateTime createTime, T createUser, LocalDateTime updateTime, T updateUser) {
|
||||
super(id, createTime, createUser);
|
||||
this.updateTime = updateTime;
|
||||
this.updateUser = updateUser;
|
||||
}
|
||||
|
||||
public Entity() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.zsw.base.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import jdk.nashorn.internal.objects.annotations.Getter;
|
||||
import jdk.nashorn.internal.objects.annotations.Setter;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Null;
|
||||
import javax.validation.groups.Default;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 基础实体
|
||||
*
|
||||
* @author 云久
|
||||
* @date 2019/05/05
|
||||
*/
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString(callSuper = true)
|
||||
public class SuperEntity<T> implements Serializable {
|
||||
public static final String FIELD_ID = "id";
|
||||
public static final String CREATE_TIME = "createTime";
|
||||
public static final String CREATE_TIME_COLUMN = "create_time";
|
||||
public static final String CREATE_USER = "createUser";
|
||||
public static final String CREATE_USER_COLUMN = "create_user";
|
||||
|
||||
private static final long serialVersionUID = -4603650115461757622L;
|
||||
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键|新增请删除")
|
||||
@NotNull(message = "id不能为空", groups = Update.class)
|
||||
@Null(message = "id错误", groups = Save.class)
|
||||
protected T id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间",hidden = true)
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
protected LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "创建人ID",hidden = true)
|
||||
@TableField(value = "create_user", fill = FieldFill.INSERT)
|
||||
protected T createUser;
|
||||
|
||||
/**
|
||||
* 保存和缺省验证组
|
||||
*/
|
||||
public interface Save extends Default {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新和缺省验证组
|
||||
*/
|
||||
public interface Update extends Default {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.zsw.base.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 树形实体
|
||||
*
|
||||
* @author 云久
|
||||
* @date 2019/05/05
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@ToString(callSuper = true)
|
||||
public class TreeEntity<E, T> extends Entity<T> {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(value = "名称")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
@Length(max = 255, message = "名称长度不能超过255")
|
||||
@TableField(value = "label")
|
||||
protected String label;
|
||||
|
||||
/**
|
||||
* 父ID
|
||||
*/
|
||||
@ApiModelProperty(value = "父ID")
|
||||
@TableField(value = "parent_id")
|
||||
protected T parentId;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ApiModelProperty(value = "排序号")
|
||||
@TableField(value = "sort_value")
|
||||
protected Integer sortValue;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "子节点", hidden = true)
|
||||
@TableField(exist = false)
|
||||
protected List<E> children;
|
||||
|
||||
|
||||
/**
|
||||
* 初始化子类
|
||||
*/
|
||||
public void initChildren() {
|
||||
if (getChildren() == null) {
|
||||
this.setChildren(new ArrayList<E>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.zsw.base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基于MP的 BaseMapper 新增了2个方法: insertBatchSomeColumn、updateAllById
|
||||
*
|
||||
* @param <T> 实体
|
||||
* @author 云久
|
||||
* @date 2020年03月06日11:06:46
|
||||
*/
|
||||
public interface SuperMapper<T> extends BaseMapper<T> {
|
||||
|
||||
/**
|
||||
* 全量修改所有字段
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
int updateAllById(@Param(Constants.ENTITY) T entity);
|
||||
|
||||
/**
|
||||
* 批量插入所有字段
|
||||
* <p>
|
||||
* 只测试过MySQL!只测试过MySQL!只测试过MySQL!
|
||||
*
|
||||
* @param entityList
|
||||
* @return
|
||||
*/
|
||||
int insertBatchSomeColumn(List<T> entityList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.zsw.base.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import com.zsw.base.mapper.SuperMapper;
|
||||
import com.zsw.exception.BizException;
|
||||
import com.zsw.exception.code.ExceptionCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基于MP的 IService 新增了2个方法: saveBatchSomeColumn、updateAllById
|
||||
* 其中:
|
||||
* 1,updateAllById 执行后,会清除缓存
|
||||
* 2,saveBatchSomeColumn 批量插入
|
||||
*
|
||||
* @param <T> 实体
|
||||
* @author 云久
|
||||
* @date 2020年03月03日20:49:03
|
||||
*/
|
||||
public interface SuperService<T> extends IService<T> {
|
||||
|
||||
/**
|
||||
* 批量保存数据
|
||||
* <p>
|
||||
* 注意:该方法仅仅测试过mysql
|
||||
*
|
||||
* @param entityList
|
||||
* @return
|
||||
*/
|
||||
default boolean saveBatchSomeColumn(List<T> entityList) {
|
||||
if (entityList.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
if (entityList.size() > 5000) {
|
||||
throw BizException.wrap(ExceptionCode.TOO_MUCH_DATA_ERROR);
|
||||
}
|
||||
return SqlHelper.retBool(((SuperMapper) getBaseMapper()).insertBatchSomeColumn(entityList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id修改 entity 的所有字段
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
boolean updateAllById(T entity);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.zsw.enums;
|
||||
|
||||
/**
|
||||
* 用户类型枚举
|
||||
*
|
||||
* @author xggz <yyimba@qq.com>
|
||||
* @since 2021/6/17 15:24
|
||||
*/
|
||||
public enum UserType {
|
||||
|
||||
/**
|
||||
* 小程序用户
|
||||
*/
|
||||
MINI,
|
||||
|
||||
/**
|
||||
* 商家账号
|
||||
*/
|
||||
BUSINESS,
|
||||
|
||||
/**
|
||||
* 平台管理账号
|
||||
*/
|
||||
PLATFORM_ADMIN,
|
||||
|
||||
/**
|
||||
* 平台App账号
|
||||
*/
|
||||
PLATFORM_APP;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.zsw.exception;
|
||||
|
||||
/**
|
||||
* 运行期异常基类
|
||||
*
|
||||
* @author 云久
|
||||
* @version 1.0
|
||||
* @see Exception
|
||||
*/
|
||||
public abstract class BaseCheckedException extends Exception implements BaseException {
|
||||
|
||||
private static final long serialVersionUID = 2706069899924648586L;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
protected String message;
|
||||
|
||||
/**
|
||||
* 具体异常码
|
||||
*/
|
||||
protected int code;
|
||||
|
||||
public BaseCheckedException(int code, String message) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public BaseCheckedException(int code, String format, Object... args) {
|
||||
super(String.format(format, args));
|
||||
this.code = code;
|
||||
this.message = String.format(format, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.zsw.exception;
|
||||
|
||||
/**
|
||||
* 异常接口类
|
||||
*
|
||||
* @author 云久
|
||||
* @version 1.0,
|
||||
*/
|
||||
public interface BaseException {
|
||||
|
||||
/**
|
||||
* 统一参数验证异常码
|
||||
*/
|
||||
int BASE_VALID_PARAM = -9;
|
||||
|
||||
/**
|
||||
* 返回异常信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getMessage();
|
||||
|
||||
/**
|
||||
* 返回异常编码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int getCode();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.zsw.exception;
|
||||
|
||||
/**
|
||||
* 非运行期异常基类,所有自定义非运行时异常继承该类
|
||||
*
|
||||
* @author 云久
|
||||
* @version 1.0,
|
||||
* @see RuntimeException
|
||||
*/
|
||||
public class BaseUncheckedException extends RuntimeException implements BaseException {
|
||||
|
||||
private static final long serialVersionUID = -778887391066124051L;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
protected String message;
|
||||
|
||||
/**
|
||||
* 具体异常码
|
||||
*/
|
||||
protected int code;
|
||||
|
||||
public BaseUncheckedException(int code, String message) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public BaseUncheckedException(int code, String format, Object... args) {
|
||||
super(String.format(format, args));
|
||||
this.code = code;
|
||||
this.message = String.format(format, args);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.zsw.exception;
|
||||
|
||||
import com.zsw.exception.code.BaseExceptionCode;
|
||||
|
||||
/**
|
||||
* 业务异常
|
||||
* 用于在处理业务逻辑时,进行抛出的异常。
|
||||
*
|
||||
* @author 云久
|
||||
* @version 1.0,
|
||||
* @see Exception
|
||||
*/
|
||||
public class BizException extends BaseUncheckedException {
|
||||
|
||||
private static final long serialVersionUID = -3843907364558373817L;
|
||||
|
||||
public BizException(String message) {
|
||||
super(-1, message);
|
||||
}
|
||||
|
||||
public BizException(int code, String message) {
|
||||
super(code, message);
|
||||
}
|
||||
|
||||
public BizException(int code, String message, Object... args) {
|
||||
super(code, message, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实例化异常
|
||||
*
|
||||
* @param code 自定义异常编码
|
||||
* @param message 自定义异常消息
|
||||
* @param args 已定义异常参数
|
||||
* @return
|
||||
*/
|
||||
public static BizException wrap(int code, String message, Object... args) {
|
||||
return new BizException(code, message, args);
|
||||
}
|
||||
|
||||
public static BizException wrap(String message, Object... args) {
|
||||
return new BizException(-1, message, args);
|
||||
}
|
||||
|
||||
public static BizException validFail(String message, Object... args) {
|
||||
return new BizException(-9, message, args);
|
||||
}
|
||||
|
||||
public static BizException wrap(BaseExceptionCode ex) {
|
||||
return new BizException(ex.getCode(), ex.getMsg());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BizException [message=" + message + ", code=" + code + "]";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zsw.exception;
|
||||
|
||||
/**
|
||||
* 非业务异常
|
||||
* 用于在处理非业务逻辑时,进行抛出的异常。
|
||||
*
|
||||
* @author 云久
|
||||
* @version 1.0
|
||||
* @see Exception
|
||||
*/
|
||||
public class CommonException extends BaseCheckedException {
|
||||
|
||||
|
||||
public CommonException(int code, String message) {
|
||||
super(code, message);
|
||||
}
|
||||
|
||||
public CommonException(int code, String format, Object... args) {
|
||||
super(code, String.format(format, args));
|
||||
this.code = code;
|
||||
this.message = String.format(format, args);
|
||||
}
|
||||
|
||||
public CommonException wrap(int code, String format, Object... args) {
|
||||
return new CommonException(code, format, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BizException [message=" + message + ", code=" + code + "]";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zsw.exception.code;
|
||||
|
||||
|
||||
public interface BaseExceptionCode {
|
||||
/**
|
||||
* 异常编码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int getCode();
|
||||
|
||||
/**
|
||||
* 异常消息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getMsg();
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zsw.exception.code;
|
||||
|
||||
|
||||
/**
|
||||
* 全局错误码 10000-15000
|
||||
* <p>
|
||||
* 预警异常编码 范围: 30000~34999
|
||||
* 标准服务异常编码 范围:35000~39999
|
||||
* 邮件服务异常编码 范围:40000~44999
|
||||
* 短信服务异常编码 范围:45000~49999
|
||||
* 权限服务异常编码 范围:50000-59999
|
||||
* 文件服务异常编码 范围:60000~64999
|
||||
* 日志服务异常编码 范围:65000~69999
|
||||
* 消息服务异常编码 范围:70000~74999
|
||||
* 开发者平台异常编码 范围:75000~79999
|
||||
* 搜索服务异常编码 范围:80000-84999
|
||||
* 共享交换异常编码 范围:85000-89999
|
||||
* 移动终端平台 异常码 范围:90000-94999
|
||||
* <p>
|
||||
* 安全保障平台 范围: 95000-99999
|
||||
* 软硬件平台 异常编码 范围: 100000-104999
|
||||
* 运维服务平台 异常编码 范围: 105000-109999
|
||||
* 统一监管平台异常 编码 范围: 110000-114999
|
||||
* 认证方面的异常编码 范围:115000-115999
|
||||
*
|
||||
* @author 云久
|
||||
* @createTime 2017-12-13 16:22
|
||||
*/
|
||||
public enum ExceptionCode implements BaseExceptionCode {
|
||||
|
||||
//系统相关 start
|
||||
SUCCESS(0, "成功"),
|
||||
SYSTEM_BUSY(-1, "系统繁忙~请稍后再试~"),
|
||||
SYSTEM_TIMEOUT(-2, "系统维护中~请稍后再试~"),
|
||||
PARAM_EX(-3, "参数类型解析异常"),
|
||||
SQL_EX(-4, "运行SQL出现异常"),
|
||||
NULL_POINT_EX(-5, "空指针异常"),
|
||||
ILLEGALA_ARGUMENT_EX(-6, "无效参数异常"),
|
||||
MEDIA_TYPE_EX(-7, "请求类型异常"),
|
||||
LOAD_RESOURCES_ERROR(-8, "加载资源出错"),
|
||||
BASE_VALID_PARAM(-9, "统一验证参数异常"),
|
||||
OPERATION_EX(-10, "操作异常"),
|
||||
SERVICE_MAPPER_ERROR(-11, "Mapper类转换异常"),
|
||||
CAPTCHA_ERROR(-12, "验证码校验失败"),
|
||||
DuplicateKey(-13,"数据重复"),
|
||||
|
||||
OK(200, "OK"),
|
||||
BAD_REQUEST(400, "错误的请求"),
|
||||
/**
|
||||
* {@code 401 Unauthorized}.
|
||||
*
|
||||
* @see <a href="http://tools.ietf.org/html/rfc7235#section-3.1">HTTP/1.1: Authentication, section 3.1</a>
|
||||
*/
|
||||
UNAUTHORIZED(401, "未经授权"),
|
||||
/**
|
||||
* {@code 404 Not Found}.
|
||||
*
|
||||
* @see <a href="http://tools.ietf.org/html/rfc7231#section-6.5.4">HTTP/1.1: Semantics and Content, section 6.5.4</a>
|
||||
*/
|
||||
NOT_FOUND(404, "没有找到资源"),
|
||||
METHOD_NOT_ALLOWED(405, "不支持当前请求类型"),
|
||||
|
||||
TOO_MANY_REQUESTS(429, "请求超过次数限制"),
|
||||
INTERNAL_SERVER_ERROR(500, "内部服务错误"),
|
||||
BAD_GATEWAY(502, "网关错误"),
|
||||
GATEWAY_TIMEOUT(504, "网关超时"),
|
||||
//系统相关 end
|
||||
|
||||
REQUIRED_FILE_PARAM_EX(1001, "请求中必须至少包含一个有效文件"),
|
||||
|
||||
DATA_SAVE_ERROR(2000, "新增数据失败"),
|
||||
DATA_UPDATE_ERROR(2001, "修改数据失败"),
|
||||
TOO_MUCH_DATA_ERROR(2002, "批量新增数据过多"),
|
||||
//jwt token 相关 start
|
||||
|
||||
JWT_BASIC_INVALID(40000, "无效的基本身份验证令牌"),
|
||||
JWT_TOKEN_EXPIRED(40001, "会话超时,请重新登录"),
|
||||
JWT_SIGNATURE(40002, "不合法的token,请认真比对 token 的签名"),
|
||||
JWT_ILLEGAL_ARGUMENT(40003, "缺少token参数"),
|
||||
JWT_GEN_TOKEN_FAIL(40004, "生成token失败"),
|
||||
JWT_PARSER_TOKEN_FAIL(40005, "解析用户身份错误,请重新登录!"),
|
||||
JWT_USER_INVALID(40006, "用户名或密码错误"),
|
||||
JWT_USER_ENABLED(40007, "用户已经被禁用!"),
|
||||
JWT_OFFLINE(40008, "您已在另一个设备登录!"),
|
||||
USER_NOT_BIND_PLATFORM(40030,"您没有注册平台会员,暂不支持本操作"),
|
||||
//jwt token 相关 end
|
||||
|
||||
;
|
||||
|
||||
private int code;
|
||||
private String msg;
|
||||
|
||||
ExceptionCode(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
public ExceptionCode build(String msg, Object... param) {
|
||||
this.msg = String.format(msg, param);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ExceptionCode param(Object... param) {
|
||||
msg = String.format(msg, param);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.zsw.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* AuthInfo
|
||||
*
|
||||
* @author 云久
|
||||
* @date 2020年03月31日21:43:31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(description = "认证信息")
|
||||
public class AuthInfo {
|
||||
@ApiModelProperty(value = "令牌")
|
||||
private String token;
|
||||
@ApiModelProperty(value = "令牌类型")
|
||||
private String tokenType;
|
||||
@ApiModelProperty(value = "刷新令牌")
|
||||
private String refreshToken;
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "账号名")
|
||||
private String account;
|
||||
@ApiModelProperty(value = "头像")
|
||||
private String avatar;
|
||||
@ApiModelProperty(value = "工作描述")
|
||||
private String workDescribe;
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
@ApiModelProperty(value = "用户类型")
|
||||
private String userType;
|
||||
@ApiModelProperty(value = "过期时间(秒)")
|
||||
private long expire;
|
||||
@ApiModelProperty(value = "到期时间")
|
||||
private Date expiration;
|
||||
@ApiModelProperty(value = "注册手机号")
|
||||
private String mobile;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zsw.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ApiModel("登录查找的门店信息")
|
||||
@Builder
|
||||
public class AuthStore implements Serializable {
|
||||
|
||||
@ApiModelProperty("门店id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("门店名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "商户类型")
|
||||
private String posType;
|
||||
|
||||
@ApiModelProperty("是否启用了进销存")
|
||||
private Boolean useErp;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.zsw.model;
|
||||
|
||||
import com.zsw.enums.UserType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* jwt 存储的 内容
|
||||
*
|
||||
* @author 云久
|
||||
* @date 2018/11/20
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class JwtUserInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private UserType userType;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.zsw.model;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "商户认证信息")
|
||||
@ToString(callSuper = true)
|
||||
public class TenantAuthInfo extends AuthInfo {
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String tenantCode;
|
||||
|
||||
@ApiModelProperty("是否是商户管理员")
|
||||
private Boolean isAdmin = false;
|
||||
|
||||
@ApiModelProperty("店铺列表")
|
||||
private List<AuthStore> storeList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zsw.model;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Token implements Serializable {
|
||||
private static final long serialVersionUID = -8482946147572784305L;
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
@ApiModelProperty(value = "token")
|
||||
private String token;
|
||||
/**
|
||||
* 有效时间:单位:秒
|
||||
*/
|
||||
@ApiModelProperty(value = "有效期")
|
||||
private Long expire;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "到期时间")
|
||||
private Date expiration;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.zsw.pos.authority.dto.auth;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 登录参数
|
||||
*
|
||||
* @author 云久
|
||||
* @date 2020年01月05日22:18:12
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Builder
|
||||
@ApiModel(value = "LoginParamDTO", description = "登录参数")
|
||||
public class LoginParamDTO implements Serializable {
|
||||
@ApiModelProperty(value = "验证码KEY")
|
||||
private String key;
|
||||
@ApiModelProperty(value = "验证码")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "账号")
|
||||
private String account;
|
||||
@ApiModelProperty(value = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* password: 账号密码
|
||||
* refresh_token: 刷新token
|
||||
* captcha: 验证码
|
||||
*/
|
||||
@ApiModelProperty(value = "授权类型", example = "captcha", allowableValues = "captcha,refresh_token,password")
|
||||
@NotEmpty(message = "授权类型不能为空")
|
||||
private String grantType;
|
||||
|
||||
/**
|
||||
* 前端界面点击清空缓存时调用
|
||||
*/
|
||||
@ApiModelProperty(value = "刷新token")
|
||||
private String refreshToken;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.zsw.pos.oauth.service;
|
||||
|
||||
import com.zsw.base.R;
|
||||
import com.zsw.model.TenantAuthInfo;
|
||||
import com.zsw.pos.authority.dto.auth.LoginParamDTO;
|
||||
|
||||
public interface LoginService {
|
||||
|
||||
R<TenantAuthInfo> grant(LoginParamDTO loginParam);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.zsw.pos.product.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel("查询店铺商品使用")
|
||||
@Data
|
||||
public class AdminStoreProductDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("是否查询新品")
|
||||
private Integer newItem;
|
||||
|
||||
@ApiModelProperty("价格排序 -1-从小到大 0-不排序 1-从大到小")
|
||||
private Integer price;
|
||||
|
||||
@ApiModelProperty("销量排序 -1-从小到大 0-不排序 1-从大到小")
|
||||
private Integer sellCount;
|
||||
|
||||
@ApiModelProperty("页码 从1开始")
|
||||
private Integer pageIndex;
|
||||
|
||||
@ApiModelProperty("每页大小")
|
||||
private Integer pageSize;
|
||||
|
||||
@ApiModelProperty(value = "起始行; 内部使用", hidden = true)
|
||||
private Integer start;
|
||||
|
||||
@ApiModelProperty(value = "排序条件; 内部使用", hidden = true)
|
||||
private String orderBy;
|
||||
|
||||
@ApiModelProperty("店铺id, 小程序查询需要传这个参数, 管理后台不用")
|
||||
private Long storeId;
|
||||
|
||||
@ApiModelProperty("分组id")
|
||||
private Long groupId;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.zsw.pos.product.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ApiModel("只需要根据id查询的接口参数对象")
|
||||
public class IdQueryDTO implements Serializable {
|
||||
|
||||
@ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zsw.pos.product.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ApiModel("商详店铺信息")
|
||||
public class StoreDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long id;
|
||||
|
||||
private String storeName;
|
||||
|
||||
@ApiModelProperty("别名")
|
||||
private String nickName;
|
||||
|
||||
@ApiModelProperty("店铺图像")
|
||||
private String logo;
|
||||
|
||||
@ApiModelProperty("商品总类")
|
||||
private Integer productCount;
|
||||
|
||||
@ApiModelProperty("已售数量")
|
||||
private Integer soldNum;
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
package com.zsw.pos.product.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.zsw.base.entity.Entity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实体类
|
||||
* 商品表
|
||||
* </p>
|
||||
*
|
||||
* @author JustArgo
|
||||
* @since 2020-05-24
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("ceres_product")
|
||||
@ApiModel(value = "Product", description = "商品表")
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class Product extends Entity<Long> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@ApiModelProperty(value = "供应商")
|
||||
@NotEmpty(message = "供应商不能为空")
|
||||
@TableField(value = "supplier_name", condition = LIKE)
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
@NotNull(message = "店铺id不能为空")
|
||||
@TableField("store_id")
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* 商品类目ID.必须是叶子类目ID
|
||||
*/
|
||||
@ApiModelProperty(value = "商品类目ID.必须是叶子类目ID")
|
||||
@TableField("category_id")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
@ApiModelProperty(value = "分组id")
|
||||
@TableField("group_id")
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 商品简称
|
||||
*/
|
||||
@ApiModelProperty(value = "商品简称")
|
||||
@TableField(value = "short_name", condition = LIKE)
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
@TableField(value = "product_name", condition = LIKE)
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 商品卖点说明文字 例如:全网最便宜
|
||||
*/
|
||||
@ApiModelProperty(value = "商品卖点说明文字 例如:全网最便宜")
|
||||
@TableField(value = "sell_desc", condition = LIKE)
|
||||
private String sellDesc;
|
||||
|
||||
/**
|
||||
* 商品自编号
|
||||
*/
|
||||
@ApiModelProperty(value = "商品自编号")
|
||||
@TableField(value = "product_code", condition = LIKE)
|
||||
private String productCode;
|
||||
|
||||
/**
|
||||
* 重量,单位:克
|
||||
*/
|
||||
@ApiModelProperty(value = "重量,单位:克")
|
||||
@TableField("weight")
|
||||
private Long weight;
|
||||
|
||||
/**
|
||||
* 采购价,单位:分
|
||||
*/
|
||||
@ApiModelProperty(value = "采购价,单位:分")
|
||||
@TableField("apply_price")
|
||||
private BigDecimal applyPrice;
|
||||
|
||||
/**
|
||||
* 商品列表时显示的价格
|
||||
*/
|
||||
@ApiModelProperty(value = "商品列表时显示的价格")
|
||||
@TableField("price")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 总库存
|
||||
*/
|
||||
@ApiModelProperty(value = "总库存")
|
||||
@NotNull(message = "总库存不能为空")
|
||||
@TableField("stock")
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
* 总销量
|
||||
*/
|
||||
@ApiModelProperty(value = "总销量")
|
||||
@TableField("sell_count")
|
||||
private Integer sellCount;
|
||||
|
||||
/**
|
||||
* 需要物流:1-需要 0-不需要
|
||||
*/
|
||||
@ApiModelProperty(value = "需要物流:1-需要 0-不需要")
|
||||
@TableField("need_logistics")
|
||||
private Integer needLogistics;
|
||||
|
||||
/**
|
||||
* 允许超卖:1-允许 0-不允许
|
||||
*/
|
||||
@ApiModelProperty(value = "允许超卖:1-允许 0-不允许")
|
||||
@TableField("oversold")
|
||||
private Integer oversold;
|
||||
|
||||
/**
|
||||
* 有机值
|
||||
*/
|
||||
@ApiModelProperty(value = "有机值")
|
||||
@TableField("organic")
|
||||
private Integer organic;
|
||||
|
||||
/**
|
||||
* 状态:1-上架 0-下架
|
||||
*/
|
||||
@ApiModelProperty(value = "状态:1-上架 0-下架")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否在小程序显示(0:否 1:是)")
|
||||
@TableField("pos_show")
|
||||
private Boolean posShow;
|
||||
|
||||
@ApiModelProperty(value = "商品类型(0:普通类型;1:拼盘类型)")
|
||||
@TableField("product_type")
|
||||
private Integer productType;
|
||||
|
||||
@ApiModelProperty("套餐购买数量 5选2")
|
||||
@TableField("product_number")
|
||||
private Integer productNumber;
|
||||
|
||||
/**
|
||||
* 套餐专属商品 0是 1不是
|
||||
*/
|
||||
@ApiModelProperty(value = "套餐专属商品 0是 1不是")
|
||||
@TableField("set_meal")
|
||||
private Integer setMeal;
|
||||
|
||||
/**
|
||||
* 款式类型:1-多款式 0-单款式
|
||||
*/
|
||||
@ApiModelProperty(value = "款式类型:1-多款式 0-单款式")
|
||||
@TableField("attr_style")
|
||||
private Integer attrStyle;
|
||||
|
||||
/**
|
||||
* 逻辑删除 1-删除 0-未删除
|
||||
*/
|
||||
@ApiModelProperty(value = "逻辑删除 1-删除 0-未删除")
|
||||
@NotNull(message = "逻辑删除 1-删除 0-未删除不能为空")
|
||||
@TableField("is_delete")
|
||||
private Integer isDelete;
|
||||
|
||||
@ApiModelProperty("打印分组标签")
|
||||
@TableField("printer_flag")
|
||||
private String printerFlag;
|
||||
|
||||
@ApiModelProperty("仓库成品物料id")
|
||||
@TableField("material_id")
|
||||
private Long materialId;
|
||||
|
||||
public String getPrinterFlag() {
|
||||
if (ObjectUtils.isEmpty(printerFlag)){
|
||||
return "DEFAULT";
|
||||
}
|
||||
return printerFlag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.zsw.pos.product.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.zsw.base.entity.Entity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实体类
|
||||
* 商品的sku
|
||||
* </p>
|
||||
*
|
||||
* @author JustArgo
|
||||
* @since 2020-05-18
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "ceres_product_sku",autoResultMap = true)
|
||||
@ApiModel(value = "ProductSku", description = "商品的sku")
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ProductSku extends Entity<Long> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
@NotNull(message = "店铺id不能为空")
|
||||
@TableField("store_id")
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* sku编码
|
||||
*/
|
||||
@ApiModelProperty(value = "sku编码")
|
||||
@Length(max = 255, message = "sku编码长度不能超过255")
|
||||
@TableField(value = "sku_code", condition = LIKE)
|
||||
private String skuCode;
|
||||
|
||||
/**
|
||||
* sku的规格值组合,例如:红色 43码
|
||||
*/
|
||||
@ApiModelProperty(value = "sku的规格值组合,例如:红色 43码")
|
||||
@Length(max = 255, message = "sku的规格值组合,例如:红色 43码长度不能超过255")
|
||||
@TableField(value = "sku_name_str", condition = LIKE)
|
||||
private String skuNameStr;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@ApiModelProperty(value = "商品id")
|
||||
@TableField("product_id")
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 销售价
|
||||
*/
|
||||
@ApiModelProperty(value = "销售价")
|
||||
@TableField("sku_price")
|
||||
private BigDecimal skuPrice;
|
||||
|
||||
/**
|
||||
* 采购价
|
||||
*/
|
||||
@ApiModelProperty(value = "采购价")
|
||||
@TableField("apply_price")
|
||||
private BigDecimal applyPrice;
|
||||
|
||||
@ApiModelProperty("会员价格")
|
||||
@TableField("vip_price")
|
||||
private BigDecimal vipPrice;
|
||||
|
||||
|
||||
/**
|
||||
* sku的图片
|
||||
*/
|
||||
@ApiModelProperty(value = "sku的图片")
|
||||
@Length(max = 200, message = "sku的图片长度不能超过200")
|
||||
@TableField(value = "sku_img", condition = LIKE)
|
||||
private String skuImg;
|
||||
|
||||
/**
|
||||
* sku的库存
|
||||
*/
|
||||
@ApiModelProperty(value = "sku的库存 只用于不启用进销存")
|
||||
@TableField("sku_stock")
|
||||
private Integer skuStock;
|
||||
|
||||
/**
|
||||
* 自动恢复库存(如果大于0,则每天凌晨恢复到设置的库存)
|
||||
*/
|
||||
@ApiModelProperty(value = "自动恢复库存")
|
||||
@TableField("auto_renew_sku_stock")
|
||||
private Integer autoRenewSkuStock;
|
||||
|
||||
@ApiModelProperty(value = "sku的排序")
|
||||
@TableField("sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* sku套餐
|
||||
*/
|
||||
@ApiModelProperty(value = "sku套餐")
|
||||
@TableField("set_meal")
|
||||
private String setMeal;
|
||||
|
||||
|
||||
/**
|
||||
* 重量,单位(千克)
|
||||
*/
|
||||
@ApiModelProperty(value = "重量,单位(千克)")
|
||||
@TableField("weight")
|
||||
private Double weight;
|
||||
|
||||
@ApiModelProperty(value = "体积,单位(平方米)")
|
||||
@TableField("volume")
|
||||
private Double volume;
|
||||
|
||||
/**
|
||||
* 逻辑删除 1-删除 0-未删除
|
||||
*/
|
||||
@ApiModelProperty(value = "逻辑删除 1-删除 0-未删除")
|
||||
@NotNull(message = "逻辑删除 1-删除 0-未删除不能为空")
|
||||
@TableField("is_delete")
|
||||
private Integer isDelete;
|
||||
|
||||
@ApiModelProperty("SKU的原材料信息")
|
||||
@TableField(value = "material",typeHandler = JacksonTypeHandler.class)
|
||||
private SkuMaterial material;
|
||||
|
||||
private Integer version;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.zsw.pos.product.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ApiModel("sku的物料设置")
|
||||
public class SkuMaterial {
|
||||
|
||||
@ApiModelProperty("成品id")
|
||||
@NotNull(message = "物料id不能为空")
|
||||
private Long materialId;
|
||||
|
||||
@ApiModelProperty("标准量")
|
||||
@NotNull(message = "标准数量不能为空")
|
||||
private BigDecimal num;
|
||||
|
||||
@ApiModelProperty("成品名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("是否可用")
|
||||
private Boolean enable;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zsw.pos.product.service;
|
||||
|
||||
|
||||
import com.zsw.base.R;
|
||||
import com.zsw.base.service.SuperService;
|
||||
import com.zsw.pos.product.dto.AdminStoreProductDTO;
|
||||
import com.zsw.pos.product.entity.Product;
|
||||
import com.zsw.pos.product.vo.ProductPageVO;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 业务接口
|
||||
* 商品表
|
||||
* </p>
|
||||
*
|
||||
* @author JustArgo
|
||||
* @date 2020-05-03
|
||||
*/
|
||||
public interface ProductService extends SuperService<Product> {
|
||||
|
||||
R<ProductPageVO> findAdminStoreProductList(AdminStoreProductDTO adminStoreProductDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.zsw.pos.product.service;
|
||||
|
||||
import com.zsw.base.service.SuperService;
|
||||
import com.zsw.pos.product.entity.ProductSku;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 业务接口
|
||||
* 商品的sku
|
||||
* </p>
|
||||
*
|
||||
* @author JustArgo
|
||||
* @date 2020-05-07
|
||||
*/
|
||||
public interface ProductSkuService extends SuperService<ProductSku> {
|
||||
|
||||
List<ProductSku> getProductSkuByMaterial(@Param("ids") List<Long> ids);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.zsw.pos.product.vo;
|
||||
|
||||
import com.zsw.pos.promotion.vo.web.PromotionShowVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("商品列表对象")
|
||||
@Data
|
||||
public class ProductPageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("商品列表")
|
||||
private List<ProductVO> productVOList;
|
||||
|
||||
@ApiModelProperty("商品符合的营销活动的列表")
|
||||
private List<PromotionShowVO> promotionShowVOList;
|
||||
|
||||
@ApiModelProperty("总数")
|
||||
private Integer total;
|
||||
|
||||
public ProductPageVO(){
|
||||
this.total = 0;
|
||||
this.productVOList = Collections.emptyList();
|
||||
}
|
||||
|
||||
public ProductPageVO(Integer total, List<ProductVO> productVOList){
|
||||
this.total = total;
|
||||
this.productVOList = productVOList;
|
||||
}
|
||||
|
||||
public ProductPageVO(Integer total, List<ProductVO> productVOList, List<PromotionShowVO> promotionShowVOList){
|
||||
this.total = total;
|
||||
this.productVOList = productVOList;
|
||||
this.promotionShowVOList = promotionShowVOList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.zsw.pos.product.vo;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.zsw.pos.product.dto.StoreDTO;
|
||||
import com.zsw.pos.product.entity.Product;
|
||||
import com.zsw.pos.promotion.dto.ProductSkuVO;
|
||||
import com.zsw.pos.promotion.vo.web.PromotionShowVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("商详对象")
|
||||
@Data
|
||||
public class ProductVO extends Product {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("商品图片列表")
|
||||
private List<String> imgs;
|
||||
|
||||
@ApiModelProperty("门店信息")
|
||||
private StoreDTO storeDTO;
|
||||
|
||||
@ApiModelProperty("规格列表")
|
||||
private JSONArray attrList;
|
||||
|
||||
@ApiModelProperty("商品sku列表")
|
||||
private List<ProductSkuVO> productSkuVOList;
|
||||
|
||||
@ApiModelProperty("发货地址")
|
||||
private String shipAddress;
|
||||
|
||||
@ApiModelProperty("付款人数")
|
||||
private Integer buyCount;
|
||||
|
||||
@ApiModelProperty("参加的活动列表")
|
||||
private List<PromotionShowVO> promotionShowVOList;
|
||||
|
||||
@ApiModelProperty("默认购买数量。。。")
|
||||
private Integer buyNum;
|
||||
|
||||
@ApiModelProperty("商品拼盘数据")
|
||||
JSONArray productPlatterInfos;
|
||||
|
||||
@ApiModelProperty("该商品被手动标记售罄")
|
||||
private Boolean markProductNone;
|
||||
|
||||
@ApiModelProperty("名称拼音")
|
||||
private String namePinyin;
|
||||
|
||||
@ApiModelProperty("首字母缩写")
|
||||
private String nameInitials;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.zsw.pos.promotion.dto;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.zsw.pos.product.entity.ProductSku;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实体类
|
||||
* 商品的sku
|
||||
* </p>
|
||||
*
|
||||
* @author JustArgo
|
||||
* @since 2020-05-16
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "ProductSkuSaveDTO", description = "商品的sku")
|
||||
public class ProductSkuSaveDTO extends ProductSku {
|
||||
|
||||
@ApiModelProperty(value = "sku对应的规格编码")
|
||||
private JSONArray skuAttrCodeDTOList;
|
||||
|
||||
@ApiModelProperty(value = "sku对应的规格列表,编辑商品时使用")
|
||||
private JSONArray skuAttrList;
|
||||
|
||||
@ApiModelProperty(value = "sku里的setMeal详情,点套餐时使用")
|
||||
private JSONArray setMealDTOList;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.zsw.pos.promotion.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("商品sku的前端返回对象")
|
||||
@Data
|
||||
public class ProductSkuVO extends ProductSkuSaveDTO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zsw.pos.promotion.vo.web;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 营销活动列表展示对象
|
||||
*/
|
||||
@ApiModel("营销活动列表展示对象")
|
||||
@Data
|
||||
public class PromotionShowVO {
|
||||
|
||||
@ApiModelProperty("营销活动的id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("营销活动的标签")
|
||||
private String tag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zsw.pos.store;
|
||||
|
||||
import com.zsw.base.service.SuperService;
|
||||
import com.zsw.pos.store.entity.Store;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 业务接口 店铺表
|
||||
* </p>
|
||||
*
|
||||
* @author kellen
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
|
||||
public interface StoreService extends SuperService<Store> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
package com.zsw.pos.store.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.zsw.base.entity.Entity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实体类 店铺表
|
||||
* </p>
|
||||
*
|
||||
* @author kellen
|
||||
* @since 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "ceres_store", autoResultMap = true)
|
||||
@ApiModel(value = "Store", description = "店铺表")
|
||||
@AllArgsConstructor
|
||||
public class Store extends Entity<Long> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "租户编号")
|
||||
private String tenantCode;
|
||||
|
||||
@ApiModelProperty(value = "是否用进销存管理库存(0:否;1:是)")
|
||||
@TableField(value = "use_erp")
|
||||
private Boolean useErp;
|
||||
|
||||
/**
|
||||
* 营业开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "营业开始时间")
|
||||
@TableField(value = "open_start_time")
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime openStartTime;
|
||||
|
||||
/**
|
||||
* 营业结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "营业结束时间")
|
||||
@TableField(value = "open_end_time")
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime openEndTime;
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
@Length(max = 200, message = "店铺名称长度不能超过200")
|
||||
@TableField(value = "store_name", condition = LIKE)
|
||||
private String storeName;
|
||||
|
||||
@ApiModelProperty(value = "店铺别名")
|
||||
@TableField("nick_name")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
@ApiModelProperty(value = "logo")
|
||||
@Length(max = 500, message = "logo长度不能超过500")
|
||||
@TableField(value = "logo", condition = LIKE)
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* facade
|
||||
*/
|
||||
@ApiModelProperty(value = "facade")
|
||||
@Length(max = 500, message = "facade长度不能超过500")
|
||||
@TableField(value = "facade", condition = LIKE)
|
||||
private String facade;
|
||||
|
||||
/**
|
||||
* 发货地址
|
||||
*/
|
||||
@ApiModelProperty(value = "发货地址")
|
||||
@Length(max = 500, message = "发货地址长度不能超过500")
|
||||
@TableField(value = "ship_address", condition = LIKE)
|
||||
private String shipAddress;
|
||||
|
||||
/**
|
||||
* 店铺简介
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺简介")
|
||||
@Length(max = 500, message = "店铺简介长度不能超过500")
|
||||
@TableField(value = "remark", condition = LIKE)
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 注册手机号
|
||||
*/
|
||||
@ApiModelProperty(value = "注册手机号")
|
||||
@NotEmpty(message = "注册手机号不能为空")
|
||||
@Length(max = 32, message = "注册手机号长度不能超过32")
|
||||
@TableField(value = "mobile", condition = LIKE)
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@ApiModelProperty("纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* 退货地址
|
||||
*/
|
||||
@ApiModelProperty(value = "退货地址")
|
||||
@Length(max = 500, message = "退货地址长度不能超过500")
|
||||
@TableField(value = "refund_address", condition = LIKE)
|
||||
private String refundAddress;
|
||||
|
||||
/**
|
||||
* 退货联系电话
|
||||
*/
|
||||
@ApiModelProperty(value = "退货联系电话")
|
||||
@Length(max = 32, message = "退货联系电话长度不能超过32")
|
||||
@TableField(value = "refund_tel", condition = LIKE)
|
||||
private String refundTel;
|
||||
|
||||
/**
|
||||
* 退货联系人
|
||||
*/
|
||||
@ApiModelProperty(value = "退货联系人")
|
||||
@Length(max = 32, message = "退货联系人长度不能超过32")
|
||||
@TableField(value = "refund_contact", condition = LIKE)
|
||||
private String refundContact;
|
||||
|
||||
/**
|
||||
* 是否自动发送退货地址给买家 0否 1是
|
||||
*/
|
||||
@ApiModelProperty(value = "是否自动发送退货地址给买家 0否 1是")
|
||||
@NotNull(message = "是否自动发送退货地址给买家 0否 1是不能为空")
|
||||
@TableField("is_auto_send_refund_address")
|
||||
private Integer isAutoSendRefundAddress;
|
||||
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
@ApiModelProperty(value = "省份")
|
||||
@NotEmpty(message = "省份不能为空")
|
||||
@Length(max = 20, message = "省份长度不能超过20")
|
||||
@TableField(value = "province", condition = LIKE)
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
@ApiModelProperty(value = "城市")
|
||||
@NotEmpty(message = "城市不能为空")
|
||||
@Length(max = 20, message = "城市长度不能超过20")
|
||||
@TableField(value = "city", condition = LIKE)
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 地区
|
||||
*/
|
||||
@ApiModelProperty(value = "地区")
|
||||
@NotEmpty(message = "地区不能为空")
|
||||
@Length(max = 20, message = "地区长度不能超过20")
|
||||
@TableField(value = "district", condition = LIKE)
|
||||
private String district;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@ApiModelProperty(value = "详细地址")
|
||||
@NotEmpty(message = "详细地址不能为空")
|
||||
@Length(max = 250, message = "详细地址长度不能超过250")
|
||||
@TableField(value = "address", condition = LIKE)
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 负责人名称
|
||||
*/
|
||||
@ApiModelProperty(value = "负责人名称")
|
||||
@Length(max = 50, message = "负责人名称长度不能超过50")
|
||||
@TableField(value = "head_name", condition = LIKE)
|
||||
private String headName;
|
||||
|
||||
/**
|
||||
* 收货人电话
|
||||
*/
|
||||
@ApiModelProperty(value = "负责人电话")
|
||||
@NotEmpty(message = "负责人电话不能为空")
|
||||
@Length(max = 30, message = "负责人电话长度不能超过30")
|
||||
@TableField(value = "head_mobile", condition = LIKE)
|
||||
private String headMobile;
|
||||
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
@TableField(value = "tel")
|
||||
private String tel;
|
||||
|
||||
@ApiModelProperty("提供服务")
|
||||
@TableField("business_service")
|
||||
private String businessService;
|
||||
|
||||
@ApiModelProperty("业务类型")
|
||||
@TableField("business_type")
|
||||
private String businessType;
|
||||
|
||||
/**
|
||||
* 收单类型
|
||||
* #{NORMAL:普通收单;FAST:快消收单
|
||||
*/
|
||||
// @ApiModelProperty(value = "收单类型")
|
||||
// @TableField("pos_type")
|
||||
// @JsonProperty(value = "posType")
|
||||
// private TenantPosTypeEnum posType;
|
||||
//
|
||||
// @ApiModelProperty("第三方配送设置")
|
||||
// @TableField(value = "delivery_info", typeHandler = JacksonTypeHandler.class)
|
||||
// private DeliveryInfo deliveryInfo;
|
||||
//
|
||||
// @ApiModelProperty("小程序配置")
|
||||
// @TableField(value = "mini_param", typeHandler = JacksonTypeHandler.class)
|
||||
// private MiniParam miniParam;
|
||||
|
||||
@ApiModelProperty("店铺余额")
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty("平台是否显示")
|
||||
@TableField("platform_show")
|
||||
private Boolean platformShow;
|
||||
|
||||
@TableLogic
|
||||
@TableField("is_delete")
|
||||
private Integer is_delete;
|
||||
|
||||
@Builder
|
||||
public Store(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, String tenantCode, Boolean useErp, LocalTime openStartTime, LocalTime openEndTime, String storeName, String nickName, String logo, String shipAddress, String remark, String mobile, BigDecimal longitude, BigDecimal latitude, String refundAddress, String refundTel, String refundContact, Integer isAutoSendRefundAddress, String province, String city, String district, String address, String headName, String headMobile, Boolean platformShow) {
|
||||
super(id, createTime, createUser, updateTime, updateUser);
|
||||
this.tenantCode = tenantCode;
|
||||
this.useErp = useErp;
|
||||
this.openStartTime = openStartTime;
|
||||
this.openEndTime = openEndTime;
|
||||
this.storeName = storeName;
|
||||
this.nickName = nickName;
|
||||
this.logo = logo;
|
||||
this.shipAddress = shipAddress;
|
||||
this.remark = remark;
|
||||
this.mobile = mobile;
|
||||
this.longitude = longitude;
|
||||
this.latitude = latitude;
|
||||
this.refundAddress = refundAddress;
|
||||
this.refundTel = refundTel;
|
||||
this.refundContact = refundContact;
|
||||
this.isAutoSendRefundAddress = isAutoSendRefundAddress;
|
||||
this.province = province;
|
||||
this.city = city;
|
||||
this.district = district;
|
||||
this.address = address;
|
||||
this.headName = headName;
|
||||
this.headMobile = headMobile;
|
||||
this.platformShow = platformShow;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user