opt: 堆垛机驱动优化
This commit is contained in:
@@ -24,6 +24,7 @@ import org.nl.acs.device.service.dto.AcsDeviceErpmappingDto;
|
||||
import org.nl.acs.device.service.dto.DeviceErpmappingQueryParam;
|
||||
import org.nl.acs.device.service.mapper.DeviceErpmappingMapper;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.acs.utils.ConvertUtil;
|
||||
import org.nl.acs.utils.PageUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
|
||||
@@ -428,28 +428,25 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
String next_device_code = instruction.getNext_device_code();
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||
List<DeviceExtra> list = deviceExtraService.list(Wrappers.lambdaQuery(DeviceExtra.class).eq(DeviceExtra::getDevice_code, next_device_code));
|
||||
for (DeviceExtra deviceExtra : list) {
|
||||
if ("x".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) {
|
||||
map.put("to_x", deviceExtra.getExtra_value());
|
||||
}
|
||||
if ("z".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) {
|
||||
map.put("to_z", deviceExtra.getExtra_value());
|
||||
}
|
||||
if ("y".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) {
|
||||
map.put("to_y", deviceExtra.getExtra_value());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z")) && "z".equals(nextDevice.getExtraValue().get("z"))) {
|
||||
map.put("to_x", nextDevice.getExtraValue().get("z"));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("x")) && "x".equals(nextDevice.getExtraValue().get("x"))) {
|
||||
map.put("to_z", nextDevice.getExtraValue().get("x"));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("y")) && "y".equals(nextDevice.getExtraValue().get("y"))) {
|
||||
map.put("to_y", nextDevice.getExtraValue().get("y"));
|
||||
}
|
||||
}
|
||||
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.storage.name())) {
|
||||
map.put("to_y", inst.getFrom_z());
|
||||
if (inst.getFrom_x().length() > 1) {
|
||||
String substring = inst.getFrom_x().substring(1);
|
||||
map.put("to_y", inst.getTo_z());
|
||||
if (inst.getTo_x().length() > 1) {
|
||||
String substring = inst.getTo_x().substring(1);
|
||||
map.put("to_z", substring);
|
||||
} else {
|
||||
map.put("to_z", inst.getFrom_x());
|
||||
map.put("to_z", inst.getTo_x());
|
||||
}
|
||||
map.put("to_x", inst.getFrom_y());
|
||||
map.put("to_x", inst.getTo_y());
|
||||
}
|
||||
map.put("to_command", 2);
|
||||
requireSucess = true;
|
||||
@@ -620,17 +617,14 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
map.put("to_task", inst.getInstruction_code());
|
||||
|
||||
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||
List<DeviceExtra> list = deviceExtraService.list(Wrappers.lambdaQuery(DeviceExtra.class).eq(DeviceExtra::getDevice_code, start_device_code));
|
||||
for (DeviceExtra deviceExtra : list) {
|
||||
if ("x".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) {
|
||||
map.put("to_x", deviceExtra.getExtra_value());
|
||||
}
|
||||
if ("z".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) {
|
||||
map.put("to_z", deviceExtra.getExtra_value());
|
||||
}
|
||||
if ("y".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) {
|
||||
map.put("to_y", deviceExtra.getExtra_value());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("x")) && "x".equals(startDevice.getExtraValue().get("x"))) {
|
||||
map.put("to_x", startDevice.getExtraValue().get("x"));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z")) && "z".equals(startDevice.getExtraValue().get("z"))) {
|
||||
map.put("to_z", startDevice.getExtraValue().get("z"));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("y")) && "y".equals(startDevice.getExtraValue().get("y"))) {
|
||||
map.put("to_y", startDevice.getExtraValue().get("y"));
|
||||
}
|
||||
}
|
||||
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name())) {
|
||||
|
||||
@@ -452,7 +452,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(route)) {
|
||||
throw new BadRequestException(LangProcess.msg("error_isNull","route"));
|
||||
throw new BadRequestException(LangProcess.msg("error_isNull", "route"));
|
||||
}
|
||||
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||
@@ -559,7 +559,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(route)) {
|
||||
throw new BadRequestException(LangProcess.msg("error_isNull","route"));
|
||||
throw new BadRequestException(LangProcess.msg("error_isNull", "route"));
|
||||
}
|
||||
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||
@@ -753,7 +753,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
Device startdevice = appService.findDeviceByCode(entity.getStart_device_code());
|
||||
if (ObjectUtils.isEmpty(startdevice)) {
|
||||
log.debug("地址对应设备未找到");
|
||||
throw new BadRequestException(LangProcess.msg("error_isNull",entity.getStart_device_code()));
|
||||
throw new BadRequestException(LangProcess.msg("error_isNull", entity.getStart_device_code()));
|
||||
}
|
||||
if (instnextdevice.indexOf(".") != -1) {
|
||||
instnextdevice = instnextdevice.substring(0, instnextdevice.indexOf("."));
|
||||
@@ -761,7 +761,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
Device device = appService.findDeviceByCode(instnextdevice);
|
||||
if (device == null) {
|
||||
log.debug("地址对应设备未找到");
|
||||
throw new BadRequestException(LangProcess.msg("error_isNull",instnextdevice));
|
||||
throw new BadRequestException(LangProcess.msg("error_isNull", instnextdevice));
|
||||
}
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||
|
||||
@@ -773,7 +773,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
Device deviceByCode = deviceAppService.findDeviceByCode(start_device_code);
|
||||
if (deviceByCode == null) {
|
||||
log.debug("地址对应设备未找到");
|
||||
throw new BadRequestException(LangProcess.msg("error_isNull",start_device_code));
|
||||
throw new BadRequestException(LangProcess.msg("error_isNull", start_device_code));
|
||||
|
||||
}
|
||||
|
||||
@@ -1572,7 +1572,25 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
|
||||
@Override
|
||||
public List<Instruction> findByDeviceCodes(Instruction instruction1, Boolean flay) {
|
||||
if (ObjectUtil.isNull(instruction1)) {
|
||||
List<Instruction> instructionList = new ArrayList<>();
|
||||
for (Instruction instruction : instructions) {
|
||||
if (flay) {
|
||||
if (Integer.parseInt(instruction.getInstruction_status()) < 2) {
|
||||
instructionList.add(instruction);
|
||||
}
|
||||
} else {
|
||||
if (instruction.getInstruction_status().equals(instruction1.getInstruction_status())) {
|
||||
instructionList.add(instruction);
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotBlank(instruction.getStart_device_code()) && instruction.getStart_device_code().equals(instruction1.getStart_device_code())){
|
||||
instructionList.add(instruction);
|
||||
}
|
||||
if(StrUtil.isNotBlank(instruction.getNext_device_code()) && instruction.getNext_device_code().equals(instruction1.getNext_device_code())){
|
||||
instructionList.add(instruction);
|
||||
}
|
||||
}
|
||||
/*if (ObjectUtil.isNull(instruction1)) {
|
||||
return null;
|
||||
}
|
||||
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
||||
@@ -1584,7 +1602,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
wrapper.eq(StrUtil.isNotBlank(instruction1.getStart_device_code()), InstructionMybatis::getStart_device_code, instruction1.getStart_device_code());
|
||||
wrapper.eq(StrUtil.isNotBlank(instruction1.getNext_device_code()), InstructionMybatis::getNext_device_code, instruction1.getNext_device_code());
|
||||
List<InstructionMybatis> instructionMybatis = instructionMapper.selectList(wrapper);
|
||||
List<Instruction> instructions = ConvertUtil.convertList(instructionMybatis, Instruction.class);
|
||||
return instructions;
|
||||
List<Instruction> instructions = ConvertUtil.convertList(instructionMybatis, Instruction.class);*/
|
||||
return instructionList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.nl.acs.opc.service.dto.OpcDto;
|
||||
import org.nl.acs.opc.service.dto.OpcQueryParam;
|
||||
import org.nl.acs.opc.service.mapper.OpcMapper;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.nl.acs.route.service.dto.RouteLineDto;
|
||||
import org.nl.acs.route.service.dto.RouteLineQueryParam;
|
||||
import org.nl.acs.route.service.mapper.RouteLineMapper;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.dao.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.nl.acs.utils.ConvertUtil;
|
||||
import org.nl.common.utils.FileUtil;
|
||||
import org.nl.acs.utils.PageUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.nl.acs.utils.ConvertUtil;
|
||||
import org.nl.common.utils.FileUtil;
|
||||
import org.nl.acs.utils.PageUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.nl.acs.storage_cell.service.dto.StorageCellDto;
|
||||
import org.nl.acs.storage_cell.service.dto.StorageCellQueryParam;
|
||||
import org.nl.acs.storage_cell.service.mapper.StorageCellMapper;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.system.service.logicflow.IStageImageService;
|
||||
import org.nl.system.service.logicflow.dao.StageImage;
|
||||
import org.nl.system.service.logicflow.dao.mapper.StageImageMapper;
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.system.service.logicflow.IStageService;
|
||||
import org.nl.system.service.logicflow.dao.Stage;
|
||||
import org.nl.system.service.logicflow.dao.mapper.StageMapper;
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.MapOf;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.dao.Param;
|
||||
import org.nl.system.service.param.dao.mapper.SysParamMapper;
|
||||
|
||||
@@ -115,7 +115,7 @@ export default {
|
||||
standard_stacker,
|
||||
siemens_conveyor_labeling,
|
||||
siemens_conveyor,
|
||||
belt_conveyor,
|
||||
belt_conveyor
|
||||
// standard_station
|
||||
},
|
||||
dicts: ['device_type'],
|
||||
|
||||
Reference in New Issue
Block a user