Commit 3837ed15 by 刘栋

UDI-定时任务中设定创建人ID

parent b7150e10
......@@ -8,6 +8,8 @@ import com.infynova.udi.mapper.base.SuperMapper;
import com.infynova.udi.vo.UdiMatchListVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author liudong
* 2024/2/29 16:41
......@@ -18,4 +20,6 @@ public interface TaskMapper extends SuperMapper<Task> {
Page<UdiMatchListVo> queryTaskPage(IPage page, @Param("query") UdiMatchTaskListQry udiMatchTaskListQry);
Task queryTaskNo(@Param("taskNo") String taskNo);
List<Task> getUploadingTask();
}
......@@ -2,6 +2,8 @@ package com.infynova.udi.service.helper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.infynova.common.core.context.HeaderCode;
import com.infynova.common.core.context.SpringContextUtils;
import com.infynova.udi.entity.MatchData;
import com.infynova.udi.entity.MatchTemp;
import com.infynova.udi.enums.match.MatchStatusEnum;
......@@ -108,6 +110,8 @@ public class MatchHelper {
TaskVo taskVo = taskHelper.getTaskVo(taskId);
log.info("对码匹配-taskNo:{}",taskVo.getTask().getTaskNo());
SpringContextUtils.set(HeaderCode.IDENTITY_ID, String.valueOf(taskVo.getTask().getCreateBy()));
SpringContextUtils.set(HeaderCode.TENANT_ID, String.valueOf(taskVo.getTask().getCreateBy()));
while (true){
// 查询未开始的数据
......
......@@ -5,6 +5,8 @@ import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.FileUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.listener.PageReadListener;
import com.infynova.common.core.context.HeaderCode;
import com.infynova.common.core.context.SpringContextUtils;
import com.infynova.udi.entity.MatchData;
import com.infynova.udi.entity.Task;
import com.infynova.udi.enums.match.MatchStatusEnum;
......@@ -79,6 +81,8 @@ public class TaskUploadHelper {
log.info("任务上传转换定时执行-此次处理的任务数量:{}",uploadingTaskList.size());
}
for (Task uploadingTask : uploadingTaskList) {
SpringContextUtils.set(HeaderCode.IDENTITY_ID, String.valueOf(uploadingTask.getCreateBy()));
SpringContextUtils.set(HeaderCode.TENANT_ID, String.valueOf(uploadingTask.getCreateBy()));
tranUpload(uploadingTask.getId());
}
}
......
......@@ -191,9 +191,7 @@ public class TaskServiceImpl extends BaseService implements TaskService {
*/
@Override
public List<Task> getUploadingTask() {
LambdaQueryWrapper<Task> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Task::getTaskStatus,TaskStatusEnum.UPLOADING.getCode());
return taskMapper.selectList(queryWrapper);
return taskMapper.getUploadingTask();
}
/**
......
......@@ -36,4 +36,14 @@
where
t.task_no = #{taskNo}
</select>
<select id="getUploadingTask" resultType="com.infynova.udi.entity.Task">
select
t.*
from
task as t
where
t.task_status = 10
limit 10
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment