Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
wulin 2020-12-16 14:16:51 +08:00
commit 367bd1f366
4 changed files with 17 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.job.entity.ScheduleJobEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
@ -26,4 +27,6 @@ public interface ScheduleJobDao extends BaseMapper<ScheduleJobEntity> {
* 批量更新状态
*/
int updateBatch(Map<String, Object> map);
List<ScheduleJobEntity> selectAll();
}

View File

@ -33,12 +33,18 @@ public class ScheduleJobServiceImpl extends ServiceImpl<ScheduleJobDao, Schedule
@Autowired
private Scheduler scheduler;
@Autowired
private ScheduleJobDao scheduleJobMapper;
/**
* 项目启动时初始化定时器
*/
@PostConstruct
public void init(){
List<ScheduleJobEntity> scheduleJobList = this.list();
List<ScheduleJobEntity> scheduleJobList = scheduleJobMapper.selectAll();
for(ScheduleJobEntity scheduleJob : scheduleJobList){
CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, scheduleJob.getJobId());
//如果不存在则创建

View File

@ -1463,7 +1463,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
if(CollectionUtils.isEmpty(flowRecordRunning) ){
flowRecords = flowRecordService.selectFlowRecordByResultRecordId(recordDetailDto.getResultRecordId());
}else{
flowRecords = flowRecordService.selectFlowRecordByRecordIdLeFlowIndex(recordDetailDto.getResultRecordId(),flowRecordRunning.get(0).getFlowIndex());
flowRecords = flowRecordService.selectFlowRecordByRecordIdLeFlowIndex(recordDetailDto.getResultRecordId(),flowRecordRunning.get(0).getFlowIndex() -1 );
}
int flowIndex = 0;
List<ResetDataResp> resetDataResps = new ArrayList<>();

View File

@ -11,4 +11,10 @@
</foreach>
</update>
<select id="selectAll" resultType="com.lz.modules.job.entity.ScheduleJobEntity">
select * from schedule_job where status = 0
</select>
</mapper>