diff --git a/.idea/qaplug_profiles.xml b/.idea/qaplug_profiles.xml new file mode 100644 index 0000000..3dfd21f --- /dev/null +++ b/.idea/qaplug_profiles.xml @@ -0,0 +1,465 @@ + + + + + \ No newline at end of file diff --git a/jing-common/jing-common-core/src/main/java/com/jing/common/core/domain/R.java b/jing-common/jing-common-core/src/main/java/com/jing/common/core/domain/R.java new file mode 100644 index 0000000..d8ac58d --- /dev/null +++ b/jing-common/jing-common-core/src/main/java/com/jing/common/core/domain/R.java @@ -0,0 +1,115 @@ +package com.jing.common.core.domain; + +import java.io.Serializable; +import com.jing.common.core.constant.Constants; + +/** + * 响应信息主体 + * + * @author ruoyi + */ +public class R implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 成功 */ + public static final int SUCCESS = Constants.SUCCESS; + + /** 失败 */ + public static final int FAIL = Constants.FAIL; + + private int code; + + private String msg; + + private T data; + + public static R ok() + { + return restResult(null, SUCCESS, null); + } + + public static R ok(T data) + { + return restResult(data, SUCCESS, null); + } + + public static R ok(T data, String msg) + { + return restResult(data, SUCCESS, msg); + } + + public static R fail() + { + return restResult(null, FAIL, null); + } + + public static R fail(String msg) + { + return restResult(null, FAIL, msg); + } + + public static R fail(T data) + { + return restResult(data, FAIL, null); + } + + public static R fail(T data, String msg) + { + return restResult(data, FAIL, msg); + } + + public static R fail(int code, String msg) + { + return restResult(null, code, msg); + } + + private static R restResult(T data, int code, String msg) + { + R apiResult = new R<>(); + apiResult.setCode(code); + apiResult.setData(data); + apiResult.setMsg(msg); + return apiResult; + } + + public int getCode() + { + return code; + } + + public void setCode(int code) + { + this.code = code; + } + + public String getMsg() + { + return msg; + } + + public void setMsg(String msg) + { + this.msg = msg; + } + + public T getData() + { + return data; + } + + public void setData(T data) + { + this.data = data; + } + + public static Boolean isError(R ret) + { + return !isSuccess(ret); + } + + public static Boolean isSuccess(R ret) + { + return R.SUCCESS == ret.getCode(); + } +} diff --git a/jing-common/jing-common-log/src/main/java/com/jing/common/log/filter/PropertyPreExcludeFilter.java b/jing-common/jing-common-log/src/main/java/com/jing/common/log/filter/PropertyPreExcludeFilter.java new file mode 100644 index 0000000..32af47d --- /dev/null +++ b/jing-common/jing-common-log/src/main/java/com/jing/common/log/filter/PropertyPreExcludeFilter.java @@ -0,0 +1,24 @@ +package com.jing.common.log.filter; + +import com.alibaba.fastjson2.filter.SimplePropertyPreFilter; + +/** + * 排除JSON敏感属性 + * + * @author ruoyi + */ +public class PropertyPreExcludeFilter extends SimplePropertyPreFilter +{ + public PropertyPreExcludeFilter() + { + } + + public PropertyPreExcludeFilter addExcludes(String... filters) + { + for (int i = 0; i < filters.length; i++) + { + this.getExcludes().add(filters[i]); + } + return this; + } +} diff --git a/jing-modules/jing-job/src/main/java/com/jing/job/util/QuartzDisallowConcurrentExecution.java b/jing-modules/jing-job/src/main/java/com/jing/job/util/QuartzDisallowConcurrentExecution.java new file mode 100644 index 0000000..960f00d --- /dev/null +++ b/jing-modules/jing-job/src/main/java/com/jing/job/util/QuartzDisallowConcurrentExecution.java @@ -0,0 +1,22 @@ +package com.jing.job.util; + +import org.quartz.DisallowConcurrentExecution; +import org.quartz.JobExecutionContext; + +import com.jing.job.domain.SysJob; + +/** + * 定时任务处理(禁止并发执行) + * + * @author ruoyi + * + */ +@DisallowConcurrentExecution +public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob +{ + @Override + protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception + { + JobInvokeUtil.invokeMethod(sysJob); + } +} diff --git a/jing-modules/jing-job/src/main/java/com/jing/job/util/QuartzJobExecution.java b/jing-modules/jing-job/src/main/java/com/jing/job/util/QuartzJobExecution.java new file mode 100644 index 0000000..dc487e4 --- /dev/null +++ b/jing-modules/jing-job/src/main/java/com/jing/job/util/QuartzJobExecution.java @@ -0,0 +1,20 @@ +package com.jing.job.util; + +import org.quartz.JobExecutionContext; + +import com.jing.job.domain.SysJob; + +/** + * 定时任务处理(允许并发执行) + * + * @author ruoyi + * + */ +public class QuartzJobExecution extends AbstractQuartzJob +{ + @Override + protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception + { + JobInvokeUtil.invokeMethod(sysJob); + } +} diff --git a/jing-modules/jing-product/src/main/java/com/jing/product/domain/Req/QueryProductReq.java b/jing-modules/jing-product/src/main/java/com/jing/product/domain/Req/QueryProductReq.java new file mode 100644 index 0000000..2211f20 --- /dev/null +++ b/jing-modules/jing-product/src/main/java/com/jing/product/domain/Req/QueryProductReq.java @@ -0,0 +1,34 @@ +package com.jing.product.domain.Req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +@Data +@ApiModel(value = "QueryProductReq", description = "接收到的参数值") +public class QueryProductReq { + @ApiModelProperty(value = "名称") + private String productName; + + @ApiModelProperty(value = "货号") + private String productNumber; + + @ApiModelProperty(value = "上下架状态 (1:上架, 2:下架)") + private Integer productStatus; + + @ApiModelProperty(value = "审核状态 (1:通过, 2:驳回)") + private Integer productExamine; + + @ApiModelProperty(value = "品牌") + private Integer brandId; + + @ApiModelProperty(value = "商品类型") + private Integer typeId; + + @ApiModelProperty(value = "分页参数") + private Integer pageNum = 1; + + @ApiModelProperty(value = "分页参数") + private Integer pageSize = 10; +} diff --git a/jing-modules/jing-product/src/main/java/com/jing/product/domain/Resp/ProductResp.java b/jing-modules/jing-product/src/main/java/com/jing/product/domain/Resp/ProductResp.java new file mode 100644 index 0000000..e3c3497 --- /dev/null +++ b/jing-modules/jing-product/src/main/java/com/jing/product/domain/Resp/ProductResp.java @@ -0,0 +1,111 @@ +package com.jing.product.domain.Resp; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + + +@Data +@ApiModel(value = "ProductResp", description = "列表返回值") +public class ProductResp { + + @ApiModelProperty(value = "id") + private Integer id; + + @ApiModelProperty(value = "名称") + @NotEmpty(message = "名称不能为空") + private String productName; + + @ApiModelProperty(value = "货号") + @NotNull(message = "货号不能为空") + private String productNumber; + + @ApiModelProperty(value = "审核状态 (1:通过, 2:驳回)") + private Integer productExamine; + + @ApiModelProperty(value = "品牌") + @NotNull(message = "品牌不能不选择") + private Integer brandId; + + @ApiModelProperty(value = "商品类型") + @NotNull(message = "商品类型不能不选择") + private Integer typeId; + + @ApiModelProperty(value = "副标题") + private String productSubheading; + + @ApiModelProperty(value = "商品介绍") + private String productInformation; + + @ApiModelProperty(value = "单位") + private String productUnit; + + @ApiModelProperty(value = "重量") + private Double productWeight; + + @ApiModelProperty(value = "排序") + private Integer productSort; + + @ApiModelProperty(value = "促销表id") + private Integer promotionId; + + @ApiModelProperty(value = "积分") + private Integer productPoints; + + @ApiModelProperty(value = "成长值") + private Integer productGrowth; + + @ApiModelProperty(value = "最大积分值") + private Integer productMaxPoints; + + @ApiModelProperty(value = "预告商品 (1:是, 2:否)") + private Integer productForeknow; + + @ApiModelProperty(value = "上下架状态 (1:上架, 2:下架)") + private Integer productStatus; + + @ApiModelProperty(value = "新品 (1:是, 2:否)") + private Integer productNew; + + @ApiModelProperty(value = "推荐 (1:是, 2:否)") + private Integer productRecommended; + + @ApiModelProperty(value = "详情标题") + private String detailsTitle; + + @ApiModelProperty(value = "详情描述") + private String detailsInformation; + + @ApiModelProperty(value = "关键字") + private String detailsKeyWord; + + @ApiModelProperty(value = "备注") + private String detailsRemark; + + @ApiModelProperty(value = "优惠方法") + @NotNull(message = "优惠方式不能不选择") + private Integer methodType; + + @ApiModelProperty(value = "优惠Id") + private Integer methodId; + + @ApiModelProperty(value = "移动端信息") + private String moveInformation; + + @ApiModelProperty(value = "PC端信息") + private String pcInformation; + + @ApiModelProperty(value = "售价") + private Double salePrice; + + @ApiModelProperty(value = "品牌名称") + private String brandName; + + @ApiModelProperty(value = "类型名称") + private String typeName; + + @ApiModelProperty(value = "图片路径") + private String imagesUrl; +} diff --git a/jing-ui/src/assets/icons/svg/qq.svg b/jing-ui/src/assets/icons/svg/qq.svg new file mode 100644 index 0000000..ee13d4e --- /dev/null +++ b/jing-ui/src/assets/icons/svg/qq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/jing-ui/src/assets/icons/svg/question.svg b/jing-ui/src/assets/icons/svg/question.svg new file mode 100644 index 0000000..cf75bd4 --- /dev/null +++ b/jing-ui/src/assets/icons/svg/question.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sql/quartz.sql b/sql/quartz.sql new file mode 100644 index 0000000..cee613b --- /dev/null +++ b/sql/quartz.sql @@ -0,0 +1,174 @@ +DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS; +DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS; +DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE; +DROP TABLE IF EXISTS QRTZ_LOCKS; +DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS; +DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS; +DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS; +DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS; +DROP TABLE IF EXISTS QRTZ_TRIGGERS; +DROP TABLE IF EXISTS QRTZ_JOB_DETAILS; +DROP TABLE IF EXISTS QRTZ_CALENDARS; + +-- ---------------------------- +-- 1、存储每一个已配置的 jobDetail 的详细信息 +-- ---------------------------- +create table QRTZ_JOB_DETAILS ( + sched_name varchar(120) not null comment '调度名称', + job_name varchar(200) not null comment '任务名称', + job_group varchar(200) not null comment '任务组名', + description varchar(250) null comment '相关介绍', + job_class_name varchar(250) not null comment '执行任务类名称', + is_durable varchar(1) not null comment '是否持久化', + is_nonconcurrent varchar(1) not null comment '是否并发', + is_update_data varchar(1) not null comment '是否更新数据', + requests_recovery varchar(1) not null comment '是否接受恢复执行', + job_data blob null comment '存放持久化job对象', + primary key (sched_name, job_name, job_group) +) engine=innodb comment = '任务详细信息表'; + +-- ---------------------------- +-- 2、 存储已配置的 Trigger 的信息 +-- ---------------------------- +create table QRTZ_TRIGGERS ( + sched_name varchar(120) not null comment '调度名称', + trigger_name varchar(200) not null comment '触发器的名字', + trigger_group varchar(200) not null comment '触发器所属组的名字', + job_name varchar(200) not null comment 'qrtz_job_details表job_name的外键', + job_group varchar(200) not null comment 'qrtz_job_details表job_group的外键', + description varchar(250) null comment '相关介绍', + next_fire_time bigint(13) null comment '上一次触发时间(毫秒)', + prev_fire_time bigint(13) null comment '下一次触发时间(默认为-1表示不触发)', + priority integer null comment '优先级', + trigger_state varchar(16) not null comment '触发器状态', + trigger_type varchar(8) not null comment '触发器的类型', + start_time bigint(13) not null comment '开始时间', + end_time bigint(13) null comment '结束时间', + calendar_name varchar(200) null comment '日程表名称', + misfire_instr smallint(2) null comment '补偿执行的策略', + job_data blob null comment '存放持久化job对象', + primary key (sched_name, trigger_name, trigger_group), + foreign key (sched_name, job_name, job_group) references QRTZ_JOB_DETAILS(sched_name, job_name, job_group) +) engine=innodb comment = '触发器详细信息表'; + +-- ---------------------------- +-- 3、 存储简单的 Trigger,包括重复次数,间隔,以及已触发的次数 +-- ---------------------------- +create table QRTZ_SIMPLE_TRIGGERS ( + sched_name varchar(120) not null comment '调度名称', + trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键', + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', + repeat_count bigint(7) not null comment '重复的次数统计', + repeat_interval bigint(12) not null comment '重复的间隔时间', + times_triggered bigint(10) not null comment '已经触发的次数', + primary key (sched_name, trigger_name, trigger_group), + foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group) +) engine=innodb comment = '简单触发器的信息表'; + +-- ---------------------------- +-- 4、 存储 Cron Trigger,包括 Cron 表达式和时区信息 +-- ---------------------------- +create table QRTZ_CRON_TRIGGERS ( + sched_name varchar(120) not null comment '调度名称', + trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键', + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', + cron_expression varchar(200) not null comment 'cron表达式', + time_zone_id varchar(80) comment '时区', + primary key (sched_name, trigger_name, trigger_group), + foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group) +) engine=innodb comment = 'Cron类型的触发器表'; + +-- ---------------------------- +-- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型,JobStore 并不知道如何存储实例的时候) +-- ---------------------------- +create table QRTZ_BLOB_TRIGGERS ( + sched_name varchar(120) not null comment '调度名称', + trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键', + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', + blob_data blob null comment '存放持久化Trigger对象', + primary key (sched_name, trigger_name, trigger_group), + foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group) +) engine=innodb comment = 'Blob类型的触发器表'; + +-- ---------------------------- +-- 6、 以 Blob 类型存储存放日历信息, quartz可配置一个日历来指定一个时间范围 +-- ---------------------------- +create table QRTZ_CALENDARS ( + sched_name varchar(120) not null comment '调度名称', + calendar_name varchar(200) not null comment '日历名称', + calendar blob not null comment '存放持久化calendar对象', + primary key (sched_name, calendar_name) +) engine=innodb comment = '日历信息表'; + +-- ---------------------------- +-- 7、 存储已暂停的 Trigger 组的信息 +-- ---------------------------- +create table QRTZ_PAUSED_TRIGGER_GRPS ( + sched_name varchar(120) not null comment '调度名称', + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', + primary key (sched_name, trigger_group) +) engine=innodb comment = '暂停的触发器表'; + +-- ---------------------------- +-- 8、 存储与已触发的 Trigger 相关的状态信息,以及相联 Job 的执行信息 +-- ---------------------------- +create table QRTZ_FIRED_TRIGGERS ( + sched_name varchar(120) not null comment '调度名称', + entry_id varchar(95) not null comment '调度器实例id', + trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键', + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', + instance_name varchar(200) not null comment '调度器实例名', + fired_time bigint(13) not null comment '触发的时间', + sched_time bigint(13) not null comment '定时器制定的时间', + priority integer not null comment '优先级', + state varchar(16) not null comment '状态', + job_name varchar(200) null comment '任务名称', + job_group varchar(200) null comment '任务组名', + is_nonconcurrent varchar(1) null comment '是否并发', + requests_recovery varchar(1) null comment '是否接受恢复执行', + primary key (sched_name, entry_id) +) engine=innodb comment = '已触发的触发器表'; + +-- ---------------------------- +-- 9、 存储少量的有关 Scheduler 的状态信息,假如是用于集群中,可以看到其他的 Scheduler 实例 +-- ---------------------------- +create table QRTZ_SCHEDULER_STATE ( + sched_name varchar(120) not null comment '调度名称', + instance_name varchar(200) not null comment '实例名称', + last_checkin_time bigint(13) not null comment '上次检查时间', + checkin_interval bigint(13) not null comment '检查间隔时间', + primary key (sched_name, instance_name) +) engine=innodb comment = '调度器状态表'; + +-- ---------------------------- +-- 10、 存储程序的悲观锁的信息(假如使用了悲观锁) +-- ---------------------------- +create table QRTZ_LOCKS ( + sched_name varchar(120) not null comment '调度名称', + lock_name varchar(40) not null comment '悲观锁名称', + primary key (sched_name, lock_name) +) engine=innodb comment = '存储的悲观锁信息表'; + +-- ---------------------------- +-- 11、 Quartz集群实现同步机制的行锁表 +-- ---------------------------- +create table QRTZ_SIMPROP_TRIGGERS ( + sched_name varchar(120) not null comment '调度名称', + trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键', + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', + str_prop_1 varchar(512) null comment 'String类型的trigger的第一个参数', + str_prop_2 varchar(512) null comment 'String类型的trigger的第二个参数', + str_prop_3 varchar(512) null comment 'String类型的trigger的第三个参数', + int_prop_1 int null comment 'int类型的trigger的第一个参数', + int_prop_2 int null comment 'int类型的trigger的第二个参数', + long_prop_1 bigint null comment 'long类型的trigger的第一个参数', + long_prop_2 bigint null comment 'long类型的trigger的第二个参数', + dec_prop_1 numeric(13,4) null comment 'decimal类型的trigger的第一个参数', + dec_prop_2 numeric(13,4) null comment 'decimal类型的trigger的第二个参数', + bool_prop_1 varchar(1) null comment 'Boolean类型的trigger的第一个参数', + bool_prop_2 varchar(1) null comment 'Boolean类型的trigger的第二个参数', + primary key (sched_name, trigger_name, trigger_group), + foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group) +) engine=innodb comment = '同步机制的行锁表'; + +commit; \ No newline at end of file