本地暂存逻辑
parent
7ada37c1eb
commit
4a15b262b0
@ -0,0 +1,41 @@
|
||||
package me.zhengjie.common;
|
||||
|
||||
/**
|
||||
* FileName: ResponseCode
|
||||
* Author: x
|
||||
* Date: 2019/12/11 20:30
|
||||
* Description: 自定义Response响应返回体 -> 这边采用的是
|
||||
* History:
|
||||
* <author> <time> <version> <desc>
|
||||
* x 2019/12/11 v 1.0 创建此文件
|
||||
*/
|
||||
public enum ResponseCode {
|
||||
|
||||
SUCCESS(0,"SUCCESS"),
|
||||
ERROR(1,"ERROR"),
|
||||
|
||||
// 请求参数校验
|
||||
ILLEGAL_ARGUMENT(1,"请求参数格式错误"),
|
||||
EMPTY_ARGUMENT(1,"请求参数为空"),
|
||||
// 请求结果性的错误
|
||||
NODATA_ERROR(1,"查询结果为空"),
|
||||
TASK_BUILD_ERROR(1,"任务建立失败"),
|
||||
DECRYPT_ERROR(1,"解密错误,请联系我");
|
||||
|
||||
|
||||
private final int code;
|
||||
private final String desc;
|
||||
|
||||
ResponseCode(int code, String desc){
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
@ -1,11 +1,37 @@
|
||||
package me.zhengjie.modules.abmessage.rest.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Deprecated // 暂时弃用
|
||||
public class AbMessageVO implements Serializable {
|
||||
|
||||
/**
|
||||
* UID
|
||||
*/
|
||||
@Column(name = "uid")
|
||||
@ApiModelProperty(value = "UID")
|
||||
private String uid;
|
||||
|
||||
/**
|
||||
* 报课年级 - 多个,用映射表进行映射
|
||||
*/
|
||||
@Column(name = "act_name")
|
||||
@ApiModelProperty(value = "报课年级")
|
||||
private List<Integer> actNames;
|
||||
|
||||
/**
|
||||
* 所在城市 - 多个城市名称,用映射表
|
||||
*/
|
||||
@Column(name = "act_name")
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
private List<Integer> cities;
|
||||
|
||||
|
||||
private Integer device;
|
||||
}
|
||||
|
@ -0,0 +1,51 @@
|
||||
package me.zhengjie.modules.form.rest.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FormMessageVO implements Serializable {
|
||||
|
||||
/**
|
||||
* UID
|
||||
*/
|
||||
@ApiModelProperty(value = "UID")
|
||||
private String uid;
|
||||
|
||||
/**
|
||||
* 业务名称
|
||||
*/
|
||||
@ApiModelProperty(value = "业务名称")
|
||||
private String actName;
|
||||
|
||||
/**
|
||||
* 报课年级 - 多个,用映射表进行映射
|
||||
*/
|
||||
@ApiModelProperty(value = "报课年级")
|
||||
private List<Integer> stuGrades;
|
||||
|
||||
/**
|
||||
* 所在城市 - 多个城市名称,用映射表
|
||||
*/
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
private List<Integer> cities;
|
||||
|
||||
/**
|
||||
* 听课设备 - 有无听课设备,1-有,0-没有
|
||||
*/
|
||||
@ApiModelProperty(value = "听课设备有无")
|
||||
private Integer device;
|
||||
|
||||
/**
|
||||
* 业务开始时间 - 在这个时间周期内
|
||||
*/
|
||||
@ApiModelProperty(value = "业务开始时间")
|
||||
private Timestamp startTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package me.zhengjie.task;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生成本地文件的异步执行任务类
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ProduceLocalFileTask {
|
||||
|
||||
/**
|
||||
* 任务处理入口,主要用于时间记录
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Async(value = "ProduceLocalFileTaskExecutor")
|
||||
public void doRunTask(List<T> list){
|
||||
Long satrtMilliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
|
||||
log.info("====== [ task start running, task name is {} ] ======", "ProduceLocalFileTask");
|
||||
runTask(list);
|
||||
Long endMilliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
|
||||
log.info("====== [ task start end, task name is {},cost milliSecond is {} ] ======", "ProduceLocalFileTask", (endMilliSecond - satrtMilliSecond));
|
||||
}
|
||||
|
||||
private void runTask(List<T> list) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package me.zhengjie.task;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发送记录异步执行任务类
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class SendRecordTask {
|
||||
|
||||
|
||||
/**
|
||||
* 任务处理入口,主要用于时间记录
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Async(value = "SendRecordTaskExecutor")
|
||||
public void doRunTask(List<T> list){
|
||||
Long satrtMilliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
|
||||
log.info("====== [ task start running, task name is {} ] ======", "SendRecordTask");
|
||||
runTask(list);
|
||||
Long endMilliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
|
||||
log.info("====== [ task start end, task name is {},cost milliSecond is {} ] ======", "SendRecordTask", (endMilliSecond - satrtMilliSecond));
|
||||
}
|
||||
|
||||
private void runTask(List<T> list) {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue