no message
							parent
							
								
									6fd72a8cc3
								
							
						
					
					
						commit
						d2fe3d1ac1
					
				| 
						 | 
					@ -0,0 +1,33 @@
 | 
				
			||||||
 | 
					package com.youchain.businessdata.inputJson;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import io.swagger.annotations.ApiModelProperty;
 | 
				
			||||||
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Data
 | 
				
			||||||
 | 
					public class MissionData {
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "序号")
 | 
				
			||||||
 | 
					    Long sequence;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "作业位置类型", example = "NODE_POINT")
 | 
				
			||||||
 | 
					    String type;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "作业路径位置")
 | 
				
			||||||
 | 
					    String position;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "在点位上需要执行的动作")
 | 
				
			||||||
 | 
					    String actionType;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "牵引车后方的拖挂车数量")
 | 
				
			||||||
 | 
					    Long tugCount;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "模型名字")
 | 
				
			||||||
 | 
					    List<String> tugModels;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "当前任务点结束后放行策略", example = "AUTO")
 | 
				
			||||||
 | 
					    String passStrategy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "自动触发离开当前任务节点的时间,默认单位:毫秒", example = "0")
 | 
				
			||||||
 | 
					    Long waitingMillis;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,51 @@
 | 
				
			||||||
 | 
					package com.youchain.businessdata.inputJson;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.alibaba.fastjson.annotation.JSONType;
 | 
				
			||||||
 | 
					import io.swagger.annotations.ApiModelProperty;
 | 
				
			||||||
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Data
 | 
				
			||||||
 | 
					@JSONType(orders = {
 | 
				
			||||||
 | 
					        "orgId", "requestId", "missionCode", "missionType", "viewBoardType",
 | 
				
			||||||
 | 
					        "robotType", "priority", "templateCode", "lockRobotAfterFinish",
 | 
				
			||||||
 | 
					        "unlockRobotId", "unlockMissionCode", "missionData"
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					public class SubmitMission {
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "任务ID",example = "KUKA")
 | 
				
			||||||
 | 
					    String orgId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "请求 id")
 | 
				
			||||||
 | 
					    String requestId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "任务编号")
 | 
				
			||||||
 | 
					    Long missionCode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "任务类型",example = "TUGGER_MOVE")
 | 
				
			||||||
 | 
					    String missionType;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "上视识别类型")
 | 
				
			||||||
 | 
					    String viewBoardType;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "机器人功能类型",example = "TUGGER")
 | 
				
			||||||
 | 
					    String robotType;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "优先级",example = "1")
 | 
				
			||||||
 | 
					    String priority;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "作业流程模板编号")
 | 
				
			||||||
 | 
					    String templateCode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "是否需要流程结束后机器人保持任务锁定状态")
 | 
				
			||||||
 | 
					    Boolean lockRobotAfterFinish;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "解锁当前小车的在上个任务的锁定状态")
 | 
				
			||||||
 | 
					    String unlockRobotId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "当前小车的上一个任务")
 | 
				
			||||||
 | 
					    String unlockMissionCode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty(value = "任务节点")
 | 
				
			||||||
 | 
					    List<MissionData> missionData;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,12 +1,21 @@
 | 
				
			||||||
package com.youchain.businessdata.rest;
 | 
					package com.youchain.businessdata.rest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.alibaba.fastjson.JSON;
 | 
				
			||||||
 | 
					import com.alibaba.fastjson.JSONObject;
 | 
				
			||||||
 | 
					import com.alibaba.fastjson.serializer.SerializerFeature;
 | 
				
			||||||
import com.youchain.annotation.AnonymousAccess;
 | 
					import com.youchain.annotation.AnonymousAccess;
 | 
				
			||||||
import com.youchain.annotation.Log;
 | 
					import com.youchain.annotation.Log;
 | 
				
			||||||
import com.youchain.businessdata.domain.AgvTask;
 | 
					import com.youchain.businessdata.domain.AgvTask;
 | 
				
			||||||
import com.youchain.businessdata.inputJson.MissionStateCallback;
 | 
					import com.youchain.businessdata.inputJson.MissionStateCallback;
 | 
				
			||||||
 | 
					import com.youchain.businessdata.inputJson.SubmitMission;
 | 
				
			||||||
import com.youchain.businessdata.service.AgvTaskService;
 | 
					import com.youchain.businessdata.service.AgvTaskService;
 | 
				
			||||||
import com.youchain.businessdata.service.KMReService;
 | 
					import com.youchain.businessdata.service.KMReService;
 | 
				
			||||||
 | 
					import com.youchain.exception.BadRequestException;
 | 
				
			||||||
import com.youchain.exception.handler.ApiResult;
 | 
					import com.youchain.exception.handler.ApiResult;
 | 
				
			||||||
 | 
					import com.youchain.modules.system.domain.Dict;
 | 
				
			||||||
 | 
					import com.youchain.utils.HttpPostUtil;
 | 
				
			||||||
 | 
					import com.youchain.utils.StringUtils;
 | 
				
			||||||
 | 
					import com.youchain.utils.UrlApi;
 | 
				
			||||||
import io.swagger.annotations.Api;
 | 
					import io.swagger.annotations.Api;
 | 
				
			||||||
import io.swagger.annotations.ApiOperation;
 | 
					import io.swagger.annotations.ApiOperation;
 | 
				
			||||||
import lombok.RequiredArgsConstructor;
 | 
					import lombok.RequiredArgsConstructor;
 | 
				
			||||||
| 
						 | 
					@ -47,4 +56,23 @@ public class KMReSController {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @PostMapping("/submitMission")
 | 
				
			||||||
 | 
					    @Log("KMReS任务下发")
 | 
				
			||||||
 | 
					    @ApiOperation("KMReS任务下发")
 | 
				
			||||||
 | 
					    @AnonymousAccess
 | 
				
			||||||
 | 
					    public ResponseEntity<Object> submitMission(@RequestBody SubmitMission submitMission) {
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            kmReService.sendAgvTaskToContainer(UrlApi.submitMission(),JSON.toJSONString(submitMission));
 | 
				
			||||||
 | 
					            return new ResponseEntity<>(ApiResult.success(), HttpStatus.OK);
 | 
				
			||||||
 | 
					        } catch (Exception e) {
 | 
				
			||||||
 | 
					            return new ResponseEntity<>(ApiResult.fail(e.getMessage()), HttpStatus.BAD_REQUEST);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -149,6 +149,7 @@ public class KMReServiceImpl implements KMReService {
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void sendAgvTaskToContainer(String url, String json) {
 | 
					    public void sendAgvTaskToContainer(String url, String json) {
 | 
				
			||||||
 | 
					        log.info(json);
 | 
				
			||||||
        Dict dict = dictRepository.findDictByName("OPEN");
 | 
					        Dict dict = dictRepository.findDictByName("OPEN");
 | 
				
			||||||
        if (dict != null) {
 | 
					        if (dict != null) {
 | 
				
			||||||
            String resultJson = HttpPostUtil.sendPostReq(url, json);
 | 
					            String resultJson = HttpPostUtil.sendPostReq(url, json);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue