getDictDetail(String code);
+
/**
* 添加字典明细
* @param resources
diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/dao/mapper/SysDictMapper.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/dao/mapper/SysDictMapper.java
index d83ff61..9231f22 100644
--- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/dao/mapper/SysDictMapper.java
+++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/dao/mapper/SysDictMapper.java
@@ -1,8 +1,11 @@
package org.nl.system.service.dict.dao.mapper;
+import org.apache.ibatis.annotations.Select;
import org.nl.system.service.dict.dao.Dict;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import java.util.List;
+
/**
*
* 字典表 Mapper 接口
@@ -13,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface SysDictMapper extends BaseMapper {
+ @Select("select dict_id,label,value from sys_dict_detail where dict_id = #{code}")
+ List getDictDetail(String code);
+
}
diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/impl/SysDictServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/impl/SysDictServiceImpl.java
index 5bd1845..b2605cf 100644
--- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/impl/SysDictServiceImpl.java
+++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/dict/impl/SysDictServiceImpl.java
@@ -124,6 +124,10 @@ public class SysDictServiceImpl extends ServiceImpl impleme
.ne(Dict::getLabel, ""));
return dictList;
}
+ @Override
+ public List getDictDetail(String code){
+ return sysDictMapper.getDictDetail(code);
+ }
@Override
@Transactional(rollbackFor = Exception.class)
@@ -189,9 +193,28 @@ public class SysDictServiceImpl extends ServiceImpl impleme
@Override
public List queryAll() {
return sysDictMapper.selectList(new QueryWrapper()
- .select("MAX(dict_id) AS dictId, code, name")
+ .select("MAX(dict_id) AS dict_id, code, name")
.lambda()
.groupBy(Dict::getCode, Dict::getName));
}
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void initDict(Dict dto) {
+ Dict dict = sysDictMapper.selectById(dto.getDict_id());
+ if (ObjectUtil.isEmpty(dict)) {
+ throw new BadRequestException("字典不存在");
+ }
+ String currentUserId = SecurityUtils.getCurrentUserId();
+ String currentNickName = SecurityUtils.getCurrentNickName();
+ dict.setValue("0");
+ dict.setPara2("");
+ dict.setPara3("充电桩空闲");
+ dict.setUpdate_id(currentUserId);
+ dict.setUpdate_name(currentNickName);
+ dict.setUpdate_time(DateUtil.now());
+ sysDictMapper.updateById(dict);
+ }
+
+
}
diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/param/ISysParamService.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/param/ISysParamService.java
index a10d971..6bbcd19 100644
--- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/param/ISysParamService.java
+++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/param/ISysParamService.java
@@ -60,4 +60,6 @@ public interface ISysParamService extends IService {
*/
/*@Cached(name = "paramDataCode.", key = "#code", expire = 3600, cacheType = CacheType.REMOTE)*/
Param findByCode(String code);
+
+ void setParam(Map whereJson);
}
diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/param/impl/SysParamServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/param/impl/SysParamServiceImpl.java
index 274e2d1..7f35c5c 100644
--- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/param/impl/SysParamServiceImpl.java
+++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/param/impl/SysParamServiceImpl.java
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
+import org.nl.acs.AcsConfig;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
@@ -98,4 +99,47 @@ public class SysParamServiceImpl extends ServiceImpl impl
Param param = paramMapper.selectOne(queryWrapper);
return param;
}
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void setParam(Map whereJson){
+ Integer electric = (Integer) whereJson.get("electric");
+ Integer electric2 = (Integer) whereJson.get("electric2");
+ String electric_begin = (String) whereJson.get("electric_begin");
+ String electric_end = (String) whereJson.get("electric_end");
+
+ String now_time = DateUtil.now();
+ //白班充电阈值
+ Param param_electric = this.findByCode(AcsConfig.ELECTRIC);
+ if (ObjectUtil.isEmpty(param_electric)) throw new BadRequestException("白班充电阈值参数异常");
+ param_electric.setValue(electric.toString());
+ param_electric.setUpdate_id(SecurityUtils.getCurrentUserId());
+ param_electric.setUpdate_name(SecurityUtils.getCurrentNickName());
+ param_electric.setUpdate_time(now_time);
+ paramMapper.updateById(param_electric);
+ //晚班充电阈值
+ Param param_electric2 = this.findByCode(AcsConfig.ELECTRIC2);
+ if (ObjectUtil.isEmpty(param_electric2)) throw new BadRequestException("晚班充电阈值参数异常");
+ param_electric2.setValue(electric2.toString());
+ param_electric2.setUpdate_id(SecurityUtils.getCurrentUserId());
+ param_electric2.setUpdate_name(SecurityUtils.getCurrentNickName());
+ param_electric2.setUpdate_time(now_time);
+ paramMapper.updateById(param_electric2);
+ //白班开始时间
+ Param param_electric_begin = this.findByCode(AcsConfig.ELECTRIC_BEGIN);
+ if (ObjectUtil.isEmpty(param_electric_begin)) throw new BadRequestException("白班开始时间参数异常");
+ param_electric_begin.setValue(electric_begin);
+ param_electric_begin.setUpdate_id(SecurityUtils.getCurrentUserId());
+ param_electric_begin.setUpdate_name(SecurityUtils.getCurrentNickName());
+ param_electric_begin.setUpdate_time(now_time);
+ paramMapper.updateById(param_electric_begin);
+ //白班结束时间
+ Param param_electric_end = this.findByCode(AcsConfig.ELECTRIC_END);
+ if (ObjectUtil.isEmpty(param_electric_end)) throw new BadRequestException("白班开始时间参数异常");
+ param_electric_end.setValue(electric_end);
+ param_electric_end.setUpdate_id(SecurityUtils.getCurrentUserId());
+ param_electric_end.setUpdate_name(SecurityUtils.getCurrentNickName());
+ param_electric_end.setUpdate_time(now_time);
+ paramMapper.updateById(param_electric_end);
+
+ }
}
diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java
index 4840af7..6e19f76 100644
--- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java
+++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java
@@ -15,24 +15,18 @@ import org.nl.acs.instruction.enums.InstructionStatusEnum;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.mapper.InstructionMapper;
import org.nl.acs.opc.DeviceAppService;
-import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.task.enums.TaskStatusEnum;
-import org.nl.acs.task.enums.TaskTypeEnum;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.common.utils.SecurityUtils;
-import org.nl.config.SpringContextHolder;
import org.nl.system.service.lucene.LuceneExecuteLogService;
import org.nl.system.service.lucene.dto.LuceneLogDto;
-import org.nl.system.service.lucene.impl.LuceneExecuteLogServiceImpl;
import org.nl.system.service.param.ISysParamService;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -60,14 +54,7 @@ public class AutoCreateInst {
RLock lock = redissonClient.getLock("autoGenInstructionLock");
boolean locked = false;
try {
- String maxPsnumber = paramService.findByCode(AcsConfig.MAXINSTNUMBER).getValue();
- String maxRtNumber = paramService.findByCode(AcsConfig.MAXRTINSTNUMBER).getValue();
- int maxPsInst = Integer.parseInt(maxPsnumber);
- int maxRtnst = Integer.parseInt(maxRtNumber);
- int rtInstNum = 0;
- int psInstNum = 0;
- long estimatedTime = (maxPsInst + maxRtnst) * 5L + 10;
- locked = lock.tryLock(0, estimatedTime, TimeUnit.SECONDS);
+ locked = lock.tryLock(0, TimeUnit.SECONDS);
if (!locked) {
//log.debug("未获取到分布式锁,跳过本次执行");
return;
@@ -77,24 +64,24 @@ public class AutoCreateInst {
if (CollectionUtils.isEmpty(list)) {
return;
}
- List pslist = list.stream().filter(r -> !"2".equals(r.getCar_type())).collect(Collectors.toList());
- List rtlist = list.stream().filter(r -> "2".equals(r.getCar_type())).collect(Collectors.toList());
+ String maxPsnumber = paramService.findByCode(AcsConfig.MAXINSTNUMBER).getValue();
+ String maxRtNumber = paramService.findByCode(AcsConfig.MAXRTINSTNUMBER).getValue();
+ int maxPsInst = Integer.parseInt(maxPsnumber);
+ int maxRtnst = Integer.parseInt(maxRtNumber);
+ int rtInstNum = 0;
+ int psInstNum = 0;
//已创建
List instructionList = new LambdaQueryChainWrapper<>(instructionMapper)
.lt(InstructionMybatis::getInstruction_status, InstructionStatusEnum.FINISHED.getIndex())
.list();
+ //2个车型各创建的任务数
if (ObjectUtil.isNotEmpty(instructionList)) {
rtInstNum = Math.toIntExact(instructionList.stream().filter(r -> "2".equals(r.getCar_type())).count());
psInstNum = instructionList.size() - rtInstNum;
}
- if (ObjectUtil.isNotEmpty(pslist)) {
- maxPsInst = Math.max(0, maxPsInst - psInstNum);
- createInstruction(pslist, maxPsInst);
- }
- if (ObjectUtil.isNotEmpty(rtlist)) {
- maxRtnst = Math.max(0, maxRtnst - rtInstNum);
- createInstruction(rtlist, maxRtnst);
- }
+ maxRtnst = Math.max(0, maxRtnst - rtInstNum);
+ maxPsInst = Math.max(0, maxPsInst - psInstNum);
+ createInstruction(list, maxPsInst, maxRtnst);
} catch (Exception e) {
log.error("自动生成指令异常", e);
} finally {
@@ -109,136 +96,64 @@ public class AutoCreateInst {
}
- private void createInstruction(List list, int maxNum) throws InterruptedException {
- int createdCount = 0;
- for (int i = 0; i < list.size(); i++) {
- //每次循环前检查本次已创建指令数是否达到上限
- if (createdCount >= maxNum) {
- break;
- }
- TaskDto acsTask = list.get(i);
- Boolean flag = false;
- String taskid = acsTask.getTask_id();
- String taskcode = acsTask.getTask_code();
- String task_type = acsTask.getTask_type();
- String vehiclecode = acsTask.getVehicle_code();
- String priority = acsTask.getPriority();
- String is_send = acsTask.getIs_send();
+ private void createInstruction(List list, int maxPsNum, int maxRtNum) throws InterruptedException {
+ int psCreatedCount = 0;
+ int rtCreatedCount = 0;
+ // 记录被阻断的起点,该起点上的后续任务一律不创建防止插
+ Set blockedPoints = new HashSet<>();
+ Iterator iterator = list.iterator();
+ while (iterator.hasNext()) {
+ TaskDto acsTask = iterator.next();
+ String car_type = acsTask.getCar_type();
+ // 判断是否为起点任务,NPE
String start_device_code = acsTask.getStart_device_code();
+ boolean isStartTask = start_device_code != null &&
+ (start_device_code.contains("BCPRK") || start_device_code.contains("CPRK"));
String start_point = null;
- if (start_device_code.contains("BCPRK")) {
- String[] parts = start_device_code.split("-", 2);
- start_point = parts[0];
- } else if (start_device_code.contains("CPRK")) {
- String[] parts = start_device_code.split("-", 2);
- start_point = parts[0];
+ if (isStartTask) {
+ start_point = start_device_code.split("-", 2)[0];
}
- if (start_point != null) {
- if (start_point.equals("CPRK1")) {
- List list1 = taskserver.queryAllByStatus("1");
- for (int j = 0; j < list1.size(); j++) {
- String start_device_code1 = list1.get(j).getStart_device_code();
- String[] parts = start_device_code1.split("-", 2);
- start_point = parts[0];
- if (start_point.equals("CPRK1")) {
- flag = true;
- }
- }
- } else if (start_point.equals("CPRK2")) {
- List list1 = taskserver.queryAllByStatus("1");
- for (int j = 0; j < list1.size(); j++) {
- String start_device_code1 = list1.get(j).getStart_device_code();
- String[] parts = start_device_code1.split("-", 2);
- start_point = parts[0];
- if (start_point.equals("CPRK2")) {
- flag = true;
- }
- }
- } else if (start_point.equals("CPRK3")) {
- List list1 = taskserver.queryAllByStatus("1");
- for (int j = 0; j < list1.size(); j++) {
- String start_device_code1 = list1.get(j).getStart_device_code();
- String[] parts = start_device_code1.split("-", 2);
- start_point = parts[0];
- if (start_point.equals("CPRK3")) {
- flag = true;
- }
- }
- } else if (start_point.equals("CPRK4")) {
- List list1 = taskserver.queryAllByStatus("1");
- for (int j = 0; j < list1.size(); j++) {
- String start_device_code1 = list1.get(j).getStart_device_code();
- String[] parts = start_device_code1.split("-", 2);
- start_point = parts[0];
- if (start_point.equals("CPRK4")) {
- flag = true;
- }
- }
- } else if (start_point.equals("CPRK5")) {
- List list1 = taskserver.queryAllByStatus("1");
- for (int j = 0; j < list1.size(); j++) {
- String start_device_code1 = list1.get(j).getStart_device_code();
- String[] parts = start_device_code1.split("-", 2);
- start_point = parts[0];
- if (start_point.equals("CPRK5")) {
- flag = true;
- }
- }
- } else if (start_point.equals("BCPRK1")) {
- List list1 = taskserver.queryAllByStatus("1");
- for (int j = 0; j < list1.size(); j++) {
- String start_device_code1 = list1.get(j).getStart_device_code();
- String[] parts = start_device_code1.split("-", 2);
- start_point = parts[0];
- if (start_point.equals("BCPRK1")) {
- flag = true;
- }
- }
- } else if (start_point.equals("BCPRK2")) {
- List list1 = taskserver.queryAllByStatus("1");
- for (int j = 0; j < list1.size(); j++) {
- String start_device_code1 = list1.get(j).getStart_device_code();
- String[] parts = start_device_code1.split("-", 2);
- start_point = parts[0];
- if (start_point.equals("BCPRK2")) {
- flag = true;
- }
- }
- } else if (start_point.equals("BCPRK3")) {
- List list1 = taskserver.queryAllByStatus("1");
- for (int j = 0; j < list1.size(); j++) {
- String start_device_code1 = list1.get(j).getStart_device_code();
- String[] parts = start_device_code1.split("-", 2);
- start_point = parts[0];
- if (start_point.equals("BCPRK3")) {
- flag = true;
- }
- }
- } else if (start_point.equals("BCPRK4")) {
- List list1 = taskserver.queryAllByStatus("1");
- for (int j = 0; j < list1.size(); j++) {
- String start_device_code1 = list1.get(j).getStart_device_code();
- String[] parts = start_device_code1.split("-", 2);
- start_point = parts[0];
- if (start_point.equals("BCPRK4")) {
- flag = true;
- }
- }
- } else if (start_point.equals("BCPRK5")) {
- List list1 = taskserver.queryAllByStatus("1");
- for (int j = 0; j < list1.size(); j++) {
- String start_device_code1 = list1.get(j).getStart_device_code();
- String[] parts = start_device_code1.split("-", 2);
- start_point = parts[0];
- if (start_point.equals("BCPRK5")) {
- flag = true;
- }
- }
- }
- }
- if (flag) {
+ //如果当前起点已被阻断,直接移除任务并跳过
+ if (isStartTask && blockedPoints.contains(start_point)) {
+ iterator.remove();
continue;
}
+ //型上限检查
+ boolean reachLimit = false;
+ if ("2".equals(car_type) && rtCreatedCount >= maxRtNum) {
+ reachLimit = true;
+ } else if (!"2".equals(car_type) && psCreatedCount >= maxPsNum) {
+ reachLimit = true;
+ }
+ if (reachLimit) {
+ iterator.remove();
+ if (isStartTask) {
+ blockedPoints.add(start_point);
+ }
+ continue;
+ }
+ if (StrUtil.equals(acsTask.getIs_send(), "0")) {
+ iterator.remove();
+ if (isStartTask) {
+ blockedPoints.add(start_point);
+ }
+ continue;
+ }
+ List activeInstructions = new LambdaQueryChainWrapper<>(instructionMapper)
+ .lt(InstructionMybatis::getInstruction_status, InstructionStatusEnum.FINISHED.getIndex())
+ .eq(InstructionMybatis::getIs_delete, "0")
+ .list();
+ //起点重复检查
+ if (isStartTask && checkinsList(activeInstructions, start_point)) {
+ blockedPoints.add(start_point);
+ iterator.remove();
+ continue;
+ }
+ String taskid = acsTask.getTask_id();
+ String taskcode = acsTask.getTask_code();
+ String vehiclecode = acsTask.getVehicle_code();
+ String priority = acsTask.getPriority();
+ String task_type = acsTask.getTask_type();
String start_point_code = acsTask.getStart_point_code();
String put_device_code = acsTask.getPut_device_code();
String put_point_code = acsTask.getPut_point_code();
@@ -249,11 +164,7 @@ public class AutoCreateInst {
String agv_system_type = acsTask.getAgv_system_type();
String start_height = acsTask.getStart_height();
String next_height = acsTask.getNext_height();
- String car_type = acsTask.getCar_type();
String car_width = acsTask.getCar_width();
- if (StrUtil.equals(is_send, "0")) {
- continue;
- }
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
} else {
@@ -287,6 +198,7 @@ public class AutoCreateInst {
instdto.setAgv_system_type(agv_system_type);
instdto.setStart_height(start_height);
instdto.setNext_height(next_height);
+ instdto.setRemark(acsTask.getRemark());
try {
instructionService.create(instdto);
} catch (Exception e) {
@@ -300,152 +212,31 @@ public class AutoCreateInst {
luceneExecuteLogService.deviceExecuteLog(logDto);
continue;
}
- TimeUnit.SECONDS.sleep(5);
//创建指令后修改任务状态
acsTask.setTask_status(TaskStatusEnum.BUSY.getIndex());
acsTask.setUpdate_time(DateUtil.now());
taskserver.update(acsTask);
log.info("自动生成指令成功: {},{}", DateUtil.now(), acsTask.getTask_code());
- createdCount++;
- }
- }
-
-
- /**
- * 根据任务状态创建指令、生成下一条指令
- */
- public void run1() throws Exception {
- //log.info("自动生成指令开始: {}", DateUtil.now());
- RLock lock = redissonClient.getLock("autoGenInstructionLock");
- boolean locked = false;
- try {
- locked = lock.tryLock(0, 5, TimeUnit.SECONDS); // 不等待,锁持有5秒自动释放
- if (!locked) {
- //log.debug("未获取到分布式锁,跳过本次执行");
- return;
- }
- TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
- InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
- DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
- LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogServiceImpl.class);
- //按优先级降序task_code升序
- List list = taskserver.queryAllByStatus("0");
- if (CollectionUtils.isEmpty(list)) {
- return;
- }
- Set busyStartPoints = taskserver.queryAllByStatus("1").stream()
- .map(t -> extractStartPoint(t.getStart_device_code()))
- .filter(Objects::nonNull)
- .collect(Collectors.toSet());
- for (TaskDto acsTask : list) {
- if (isNonBlockingTaskType(acsTask)) {
- continue; // AGV/Truss且不以"-"开头,跳过,继续看下一个
- }
- if (StrUtil.equals(acsTask.getIs_send(), "0")) {
- break;
- }
- //起始点冲突(同一起点已有执行中任务)
- String startPoint = extractStartPoint(acsTask.getStart_device_code());
- if (startPoint != null && busyStartPoints.contains(startPoint)) {
- break;
- }
- try {
- createInstruction(acsTask, appService, instructionService, taskserver);
- } catch (Exception e) {
- acsTask.setRemark(e.getMessage());
- taskserver.updateByCodeFromCache(acsTask);
- LuceneLogDto logDto = LuceneLogDto.builder()
- .device_code("定时创建指令失败")
- .content(e.getMessage())
- .build();
- logDto.setLog_level(2);
- luceneExecuteLogService.deviceExecuteLog(logDto);
- break;
- }
- break;
- }
- } catch (Exception e) {
- log.error("自动生成指令异常", e);
- } finally {
- if (locked && lock.isHeldByCurrentThread()) {
- try {
- lock.unlock();
- } catch (Exception e) {
- log.error("释放分布式锁异常", e);
- }
+ if ("2".equals(car_type)) {
+ rtCreatedCount++;
+ } else {
+ psCreatedCount++;
}
+ TimeUnit.SECONDS.sleep(1);
}
}
- /**
- * 判断是否属于无需生成指令的任务类型
- */
- private boolean isNonBlockingTaskType(TaskDto acsTask) {
- String taskType = acsTask.getTask_type();
- String taskCode = acsTask.getTask_code();
- boolean isAgv = StrUtil.equals(taskType, TaskTypeEnum.AGV_Task.getIndex())
- && !StrUtil.startWith(taskCode, "-");
- boolean isTruss = StrUtil.equals(taskType, TaskTypeEnum.Truss_Task.getIndex())
- && !StrUtil.startWith(taskCode, "-");
- return isAgv || isTruss;
+ private boolean checkinsList(List instructList, String targetPoint) {
+ if (instructList == null || targetPoint == null) {
+ return false;
+ }
+ return instructList.stream().anyMatch(r -> {
+ String code = r.getStart_device_code();
+ if (code == null) return false;
+ String[] parts = code.split("-", 2);
+ return targetPoint.equals(parts[0]);
+ });
}
- /**
- * 从设备编码中提取起点区域CPRK1, BCPRK2
- */
- private String extractStartPoint(String startDeviceCode) {
- if (startDeviceCode == null) {
- return null;
- }
- if (startDeviceCode.contains("BCPRK") || startDeviceCode.contains("CPRK")) {
- return startDeviceCode.split("-")[0];
- }
- return null;
- }
- /**
- * 封装指令创建与任务状态更新
- */
- private void createInstruction(TaskDto acsTask, DeviceAppService appService,
- InstructionService instructionService, TaskService taskserver) throws Exception {
- String next_device_code = acsTask.getNext_device_code();
- String next_point_code;
- if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
- next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
- } else {
- next_point_code = next_device_code;
- }
- Instruction instdto = new Instruction();
- instdto.setInstruction_type(acsTask.getTask_type());
- instdto.setInstruction_id(IdUtil.simpleUUID());
- instdto.setRoute_plan_code(acsTask.getRoute_plan_code());
- instdto.setRemark(acsTask.getRemark());
- instdto.setMaterial(acsTask.getMaterial());
- instdto.setQuantity(acsTask.getQuantity());
- instdto.setTask_id(acsTask.getTask_id());
- instdto.setTask_code(acsTask.getTask_code());
- instdto.setVehicle_code(acsTask.getVehicle_code());
- instdto.setCreate_time(DateUtil.now());
- instdto.setCreate_by(SecurityUtils.getCurrentNickName());
- instdto.setStart_device_code(acsTask.getStart_point_code());
- instdto.setStart_point_code(acsTask.getStart_point_code());
- instdto.setPut_device_code(acsTask.getPut_device_code());
- instdto.setPut_point_code(acsTask.getPut_point_code());
- instdto.setNext_device_code(next_device_code);
- instdto.setNext_point_code(next_point_code);
- instdto.setCar_type(acsTask.getCar_type());
- instdto.setCar_width(acsTask.getCar_width());
- instdto.setPriority(acsTask.getPriority());
- instdto.setInstruction_status(InstructionStatusEnum.READY.getIndex());
- instdto.setExecute_device_code(acsTask.getStart_point_code());
- instdto.setVehicle_type(acsTask.getVehicle_type());
- instdto.setAgv_system_type(acsTask.getAgv_system_type());
- instdto.setStart_height(acsTask.getStart_height());
- instdto.setNext_height(acsTask.getNext_height());
- instructionService.create(instdto);
- // 更新任务状态为执行中
- acsTask.setTask_status(TaskStatusEnum.BUSY.getIndex());
- acsTask.setUpdate_time(DateUtil.now());
- taskserver.update(acsTask);
- }
}
diff --git a/acs/nladmin-ui/src/router/routers.js b/acs/nladmin-ui/src/router/routers.js
index d516b9c..627f253 100644
--- a/acs/nladmin-ui/src/router/routers.js
+++ b/acs/nladmin-ui/src/router/routers.js
@@ -71,6 +71,19 @@ export const constantRouterMap = [
meta: { title: i18n.t('auto.common.Personal_center') }
}
]
+ },
+ {
+ path: '/acs/history/taskRecord',
+ component: Layout,
+ hidden: true,
+ children: [
+ {
+ path: '',
+ component: (resolve) => require(['@/views/acs/history/taskRecord/index'], resolve),
+ name: 'TaskRecord',
+ meta: { title: '任务历史记录' }
+ }
+ ]
}
]
diff --git a/acs/nladmin-ui/src/views/acs/history/taskRecord/index.vue b/acs/nladmin-ui/src/views/acs/history/taskRecord/index.vue
index 64796a3..8ea2652 100644
--- a/acs/nladmin-ui/src/views/acs/history/taskRecord/index.vue
+++ b/acs/nladmin-ui/src/views/acs/history/taskRecord/index.vue
@@ -475,6 +475,27 @@ export default {
}
},
created() {
+ // 处理从任务统计页面跳转过来的查询参数
+ const { startPoint, endPoint, timeIndex, car_no, createTime, end_time, ...rest } = this.$route.query
+ if (startPoint) {
+ this.$set(this.crud.query, 'start_point_code', startPoint)
+ }
+ if (endPoint) {
+ this.$set(this.crud.query, 'next_point_code', endPoint)
+ }
+ if (timeIndex) {
+ this.$set(this.crud.query, 'timeIndex', timeIndex)
+ }
+ if (car_no) {
+ this.$set(this.crud.query, 'car_no', car_no)
+ }
+ // 处理日期范围参数 - 使用数组格式 [开始时间, 结束时间]
+ if (createTime && end_time) {
+ this.$set(this.crud.query, 'createTime', [createTime, end_time])
+ }
+ // 合并其他查询参数
+ Object.assign(this.crud.query, rest)
+
deviceCrud.selectDeviceList().then(data => {
this.deviceList = data
})
@@ -484,6 +505,12 @@ export default {
getDicts().then(data => {
this.dicts = data
})
+ // 如果有从任务统计页面跳转过来的查询参数,自动刷新查询
+ if (startPoint || endPoint || timeIndex || car_no || createTime) {
+ this.$nextTick(() => {
+ this.crud.toQuery()
+ })
+ }
},
methods: {
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
@@ -526,6 +553,10 @@ export default {
material_type: this.crud.query.material_type,
status: this.crud.query.status,
point_code: this.crud.query.point_code,
+ start_point_code: this.crud.query.start_point_code,
+ next_point_code: this.crud.query.next_point_code,
+ car_no: this.crud.query.car_no,
+ timeIndex: this.crud.query.timeIndex,
createTime: formatDateTime(timeRange[0]),
end_time: formatDateTime(timeRange[1])
}
diff --git a/acs/nladmin-ui/src/views/acs/history/taskSheet/index.vue b/acs/nladmin-ui/src/views/acs/history/taskSheet/index.vue
index 257364b..1aeae17 100644
--- a/acs/nladmin-ui/src/views/acs/history/taskSheet/index.vue
+++ b/acs/nladmin-ui/src/views/acs/history/taskSheet/index.vue
@@ -35,10 +35,26 @@
>
-
-
-
-
+
+
+ {{ row.item1 }}
+
+
+
+
+ {{ row.item2 }}
+
+
+
+
+ {{ row.item3 }}
+
+
+
+
+ {{ row.item4 }}
+
+
@@ -55,10 +71,48 @@
>
-
-
-
-
+
+
+ {{ row.item1 }}
+
+
+
+
+ {{ row.item2 }}
+
+
+
+
+ {{ row.item3 }}
+
+
+
+
+ {{ row.item4 }}
+
+
+
+
+
+
+
@@ -75,18 +129,20 @@ export default {
query: {
dateRange: []
},
- // 入库数据
+ // 入库数据 (AA->AB/AD/AC)
inboundData: [
- { startPoint: 'AA/缓存区', endPoint: 'AB', item1: '', item2: '', item3: '', item4: '' },
- { startPoint: 'AA/缓存区', endPoint: 'AD', item1: '', item2: '', item3: '', item4: '' },
- { startPoint: 'AA/缓存区', endPoint: 'AC', item1: '', item2: '', item3: '', item4: '' }
+ { startPoint: 'AA', endPoint: 'AB', item1: '', item2: '', item3: '', item4: '', item1Key: '', item2Key: '', item3Key: '', item4Key: '' },
+ { startPoint: 'AA', endPoint: 'AD', item1: '', item2: '', item3: '', item4: '', item1Key: '', item2Key: '', item3Key: '', item4Key: '' },
+ { startPoint: 'AA', endPoint: 'AC', item1: '', item2: '', item3: '', item4: '', item1Key: '', item2Key: '', item3Key: '', item4Key: '' }
],
- // 出库数据
+ // 出库数据 (AB/AD/AC->AA)
outboundData: [
- { startPoint: 'AB', endPoint: 'AA/缓存区', item1: '', item2: '', item3: '', item4: '' },
- { startPoint: 'AD', endPoint: 'AA/缓存区', item1: '', item2: '', item3: '', item4: '' },
- { startPoint: 'AC', endPoint: 'AA/缓存区', item1: '', item2: '', item3: '', item4: '' }
- ]
+ { startPoint: 'AB', endPoint: 'AA', item1: '', item2: '', item3: '', item4: '', item1Key: '', item2Key: '', item3Key: '', item4Key: '' },
+ { startPoint: 'AD', endPoint: 'AA', item1: '', item2: '', item3: '', item4: '', item1Key: '', item2Key: '', item3Key: '', item4Key: '' },
+ { startPoint: 'AC', endPoint: 'AA', item1: '', item2: '', item3: '', item4: '', item1Key: '', item2Key: '', item3Key: '', item4Key: '' }
+ ],
+ // 稼动率数据 (动态从后端获取)
+ carData: []
}
},
mounted() {
@@ -101,27 +157,173 @@ export default {
}
queryTaskSheet(params).then(res => {
if (res) {
- this.fillData(res)
+ this.fillData(res[0])
}
})
},
fillData(data) {
- // 入库数据填充 (item1-item12)
+ // 入库数据填充 (AA-AB-X-Y, AA-AD-X-Y, AA-AC-X-Y)
for (let i = 0; i < 3; i++) {
- const baseIndex = i * 4
- this.inboundData[i].item1 = data[0][`item${baseIndex + 1}`] ? data[0][`item${baseIndex + 1}`] + '%' : '0%'
- this.inboundData[i].item2 = data[0][`item${baseIndex + 2}`] ? data[0][`item${baseIndex + 2}`] + '%' : '0%'
- this.inboundData[i].item3 = data[0][`item${baseIndex + 3}`] ? data[0][`item${baseIndex + 3}`] + '%' : '0%'
- this.inboundData[i].item4 = data[0][`item${baseIndex + 4}`] ? data[0][`item${baseIndex + 4}`] + '%' : '0%'
+ const start = this.inboundData[i].startPoint
+ const end = this.inboundData[i].endPoint
+
+ // 时间段1-3分钟 (timeIndex=1)
+ this.inboundData[i].item1Key = `${start}-${end}-1`
+ this.inboundData[i].item1 = this.getValue(data, start, end, 1)
+
+ // 时间段3-5分钟 (timeIndex=2)
+ this.inboundData[i].item2Key = `${start}-${end}-2`
+ this.inboundData[i].item2 = this.getValue(data, start, end, 2)
+
+ // 时间段5-8分钟 (timeIndex=3)
+ this.inboundData[i].item3Key = `${start}-${end}-3`
+ this.inboundData[i].item3 = this.getValue(data, start, end, 3)
+
+ // 时间段8分钟以上 (timeIndex=4)
+ this.inboundData[i].item4Key = `${start}-${end}-4`
+ this.inboundData[i].item4 = this.getValue(data, start, end, 4)
}
- // 出库数据填充 (item13-item24)
+
+ // 出库数据填充 (AB-AA-X-Y, AD-AA-X-Y, AC-AA-X-Y)
for (let i = 0; i < 3; i++) {
- const baseIndex = 12 + i * 4
- this.outboundData[i].item1 = data[0][`item${baseIndex + 1}`] ? data[0][`item${baseIndex + 1}`] + '%' : '0%'
- this.outboundData[i].item2 = data[0][`item${baseIndex + 2}`] ? data[0][`item${baseIndex + 2}`] + '%' : '0%'
- this.outboundData[i].item3 = data[0][`item${baseIndex + 3}`] ? data[0][`item${baseIndex + 3}`] + '%' : '0%'
- this.outboundData[i].item4 = data[0][`item${baseIndex + 4}`] ? data[0][`item${baseIndex + 4}`] + '%' : '0%'
+ const start = this.outboundData[i].startPoint
+ const end = this.outboundData[i].endPoint
+
+ this.outboundData[i].item1Key = `${start}-${end}-1`
+ this.outboundData[i].item1 = this.getValue(data, start, end, 1)
+
+ this.outboundData[i].item2Key = `${start}-${end}-2`
+ this.outboundData[i].item2 = this.getValue(data, start, end, 2)
+
+ this.outboundData[i].item3Key = `${start}-${end}-3`
+ this.outboundData[i].item3 = this.getValue(data, start, end, 3)
+
+ this.outboundData[i].item4Key = `${start}-${end}-4`
+ this.outboundData[i].item4 = this.getValue(data, start, end, 4)
}
+
+ // 稼动率数据填充 (car-X-Y)
+ this.fillCarData(data)
+ },
+ // 填充稼动率数据
+ fillCarData(data) {
+ const carData = []
+ // 后端格式: car-{车辆号}-{列号},如 car-2-1 表示车辆2的第1列(车辆编号)
+ const carMap = new Map()
+
+ Object.keys(data).forEach(key => {
+ if (key.startsWith('car-')) {
+ const parts = key.split('-')
+ if (parts.length >= 3) {
+ const carNo = parts[1]
+ const colIndex = parseInt(parts[2])
+ if (!carMap.has(carNo)) {
+ carMap.set(carNo, {})
+ }
+ carMap.get(carNo)[colIndex] = data[key]
+ }
+ }
+ })
+
+ // 按车辆编号排序并构建数据
+ const sortedCarNos = Array.from(carMap.keys()).sort((a, b) => parseInt(a) - parseInt(b))
+
+ sortedCarNos.forEach(carNo => {
+ const carInfo = carMap.get(carNo)
+ // 列1: 车辆编号, 列2: 实际运行总时长, 列3: 标准工作时间, 列4: 总任务数, 列5: 稼动率, 列6: 平均耗时
+ carData.push({
+ carNo: carInfo[1] || carNo, // 车辆编号
+ actualTime: carInfo[2] || '0', // 实际运行总时长
+ standardTime: carInfo[3] || '0', // 标准工作时间
+ totalTasks: carInfo[4] || '0', // 总任务数
+ utilizationRate: carInfo[5] ? carInfo[5] + '%' : '0%', // 稼动率
+ avgTime: carInfo[6] || '0' // 平均耗时
+ })
+ })
+
+ this.carData = carData
+ },
+ // 获取百分比值
+ getValue(data, start, end, timeIndex) {
+ // 查找匹配的key,格式: start-end-timeIndex-index
+ for (let index = 1; index <= 30; index++) {
+ const key = `${start}-${end}-${timeIndex}-${index}`
+ if (data[key] !== undefined) {
+ return data[key] + '%'
+ }
+ }
+ return '0%'
+ },
+ // 获取日期范围参数
+ getDateRangeParams() {
+ let startDate, endDate
+ if (this.query.dateRange && this.query.dateRange.length === 2) {
+ startDate = this.query.dateRange[0]
+ endDate = this.query.dateRange[1]
+ } else {
+ // 如果没有选择日期范围,使用今天日期
+ const today = new Date()
+ const year = today.getFullYear()
+ const month = String(today.getMonth() + 1).padStart(2, '0')
+ const day = String(today.getDate()).padStart(2, '0')
+ startDate = `${year}-${month}-${day}`
+ endDate = startDate
+ }
+ return {
+ createTime: `${startDate} 00:00:00`,
+ end_time: `${endDate} 23:59:59`
+ }
+ },
+ // 点击百分比跳转到任务历史记录页面
+ handleClick(key, value) {
+ if (!key || value === '0%') {
+ return
+ }
+ // 解析key,如 "AA-AB-1" 或 "car-1"
+ const parts = key.split('-')
+ const query = {}
+
+ if (parts.length >= 3) {
+ // 格式: AA-AB-1-X 或 car-1-X
+ if (parts[0] === 'car') {
+ // car-1-X 格式 -> car_type=1
+ query.car_no = parts[1]
+ } else {
+ // AA-AB-1-X 格式 -> startPoint=AA, endPoint=AB, timeIndex=1
+ query.startPoint = parts[0]
+ query.endPoint = parts[1]
+ query.timeIndex = parts[2]
+ }
+ }
+
+ // 添加日期范围参数
+ const dateParams = this.getDateRangeParams()
+ query.createTime = dateParams.createTime
+ query.end_time = dateParams.end_time
+
+ // 跳转到任务历史记录页面
+ this.$router.push({
+ path: '/acs/history/taskRecord',
+ query: query
+ })
+ },
+ // 点击车辆跳转到任务历史记录页面
+ handleCarClick(carNo) {
+ if (!carNo) {
+ return
+ }
+ // 构建查询参数
+ const query = { car_no: carNo }
+ // 添加日期范围参数
+ const dateParams = this.getDateRangeParams()
+ query.createTime = dateParams.createTime
+ query.end_time = dateParams.end_time
+
+ // 跳转到任务历史记录页面
+ this.$router.push({
+ path: '/acs/history/taskRecord',
+ query: query
+ })
},
// 导出所有表格
exportAll() {
@@ -132,44 +334,33 @@ export default {
const data = []
// 添加入库统计数据
- data.push(['入库统计']) // 添加入库统计标题
- data.push(header) // 添加表头
+ data.push(['入库统计'])
+ data.push(header)
this.inboundData.forEach(item => {
- data.push([
- item.startPoint,
- item.endPoint,
- item.item1,
- item.item2,
- item.item3,
- item.item4
- ])
+ data.push([item.startPoint, item.endPoint, item.item1, item.item2, item.item3, item.item4])
})
- data.push([]) // 空行分隔
+ data.push([])
// 添加出库统计数据
- data.push(['出库统计']) // 添加出库统计标题
- data.push(header) // 添加表头
+ data.push(['出库统计'])
+ data.push(header)
this.outboundData.forEach(item => {
- data.push([
- item.startPoint,
- item.endPoint,
- item.item1,
- item.item2,
- item.item3,
- item.item4
- ])
+ data.push([item.startPoint, item.endPoint, item.item1, item.item2, item.item3, item.item4])
+ })
+ data.push([])
+
+ // 添加稼动率统计数据
+ data.push(['稼动率统计'])
+ data.push(['车辆', '实际运行总时长', '标准工作时间', '总任务数', '稼动率', '平均耗时'])
+ this.carData.forEach(item => {
+ data.push([item.carNo, item.actualTime, item.standardTime, item.totalTasks, item.utilizationRate, item.avgTime])
})
const worksheet = XLSX.utils.aoa_to_sheet(data)
// 设置列宽
worksheet['!cols'] = [
- { wch: 15 },
- { wch: 15 },
- { wch: 12 },
- { wch: 12 },
- { wch: 12 },
- { wch: 15 }
+ { wch: 15 }, { wch: 15 }, { wch: 12 }, { wch: 12 }, { wch: 12 }, { wch: 15 }
]
// 设置样式
@@ -180,16 +371,13 @@ export default {
const cellAddress = XLSX.utils.encode_cell({ r: R, c: C })
if (!worksheet[cellAddress]) continue
- // 设置"入库统计"和"出库统计"标题样式(第1行和第6行)
if (R === 0 || R === 5) {
worksheet[cellAddress].s = {
fill: { fgColor: { rgb: "FFFFFF" } },
font: { bold: true, sz: 14 },
alignment: { horizontal: "center", vertical: "center" }
}
- }
- // 设置表头样式(第2行和第7行)
- else if (R === 1 || R === 6) {
+ } else if (R === 1 || R === 6) {
worksheet[cellAddress].s = {
fill: { fgColor: { rgb: "F5F7FA" } },
font: { bold: true },
@@ -200,10 +388,8 @@ export default {
}
}
- // 添加工作表到工作簿
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1')
- // 生成文件名
let filename = '任务统计'
if (this.query.dateRange && this.query.dateRange.length === 2) {
filename = `${filename}_${this.query.dateRange[0]}至${this.query.dateRange[1]}`
@@ -215,7 +401,6 @@ export default {
// 入库表格合并方法 - 合并起点列
inboundSpanMethod({ rowIndex, columnIndex }) {
if (columnIndex === 0) {
- // 起点列,第一行合并3行
if (rowIndex === 0) {
return { rowspan: 3, colspan: 1 }
} else {
@@ -226,7 +411,6 @@ export default {
// 出库表格合并方法 - 合并终点列
outboundSpanMethod({ rowIndex, columnIndex }) {
if (columnIndex === 1) {
- // 终点列,第一行合并3行
if (rowIndex === 0) {
return { rowspan: 3, colspan: 1 }
} else {
@@ -241,14 +425,18 @@ export default {
return {}
},
headerCellStyle({ columnIndex }) {
- // 时间列头背景色: 5-8分钟黄色, 8分钟以上红色
if (columnIndex === 4) {
return { backgroundColor: '#ffff00', color: '#000' }
} else if (columnIndex === 5) {
return { backgroundColor: '#f46262', color: '#000' }
}
return { backgroundColor: '#f5f7fa', color: '#000' }
- }
+ },
+ // 稼动率表格表头样式(普通颜色,无黄红标记)
+ carHeaderCellStyle() {
+ return { backgroundColor: '#f5f7fa', color: '#000' }
+ },
+ // 点击车辆跳转到任务历史记录页面
}
}
@@ -263,4 +451,12 @@ export default {
text-align: center;
margin-bottom: 15px;
}
+.clickable-link {
+ color: #409EFF;
+ cursor: pointer;
+ text-decoration: underline;
+}
+.clickable-link:hover {
+ color: #66b1ff;
+}
diff --git a/acs/nladmin-ui/src/views/system/param/index.vue b/acs/nladmin-ui/src/views/system/param/index.vue
index fb183fe..e5cd28a 100644
--- a/acs/nladmin-ui/src/views/system/param/index.vue
+++ b/acs/nladmin-ui/src/views/system/param/index.vue
@@ -4,6 +4,26 @@
+
+
@@ -67,7 +89,8 @@ import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
-
+import TubeDialog2 from '@/views/system/param/tubeDialog2.vue'
+import StationDialog from '@/views/system/param/stationDialog.vue'
const defaultForm = {
id: null,
code: null,
@@ -78,7 +101,7 @@ const defaultForm = {
}
export default {
name: 'Param',
- components: { pagination, crudOperation, udOperation },
+ components: { pagination, crudOperation, udOperation, TubeDialog2, StationDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({ title: 'menu.table_title.SystemParam', url: 'api/param', idField: 'id', sort: 'id,desc', crudMethod: { ...crudParam },
@@ -98,7 +121,8 @@ export default {
edit: ['admin', 'param:edit'],
del: ['admin', 'param:del']
},
-
+ showView2: false,
+ showStation: false,
rules: {
id: [
{ required: true, message: this.$t('SysParam.rules.NotNull'), trigger: 'blur' }
@@ -130,6 +154,12 @@ export default {
[CRUD.HOOK.beforeRefresh]() {
return true
},
+ divOpen() {
+ this.showView2 = true
+ },
+ divOpenStation() {
+ this.showStation = true
+ },
webSocket() {
const that = this
if (typeof (WebSocket) === 'undefined') {
diff --git a/acs/nladmin-ui/src/views/system/param/param.js b/acs/nladmin-ui/src/views/system/param/param.js
index 9050af5..af09fc3 100644
--- a/acs/nladmin-ui/src/views/system/param/param.js
+++ b/acs/nladmin-ui/src/views/system/param/param.js
@@ -30,5 +30,43 @@ export function getValueByCode(code) {
method: 'post'
})
}
+export function queryParam() {
+ return request({
+ url: '/api/param/queryParam',
+ method: 'get'
+ })
+}
-export default { add, edit, del, getValueByCode }
+export function setParam(data) {
+ return request({
+ url: 'api/param/setParam',
+ method: 'post',
+ data
+ })
+}
+
+export function showDetail2(params) {
+ return request({
+ url: 'api/dict/showDetail2',
+ method: 'get',
+ params
+ })
+}
+
+export function showDetail3(params) {
+ return request({
+ url: 'api/dict/showDetail3',
+ method: 'get',
+ params
+ })
+}
+
+export function initDict(data) {
+ return request({
+ url: 'api/dict/initDict',
+ method: 'post',
+ data
+ })
+}
+
+export default { add, edit, del, getValueByCode, setParam, showDetail2, initDict, showDetail3 }
diff --git a/acs/nladmin-ui/src/views/system/param/stationDialog.vue b/acs/nladmin-ui/src/views/system/param/stationDialog.vue
new file mode 100644
index 0000000..f0ad362
--- /dev/null
+++ b/acs/nladmin-ui/src/views/system/param/stationDialog.vue
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 初始化充电桩信息
+
+
+
+
+
+
+
+
+
+
diff --git a/acs/nladmin-ui/src/views/system/param/tubeDialog2.vue b/acs/nladmin-ui/src/views/system/param/tubeDialog2.vue
new file mode 100644
index 0000000..3954ff6
--- /dev/null
+++ b/acs/nladmin-ui/src/views/system/param/tubeDialog2.vue
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/wms/basedata_manage/service/dto/StrategyStructParam.java b/nladmin-system/nlsso-server/src/main/java/org/nl/wms/basedata_manage/service/dto/StrategyStructParam.java
index f05de94..8cfa4ea 100644
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/wms/basedata_manage/service/dto/StrategyStructParam.java
+++ b/nladmin-system/nlsso-server/src/main/java/org/nl/wms/basedata_manage/service/dto/StrategyStructParam.java
@@ -33,6 +33,11 @@ public class StrategyStructParam {
*/
private String ext_type;
+ /**
+ * 起点
+ */
+ private String point_code1;
+
/**
* 出入库类型
*/
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/wms/basedata_manage/service/impl/StructattrServiceImpl.java b/nladmin-system/nlsso-server/src/main/java/org/nl/wms/basedata_manage/service/impl/StructattrServiceImpl.java
index 88b99fc..e433ffa 100644
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/wms/basedata_manage/service/impl/StructattrServiceImpl.java
+++ b/nladmin-system/nlsso-server/src/main/java/org/nl/wms/basedata_manage/service/impl/StructattrServiceImpl.java
@@ -434,7 +434,7 @@ public class StructattrServiceImpl extends ServiceImpl strategy = one.getStrategy();
Map decisionerMap = SpringContextHolder.getBeansOfType(Decisioner.class);
@@ -478,16 +478,24 @@ public class StructattrServiceImpl extends ServiceImpl list = this.list(query);
+ //特殊载具规则
if ("BCPCTZB".equals(param.getStoragevehicle_type()) || "DJQCT".equals(param.getStoragevehicle_type())) {
list = structattrMapper.getctnextcode();
- }
- if ("2FCP3C".equals(param.getStoragevehicle_type()) && ObjectUtil.isEmpty(list)) {
+ //只入234层
+ } else if ("DJQMZB".equals(param.getStoragevehicle_type())) {
+ list.removeIf(r -> r.getLayer_num().equals(1));
+ } else if ("2FCP3C".equals(param.getStoragevehicle_type()) && ObjectUtil.isEmpty(list)) {
query.eq("is_used", true)
.eq("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))
.eq("sect_code", param.getSect_code())
.isNull("storagevehicle_code");
list = this.list(query);
}
+ //CNC点位不入4层
+ if (param.getPoint_code1().contains("BCPRK6")) {
+ Integer finalMaxLayerNum = maxLayerNum;
+ list.removeIf(r -> r.getLayer_num().equals(finalMaxLayerNum));
+ }
for (String decisionerType : strategy) {
Decisioner decisioner = decisionerMap.get(decisionerType);
log.info("执行入库规格:" + decisioner.strategyConfig.getStrategy_name());
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/wms/warehouse_manage/inAndOut/service/impl/InBillServiceImpl.java b/nladmin-system/nlsso-server/src/main/java/org/nl/wms/warehouse_manage/inAndOut/service/impl/InBillServiceImpl.java
index 2f540fe..3559c7e 100644
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/wms/warehouse_manage/inAndOut/service/impl/InBillServiceImpl.java
+++ b/nladmin-system/nlsso-server/src/main/java/org/nl/wms/warehouse_manage/inAndOut/service/impl/InBillServiceImpl.java
@@ -597,6 +597,7 @@ public class InBillServiceImpl extends ServiceImpl i
String iostorinvId = param.getString("iostorinv_id");
String storagevehicleCode = param.getString("storagevehicle_code");
String storagevehicle_stype = param.getString("storagevehicle_type");
+ String point_code1 = param.getString("point_code");
MdPbStoragevehicletype mdPbStoragevehicletype = iMdPbStoragevehicletypeService.getByCode(storagevehicle_stype);
//处理不同库区,一楼半成品特殊区域待检区
if ("DJQHDL".equals(storagevehicle_stype) || "DJQMZB".equals(storagevehicle_stype) || "DJQCT".equals(storagevehicle_stype)) {
@@ -642,6 +643,7 @@ public class InBillServiceImpl extends ServiceImpl i
.suitable_car(suitable_car)
.strategyMaters(maters)
.storagevehicle_type(storagevehicle_stype)
+ .point_code1(point_code1)
.build());
Structattr struct = structattrs.get(0);
sect_id = struct.getSect_id();
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/wms/wbwms/service/impl/WmsToIWmsServiceImpl.java b/nladmin-system/nlsso-server/src/main/java/org/nl/wms/wbwms/service/impl/WmsToIWmsServiceImpl.java
index 0db9181..9ed136b 100644
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/wms/wbwms/service/impl/WmsToIWmsServiceImpl.java
+++ b/nladmin-system/nlsso-server/src/main/java/org/nl/wms/wbwms/service/impl/WmsToIWmsServiceImpl.java
@@ -354,8 +354,9 @@ public class WmsToIWmsServiceImpl implements WmsToIWmsService {
if (CollectionUtils.isNotEmpty(list)) {
for (SchBasePoint point : list) {
JSONObject pointData = new JSONObject();
+ pointData.put("barcode", StringUtils.isBlank(point.getVehicle_code()) ? "" : point.getVehicle_code());
pointData.put("point_code", point.getPoint_code());
- pointData.put("status", point.getPoint_status().equals(PointStatusEnum.EMPTY_POINT.getCode()) && !point.getLock_up() ? "0" : "1");
+ pointData.put("status", point.getPoint_status().equals(PointStatusEnum.EMPTY_POINT.getCode()) && StringUtils.isBlank(point.getVehicle_code()) ? "0" : "1");
dataList.add(pointData);
}
}