add: ACS与LMS的接口日志添加到Lucene
This commit is contained in:
@@ -78,7 +78,7 @@ public interface XianGongAgvService {
|
||||
public HttpResponse sendOrderSequencesToXZ(Instruction inst) throws Exception;
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* 追加运单
|
||||
* @param inst
|
||||
* @return
|
||||
* @throws Exception
|
||||
@@ -109,11 +109,6 @@ public interface XianGongAgvService {
|
||||
*/
|
||||
JSONObject xgAGVWaitPointRequest(JSONObject requestParam);
|
||||
|
||||
/**
|
||||
* 运单号查询运单状态
|
||||
*/
|
||||
public HttpResponse selectOrderByInstCode(String instCode);
|
||||
|
||||
|
||||
/**
|
||||
* 查询场景中指定机器人信息
|
||||
|
||||
@@ -245,46 +245,29 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
@LokiLog(type = LokiLogType.AGV)
|
||||
@Override
|
||||
public HttpResponse sendOrderSequencesToXZ(Instruction inst) throws Exception {
|
||||
/*JSONObject jo = new JSONObject();
|
||||
jo.put("intendedVehicle", "");
|
||||
jo.put("category", "");
|
||||
jo.put("failureFatal", false);
|
||||
jo.put("complete", false);
|
||||
JSONArray transports = new JSONArray();
|
||||
JSONObject orderjo = new JSONObject();
|
||||
orderjo.put("name", inst.getInstruction_code());
|
||||
orderjo.put("order", createOrederData(inst, CommonFinalParam.ONE));
|
||||
transports.add(orderjo);
|
||||
jo.put("transports", transports);
|
||||
|
||||
JSONArray ja1 = new JSONArray();
|
||||
JSONObject jo1 = new JSONObject();
|
||||
jo1.put("key", "");
|
||||
jo1.put("value", "");
|
||||
ja1.add(jo1);
|
||||
jo.put("properties", ja1);
|
||||
log.info("任务号:{},指令号{},下发agv订单序列参数:{}", inst.getTask_code(), inst.getInstruction_code(), jo.toString());*/
|
||||
|
||||
com.alibaba.fastjson.JSONObject jo = new com.alibaba.fastjson.JSONObject();
|
||||
jo.put("id", inst.getInstruction_code());
|
||||
//运单封口,true=创建运单之后不可添加动作块;false=创建运单可以添加动作块
|
||||
jo.put("complete", true);
|
||||
//动作块
|
||||
jo.put("blocks", createBlocksData(inst));
|
||||
//运单优先级
|
||||
jo.put("priority", inst.getPriority());
|
||||
log.info("任务号:{},指令号{},下发agv订单序列参数:{}", inst.getTask_code(), inst.getInstruction_code(), jo.toString());
|
||||
log.info("任务号:{},指令号{},下发agv订单序列参数:{}", inst.getTask_code(), inst.getInstruction_code(), jo);
|
||||
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), CommonFinalParam.ONE)) {
|
||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
||||
|
||||
agvurl = agvurl + ":" + agvport + "/api/route/orderSequences/" + inst.getTask_code();
|
||||
agvurl = agvurl + ":" + agvport + "/setOrder";
|
||||
|
||||
log.info(agvurl);
|
||||
HttpResponse result = HttpRequest.post(agvurl)
|
||||
//表单内容
|
||||
.body(String.valueOf(jo))
|
||||
//超时,毫秒
|
||||
.timeout(20000)
|
||||
.execute();
|
||||
log.info(agvurl);
|
||||
log.info("任务号:{},指令号{},状态{},下发agv订单序列反馈:{}", inst.getTask_code(), inst.getInstruction_code(), result.getStatus(), result.body());
|
||||
|
||||
return result;
|
||||
@@ -294,41 +277,57 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发运单
|
||||
* 下发动作块信号
|
||||
*
|
||||
* @param inst
|
||||
* @return
|
||||
*/
|
||||
public JSONArray createBlocksData(Instruction inst) {
|
||||
JSONArray ja = new JSONArray();
|
||||
sendStartDeviceOrder(ja,inst.getStart_device_code(), inst.getStart_point_code(),inst.getInstruction_code());
|
||||
sendEndDeviceOrder(ja,inst.getStart_device_code(),inst.getInstruction_code(),inst.getNext_point_code(),inst.getNext_device_code());
|
||||
if(StrUtil.isNotEmpty(inst.getStart_device_code2())){
|
||||
sendStartDeviceOrder(ja,inst.getStart_device_code2(), inst.getStart_point_code2(),inst.getInstruction_code());
|
||||
String instruction_code = inst.getInstruction_code();
|
||||
String start_device_code = inst.getStart_device_code();
|
||||
String start_point_code = inst.getStart_point_code();
|
||||
String next_device_code = inst.getNext_device_code();
|
||||
String next_point_code = inst.getNext_point_code();
|
||||
sendStartDeviceOrder(ja, start_device_code, start_point_code, instruction_code);
|
||||
sendEndDeviceOrder(ja, start_device_code, instruction_code, next_point_code, next_device_code);
|
||||
String start_device_code2 = inst.getStart_device_code2();
|
||||
String start_point_code2 = inst.getStart_point_code2();
|
||||
if (StrUtil.isNotEmpty(start_device_code2)) {
|
||||
sendStartDeviceOrder(ja, start_device_code2, start_point_code2, instruction_code);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(inst.getNext_device_code2())){
|
||||
sendEndDeviceOrder(ja,inst.getNext_device_code2(),inst.getInstruction_code(),inst.getNext_point_code2(),inst.getNext_device_code2());
|
||||
String next_device_code2 = inst.getNext_device_code2();
|
||||
String next_point_code2 = inst.getNext_point_code2();
|
||||
if (StrUtil.isNotEmpty(next_device_code2)) {
|
||||
sendEndDeviceOrder(ja, start_device_code2, instruction_code, next_device_code2, next_point_code2);
|
||||
}
|
||||
return ja;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发取货
|
||||
* @param device_code
|
||||
* @param instCode
|
||||
* 下发取货信号
|
||||
* @param ja
|
||||
* @param pointCode 起始点位
|
||||
* @param device_code 起始设备
|
||||
* @param instCode 指令号
|
||||
*/
|
||||
public void sendStartDeviceOrder(JSONArray ja,String pointCode, String device_code,String instCode){
|
||||
|
||||
public void sendStartDeviceOrder(JSONArray ja, String pointCode, String device_code, String instCode) {
|
||||
Device startDevice = deviceAppService.findDeviceByCode(device_code);
|
||||
//忽略取货校验
|
||||
if ("true".equals(startDevice.getExtraValue().get("ignore_pickup_check"))) {
|
||||
//取货前等待
|
||||
JSONObject jo = new JSONObject();
|
||||
//动作块id
|
||||
jo.put("blockId", IdUtil.simpleUUID());
|
||||
//目的地名称
|
||||
jo.put("location", pointCode + "INGET");
|
||||
//执行脚本
|
||||
jo.put("operation", "script");
|
||||
jo.put("id", pointCode + "INGET");
|
||||
//通信脚本,动作前后与现场设备交互的场景
|
||||
jo.put("script_name", "userpy/interact.py");
|
||||
JSONObject script_args = new JSONObject();
|
||||
//更改为现场设备IP及PORT
|
||||
script_args.put("addr", addr);
|
||||
JSONObject data = new JSONObject();
|
||||
JSONObject reach = new JSONObject();
|
||||
@@ -340,7 +339,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
jo.put("script_args", script_args);
|
||||
ja.add(jo);
|
||||
}
|
||||
|
||||
//将货物顶起来
|
||||
JSONObject jo1 = new JSONObject();
|
||||
jo1.put("blockId", IdUtil.simpleUUID());
|
||||
jo1.put("location", pointCode);
|
||||
@@ -368,11 +367,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发放货
|
||||
* @param device_code
|
||||
* @param instCode
|
||||
* 下发放货信号
|
||||
* @param ja
|
||||
* @param device_code 起始设备
|
||||
* @param instCode 指令号
|
||||
* @param pointCode 终点点位
|
||||
* @param nextDeviceCode 终点设备
|
||||
*/
|
||||
public void sendEndDeviceOrder(JSONArray ja,String device_code,String instCode,String pointCode,String nextDeviceCode){
|
||||
public void sendEndDeviceOrder(JSONArray ja, String device_code, String instCode, String pointCode, String nextDeviceCode) {
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(nextDeviceCode);
|
||||
//忽略放货校验
|
||||
if ("true".equals(nextDevice.getExtraValue().get("ignore_release_check"))) {
|
||||
@@ -398,24 +400,27 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
|
||||
//放货前下发旋转角度
|
||||
JSONObject json1 = new JSONObject();
|
||||
AcsPointAngle acsPointAngleDto = acsPointAngleService.findByCode(device_code,nextDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(acsPointAngleDto)){
|
||||
AcsPointAngle acsPointAngleDto = acsPointAngleService.findByCode(device_code, nextDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(acsPointAngleDto)) {
|
||||
log.info("acsPointAngleDto----參數,{}", acsPointAngleDto.toString());
|
||||
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject();
|
||||
BigDecimal next_point_angle = acsPointAngleDto.getNext_point_angle();
|
||||
operation_args.put("increase_spin_angle",next_point_angle);//弧度值,如3.14
|
||||
operation_args.put("skill_name","GoByOdometer");
|
||||
operation_args.put("increase_spin_angle", next_point_angle);//弧度值,如3.14
|
||||
operation_args.put("skill_name", "GoByOdometer");
|
||||
json1.put("blockId", IdUtil.simpleUUID());
|
||||
json1.put("location", pointCode + "INPUT");
|
||||
json1.put("operation_args",operation_args);
|
||||
json1.put("operation_args", operation_args);
|
||||
ja.add(json1);
|
||||
}
|
||||
|
||||
//将货物放下
|
||||
com.alibaba.fastjson.JSONObject jo4 = new com.alibaba.fastjson.JSONObject();
|
||||
jo4.put("blockId", IdUtil.simpleUUID());
|
||||
jo4.put("location", pointCode);
|
||||
jo4.put("operation", "JackUnload");
|
||||
ja.add(jo4);
|
||||
|
||||
|
||||
//忽略放货校验
|
||||
if ("true".equals(nextDevice.getExtraValue().get("ignore_release_check"))) {
|
||||
//放货完成等待
|
||||
@@ -523,8 +528,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
Device startdevice = deviceAppService.findDeviceByCode(startAddress);
|
||||
Device nextdevice = deviceAppService.findDeviceByCode(nextAddress);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
orderjo.put("destinations", ja);
|
||||
@@ -711,35 +716,13 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
throw new BadRequestException("请求失败,IN OUT 站点错误!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse selectOrderByInstCode(String instCode) {
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||
String agvurl =paramService.findByCode(AcsConfig.AGVURL).getValue();
|
||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
||||
|
||||
com.alibaba.fastjson.JSONObject param = new com.alibaba.fastjson.JSONObject();
|
||||
param.put("id", instCode);
|
||||
param.put("disableVehicle", false);
|
||||
agvurl = agvurl + ":" + agvport + "/" + instCode;
|
||||
log.info("根据运单号查询运单状态的请求:{}", agvurl);
|
||||
HttpResponse result = HttpRequest.post(agvurl)
|
||||
.body(param.toJSONString())
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute();
|
||||
log.info("根据运单号查询运单状态的请求反馈:{}", result);
|
||||
return result;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse getRobotInfo(String robotCode) {
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||
String agvurl =paramService.findByCode(AcsConfig.AGVURL).getValue();
|
||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
||||
|
||||
agvurl = agvurl + ":" + agvport + "/"+ " robotsStatus?vehicles=" + robotCode;
|
||||
agvurl = agvurl + ":" + agvport + "/" + " robotsStatus?vehicles=" + robotCode;
|
||||
log.info("根据指定机器人查询状态的请求:{}", agvurl);
|
||||
HttpResponse result = HttpRequest.get(agvurl)
|
||||
.timeout(20000)//超时,毫秒
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.nl.acs.device.enums.DeviceType;
|
||||
import org.nl.acs.device.service.mapper.DeviceExtraMapper;
|
||||
import org.nl.acs.device.domain.DeviceRunpoint;
|
||||
import org.nl.acs.device.service.mapper.DeviceRunpointMapper;
|
||||
import org.nl.acs.device_driver.stacker.standard_stacker.StandardStackerDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.slit_two_manipulator.SlitTwoManipulatorDeviceDriver;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
@@ -1021,6 +1022,9 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
|
||||
} else if (device.getDeviceDriver() instanceof DeviceStageMonitor) {
|
||||
DeviceStageMonitor deviceStageMonitor = (DeviceStageMonitor) device.getDeviceDriver();
|
||||
deviceStageMonitor.setDeviceStatus(form);
|
||||
}else if (device.getDeviceDriver() instanceof StandardStackerDeviceDriver) {
|
||||
StandardStackerDeviceDriver standardStackerDeviceDriver = (StandardStackerDeviceDriver) device.getDeviceDriver();
|
||||
standardStackerDeviceDriver.setDeviceStatus(form);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 普通站点仙工AGV
|
||||
* 仙工AGV
|
||||
*/
|
||||
@Slf4j
|
||||
@Data
|
||||
|
||||
@@ -725,7 +725,10 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() throws Exception {
|
||||
return null;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("device_code", this.getDevice().getDevice_code());
|
||||
jsonObject.put("is_click", true);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,6 +28,8 @@ import org.nl.acs.instruction.domain.Instruction;
|
||||
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.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -55,6 +57,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer;
|
||||
|
||||
@Autowired
|
||||
private LuceneExecuteLogService luceneLogService;
|
||||
|
||||
public String token;
|
||||
|
||||
|
||||
@@ -92,6 +97,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
type = "error";
|
||||
}
|
||||
log.info("applyTaskToWms-----输出参数{}", result2.body());
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto("applyTaskToWms", String.valueOf(result2.getStatus()),
|
||||
JSON.toJSONString(jo), String.valueOf(result2.body()), "ACS向LMS申请生箔按钮任务");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
return result2.body();
|
||||
|
||||
} finally {
|
||||
@@ -183,6 +191,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
map.put("message", e.getMessage());
|
||||
return JSONObject.toJavaObject(map, ApplyGreenFoilButtonResponse.class);
|
||||
}
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto("ApplyGreenFoilButtonRequest", String.valueOf(applyGreenFoilButtonResponse.getCode()),
|
||||
JSON.toJSONString(param), String.valueOf(applyGreenFoilButtonResponse.getMessage()), "ACS向LMS申请生箔按钮任务");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
}
|
||||
return applyGreenFoilButtonResponse;
|
||||
} finally {
|
||||
@@ -215,6 +226,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
map.put("message", e.getMessage());
|
||||
return JSONObject.toJavaObject(map, BlankingButtonResponse.class);
|
||||
}
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto("BlankingButtonRequest", String.valueOf(blankingButtonResponse.getCode()),
|
||||
JSON.toJSONString(param), String.valueOf(blankingButtonResponse.getMessage()), "ACS向LMS申请表处下料位按钮任务");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
}
|
||||
return blankingButtonResponse;
|
||||
} finally {
|
||||
@@ -248,6 +262,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
map.put("message", e.getMessage());
|
||||
return JSONObject.toJavaObject(map, ApplyPlugPullSitResponse.class);
|
||||
}
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto("ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getCode()),
|
||||
JSON.toJSONString(param), String.valueOf(applyPlugPullSitResponse.getMessage()), "ACS向LMS申请套管");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
}
|
||||
return applyPlugPullSitResponse;
|
||||
} finally {
|
||||
@@ -281,6 +298,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
map.put("message", e.getMessage());
|
||||
return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class);
|
||||
}
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto("ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()),
|
||||
JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
}
|
||||
return applyManipulatorActionResponse;
|
||||
} finally {
|
||||
@@ -303,7 +323,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
.execute()
|
||||
.body();
|
||||
log.info("gccQueryStationState - 响应参数{}", responseBody);
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(responseBody);
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto("gccQueryStationState", String.valueOf(jsonObject.get("code")),
|
||||
JSON.toJSONString("StartStationCode=" + inst.getStart_point_code() + "&EndStationCode=" + inst.getNext_point_code()),
|
||||
String.valueOf(jsonObject), "ACS查询站点有无货状态");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
return JSONObject.parseObject(responseBody);
|
||||
} catch (Exception e) {
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import lombok.Builder;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device.domain.Device;
|
||||
@@ -28,7 +29,11 @@ import org.nl.acs.ext.wms.service.WmsToAcsService;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.storage_cell.domain.StorageCell;
|
||||
import org.nl.acs.storage_cell.service.mapper.StorageCellMapper;
|
||||
import org.nl.common.enums.LogTypeEnum;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.config.lucene.service.impl.LuceneExecuteLogServiceImpl;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -48,6 +53,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
@Autowired
|
||||
private DeviceAppService deviceAppService;
|
||||
|
||||
@Autowired
|
||||
private LuceneExecuteLogService luceneExecuteLogService;
|
||||
|
||||
private String log_file_type = "log_file_type";
|
||||
private String log_type = "LMS请求ACS";
|
||||
|
||||
@@ -118,6 +126,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
}
|
||||
response.setCode(200);
|
||||
response.setMessage("success");
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto("putAction", String.valueOf(response.getCode()),
|
||||
jsonObject, String.valueOf(response), "LMS下发动作");
|
||||
luceneExecuteLogService.interfaceExecuteLog(luceneLogDto);
|
||||
log.info("putAction--------------:输出参数:" + response);
|
||||
return response;
|
||||
} finally {
|
||||
@@ -156,7 +167,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
String parent_device_code = data.getString("device_code");
|
||||
String device_code = "";
|
||||
LambdaQueryWrapper<StorageCell> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotBlank(parent_device_code), StorageCell::getParent_storage_code, parent_device_code);
|
||||
wrapper.in(StringUtils.isNotBlank(parent_device_code), StorageCell::getParent_storage_code, parent_device_code);
|
||||
StorageCell storageCell = storageCellMapper.selectOne(wrapper);
|
||||
final JSONObject device_json = (JSONObject) JSON.toJSON(storageCell);
|
||||
if (!ObjectUtil.isEmpty(device_json)) {
|
||||
@@ -280,6 +291,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
resultJson.put("status", HttpStatus.OK.value());
|
||||
resultJson.put("message", "操作成功");
|
||||
resultJson.put("data", backja);
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto("queryDevice", String.valueOf(resultJson.get("status")),
|
||||
jsonObject, String.valueOf(resultJson), "LMS查询设备状态");
|
||||
luceneExecuteLogService.interfaceExecuteLog(luceneLogDto);
|
||||
return resultJson;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
|
||||
@@ -445,12 +445,23 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
||||
}
|
||||
//判断是否是仙工AGV
|
||||
if(CommonFinalParam.ONE.equals(route.getType())){
|
||||
HttpResponse response = xiangGongAgvService.sendOrderSequencesToXZ(dto);
|
||||
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
|
||||
dto.setSend_status("2");
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "3")) {
|
||||
if (StrUtil.equals(task.getRequest_again_success(), "1")) {
|
||||
//追加订单
|
||||
HttpResponse result = xiangGongAgvService.addOrderSequences(dto);
|
||||
if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) {
|
||||
dto.setSend_status("2");
|
||||
} else {
|
||||
dto.setSend_status("1");
|
||||
}
|
||||
} else {
|
||||
dto.setSend_status("1");
|
||||
//创建运单序列
|
||||
HttpResponse response = xiangGongAgvService.sendOrderSequencesToXZ(dto);
|
||||
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
|
||||
dto.setSend_status("2");
|
||||
} else {
|
||||
dto.setSend_status("1");
|
||||
}
|
||||
}
|
||||
}
|
||||
Device nextdevice = appService.findDeviceByCode(dto.getNext_device_code());
|
||||
|
||||
@@ -83,6 +83,17 @@ public class LuceneLogDto {
|
||||
+ home;
|
||||
}
|
||||
|
||||
public LuceneLogDto(final String method, final String status,
|
||||
final String requestparam, final String responseparam, final String content) {
|
||||
super();
|
||||
this.content = content;
|
||||
this.method = method;
|
||||
this.status_code = status;
|
||||
this.requestparam = requestparam;
|
||||
this.responseparam = responseparam;
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public LuceneLogDto(final String device_code, final String remark) {
|
||||
super();
|
||||
this.device_code = device_code;
|
||||
|
||||
Reference in New Issue
Block a user