Browse Source

ACS请求LMS获取点位高度接口重新调整

psh
psh 1 year ago
parent
commit
ead57ef05c
  1. 56
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  2. 5
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/BaseRequest.java
  3. 12
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/dto/TaskDto.java
  4. 11
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java
  5. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java
  6. 22
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java
  7. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KGHJRKTask.java
  8. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/MJXLTask.java
  9. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/TBXBKJTask.java
  10. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/XSCKTask.java
  11. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ZJBZKDDTask.java
  12. 18
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSFMTask.java
  13. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java

56
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

@ -30,6 +30,7 @@ import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.task.domain.Task; import org.nl.acs.task.domain.Task;
import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.acs.task.service.impl.TaskServiceImpl; import org.nl.acs.task.service.impl.TaskServiceImpl;
import org.nl.system.service.param.ISysParamService; import org.nl.system.service.param.ISysParamService;
import org.nl.config.SpringContextHolder; import org.nl.config.SpringContextHolder;
@ -124,6 +125,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
// //
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
TaskDto task =taskService.findById(inst.getTask_id());
int start_height= ObjectUtil.isNotEmpty(task.getStart_height())?Integer.parseInt(task.getStart_height()):0;
int next_height= ObjectUtil.isNotEmpty(task.getNext_height())?Integer.parseInt(task.getNext_height()):0;
String start_point=task.getStart_point_code();
String next_point=task.getNext_point_code();
//分配 车id //分配 车id
//(不需要WCS反馈) //(不需要WCS反馈)
if (phase == 0x02) { if (phase == 0x02) {
@ -168,16 +175,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
return; return;
} }
Task task =taskService.getById(inst.getTask_id());
BaseRequest request=new BaseRequest(); data = getData(data, index, inst, task);
request.setRequestNo(IdUtil.simpleUUID());
request.setTaskId(task.getExt_task_id());
request.setPhase(String.valueOf(phase));
acsToWmsService.feedbackState(request);
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
//到达取货等待点 //到达取货等待点
//(需要WCS反馈) //(需要WCS反馈)
} else if (phase == 0x04) { } else if (phase == 0x04) {
data = getData(data, index, inst, task);
//取货完毕 //取货完毕
//(需要WCS反馈) //(需要WCS反馈)
} else if (phase == 0x05) { } else if (phase == 0x05) {
@ -214,7 +217,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
return; return;
} }
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0); data = getData(data, index, inst, task);
//到达放货等待点 //到达放货等待点
//(需要WCS反馈) //(需要WCS反馈)
} else if (phase == 0x06) { } else if (phase == 0x06) {
@ -251,7 +254,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到关联编号{}对应的指令", ikey); log.info("未找到关联编号{}对应的指令", ikey);
return; return;
} }
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0); data = getData(data, index, inst, task);
//放货完毕 //放货完毕
//(需要WCS反馈) //(需要WCS反馈)
@ -310,4 +313,39 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
} }
} }
private byte[] getData(byte[] data, int index, Instruction inst, TaskDto task) {
String next_point;
String start_point;
int next_height;
int start_height;
if(!"1".equals(task.getTask_type())&&!"2".equals(task.getTask_type())) {
BaseRequest request = new BaseRequest();
request.setRequestNo(IdUtil.simpleUUID());
request.setTaskId(task.getExt_task_id());
JSONObject resp = JSONObject.parseObject(acsToWmsService.feedbackState(request));
if("200".equals(resp.getString("code"))){
start_height=(resp.getJSONObject("parameters").getInteger("start_height")-1)*1000;
next_height=(resp.getJSONObject("parameters").getInteger("next_height")-1)*1000;
start_point=resp.getJSONObject("parameters").getString("start_point");
next_point=resp.getJSONObject("parameters").getString("next_point");
task.setStart_height(String.valueOf(start_height));
task.setNext_height(String.valueOf(next_height));
task.setStart_point_code(start_point);
task.setStart_device_code(start_point);
task.setNext_point_code(next_point);
task.setNext_device_code(next_point);
int start_address=deviceService.queryAddressBydeviceCode(start_point);
int next_address=deviceService.queryAddressBydeviceCode(next_point);
taskService.update(task);
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, start_address, next_address, start_height, next_height);
log.info("指令号:{},phase:{},acs请求wms申请成功", inst.getInstruction_code(),phase);
}else{
log.info("指令号:{},phase:{},acs请求wms申请失败", inst.getInstruction_code(),phase);
}
}else {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
}
return data;
}
} }

5
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/BaseRequest.java

@ -68,10 +68,5 @@ public class BaseRequest {
*/ */
private String taskId; private String taskId;
/**
* 阶段号
*/
private String phase;
} }

12
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/dto/TaskDto.java

@ -290,4 +290,16 @@ public class TaskDto implements Serializable {
* 烘箱温度 * 烘箱温度
*/ */
private String temperature; private String temperature;
/**
* 起点高度
*/
private String start_height;
/**
* 终点高度
*/
private String next_height;
} }

11
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java

