自动化立体仓库 - WMS系统
lsh
2025-05-26 d61d4384e19580a32becb54e8e7f2287bed5469a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.zy.asrs.task.NewWay;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.R;
import com.zy.asrs.controller.MobileController;
import com.zy.asrs.entity.WaitPakin;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.service.impl.WaitPakinServiceImpl;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.task.handler.WorkMastHandler;
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 java.util.Date;
import java.util.List;
 
/**
 * Created by vincent on 2020/7/7
 */
@Component
public class AutomaticallyAssignInTasksToRCSScheduler {
 
    private static final Logger log = LoggerFactory.getLogger(AutomaticallyAssignInTasksToRCSScheduler.class);
 
    @Autowired
    private WrkMastService wrkMastService;
    @Autowired
    private WorkMastHandler workMastHandler;
    @Autowired
    private WaitPakinServiceImpl waitPakinService;
    @Autowired
    private MobileController mobileController;
 
    /**
     * 自动派发入库任务给RCS
     */
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute(){
        //查看是否有agv在做的任务
        WaitPakin waitPakin1=waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("be_batch",1));
        if(waitPakin1!=null){
            return;
        }
        //找到正在等待的组托数据
        //该数据进行0转1
        WaitPakin waitPakin=waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("be_batch",0));
        if(waitPakin!=null){
            R r=mobileController.AGVMove(waitPakin.getMemo(),100+"");
            if (r.get("code").equals(200)){
                waitPakin.setBeBatch(1);//0转1
                waitPakinService.update(waitPakin,new EntityWrapper<WaitPakin>().eq("manu",waitPakin.getManu()));
            }
        }
 
    }
 
}