Browse Source

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

master
zds 3 months ago
parent
commit
5cd48094dd
  1. 31
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java
  2. 46
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java
  3. 33
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java
  4. 41
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java
  5. 39
      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

31
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; 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.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.druid.util.StringUtils; import com.alibaba.druid.util.StringUtils;
@ -84,18 +85,28 @@ public class KJRKTask extends AbstractTask {
continue; continue;
} }
} }
//复制对象
SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class);
// 设置终点并修改创建成功状态 // 设置终点并修改创建成功状态
task.setPoint_code2(point.getPoint_code()); acs_task.setPoint_code2(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("下发");
taskService.update(task);
//发起任务时先把点位占用,防止发起重复任务
point.setIng_task_code(task.getTask_code());
pointService.update(point);
//下发 //下发
this.renotifyAcs(task); 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);
now_num++;
}else{
task.setRemark("下发acs失败:"+result.toString());
taskService.update(task);
}
} }
} }

46
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; 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.date.DateUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
@ -102,25 +103,36 @@ public class POINTTask extends AbstractTask {
continue; continue;
} }
} }
task.setTask_status(TaskStatus.CREATED.getCode()); //复制对象
task.setVehicle_code(schBasePoint.getVehicle_code()); SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class);
task.setVehicle_code2(schBasePoint.getVehicle_code2()); acs_task.setVehicle_code(schBasePoint.getVehicle_code());
task.setRemark("下发"); acs_task.setVehicle_code2(schBasePoint.getVehicle_code2());
taskService.update(task); //下发
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());
taskService.update(task);
//发起任务时先把点位占用,防止发起重复任务 //发起任务时先把点位占用,防止发起重复任务
schBasePoint.setIng_task_code(task.getTask_code()); schBasePoint.setIng_task_code(task.getTask_code());
pointService.update(schBasePoint); pointService.update(schBasePoint);
nextSchBasePoint.setIng_task_code(task.getTask_code()); nextSchBasePoint.setIng_task_code(task.getTask_code());
pointService.update(nextSchBasePoint); pointService.update(nextSchBasePoint);
//去回温库的任务,更细工单表 //去回温库的任务,更细工单表
if(nextSchBasePoint.getPoint_code().contains("XHW")){ if(nextSchBasePoint.getPoint_code().contains("XHW")){
//pdm_bd_workorder_two任务完成时,status改为2出库中 //pdm_bd_workorder_two任务完成时,status改为2出库中
workorderService.update(schBasePoint.getVehicle_code2(),"2"); workorderService.update(schBasePoint.getVehicle_code2(),"2");
}
now_num++;
}else{
task.setRemark("下发acs失败:"+result.toString());
taskService.update(task);
} }
//下发
this.renotifyAcs(task);
now_num++;
} }
} }

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

41
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; 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.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
@ -123,24 +124,36 @@ public class YCLCKTask extends AbstractTask {
continue; continue;
} }
} }
//复制对象
SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class);
// 设置终点并修改创建成功状态 // 设置终点并修改创建成功状态
task.setPoint_code2(point.getPoint_code()); acs_task.setPoint_code2(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("任务下发");
SchBasePoint schBasePoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() SchBasePoint schBasePoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, task.getPoint_code1())); .eq(SchBasePoint::getPoint_code, task.getPoint_code1()));
task.setVehicle_code(schBasePoint.getVehicle_code()); acs_task.setVehicle_code(schBasePoint.getVehicle_code());
task.setVehicle_code2(schBasePoint.getVehicle_code2()); acs_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); JSONObject result = this.renotifyAcs(acs_task);
now_num++; 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");
now_num++;
}else{
task.setRemark("下发acs失败:"+result.toString());
taskService.update(task);
}
} }
} }
} }

39
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; 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.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
@ -115,20 +116,32 @@ public class YCLRKTask extends AbstractTask {
continue; continue;
} }
} }
// 设置终点并修改创建成功状态 //复制对象
task.setPoint_code2(point.getPoint_code()); SchBaseTask acs_task = BeanUtil.copyProperties(task,SchBaseTask.class);
task.setTask_status(TaskStatus.CREATED.getCode()); acs_task.setPoint_code2(point.getPoint_code());
task.setVehicle_code(jsonObject.getString("mother_tray")); acs_task.setVehicle_code(jsonObject.getString("mother_tray"));
task.setVehicle_code2(jsonObject.getString("sub_tray")); acs_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); JSONObject result = this.renotifyAcs(acs_task);
now_num++; 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(jsonObject.getString("mother_tray"));
task.setVehicle_code2(jsonObject.getString("sub_tray"));
taskService.update(task);
//发起任务时先把点位占用,防止发起重复任务
point.setIng_task_code(task.getTask_code());
pointService.update(point);
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 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="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"> <template slot-scope="scope">
{{ scope.row.vehicle_code ? scope.row.vehicle_code : '-' }} {{ scope.row.vehicle_code ? scope.row.vehicle_code : '-' }}
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
{{ scope.row.vehicle_code2 ? scope.row.vehicle_code2 : '-' }} {{ scope.row.vehicle_code2 ? scope.row.vehicle_code2 : '-' }}
</template> </template>
@ -91,10 +91,10 @@
{{ getStatusName(scope.row.task_status) }} {{ getStatusName(scope.row.task_status) }}
</template> </template>
</el-table-column> </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="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_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="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="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="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,'任务生成方式')" /> <el-table-column prop="create_mode" label="任务生成方式" :formatter="format_create_mode" :min-width="flexWidth('create_mode',crud.data,'任务生成方式')" />

Loading…
Cancel
Save