Browse Source

fix:修改下发acs任务时,未判断请求是否成功的Bug

master
zds 3 months ago
parent
commit
5cd48094dd
  1. 19
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java
  2. 18
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java
  3. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java
  4. 25
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java
  5. 21
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java
  6. 6
      lms/nladmin-ui/src/views/wms/sch/task/index.vue

19
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java

@ -1,5 +1,6 @@
package org.nl.wms.sch.task_manage.task.tasks;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.druid.util.StringUtils;
@ -84,18 +85,28 @@ public class KJRKTask extends AbstractTask {
continue;
}
}
//复制对象
SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class);
// 设置终点并修改创建成功状态
task.setPoint_code2(point.getPoint_code());
acs_task.setPoint_code2(point.getPoint_code());
//下发
JSONObject result = this.renotifyAcs(acs_task);
String status = result.getString("status");
//下发成功
if("200".equals(status)){
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("下发");
task.setPoint_code2(point.getPoint_code());
taskService.update(task);
//发起任务时先把点位占用,防止发起重复任务
point.setIng_task_code(task.getTask_code());
pointService.update(point);
//下发
this.renotifyAcs(task);
now_num++;
}else{
task.setRemark("下发acs失败:"+result.toString());
taskService.update(task);
}
}
}

18
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java

@ -1,5 +1,6 @@
package org.nl.wms.sch.task_manage.task.tasks;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
@ -102,10 +103,19 @@ public class POINTTask extends AbstractTask {
continue;
}
}
//复制对象
SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class);
acs_task.setVehicle_code(schBasePoint.getVehicle_code());
acs_task.setVehicle_code2(schBasePoint.getVehicle_code2());
//下发
JSONObject result = this.renotifyAcs(acs_task);
String status = result.getString("status");
//下发成功
if("200".equals(status)){
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("下发");
task.setVehicle_code(schBasePoint.getVehicle_code());
task.setVehicle_code2(schBasePoint.getVehicle_code2());
task.setRemark("下发");
taskService.update(task);
//发起任务时先把点位占用,防止发起重复任务
@ -118,9 +128,11 @@ public class POINTTask extends AbstractTask {
//pdm_bd_workorder_two任务完成时,status改为2出库中
workorderService.update(schBasePoint.getVehicle_code2(),"2");
}
//下发
this.renotifyAcs(task);
now_num++;
}else{
task.setRemark("下发acs失败:"+result.toString());
taskService.update(task);
}
}
}

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java

@ -1,5 +1,6 @@
package org.nl.wms.sch.task_manage.task.tasks;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.druid.util.StringUtils;
@ -84,18 +85,28 @@ public class SSXBKJTask extends AbstractTask {
continue;
}
}
//复制对象
SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class);
acs_task.setPoint_code1(point.getPoint_code());
//下发
JSONObject result = this.renotifyAcs(acs_task);
String status = result.getString("status");
//下发成功
if("200".equals(status)){
// 设置起点并修改创建成功状态
task.setPoint_code1(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("下发");
task.setPoint_code1(point.getPoint_code());
taskService.update(task);
//发起任务时先把点位占用,防止发起重复任务
point.setIng_task_code(task.getTask_code());
pointService.update(point);
//下发
this.renotifyAcs(task);
now_num++;
}else{
task.setRemark("下发acs失败:"+result.toString());
taskService.update(task);
}
}
}
}

25
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java

@ -1,5 +1,6 @@
package org.nl.wms.sch.task_manage.task.tasks;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
@ -123,24 +124,36 @@ public class YCLCKTask extends AbstractTask {
continue;
}
}
//复制对象
SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class);
// 设置终点并修改创建成功状态
task.setPoint_code2(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("任务下发");
acs_task.setPoint_code2(point.getPoint_code());
SchBasePoint schBasePoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, task.getPoint_code1()));
acs_task.setVehicle_code(schBasePoint.getVehicle_code());
acs_task.setVehicle_code2(schBasePoint.getVehicle_code2());
//下发
JSONObject result = this.renotifyAcs(acs_task);
String status = result.getString("status");
//下发成功
if("200".equals(status)){
// 设置终点并修改创建成功状态
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("任务下发");
task.setPoint_code2(point.getPoint_code());
task.setVehicle_code(schBasePoint.getVehicle_code());
task.setVehicle_code2(schBasePoint.getVehicle_code2());
taskService.update(task);
//发起任务时先把点位占用,防止发起重复任务
point.setIng_task_code(task.getTask_code());
pointService.update(point);
//pdm_bd_workorder_two任务下发时,status改为2
workorderService.update(schBasePoint.getVehicle_code2(),"2");
//下发
this.renotifyAcs(task);
now_num++;
}else{
task.setRemark("下发acs失败:"+result.toString());
taskService.update(task);
}
}
}
}

