add:增加近期的一些新增需求实现;
This commit is contained in:
@@ -18,6 +18,9 @@ public interface AcsConfig {
|
|||||||
String MAXINSTNUMBER = "maxInstNumber";
|
String MAXINSTNUMBER = "maxInstNumber";
|
||||||
//同一任务创建最大RT车指令数
|
//同一任务创建最大RT车指令数
|
||||||
String MAXRTINSTNUMBER = "maxRtInstNumber";
|
String MAXRTINSTNUMBER = "maxRtInstNumber";
|
||||||
|
|
||||||
|
//人工创建最大指令数
|
||||||
|
String MAXMANINSTNUMBER = "codeCreate";
|
||||||
//创建任务检查
|
//创建任务检查
|
||||||
String CREATETASKCHECK = "createTaskCheck";
|
String CREATETASKCHECK = "createTaskCheck";
|
||||||
//撤销任务检查
|
//撤销任务检查
|
||||||
|
|||||||
@@ -85,8 +85,18 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
int is_have = 0; //是否有货
|
int is_have = 0; //是否有货
|
||||||
int error = 0; //车辆故障
|
int error = 0; //车辆故障
|
||||||
|
|
||||||
// 飞书消息去重缓存:key为设备代码+错误类型,value为最后发送时间戳
|
// 飞书消息去重缓存:key为设备代码+错误类型,value为错误记录(含计数和最后发送时间)
|
||||||
private final ConcurrentHashMap<String, Long> feiShuErrorCache = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<String, FeiShuErrorRecord> feiShuErrorCache = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 飞书报警错误记录,用于计数和间隔推送控制
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
private static class FeiShuErrorRecord {
|
||||||
|
private int num = 0; // 收到同一报警的次数
|
||||||
|
private long lastSendTime = 0; // 最后一次推送的时间戳(毫秒)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缓存的参数值,避免频繁查询数据库
|
* 缓存的参数值,避免频繁查询数据库
|
||||||
*/
|
*/
|
||||||
@@ -202,7 +212,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
//(需要WCS反馈)
|
//(需要WCS反馈)
|
||||||
} else if (phase == 0x05) {
|
} else if (phase == 0x05) {
|
||||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
task.setTask_status("8");
|
task.setTask_status("4");
|
||||||
//车辆执行任务开始计时字段
|
//车辆执行任务开始计时字段
|
||||||
if (StringUtils.isBlank(task.getTo_x())) {
|
if (StringUtils.isBlank(task.getTo_x())) {
|
||||||
task.setTo_x(DateUtil.now());
|
task.setTo_x(DateUtil.now());
|
||||||
@@ -374,23 +384,36 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
int endMinutes = endHour * 60 + endMinute;
|
int endMinutes = endHour * 60 + endMinute;
|
||||||
// 判断当前时间是否在工作时间内
|
// 判断当前时间是否在工作时间内
|
||||||
if (nowMinutes < startMinutes || nowMinutes >= endMinutes) {
|
if (nowMinutes < startMinutes || nowMinutes >= endMinutes) {
|
||||||
// log.info("当前时间{}不在工作时间范围内({}),跳过发送飞书消息",
|
// log.info("当前时间{}不在工作时间范围内({}),跳过发送飞书消息",
|
||||||
// DateUtil.formatTime(now), feiShuSendTime);
|
// DateUtil.formatTime(now), feiShuSendTime);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 2. 重复消息筛选:5分钟内相同设备的相同错误不重复发送
|
// 2. 计数与间隔推送逻辑:第1次收到不推送,第2次收到首次推送,之后按间隔推送
|
||||||
String cacheKey = this.getDeviceCode() + errorMessage;
|
String cacheKey = this.getDeviceCode() + errorMessage;
|
||||||
long currentTime = System.currentTimeMillis();
|
long currentTime = System.currentTimeMillis();
|
||||||
Long lastSendTime = feiShuErrorCache.get(cacheKey);
|
FeiShuErrorRecord record = feiShuErrorCache.get(cacheKey);
|
||||||
if (lastSendTime != null) {
|
if (record == null) {
|
||||||
long diffTime = currentTime - lastSendTime;
|
// 第一次收到该报警,num=1,不推送
|
||||||
// 距离上次发送不足2分钟,过滤掉该消息
|
record = new FeiShuErrorRecord();
|
||||||
|
record.setNum(1);
|
||||||
|
feiShuErrorCache.put(cacheKey, record);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 每次收到报警,计数+1;超过5次则清除缓存,重新开始计数
|
||||||
|
record.setNum(record.getNum() + 1);
|
||||||
|
if (record.getNum() > 5) {
|
||||||
|
feiShuErrorCache.remove(cacheKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (record.getNum() > 2) {
|
||||||
|
// num > 2,已推送过,按间隔时间控制后续推送
|
||||||
int feiShuSendFreMin = Integer.parseInt(feiShuSendFre);
|
int feiShuSendFreMin = Integer.parseInt(feiShuSendFre);
|
||||||
|
long diffTime = currentTime - record.getLastSendTime();
|
||||||
if (diffTime < feiShuSendFreMin * 60000L) {
|
if (diffTime < feiShuSendFreMin * 60000L) {
|
||||||
log.debug("设备{}的{}在5分钟内已有过提醒,过滤掉本次重复提醒(距今{}ms)",
|
log.debug("设备{}的{}在{}分钟内已有过提醒,过滤掉本次重复提醒(距今{}ms)",
|
||||||
this.getDeviceCode(), errorMessage, diffTime);
|
this.getDeviceCode(), errorMessage, feiShuSendFreMin, diffTime);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -449,8 +472,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
JSONObject jsonResponse = JSONObject.parseObject(response);
|
JSONObject jsonResponse = JSONObject.parseObject(response);
|
||||||
if (jsonResponse != null && jsonResponse.getIntValue("code") == 0) {
|
if (jsonResponse != null && jsonResponse.getIntValue("code") == 0) {
|
||||||
//log.info("设备{}的故障消息发送成功:{}", this.getDeviceCode(), errorMessage);
|
//log.info("设备{}的故障消息发送成功:{}", this.getDeviceCode(), errorMessage);
|
||||||
// 更新缓存:记录最后发送时间
|
// 更新记录:记录最后发送时间
|
||||||
feiShuErrorCache.put(cacheKey, currentTime);
|
record.setLastSendTime(currentTime);
|
||||||
} else {
|
} else {
|
||||||
log.error("设备{}的故障消息发送失败:{}", this.getDeviceCode(), response);
|
log.error("设备{}的故障消息发送失败:{}", this.getDeviceCode(), response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
// dto.setIs_send(task.getLink_num());
|
// dto.setIs_send(task.getLink_num());
|
||||||
// }
|
// }
|
||||||
// if (task.getTask_type().equals(CommonFinalParam.ONE) || task.getTask_type().equals("2")) {
|
// if (task.getTask_type().equals(CommonFinalParam.ONE) || task.getTask_type().equals("2")) {
|
||||||
dto.setInstruction_type(task!=null?task.getTask_type():dto.getInstruction_type());
|
// dto.setInstruction_type(task.getTask_type());
|
||||||
// } else if (false) {
|
// } else if (false) {
|
||||||
//
|
//
|
||||||
// } else {
|
// } else {
|
||||||
@@ -379,7 +379,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// 查询是否存在相同指令号
|
// 查询是否存在相同指令号
|
||||||
// if (!StrUtil.isEmpty(dto.getVehicle_code() )) {
|
// if (!StzzzzzzrUtil.isEmpty(dto.getVehicle_code() )) {
|
||||||
// Instruction inst_dto = findByContainer(dto.getVehicle_code());
|
// Instruction inst_dto = findByContainer(dto.getVehicle_code());
|
||||||
// if (inst_dto != null) {
|
// if (inst_dto != null) {
|
||||||
// log.error("存在相同载具号任务,载具号"+dto.getVehicle_code());
|
// log.error("存在相同载具号任务,载具号"+dto.getVehicle_code());
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class TaskDto implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 任务类型
|
* 任务类型
|
||||||
*/
|
*/
|
||||||
private String task_type = CommonFinalParam.ONE;
|
private String task_type ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立库任务类型
|
* 立库任务类型
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
@Override
|
@Override
|
||||||
public List<TaskDto> queryAll() {
|
public List<TaskDto> queryAll() {
|
||||||
List<Task> taskList = new LambdaQueryChainWrapper<>(taskMapper)
|
List<Task> taskList = new LambdaQueryChainWrapper<>(taskMapper)
|
||||||
.lt(Task::getTask_status, TaskStatusEnum.FINISHED.getIndex())
|
.in(Task::getTask_status, 0, 1, 4, 10, 99)
|
||||||
.eq(Task::getIs_delete, "0")
|
.eq(Task::getIs_delete, "0")
|
||||||
.orderByDesc(Task::getCreate_time)
|
.orderByDesc(Task::getCreate_time)
|
||||||
.list();
|
.list();
|
||||||
@@ -251,7 +251,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
wrapper.lt(Task::getTask_status, TaskStatusEnum.FINISHED.getIndex());
|
wrapper.lt(Task::getTask_status, TaskStatusEnum.FINISHED.getIndex());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wrapper.in(Task::getTask_status, 1, 4 ,10 ,0);
|
wrapper.in(Task::getTask_status, 0, 1, 4, 10, 99);
|
||||||
wrapper.orderByDesc(Task::getCreate_time);
|
wrapper.orderByDesc(Task::getCreate_time);
|
||||||
IPage<Task> taskPage = taskMapper.selectPage(queryPage, wrapper);
|
IPage<Task> taskPage = taskMapper.selectPage(queryPage, wrapper);
|
||||||
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(taskPage, TaskDto.class));
|
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(taskPage, TaskDto.class));
|
||||||
@@ -823,7 +823,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
//判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
//判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
||||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||||
//&& !StrUtil.equals(dto.getTask_status(),"0")
|
//&& !StrUtil.equals(dto.getTask_status(),"0")
|
||||||
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")&& !StrUtil.equals(dto.getTask_status(), "8")) {
|
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1") && !StrUtil.equals(dto.getTask_status(), TaskStatusEnum.FINISHEDMOVE.getIndex())) {
|
||||||
this.feedWmsTaskStatus(entity);
|
this.feedWmsTaskStatus(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -878,23 +878,17 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
}
|
}
|
||||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
for (String taskId : taskIds) {
|
// 批量查询验证所有任务是否存在
|
||||||
TaskDto entity = this.findById(taskId);
|
List<Task> tasks = taskMapper.selectBatchIds(taskIds);
|
||||||
if (entity == null) {
|
if (tasks.size() != taskIds.size()) {
|
||||||
throw new BadRequestException(LangProcess.msg("error_sysAuth"));
|
throw new BadRequestException(LangProcess.msg("error_sysAuth"));
|
||||||
}
|
|
||||||
if (!"0".equals(entity.getTask_status())) {
|
|
||||||
throw new BadRequestException("只能修改待执行任务的优先级");
|
|
||||||
}
|
|
||||||
TaskDto updateDto = new TaskDto();
|
|
||||||
updateDto.setTask_id(taskId);
|
|
||||||
updateDto.setPriority(String.valueOf(priority));
|
|
||||||
updateDto.setUpdate_time(now);
|
|
||||||
updateDto.setUpdate_by(currentUsername);
|
|
||||||
updateDto.setTemperature(currentUsername + "于" + now + "手动修改了优先级:"+priority);
|
|
||||||
Task task = ConvertUtil.convert(updateDto, Task.class);
|
|
||||||
taskMapper.updateById(task);
|
|
||||||
}
|
}
|
||||||
|
taskMapper.update(null, Wrappers.<Task>lambdaUpdate()
|
||||||
|
.in(Task::getTask_id, taskIds)
|
||||||
|
.set(Task::getPriority, String.valueOf(priority))
|
||||||
|
.set(Task::getUpdate_time, now)
|
||||||
|
.set(Task::getUpdate_by, currentUsername)
|
||||||
|
.set(Task::getTemperature, currentUsername + "于" + now + "手动修改了优先级:" + priority));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1031,11 +1025,19 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
throw new BadRequestException(LangProcess.msg("task_insRun"));
|
throw new BadRequestException(LangProcess.msg("task_insRun"));
|
||||||
}
|
}
|
||||||
|
String maxManInstNumber = "5";
|
||||||
|
long unfinishedManInstructionCount = 0L;
|
||||||
String maxInstNumber = "0";
|
String maxInstNumber = "0";
|
||||||
long unfinishedInstructionCount = 0L;
|
long unfinishedInstructionCount = 0L;
|
||||||
List<InstructionMybatis> unfinishedList = new LambdaQueryChainWrapper<>(instructionMapper)
|
List<InstructionMybatis> unfinishedList = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||||
.lt(InstructionMybatis::getInstruction_status, InstructionStatusEnum.FINISHED.getIndex())
|
.lt(InstructionMybatis::getInstruction_status, InstructionStatusEnum.FINISHED.getIndex())
|
||||||
.eq(InstructionMybatis::getIs_delete, "0").list();
|
.eq(InstructionMybatis::getIs_delete, "0").list();
|
||||||
|
maxManInstNumber = paramService.findByCode(AcsConfig.MAXMANINSTNUMBER).getValue();
|
||||||
|
unfinishedManInstructionCount = unfinishedList.stream().filter(r -> "2".equals(r.getCreate_type())).count();
|
||||||
|
long maxManInst = Long.parseLong(maxManInstNumber);
|
||||||
|
// if (unfinishedManInstructionCount >= maxManInst) {
|
||||||
|
// throw new BadRequestException("超过人工创建的最大指令数:" + maxInstNumber + "个,请等待指令列表完成后再创建!");
|
||||||
|
// }
|
||||||
if ("2".equals(acsTask.getCar_type())) {
|
if ("2".equals(acsTask.getCar_type())) {
|
||||||
maxInstNumber = paramService.findByCode(AcsConfig.MAXRTINSTNUMBER).getValue();
|
maxInstNumber = paramService.findByCode(AcsConfig.MAXRTINSTNUMBER).getValue();
|
||||||
unfinishedInstructionCount = unfinishedList.stream().filter(r -> "2".equals(r.getCar_type())).count();
|
unfinishedInstructionCount = unfinishedList.stream().filter(r -> "2".equals(r.getCar_type())).count();
|
||||||
@@ -1044,8 +1046,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
unfinishedInstructionCount = unfinishedList.stream().filter(r -> !"2".equals(r.getCar_type())).count();
|
unfinishedInstructionCount = unfinishedList.stream().filter(r -> !"2".equals(r.getCar_type())).count();
|
||||||
}
|
}
|
||||||
long maxInst = Long.parseLong(maxInstNumber);
|
long maxInst = Long.parseLong(maxInstNumber);
|
||||||
if (unfinishedInstructionCount >= maxInst) {
|
if (unfinishedInstructionCount >= maxInst&&unfinishedManInstructionCount >= maxManInst) {
|
||||||
throw new BadRequestException("超过最大指令数:" + maxInstNumber + "个,请等待指令列表完成后再创建!");
|
throw new BadRequestException("超过该车型的最大指令数,请等待指令列表完成后再创建!");
|
||||||
}
|
}
|
||||||
String startDeviceCode = acsTask.getStart_device_code();
|
String startDeviceCode = acsTask.getStart_device_code();
|
||||||
if ("1".equals(acsTask.getTask_type()) && (startDeviceCode.contains("BCPRK") || startDeviceCode.contains("CPRK"))) {
|
if ("1".equals(acsTask.getTask_type()) && (startDeviceCode.contains("BCPRK") || startDeviceCode.contains("CPRK"))) {
|
||||||
@@ -1136,7 +1138,10 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
instdto.setNext_device_code(next_device_code);
|
instdto.setNext_device_code(next_device_code);
|
||||||
instdto.setStart_point_code(start_point_code);
|
instdto.setStart_point_code(start_point_code);
|
||||||
instdto.setNext_point_code(next_point_code);
|
instdto.setNext_point_code(next_point_code);
|
||||||
instdto.setPriority(priority);
|
//人工创建指令优先级最高
|
||||||
|
instdto.setPriority("98");
|
||||||
|
//指令由人工创建
|
||||||
|
instdto.setCreate_type("2");
|
||||||
instdto.setInstruction_status(InstructionStatusEnum.READY.getIndex());
|
instdto.setInstruction_status(InstructionStatusEnum.READY.getIndex());
|
||||||
instdto.setExecute_device_code(start_point_code);
|
instdto.setExecute_device_code(start_point_code);
|
||||||
instdto.setVehicle_type(vehicleType);
|
instdto.setVehicle_type(vehicleType);
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ export default {
|
|||||||
'Description': '描述信息',
|
'Description': '描述信息',
|
||||||
'Cancel': '取消',
|
'Cancel': '取消',
|
||||||
'Confirm': '确认',
|
'Confirm': '确认',
|
||||||
|
'assign': '分配中',
|
||||||
|
'finished_move': '取货完成',
|
||||||
|
'exception': '异常',
|
||||||
|
'request': '二次分配请求',
|
||||||
'Ready': '就绪',
|
'Ready': '就绪',
|
||||||
'In_progress': '执行中',
|
'In_progress': '执行中',
|
||||||
'Completed': '完成',
|
'Completed': '完成',
|
||||||
|
|||||||
@@ -150,6 +150,9 @@
|
|||||||
<span v-if="scope.row.instruction_status=='1' ">{{ $t('task.select.In_progress') }}</span>
|
<span v-if="scope.row.instruction_status=='1' ">{{ $t('task.select.In_progress') }}</span>
|
||||||
<span v-if="scope.row.instruction_status=='2' ">{{ $t('task.select.Completed') }}</span>
|
<span v-if="scope.row.instruction_status=='2' ">{{ $t('task.select.Completed') }}</span>
|
||||||
<span v-if="scope.row.instruction_status=='3' ">{{ $t('task.select.Cancel') }}</span>
|
<span v-if="scope.row.instruction_status=='3' ">{{ $t('task.select.Cancel') }}</span>
|
||||||
|
<span v-if="scope.row.instruction_status=='4' ">{{ $t('task.select.finished_move') }}</span>
|
||||||
|
<span v-if="scope.row.instruction_status=='8' ">{{ $t('task.select.assign') }}</span>
|
||||||
|
<span v-if="scope.row.instruction_status=='10' ">{{ $t('task.select.request') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="start_point_code" :label="$t('task.select.Start_point')" :min-width="flexWidth('start_point_code',crud.data,$t('task.select.Start_point'))" />
|
<el-table-column prop="start_point_code" :label="$t('task.select.Start_point')" :min-width="flexWidth('start_point_code',crud.data,$t('task.select.Start_point'))" />
|
||||||
|
|||||||
@@ -295,10 +295,14 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="task_status" :label="$t('task.txt_box.Task_status')">
|
<el-table-column prop="task_status" :label="$t('task.txt_box.Task_status')">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.task_status=='0' ">{{ $t('task.select.Ready') }}</span>
|
<span v-if="scope.row.task_status==='0' ">{{ $t('task.select.Ready') }}</span>
|
||||||
<span v-if="scope.row.task_status=='1' ">{{ $t('task.select.In_progress') }}</span>
|
<span v-if="scope.row.task_status==='1' ">{{ $t('task.select.In_progress') }}</span>
|
||||||
<span v-if="scope.row.task_status=='2' ">{{ $t('task.select.Completed') }}</span>
|
<span v-if="scope.row.task_status==='2' ">{{ $t('task.select.Completed') }}</span>
|
||||||
<span v-if="scope.row.task_status=='3' ">{{ $t('task.select.Cancel') }}</span>
|
<span v-if="scope.row.task_status==='3' ">{{ $t('task.select.Cancel') }}</span>
|
||||||
|
<span v-if="scope.row.task_status==='4' ">{{ $t('task.select.finished_move') }}</span>
|
||||||
|
<span v-if="scope.row.task_status==='8' ">{{ $t('task.select.assign') }}</span>
|
||||||
|
<span v-if="scope.row.task_status==='10' ">{{ $t('task.select.request') }}</span>
|
||||||
|
<span v-if="scope.row.task_status==='99' ">{{ $t('task.select.exception') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="priority" :label="$t('TaskRecord.table.Priority')" :min-width="flexWidth('priority',crud.data,$t('TaskRecord.table.Priority'))" />
|
<el-table-column prop="priority" :label="$t('TaskRecord.table.Priority')" :min-width="flexWidth('priority',crud.data,$t('TaskRecord.table.Priority'))" />
|
||||||
|
|||||||
@@ -587,6 +587,11 @@
|
|||||||
<span v-if="scope.row.task_status==='0' ">{{ $t('task.select.Ready') }}</span>
|
<span v-if="scope.row.task_status==='0' ">{{ $t('task.select.Ready') }}</span>
|
||||||
<span v-if="scope.row.task_status==='1' ">{{ $t('task.select.In_progress') }}</span>
|
<span v-if="scope.row.task_status==='1' ">{{ $t('task.select.In_progress') }}</span>
|
||||||
<span v-if="scope.row.task_status==='2' ">{{ $t('task.select.Completed') }}</span>
|
<span v-if="scope.row.task_status==='2' ">{{ $t('task.select.Completed') }}</span>
|
||||||
|
<span v-if="scope.row.task_status==='3' ">{{ $t('task.select.Cancel') }}</span>
|
||||||
|
<span v-if="scope.row.task_status==='4' ">{{ $t('task.select.finished_move') }}</span>
|
||||||
|
<span v-if="scope.row.task_status==='8' ">{{ $t('task.select.assign') }}</span>
|
||||||
|
<span v-if="scope.row.task_status==='10' ">{{ $t('task.select.request') }}</span>
|
||||||
|
<span v-if="scope.row.task_status==='99' ">{{ $t('task.select.exception') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="priority" :label="$t('task.txt_box.Priority')" :min-width="flexWidth('priority',crud.data,$t('task.txt_box.Priority'))" />
|
<el-table-column prop="priority" :label="$t('task.txt_box.Priority')" :min-width="flexWidth('priority',crud.data,$t('task.txt_box.Priority'))" />
|
||||||
@@ -974,11 +979,11 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 校验所有选中的任务状态必须为 '0'(待执行)
|
// 校验所有选中的任务状态必须为 '0'(待执行)
|
||||||
const invalidSelections = selections.filter(item => item.task_status !== '0')
|
// const invalidSelections = selections.filter(item => item.task_status !== '0' || item.task_status !== '1')
|
||||||
if (invalidSelections.length > 0) {
|
// if (invalidSelections.length > 0) {
|
||||||
this.crud.notify('只能选择状态为"就绪"的任务', CRUD.NOTIFICATION_TYPE.WARNING)
|
// this.crud.notify('只能选择状态为"就绪"的任务', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
// 取第一个选中任务的 task_code 展示
|
// 取第一个选中任务的 task_code 展示
|
||||||
this.priorityForm.task_code = selections[0].task_code
|
this.priorityForm.task_code = selections[0].task_code
|
||||||
this.priorityForm.priority = selections[0].priority ? Number(selections[0].priority) : 1
|
this.priorityForm.priority = selections[0].priority ? Number(selections[0].priority) : 1
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.CodeUtil;
|
import org.nl.common.utils.CodeUtil;
|
||||||
@@ -967,6 +968,15 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void taskFinish(SchBaseTask task) {
|
public void taskFinish(SchBaseTask task) {
|
||||||
|
List<GroupPlate> groupPlateList = mdPbGroupplateMapper.selectList(new LambdaQueryWrapper<GroupPlate>()
|
||||||
|
.eq(GroupPlate::getStoragevehicle_code, task.getVehicle_code()).orderByDesc(GroupPlate::getCreate_name));
|
||||||
|
if (ObjectUtils.isEmpty(groupPlateList)) {
|
||||||
|
throw new BadRequestException("未找到该托盘的组盘信息,检查一下该托盘是否已出库或在操作日志中查询该托盘是否被删除组盘信息!");
|
||||||
|
}
|
||||||
|
List<MdMeMaterialbase> MdMeMaterialbaseList = mdMeMaterialbaseMapper.selectList(new LambdaQueryWrapper<MdMeMaterialbase>().eq(MdMeMaterialbase::getMaterial_id, groupPlateList.get(0).getMaterial_id()).orderByDesc(MdMeMaterialbase::getCreate_name));
|
||||||
|
if (ObjectUtils.isEmpty(MdMeMaterialbaseList)) {
|
||||||
|
throw new BadRequestException("未找到该托盘的物料信息,检查一下该托盘是否已出库或在操作日志中查询该物料是否被删除!");
|
||||||
|
}
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
@@ -1056,14 +1066,9 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
|||||||
jo.put("storagevehicle_code", task.getVehicle_code());
|
jo.put("storagevehicle_code", task.getVehicle_code());
|
||||||
jo.put("struct_name", task.getPoint_code2());
|
jo.put("struct_name", task.getPoint_code2());
|
||||||
jo.put("struct_code", task.getPoint_code2());
|
jo.put("struct_code", task.getPoint_code2());
|
||||||
GroupPlate groupPlate = mdPbGroupplateMapper.selectOne(new LambdaQueryWrapper<GroupPlate>()
|
jo.put("material_name", MdMeMaterialbaseList.get(0).getMaterial_name());
|
||||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
jo.put("material_code", MdMeMaterialbaseList.get(0).getMaterial_code());
|
||||||
.eq(GroupPlate::getStoragevehicle_code, task.getVehicle_code()
|
jo.put("qty", groupPlateList.get(0).getQty());
|
||||||
));
|
|
||||||
MdMeMaterialbase mdMeMaterialbase = mdMeMaterialbaseMapper.selectOne(new LambdaQueryWrapper<MdMeMaterialbase>().eq(MdMeMaterialbase::getMaterial_code, groupPlate.getMaterial_id()));
|
|
||||||
jo.put("material_name", mdMeMaterialbase.getMaterial_name());
|
|
||||||
jo.put("material_code", mdMeMaterialbase.getMaterial_code());
|
|
||||||
jo.put("qty", groupPlate.getQty());
|
|
||||||
List<JSONObject> tableData = new ArrayList<>();
|
List<JSONObject> tableData = new ArrayList<>();
|
||||||
tableData.add(jo);
|
tableData.add(jo);
|
||||||
towmsmsg.setTableData(tableData);
|
towmsmsg.setTableData(tableData);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
@@ -1417,6 +1418,15 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void taskFinish(SchBaseTask task) {
|
public void taskFinish(SchBaseTask task) {
|
||||||
|
List<GroupPlate> groupPlateList = mdPbGroupplateMapper.selectList(new LambdaQueryWrapper<GroupPlate>()
|
||||||
|
.eq(GroupPlate::getStoragevehicle_code, task.getVehicle_code()).orderByDesc(GroupPlate::getCreate_name));
|
||||||
|
if (ObjectUtils.isEmpty(groupPlateList)) {
|
||||||
|
throw new BadRequestException("未找到该托盘的组盘信息,检查一下该托盘是否已出库或在操作日志中查询该托盘是否被删除组盘信息!");
|
||||||
|
}
|
||||||
|
List<MdMeMaterialbase> MdMeMaterialbaseList = mdMeMaterialbaseMapper.selectList(new LambdaQueryWrapper<MdMeMaterialbase>().eq(MdMeMaterialbase::getMaterial_id, groupPlateList.get(0).getMaterial_id()).orderByDesc(MdMeMaterialbase::getCreate_name));
|
||||||
|
if (ObjectUtils.isEmpty(MdMeMaterialbaseList)) {
|
||||||
|
throw new BadRequestException("未找到该托盘的物料信息,检查一下该托盘是否已出库或在操作日志中查询该物料是否被删除!");
|
||||||
|
}
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
@@ -1517,13 +1527,9 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
|||||||
jo.put("storagevehicle_code", task.getVehicle_code());
|
jo.put("storagevehicle_code", task.getVehicle_code());
|
||||||
jo.put("struct_name", task.getPoint_code2());
|
jo.put("struct_name", task.getPoint_code2());
|
||||||
jo.put("struct_code", task.getPoint_code2());
|
jo.put("struct_code", task.getPoint_code2());
|
||||||
GroupPlate groupPlate = mdPbGroupplateMapper.selectOne(new LambdaQueryWrapper<GroupPlate>()
|
jo.put("material_name", MdMeMaterialbaseList.get(0).getMaterial_name());
|
||||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
jo.put("material_code", MdMeMaterialbaseList.get(0).getMaterial_code());
|
||||||
.eq(GroupPlate::getStoragevehicle_code, task.getVehicle_code()));
|
jo.put("qty", groupPlateList.get(0).getQty());
|
||||||
MdMeMaterialbase mdMeMaterialbase = mdMeMaterialbaseMapper.selectOne(new LambdaQueryWrapper<MdMeMaterialbase>().eq(MdMeMaterialbase::getMaterial_id, groupPlate.getMaterial_id()));
|
|
||||||
jo.put("material_name", mdMeMaterialbase.getMaterial_name());
|
|
||||||
jo.put("material_code", mdMeMaterialbase.getMaterial_code());
|
|
||||||
jo.put("qty", groupPlate.getQty());
|
|
||||||
List<JSONObject> tableData = new ArrayList<>();
|
List<JSONObject> tableData = new ArrayList<>();
|
||||||
tableData.add(jo);
|
tableData.add(jo);
|
||||||
towmsmsg.setTableData(tableData);
|
towmsmsg.setTableData(tableData);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ spring:
|
|||||||
freemarker:
|
freemarker:
|
||||||
check-template-location: false
|
check-template-location: false
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: prod
|
||||||
# active: dev
|
# active: dev
|
||||||
# active: prod
|
# active: prod
|
||||||
jackson:
|
jackson:
|
||||||
|
|||||||
Reference in New Issue
Block a user