add: 添加行架-agv对接位取货完成反馈LMS
This commit is contained in:
@@ -44,12 +44,14 @@ import org.nl.config.language.LangProcess;
|
|||||||
import org.nl.config.lucene.enums.LogTypeEnum;
|
import org.nl.config.lucene.enums.LogTypeEnum;
|
||||||
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
||||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||||
|
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||||
import org.nl.system.service.param.ISysParamService;
|
import org.nl.system.service.param.ISysParamService;
|
||||||
import org.nl.config.SpringContextHolder;
|
import org.nl.config.SpringContextHolder;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -70,6 +72,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class);
|
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class);
|
||||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||||
|
final ThreadPoolExecutor EXECUTOR = ThreadPoolExecutorUtil.getPoll();
|
||||||
TwoAgvPhase twoAgvPhase = new TwoAgvPhase();
|
TwoAgvPhase twoAgvPhase = new TwoAgvPhase();
|
||||||
|
|
||||||
String error_code = "0";
|
String error_code = "0";
|
||||||
@@ -583,6 +586,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
|
String task_code = inst.getTask_code();
|
||||||
|
EXECUTOR.submit(() -> {
|
||||||
|
boolean feedbackToLms = (boolean)manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms");
|
||||||
|
if(feedbackToLms){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("task_code", task_code);
|
||||||
|
acsToWmsService.actionFinishRequest2(jsonObject);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||||
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -201,4 +201,10 @@ public interface AcsToWmsService {
|
|||||||
HttpResponse feedbackDies(JSONObject param);
|
HttpResponse feedbackDies(JSONObject param);
|
||||||
|
|
||||||
String secondaryAllocationPoint(JSONObject param);
|
String secondaryAllocationPoint(JSONObject param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行架-agv对接位取货完成反馈
|
||||||
|
* @param jsonObject
|
||||||
|
*/
|
||||||
|
void actionFinishRequest2(JSONObject jsonObject);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -677,6 +677,35 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionFinishRequest2(JSONObject jsonObject) {
|
||||||
|
HttpResponse execute = null;
|
||||||
|
try {
|
||||||
|
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
|
AddressDto addressDto = addressService.findByCode("actionFinishRequest2");
|
||||||
|
String url = wmsurl + addressDto.getMethods_url();
|
||||||
|
log.info("feedbackDie - 反馈管芯请求路径{}", jsonObject);
|
||||||
|
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", "",
|
||||||
|
String.valueOf(jsonObject),
|
||||||
|
"", jsonObject.getString("task_code") + "任务取货完成反馈");
|
||||||
|
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
|
try {
|
||||||
|
execute = HttpRequest.post(url)
|
||||||
|
.body(String.valueOf(jsonObject))
|
||||||
|
.execute();
|
||||||
|
} catch (Exception e) {
|
||||||
|
String msg = e.getMessage();
|
||||||
|
log.info("feedbackDie-----输出参数{}", msg);
|
||||||
|
//网络不通
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", String.valueOf(execute.getStatus()),
|
||||||
|
JSON.toJSONString(execute.body()),
|
||||||
|
String.valueOf(execute.body()), jsonObject.getString("task_code") + "任务取货完成反馈失败");
|
||||||
|
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse feedbackDies(JSONObject param) {
|
public HttpResponse feedbackDies(JSONObject param) {
|
||||||
HttpResponse result2 = null;
|
HttpResponse result2 = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user