|
|
@ -346,15 +346,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object feedTaskStatus(JSONObject param) { |
|
|
|
if(ObjectUtil.isNotEmpty(param)){ |
|
|
|
if (ObjectUtil.isNotEmpty(param)) { |
|
|
|
String task_code = param.getString("task_code"); |
|
|
|
String task_status = param.getString("task_status"); |
|
|
|
if(StrUtil.isEmpty(task_code) || StrUtil.isEmpty(task_status)){ |
|
|
|
if (StrUtil.isEmpty(task_code) || StrUtil.isEmpty(task_status)) { |
|
|
|
throw new BadRequestException("task_code或task_status为空!"); |
|
|
|
} |
|
|
|
SchBaseTask schBaseTask = taskService.getOne(Wrappers.lambdaQuery(SchBaseTask.class) |
|
|
|
.eq(SchBaseTask::getTask_code, task_code).in(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode(), TaskStatus.ISSUED.getCode())); |
|
|
|
if(ObjectUtil.isEmpty(schBaseTask)) throw new BadRequestException("任务不存在!task_code:" + task_code); |
|
|
|
if (ObjectUtil.isEmpty(schBaseTask)) throw new BadRequestException("任务不存在!task_code:" + task_code); |
|
|
|
switch (task_status) { |
|
|
|
case "1": |
|
|
|
//执行中
|
|
|
@ -369,7 +369,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return null; |
|
|
@ -385,9 +385,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
//TODO:空料容放货完成反馈给Connector
|
|
|
|
if (!is_empty) { |
|
|
|
finishTask(schBaseTask.getTask_code(), schBaseTask.getPoint_code2()); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
finishTask(schBaseTask.getTask_code(), schBaseTask.getPoint_code1()); |
|
|
|
|
|
|
|
if ("1".equals(is_connector)) { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("vehicle_code", schBaseTask.getVehicle_code()); |
|
|
@ -411,8 +410,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
private void finishTask(String task_code, String point_code) { |
|
|
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code) |
|
|
|
.set(SchBasePoint::getIs_lock, false)); |
|
|
|
/*taskService.update(Wrappers.lambdaUpdate(SchBaseTask.class).eq(SchBaseTask::getTask_code, task_code) |
|
|
|
.set(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode()));*/ |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -425,7 +422,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
//TODO:取货完成创建第二条任务:补空托盘
|
|
|
|
String vehicle_code = schBaseTask.getVehicle_code(); |
|
|
|
if ("1".equals(is_connector)) { |
|
|
|
List<SchBaseTask> list = taskService.list(Wrappers.lambdaQuery(SchBaseTask.class).eq(SchBaseTask::getPoint_code2, schBaseTask.getPoint_code1()) |
|
|
|
List<SchBaseTask> list = taskService.list(Wrappers.lambdaQuery(SchBaseTask.class) |
|
|
|
.eq(SchBaseTask::getPoint_code2, schBaseTask.getPoint_code1()) |
|
|
|
.in(SchBaseTask::getTask_status, TaskStatus.APPLY.getCode(), TaskStatus.CREATED.getCode(), TaskStatus.ISSUED.getCode(), TaskStatus.EXECUTING.getCode())); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getOne(new QueryWrapper<MdBaseVehicle>().eq("vehicle_code", vehicle_code)); |
|
|
@ -496,6 +494,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
taskService.update(Wrappers.lambdaUpdate(SchBaseTask.class).eq(SchBaseTask::getTask_code, schBaseTask.getTask_code()) |
|
|
|
.set(SchBaseTask::getJob_name, connectorDto.getJobname())); |
|
|
|
} |
|
|
|
} else { |
|
|
|
throw new BadRequestException("LMS向Connector请求取货"); |
|
|
|
} |
|
|
|
} |
|
|
|
if ("2".equals(is_connector)) { |
|
|
@ -532,6 +532,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
if (acsResponse.getStatus() != 200 || StringUtils.isNotEmpty(acsResponse.getErrMsg())) { |
|
|
|
throw new BadRequestException("申请失败,"+ acsResponse.getErrMsg()); |
|
|
|
} |
|
|
|
}else if("1".equals(is_connector)){ |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("vehicle_code", schBaseTask.getVehicle_code()); |
|
|
|
json.put("status", status); |
|
|
|
json.put("device_code", schBaseTask.getPoint_code2()); |
|
|
|
json.put("task_code", schBaseTask.getTask_code()); |
|
|
|
AcsResponse acsResponse = connectorService.feedAgvTaskStatus(json); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|