| | |
| | | // |
| | | // }}; |
| | | public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{ |
| | | add(100);add(101);add(102);add(103); |
| | | add(104);add(105);add(106);add(107); |
| | | add(108);add(109);add(110);add(111); |
| | | add(112);add(113);add(114);add(115); |
| | | add(116);add(117);add(118);add(119); |
| | | add(120);add(121);add(122);add(123); |
| | | add(121);add(122);add(123);add(124);add(125); |
| | | add(126); |
| | | add(221);add(222);add(223);add(224);add(225); |
| | | add(226);add(227);add(228);add(229);add(230); |
| | | add(231); |
| | | add(411);add(412);add(413);add(414); |
| | | }}; |
| | | |
| | | add(200);add(201);add(202);add(203); |
| | | add(204);add(205);add(206);add(207); |
| | | add(208);add(209);add(210);add(211); |
| | | add(212);add(213);add(214);add(215); |
| | | add(216);add(217);add(218);add(219); |
| | | add(220);add(221);add(222);add(223); |
| | | public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ |
| | | add(101);add(102);add(103); |
| | | add(104);add(105);add(106);add(107); |
| | | add(108);add(109); |
| | | |
| | | add(201);add(202);add(203); |
| | | add(204);add(205);add(206);add(207); |
| | | add(208);add(209);add(210);add(211); |
| | | |
| | | add(401);add(402);add(403);add(404); |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> BarcodeList = new ArrayList<Integer>() {{ |
| | | add(1); add(2); |
| | | add(1); add(2);add(3);add(4);add(5);add(6);add(7);add(8);add(9); |
| | | add(10); add(11); add(12); add(13); |
| | | }}; |
| | | public static final ArrayList<Integer> staNosErrList = new ArrayList<Integer>() {{ |
| | | add(101); add(201); |
| | |
| | | /** |
| | | * 条码数量 |
| | | */ |
| | | private int barcodeSize = 2; |
| | | private int barcodeSize = 13; |
| | | |
| | | /** |
| | | * 入出库模式 |
| | |
| | | switch (slave.getId()) { |
| | | case 1: |
| | | return staNos1; |
| | | case 2: |
| | | return staNos2; |
| | | default: |
| | | throw new CoolException("服务器异常"); |
| | | } |
| | |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | basDevps.add(staProtocol.toSqlModel()); |
| | | } |
| | | |
| | | BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class); |
| | | BasDevpService basDevpService = SpringContextUtil.getBean(BasDevpService.class); |
| | | //BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class); |
| | | if (null != basDevpService && !basDevpService.updateBatchById(basDevps)) { |
| | | throw new Exception("更新数据库数据失败"); |
| | | } |
| | |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线站点数据失败。输送线plc编号={1},站点数据={2}", slave.getId(), JSON.toJSON(staProtocol))); |
| | | News.error("SiemensDevp"+" - 4"+" - 写入输送线站点数据失败。输送线plc编号={},站点数据={}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | } else { |
| | | //dang 101,201zhan xaifazhiling qingchu tiaoxingsaomaolide shuju shanchu |
| | | if (staProtocol.getSiteId()==101){ |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 1); |
| | | log.info("qingchutiaoma,{}",barcodeThread.getBarcode()); |
| | | barcodeThread.clearBarcode(); |
| | | } |
| | | if (staProtocol.getSiteId()==201){ |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 2); |
| | | log.info("qingchutiaoma,{}",barcodeThread.getBarcode()); |
| | | barcodeThread.clearBarcode(); |
| | | } |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 输送线命令下发 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol))); |
| | | News.info("SiemensDevp"+" - 5"+" - 输送线命令下发 [id:{}] >>>>> 命令下发: {}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | } |