Commit 3837ed15 by 刘栋

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

parent b7150e10
...@@ -8,6 +8,8 @@ import com.infynova.udi.mapper.base.SuperMapper; ...@@ -8,6 +8,8 @@ import com.infynova.udi.mapper.base.SuperMapper;
import com.infynova.udi.vo.UdiMatchListVo; import com.infynova.udi.vo.UdiMatchListVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author liudong * @author liudong
* 2024/2/29 16:41 * 2024/2/29 16:41
...@@ -18,4 +20,6 @@ public interface TaskMapper extends SuperMapper<Task> { ...@@ -18,4 +20,6 @@ public interface TaskMapper extends SuperMapper<Task> {
Page<UdiMatchListVo> queryTaskPage(IPage page, @Param("query") UdiMatchTaskListQry udiMatchTaskListQry); Page<UdiMatchListVo> queryTaskPage(IPage page, @Param("query") UdiMatchTaskListQry udiMatchTaskListQry);
Task queryTaskNo(@Param("taskNo") String taskNo); Task queryTaskNo(@Param("taskNo") String taskNo);
List<Task> getUploadingTask();
} }
...@@ -2,6 +2,8 @@ package com.infynova.udi.service.helper; ...@@ -2,6 +2,8 @@ package com.infynova.udi.service.helper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.MatchData;
import com.infynova.udi.entity.MatchTemp; import com.infynova.udi.entity.MatchTemp;
import com.infynova.udi.enums.match.MatchStatusEnum; import com.infynova.udi.enums.match.MatchStatusEnum;
...@@ -108,6 +110,8 @@ public class MatchHelper { ...@@ -108,6 +110,8 @@ public class MatchHelper {
TaskVo taskVo = taskHelper.getTaskVo(taskId); TaskVo taskVo = taskHelper.getTaskVo(taskId);
log.info("对码匹配-taskNo:{}",taskVo.getTask().getTaskNo()); 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){ while (true){
// 查询未开始的数据 // 查询未开始的数据
......
...@@ -5,6 +5,8 @@ import cn.hutool.core.date.LocalDateTimeUtil; ...@@ -5,6 +5,8 @@ import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.listener.PageReadListener; 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.MatchData;
import com.infynova.udi.entity.Task; import com.infynova.udi.entity.Task;
import com.infynova.udi.enums.match.MatchStatusEnum; import com.infynova.udi.enums.match.MatchStatusEnum;
...@@ -79,6 +81,8 @@ public class TaskUploadHelper { ...@@ -79,6 +81,8 @@ public class TaskUploadHelper {
log.info("任务上传转换定时执行-此次处理的任务数量:{}",uploadingTaskList.size()); log.info("任务上传转换定时执行-此次处理的任务数量:{}",uploadingTaskList.size());
} }
for (Task uploadingTask : uploadingTaskList) { 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()); tranUpload(uploadingTask.getId());
} }
} }
......
...@@ -191,9 +191,7 @@ public class TaskServiceImpl extends BaseService implements TaskService { ...@@ -191,9 +191,7 @@ public class TaskServiceImpl extends BaseService implements TaskService {
*/ */
@Override @Override
public List<Task> getUploadingTask() { public List<Task> getUploadingTask() {
LambdaQueryWrapper<Task> queryWrapper = new LambdaQueryWrapper<>(); return taskMapper.getUploadingTask();
queryWrapper.eq(Task::getTaskStatus,TaskStatusEnum.UPLOADING.getCode());
return taskMapper.selectList(queryWrapper);
} }
/** /**
......
...@@ -36,4 +36,14 @@ ...@@ -36,4 +36,14 @@
where where
t.task_no = #{taskNo} t.task_no = #{taskNo}
</select> </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> </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