| | |
| | | import com.zy.core.properties.SystemProperties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | 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.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 堆垛机接口 |
| | |
| | | return R.ok().add(str.toString()); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/demo/status") |
| | | public R demoStatus(){ |
| | | List<Map<String, Object>> res = new ArrayList<>(); |
| | | for (CrnSlave crnSlave : slaveProperties.getCrn()) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("crnNo", crnSlave.getId()); |
| | | map.put("demo", crnSlave.getDemo()); |
| | | res.add(map); |
| | | } |
| | | return R.ok().add(res); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/demo/switch") |
| | | @ManagerAuth(memo = "堆垛机演示") |
| | | public R crnDemo(CrnDemoParam param) throws InterruptedException { |
| | |
| | | return R.error("口令错误"); |
| | | } |
| | | Thread.sleep(200L); |
| | | mainService.crnDemoOfLocMove(param.getCrnId()); |
| | | for (CrnSlave crnSlave : slaveProperties.getCrn()) { |
| | | if (crnSlave.getId().equals(param.getCrnId())) { |
| | | crnSlave.setDemo(param.getOpt()); |
| | | } |
| | | } |
| | | // mainService.crnDemoOfLocMove(param.getCrnId()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | /****************************************************************/ |
| | | /************************** 手动操作 ******************************/ |
| | | /****************************************************************/ |