| New file |
| | |
| | | package com.vincent.rsf.server.manager.schedules; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.system.constant.GlobalConfigCode; |
| | | import com.vincent.rsf.server.system.entity.Config; |
| | | import com.vincent.rsf.server.system.service.ConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Munch D. Luffy |
| | | * @date 2026/01/15 |
| | | * 缓存区域任务自动触发 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class TaskCacheLocSchedules { |
| | | |
| | | public static Logger logger = LoggerFactory.getLogger(TaskCacheLocSchedules.class); |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | /** |
| | | * @author Munch D. Luffy |
| | | * @date 2026/01/15 |
| | | * @description: 缓存区域自动生成移库任务 |
| | | * @version 1.0 |
| | | */ |
| | | @Scheduled(cron = "0/15 * * * * ?") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void startCacheInLocStock() throws Exception { |
| | | Config config = configService.getOne(new LambdaQueryWrapper<Config>().eq(Config::getFlag, GlobalConfigCode.AUTO_RUN_CHECK_ORDERS_YZ)); |
| | | if (!Boolean.parseBoolean(config.getVal())) { |
| | | return; |
| | | } |
| | | |
| | | String autoRunArea = configService.getVal("AUTO_RUN_AREA", String.class); |
| | | if (Cools.isEmpty(autoRunArea)) { |
| | | return; |
| | | } |
| | | List<Integer> array = new ArrayList<>(); |
| | | for (char c : autoRunArea.toCharArray()) { |
| | | switch (c) { |
| | | case '1': |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @author Munch D. Luffy |
| | | * @date 2026/01/15 |
| | | * @description: 缓存区域自动生成空货架出库任务 |
| | | * @version 1.0 |
| | | */ |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void complateOutStock() throws Exception { |
| | | } |
| | | } |