| | |
| | | @Autowired |
| | | private JdbcConnections jdbcConnections; |
| | | |
| | | @GetMapping("/WriteWord") |
| | | public Result WriteWord(String address,float value,String type) { |
| | | |
| | | if("0".equals(type)){ |
| | | System.err.println("写入word"+address+"+"+value); |
| | | S7control.getinstance().WriteWord(address, (short)value); |
| | | |
| | | } |
| | | else if("3".equals(type)){ |
| | | System.err.println("写入time"+address+"+"+value); |
| | | S7control.getinstance().writetime(address, (long)value); |
| | | } |
| | | else{ |
| | | System.err.println("写入float"+address+"+"+value); |
| | | S7control.getinstance().writeFloat32(address, value); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | // 写入bit |
| | | @GetMapping("/WriteBit") |
| | | public Result WriteBit(String address,short value) { |
| | | |
| | | boolean values; |
| | | if (value == 0) { |
| | | values=false; |
| | | }else{ |
| | | values=true; |
| | | } |
| | | S7control.getinstance().WriteBit(address, values); |
| | | System.err.println("写入bit"+address+"+"+values); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | // 获取当前登录用户权限 |
| | | @GetMapping("/SelectPermissionByUserName") |
| | | public Result SelectPermissionByUserName(String username) throws SQLException { |
| | |
| | | |
| | | //领取/暂停任务 |
| | | @PostMapping("/ClaimTasks") |
| | | public Result ClaimTasks(String flowcard,Integer state) { |
| | | return storageCageService.ClaimTasks(flowcard,state); |
| | | public Result ClaimTasks(String flowcard,Integer state, Integer line) { |
| | | return storageCageService.ClaimTasks(flowcard,state,line); |
| | | } |
| | | |
| | | //修改出片方式 |