全量提交

This commit is contained in:
林华觞
2025-05-21 08:59:12 +08:00
parent 2bf962399b
commit 08924f2b28
634 changed files with 59141 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package com.zf.foodpurchase.common.constant;
/**
* @author:lilj
* @date:2025/4/23
*/
public class AccountConstants {
//账号类型:0 若依系统用户;1 学校;2 供货商;3 教育局;4 商户
public static final Integer SYSTEM_USER = 0;
public static final Integer SCHOOL = 1;
public static final Integer SUPPLIER =2;
public static final Integer EDU = 3;
public static final Integer MERCHANT = 4;
}

View File

@@ -0,0 +1,71 @@
package com.zf.foodpurchase.common.constant;
/**
* 缓存的key 常量
*
* @author ruoyi
*/
public class CacheConstants
{
/**
* 手机号验证码前缀
*/
public static final String SMS_SEND="SMS_SEND";
/**
* 用户商品详情页-requestId前缀
*/
public static final String PRODUCTS_REQUEST_ID_PREFIX = "wx_user_products:";
/**
* 完整的树形区划结构
*/
public static final String TREE_AREA_KEY = "tree_area:";
/**
* 微信小程序token前缀
*/
public static final String LOGIN_WX_TOKEN_KEY = "login_wx_tokens:";
/**
* 学校食材采购,小程序/app公用的token前缀
*/
public static final String LOGIN_WX_APP_TOKEN_KEY = "login_wx_app_tokens:";
/**
* 调用微信接口的access_token凭证
*/
public static final String WX_ACCESS_TOKEN_KEY = "wx_access_token";
/**
* 登录用户 redis key
*/
public static final String LOGIN_TOKEN_KEY = "login_tokens:";
/**
* 验证码 redis key
*/
public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
/**
* 参数管理 cache key
*/
public static final String SYS_CONFIG_KEY = "sys_config:";
/**
* 字典管理 cache key
*/
public static final String SYS_DICT_KEY = "sys_dict:";
/**
* 防重提交 redis key
*/
public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
/**
* 限流 redis key
*/
public static final String RATE_LIMIT_KEY = "rate_limit:";
/**
* 登录账户密码错误次数 redis key
*/
public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
}

View File

@@ -0,0 +1,272 @@
package com.zf.foodpurchase.common.constant;
import java.util.Locale;
import io.jsonwebtoken.Claims;
/**
* 通用常量信息
*
* @author ruoyi
*/
public class Constants
{
public static final String DEL_FLAG_NORMAL = "0";
public static final String DEL_FLAG_ABNORMAL = "1";
/**
* 是默认收货地址
*/
public static final Integer USER_ADDRESS_DEFAULT = 1;
/**
* 非默认收货地址
*/
public static final Integer USER_ADDRESS_NOT_DEFAULT = 0;
/**
* 总订单混合购买商品
*/
public static final String GOODS_COMBINE_BUY = "2";
/**
* 积分购买商品
*/
public static final String GOODS_INTEGRAL_BUY = "1";
/**
* 人民币购买
*/
public static final String GOODS_MONEY_BUY = "0";
/**
* 默认仓库:是
*/
public static final String REPO_DEFAULT = "1";
/**
* 默认仓库:否
*/
public static final String REPO_UN_DEFAULT = "0";
/**
* 用户默认购物车名
*/
public static final String DEFAULT_CART_NAME = "默认购物车";
/**
* 商品状态:待上架
*/
public static final String GOODS_STATUS_UP = "0";
/**
* 商品状态: 上架
*/
public static final String GOODS_STATUS_SOLD = "1";
/**
* 商品状态:上架
*/
public static final String GOODS_STATUS_DOWN = "2";
/**
* 商品状态:已售罄
*/
public static final String GOODS_STATUS_SOLD_OUT = "3";
/**
* 是否多规格商品
*/
public static final String MULTI_SPEC = "1";
/**
* 是否单规格商品
*/
public static final String SINGLE_SPEC = "0";
/**
* 微信小程序令牌前缀
*/
public static final Long MERCHANT_ROLE = 100L;
/**
* 微信小程序令牌前缀
*/
public static final String LOGIN_WX_USER_KEY = "login_wx_user_key";
/**
* 学校食材采购:微信小程序/app通用令牌前缀
*/
public static final String LOGIN_WX_APP_USER_KEY = "login_wx_user_key";
/**
* 微信小程序接口前缀
*/
public static final String WX_URI = "/wx/";
/**
* 微信小程序/APP接口前缀
*/
public static final String WX_APP_URI = "/wxapp/";
/**
* 资源映射路径 前缀
*/
public static final String WX_AVATAR_PREFIX = "/wx/static/avatar";
/**
* 资源映射路径 前缀
*/
public static final String WX_QRCODE_PREFIX = "/wx/static/qrcode";
/**
* UTF-8 字符集
*/
public static final String UTF8 = "UTF-8";
/**
* GBK 字符集
*/
public static final String GBK = "GBK";
/**
* 系统语言
*/
public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE;
/**
* www主域
*/
public static final String WWW = "www.";
/**
* http请求
*/
public static final String HTTP = "http://";
/**
* https请求
*/
public static final String HTTPS = "https://";
/**
* 通用成功标识
*/
public static final String SUCCESS = "0";
/**
* 通用失败标识
*/
public static final String FAIL = "1";
/**
* 登录成功
*/
public static final String LOGIN_SUCCESS = "Success";
/**
* 注销
*/
public static final String LOGOUT = "Logout";
/**
* 注册
*/
public static final String REGISTER = "Register";
/**
* 登录失败
*/
public static final String LOGIN_FAIL = "Error";
/**
* 所有权限标识
*/
public static final String ALL_PERMISSION = "*:*:*";
/**
* 管理员角色权限标识
*/
public static final String SUPER_ADMIN = "admin";
/**
* 角色权限分隔符
*/
public static final String ROLE_DELIMETER = ",";
/**
* 权限标识分隔符
*/
public static final String PERMISSION_DELIMETER = ",";
/**
* 验证码有效期(分钟)
*/
public static final Integer CAPTCHA_EXPIRATION = 2;
/**
* 令牌
*/
public static final String TOKEN = "token";
/**
* 令牌前缀
*/
public static final String TOKEN_PREFIX = "Bearer ";
/**
* 令牌前缀
*/
public static final String LOGIN_USER_KEY = "login_user_key";
/**
* 用户ID
*/
public static final String JWT_USERID = "userid";
/**
* 用户名称
*/
public static final String JWT_USERNAME = Claims.SUBJECT;
/**
* 用户头像
*/
public static final String JWT_AVATAR = "avatar";
/**
* 创建时间
*/
public static final String JWT_CREATED = "created";
/**
* 用户权限
*/
public static final String JWT_AUTHORITIES = "authorities";
/**
* 资源映射路径 前缀
*/
public static final String RESOURCE_PREFIX = "/profile";
/**
* RMI 远程方法调用
*/
public static final String LOOKUP_RMI = "rmi:";
/**
* LDAP 远程方法调用
*/
public static final String LOOKUP_LDAP = "ldap:";
/**
* LDAPS 远程方法调用
*/
public static final String LOOKUP_LDAPS = "ldaps:";
/**
* 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
*/
public static final String[] JSON_WHITELIST_STR = { "org.springframework", "com.zf.foodpurchase" };
/**
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
*/
public static final String[] JOB_WHITELIST_STR = { "com.zf.foodpurchase.quartz.task" };
/**
* 定时任务违规的字符
*/
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
"org.springframework", "org.apache", "com.zf.foodpurchase.common.utils.file", "com.zf.foodpurchase.common.config", "com.zf.foodpurchase.generator" };
}

View File

@@ -0,0 +1,11 @@
package com.zf.foodpurchase.common.constant;
/**
* @author:lilj
* @date:2025/4/26
*/
public interface DeliveryStatusConstants {
// 0未送达 1 已收货
public static final Integer NOT_ARRIVED = 0;
public static final Integer ARRIVED = 1;
}

