| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | List<TaskDetl> taskDetls = taskDetlService.getTaskDetlByTaskId(task.getId()); |
| | | if(taskDetls.isEmpty()) { |
| | | throw new CoolException("库存明细不存在"); |
| | | throw new CoolException("任务明细不存在"); |
| | | } |
| | | |
| | | //添加库存明细 |
| | |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | }finally { |
| | | InterceptorIgnoreHelper.clearIgnoreStrategy(); |
| | | } |
| | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Transactional |
| | | public void outExecute() { |
| | | InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().tenantLine(true).build()); |
| | | try { |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | }finally { |
| | | InterceptorIgnoreHelper.clearIgnoreStrategy(); |
| | | } |
| | | } |
| | | |
| | | } |