21
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java

@ -1,5 +1,6 @@
package org.nl.wms.sch.task_manage.task.tasks;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
@ -115,20 +116,32 @@ public class YCLRKTask extends AbstractTask {
continue;
}
}
//复制对象
SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class);
acs_task.setPoint_code2(point.getPoint_code());
acs_task.setVehicle_code(jsonObject.getString("mother_tray"));
acs_task.setVehicle_code2(jsonObject.getString("sub_tray"));
//下发
JSONObject result = this.renotifyAcs(acs_task);
String status = result.getString("status");
//下发成功
if("200".equals(status)){
// 设置终点并修改创建成功状态
task.setPoint_code2(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("下发");
task.setPoint_code2(point.getPoint_code());
task.setVehicle_code(jsonObject.getString("mother_tray"));
task.setVehicle_code2(jsonObject.getString("sub_tray"));
task.setRemark("下发");
taskService.update(task);
//发起任务时先把点位占用,防止发起重复任务
point.setIng_task_code(task.getTask_code());
pointService.update(point);
//下发
this.renotifyAcs(task);
now_num++;
}else{
task.setRemark("下发acs失败:"+result.toString());
taskService.update(task);
}
}
}
}

6
lms/nladmin-ui/src/views/wms/sch/task/index.vue

@ -76,12 +76,12 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column prop="task_code" label="任务编码" :min-width="flexWidth('task_code',crud.data,'任务编码')" />
<el-table-column prop="vehicle_code" label="载具编码1" :min-width="flexWidth('vehicle_code',crud.data,'载具编码1')">
<el-table-column prop="vehicle_code" label="母托盘编码" :min-width="flexWidth('vehicle_code',crud.data,'母托盘编码')">
<template slot-scope="scope">
{{ scope.row.vehicle_code ? scope.row.vehicle_code : '-' }}
</template>
</el-table-column>
<el-table-column prop="vehicle_code2" label="载具编码2" :min-width="flexWidth('vehicle_code2',crud.data,'载具编码2')">
<el-table-column prop="vehicle_code2" label="子托盘编码" :min-width="flexWidth('vehicle_code2',crud.data,'子托盘编码')">
<template slot-scope="scope">
{{ scope.row.vehicle_code2 ? scope.row.vehicle_code2 : '-' }}
</template>
@ -91,10 +91,10 @@
{{ getStatusName(scope.row.task_status) }}
</template>
</el-table-column>
<el-table-column prop="remark" label="提示信息" :min-width="flexWidth('remark',crud.data,'提示信息')" />
<el-table-column prop="config_code" label="任务配置编码" :min-width="flexWidth('config_code',crud.data,'任务配置编码')" />
<el-table-column prop="point_code1" label="起点1" :min-width="flexWidth('point_code1',crud.data,'点位1')" />
<el-table-column prop="point_code2" label="终点1" :min-width="flexWidth('point_code2',crud.data,'点位2')" />
<el-table-column prop="remark" label="提示信息" :min-width="200" />
<el-table-column prop="vehicle_qty" label="载具数量" :min-width="flexWidth('vehicle_qty',crud.data,'载具数量')" />
<el-table-column prop="priority" label="优先级" :min-width="flexWidth('priority',crud.data,'优先级')" />
<el-table-column prop="create_mode" label="任务生成方式" :formatter="format_create_mode" :min-width="flexWidth('create_mode',crud.data,'任务生成方式')" />

Loading…
Cancel
Save