|
@ -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()) |
|
|
|
|
|
//放货三拖一起放,只能到01位置
|
|
|
|
|
|
&& schBasePoint.getPoint_code().endsWith("01") |
|
|
&& (ObjectUtil.isEmpty(schBasePoint.getVehicle_type()) || materialType.equals(schBasePoint.getVehicle_type()))) { |
|
|
&& (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) { |
|
|
for (SchBasePoint tempPoint : tempList) { |
|
|
if(tempPoint.getVehicle_qty()!=0||ObjectUtil.isNotEmpty(schBasePoint.getIng_task_code())){ |
|
|
if ((tempPoint.getVehicle_qty() != 0 || ObjectUtil.isNotEmpty(schBasePoint.getIng_task_code())) |
|
|
if(temp!=null){ |
|
|
) { |
|
|
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; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -228,18 +232,22 @@ public class GHSQHTask extends AbstractTask { |
|
|
} |
|
|
} |
|
|
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,6 +275,7 @@ 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已经放满,固化室可以进行固化
|
|
@ -310,7 +319,7 @@ public class GHSQHTask extends AbstractTask { |
|
|
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()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|