|
@ -67,7 +67,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa |
|
|
String begin_time = ObjectUtil.isNotEmpty(whereJson.get("begin_time")) ? whereJson.get("begin_time").toString() : null; |
|
|
String begin_time = ObjectUtil.isNotEmpty(whereJson.get("begin_time")) ? whereJson.get("begin_time").toString() : null; |
|
|
String end_time = ObjectUtil.isNotEmpty(whereJson.get("end_time")) ? whereJson.get("end_time").toString() : null; |
|
|
String end_time = ObjectUtil.isNotEmpty(whereJson.get("end_time")) ? whereJson.get("end_time").toString() : null; |
|
|
String more_task_status = ObjectUtil.isNotEmpty(whereJson.get("more_task_status")) ? whereJson.get("more_task_status").toString() : null; |
|
|
String more_task_status = ObjectUtil.isNotEmpty(whereJson.get("more_task_status")) ? whereJson.get("more_task_status").toString() : null; |
|
|
List<String> collect = ObjectUtil.isNotEmpty(more_task_status)?Arrays.stream(more_task_status.split(",")).collect(Collectors.toList()):null; |
|
|
List<String> collect = ObjectUtil.isNotEmpty(more_task_status) ? Arrays.stream(more_task_status.split(",")).collect(Collectors.toList()) : null; |
|
|
String unFinished = null; |
|
|
String unFinished = null; |
|
|
if (collect != null) { |
|
|
if (collect != null) { |
|
|
if (collect.contains(TaskStatus.UNFINISHED.getCode())) { |
|
|
if (collect.contains(TaskStatus.UNFINISHED.getCode())) { |
|
@ -189,30 +189,30 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa |
|
|
String vehicle_code = ObjectUtil.isNotEmpty(param.getString("vehicle_code")) ? param.getString("vehicle_code") : null; |
|
|
String vehicle_code = ObjectUtil.isNotEmpty(param.getString("vehicle_code")) ? param.getString("vehicle_code") : null; |
|
|
String config_code = param.getString("config_code"); |
|
|
String config_code = param.getString("config_code"); |
|
|
|
|
|
|
|
|
if("4".equals(type)){ |
|
|
if ("4".equals(type)) { |
|
|
//4-叫料
|
|
|
//4-叫料
|
|
|
|
|
|
|
|
|
}else if("5".equals(type)){ |
|
|
} else if ("5".equals(type)) { |
|
|
//5-满料出库
|
|
|
//5-满料出库
|
|
|
if(device_code.startsWith("TBX")){ |
|
|
if (device_code.startsWith("TBX")) { |
|
|
config_code="MJXLTask"; |
|
|
config_code = "MJXLTask"; |
|
|
param.put("config_code",config_code); |
|
|
param.put("config_code", config_code); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}else if("6".equals(type)){ |
|
|
} else if ("6".equals(type)) { |
|
|
//6-申请空盘
|
|
|
//6-申请空盘
|
|
|
|
|
|
|
|
|
}else if("7".equals(type)){ |
|
|
} else if ("7".equals(type)) { |
|
|
//7-空托盘出库
|
|
|
//7-空托盘出库
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(ObjectUtil.isEmpty(config_code)){ |
|
|
if (ObjectUtil.isEmpty(config_code)) { |
|
|
throw new BadRequestException("任务类型不正确!device_code:"+device_code+",type:"+type); |
|
|
throw new BadRequestException("任务类型不正确!device_code:" + device_code + ",type:" + type); |
|
|
} |
|
|
} |
|
|
AbstractTask task = taskFactory.getTask(config_code); |
|
|
AbstractTask task = taskFactory.getTask(config_code); |
|
|
// 执行创建任务
|
|
|
// 执行创建任务
|
|
|
task.apply(param); |
|
|
task.apply(param); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -239,7 +239,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa |
|
|
// 根据标识找到任务
|
|
|
// 根据标识找到任务
|
|
|
SchBaseTask taskOne = schBaseTaskMapper.selectById(task_id); |
|
|
SchBaseTask taskOne = schBaseTaskMapper.selectById(task_id); |
|
|
if (Integer.parseInt(taskOne.getTask_status()) >= Integer.parseInt(TaskStatus.FINISHED.getCode()) |
|
|
if (Integer.parseInt(taskOne.getTask_status()) >= Integer.parseInt(TaskStatus.FINISHED.getCode()) |
|
|
&&!"feedback".equals(method_name)) { |
|
|
&& !"feedback".equals(method_name)) { |
|
|
throw new BadRequestException("任务已完成或已取消!"); |
|
|
throw new BadRequestException("任务已完成或已取消!"); |
|
|
} |
|
|
} |
|
|
// 根据配置去工厂类获得类对象
|
|
|
// 根据配置去工厂类获得类对象
|
|
@ -267,12 +267,12 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void sendToMes(SchBaseTask task){ |
|
|
private void sendToMes(SchBaseTask task) { |
|
|
if(task.getPoint_code2().startsWith("YL")){ |
|
|
if (task.getPoint_code2().startsWith("YL")) { |
|
|
// QPMES062
|
|
|
// QPMES062
|
|
|
}else if(task.getPoint_code2().startsWith("HW")){ |
|
|
} else if (task.getPoint_code2().startsWith("HW")) { |
|
|
// QPMES065
|
|
|
// QPMES065
|
|
|
}else{ |
|
|
} else { |
|
|
throw new RuntimeException("目的地非入原材料库或出库,无需反馈MES!"); |
|
|
throw new RuntimeException("目的地非入原材料库或出库,无需反馈MES!"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -283,29 +283,31 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public void move(){ |
|
|
public void move() { |
|
|
log.info("管理端发起一键移库!"); |
|
|
log.info("管理端发起一键移库!"); |
|
|
List<SchBasePoint> schBasePointList=schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>() |
|
|
List<SchBasePoint> schBasePointList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>() |
|
|
.eq(SchBasePoint::getIs_used,true) |
|
|
.eq(SchBasePoint::getIs_used, true) |
|
|
.eq(SchBasePoint::getRegion_code, "YLHC") |
|
|
.eq(SchBasePoint::getRegion_code, "YLHC") |
|
|
.notLike(SchBasePoint::getVehicle_code2,"YBHC") |
|
|
.notLike(SchBasePoint::getVehicle_code2, "YBHC") |
|
|
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code) |
|
|
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code) |
|
|
.or() |
|
|
.or() |
|
|
.eq(SchBasePoint::getIng_task_code, "") |
|
|
.eq(SchBasePoint::getIng_task_code, "") |
|
|
)); |
|
|
)); |
|
|
List<SchBasePoint> nextList=schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>() |
|
|
List<SchBasePoint> nextList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>() |
|
|
.eq(SchBasePoint::getRegion_code, "YL") |
|
|
.eq(SchBasePoint::getRegion_code, "YL") |
|
|
|
|
|
.eq(SchBasePoint::getIs_used, true) |
|
|
|
|
|
.eq(SchBasePoint::getVehicle_qty, 0) |
|
|
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code) |
|
|
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code) |
|
|
.or() |
|
|
.or() |
|
|
.eq(SchBasePoint::getIng_task_code, ""))); |
|
|
.eq(SchBasePoint::getIng_task_code, ""))); |
|
|
for(SchBasePoint schBasePoint:schBasePointList){ |
|
|
for (SchBasePoint schBasePoint : schBasePointList) { |
|
|
JSONObject param =new JSONObject(); |
|
|
JSONObject param = new JSONObject(); |
|
|
param.put("start_point",schBasePoint.getPoint_code()); |
|
|
param.put("start_point", schBasePoint.getPoint_code()); |
|
|
param.put("next_point",nextList.get(0).getPoint_code()); |
|
|
param.put("next_point", nextList.get(0).getPoint_code()); |
|
|
param.put("request_medthod_code", "POINTTask"); |
|
|
param.put("request_medthod_code", "POINTTask"); |
|
|
param.put("request_medthod_name", "点对点任务"); |
|
|
param.put("request_medthod_name", "点对点任务"); |
|
|
param.put("device_code",param.getString("start_point")); |
|
|
param.put("device_code", param.getString("start_point")); |
|
|
BaseResponse baseResponse=acsToWmsService.acsApply(param); |
|
|
BaseResponse baseResponse = acsToWmsService.acsApply(param); |
|
|
nextList.remove(0); |
|
|
nextList.remove(0); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|