| | |
| | | package com.zy.acs.manager.manager.controller; |
| | | |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.zy.acs.framework.common.R; |
| | | import com.zy.acs.manager.common.annotation.OperationLog; |
| | | import com.zy.acs.manager.core.service.MainZkdService; |
| | | import com.zy.acs.manager.core.third.zkd.dto.Navigation; |
| | | import com.zy.acs.manager.manager.controller.param.OpenAgvParam; |
| | |
| | | import com.zy.acs.manager.manager.service.CodeService; |
| | | import com.zy.acs.manager.manager.service.OpenAlgorithmService; |
| | | import com.zy.acs.manager.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * Created by vincent on 2023/6/12 |
| | | */ |
| | | @Api(tags = "Open Api") |
| | | //@Api(tags = "Open Api") |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/open/algorithm") |
| | | public class OpenAlgorithmController extends BaseController { |
| | |
| | | @Autowired |
| | | private CodeService codeService; |
| | | |
| | | @GetMapping("/demo") |
| | | public R demo() { |
| | | return R.ok("demo"); |
| | | } |
| | | |
| | | @PostMapping("/getAgv") |
| | | @OperationLog("get agv msg") |
| | | public R save(@RequestBody OpenAgvParam param) { |
| | | if (Cools.isEmpty(param)) { |
| | | return R.error("不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getMapId())) { |
| | | return R.error("地图编号不能为空"); |
| | | } |
| | | // @OperationLog("get agv msg") |
| | | public R save(@RequestBody(required = false) OpenAgvParam param) { |
| | | // if (Cools.isEmpty(param)) { |
| | | // return R.error("不能为空"); |
| | | // } |
| | | // if (Cools.isEmpty(param.getMapId())) { |
| | | // return R.error("地图编号不能为空"); |
| | | // } |
| | | return R.ok(openAlgorithmService.listAgv(param)); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/zkd/navigation/v1") |
| | | public Object navigation(@RequestBody Navigation navigation) { |
| | | public Object navigation(@RequestBody String data) { |
| | | log.info("收到的导航信息:{}", data); |
| | | Navigation navigation = JSONObject.parseObject(data, Navigation.class); |
| | | Long agvId = agvService.getAgvId(navigation.getAgvId()); |
| | | mainZkdService.buildMajorTask(agvId, navigation); |
| | | return null; |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |