Browse Source

现场问题修复

master
psh 11 months ago
parent
commit
b4344185f1
  1. 2
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java
  2. 56
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java
  3. 16
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  4. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java
  5. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java
  6. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/MJXLTask.java
  7. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java

2
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java

@ -19,6 +19,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.system.service.param.ISysParamService; import org.nl.system.service.param.ISysParamService;
import org.nl.common.utils.CodeUtil; import org.nl.common.utils.CodeUtil;
import org.nl.config.SpringContextHolder; import org.nl.config.SpringContextHolder;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.HashMap;
@ -27,6 +28,7 @@ import java.util.Map;
@Slf4j @Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Lazy
public class NDCAgvServiceImpl implements NDCAgvService { public class NDCAgvServiceImpl implements NDCAgvService {
private final DeviceAppService deviceAppService; private final DeviceAppService deviceAppService;

56
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java

@ -1,12 +1,14 @@
package org.nl.acs.auto.run; package org.nl.acs.auto.run;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.acs.AcsConfig; import org.nl.acs.AcsConfig;
import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.agv.server.NDCAgvService;
import org.nl.acs.device.domain.Device; import org.nl.acs.device.domain.Device;
import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver; import org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_autodoor.StandardAutodoorDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.domain.Instruction;
@ -80,7 +82,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class);
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class);
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
TaskService taskService=SpringContextHolder.getBean(TaskService.class); TaskService taskService = SpringContextHolder.getBean(TaskService.class);
ip = paramService.findByCode(AcsConfig.AGVURL).getValue(); ip = paramService.findByCode(AcsConfig.AGVURL).getValue();
port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT).getValue()); port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT).getValue());
@ -147,10 +149,24 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno); log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno);
Device device = null; Device device = null;
String device_code = null; String device_code = null;
String old_device_code = null;
if (agvaddr != 0) {
old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
if (StrUtil.contains(old_device_code, "-")) {
String[] point = old_device_code.split("-");
device_code = point[0];
} else if (StrUtil.contains(old_device_code, ".")) {
String[] point = old_device_code.split("\\.");
device_code = point[0];
} else {
device_code = old_device_code;
}
device = deviceAppService.findDeviceByCode(device_code);
}
// //
AgvNdcOneDeviceDriver agvNdcOneDeviceDriver; AgvNdcOneDeviceDriver agvNdcOneDeviceDriver;
StandardAutodoorDeviceDriver standardAutodoorDeviceDriver;
//开始任务/上报订单号 //开始任务/上报订单号
if (phase == 0x01) { if (phase == 0x01) {
@ -177,10 +193,31 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
//(需要WCS反馈) //(需要WCS反馈)
else if (phase == 0x30) { else if (phase == 0x30) {
data = NDCAgvService.sendAgvOneModeInst(0x8F, index, 0, 0, 0, 0, 0); data = NDCAgvService.sendAgvOneModeInst(0x8F, index, 0, 0, 0, 0, 0);
} //进入区域
else if (phase == 0x50) {
//开门
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
standardAutodoorDeviceDriver.OpenOrClose("1");
if (standardAutodoorDeviceDriver.getAction() == 1) {
standardAutodoorDeviceDriver.OpenOrClose("1");
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
}
}
}
//离开区域
else if (phase == 0x51) {
//关门
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
standardAutodoorDeviceDriver.OpenOrClose("2");
if (standardAutodoorDeviceDriver.getAction() == 2) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
}
} }
//任务删除确认 //任务删除确认
//(需要WCS反馈) //(需要WCS反馈)
else if (phase == 0xFF) { }else if (phase == 0xFF) {
if (!ObjectUtil.isEmpty(inst)) { if (!ObjectUtil.isEmpty(inst)) {
if (!ObjectUtil.isEmpty(inst)) { if (!ObjectUtil.isEmpty(inst)) {
@ -216,15 +253,11 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} }
} catch (Exception e) { } catch (Exception e) {
System.out.println("Agv链接异常"); System.out.println("OneAgv链接异常");
log.info("Agv链接异常"); log.info("OneAgv链接异常");
log.error("agv连接出现异常:{}", e); log.error("agv连接出现异常:{}", e);
// logServer.deviceExecuteLog("1", "", "", "agv异常" + e.getMessage()); logServer.deviceExecuteLog("1", "", "", "agv异常" + e.getMessage());
// logServer.deviceExecuteLog("1", "", "", "agv异常" + e); logServer.deviceExecuteLog("1", "", "", "agv异常" + e);
// LuceneLogDto logDto = new LuceneLogDto();
// logDto.setContent("agv异常" + e.getMessage());
// logDto.setDevice_code("1001");
// luceneExecuteLogService.deviceExecuteLog(logDto);
if (ObjectUtil.isNotEmpty(s)) { if (ObjectUtil.isNotEmpty(s)) {
s.close(); s.close();
} }
@ -233,7 +266,6 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} finally { } finally {
} }
} }

