自动化立体仓库 - WCS系统
#
vincent
2020-06-02 4eca179a8c7ebbe310f6560fc8f88555a2e6994e
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
package com.zy.client.controller;
 
import com.core.annotations.ManagerAuth;
import com.core.common.R;
import com.zy.client.domain.CrnStateTableVo;
import com.zy.client.domain.enums.CrnStatusType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
 
/**
 * 堆垛机接口
 * Created by vincent on 2020-06-01
 */
@RestController
@RequestMapping("/crn")
public class CrnController {
 
 
    private AtomicInteger integer = new AtomicInteger();
 
    @PostMapping("/table/crn/state")
    @ManagerAuth(memo = "堆垛机信息表")
    public R crnTable(){
        List<CrnStateTableVo> list = new ArrayList<>();
        for (int i=0;i<4;i++){
            CrnStateTableVo vo = new CrnStateTableVo("1", CrnStatusType.AUTO, "正常", "有物", "99", "3", "中位", "18233", "422", "0", "1204", "关闭", "0");
            if (integer.get()%5 == 0) {
                vo.setWorkNo("0000");
            } else {
                vo.setWorkNo("9998");
            }
            list.add(vo);
        }
        integer.getAndIncrement();
        return R.ok().add(list);
    }
 
    @PostMapping("/output/site")
    @ManagerAuth(memo = "堆垛机报文日志输出")
    public R crnOutput(){
        String str = "\n" +new Date().toLocaleString() + "【2020-5-29 13:14:22】扫描plcA 目标站--273283723728327636432343234323422732837237283276364323432343234227328372372832763643234323432342";
        return R.ok().add(str);
    }
}