add 新增需求
This commit is contained in:
@@ -291,8 +291,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
});
|
||||
data = feedBackStatus(data, index, 2, inst, task, 2, false);
|
||||
actionFinishRequest2(task,device_code);
|
||||
} else if (device_code.contains("_02")) {
|
||||
data = feedBackStatus(data, index, 2, inst, task, 2, false);
|
||||
actionFinishRequest2(task,device_code);
|
||||
} else {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
@@ -315,15 +317,18 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
});
|
||||
data = feedBackStatus(data, index, 2, inst, task, 2, false);
|
||||
actionFinishRequest2(task,device_code);
|
||||
}
|
||||
} else if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
try {
|
||||
data = feedBackStatus(data, index, 2, inst, task, 1, false);
|
||||
actionFinishRequest2(task,device_code);
|
||||
} catch (Exception e) {
|
||||
log.info("取货完成反馈AGV状态失败:{}", e.getMessage());
|
||||
}
|
||||
} else {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
|
||||
actionFinishRequest2(task,device_code);
|
||||
}
|
||||
//到达放货等待点
|
||||
//(需要WCS反馈)
|
||||
@@ -633,4 +638,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
return data;
|
||||
}
|
||||
|
||||
public void actionFinishRequest2(TaskDto task,String device_code){
|
||||
String hasWms = paramService.findByCode("hasWms").getValue();
|
||||
if (StrUtil.isNotEmpty(hasWms) && "1".equals(hasWms)) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_code", task.getTask_code());
|
||||
jo.put("device_code", device_code);
|
||||
HttpResponse httpResponse = acsToWmsService.actionFinishRequest2(jo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,11 +85,10 @@ public class WmsToAcsController {
|
||||
@Log(value = "WMS查询设备DB值")
|
||||
@ApiOperation("WMS查询设备DB值")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryDeviceDBValue(@RequestBody String whereJson){
|
||||
public ResponseEntity<Object> queryDeviceDBValue(@RequestBody String whereJson) {
|
||||
return new ResponseEntity<>(wmstoacsService.queryDeviceDBValue(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/putPlusPullAction")
|
||||
@Log(value = "WMS下发插拔轴动作")
|
||||
@ApiOperation("WMS下发插拔轴动作")
|
||||
|
||||
@@ -134,4 +134,6 @@ public interface AcsToWmsService {
|
||||
* 任务阶段反馈最新点位
|
||||
*/
|
||||
String feedbackState(BaseRequest request);
|
||||
|
||||
HttpResponse actionFinishRequest2(JSONObject jsonObject);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.system.service.lucene.LuceneExecuteLogService;
|
||||
import org.nl.system.service.lucene.dto.LuceneLogDto;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
@@ -562,6 +561,36 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse actionFinishRequest2(JSONObject from) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("actionFinishRequest2");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
HttpResponse result = null;
|
||||
log.info("actionFinishRequest2----请求参数{}", from);
|
||||
try {
|
||||
result = HttpRequest.post(url)
|
||||
.body(String.valueOf(from))
|
||||
.execute();
|
||||
LuceneLogDto reqlogDto = LuceneLogDto.builder()
|
||||
.device_code(from.getString("device_code"))
|
||||
.task_code(from.getString("task_code"))
|
||||
.status_code(StrUtil.toString(result.getStatus()))
|
||||
.requestparam("请求参数:"+ from)
|
||||
.responseparam("响应参数:"+result.body())
|
||||
.content(result.body())
|
||||
.method("actionFinishRequest2")
|
||||
.build();
|
||||
luceneExecuteLogService.interfaceExecuteLog(reqlogDto);
|
||||
log.info("actionFinishRequest2----返回参数{}", result);
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
log.info("actionFinishRequest2----报错{}", msg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String applyTask(BaseRequest requestParam) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user