opt:反馈mes接口
This commit is contained in:
@@ -728,6 +728,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
|
||||
//回传MES放货完毕 逻辑:acs-> lms -> mes
|
||||
String task_code = inst.getTask_code();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("task_code", task_code);
|
||||
acsToWmsService.uploadMes(jsonObject);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -224,6 +224,13 @@ public interface AcsToWmsService {
|
||||
*/
|
||||
ApplyPlugPullSitResponse actionCheckMaterialBucket(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 回传MES
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
ApplyPlugPullSitResponse uploadMes(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 横移请求
|
||||
* @param jsonObject
|
||||
|
||||
@@ -897,6 +897,46 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplyPlugPullSitResponse uploadMes(JSONObject param) {
|
||||
log.info("向lms请求 ,lms向MES请求放料完成,请求参数{}", param);
|
||||
String result = "";
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse = new ApplyPlugPullSitResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("uploadMes");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
log.info("向lms请求 ,lms向MES请求放料完成----请求参数:{}", JSONObject.toJSONString(param));
|
||||
try {
|
||||
result = HttpRequest.post(url)
|
||||
.addInterceptor(tLogHutoolhttpInterceptor)
|
||||
.header(Header.USER_AGENT, "Hutool http")
|
||||
.body(JSON.toJSONString(param))
|
||||
.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class);
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "uploadMes", String.valueOf(applyPlugPullSitResponse.getstatus()),
|
||||
JSON.toJSONString(param), String.valueOf(result), "ACS向LMS发送物料已经放好");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
} catch (Exception e) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
log.info("向lms请求 ,lms向MES请求放料完成----返回参数{}", e.getMessage());
|
||||
applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class);
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "向lms请求 ,lms向MES请求放料完成", String.valueOf(applyPlugPullSitResponse.getstatus()),
|
||||
JSON.toJSONString(param),
|
||||
String.valueOf(result), "ACS向LMS发送物料已经放好");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
}
|
||||
}
|
||||
return applyPlugPullSitResponse;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplyPlugPullSitResponse actionMove(JSONObject param) {
|
||||
log.info("向lms请求横移,请求参数{}", param);
|
||||
|
||||
Reference in New Issue
Block a user