View File

@@ -0,0 +1,12 @@
package com.zf.foodpurchase.common.constant;
/**
* @author:lilj
* @date:2025/4/26
*/
public interface FoodStatusConstants {
//check_status 审核状态:0 待审核 1 审核通过 2 审核不通过
public static final Integer PRODUCT_WAIT_CHECK = 0;
public static final Integer PRODUCT_CHECK_PASS = 1;
public static final Integer PRODUCT_CHECK_NO_PASS = 2;
}

View File

@@ -0,0 +1,117 @@
package com.zf.foodpurchase.common.constant;
/**
* 代码生成通用常量
*
* @author ruoyi
*/
public class GenConstants
{
/** 单表(增删改查) */
public static final String TPL_CRUD = "crud";
/** 树表(增删改查) */
public static final String TPL_TREE = "tree";
/** 主子表(增删改查) */
public static final String TPL_SUB = "sub";
/** 树编码字段 */
public static final String TREE_CODE = "treeCode";
/** 树父编码字段 */
public static final String TREE_PARENT_CODE = "treeParentCode";
/** 树名称字段 */
public static final String TREE_NAME = "treeName";
/** 上级菜单ID字段 */
public static final String PARENT_MENU_ID = "parentMenuId";
/** 上级菜单名称字段 */
public static final String PARENT_MENU_NAME = "parentMenuName";
/** 数据库字符串类型 */
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" };
/** 数据库文本类型 */
public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" };
/** 数据库时间类型 */
public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
/** 数据库数字类型 */
public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
"bit", "bigint", "float", "double", "decimal" };
/** 页面不需要编辑字段 */
public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
/** 页面不需要显示的列表字段 */
public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by",
"update_time" };
/** 页面不需要查询字段 */
public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by",
"update_time", "remark" };
/** Entity基类字段 */
public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" };
/** Tree基类字段 */
public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" };
/** 文本框 */
public static final String HTML_INPUT = "input";
/** 文本域 */
public static final String HTML_TEXTAREA = "textarea";
/** 下拉框 */
public static final String HTML_SELECT = "select";
/** 单选框 */
public static final String HTML_RADIO = "radio";
/** 复选框 */
public static final String HTML_CHECKBOX = "checkbox";
/** 日期控件 */
public static final String HTML_DATETIME = "datetime";
/** 图片上传控件 */
public static final String HTML_IMAGE_UPLOAD = "imageUpload";
/** 文件上传控件 */
public static final String HTML_FILE_UPLOAD = "fileUpload";
/** 富文本控件 */
public static final String HTML_EDITOR = "editor";
/** 字符串类型 */
public static final String TYPE_STRING = "String";
/** 整型 */
public static final String TYPE_INTEGER = "Integer";
/** 长整型 */
public static final String TYPE_LONG = "Long";
/** 浮点型 */
public static final String TYPE_DOUBLE = "Double";
/** 高精度计算类型 */
public static final String TYPE_BIGDECIMAL = "BigDecimal";
/** 时间类型 */
public static final String TYPE_DATE = "Date";
/** 模糊查询 */
public static final String QUERY_LIKE = "LIKE";
/** 相等查询 */
public static final String QUERY_EQ = "EQ";
/** 需要 */
public static final String REQUIRE = "1";
}

View File

