自动化立体仓库 - WCS系统
#
vincent
2020-06-03 4c82a8e7f607ebbb82a8d9c44e5ea08e1c8b0419
src/main/java/com/zy/client/controller/SiteController.java
@@ -2,14 +2,17 @@
import com.core.annotations.ManagerAuth;
import com.core.common.R;
import com.zy.client.domain.PlcErrorTable;
import com.zy.client.domain.vo.PlcErrorTableVo;
import com.zy.client.domain.vo.SiteTableVo;
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.Random;
import java.util.concurrent.atomic.AtomicInteger;
/**
 * 输送设备接口
@@ -19,21 +22,40 @@
@RequestMapping("/site")
public class SiteController {
    private AtomicInteger integer = new AtomicInteger();
    @PostMapping("/table/site")
    @ManagerAuth(memo = "站点信息表")
    public R siteTable(){
        return R.ok();
        List<SiteTableVo> list = new ArrayList<>();
        for (int i=0;i<32;i++){
            SiteTableVo vo = new SiteTableVo();
            vo.setDevNo(String.valueOf(i));
            vo.setWorkNo("1204");
            vo.setAutoing("Y");
            vo.setCanining("Y");
            vo.setCanouting("N");
            vo.setHighLow("1");
            vo.setInreqIn("Y");
            vo.setInreqOut("N");
            vo.setLoading("Y");
            if (integer.get()%5 == 0) {
                vo.setStaNo("0000");
            } else {
                vo.setStaNo("9998");
            }
            list.add(vo);
        }
        integer.getAndIncrement();
        return R.ok().add(list);
    }
    @PostMapping("/table/plc/errors")
    @ManagerAuth(memo = "输送设备plc异常信息表")
    public R plcErrorTable(){
        List<PlcErrorTable> list = new ArrayList<>();
        List<PlcErrorTableVo> list = new ArrayList<>();
        for (int i = 0; i<new Random().nextInt(13); i++){
            PlcErrorTable table = new PlcErrorTable();
            PlcErrorTableVo table = new PlcErrorTableVo();
            table.setNo(String.valueOf(i));
            table.setError("异常信息");
            table.setPlcDesc("plc异常描述");
@@ -52,4 +74,11 @@
        return R.ok().add(list);
    }
    @PostMapping("/output/site")
    @ManagerAuth(memo = "站点设备报文日志输出")
    public R siteOutput(){
        String str = "\n" +new Date().toLocaleString() + "【2020-5-29 13:14:22】扫描plcA 目标站--27328372372832763643234323432342";
        return R.ok().add(str);
    }
}