Merge branch 'master' of http://121.40.234.130:8899/root/yongYuJiaJu
This commit is contained in:
@@ -16,6 +16,7 @@ import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.Empty
|
|||||||
import org.nl.acs.device_driver.basedriver.hailiang_smart_plc_test.HailiangSmartplcTestDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.hailiang_smart_plc_test.HailiangSmartplcTestDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.haokai_auto_conveyor.HaoKaiAutoConveyorDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.haokai_auto_conveyor.HaoKaiAutoConveyorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.paint_conveyor.PaintConveyorDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.paint_conveyor.PaintConveyorDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
@@ -38,6 +39,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
private final ParamService paramService;
|
private final ParamService paramService;
|
||||||
private final TaskService taskService;
|
private final TaskService taskService;
|
||||||
private final InstructionService instructionService;
|
private final InstructionService instructionService;
|
||||||
|
|
||||||
@LokiLog(type = LokiLogType.AGV)
|
@LokiLog(type = LokiLogType.AGV)
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse sendAgvInstToAgv(Instruction inst) throws Exception {
|
public HttpResponse sendAgvInstToAgv(Instruction inst) throws Exception {
|
||||||
@@ -127,6 +129,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@LokiLog(type = LokiLogType.AGV)
|
@LokiLog(type = LokiLogType.AGV)
|
||||||
@Override
|
@Override
|
||||||
//ZDAGV
|
//ZDAGV
|
||||||
@@ -365,8 +368,15 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||||
is_feedback = true;
|
is_feedback = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (addressdevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
|
is_feedback = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ("PauseOnStation".equals(type)) {
|
if ("PauseOnStation".equals(type)) {
|
||||||
|
if (addressdevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
|
is_feedback = true;
|
||||||
|
}
|
||||||
if (addressdevice.getDeviceDriver() instanceof HailiangSmartplcTestDeviceDriver) {
|
if (addressdevice.getDeviceDriver() instanceof HailiangSmartplcTestDeviceDriver) {
|
||||||
// hailiangSmartplcTestDeviceDriver = (HailiangSmartplcTestDeviceDriver) addressdevice.getDeviceDriver();
|
// hailiangSmartplcTestDeviceDriver = (HailiangSmartplcTestDeviceDriver) addressdevice.getDeviceDriver();
|
||||||
// inst.setExecute_status("4");
|
// inst.setExecute_status("4");
|
||||||
@@ -434,6 +444,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
return requestjo.toString();
|
return requestjo.toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@LokiLog(type = LokiLogType.AGV)
|
@LokiLog(type = LokiLogType.AGV)
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse markComplete(String code) {
|
public HttpResponse markComplete(String code) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.nl.acs.AcsConfig;
|
|||||||
import org.nl.acs.agv.server.*;
|
import org.nl.acs.agv.server.*;
|
||||||
import org.nl.acs.auto.initial.ApplicationAutoInitial;
|
import org.nl.acs.auto.initial.ApplicationAutoInitial;
|
||||||
import org.nl.acs.device.service.DeviceService;
|
import org.nl.acs.device.service.DeviceService;
|
||||||
|
import org.nl.acs.device.service.impl.DeviceExtraServiceImpl;
|
||||||
import org.nl.acs.device.service.impl.DeviceServiceImpl;
|
import org.nl.acs.device.service.impl.DeviceServiceImpl;
|
||||||
import org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.CargoLiftConveyorDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.CargoLiftConveyorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.EmptyVehicleStackingPositionDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.EmptyVehicleStackingPositionDeviceDriver;
|
||||||
@@ -27,6 +28,7 @@ import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanne
|
|||||||
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
import org.nl.acs.instruction.service.dto.Instruction;
|
import org.nl.acs.instruction.service.dto.Instruction;
|
||||||
|
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||||
import org.nl.acs.opc.Device;
|
import org.nl.acs.opc.Device;
|
||||||
import org.nl.acs.opc.DeviceAppService;
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
import org.nl.acs.opc.DeviceAppServiceImpl;
|
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||||
@@ -77,7 +79,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
RouteLineService routeLineService;
|
RouteLineService routeLineService;
|
||||||
@Autowired
|
@Autowired
|
||||||
TaskService taskService;
|
TaskService taskService;
|
||||||
|
@Autowired
|
||||||
|
DeviceExecuteLogService logServer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void autoInitial() {
|
public void autoInitial() {
|
||||||
@@ -381,18 +384,23 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
throw new BadRequestException("未查询到相关路由!");
|
throw new BadRequestException("未查询到相关路由!");
|
||||||
}
|
}
|
||||||
if (startdevice.getDeviceDriver() instanceof EmptyVehicleStackingPositionDeviceDriver) {
|
if (startdevice.getDeviceDriver() instanceof EmptyVehicleStackingPositionDeviceDriver) {
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "开始创建取叠盘架指令~");
|
||||||
emptyVehicleStackingPositionDeviceDriver = (EmptyVehicleStackingPositionDeviceDriver) startdevice.getDeviceDriver();
|
emptyVehicleStackingPositionDeviceDriver = (EmptyVehicleStackingPositionDeviceDriver) startdevice.getDeviceDriver();
|
||||||
//已经生成指令得取空托盘数量
|
//已经生成指令得取空托盘数量
|
||||||
Integer emptyNum = taskService.queryStartNum(dto.getStart_device_code(), dto.getNext_device_code());
|
Integer emptyNum = taskService.queryStartNum(dto.getStart_device_code(), dto.getNext_device_code());
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "查询到同一起点任务已经生成指令的搬运托盘的数量为:" + emptyNum);
|
||||||
//当前任务取得空托盘数量
|
//当前任务取得空托盘数量
|
||||||
Integer now_need_emptypallet_num = Integer.parseInt(taskService.findByCode(dto.getTask_code()).getEmptypallet_num());
|
Integer now_need_emptypallet_num = Integer.parseInt(taskService.findByCode(dto.getTask_code()).getEmptypallet_num());
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "当前任务需要搬运空托盘数量:" + now_need_emptypallet_num);
|
||||||
//当前叠盘架有空托盘数量
|
//当前叠盘架有空托盘数量
|
||||||
int now_number = emptyVehicleStackingPositionDeviceDriver.getNumber();
|
int now_number = emptyVehicleStackingPositionDeviceDriver.getNumber();
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "当前叠盘架上空托盘数量为:" + now_number);
|
||||||
if (now_number == 0) {
|
if (now_number == 0) {
|
||||||
now_number = 1;
|
throw new BadRequestException("当前叠盘架:" + dto.getStart_device_code() + "叠盘数为0!");
|
||||||
}
|
}
|
||||||
//判断从第几层取
|
//判断从第几层取
|
||||||
int i = now_number - now_need_emptypallet_num - emptyNum + 1;
|
int i = now_number - now_need_emptypallet_num - emptyNum + 1;
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "该任务需要从第:" + i + "层取,即当前叠盘架上空托盘数量" + now_number + "-当前任务需要搬运的托盘数量" + now_need_emptypallet_num + "-已经生成指令的同一起点的托盘数量" + emptyNum + "+ 1");
|
||||||
if (i <= 0) {
|
if (i <= 0) {
|
||||||
throw new BadRequestException("当前叠盘架:" + dto.getStart_device_code() + "叠盘数为0!");
|
throw new BadRequestException("当前叠盘架:" + dto.getStart_device_code() + "叠盘数为0!");
|
||||||
}
|
}
|
||||||
@@ -401,16 +409,22 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
dto.setStart_point_code(start_device_code + "." + i);
|
dto.setStart_point_code(start_device_code + "." + i);
|
||||||
}
|
}
|
||||||
if (nextdevice.getDeviceDriver() instanceof EmptyVehicleStackingPositionDeviceDriver) {
|
if (nextdevice.getDeviceDriver() instanceof EmptyVehicleStackingPositionDeviceDriver) {
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "开始创建放叠盘架指令~");
|
||||||
emptyVehicleStackingPositionDeviceDriver = (EmptyVehicleStackingPositionDeviceDriver) startdevice.getDeviceDriver();
|
emptyVehicleStackingPositionDeviceDriver = (EmptyVehicleStackingPositionDeviceDriver) startdevice.getDeviceDriver();
|
||||||
//已经生成指令得放空托盘数量
|
//已经生成指令得放空托盘数量
|
||||||
Integer emptyNum = taskService.queryEndNum(dto.getStart_device_code(), dto.getNext_device_code());
|
Integer emptyNum = taskService.queryEndNum(dto.getStart_device_code(), dto.getNext_device_code());
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "查询到同一终点任务已经生成指令的搬运托盘的数量为:" + emptyNum);
|
||||||
//当前任务放空托盘数量
|
//当前任务放空托盘数量
|
||||||
Integer now_need_emptypallet_num = Integer.parseInt(taskService.findByCode(dto.getTask_code()).getEmptypallet_num());
|
Integer now_need_emptypallet_num = Integer.parseInt(taskService.findByCode(dto.getTask_code()).getEmptypallet_num());
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "当前任务需要放空托盘数量:" + now_need_emptypallet_num);
|
||||||
//当前叠盘架有空托盘数量
|
//当前叠盘架有空托盘数量
|
||||||
int now_number = emptyVehicleStackingPositionDeviceDriver.getNumber();
|
int now_number = emptyVehicleStackingPositionDeviceDriver.getNumber();
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "当前放叠盘架上空托盘数量为:" + now_number);
|
||||||
int i = now_number + emptyNum + 1;
|
int i = now_number + emptyNum + 1;
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "该任务需要从第:" + i + "层放,即当前叠盘架上空托盘数量" + now_number + "-已经生成指令的同一终点的托盘数量" + emptyNum + "+ 1");
|
||||||
//判断当前放叠盘架位置叠盘数量+已经生成指令的需要搬运的叠盘数量是否大于最大叠盘数量
|
//判断当前放叠盘架位置叠盘数量+已经生成指令的需要搬运的叠盘数量是否大于最大叠盘数量
|
||||||
if (i - 1 + now_need_emptypallet_num > 12) {
|
if (i - 1 + now_need_emptypallet_num > 12) {
|
||||||
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "该任务需要放的托盘数量加原有的托盘数量之和大于叠盘架最大数量!");
|
||||||
throw new BadRequestException("当前叠盘架:" + dto.getStart_device_code() + "超出最大叠盘数量!");
|
throw new BadRequestException("当前叠盘架:" + dto.getStart_device_code() + "超出最大叠盘数量!");
|
||||||
}
|
}
|
||||||
dto.setNext_device_code(next_device_code + "." + i);
|
dto.setNext_device_code(next_device_code + "." + i);
|
||||||
|
|||||||
@@ -26,4 +26,6 @@ public interface DeviceExecuteLogService {
|
|||||||
void acsToLms(String title, String requestUrl, String requestParam, String result);
|
void acsToLms(String title, String requestUrl, String requestParam, String result);
|
||||||
|
|
||||||
void lmsToAcs(String title, String requestType, String requestParam);
|
void lmsToAcs(String title, String requestType, String requestParam);
|
||||||
|
|
||||||
|
void createInstInfo(String title, String task_code, String start_device_code, String end_device_code, String message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,16 @@ public class DeviceExecuteLogServiceImpl implements DeviceExecuteLogService {
|
|||||||
MDC.remove("device_code_log");
|
MDC.remove("device_code_log");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createInstInfo(String title, String task_code, String start_device_code, String end_device_code, String message) {
|
||||||
|
try {
|
||||||
|
MDC.put("device_code_log", title);
|
||||||
|
log.info("日志主题:{},任务号:{},起始点位:{},终点点位:{},消息:{}", title, task_code, start_device_code, end_device_code, message);
|
||||||
|
} finally {
|
||||||
|
MDC.remove("device_code_log");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user