@ -39,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@ -196,8 +197,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
AbstractTask task = taskFactory.getTask(schBaseTask.getConfig_code()); AbstractTask task = taskFactory.getTask(schBaseTask.getConfig_code());
// 执行创建任务 // 执行创建任务
String resultCode=task.feedbackState(param); task.feedbackState(param,schBaseTask,result);
result.getParameters().put("result",resultCode); Map<String, String> map=new HashMap<>();
map.put("start_point",schBaseTask.getPoint_code1());
map.put("next_point",schBaseTask.getPoint_code2());
//todo
map.put("start_height","0");
map.put("next_height","0");
result.setParameters(map);
} catch (Exception e) { } catch (Exception e) {
String message = ObjectUtil.isEmpty(e.getMessage()) String message = ObjectUtil.isEmpty(e.getMessage())
? ((InvocationTargetException) e).getTargetException().getMessage() ? ((InvocationTargetException) e).getTargetException().getMessage()

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.wms.database.material.service.IMdBaseMaterialService; import org.nl.wms.database.material.service.IMdBaseMaterialService;
import org.nl.wms.database.material.service.dao.MdBaseMaterial; import org.nl.wms.database.material.service.dao.MdBaseMaterial;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.ISchBasePointService;
@ -235,10 +236,10 @@ public abstract class AbstractTask {
* @param param * @param param
* @throws BadRequestException * @throws BadRequestException
*/ */
public String feedbackState(JSONObject param) throws BadRequestException { public void feedbackState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) throws BadRequestException {
return this.feedbackTaskState(param); this.feedbackTaskState(param,schBaseTask,result);
} }
protected abstract String feedbackTaskState(JSONObject param); protected abstract void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask,BaseResponse result);
} }

22
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java

@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.config.MapOf; import org.nl.config.MapOf;
import org.nl.wms.ext.service.WmsToAcsService; import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
@ -216,19 +217,12 @@ public class BPSLTask extends AbstractTask {
} }
@Override @Override
protected String feedbackTaskState(JSONObject param) { protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
int phase=param.getInteger("phase"); //todo 重算最优点
String result="0"; JSONObject jsonObject = JSONObject.parseObject(schBaseTask.getExt_group_data());
switch (phase){ SchBasePoint point = this.findNextPoint(jsonObject);
case 3: // 设置起点并修改创建成功状态
break; schBaseTask.setPoint_code1(point.getPoint_code());
case 4: taskService.update(schBaseTask);
break;
case 6:
break;
case 7:
break;
}
return result;
} }
} }

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KGHJRKTask.java

@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.config.MapOf; import org.nl.config.MapOf;
import org.nl.wms.ext.service.WmsToAcsService; import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
@ -177,19 +178,7 @@ public class KGHJRKTask extends AbstractTask {
} }
@Override @Override
protected String feedbackTaskState(JSONObject param) { protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
int phase=param.getInteger("phase"); //todo 重算最优点
String result="0";
switch (phase){
case 3:
break;
case 4:
break;
case 6:
break;
case 7:
break;
}
return result;
} }
} }

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/MJXLTask.java

@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
@ -244,19 +245,7 @@ public class MJXLTask extends AbstractTask {
} }
@Override @Override
protected String feedbackTaskState(JSONObject param) { protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
int phase=param.getInteger("phase"); //todo 重算最优点
String result="0";
switch (phase){
case 3:
break;
case 4:
break;
case 6:
break;
case 7:
break;
}
return result;
} }
} }

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/TBXBKJTask.java

@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.config.MapOf; import org.nl.config.MapOf;
import org.nl.wms.ext.service.WmsToAcsService; import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
@ -183,19 +184,7 @@ public class TBXBKJTask extends AbstractTask {
} }
@Override @Override
protected String feedbackTaskState(JSONObject param) { protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
int phase=param.getInteger("phase"); //todo 重算最优点
String result="0";
switch (phase){
case 3:
break;
case 4:
break;
case 6:
break;
case 7:
break;
}
return result;
} }
} }

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/XSCKTask.java

@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.config.MapOf; import org.nl.config.MapOf;
import org.nl.wms.ext.service.WmsToAcsService; import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
@ -228,19 +229,7 @@ public class XSCKTask extends AbstractTask {
} }
@Override @Override
protected String feedbackTaskState(JSONObject param) { protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
int phase=param.getInteger("phase"); //todo 重算最优点
String result="0";
switch (phase){
case 3:
break;
case 4:
break;
case 6:
break;
case 7:
break;
}
return result;
} }
} }

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ZJBZKDDTask.java

@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.config.MapOf; import org.nl.config.MapOf;
import org.nl.wms.ext.service.WmsToAcsService; import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
@ -90,19 +91,7 @@ public class ZJBZKDDTask extends AbstractTask {
} }
@Override @Override
protected String feedbackTaskState(JSONObject param) { protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
int phase=param.getInteger("phase"); //todo 重算最优点
String result="0";
switch (phase){
case 3:
break;
case 4:
break;
case 6:
break;
case 7:
break;
}
return result;
} }
} }

18
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSFMTask.java

@ -11,6 +11,7 @@ import org.nl.common.exception.BadRequestException;
import org.nl.config.MapOf; import org.nl.config.MapOf;
import org.nl.wms.database.material.service.dao.MdBaseMaterial; import org.nl.wms.database.material.service.dao.MdBaseMaterial;
import org.nl.wms.ext.service.WmsToAcsService; import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
@ -280,20 +281,9 @@ public class GHSFMTask extends AbstractTask {
this.updateStatus(task_code, TaskStatus.CANCELED); this.updateStatus(task_code, TaskStatus.CANCELED);
} }
@Override @Override
protected String feedbackTaskState(JSONObject param) { protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
int phase=param.getInteger("phase"); //todo 重算最优点
String result="0";
switch (phase){
case 3:
break;
case 4:
break;
case 6:
break;
case 7:
break;
}
return result;
} }
} }

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java

@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.config.MapOf; import org.nl.config.MapOf;
import org.nl.wms.ext.service.WmsToAcsService; import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
@ -294,19 +295,7 @@ public class GHSQHTask extends AbstractTask {
} }
@Override @Override
protected String feedbackTaskState(JSONObject param) { protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
int phase=param.getInteger("phase"); //todo 重算最优点
String result="0";
switch (phase){
case 3:
break;
case 4:
break;
case 6:
break;
case 7:
break;
}
return result;
} }
} }

Loading…
Cancel
Save