16
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

@ -124,12 +124,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
StandardStorageDeviceDriver standardStorageDeviceDriver; StandardStorageDeviceDriver standardStorageDeviceDriver;
// //
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
TaskDto task=new TaskDto();
TaskDto task = taskService.findById(inst.getTask_id()); if (ObjectUtil.isNotEmpty(inst)) {
int start_height = ObjectUtil.isNotEmpty(task.getStart_height()) ? Integer.parseInt(task.getStart_height()) : 0; task = taskService.findById(inst.getTask_id());
int next_height = ObjectUtil.isNotEmpty(task.getNext_height()) ? Integer.parseInt(task.getNext_height()) : 0; }
String start_point = task.getStart_point_code();
String next_point = task.getNext_point_code();
//分配 车id //分配 车id
//(不需要WCS反馈) //(不需要WCS反馈)
@ -301,12 +299,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
agvaddr_copy = agvaddr; agvaddr_copy = agvaddr;
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data); logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
} else if (phase == 0x50) {//进入交通灯区域
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
} else if (phase == 0x51) {//离开交通灯区域
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
} }
if (!ObjectUtil.isEmpty(data)) { if (!ObjectUtil.isEmpty(data)) {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data); logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.system.service.logicflow.dao.Stage;
import org.nl.system.service.notice.ISysNoticeService; import org.nl.system.service.notice.ISysNoticeService;
import org.nl.system.service.param.ISysParamService; import org.nl.system.service.param.ISysParamService;
import org.nl.wms.database.material.service.IMdBaseMaterialService; import org.nl.wms.database.material.service.IMdBaseMaterialService;
@ -122,7 +123,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (ObjectUtil.isEmpty(taskId)) { if (ObjectUtil.isEmpty(taskId)) {
throw new BadRequestException("任务编码不能为空!"); throw new BadRequestException("任务编码不能为空!");
} }
SchBaseTask taskObj = taskService.getById(taskId); SchBaseTask taskObj = taskService.getOne(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getTask_code, taskId));
if (ObjectUtil.isEmpty(taskObj)) { if (ObjectUtil.isEmpty(taskObj)) {
throw new BadRequestException("未找到任务编码为 [" + taskId + "] 的任务"); throw new BadRequestException("未找到任务编码为 [" + taskId + "] 的任务");
} }

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java

@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.common.logging.annotation.Log; import org.nl.common.logging.annotation.Log;
import org.nl.wms.pda.service.PdaService; import org.nl.wms.pda.service.PdaService;
import org.nl.wms.pda.service.dao.vo.PdaResponseVo; import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -28,6 +29,7 @@ import javax.annotation.Resource;
@Api(tags = "手持接口") @Api(tags = "手持接口")
@RequestMapping("/api/pda") @RequestMapping("/api/pda")
@SaIgnore @SaIgnore
@Lazy
public class PdaController { public class PdaController {
@Resource @Resource

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/MJXLTask.java

@ -28,6 +28,7 @@ import org.nl.wms.sch.task_manage.task.core.TaskStatus;
import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper;
import org.nl.wms.util.PointUtils; import org.nl.wms.util.PointUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -42,6 +43,7 @@ import java.util.Map;
@Slf4j @Slf4j
@Component @Component
@TaskType("MJXLTask") @TaskType("MJXLTask")
@Lazy
public class MJXLTask extends AbstractTask { public class MJXLTask extends AbstractTask {
private static String TASK_CONFIG_CODE = "MJXLTask"; private static String TASK_CONFIG_CODE = "MJXLTask";
/** /**

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/ghs/GHSQHTask.java

@ -143,6 +143,10 @@ public class GHSQHTask extends AbstractTask {
task.setVehicle_qty(schBasePoint.getVehicle_qty()); task.setVehicle_qty(schBasePoint.getVehicle_qty());
task.setTask_status(TaskStatus.APPLY.getCode()); task.setTask_status(TaskStatus.APPLY.getCode());
task.setWorkshop_code(taskConfig.getWorkshop_code()); // 车间编码 task.setWorkshop_code(taskConfig.getWorkshop_code()); // 车间编码
//首位01或06生成任务需要补01,例如GHS0101下发需要改成GHS010101
if(task.getPoint_code1().endsWith("01")||task.getPoint_code1().endsWith("06")) {
task.setPoint_code1(task.getPoint_code1()+"01");
}
task.setPoint_code2(endPoint); task.setPoint_code2(endPoint);
task.setTask_status(TaskStatus.CREATED.getCode()); task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark(""); task.setRemark("");

Loading…
Cancel
Save