Browse Source

自测问题修复

master
psh 1 year ago
parent
commit
8b9cfe49e0
  1. 5
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  2. 4
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/domain/Instruction.java
  3. 2
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/rest/InstructionController.java
  4. 2
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
  5. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/BPSLTask.java
  6. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSFMTask.java
  7. 105
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java

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

@ -337,6 +337,11 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
int start_address=deviceService.queryAddressBydeviceCode(start_point); int start_address=deviceService.queryAddressBydeviceCode(start_point);
int next_address=deviceService.queryAddressBydeviceCode(next_point); int next_address=deviceService.queryAddressBydeviceCode(next_point);
taskService.update(task); taskService.update(task);
inst.setStart_point_code(start_point);
inst.setStart_device_code(start_point);
inst.setNext_point_code(next_point);
inst.setNext_device_code(next_point);
instructionService.update(inst);
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, start_address, next_address, start_height, next_height); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, start_address, next_address, start_height, next_height);
log.info("指令号:{},phase:{},acs请求wms申请成功", inst.getInstruction_code(),phase); log.info("指令号:{},phase:{},acs请求wms申请成功", inst.getInstruction_code(),phase);
}else{ }else{

4
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/domain/Instruction.java

@ -26,6 +26,10 @@ public class Instruction extends InstructionDto implements Serializable {
public Instruction() { public Instruction() {
} }
public Instruction(InstructionDto instructionDto) {
BeanUtil.copyProperties(instructionDto,this, CopyOptions.create().setIgnoreNullValue(true));
}
public void copyFrom(Instruction source){ public void copyFrom(Instruction source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
} }

2
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/rest/InstructionController.java

@ -38,7 +38,7 @@ public class InstructionController {
//@PreAuthorize("@el.check('instruction:list')") //@PreAuthorize("@el.check('instruction:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) { public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
if(ObjectUtil.isEmpty(whereJson.get("status"))) { if(ObjectUtil.isEmpty(whereJson.get("status"))) {
whereJson.put("status", "1"); whereJson.put("status", "0");
} }
return new ResponseEntity<>(instructionService.queryAll(whereJson, page), HttpStatus.OK); return new ResponseEntity<>(instructionService.queryAll(whereJson, page), HttpStatus.OK);
} }

2
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java

@ -807,7 +807,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (StrUtil.equals(task.getNext_device_code(), instnextdevice)) { if (StrUtil.equals(task.getNext_device_code(), instnextdevice)) {
taskService.finish(task.getTask_id()); taskService.finish(task.getTask_id());
} else { } else {
finishAndCreateNextInst((Instruction) entity); finishAndCreateNextInst(new Instruction(entity));
} }
} }

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