@@ -0,0 +1,94 @@
package com.zf.foodpurchase.common.constant;
/**
* 返回状态码
*
* @author ruoyi
*/
public class HttpStatus
{
/**
* 操作成功
*/
public static final int SUCCESS = 200;
/**
* 对象创建成功
*/
public static final int CREATED = 201;
/**
* 请求已经被接受
*/
public static final int ACCEPTED = 202;
/**
* 操作已经执行成功,但是没有返回数据
*/
public static final int NO_CONTENT = 204;
/**
* 资源已被移除
*/
public static final int MOVED_PERM = 301;
/**
* 重定向
*/
public static final int SEE_OTHER = 303;
/**
* 资源没有被修改
*/
public static final int NOT_MODIFIED = 304;
/**
* 参数列表错误(缺少,格式不匹配)
*/
public static final int BAD_REQUEST = 400;
/**
* 未授权
*/
public static final int UNAUTHORIZED = 401;
/**
* 访问受限,授权过期
*/
public static final int FORBIDDEN = 403;
/**
* 资源,服务未找到
*/
public static final int NOT_FOUND = 404;
/**
* 不允许的http方法
*/
public static final int BAD_METHOD = 405;
/**
* 资源冲突,或者资源被锁
*/
public static final int CONFLICT = 409;
/**
* 不支持的数据,媒体类型
*/
public static final int UNSUPPORTED_TYPE = 415;
/**
* 系统内部错误
*/
public static final int ERROR = 500;
/**
* 接口未实现
*/
public static final int NOT_IMPLEMENTED = 501;
/**
* 系统警告消息
*/
public static final int WARN = 601;
}

View File

@@ -0,0 +1,18 @@
package com.zf.foodpurchase.common.constant;
/**
* @author:lilj
* @date:2025/4/26
*/
public interface OrderStatusConstants {
//订单状态:0 待接单;1 已接单;2 配送中;3 已完成;4 已取消
public static final Integer WAIT_ACCEPT = 0;
public static final Integer ACCEPTED = 1;
public static final Integer DELIVERING = 2;
public static final Integer COMPLETED = 3;
public static final Integer CANCELED = 4;
// 订单是否可参与结算
public static final Integer CAN_SETTLEMENT = 1;
public static final Integer CANNOT_SETTLEMENT = 0;
}

View File

@@ -0,0 +1,13 @@
package com.zf.foodpurchase.common.constant;
/**
* 退货单状态
* @author:lilj
* @date:2025/4/28
*/
public class RefundStatusConstants {
//退货状态:0 待审核,1 同一退货, 2 不同意退货
public static final Integer WAIT_CHECK = 0;
public static final Integer AGREE_REFUND = 1;
public static final Integer NOT_AGREE = 2;
}

View File

@@ -0,0 +1,50 @@
package com.zf.foodpurchase.common.constant;
/**
* 任务调度通用常量
*
* @author ruoyi
*/
public class ScheduleConstants
{
public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
/** 执行目标key */
public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
/** 默认 */
public static final String MISFIRE_DEFAULT = "0";
/** 立即触发执行 */
public static final String MISFIRE_IGNORE_MISFIRES = "1";
/** 触发一次执行 */
public static final String MISFIRE_FIRE_AND_PROCEED = "2";
/** 不触发立即执行 */
public static final String MISFIRE_DO_NOTHING = "3";
public enum Status
{
/**
* 正常
*/
NORMAL("0"),
/**
* 暂停
*/
PAUSE("1");
private String value;
private Status(String value)
{
this.value = value;
}
public String getValue()
{
return value;
}
}
}

View File

@@ -0,0 +1,30 @@
package com.zf.foodpurchase.common.constant;
/**
* @author:lilj
* @date:2025/5/6
*/
public class SettleStatusConstant {
// 结算状态:0 待审核 1 审核通过 2 审核不通过 3 学校已支付 4 供货商确认收款
/**
* 等待教育局审核
*/
public static final Integer WAIT_AUDIT = 0;
/**
* 审核通过
*/
public static final Integer AUDIT_PASS = 1;
/**
* 审核不通过
*/
public static final Integer AUDIT_NOT_PASS = 2;
/**
* 学校支付
*/
public static final Integer SCHOOL_PAY = 3;
/**
* 供货商确认
*/
public static final Integer SUPPLIER_CONFIRM = 4;
}

View File

