| | |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.handler.AutoReplenishmentHandler; |
| | | import com.zy.common.entity.Parameter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | |
| | | private LocDetlService locDetlService; |
| | | |
| | | /* |
| | | 定时便利库存,生成自动补货单据 |
| | | 定时遍历库存,生成自动补货单据 |
| | | */ |
| | | @Scheduled(cron = "0 */1 * * * ? ") |
| | | // @Scheduled(cron = "0 */1 * * * ? ") |
| | | public void createOrder(){ |
| | | System.out.println(new Date()); |
| | | |
| | | if(!"Y".equals(Parameter.get().getAutoReplenishment())){ |
| | | return; |
| | | } |
| | | |
| | | //检测是否有未完成的补货单据 |
| | | DocType docType = docTypeService.selectOne(new EntityWrapper<DocType>().eq("doc_name", "自动补货单")); |
| | | int count = orderService.selectCount(new EntityWrapper<Order>() |
| | |
| | | if(anfmeSum > mat.getStoreMin()){ |
| | | continue; |
| | | } |
| | | //查询当前物料四项库是否存在,并且托盘不含有非料箱物料 |
| | | //查询当前物料四项库是否存在,并且货架不含有非货架物料 |
| | | if(Cools.isEmpty(locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("matnr", mat.getMatnr())))){ |
| | | continue; |
| | | } |
| | |
| | | /* |
| | | 定时处理自动补货单据 |
| | | */ |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | //@Scheduled(cron = "0/10 * * * * ? ") |
| | | public void excuteOrder(){ |
| | | DocType docType = docTypeService.selectOne(new EntityWrapper<DocType>().eq("doc_name", "自动补货单")); |
| | | List<Order> orderList = orderService.selectList(new EntityWrapper<Order>() |