@ -93,7 +93,7 @@ public class BPSLTask extends AbstractTask {
taskService.update(task); taskService.update(task);
//发起任务时先把点位占用,防止发起重复任务 //发起任务时先把点位占用,防止发起重复任务
point.setIng_task_code(task.getTask_code()); // point.setIng_task_code(task.getTask_code());
// point.setVehicle_qty(point.getVehicle_qty() - 1); // point.setVehicle_qty(point.getVehicle_qty() - 1);
point.setVehicle_type(materialType); point.setVehicle_type(materialType);
pointService.update(point); pointService.update(point);
@ -120,7 +120,7 @@ public class BPSLTask extends AbstractTask {
}else if ("3".equals(materialType)){ }else if ("3".equals(materialType)){
regionCode="HCQ2"; regionCode="HCQ2";
} }
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode,"2"); List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode,"1");
for(int i=schBasePointList.size()-1;i>=0;i--){ for(int i=schBasePointList.size()-1;i>=0;i--){
SchBasePoint schBasePoint=schBasePointList.get(i); SchBasePoint schBasePoint=schBasePointList.get(i);
if (!"2".equals(schBasePoint.getPoint_type())&&schBasePoint.getVehicle_qty()!=0 if (!"2".equals(schBasePoint.getPoint_type())&&schBasePoint.getVehicle_qty()!=0
@ -230,8 +230,6 @@ public class BPSLTask extends AbstractTask {
//todo 重算最优点 //todo 重算最优点
JSONObject jsonObject = JSONObject.parseObject(schBaseTask.getExt_group_data()); JSONObject jsonObject = JSONObject.parseObject(schBaseTask.getExt_group_data());
SchBasePoint point = this.findNextPoint(jsonObject); SchBasePoint point = this.findNextPoint(jsonObject);
// 设置起点并修改创建成功状态 schBaseTask.setPoint_code1(point.getPoint_code());
List<String> vehicleCodeList = Arrays.stream(point.getVehicle_code().split(",")).collect(Collectors.toList());
schBaseTask.setPoint_code1(point.getPoint_code()+"0"+vehicleCodeList.size());
} }
} }

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

@ -161,7 +161,7 @@ public class GHSFMTask extends AbstractTask {
Integer tcmn = taskConfig.getTask_create_max_num(); Integer tcmn = taskConfig.getTask_create_max_num();
// 获取执行中的任务 // 获取执行中的任务
List<SchBaseTask> unFinishTasksByTaskConfig = taskService.findUnFinishTasksByTaskConfig( List<SchBaseTask> unFinishTasksByTaskConfig = taskService.findUnFinishTasksByTaskConfig(
taskConfig.getConfig_code(), apply_point_code, taskConfig.getTask_direction()); taskConfig.getConfig_code(), apply_point_code+"01", taskConfig.getTask_direction());
Assert.isFalse(unFinishTasksByTaskConfig.size() >= tcmn, Assert.isFalse(unFinishTasksByTaskConfig.size() >= tcmn,
"该点位申请的任务未完成数已超过上限,无法申请任务"); "该点位申请的任务未完成数已超过上限,无法申请任务");
@ -180,11 +180,13 @@ public class GHSFMTask extends AbstractTask {
task.setVehicle_qty(schBasePoint.getVehicle_qty()); task.setVehicle_qty(schBasePoint.getVehicle_qty());
task.setTask_status(TaskStatus.APPLY.getCode()); task.setTask_status(TaskStatus.APPLY.getCode());
task.setWorkshop_code(taskConfig.getWorkshop_code()); // 车间编码 task.setWorkshop_code(taskConfig.getWorkshop_code()); // 车间编码
//acs固化室首位不存在01和06整体概念,需要补充01生成第一个点位的任务
task.setPoint_code1(apply_point_code+"01");
task.setPoint_code2(endPoint); task.setPoint_code2(endPoint);
task.setTask_status(TaskStatus.CREATED.getCode()); task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark(""); task.setRemark("");
// 设置起/终点 // 设置起/终点
this.setTaskPoint(taskConfig, task, apply_point_code); // this.setTaskPoint(taskConfig, task, apply_point_code);
taskService.create(task); taskService.create(task);
//下发 //下发
@ -212,7 +214,7 @@ public class GHSFMTask extends AbstractTask {
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) { if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) {
throw new BadRequestException("该任务已取消!"); throw new BadRequestException("该任务已取消!");
} }
String startPoint = taskObj.getPoint_code1(); // 获取起点 String startPoint = taskObj.getPoint_code1().substring(0,taskObj.getPoint_code1().length()-2); // 获取起点
String endPoint = taskObj.getPoint_code2(); // 获取终点 String endPoint = taskObj.getPoint_code2(); // 获取终点
SchBasePoint startPointObj = pointService.getById(startPoint); SchBasePoint startPointObj = pointService.getById(startPoint);
SchBasePoint endPointObj = pointService.getById(endPoint); SchBasePoint endPointObj = pointService.getById(endPoint);
@ -225,7 +227,6 @@ public class GHSFMTask extends AbstractTask {
StringBuilder group_id= new StringBuilder(); StringBuilder group_id= new StringBuilder();
// 终点解锁 // 终点解锁
endPointObj.setIng_task_code(""); endPointObj.setIng_task_code("");
endPointObj.setVehicle_code(startPointObj.getVehicle_code());
endPointObj.setVehicle_type(startPointObj.getVehicle_type()); endPointObj.setVehicle_type(startPointObj.getVehicle_type());
endPointObj.setVehicle_code(startPointObj.getVehicle_code()); endPointObj.setVehicle_code(startPointObj.getVehicle_code());
endPointObj.setVehicle_qty(startPointObj.getVehicle_qty()); endPointObj.setVehicle_qty(startPointObj.getVehicle_qty());

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

@ -74,17 +74,17 @@ public class GHSQHTask extends AbstractTask {
// @Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
protected void create() throws BadRequestException { protected void create() throws BadRequestException {
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion("GHS","3"); List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion("GHS", "3");
if (schBasePointList.size()==0) { if (schBasePointList.size() == 0) {
// 消息通知 // 消息通知
log.info("未找到当前符合允许取货的固化室点位,暂不生成任务"); log.info("未找到当前符合允许取货的固化室点位,暂不生成任务");
return; return;
} }
SchBasePoint schBasePoint=null; SchBasePoint schBasePoint = null;
//按顺序查找第一个符合条件的固化室位置,发起任务 //按顺序查找第一个符合条件的固化室位置,发起任务
for(SchBasePoint schBasePoint1:schBasePointList){ for (SchBasePoint schBasePoint1 : schBasePointList) {
if (schBasePoint1.getVehicle_qty()==3&&ObjectUtil.isEmpty(schBasePoint1.getIng_task_code())) { if (schBasePoint1.getVehicle_qty() == 3 && ObjectUtil.isEmpty(schBasePoint1.getIng_task_code())) {
schBasePoint=schBasePoint1; schBasePoint = schBasePoint1;
break; break;
} }
} }
@ -93,14 +93,14 @@ public class GHSQHTask extends AbstractTask {
log.info("未找到当前符合允许取货的固化室点位,暂不生成任务"); log.info("未找到当前符合允许取货的固化室点位,暂不生成任务");
return; return;
} }
SchBasePoint nextPoint=this.findNextPoint(schBasePoint); SchBasePoint nextPoint = this.findNextPoint(schBasePoint);
if (ObjectUtil.isEmpty(nextPoint)) { if (ObjectUtil.isEmpty(nextPoint)) {
// 消息通知 // 消息通知
log.info("未找到当前符合允许放货的缓存点,暂不生成任务Vehicle_type:{}",schBasePoint.getVehicle_type()); log.info("未找到当前符合允许放货的缓存点,暂不生成任务Vehicle_type:{}", schBasePoint.getVehicle_type());
return; return;
} }
// 放料先去等待点 // 放料先去等待点
this.createTask(schBasePoint,nextPoint.getNext_wait_point()); this.createTask(schBasePoint, nextPoint.getNext_wait_point());
} }
@ -111,10 +111,10 @@ public class GHSQHTask extends AbstractTask {
* @param endPoint * @param endPoint
* @return * @return
*/ */
private void createTask(SchBasePoint schBasePoint,String endPoint) { private void createTask(SchBasePoint schBasePoint, String endPoint) {
// 申请任务 // 申请任务
SchBaseTask task = new SchBaseTask(); // 任务实体 SchBaseTask task = new SchBaseTask(); // 任务实体
String apply_point_code =schBasePoint.getPoint_code(); // 请求点 String apply_point_code = schBasePoint.getPoint_code(); // 请求点
String config_code = "GHSQHTask"; String config_code = "GHSQHTask";
// 1、校验数据 // 1、校验数据
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>() SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
@ -175,28 +175,32 @@ public class GHSQHTask extends AbstractTask {
//边负极板到缓存区1 //边负极板到缓存区1
regionCode = "HCQ2"; regionCode = "HCQ2";
} }
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode,"2"); List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1");
for(int i=schBasePointList.size()-1;i>=0;i--){ for (int i = schBasePointList.size() - 1; i >= 0; i--) {
SchBasePoint schBasePoint=schBasePointList.get(i); SchBasePoint schBasePoint = schBasePointList.get(i);
SchBasePoint temp=null; SchBasePoint temp = null;
if (schBasePoint.getVehicle_qty()==0 if (schBasePoint.getVehicle_qty() == 0
&&ObjectUtil.isEmpty(schBasePoint.getIng_task_code()) && ObjectUtil.isEmpty(schBasePoint.getIng_task_code())
&&(ObjectUtil.isEmpty(schBasePoint.getVehicle_type())||materialType.equals(schBasePoint.getVehicle_type()))){ //放货三拖一起放,只能到01位置
&& schBasePoint.getPoint_code().endsWith("01")
&& (ObjectUtil.isEmpty(schBasePoint.getVehicle_type()) || materialType.equals(schBasePoint.getVehicle_type()))) {
//发现有空位时暂存当前位置,检查当前列前面是否存在已放货位置,找最前面无货的位置 //发现有空位时暂存当前位置,检查当前列前面是否存在已放货位置,找最前面无货的位置
//如果当列其他位置均已放满,则继续找下一列 //如果当列其他位置均已放满,则继续找下一列
List<SchBasePoint> tempList = pointMapper.findPointByParentPoint(schBasePoint.getParent_point_code()); List<SchBasePoint> tempList = pointMapper.findPointByParentPoint(schBasePoint.getParent_point_code());
for(SchBasePoint tempPoint:tempList){
if(tempPoint.getVehicle_qty()!=0||ObjectUtil.isNotEmpty(schBasePoint.getIng_task_code())){ for (SchBasePoint tempPoint : tempList) {
if(temp!=null){ if ((tempPoint.getVehicle_qty() != 0 || ObjectUtil.isNotEmpty(schBasePoint.getIng_task_code()))
return temp; ) {
break; // 如果当前库位非空,则跳出循环
} else {
if(tempPoint.getPoint_code().endsWith("01")) {
temp = tempPoint; // 更新最大空库位
} }
temp=tempPoint;
} }
} }
if(temp==null){ if (temp != null) {
continue; log.info("固化室取货任务找到当前符合条件的缓存区位置{}", schBasePoint.getPoint_code());
} }
log.info("固化室取货任务找到当前符合条件的缓存区位置{}",schBasePoint.getPoint_code());
return temp; return temp;
} }
} }
@ -227,19 +231,23 @@ public class GHSQHTask extends AbstractTask {
taskObj.setRemark("执行中"); taskObj.setRemark("执行中");
} }
if (status.equals(TaskStatus.FINISHED)) { // 完成 if (status.equals(TaskStatus.FINISHED)) { // 完成
StringBuilder group_id= new StringBuilder(); StringBuilder group_id = new StringBuilder();
// 终点解锁 // 终点解锁,缓存区现在由一个点位改为三个点位,所以将物料存在010203三个位置上
endPointObj.setIng_task_code(""); for(int i=1;i<=3;i++) {
endPointObj.setVehicle_code(startPointObj.getVehicle_code()); SchBasePoint point = pointService.getById(endPoint.substring(0,endPoint.length()-1)+i);
endPointObj.setVehicle_type(startPointObj.getVehicle_type()); point.setIng_task_code("");
endPointObj.setVehicle_code(startPointObj.getVehicle_code()); List<String> vehicleCodeList = Arrays.stream(startPointObj.getVehicle_code().split(",")).collect(Collectors.toList());
endPointObj.setVehicle_qty(startPointObj.getVehicle_qty()); point.setVehicle_code(vehicleCodeList.get(i-1));
endPointObj.setUpdate_time(DateUtil.now()); point.setVehicle_type(startPointObj.getVehicle_type());
pointService.update(endPointObj); point.setVehicle_qty(1);
point.setUpdate_time(DateUtil.now());
pointService.update(point);
}
//固化室放料完毕后,将当前一整排都标记上物料信息,防止出现混放情况 //固化室放料完毕后,将当前一整排都标记上物料信息,防止出现混放情况
pointMapper.updateVehicleType(endPointObj.getPoint_code().substring(0,endPointObj.getPoint_code().length()-2),endPointObj.getVehicle_type()); pointMapper.updateVehicleType(endPointObj.getPoint_code().substring(0, endPointObj.getPoint_code().length() - 2), endPointObj.getVehicle_type());
List<String> vehicleCodeList = Arrays.stream(startPointObj.getVehicle_code().split(",")).collect(Collectors.toList()); List<String> vehicleCodeList = Arrays.stream(startPointObj.getVehicle_code().split(",")).collect(Collectors.toList());
for(String vehicleCode:vehicleCodeList) { for (int i=0;i<vehicleCodeList.size();i++) {
String vehicleCode=vehicleCodeList.get(i);
SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(new LambdaQueryWrapper<SchBaseVehiclematerialgroup>() SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(new LambdaQueryWrapper<SchBaseVehiclematerialgroup>()
.eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicleCode) .eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicleCode)
.eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, .eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status,
@ -248,9 +256,9 @@ public class GHSQHTask extends AbstractTask {
throw new BadRequestException(vehicleCode + " => " + startPointObj.getVehicle_type() + "的组盘信息未找到"); throw new BadRequestException(vehicleCode + " => " + startPointObj.getVehicle_type() + "的组盘信息未找到");
} }
one.setTask_code(taskObj.getTask_code()); one.setTask_code(taskObj.getTask_code());
one.setPoint_code(endPointObj.getPoint_code()); // 当前位置 one.setPoint_code(endPointObj.getPoint_code().substring(0,endPointObj.getPoint_code().length()-1)+(i+1)); // 当前位置
one.setPoint_name(endPointObj.getPoint_name()); one.setPoint_name(endPointObj.getPoint_name().substring(0,endPointObj.getPoint_name().length()-1)+(i+1));
one.setMove_way(one.getMove_way()==null?"":(one.getMove_way() + " -> ") + endPointObj.getPoint_code()); one.setMove_way(one.getMove_way() == null ? "" : (one.getMove_way() + " -> ") + endPointObj.getPoint_code().substring(0,endPointObj.getPoint_code().length()-1)+(i+1));
one.setUpdate_id(GeneralDefinition.ACS_ID); one.setUpdate_id(GeneralDefinition.ACS_ID);
one.setUpdate_name(GeneralDefinition.ACS_NAME); one.setUpdate_name(GeneralDefinition.ACS_NAME);
one.setUpdate_time(DateUtil.now()); one.setUpdate_time(DateUtil.now());
@ -267,7 +275,8 @@ public class GHSQHTask extends AbstractTask {
taskObj.setRemark("任务完成"); taskObj.setRemark("任务完成");
//如果起点点位为10结尾视为最后该固化室最后一个任务,取完后通知acs取货完毕 //如果起点点位为10结尾视为最后该固化室最后一个任务,取完后通知acs取货完毕
if(taskObj.getPoint_code1().endsWith("10")) { // (如果不放满的情况可以固化,可能逻辑需要改成任务完成时检测当前固化室所有点位是否已完成)
if (taskObj.getPoint_code1().endsWith("10")) {
String middle = taskObj.getPoint_code1().substring(taskObj.getPoint_code1().length() - 4, taskObj.getPoint_code1().length() - 2); String middle = taskObj.getPoint_code1().substring(taskObj.getPoint_code1().length() - 4, taskObj.getPoint_code1().length() - 2);
//通知acs已经放满,固化室可以进行固化 //通知acs已经放满,固化室可以进行固化
String device_code = "ZDM" + middle; String device_code = "ZDM" + middle;
@ -302,15 +311,15 @@ public class GHSQHTask extends AbstractTask {
@SneakyThrows @SneakyThrows
@Override @Override
protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) { protected void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) {
//todo 重算最优点 //todo 重算最优点
SchBasePoint startPoint=pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code1())); .eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code1()));
SchBasePoint nextPoint=this.findNextPoint(startPoint); SchBasePoint nextPoint = this.findNextPoint(startPoint);
if(ObjectUtil.isEmpty(nextPoint)){ if (ObjectUtil.isEmpty(nextPoint)) {
throw new Exception("当前起点"+schBaseTask.getPoint_code1()+"未找到合适的放货点位"); throw new Exception("当前起点" + schBaseTask.getPoint_code1() + "未找到合适的放货点位");
} }
//上位记的是整一个缓存区三个点,整体搬运时反馈点位带01 //上位记的是整一个缓存区三个点
schBaseTask.setPoint_code2(nextPoint.getPoint_code()+"01"); schBaseTask.setPoint_code2(nextPoint.getPoint_code());
} }
} }

Loading…
Cancel
Save