|
|
@ -120,44 +120,12 @@ public class YCLRKTask extends AbstractTask { |
|
|
|
*/ |
|
|
|
private SchBasePoint findNextPoint(SchBasePoint startPoint, JSONObject extGroupData) { |
|
|
|
String regionCode = null; |
|
|
|
String materialType = extGroupData.getString("material_type"); |
|
|
|
if ("TBX1".equals(startPoint.getRegion_code())) { |
|
|
|
//TBX1找A区
|
|
|
|
regionCode = "GHS1"; |
|
|
|
|
|
|
|
} else if ("TBX2".equals(startPoint.getRegion_code())) { |
|
|
|
//TBX2找B区
|
|
|
|
regionCode = "GHS2"; |
|
|
|
} |
|
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "2"); |
|
|
|
for (SchBasePoint schBasePoint : schBasePointList) { |
|
|
|
if (!schBasePoint.getPoint_code().endsWith("01") && |
|
|
|
!schBasePoint.getPoint_code().endsWith("06")) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
if ((ObjectUtil.isEmpty(schBasePoint.getVehicle_type()) || |
|
|
|
materialType.equals(schBasePoint.getVehicle_type())) |
|
|
|
&& "2".equals(schBasePoint.getPoint_status()) |
|
|
|
&& schBasePoint.getVehicle_qty() < 3) { |
|
|
|
//新增逻辑,同一列只能放相同物料
|
|
|
|
boolean flag=true; |
|
|
|
List<String> list=new ArrayList<>(); |
|
|
|
for(int i=1;i<=4;i++){ |
|
|
|
int end=Integer.parseInt(schBasePoint.getPoint_code().substring(schBasePoint.getPoint_code().length()-1))+i; |
|
|
|
String pointCode=schBasePoint.getPoint_code().substring(0,schBasePoint.getPoint_code().length()-1); |
|
|
|
list.add(pointCode+end); |
|
|
|
} |
|
|
|
for (SchBasePoint schBasePoint2 : schBasePointList) { |
|
|
|
if(list.contains(schBasePoint2.getPoint_code())) { |
|
|
|
if (ObjectUtil.isNotEmpty(schBasePoint2.getVehicle_type()) && !materialType.equals(schBasePoint2.getVehicle_type())) { |
|
|
|
flag = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(!flag){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
log.info("满架下料找到当前符合条件的点位{}", schBasePoint.getPoint_code()); |
|
|
|
if ("2".equals(schBasePoint.getPoint_status()) |
|
|
|
&& schBasePoint.getVehicle_qty() ==0) { |
|
|
|
log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code()); |
|
|
|
return schBasePoint; |
|
|
|
} |
|
|
|
} |
|
|
@ -207,7 +175,7 @@ public class YCLRKTask extends AbstractTask { |
|
|
|
// 终点解锁
|
|
|
|
endPointObj.setIng_task_code(""); |
|
|
|
endPointObj.setVehicle_code(ObjectUtil.isEmpty(endPointObj.getVehicle_code()) ? vehicle_code + "," : endPointObj.getVehicle_code() + vehicle_code + ","); |
|
|
|
endPointObj.setVehicle_qty(endPointObj.getVehicle_qty() + 1); |
|
|
|
endPointObj.setVehicle_qty(1); |
|
|
|
pointService.update(endPointObj); |
|
|
|
// 要把数据存到组盘表 -> 改造公共方法,返回id
|
|
|
|
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); |
|
|
@ -243,15 +211,10 @@ public class YCLRKTask extends AbstractTask { |
|
|
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode()); |
|
|
|
taskObj.setGroup_id(groupEntity.getGroup_id()); |
|
|
|
taskObj.setRemark("任务完成"); |
|
|
|
JSONObject param=new JSONObject(); |
|
|
|
String device_code=startPoint.substring(0,startPoint.length()-1)+"2"; |
|
|
|
param.put("device_code",device_code); |
|
|
|
param.put("request_medthod_code","TBXBKJTask"); |
|
|
|
param.put("request_medthod_name","涂板线补空架"); |
|
|
|
try { |
|
|
|
acsToWmsService.acsApply(param); |
|
|
|
//todo 入库成功后上报mes
|
|
|
|
}catch (Exception e){ |
|
|
|
log.error("涂板线下料任务自动创建涂板线补空架任务失败{}",e.getMessage()); |
|
|
|
log.error("原材料入库上报MES失败{}",e.getMessage(),e); |
|
|
|
} |
|
|
|
} |
|
|
|
if (status.equals(TaskStatus.CANCELED)) { // 取消
|
|
|
|