This commit is contained in:
psh
2023-12-29 15:51:18 +08:00
parent 71570bc8ed
commit befe4f1bdc
13 changed files with 30 additions and 22 deletions

View File

@@ -117,6 +117,13 @@ public class GHSQHTask extends AbstractTask {
// 申请任务
SchBaseTask task = new SchBaseTask(); // 任务实体
String apply_point_code = schBasePoint.getPoint_code(); // 请求点
// 获取对接位点位对象
SchBasePoint pointObj = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, apply_point_code));
//首位01或06生成任务需要补01例如GHS0101下发需要改成GHS010101
if(apply_point_code.endsWith("01")||apply_point_code.endsWith("06")) {
apply_point_code+="01";
}
String config_code = "GHSQHTask";
// 1、校验数据
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
@@ -130,9 +137,6 @@ public class GHSQHTask extends AbstractTask {
Assert.isFalse(unFinishTasksByTaskConfig.size() >= tcmn,
"该点位申请的任务未完成数已超过上限,无法申请任务");
// 获取对接位点位对象
SchBasePoint pointObj = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, apply_point_code));
// 校验是否需要自动agv
if (!pointObj.getIs_auto()) {
// 如果不需要自动,则不创建任务
@@ -146,14 +150,12 @@ public class GHSQHTask extends AbstractTask {
task.setTask_status(TaskStatus.APPLY.getCode());
task.setWorkshop_code(taskConfig.getWorkshop_code()); // 车间编码
//首位01或06生成任务需要补01例如GHS0101下发需要改成GHS010101
if(schBasePoint.getPoint_code().endsWith("01")||schBasePoint.getPoint_code().endsWith("06")) {
task.setPoint_code1(task.getPoint_code1()+"01");
}
task.setPoint_code1(apply_point_code);
task.setPoint_code2(endPoint);
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("");
// 设置起/终点
this.setTaskPoint(taskConfig, task, apply_point_code);
// this.setTaskPoint(taskConfig, task, apply_point_code);
taskService.create(task);
//下发
@@ -319,13 +321,19 @@ public class GHSQHTask extends AbstractTask {
@Override
protected void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) {
//todo 重算最优点
String schBasePoint=schBaseTask.getPoint_code1();
if(schBasePoint.endsWith("0101")||schBasePoint.endsWith("0601")){
schBasePoint=schBasePoint.substring(0,schBasePoint.length()-2);
}
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code1()));
.eq(SchBasePoint::getPoint_code, schBasePoint));
SchBasePoint nextPoint = this.findNextPoint(startPoint);
if (ObjectUtil.isEmpty(nextPoint)) {
throw new Exception("当前起点" + schBaseTask.getPoint_code1() + "未找到合适的放货点位");
}
//上位记的是整一个缓存区三个点
schBaseTask.setPoint_code2(nextPoint.getPoint_code());
nextPoint.setIng_task_code(schBaseTask.getTask_code());
pointService.update(nextPoint);
}
}

View File

@@ -11,7 +11,7 @@
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
<!--单个日志最大容量 至少10MB才能看得出来-->
<maxFileSize>200MB</maxFileSize>
<maxFileSize>50MB</maxFileSize>
<!--所有日志最多占多大容量-->
<totalSizeCap>2GB</totalSizeCap>
</rollingPolicy>

View File

@@ -37,7 +37,7 @@ https://juejin.cn/post/6844903775631572999
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
<!--单个日志最大容量 至少10MB才能看得出来-->
<maxFileSize>20MB</maxFileSize>
<maxFileSize>50MB</maxFileSize>
<!--所有日志最多占多大容量-->
<totalSizeCap>20GB</totalSizeCap>
</rollingPolicy>