最终更新
This commit is contained in:
@@ -194,9 +194,13 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
||||
|
||||
agvurl = agvurl + ":" + agvport + "/api/route/transportOrders/" + instCode + "/withdrawal";
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("id", instCode);
|
||||
param.put("disableVehicle", false);
|
||||
agvurl = agvurl + ":" + agvport + "/terminate";
|
||||
log.info("删除agv指令请求agvurl:{}", agvurl);
|
||||
HttpResponse result = HttpRequest.post(agvurl)
|
||||
.body(param.toJSONString())
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute();
|
||||
log.info("删除agv指令请求反馈:{}", result);
|
||||
|
||||
@@ -66,7 +66,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
@Autowired
|
||||
DeviceAppService deviceAppService;
|
||||
@Autowired
|
||||
NDCAgvService ndcAgvService;
|
||||
XianGongAgvService agvService;
|
||||
@Autowired
|
||||
ParamService paramService;
|
||||
@Autowired
|
||||
@@ -455,12 +455,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) {
|
||||
|
||||
if (StrUtil.equals("1", dto.getInstruction_type())) {
|
||||
ndcAgvService.sendAgvTwoInstToNDC(dto, dto2);
|
||||
agvService.sendOrderSequencesToXZ(dto);
|
||||
agvService.sendOrderSequencesToXZ(dto2);
|
||||
dto.setSend_status("1");
|
||||
dto2.setSend_status("1");
|
||||
} else if (StrUtil.equals("2", dto.getInstruction_type())) {
|
||||
dto.setSend_status("1");
|
||||
ndcAgvService.sendAgvTwoInstToNDC(dto, null);
|
||||
agvService.sendOrderSequencesToXZ(dto);
|
||||
} else if (StrUtil.equals("3", dto.getInstruction_type())) {
|
||||
|
||||
} else if (StrUtil.equals("4", dto.getInstruction_type())) {
|
||||
@@ -469,13 +470,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
} else if (StrUtil.equals("6", dto.getInstruction_type())) {
|
||||
dto.setSend_status("1");
|
||||
ndcAgvService.sendAgvOneInstToNDC(dto);
|
||||
agvService.sendOrderSequencesToXZ(dto);
|
||||
} else if (StrUtil.equals("7", dto.getInstruction_type())) {
|
||||
ndcAgvService.sendAgvOneInstToNDC(dto);
|
||||
agvService.sendOrderSequencesToXZ(dto);
|
||||
dto.setSend_status("1");
|
||||
} else if (StrUtil.equals("8", dto.getInstruction_type())) {
|
||||
dto.setSend_status("1");
|
||||
ndcAgvService.sendAgvOneInstToNDC(dto);
|
||||
agvService.sendOrderSequencesToXZ(dto);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -861,14 +862,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
// != 0 为agv任务 1=magic 2=NDC 3=XZ,4=ZHEDA
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "1")
|
||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
||||
MagicAgvService magicAgvService = SpringContextHolder.getBean(MagicAgvService.class);
|
||||
magicAgvService.deleteAgvInst(entity.getInstruction_code());
|
||||
XianGongAgvService agvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
||||
agvService.deleteXZAgvInst(entity.getInstruction_code());
|
||||
flag = true;
|
||||
|
||||
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) {
|
||||
//NDC agv指令不当场取消指令,需要等agv上报
|
||||
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
||||
ndcAgvService.deleteAgvInstToNDC(entity);
|
||||
agvService.deleteXZAgvInst(entity.getInstruction_code());
|
||||
} else {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.agv.server.MagicAgvService;
|
||||
import org.nl.acs.agv.server.impl.MagicAgvServiceImpl;
|
||||
import org.nl.acs.agv.server.XianGongAgvService;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device.service.dto.DeviceDto;
|
||||
import org.nl.acs.device.service.impl.DeviceServiceImpl;
|
||||
@@ -330,7 +329,7 @@ public class HFHandServiceImpl implements HFHandService {
|
||||
resultJson.put("result", "");
|
||||
return resultJson;
|
||||
}
|
||||
if(Boolean.parseBoolean(startDevice.getIslock()) || Boolean.parseBoolean(nextDevice.getIslock())){
|
||||
if (Boolean.parseBoolean(startDevice.getIslock()) || Boolean.parseBoolean(nextDevice.getIslock())) {
|
||||
resultJson.put("code", "0");
|
||||
resultJson.put("desc", "起点或终点设备已被锁定");
|
||||
resultJson.put("result", "");
|
||||
@@ -542,7 +541,7 @@ public class HFHandServiceImpl implements HFHandService {
|
||||
}
|
||||
String task_id = instwo.getString("task_id");
|
||||
Instruction instdto = (Instruction) instwo.toJavaObject(Instruction.class);
|
||||
MagicAgvService agvService = SpringContextHolder.getBean(MagicAgvServiceImpl.class);
|
||||
XianGongAgvService agvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
||||
InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class);
|
||||
|
||||
/* 1 指令撤销
|
||||
@@ -553,11 +552,8 @@ public class HFHandServiceImpl implements HFHandService {
|
||||
|
||||
try {
|
||||
//agvService.deleteAgvInst(instwo.getString("instruction_code"));
|
||||
if (StrUtil.isEmpty(instdto.getAgv_jobno())) {
|
||||
instructionService.cancelNOSendAgv(inst_uuid);
|
||||
} else {
|
||||
agvService.deleteAgvInst(instdto.getInstruction_code());
|
||||
}
|
||||
instructionService.cancel(inst_uuid);
|
||||
agvService.deleteXZAgvInst(instdto.getInstruction_code());
|
||||
|
||||
} catch (Exception e) {
|
||||
jo.put("code", "2");
|
||||
@@ -568,7 +564,7 @@ public class HFHandServiceImpl implements HFHandService {
|
||||
}
|
||||
if (type.equals("2")) {
|
||||
try {
|
||||
agvService.sendAgvInstToMagic(instdto);
|
||||
agvService.sendOrderSequencesToXZ(instdto);
|
||||
} catch (Exception e) {
|
||||
jo.put("code", "2");
|
||||
jo.put("desc", "下发agv失败");
|
||||
@@ -677,7 +673,7 @@ public class HFHandServiceImpl implements HFHandService {
|
||||
TaskDto acsTask = taskjo.toJavaObject(TaskDto.class);
|
||||
InstructionService instructionservice = SpringContextHolder.getBean(InstructionServiceImpl.class);
|
||||
InstructionDto instdto = instructionservice.findByTaskid(acsTask.getTask_id(), "instruction_status <2 ");
|
||||
if (instdto != null){
|
||||
if (instdto != null) {
|
||||
jo.put("code", "0");
|
||||
jo.put("desc", "有指令未完成!");
|
||||
jo.put("result", new JSONObject());
|
||||
|
||||
Reference in New Issue
Block a user