dubin
1 天以前 0e10bf39c53b0b79cbdc051ddb10845d361042c3
初始化
10个文件已修改
532 ■■■■ 已修改文件
src/main/java/com/zy/common/model/AgvTaskCompleteDto.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/task/GhlnWcsScheduler.java 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/controller/OpenController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/service/impl/MainServiceImpl.java 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/utils/Utils.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/console.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/console.map.js 190 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/crn.html 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/model/AgvTaskCompleteDto.java
@@ -9,4 +9,5 @@
 */
@Data
public class AgvTaskCompleteDto {
    private Integer staNo; // 取放货站点
}
src/main/java/com/zy/common/task/GhlnWcsScheduler.java
@@ -23,7 +23,9 @@
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@@ -49,57 +51,65 @@
    @Scheduled(cron = "0/5 * * * * ?")
    private void wcsOpenComplete() {
        SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
        StaProtocol staProtocol305 = devpThread.getStation().get(305);
        if (staProtocol305!= null && staProtocol305.getIfOpenDoor()) {
            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
            if (basDevp.getWrkNo() != 0) {
                WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
                if (wrkMast == null || wrkMast.getWhsType() == null || wrkMast.getWhsType() == 3){
                    return;
                }
                if (wrkMast.getWhsType() == 4) {
                    return;
                }
                WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()));
                // 判断开门完成,则通知agv可以放货
                // 调用结果
                boolean success = false;
                // 构造请求头
                Map<String, Object> headers = new HashMap<>();
                headers.put("Content-Type", "application/json;charset=UTF-8");
                // 构造请求体
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("matnr",wrkDetl.getMatnr());
                jsonObject.put("batch",wrkDetl.getBatch());
                jsonObject.put("flag",wrkMast.getIoType() > 100 ? "0" : "1");
                String body = jsonObject.toJSONString();
                String response = "";
                try {
                    response = new HttpHandler.Builder()
                            .setUri(AgvApi.OPEN_COMPLETE_PUSH.getURI())
                            .setPath(AgvApi.OPEN_COMPLETE_PUSH.getPath())
                            .setHeaders(headers)
                            .setJson(body)
                            .build()
                            .doPost();
                    if (!Cools.isEmpty(response)) {
                        JSONObject jsonObject1 = JSONObject.parseObject(response);
                        if ((Integer) jsonObject1.get("code") == 200) {
                            success = true;
                            wrkMast.setWhsType(3);
                            wrkMastService.updateById(wrkMast);
                        }
                    } else {
                        log.error("wcs开门完成通知agv接口异常接口失败!!!url:{};request:{};response:{}", "", body, response);
        List<StaProtocol> staProtocols = new ArrayList<StaProtocol>() {{
            add(devpThread.getStation().get(305));
            add(devpThread.getStation().get(1202));
        }};
//        StaProtocol staProtocol305 = devpThread.getStation().get(305);
        for (StaProtocol staProtocol : staProtocols) {
//            if (staProtocol305 != null && staProtocol305.getIfOpenDoor()) {
            if (staProtocol != null && staProtocol.getIfOpenDoor()) {
                BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", staProtocol.getSiteId()));
                if (basDevp.getWrkNo() != 0) {
                    WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
                    if (wrkMast == null || wrkMast.getWhsType() == null || wrkMast.getWhsType() == 3) {
                        return;
                    }
                } catch (Exception e) {
                    log.error("wcs开门完成通知agv接口异常:{}", e.getMessage());
                } finally {
                    log.error("wcs开门完成通知agv接口:{}", success);
                    if (wrkMast.getWhsType() == 4) {
                        return;
                    }
                    WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()));
                    // 判断开门完成,则通知agv可以放货
                    // 调用结果
                    boolean success = false;
                    // 构造请求头
                    Map<String, Object> headers = new HashMap<>();
                    headers.put("Content-Type", "application/json;charset=UTF-8");
                    // 构造请求体
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("matnr", wrkDetl.getMatnr());
                    jsonObject.put("batch", wrkDetl.getBatch());
                    jsonObject.put("flag", wrkMast.getIoType() > 100 ? "0" : "1");
                    String body = jsonObject.toJSONString();
                    String response = "";
                    try {
                        response = new HttpHandler.Builder()
                                .setUri(AgvApi.OPEN_COMPLETE_PUSH.getURI())
                                .setPath(AgvApi.OPEN_COMPLETE_PUSH.getPath())
                                .setHeaders(headers)
                                .setJson(body)
                                .build()
                                .doPost();
                        if (!Cools.isEmpty(response)) {
                            JSONObject jsonObject1 = JSONObject.parseObject(response);
                            if ((Integer) jsonObject1.get("code") == 200) {
                                success = true;
                                wrkMast.setWhsType(3);
                                wrkMastService.updateById(wrkMast);
                            }
                        } else {
                            log.error("wcs开门完成通知agv接口异常接口失败!!!url:{};request:{};response:{}", "", body, response);
                        }
                    } catch (Exception e) {
                        log.error("wcs开门完成通知agv接口异常:{}", e.getMessage());
                    } finally {
                        log.error("wcs开门完成通知agv接口:{}", success);
                    }
                }
            }
        }
        }
    }
    /**
     * 读已关门
@@ -107,22 +117,27 @@
    @Scheduled(cron = "0/5 * * * * ?")
    private void wcsCloseComplete() {
        SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
        StaProtocol staProtocol = devpThread.getStation().get(305);
        if (staProtocol == null) {
            return;
        } else {
            staProtocol = staProtocol.clone();
        }
            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
        List<StaProtocol> staProtocols = new ArrayList<StaProtocol>() {{
            add(devpThread.getStation().get(305));
            add(devpThread.getStation().get(1202));
        }};
//        StaProtocol staProtocol = devpThread.getStation().get(305);
        for (StaProtocol staProtocol : staProtocols) {
            if (staProtocol == null) {
                return;
            } else {
                staProtocol = staProtocol.clone();
            }
            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", staProtocol.getSiteId()));
            if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) {
                WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
                if (wrkMast == null ||  wrkMast.getWhsType() == null ||wrkMast.getWhsType() != 4) {
                if (wrkMast == null || wrkMast.getWhsType() == null || wrkMast.getWhsType() != 4) {
                    return;
                }
                if (wrkMast.getIoType() == 1 && wrkMast.getWrkSts() == 1) {
                    staProtocol.setWorkNo(wrkMast.getWrkNo());
                    staProtocol.setStaNo(wrkMast.getStaNo().shortValue());
                    if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol))){
                    if (!MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol))) {
                        log.error("入库关门完成失败");
                    }
                    wrkMast.setWrkSts(2L);
@@ -132,12 +147,13 @@
                } else if (wrkMast.getIoType() == 101) {
                    staProtocol.setWorkNo(9999);
                    staProtocol.setStaNo(wrkMast.getSourceStaNo().shortValue());
                    if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol))){
                    if (!MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol))) {
                        log.error("出库关门完成失败");
                    }
                    basDevp.setWrkNo(staProtocol.getWorkNo());
                    basDevpService.updateById(basDevp);
                }
            }
        }
    }
}
src/main/java/com/zy/controller/OpenController.java
@@ -49,12 +49,14 @@
                                     HttpServletRequest request) {
        auth(appkey, param, request);
            // 给305写关门
            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
//            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", param.getStaNo()));
            if (basDevp.getWrkNo() != 0) {
                WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
                if(wrkMast.getWhsType() != null && wrkMast.getWhsType() == 3) {
                    SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
                    StaProtocol staProtocol305 = devpThread.getStation().get(305);
//                    StaProtocol staProtocol305 = devpThread.getStation().get(305);
                    StaProtocol staProtocol305 = devpThread.getStation().get(param.getStaNo());
                    if (!staProtocol305.getIfCloseDoor()) { // 没请求关闭
                        // 请求关闭
                        if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 0))){
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -45,21 +45,22 @@
    public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{
        add(100);add(101);add(102);add(103);
        add(104);add(105);add(106);add(107);
        add(200);add(201);add(202);add(203);add(210);
        add(300);add(301);add(302);add(303);add(304);add(305);
        add(1101);add(1102);
        add(200);add(201);add(202);add(203);add(2101);add(2102);add(2103);add(2104);add(210);
        add(300);add(301);add(302);add(303);add(304);add(305);add(1200);add(1201);add(1202);
    }};
    public static final ArrayList<Integer> BarcodeList = new ArrayList<Integer>() {{
        add(1); add(2);
        add(1); add(2);add(3);
    }};
    public static final ArrayList<Integer> staNosErrList = new ArrayList<Integer>() {{
        add(101); add(103);
        add(101); add(103);add(1102);
    }};
    /**
     * 条码数量
     */
    private int barcodeSize = 2;
    private int barcodeSize = 3;
    /**
     * 入出库模式
@@ -218,7 +219,7 @@
        // 读一楼连续8个站点
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB101.0", (short) (8*8));
        if (result.IsSuccess) {
            for (int i = 0; i < 8; i++) {
            for (int i = 0; i < 10; i++) {
                Integer siteId = staNos.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
@@ -248,7 +249,7 @@
        // 读二楼连续4个站点
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.800", (short) (4*8));
        if (result2.IsSuccess) {
            for (int i = 8; i < 12; i++) {
            for (int i = 10; i < 18; i++) {
                Integer siteId = staNos.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
@@ -278,7 +279,7 @@
        // 读二楼210
        OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB101.880", (short) (8));
        if (result3.IsSuccess) {
                Integer siteId = staNos.get(12); // 站点编号210
                Integer siteId = staNos.get(18); // 站点编号210
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
                    staProtocol = new StaProtocol();
@@ -306,7 +307,7 @@
        // 读二楼3区
        OperateResultExOne<byte[]> result4 = siemensS7Net.Read("DB101.1600", (short) (6*8));
        if (result2.IsSuccess) {
            for (int i = 13; i < staNos.size(); i++) {
            for (int i = 19; i < staNos.size(); i++) {
                Integer siteId = staNos.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
@@ -382,7 +383,7 @@
        // 读一楼连续8个站点,故障信息反馈
        OperateResultExOne<byte[]> resultErr2 = siemensS7Net.Read("DB101.3312", (short) (8*2));
        if (resultErr2.IsSuccess) {
            for (int i = 0; i < 8; i++) {
            for (int i = 0; i < 10; i++) {
                boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr2.Content, i*2 + 1, 1);
                StaProtocol staProtocol = station.get(staNos.get(i)); // 站点编号
                staProtocol.setBreakerErr(status[0]);
@@ -399,7 +400,7 @@
        // 读二楼连续4个站点,故障信息反馈
        OperateResultExOne<byte[]> resultErr3 = siemensS7Net.Read("DB101.3512", (short) (4*2));
        if (resultErr3.IsSuccess) {
            for (int i = 8; i < 12; i++) {
            for (int i = 10; i < 18; i++) {
                boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr3.Content, (i-8) * 2 + 1, 1);
                StaProtocol staProtocol = station.get(staNos.get(i)); // 站点编号
                staProtocol.setBreakerErr(status[0]);
@@ -415,7 +416,7 @@
        // 读三区故障信息反馈
        OperateResultExOne<byte[]> resultErr4 = siemensS7Net.Read("DB101.2096", (short) (6*2));
        if (resultErr4.IsSuccess) {
            for (int i = 13; i < staNos.size(); i++) {
            for (int i = 19; i < staNos.size(); i++) {
                boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr4.Content, (i-13) * 2 + 1, 1);
                StaProtocol staProtocol = station.get(staNos.get(i)); // 站点编号
                staProtocol.setBreakerErr(status[0]);
src/main/java/com/zy/service/impl/MainServiceImpl.java
@@ -95,6 +95,9 @@
    @Value("${wms.url}")
    private String wmsUrl;
    @Value("${open-door.site}")
    private String openDoorSite;
    public Integer wrkNo = 9901;
    /**
@@ -1068,7 +1071,12 @@
                    // 双深库位且浅库位有货,则需先对浅库位进行库位移转
                    if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) {
                        News.warnNoLog(""+mark+" - 2"+" - 6"+" - 双深库位且浅库位有货,则需先对浅库位进行库位移转 : 开始执行 任务号={}",wrkMast.getWrkNo());
                        String shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo());
                        String shallowLocNo = "";
                        if (Utils.getRow(wrkMast.getSourceLocNo()) == 11 && Utils.getBay(wrkMast.getSourceLocNo()) <= 18){
                            shallowLocNo = "10" + Utils.getBay(wrkMast.getSourceLocNo()) + Utils.getLev(wrkMast.getSourceLocNo());
                        }else {
                            shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo());
                        }
                        LocMast shallowLoc = locMastService.selectById(shallowLocNo);
                        // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬!
                        if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) {
@@ -1883,7 +1891,12 @@
                    if (loc != null) {
                        if (Utils.isDeepLoc(slaveProperties, loc.getLocNo())) {
                            String shallowLocNo = Utils.getShallowLoc(slaveProperties, loc.getLocNo());
                            String shallowLocNo = "";
                            if (row == 11){
                                shallowLocNo = "10" + loc.getBay1() + loc.getLev1();
                            }else {
                                shallowLocNo = Utils.getShallowLoc(slaveProperties, loc.getLocNo());
                            }
                            LocMast shallowLoc1 = locMastService.selectById(shallowLocNo);
                            if (!shallowLoc1.getLocSts().equals("O")) {
                                loc = null;
@@ -1900,7 +1913,7 @@
                    if (Utils.isShallowLoc(slaveProperties, row)) {
                        loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2());
                        if (null != loc) {//对应深库位非在库状态,不能移库
                        if (null != loc && row != 9 && row != 10) {//对应深库位非在库状态,不能移库
                            String deepLoc = Utils.getDeepLoc(slaveProperties, loc.getLocNo());
                            LocMast deepLoc1 = locMastService.selectById(deepLoc);
                            if (!deepLoc1.getLocSts().equals("F") && !deepLoc1.getLocSts().equals("D")) {
@@ -3101,20 +3114,39 @@
    }
    public synchronized void writePlc305() {
        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
        if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) {
            WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
            if(wrkMast != null && wrkMast.getWhsType() != null && wrkMast.getWhsType() == 2) {
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
                StaProtocol staProtocol305 = devpThread.getStation().get(305);
                if (!staProtocol305.getOpenAskDoor() && !staProtocol305.getIfOpenDoor()) { // 没请求打开
                    // 请求打开
                    if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 1))){
                        log.error("请求开门失败");
        String[] sites = openDoorSite.split(",");
        for (String site : sites) {
            Integer sta = Integer.valueOf(site);
            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", sta));
            if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) {
                WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
                if(wrkMast != null && wrkMast.getWhsType() != null && wrkMast.getWhsType() == 2) {
                    SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
                    StaProtocol staProtocol305 = devpThread.getStation().get(sta);
                    if (!staProtocol305.getOpenAskDoor() && !staProtocol305.getIfOpenDoor()) { // 没请求打开
                        // 请求打开
//                        if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 1))){
                        if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, site))){ // data为需要开门的站点 通知PLC需要开哪个门
                            log.error("请求开门失败");
                        }
                    }
                }
            }
        }
//        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
//        if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) {
//            WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
//            if(wrkMast != null && wrkMast.getWhsType() != null && wrkMast.getWhsType() == 2) {
//                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
//                StaProtocol staProtocol305 = devpThread.getStation().get(305);
//                if (!staProtocol305.getOpenAskDoor() && !staProtocol305.getIfOpenDoor()) { // 没请求打开
//                    // 请求打开
//                    if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 1))){
//                        log.error("请求开门失败");
//                    }
//                }
//            }
//        }
    }
    public synchronized void readPlc305() {
        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 16L));
@@ -3132,7 +3164,7 @@
//                return;
//            }
           List<WrkMast> wrkMastList = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 1L).eq("io_type", 1)
                .eq("source_sta_no", 305).orderBy("appe_time",true));
                .in("source_sta_no", 305, 1202).orderBy("appe_time",true));
           for (WrkMast wrkMast : wrkMastList) {
               SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
               StaProtocol staProtocol= devpThread.getStation().get(wrkMast.getStaNo());
src/main/java/com/zy/utils/Utils.java
@@ -144,6 +144,26 @@
    }
    /**
     * 通过库位号获取 列
     */
    public static int getBay(String locNo) {
        if (!Cools.isEmpty(locNo)) {
            return Integer.parseInt(locNo.substring(2, 5));
        }
        throw new RuntimeException("库位解析异常");
    }
    /**
     * 通过库位号获取 层
     */
    public static int getLev(String locNo) {
        if (!Cools.isEmpty(locNo)) {
            return Integer.parseInt(locNo.substring(5, 7));
        }
        throw new RuntimeException("库位解析异常");
    }
    /**
     * 当检索到双深库位的浅库位时,如果深库位无货,则放入对应的深库位
     */
    public static void toDeepIfEmptyByShallow(String shallowLoc) {
src/main/resources/application.yml
@@ -8,8 +8,8 @@
    name: @pom.build.finalName@
  datasource:
    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    url: jdbc:sqlserver://10.10.10.243:1433;databasename=ghlnasrs
#    url: jdbc:sqlserver://127.0.0.1:1433;databasename=ghlnasrs
#    url: jdbc:sqlserver://10.10.10.243:1433;databasename=ghlnasrs
    url: jdbc:sqlserver://127.0.0.1:1433;databasename=ghlnasrs
    username: sa
    password: sa@123
  mvc:
@@ -35,14 +35,18 @@
  enable: false
wms:
  url: 10.10.10.243:8080/ghlnwms
#  url: 10.10.10.243:8080/ghlnwms
  url: 127.0.0.1:8080/ghlnwms
open-door:
  site: 305,1202
# 下位机配置
wcs-slave:
  # 双深
  doubleDeep: true
  # 双深库位排号
  doubleLocs: 1,4,5,8
  doubleLocs: 1,4,5,8,11
  # 一个堆垛机负责的货架排数
  groupCount: 4
@@ -136,6 +140,48 @@
      row: 6
      bay: 28
      lev: 1
  # 堆垛机3
  crn[2]:
    id: 3
    ip: 10.10.10.20
    port: 102
    rack: 0
    slot: 0
    # 偏移量,当堆垛机站点列号=1时,偏移量=2
    offset: 2
    demo: false
    # 堆垛机入库站点
    crnInStn[0]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 1102
      row: 9
      bay: 1
      lev: 1
    crnInStn[1]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 2101
      row: 9
      bay: 1
      lev: 2
    # 堆垛机出库站点
    crnOutStn[0]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 1102
      row: 6
      bay: 1
      lev: 1
    crnOutStn[1]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 2101
      row: 9
      bay: 1
      lev: 2
    crnOutStn[2]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 2103
      row: 10
      bay: 1
      lev: 1
  # 输送线1
  devp[0]:
@@ -159,6 +205,15 @@
    # 入库口3
    inSta[2]:
      staNo: 305
    # 入库口4
    inSta[3]:
      staNo: 1102
      barcode: ${wcs-slave.barcode[2].id}
      backSta: 108
      led: ${wcs-slave.led[3].id}
    # 入库口5
    inSta[4]:
      staNo: 1202
    # 空板入库口1
#    emptyInSta[0]:
#      staNo: 101
@@ -188,6 +243,13 @@
    # 出库口5
    outSta[4]:
      staNo: 305
    # 出库口6
    outSta[5]:
      staNo: 1101
      led: ${wcs-slave.led[3].id}
    # 出库口7
    outSta[6]:
      staNo: 1202
  # 条码扫描仪1
  barcode[0]:
@@ -198,6 +260,11 @@
  barcode[1]:
    id: 2
    ip: 10.10.10.122
    port: 51236
  # 条码扫描仪3
  barcode[2]:
    id: 2
    ip: 10.10.10.123
    port: 51236
  # LED1
@@ -221,4 +288,11 @@
    ip: 10.10.10.192
    port: 5005
    devpPlcId: ${wcs-slave.devp[0].id}
    staArr: 104
    staArr: 104
  # LED3
  led[3]:
    id: 4
    ip: 10.10.10.193
    port: 5005
    devpPlcId: ${wcs-slave.devp[0].id}
    staArr: 1101
src/main/webapp/static/js/console.js
@@ -126,7 +126,7 @@
        let stnss = areas[i].stns
        let floor = areas[i].text
        floorId = areas[i].id
        var position = (i+1)*100
        var position = (i+1)*300
        floorBtn =
            "<button class='floorBtn btn-16' onclick='changFloor("+i+")' style='top: "+position+"px;'>" + floor +"</button>"
        if (mapInfo.areas[0].floors.length == 1) {
src/main/webapp/static/js/console.map.js
@@ -1,7 +1,7 @@
mapInfo = {
    "mapName": "WCS",
    "rackCount": 8,
    "crnCount": 2,
    "rackCount": 10,
    "crnCount": 3,
    "stbCount": 18,
    "hpPosition": 1,
    "minBayNo": 1,
@@ -9,7 +9,7 @@
    "racks": [{
        "type": "rack",
        "id": "rack1",
        "top": 189,
        "top": 325,
        "left": 200,
        "width": 1350,
        "height": 23,
@@ -18,7 +18,7 @@
    }, {
        "type": "rack",
        "id": "rack8",
        "top": 457,
        "top": 595,
        "left": 200,
        "width": 1300,
        "height": 23,
@@ -27,7 +27,7 @@
    }, {
        "type": "rack",
        "id": "rack7",
        "top": 430,
        "top": 570,
        "left": 200,
        "width": 1300,
        "height": 23,
@@ -36,7 +36,7 @@
    }, {
        "type": "rack",
        "id": "rack6",
        "top": 365,
        "top": 500,
        "left": 200,
        "width": 1350,
        "height": 23,
@@ -45,7 +45,7 @@
    }, {
        "type": "rack",
        "id": "rack5",
        "top": 338,
        "top": 473,
        "left": 200,
        "width": 1350,
        "height": 23,
@@ -54,7 +54,7 @@
    }, {
        "type": "rack",
        "id": "rack4",
        "top": 311,
        "top": 448,
        "left": 200,
        "width": 1300,
        "height": 23,
@@ -63,7 +63,7 @@
    }, {
        "type": "rack",
        "id": "rack3",
        "top": 283,
        "top": 423,
        "left": 200,
        "width": 1300,
        "height": 23,
@@ -72,34 +72,64 @@
    }, {
        "type": "rack",
        "id": "rack2",
        "top": 217,
        "top": 350,
        "left": 200,
        "width": 1350,
        "height": 23,
        "minBayNo": 1,
        "maxBayNo": 31
    },{
        "type": "rack",
        "id": "rack9",
        "top": 300,
        "left": 200,
        "width": 1300,
        "height": 23,
        "minBayNo": 2,
        "maxBayNo": 31
    },{
        "type": "rack",
        "id": "rack10",
        "top": 230,
        "left": 200,
        "width": 1350,
        "height": 23,
        "minBayNo": 1,
        "maxBayNo": 31
    },{
        "type": "rack",
        "id": "rack11",
        "top": 205,
        "left": 200,
        "width": 1350,
        "height": 23,
        "minBayNo": 1,
        "maxBayNo": 18
    }],
    "rackDescs": [{
        "type": "rackDescs",
        "id": "lb_desc8",
        "text": "#8",
        "top": 190,
        "top": 325,
        "left": 150,
        "width": 33,
        "height": 23
    },
        {"type": "rackDescs", "id": "lb_desc7", "text": "#7", "top": 218, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc6", "text": "#6", "top": 280, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc5", "text": "#5", "top": 310, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc4", "text": "#4", "top": 340, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc3", "text": "#3", "top": 370, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc2", "text": "#2", "top": 430, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc1", "text": "#1", "top": 460, "left": 150, "width": 33, "height": 23}],
        {"type": "rackDescs", "id": "lb_desc11", "text": "#11", "top": 205, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc10", "text": "#10", "top": 230, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc9", "text": "#9", "top": 300, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc7", "text": "#7", "top": 350, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc6", "text": "#6", "top": 423, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc5", "text": "#5", "top": 448, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc4", "text": "#4", "top": 473, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc3", "text": "#3", "top": 500, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc2", "text": "#2", "top": 570, "left": 150, "width": 33, "height": 23},
        {"type": "rackDescs", "id": "lb_desc1", "text": "#1", "top": 595, "left": 150, "width": 33, "height": 23}],
    "crns": [{
        "type": "crane",
        "id": "crn-1",
        "text": "1",
        "top": 393,
        "top": 530,
        "left": 376,
        "width": 101,
        "height": 32
@@ -107,7 +137,7 @@
        "type": "track",
        "id": "lb_track4",
        "text": "",
        "top": 408,
        "top": 548,
        "left": 200,
        "width": 1300,
        "height": 1
@@ -115,7 +145,7 @@
        "type": "crane",
        "id": "crn-2",
        "text": "2",
        "top": 250,
        "top": 385,
        "left": 383,
        "width": 101,
        "height": 29
@@ -123,7 +153,23 @@
        "type": "track",
        "id": "lb_track3",
        "text": "",
        "top": 400,
        "left": 200,
        "width": 1300,
        "height": 1
    },{
        "type": "crane",
        "id": "crn-3",
        "text": "3",
        "top": 265,
        "left": 383,
        "width": 101,
        "height": 29
    },{
        "type": "track",
        "id": "lb_track5",
        "text": "",
        "top": 280,
        "left": 200,
        "width": 1300,
        "height": 1
@@ -148,7 +194,7 @@
                "type": "stn",
                "id": "site-102",
                "text": "102",
                "top": 431,
                "top": 570,
                "left": 1600,
                "width": 59,
                "height": 27
@@ -156,7 +202,7 @@
                "type": "stn",
                "id": "site-103",
                "text": "103",
                "top": 431,
                "top": 570,
                "left": 1520,
                "width": 59,
                "height": 27
@@ -164,7 +210,7 @@
                "type": "stn",
                "id": "site-100",
                "text": "100",
                "top": 285,
                "top": 423,
                "left": 1600,
                "width": 59,
                "height": 25
@@ -172,7 +218,7 @@
                "type": "stn",
                "id": "site-101",
                "text": "101",
                "top": 285,
                "top": 423,
                "left": 1520,
                "width": 59,
                "height": 25
@@ -181,7 +227,7 @@
                    "type": "stn",
                    "id": "site-105",
                    "text": "105",
                    "top": 431,
                    "top": 570,
                    "left": 1328,
                    "width": 85,
                    "height": 50
@@ -189,7 +235,7 @@
                    "type": "stn",
                    "id": "site-104",
                    "text": "104",
                    "top": 491,
                    "top": 630,
                    "left": 1328,
                    "width": 85,
                    "height": 50
@@ -197,7 +243,7 @@
                    "type": "stn",
                    "id": "site-106",
                    "text": "106",
                    "top": 284,
                    "top": 420,
                    "left": 287,
                    "width": 86,
                    "height": 105
@@ -205,10 +251,26 @@
                    "type": "stn",
                    "id": "site-107",
                    "text": "107",
                    "top": 431,
                    "top": 570,
                    "left": 287,
                    "width": 86,
                    "height": 50
                },{
                    "type": "stn",
                    "id": "site-1102",
                    "text": "1102",
                    "top": 297,
                    "left": 1520,
                    "width": 59,
                    "height": 25
                },{
                    "type": "stn",
                    "id": "site-1101",
                    "text": "1101",
                    "top": 297,
                    "left": 1600,
                    "width": 59,
                    "height": 25
                }]
        }, {
            "type": "floor",
@@ -222,7 +284,7 @@
                "type": "stn",
                "id": "site-202",
                "text": "202",
                "top": 431,
                "top": 595,
                "left": 1600,
                "width": 59,
                "height": 27
@@ -230,7 +292,7 @@
                "type": "stn",
                "id": "site-203",
                "text": "203",
                "top": 431,
                "top": 595,
                "left": 1520,
                "width": 59,
                "height": 27
@@ -238,7 +300,7 @@
                "type": "stn",
                "id": "site-200",
                "text": "200",
                "top": 285,
                "top": 448,
                "left": 1600,
                "width": 59,
                "height": 25
@@ -246,7 +308,7 @@
                "type": "stn",
                "id": "site-201",
                "text": "201",
                "top": 285,
                "top": 448,
                "left": 1520,
                "width": 59,
                "height": 25
@@ -254,7 +316,7 @@
                "type": "stn",
                "id": "site-210",
                "text": "210",
                "top": 431,
                "top": 595,
                "left": 1680,
                "width": 59,
                "height": 25
@@ -265,7 +327,7 @@
                "top": 110,
                "left": 1690,
                "width": 1,
                "height": 350
                "height": 520
            }, {
                "type": "track",
                "id": "lb_track6",
@@ -273,7 +335,7 @@
                "top": 110,
                "left": 1720,
                "width": 1,
                "height": 350
                "height": 520
            }, {
                "type": "stn",
                "id": "site-300",
@@ -327,6 +389,62 @@
                    "left": 1450,
                    "width": 59,
                    "height": 25
                },{
                    "type": "stn",
                    "id": "site-2101",
                    "text": "2101",
                    "top": 297,
                    "left": 1520,
                    "width": 59,
                    "height": 25
                },{
                    "type": "stn",
                    "id": "site-2102",
                    "text": "2102",
                    "top": 297,
                    "left": 1600,
                    "width": 59,
                    "height": 25
                },{
                    "type": "stn",
                    "id": "site-2103",
                    "text": "2103",
                    "top": 230,
                    "left": 1600,
                    "width": 59,
                    "height": 25
                },{
                    "type": "stn",
                    "id": "site-2104",
                    "text": "2104",
                    "top": 120,
                    "left": 1722,
                    "width": 59,
                    "height": 25
                },{
                    "type": "stn",
                    "id": "site-1200",
                    "text": "1200",
                    "top": 120,
                    "left": 1782,
                    "width": 59,
                    "height": 25
                },{
                    "type": "stn",
                    "id": "site-1201",
                    "text": "1201",
                    "top": 94,
                    "left": 1782,
                    "width": 59,
                    "height": 25
                },{
                    "type": "stn",
                    "id": "site-1202",
                    "text": "1202",
                    "top": 68,
                    "left": 1782,
                    "width": 59,
                    "height": 25
                }
            ]
        }]
src/main/webapp/views/crn.html
@@ -65,12 +65,12 @@
                    <!--            <span>&nbsp;</span>-->
                    <input id="crn2" disabled="disabled">
                </div>
<!--                <div class="crn-command-item">-->
<!--                    <label>3#</label>-->
<!--                    <button id="demoBtn-3" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>-->
<!--                    &lt;!&ndash;            <span>&nbsp;</span>&ndash;&gt;-->
<!--                    <input id="crn3" disabled="disabled">-->
<!--                </div>-->
                <div class="crn-command-item">
                    <label>3#</label>
                    <button id="demoBtn-3" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>
                    <!--            <span>&nbsp;</span>-->
                    <input id="crn3" disabled="disabled">
                </div>
<!--                <div class="crn-command-item">-->
<!--                    <label>4#</label>-->
<!--                    <button id="demoBtn-4" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>-->
@@ -144,7 +144,7 @@
                    <div class="select-container" style="padding: 20px 0;">
                        <label><input type="radio" name="crnSelect" value="1" checked>&nbsp;1号堆垛机</label>
                        <label><input type="radio" name="crnSelect" value="2">&nbsp;2号堆垛机</label>
<!--                        <label><input type="radio" name="crnSelect" value="3">&nbsp;3号堆垛机</label>-->
                        <label><input type="radio" name="crnSelect" value="3">&nbsp;3号堆垛机</label>
<!--                        <label><input type="radio" name="crnSelect" value="4">&nbsp;4号堆垛机</label>-->
                    </div>
                </div>