@@ -0,0 +1,17 @@
package com.zf.foodpurchase.common.constant;
/**
* 单位状态常量:
* 学校
* 教育局
* 供货商状态
* @author:lilj
* @date:2025/4/26
*/
public interface UnitStatusConstants {
// 供货商账号状态: 0 未上架. 1 上架
Integer SUPPLIER_STATUS_NORMAL = 1;
Integer SUPPLIER_STATUS_UNNORMAL = 0;
}

View File

@@ -0,0 +1,81 @@
package com.zf.foodpurchase.common.constant;
/**
* 用户常量信息
*
* @author ruoyi
*/
public class UserConstants
{
/**
* 平台内系统用户的唯一标志
*/
public static final String SYS_USER = "SYS_USER";
/** 正常状态 */
public static final String NORMAL = "0";
/** 异常状态 */
public static final String EXCEPTION = "1";
/** 用户封禁状态 */
public static final String USER_DISABLE = "1";
/** 角色正常状态 */
public static final String ROLE_NORMAL = "0";
/** 角色封禁状态 */
public static final String ROLE_DISABLE = "1";
/** 部门正常状态 */
public static final String DEPT_NORMAL = "0";
/** 部门停用状态 */
public static final String DEPT_DISABLE = "1";
/** 字典正常状态 */
public static final String DICT_NORMAL = "0";
/** 是否为系统默认(是) */
public static final String YES = "Y";
/** 是否菜单外链(是) */
public static final String YES_FRAME = "0";
/** 是否菜单外链(否) */
public static final String NO_FRAME = "1";
/** 菜单类型(目录) */
public static final String TYPE_DIR = "M";
/** 菜单类型(菜单) */
public static final String TYPE_MENU = "C";
/** 菜单类型(按钮) */
public static final String TYPE_BUTTON = "F";
/** Layout组件标识 */
public final static String LAYOUT = "Layout";
/** ParentView组件标识 */
public final static String PARENT_VIEW = "ParentView";
/** InnerLink组件标识 */
public final static String INNER_LINK = "InnerLink";
/** 校验是否唯一的返回标识 */
public final static boolean UNIQUE = true;
public final static boolean NOT_UNIQUE = false;
/**
* 用户名长度限制
*/
public static final int USERNAME_MIN_LENGTH = 2;
public static final int USERNAME_MAX_LENGTH = 20;
/**
* 密码长度限制
*/
public static final int PASSWORD_MIN_LENGTH = 5;
public static final int PASSWORD_MAX_LENGTH = 20;
}

View File

@@ -0,0 +1,13 @@
package com.zf.foodpurchase.common.constant;
/**
* @author:lilj
* @date:2025/5/13
*/
public interface WxAPPAccountConstants {
public static final Integer SYSTEM_USER = 0;
public static final Integer SCHOOL = 1;
public static final Integer SUPPLIER =2;
public static final Integer EDU = 3;
public static final Integer MERCHANT = 4;
}

View File

@@ -0,0 +1,79 @@
package com.zf.foodpurchase.common.constant;
/**
* @author:lilj
* @date:2024/11/26
*/
public class WxPayOrderStatus {
/**
* 未支付
*/
public static final Integer NOT_PAY = 0;
/**
* 支付成功
*/
public static final Integer PAY_SUCCESS = 1;
/**
* 超时关闭
*/
public static final Integer CLOSED = 2;
/**
* 用户取消
*/
public static final Integer CANCEL = 3;
/**
* 已发货
*/
public static final Integer SHIPPED = 4;
/**
* 运输中
*/
public static final Integer TRANSPORTING = 5;
/**
* 已签收
*/
public static final Integer SIGNED = 6;
/**
* 交易结束
*/
public static final Integer TRADE_FINISHED = 7;
/**
* 退款中
*/
public static final Integer REFUNDING = 8;
/**
* 已退款
*/
public static final Integer REFUNDED = 9;
/**
* 退款异常
*/
public static final Integer REFUND_ABNORMAL = 10;
/**
* 物流异常
*/
public static final Integer LOGISTICS_ABNORMAL = 11;
/**
* 订单初始化
*/
public static final Integer INIT_PAY = 12;
}