Browse Source

fix:acs重复扫码时,lms生成任务时判断是否存在未完成的任务

master
zds 5 months ago
parent
commit
13a1aae19b
  1. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java
  2. 13
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java
  3. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java
  4. 2
      lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java

@ -67,6 +67,14 @@ public interface ISchBaseTaskService extends IService<SchBaseTask> {
*/ */
List<SchBaseTask> findUnFinishTasksByPoint_code2(String task_code, String point_code2); List<SchBaseTask> findUnFinishTasksByPoint_code2(String task_code, String point_code2);
/**
* 根据任务号和子托盘查询未完成的任务
* @param task_code
* @param sub_tray
* @return
*/
List<SchBaseTask> findUnFinishTasksBySub_tray(String task_code, String sub_tray);
/** /**
* 根据任务类型和任务状态查询任务 * 根据任务类型和任务状态查询任务
* @param config_code * @param config_code

13
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java

@ -140,6 +140,19 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
return schBaseTasks; return schBaseTasks;
} }
@Override
public List<SchBaseTask> findUnFinishTasksBySub_tray(String task_code, String sub_tray) {
Assert.notNull(task_code, "任务编码不能为空!");
Assert.notNull(sub_tray, "子托盘不能为空!");
LambdaQueryWrapper<SchBaseTask> lam = new LambdaQueryWrapper<>();
lam.lt(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode())
.ne(ObjectUtil.isNotEmpty(task_code),SchBaseTask::getTask_code, task_code)// 不是当前任务
.eq(SchBaseTask::getVehicle_code2, sub_tray)
.eq(SchBaseTask::getIs_delete, false);
List<SchBaseTask> schBaseTasks = schBaseTaskMapper.selectList(lam);
return schBaseTasks;
}
@Override @Override
public List<SchBaseTask> findTasksByTaskStatus(String config_code, TaskStatus status) { public List<SchBaseTask> findTasksByTaskStatus(String config_code, TaskStatus status) {
Assert.notNull(config_code, "任务配置编码不能为空!"); Assert.notNull(config_code, "任务配置编码不能为空!");

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java

@ -169,6 +169,7 @@ public abstract class AbstractTask {
String apply_point_code = param.getString("device_code"); // 请求点 String apply_point_code = param.getString("device_code"); // 请求点
String next_point = param.getString("next_point"); // 目的点 String next_point = param.getString("next_point"); // 目的点
String config_code = param.getString("config_code"); String config_code = param.getString("config_code");
String sub_tray = param.getString("sub_tray");
// 1、校验数据 // 1、校验数据
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>() SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
.eq(SchBaseTaskconfig::getConfig_code, config_code)); .eq(SchBaseTaskconfig::getConfig_code, config_code));
@ -182,6 +183,13 @@ public abstract class AbstractTask {
Assert.isFalse(apply_point_lists.size()>0, Assert.isFalse(apply_point_lists.size()>0,
"该任务申请点位["+apply_point_code+"]已存在未完成的任务,无法申请任务!"); "该任务申请点位["+apply_point_code+"]已存在未完成的任务,无法申请任务!");
} }
//子托盘非空
if(ObjectUtil.isNotEmpty(sub_tray)) {
//判断该子托盘是否存在未完成任务
List<SchBaseTask> apply_sub_tray_lists = taskService.findUnFinishTasksBySub_tray("",sub_tray);
Assert.isFalse(apply_sub_tray_lists.size()>0,
"该任务申请子托盘["+sub_tray+"]已存在未完成的任务,无法申请任务!");
}
// 最大可创建任务数 // 最大可创建任务数
Integer tcmn = taskConfig.getTask_create_max_num(); Integer tcmn = taskConfig.getTask_create_max_num();
// 获取申请的任务 // 获取申请的任务

2
lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml

@ -57,7 +57,7 @@ https://juejin.cn/post/6844903775631572999
<!--开发环境:打印控制台--> <!--开发环境:打印控制台-->
<springProfile name="dev"> <springProfile name="dev">
<root level="debug"> <root level="debug">
<appender-ref ref="CONSOLE"/> <appender-ref ref="asyncFileAppender"/>
</root> </root>
<logger name="org.springframework" level="ERROR" additivity="false"> <logger name="org.springframework" level="ERROR" additivity="false">
<appender-ref ref="asyncFileAppender"/> <appender-ref ref="asyncFileAppender"/>

Loading…
Cancel
Save