| | |
| | | @PostMapping("/InsertQueueGlassId") |
| | | public Result InsertQueueGlassId(Short id, @RequestBody Queue queue) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Short zhi=200; |
| | | short result = homeMapper.SelectStorageByGlassId(queue.getglassId()); |
| | | if (result > 0) { |
| | | map.put("message", "300"); |
| | | } else { |
| | | homeMapper.InsertQueueGlassId(queue, id); |
| | | |
| | | if (id == 1) { |
| | | // 调用伍存储过程 |
| | | spianService.selectAll(queue.getglassId()); |
| | | zhi=spianService.selectAll(queue.getglassId()); |
| | | if(zhi==200){ |
| | | homeMapper.InsertQueueGlassId(queue, id); |
| | | } |
| | | } |
| | | map.put("message", "200"); |
| | | |
| | | map.put("message",zhi); |
| | | } |
| | | return Result.success(map); |
| | | } |
| | |
| | | |
| | | // 手动写入plc扫码位玻璃id |
| | | @PostMapping("/WriteGlassID") |
| | | public void WriteGlassID(String glassid) { |
| | | public Result WriteGlassID(String glassid) { |
| | | // 扫码位写入玻璃id |
| | | spianService.outmesid(glassid, "DB103.286"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | // 清除指定位置id |
| | |
| | | // 软急停 |
| | | @PostMapping("/SoftEmergencyStop") |
| | | public Result SoftEmergencyStop(Short num) { |
| | | String position="DB101.11.3"; |
| | | String position = "DB101.11.3"; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (S7control.getinstance().CheckConnected() == true) { |
| | | S7control.getinstance().WriteBit(position, false); |
| | | try { |
| | | TimeUnit.MILLISECONDS.sleep(300); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | S7control.getinstance().WriteBit(position, true); |
| | | map.put("message", "200"); |
| | | } else { |
| | | map.put("message", "300"); |
| | | } |
| | | return Result.success(map); |
| | | if (S7control.getinstance().CheckConnected() == true) { |
| | | S7control.getinstance().WriteBit(position, false); |
| | | try { |
| | | TimeUnit.MILLISECONDS.sleep(300); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | S7control.getinstance().WriteBit(position, true); |
| | | map.put("message", "200"); |
| | | } else { |
| | | map.put("message", "300"); |
| | | } |
| | | return Result.success(map); |
| | | } |
| | | |
| | | // 切换PLC获取二维码方式 |
| | | @PostMapping("/SwitchScanMethod") |
| | | public Result SwitchScanMethod(Boolean scansmethod) { |
| | | S7control.getinstance().WriteBit("DB101.11.4", scansmethod); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | } |