Commit e0f9ddcc028e982446fdb9bd37e7b7a5d8528613

Authored by 肖超群
1 parent 0702a0d0

完善AGV对接

Showing 19 changed files with 636 additions and 60 deletions
ant-design-vue-jeecg/src/api/api.js
... ... @@ -183,6 +183,12 @@ export const inventoryUtilization = (params) => postAction("/sys/home/inventoryU
183 183 export const inventoryStatus = (params) => postAction("/sys/home/inventoryStatus", params);
184 184 export const inventoryOverview = (params) => postAction("/sys/home/inventoryOverview", params);
185 185 export const getCommonData = (params) => postAction("/sys/home/getCommonData", params);
  186 +//执行AGV任务
  187 +export const executeAgv = (params) => postAction('/task/agvTask/execute?ids=' + params, params);
  188 +//完成AGV任务
  189 +export const completeAgv = (params) => postAction('/task/agvTask/complete?ids=' + params, params);
  190 +//取消AGV任务
  191 +export const cancelAgv = (params) => postAction('/task/agvTask/cancel?ids=' + params, params);
186 192 // 中转HTTP请求
187 193 export const transitRESTful = {
188 194 get: (url, parameter) => getAction(getTransitURL(url), parameter),
... ...
ant-design-vue-jeecg/src/views/system/config/AgvPortList.vue
... ... @@ -31,7 +31,7 @@
31 31  
32 32 <!-- 操作按钮区域 -->
33 33 <div class="table-operator">
34   - <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  34 + <a-button @click="handleAdd" v-has="'agvPort:add'" type="primary" icon="plus">新增</a-button>
35 35 <a-button type="primary" icon="download" @click="handleExportXls('AGV点位')">导出</a-button>
36 36 <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
37 37 <a-button type="primary" icon="import">导入</a-button>
... ... @@ -40,7 +40,7 @@
40 40 <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
41 41 <a-dropdown v-if="selectedRowKeys.length > 0">
42 42 <a-menu slot="overlay">
43   - <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  43 + <a-menu-item key="1" v-has="'agvPort:delete'" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
44 44 </a-menu>
45 45 <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
46 46 </a-dropdown>
... ... @@ -88,7 +88,7 @@
88 88 </template>
89 89  
90 90 <span slot="action" slot-scope="text, record">
91   - <a @click="handleEdit(record)">编辑</a>
  91 + <a v-has="'agvPort:edit'" @click="handleEdit(record)">编辑</a>
92 92  
93 93 <a-divider type="vertical" />
94 94 <a-dropdown>
... ... @@ -98,7 +98,7 @@
98 98 <a @click="handleDetail(record)">详情</a>
99 99 </a-menu-item>
100 100 <a-menu-item>
101   - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  101 + <a-popconfirm title="确定删除吗?" v-has="'agvPort:delete'" @confirm="() => handleDelete(record.id)">
102 102 <a>删除</a>
103 103 </a-popconfirm>
104 104 </a-menu-item>
... ... @@ -191,7 +191,7 @@
191 191 deleteBatch: "/config/agvPort/deleteBatch",
192 192 exportXlsUrl: "/config/agvPort/exportXls",
193 193 importExcelUrl: "config/agvPort/importExcel",
194   -
  194 +
195 195 },
196 196 dictOptions:{},
197 197 superFieldList:[],
... ...
ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue
... ... @@ -48,19 +48,19 @@
48 48  
49 49 <!-- 操作按钮区域 -->
50 50 <div class="table-operator">
51   - <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  51 + <a-button v-has="'agvTask:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
52 52 <a-button type="primary" icon="download" @click="handleExportXls('AGV任务')">导出</a-button>
53 53 <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
54 54 <a-button type="primary" icon="import">导入</a-button>
55 55 </a-upload>
56 56 <!-- 高级查询区域 -->
57 57 <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
58   - <a-dropdown v-if="selectedRowKeys.length > 0">
59   - <a-menu slot="overlay">
60   - <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
61   - </a-menu>
62   - <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
63   - </a-dropdown>
  58 +<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
  59 +<!-- <a-menu slot="overlay">-->
  60 +<!-- <a-menu-item key="1" v-has="'agvTask:delete'" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
  61 +<!-- </a-menu>-->
  62 +<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
  63 +<!-- </a-dropdown>-->
64 64 </div>
65 65  
66 66 <!-- table区域-begin -->
... ... @@ -105,9 +105,14 @@
105 105 </template>
106 106  
107 107 <span slot="action" slot-scope="text, record">
108   - <a @click="handleEdit(record)">编辑</a>
109   -
110   - <a-divider type="vertical" />
  108 + <a v-if="record.status == 1" v-has="'agvTask:executeTask'" @click="executeAgvTask(record)">执行</a>
  109 + <a-divider type="vertical"/>
  110 + <a-popconfirm v-if="record.status < 100" title="确定删除吗?" v-has="'agvTask:delete'" @confirm="() => handleDelete(record.id)">
  111 + <a>删除</a>
  112 + </a-popconfirm>
  113 + <a-divider type="vertical"/>
  114 + <a v-if="record.status < 100" v-has="'agvTask:completeTask'" @click="completeAgvTask(record)">完成</a>
  115 + <a-divider type="vertical"/>
111 116 <a-dropdown>
112 117 <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
113 118 <a-menu slot="overlay">
... ... @@ -115,9 +120,7 @@
115 120 <a @click="handleDetail(record)">详情</a>
116 121 </a-menu-item>
117 122 <a-menu-item>
118   - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
119   - <a>删除</a>
120   - </a-popconfirm>
  123 + <a v-has="'agvTask:edit'" @click="handleEdit(record)">编辑</a>
121 124 </a-menu-item>
122 125 </a-menu>
123 126 </a-dropdown>
... ... @@ -137,6 +140,8 @@
137 140 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
138 141 import AgvTaskModal from './modules/AgvTaskModal'
139 142 import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  143 + import {executeAgv} from '@/api/api'
  144 + import {completeAgv, cancelAgv} from '@/api/api'
140 145  
141 146 export default {
142 147 name: 'AgvTaskList',
... ... @@ -150,14 +155,9 @@
150 155 // 表头
151 156 columns: [
152 157 {
153   - title: '#',
154   - dataIndex: '',
155   - key:'rowIndex',
156   - width:60,
157   - align:"center",
158   - customRender:function (t,r,index) {
159   - return parseInt(index)+1;
160   - }
  158 + title: '任务ID',
  159 + align: "center",
  160 + dataIndex: 'id',
161 161 },
162 162 {
163 163 title:'任务类型',
... ... @@ -246,6 +246,45 @@
246 246 methods: {
247 247 initDictConfig(){
248 248 },
  249 + executeAgvTask(record) {
  250 + this.loading = true;
  251 + this.model = Object.assign({}, record);
  252 + executeAgv(this.model.id).then((res) => {
  253 + this.loading = false;
  254 + if (res.success) {
  255 + this.$message.success(res.message);
  256 + } else {
  257 + this.$message.error(res.message);
  258 + }
  259 + this.searchQuery();
  260 + });
  261 + },
  262 + completeAgvTask(record) {
  263 + this.loading = true;
  264 + this.model = Object.assign({}, record);
  265 + completeAgv(this.model.id).then((res) => {
  266 + this.loading = false;
  267 + if (res.success) {
  268 + this.$message.success(res.message);
  269 + } else {
  270 + this.$message.error(res.message);
  271 + }
  272 + this.searchQuery();
  273 + });
  274 + },
  275 + cancelAgvTask(record) {
  276 + this.loading = true;
  277 + this.model = Object.assign({}, record);
  278 + cancelAgv(this.model.id).then((res) => {
  279 + this.loading = false;
  280 + if (res.success) {
  281 + this.$message.success(res.message);
  282 + } else {
  283 + this.$message.error(res.message);
  284 + }
  285 + this.searchQuery();
  286 + });
  287 + },
249 288 getSuperFieldList(){
250 289 let fieldList=[];
251 290 fieldList.push({type:'string',value:'warehouseCode',text:'仓库编码',dictCode:''})
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/controller/AcsController.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.acs.controller;
  2 +
  3 +import javax.annotation.Resource;
  4 +
  5 +import org.jeecg.common.api.vo.Result;
  6 +import org.jeecg.modules.wms.api.acs.entity.AcsStatus;
  7 +import org.jeecg.modules.wms.api.acs.service.IAcsService;
  8 +import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger;
  9 +import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
  10 +import org.jeecg.modules.wms.task.agvTask.service.IAgvTaskService;
  11 +import org.jeecg.utils.constant.QuantityConstant;
  12 +import org.springframework.transaction.annotation.Transactional;
  13 +import org.springframework.web.bind.annotation.*;
  14 +
  15 +import io.swagger.annotations.ApiOperation;
  16 +
  17 +@RestController
  18 +@RequestMapping("/API/WMS/acs")
  19 +public class AcsController extends HuahengBaseController {
  20 +
  21 + @Resource
  22 + private IAcsService acsService;
  23 + @Resource
  24 + private IAgvTaskService agvTaskService;
  25 +
  26 + @PostMapping("/notifyAGVTask")
  27 + @ApiOperation("更新AGV状态")
  28 + @ResponseBody
  29 + @ApiLogger(apiName = "更新AGV状态", from = "ACS")
  30 + @Transactional(rollbackFor = Exception.class)
  31 + public Result notifyAGVTask(@RequestBody AcsStatus acsStatus) {
  32 + if (acsStatus == null) {
  33 + return Result.error("更新AGV状态,数据为空");
  34 + }
  35 + String taskNo = acsStatus.getTaskNo();
  36 + String carNo = acsStatus.getCarNo();
  37 + int status = acsStatus.getStatus();
  38 + String updateBy = acsStatus.getUpdateBy();
  39 + if (taskNo == null) {
  40 + return Result.error("更新AGV状态,任务号为空");
  41 + }
  42 + if (carNo == null) {
  43 + return Result.error("更新AGV状态,车辆编号为空");
  44 + }
  45 + if (status == 0) {
  46 + return Result.error("更新AGV状态,状态信息为空");
  47 + }
  48 + if (updateBy == null) {
  49 + return Result.error("更新AGV状态,更新者信息为空");
  50 + }
  51 + if (status == QuantityConstant.TASK_STATUS_COMPLETED) {
  52 + Result result = agvTaskService.completeAgvTask(Integer.parseInt(taskNo));
  53 + return result;
  54 + }
  55 + Result result = acsService.notifyAGVTask(taskNo, carNo, status, updateBy);
  56 + return result;
  57 + }
  58 +
  59 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/entity/AcsStatus.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.acs.entity;
  2 +
  3 +import lombok.Data;
  4 +
  5 +/**
  6 + * @author 游杰
  7 + */
  8 +@Data
  9 +public class AcsStatus {
  10 +
  11 + private String taskNo;
  12 + private String carNo;
  13 + private int status;
  14 + private String updateBy;
  15 +
  16 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/entity/AgvEntity.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.acs.entity;
  2 +
  3 +import lombok.Data;
  4 +
  5 +/**
  6 + * @author 游杰
  7 + */
  8 +@Data
  9 +public class AgvEntity {
  10 +
  11 + private Integer taskNo;
  12 + private Integer preTaskNo;
  13 + private Integer taskType;
  14 + private String containerCode;
  15 + private String fromPort;
  16 + private String toPort;
  17 + private Integer priority;
  18 + private String createdBy;
  19 +
  20 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/service/IAcsService.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.acs.service;
  2 +
  3 +import org.jeecg.common.api.vo.Result;
  4 +import org.jeecg.modules.wms.task.agvTask.entity.AgvTask;
  5 +
  6 +public interface IAcsService {
  7 +
  8 + Result executeAGVTask(AgvTask agvTask);
  9 +
  10 + Result cancelAGVTask(AgvTask agvTask);
  11 +
  12 + Result updateAGVTask(AgvTask agvTask);
  13 +
  14 + Result notifyAGVTask(String taskNo, String carNo, int status, String updateBy);
  15 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/service/impl/AcsServiceImpl.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.acs.service.impl;
  2 +
  3 +import javax.annotation.Resource;
  4 +
  5 +import org.jeecg.common.api.vo.Result;
  6 +import org.jeecg.modules.wms.api.acs.entity.AgvEntity;
  7 +import org.jeecg.modules.wms.api.acs.service.IAcsService;
  8 +import org.jeecg.modules.wms.config.address.service.IAddressService;
  9 +import org.jeecg.modules.wms.config.location.entity.Location;
  10 +import org.jeecg.modules.wms.config.location.service.ILocationService;
  11 +import org.jeecg.modules.wms.task.agvTask.entity.AgvTask;
  12 +import org.jeecg.modules.wms.task.agvTask.service.IAgvTaskService;
  13 +import org.jeecg.utils.StringUtils;
  14 +import org.jeecg.utils.constant.QuantityConstant;
  15 +import org.jeecg.utils.http.OkHttpUtils;
  16 +import org.springframework.stereotype.Service;
  17 +
  18 +import com.alibaba.fastjson.JSON;
  19 +import com.aliyun.oss.ServiceException;
  20 +
  21 +@Service
  22 +public class AcsServiceImpl implements IAcsService {
  23 +
  24 + @Resource
  25 + private ILocationService locationService;
  26 + @Resource
  27 + private IAgvTaskService agvTaskService;
  28 + @Resource
  29 + private IAddressService addressService;
  30 +
  31 + @Override
  32 + public Result executeAGVTask(AgvTask agvTask) {
  33 + String fromPort = agvTask.getFromPort();
  34 + String toPort = agvTask.getToPort();
  35 + String warehouseCode = agvTask.getWarehouseCode();
  36 + if (StringUtils.isEmpty(fromPort)) {
  37 + return Result.error("创建AGV任务失败,起点为空");
  38 + }
  39 +
  40 + if (StringUtils.isEmpty(toPort)) {
  41 + return Result.error("创建AGV任务失败,终点为空");
  42 + }
  43 +
  44 + int preTaskNo = 0;
  45 + Location fromLocation = locationService.getLocationByCode(fromPort, warehouseCode);
  46 + if (fromLocation != null) {
  47 + int row = fromLocation.getRow();
  48 + int icolumn = fromLocation.getIcolumn();
  49 + int layer = fromLocation.getLayer();
  50 + icolumn = icolumn - 1;
  51 + Location location = locationService.getLocationByCode(row, icolumn, layer, warehouseCode);
  52 + if (location != null) {
  53 + String locationCode = location.getCode();
  54 + AgvTask agvTask1 = agvTaskService.getAgvTaskByPort(locationCode, warehouseCode);
  55 + if (agvTask1 != null) {
  56 + preTaskNo = agvTask1.getId();
  57 + }
  58 + }
  59 + }
  60 + Location toLocation = locationService.getLocationByCode(toPort, warehouseCode);
  61 + agvTask.setPreTaskNo(preTaskNo);
  62 + boolean success = agvTaskService.updateById(agvTask);
  63 + if (!success) {
  64 + throw new ServiceException("更新Agv任务状态失败");
  65 + }
  66 + AgvEntity agvEntity = new AgvEntity();
  67 + agvEntity.setTaskNo(agvTask.getId());
  68 + agvEntity.setPreTaskNo(agvTask.getPreTaskNo());
  69 + agvEntity.setContainerCode(agvTask.getContainerCode());
  70 + agvEntity.setFromPort(agvTask.getFromPort());
  71 + agvEntity.setToPort(agvTask.getToPort());
  72 + agvEntity.setTaskType(agvTask.getTaskType());
  73 + agvEntity.setCreatedBy(agvTask.getCreateBy());
  74 +
  75 + String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_AGV_TASK_ASSIGN);
  76 + String jsonParam = JSON.toJSONString(agvEntity);
  77 + System.out.println(jsonParam);
  78 + String body = OkHttpUtils.bodypost(url, jsonParam);
  79 + if (StringUtils.isEmpty(body)) {
  80 + throw new ServiceException("接口地址错误或返回为空");
  81 + }
  82 + Result result = JSON.parseObject(body, Result.class);
  83 + if (result.getCode() != QuantityConstant.HTTP_OK) {
  84 + return Result.error(result.getMessage());
  85 + }
  86 + return Result.ok("创建AGV任务成功");
  87 + }
  88 +
  89 + @Override
  90 + public Result cancelAGVTask(AgvTask agvTask) {
  91 + AgvEntity agvEntity = new AgvEntity();
  92 + agvEntity.setTaskNo(agvTask.getId());
  93 + String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_AGV_TASK_CANCEL);
  94 + String jsonParam = JSON.toJSONString(agvEntity);
  95 + String body = OkHttpUtils.bodypost(url, jsonParam);
  96 + if (StringUtils.isEmpty(body)) {
  97 + throw new ServiceException("接口地址错误或返回为空");
  98 + }
  99 + Result result = JSON.parseObject(body, Result.class);
  100 + if (result.getCode() != QuantityConstant.HTTP_OK) {
  101 + return Result.error(result.getMessage());
  102 + }
  103 + return Result.OK("取消AGV任务成功");
  104 + }
  105 +
  106 + @Override
  107 + public Result updateAGVTask(AgvTask agvTask) {
  108 + AgvEntity agvEntity = new AgvEntity();
  109 + agvEntity.setTaskNo(agvTask.getId());
  110 + agvEntity.setPriority(agvTask.getPriority());
  111 + String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_AGV_TASK_UPDATE);
  112 + String jsonParam = JSON.toJSONString(agvEntity);
  113 + String body = OkHttpUtils.bodypost(url, jsonParam);
  114 + if (StringUtils.isEmpty(body)) {
  115 + throw new ServiceException("接口地址错误或返回为空");
  116 + }
  117 + Result result = JSON.parseObject(body, Result.class);
  118 + if (result.getCode() != QuantityConstant.HTTP_OK) {
  119 + return Result.error(result.getMessage());
  120 + }
  121 + return Result.ok("更新AGV任务成功");
  122 + }
  123 +
  124 + @Override
  125 + public Result notifyAGVTask(String taskNo, String carNo, int status, String updateBy) {
  126 + AgvTask agvTask = agvTaskService.getById(taskNo);
  127 + if (agvTask == null) {
  128 + return Result.error("没有找到对应AGV任务,任务号为" + taskNo);
  129 + }
  130 + agvTask.setStatus(status);
  131 + agvTask.setCarno(carNo);
  132 + agvTask.setUpdateBy(updateBy);
  133 + boolean result = agvTaskService.updateById(agvTask);
  134 + if (!result) {
  135 + return Result.error("更新任务信息失败 ");
  136 + }
  137 + return Result.ok("更新任务信息成功");
  138 + }
  139 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/agvPort/controller/AgvPortController.java
... ... @@ -5,6 +5,7 @@ import java.util.Arrays;
5 5 import javax.servlet.http.HttpServletRequest;
6 6 import javax.servlet.http.HttpServletResponse;
7 7  
  8 +import org.apache.shiro.authz.annotation.RequiresPermissions;
8 9 import org.jeecg.common.api.vo.Result;
9 10 import org.jeecg.common.aspect.annotation.AutoLog;
10 11 import org.jeecg.common.system.base.controller.JeecgController;
... ... @@ -64,6 +65,7 @@ public class AgvPortController extends JeecgController&lt;AgvPort, IAgvPortService&gt;
64 65 @AutoLog(value = "AGV点位-添加")
65 66 @ApiOperation(value = "AGV点位-添加", notes = "AGV点位-添加")
66 67 @PostMapping(value = "/add")
  68 + @RequiresPermissions("agvPort:add")
67 69 public Result<String> add(@RequestBody AgvPort agvPort) {
68 70 agvPortService.save(agvPort);
69 71 return Result.OK("添加成功!");
... ... @@ -77,6 +79,7 @@ public class AgvPortController extends JeecgController&lt;AgvPort, IAgvPortService&gt;
77 79 @AutoLog(value = "AGV点位-编辑")
78 80 @ApiOperation(value = "AGV点位-编辑", notes = "AGV点位-编辑")
79 81 @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
  82 + @RequiresPermissions("agvPort:edit")
80 83 public Result<String> edit(@RequestBody AgvPort agvPort) {
81 84 agvPortService.updateById(agvPort);
82 85 return Result.OK("编辑成功!");
... ... @@ -90,6 +93,7 @@ public class AgvPortController extends JeecgController&lt;AgvPort, IAgvPortService&gt;
90 93 @AutoLog(value = "AGV点位-通过id删除")
91 94 @ApiOperation(value = "AGV点位-通过id删除", notes = "AGV点位-通过id删除")
92 95 @DeleteMapping(value = "/delete")
  96 + @RequiresPermissions("agvPort:delete")
93 97 public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
94 98 agvPortService.removeById(id);
95 99 return Result.OK("删除成功!");
... ... @@ -103,6 +107,7 @@ public class AgvPortController extends JeecgController&lt;AgvPort, IAgvPortService&gt;
103 107 @AutoLog(value = "AGV点位-批量删除")
104 108 @ApiOperation(value = "AGV点位-批量删除", notes = "AGV点位-批量删除")
105 109 @DeleteMapping(value = "/deleteBatch")
  110 + @RequiresPermissions("agvPort:delete")
106 111 public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
107 112 this.agvPortService.removeByIds(Arrays.asList(ids.split(",")));
108 113 return Result.OK("批量删除成功!");
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java
... ... @@ -12,6 +12,7 @@ import org.jeecg.modules.wms.config.container.entity.Container;
12 12 import org.jeecg.modules.wms.config.container.mapper.ContainerMapper;
13 13 import org.jeecg.modules.wms.config.container.service.IContainerService;
14 14 import org.jeecg.modules.wms.config.containerType.service.IContainerTypeService;
  15 +import org.jeecg.utils.StringUtils;
15 16 import org.jeecg.utils.constant.QuantityConstant;
16 17 import org.springframework.stereotype.Service;
17 18  
... ... @@ -82,9 +83,12 @@ public class ContainerServiceImpl extends ServiceImpl&lt;ContainerMapper, Container
82 83 if (container == null) {
83 84 return false;
84 85 }
85   - boolean success = havaLocationCodeByContainer(locationCode, warehouseCode);
86   - if (!success) {
87   - throw new ServiceException("取消任务时, 库位表已经存在这个容器号,不能再写入");
  86 + boolean success = false;
  87 + if (StringUtils.isNotEmpty(locationCode)) {
  88 + success = havaLocationCodeByContainer(locationCode, warehouseCode);
  89 + if (!success) {
  90 + throw new ServiceException("取消任务时, 库位表已经存在这个容器号,不能再写入");
  91 + }
88 92 }
89 93 container.setStatus(status);
90 94 container.setLocationCode(locationCode);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java
... ... @@ -21,6 +21,8 @@ public interface ILocationService extends IService&lt;Location&gt; {
21 21  
22 22 Location getLocationByCode(String locationCode, String warehouseCode);
23 23  
  24 + Location getLocationByCode(int row, int column, int layer, String warehouseCode);
  25 +
24 26 List<Location> getLocationListByZoneCode(String zoneCode, String warehouseCode);
25 27  
26 28 boolean updateStatus(String locationCode, String status, String warehouseCode);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
... ... @@ -59,6 +59,15 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i
59 59 }
60 60  
61 61 @Override
  62 + public Location getLocationByCode(int row, int column, int layer, String warehouseCode) {
  63 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  64 + locationLambdaQueryWrapper.eq(Location::getRow, row).eq(Location::getIcolumn, column).eq(Location::getLayer, layer)
  65 + .eq(Location::getEnable, QuantityConstant.STATUS_ENABLE).eq(Location::getWarehouseCode, warehouseCode);
  66 + Location location = this.getOne(locationLambdaQueryWrapper);
  67 + return location;
  68 + }
  69 +
  70 + @Override
62 71 public List<Location> getLocationListByZoneCode(String zoneCode, String warehouseCode) {
63 72 LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
64 73 locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode).eq(Location::getEnable, QuantityConstant.STATUS_ENABLE).eq(Location::getWarehouseCode,
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/controller/AgvTaskController.java
1 1 package org.jeecg.modules.wms.task.agvTask.controller;
2 2  
3   -import java.util.Arrays;
4   -
5 3 import javax.servlet.http.HttpServletRequest;
6 4 import javax.servlet.http.HttpServletResponse;
7 5  
  6 +import org.apache.shiro.authz.annotation.RequiresPermissions;
8 7 import org.jeecg.common.api.vo.Result;
9 8 import org.jeecg.common.aspect.annotation.AutoLog;
10 9 import org.jeecg.common.system.base.controller.JeecgController;
... ... @@ -12,7 +11,6 @@ import org.jeecg.common.system.query.QueryGenerator;
12 11 import org.jeecg.modules.wms.task.agvTask.entity.AgvTask;
13 12 import org.jeecg.modules.wms.task.agvTask.service.IAgvTaskService;
14 13 import org.jeecg.utils.HuahengJwtUtil;
15   -import org.jeecg.utils.constant.QuantityConstant;
16 14 import org.springframework.beans.factory.annotation.Autowired;
17 15 import org.springframework.web.bind.annotation.*;
18 16 import org.springframework.web.servlet.ModelAndView;
... ... @@ -68,12 +66,8 @@ public class AgvTaskController extends JeecgController&lt;AgvTask, IAgvTaskService&gt;
68 66 @PostMapping(value = "/add")
69 67 public Result<String> add(@RequestBody AgvTask agvTask, HttpServletRequest req) {
70 68 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
71   - agvTask.setWarehouseCode(warehouseCode);
72   - agvTask.setTaskType(QuantityConstant.AGV_TYPE_TAKE_AND_RELEASE);
73   - agvTask.setStatus(QuantityConstant.AGV_TASK_STATUS_BUILD);
74   - agvTask.setPriority(10);
75   - agvTaskService.save(agvTask);
76   - return Result.OK("添加成功!");
  69 + Result result = agvTaskService.addAgvTask(agvTask, warehouseCode);
  70 + return result;
77 71 }
78 72  
79 73 /**
... ... @@ -97,23 +91,24 @@ public class AgvTaskController extends JeecgController&lt;AgvTask, IAgvTaskService&gt;
97 91 @AutoLog(value = "AGV任务-通过id删除")
98 92 @ApiOperation(value = "AGV任务-通过id删除", notes = "AGV任务-通过id删除")
99 93 @DeleteMapping(value = "/delete")
100   - public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
101   - agvTaskService.removeById(id);
102   - return Result.OK("删除成功!");
  94 + @RequiresPermissions("agvTask:delete")
  95 + public Result<String> delete(@RequestParam(name = "id", required = true) Integer id) {
  96 + Result result = agvTaskService.cancelAgvTask(id);
  97 + return result;
103 98 }
104 99  
105   - /**
106   - * 批量删除
107   - * @param ids
108   - * @return
109   - */
110   - @AutoLog(value = "AGV任务-批量删除")
111   - @ApiOperation(value = "AGV任务-批量删除", notes = "AGV任务-批量删除")
112   - @DeleteMapping(value = "/deleteBatch")
113   - public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
114   - this.agvTaskService.removeByIds(Arrays.asList(ids.split(",")));
115   - return Result.OK("批量删除成功!");
116   - }
  100 +// /**
  101 +// * 批量删除
  102 +// * @param ids
  103 +// * @return
  104 +// */
  105 +// @AutoLog(value = "AGV任务-批量删除")
  106 +// @ApiOperation(value = "AGV任务-批量删除", notes = "AGV任务-批量删除")
  107 +// @DeleteMapping(value = "/deleteBatch")
  108 +// public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
  109 +// this.agvTaskService.removeByIds(Arrays.asList(ids.split(",")));
  110 +// return Result.OK("批量删除成功!");
  111 +// }
117 112  
118 113 /**
119 114 * 通过id查询
... ... @@ -152,4 +147,28 @@ public class AgvTaskController extends JeecgController&lt;AgvTask, IAgvTaskService&gt;
152 147 return super.importExcel(request, response, AgvTask.class);
153 148 }
154 149  
  150 + /**
  151 + * 执行任务
  152 + */
  153 + @AutoLog(value = "AGV任务-执行任务")
  154 + @ApiOperation(value = "AGV任务-执行任务", notes = "AGV任务-执行任务")
  155 + @PostMapping("/execute")
  156 + @RequiresPermissions("agvTask:executeTask")
  157 + public Result execute(@RequestParam(name = "ids", required = true) Integer ids) {
  158 + Result result = agvTaskService.sendAgvTaskToAcs(ids);
  159 + return result;
  160 + }
  161 +
  162 + /**
  163 + * 完成任务
  164 + */
  165 + @AutoLog(value = "AGV任务-完成任务")
  166 + @ApiOperation(value = "AGV任务-完成任务", notes = "AGV任务-完成任务")
  167 + @PostMapping("/complete")
  168 + @RequiresPermissions("agvTask:completeTask")
  169 + public Result complete(@RequestParam(name = "ids", required = true) Integer ids) {
  170 + Result result = agvTaskService.completeAgvTask(ids);
  171 + return result;
  172 + }
  173 +
155 174 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/service/IAgvTaskService.java
1 1 package org.jeecg.modules.wms.task.agvTask.service;
2 2  
  3 +import org.jeecg.common.api.vo.Result;
3 4 import org.jeecg.modules.wms.task.agvTask.entity.AgvTask;
4 5  
5 6 import com.baomidou.mybatisplus.extension.service.IService;
... ... @@ -12,4 +13,29 @@ import com.baomidou.mybatisplus.extension.service.IService;
12 13 */
13 14 public interface IAgvTaskService extends IService<AgvTask> {
14 15  
  16 + /**
  17 + * 新建AGV任务
  18 + */
  19 + public Result addAgvTask(AgvTask agvTask, String warehouseCode);
  20 +
  21 + /**
  22 + * 下发AGV任务给ACS系统
  23 + */
  24 + public Result sendAgvTaskToAcs(Integer taskId);
  25 +
  26 + /**
  27 + * 完成AGV任务
  28 + */
  29 + public Result completeAgvTask(Integer taskId);
  30 +
  31 + /**
  32 + * 取消AGV任务
  33 + */
  34 + public Result cancelAgvTask(Integer taskId);
  35 +
  36 + public AgvTask getAgvTaskByPort(String portCode, String warehouseCode);
  37 +
  38 + public AgvTask getAgvTaskBuFromPort(String fromPortCode, String warehouseCode);
  39 +
  40 + public AgvTask getAgvTaskBuToPort(String toPortCode, String warehouseCode);
15 41 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/service/impl/AgvTaskServiceImpl.java
1 1 package org.jeecg.modules.wms.task.agvTask.service.impl;
2 2  
  3 +import java.util.List;
  4 +
  5 +import javax.annotation.Resource;
  6 +
  7 +import org.jeecg.common.api.vo.Result;
  8 +import org.jeecg.common.exception.JeecgBootException;
  9 +import org.jeecg.modules.wms.api.acs.service.IAcsService;
  10 +import org.jeecg.modules.wms.config.container.entity.Container;
  11 +import org.jeecg.modules.wms.config.container.service.IContainerService;
  12 +import org.jeecg.modules.wms.config.location.entity.Location;
  13 +import org.jeecg.modules.wms.config.location.service.ILocationService;
  14 +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
  15 +import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
3 16 import org.jeecg.modules.wms.task.agvTask.entity.AgvTask;
4 17 import org.jeecg.modules.wms.task.agvTask.mapper.AgvTaskMapper;
5 18 import org.jeecg.modules.wms.task.agvTask.service.IAgvTaskService;
  19 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
  20 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
  21 +import org.jeecg.utils.constant.QuantityConstant;
6 22 import org.springframework.stereotype.Service;
  23 +import org.springframework.transaction.annotation.Transactional;
7 24  
  25 +import com.aliyun.oss.ServiceException;
  26 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  27 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
8 28 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9 29  
10 30 /**
... ... @@ -16,4 +36,183 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
16 36 @Service
17 37 public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> implements IAgvTaskService {
18 38  
  39 + @Resource
  40 + private IAcsService acsService;
  41 + @Resource
  42 + private ILocationService locationService;
  43 + @Resource
  44 + private IContainerService containerService;
  45 + @Resource
  46 + private ITaskHeaderService taskHeaderService;
  47 + @Resource
  48 + private IInventoryDetailService inventoryDetailService;
  49 +
  50 + @Override
  51 + public Result addAgvTask(AgvTask agvTask, String warehouseCode) {
  52 + agvTask.setWarehouseCode(warehouseCode);
  53 + agvTask.setTaskType(QuantityConstant.AGV_TYPE_TAKE_AND_RELEASE);
  54 + agvTask.setStatus(QuantityConstant.AGV_TASK_STATUS_BUILD);
  55 + agvTask.setPriority(10);
  56 + boolean success = save(agvTask);
  57 + if (!success) {
  58 + return Result.OK("添加失败");
  59 + }
  60 + return Result.OK("添加成功");
  61 + }
  62 +
  63 + @Override
  64 + @Transactional(rollbackFor = JeecgBootException.class)
  65 + public Result sendAgvTaskToAcs(Integer taskId) {
  66 + AgvTask agvTask = getById(taskId);
  67 + if (agvTask == null) {
  68 + return Result.error("没有找到agv任务,任务id:" + taskId);
  69 + }
  70 + Result result = acsService.executeAGVTask(agvTask);
  71 + if (result.isSuccess()) {
  72 + agvTask.setStatus(QuantityConstant.AGV_TASK_STATUS_RELEASE);
  73 + boolean success = updateById(agvTask);
  74 + if (!success) {
  75 + throw new ServiceException("更新AGV任务状态失败");
  76 + }
  77 + }
  78 + return result;
  79 + }
  80 +
  81 + @Override
  82 + @Transactional(rollbackFor = JeecgBootException.class)
  83 + public Result completeAgvTask(Integer taskId) {
  84 + boolean success = false;
  85 + AgvTask agvTask = getById(taskId);
  86 + if (agvTask == null) {
  87 + return Result.error("没有找到agv任务,任务id:" + taskId);
  88 + }
  89 + int status = agvTask.getStatus();
  90 + if (status == QuantityConstant.TASK_STATUS_COMPLETED) {
  91 + return Result.error("任务已经完成,任务id:" + taskId);
  92 + }
  93 +
  94 + String fromPort = agvTask.getFromPort();
  95 + String toPort = agvTask.getToPort();
  96 + String warehouseCode = agvTask.getWarehouseCode();
  97 + String containerCode = agvTask.getContainerCode();
  98 + Location fromLocation = locationService.getLocationByCode(fromPort, warehouseCode);
  99 + if (fromLocation != null) {
  100 + success = locationService.updateContainerCodeAndStatus(fromPort, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  101 + if (!success) {
  102 + throw new ServiceException("完成AGV任务时,更新起始库位数据失败");
  103 + }
  104 + } else {
  105 + fromPort = QuantityConstant.EMPTY_STRING;
  106 + }
  107 + Location toLocation = locationService.getLocationByCode(toPort, warehouseCode);
  108 + if (toLocation != null) {
  109 + success = locationService.updateContainerCodeAndStatus(toPort, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  110 + if (!success) {
  111 + throw new ServiceException("完成AGV任务时,更新终点库位数据失败");
  112 + }
  113 + } else {
  114 + toPort = QuantityConstant.EMPTY_STRING;
  115 + }
  116 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  117 + if (container == null) {
  118 + throw new ServiceException("完成AGV任务时,根据容器号没有找到容器");
  119 + }
  120 + success = containerService.updateLocationCodeAndStatus(containerCode, toPort, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
  121 + if (!success) {
  122 + throw new ServiceException("完成AGV任务时,更新容器数据失败");
  123 + }
  124 + agvTask.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
  125 + success = updateById(agvTask);
  126 + if (!success) {
  127 + throw new ServiceException("完成AGV任务时, 更新AGV任务失败");
  128 + }
  129 + TaskHeader taskHeader = taskHeaderService.getTaskHeaderByAgvTaskId(taskId);
  130 + if (taskHeader != null) {
  131 + Result result = taskHeaderService.completeTaskByWMS(taskHeader.getId());
  132 + if (!result.isSuccess()) {
  133 + throw new ServiceException("完成AGV任务时, 完成WCS任务失败");
  134 + }
  135 + }
  136 +
  137 + return Result.ok("完成AGV任务成功");
  138 + }
  139 +
  140 + @Override
  141 + @Transactional(rollbackFor = JeecgBootException.class)
  142 + public Result cancelAgvTask(Integer taskId) {
  143 + AgvTask agvTask = getById(taskId);
  144 + if (agvTask == null) {
  145 + return Result.error("没有找到agv任务,任务id:" + taskId);
  146 + }
  147 + String fromPort = agvTask.getFromPort();
  148 + String toPort = agvTask.getToPort();
  149 + String warehouseCode = agvTask.getWarehouseCode();
  150 + String containerCode = agvTask.getContainerCode();
  151 +
  152 + boolean success = false;
  153 + Location fromLocation = locationService.getLocationByCode(fromPort, warehouseCode);
  154 + if (fromLocation != null) {
  155 + success = locationService.updateContainerCodeAndStatus(fromPort, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  156 + if (!success) {
  157 + throw new ServiceException("取消AGV任务。 更新起始库位状态失败");
  158 + }
  159 + }
  160 + Location toLocation = locationService.getLocationByCode(toPort, warehouseCode);
  161 + if (toLocation != null) {
  162 + success = locationService.updateContainerCodeAndStatus(toPort, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  163 + if (!success) {
  164 + throw new ServiceException("取消AGV任务。 更新终点库位状态失败");
  165 + }
  166 + }
  167 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  168 + if (container == null) {
  169 + throw new ServiceException("取消AGV任务。 根据容器号没有找到容器");
  170 + }
  171 + String containerStatus = QuantityConstant.STATUS_CONTAINER_EMPTY;
  172 + List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, warehouseCode);
  173 + if (inventoryDetailList.size() != 0) {
  174 + containerStatus = QuantityConstant.STATUS_CONTAINER_SOME;
  175 + }
  176 + success = containerService.updateStatus(containerCode, containerStatus, warehouseCode);
  177 + if (!success) {
  178 + throw new ServiceException("取消AGV任务。 更新容器状态失败");
  179 + }
  180 + int status = agvTask.getStatus();
  181 + if (status != QuantityConstant.AGV_TASK_STATUS_BUILD) {
  182 + Result result = acsService.cancelAGVTask(agvTask);
  183 + if (!result.isSuccess()) {
  184 + throw new ServiceException(result.getMessage());
  185 + }
  186 + }
  187 + success = removeById(taskId);
  188 + if (!success) {
  189 + throw new ServiceException("取消agv任务失败,任务id:" + taskId);
  190 + }
  191 + return Result.ok("取消AGV任务成功");
  192 + }
  193 +
  194 + @Override
  195 + public AgvTask getAgvTaskByPort(String portCode, String warehouseCode) {
  196 + AgvTask agvTask = getAgvTaskBuFromPort(portCode, warehouseCode);
  197 + if (agvTask == null) {
  198 + agvTask = getAgvTaskBuToPort(portCode, warehouseCode);
  199 + }
  200 + return agvTask;
  201 + }
  202 +
  203 + @Override
  204 + public AgvTask getAgvTaskBuFromPort(String fromPortCode, String warehouseCode) {
  205 + LambdaQueryWrapper<AgvTask> agvTaskLambdaQueryWrapper = Wrappers.lambdaQuery();
  206 + agvTaskLambdaQueryWrapper.eq(AgvTask::getFromPort, fromPortCode).eq(AgvTask::getWarehouseCode, warehouseCode);
  207 + AgvTask agvTask = getOne(agvTaskLambdaQueryWrapper);
  208 + return agvTask;
  209 + }
  210 +
  211 + @Override
  212 + public AgvTask getAgvTaskBuToPort(String toPortCode, String warehouseCode) {
  213 + LambdaQueryWrapper<AgvTask> agvTaskLambdaQueryWrapper = Wrappers.lambdaQuery();
  214 + agvTaskLambdaQueryWrapper.eq(AgvTask::getToPort, toPortCode).eq(AgvTask::getWarehouseCode, warehouseCode);
  215 + AgvTask agvTask = getOne(agvTaskLambdaQueryWrapper);
  216 + return agvTask;
  217 + }
19 218 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java
... ... @@ -7,7 +7,6 @@ import org.jeecg.common.aspect.annotation.Dict;
7 7 import org.jeecgframework.poi.excel.annotation.Excel;
8 8  
9 9 import com.baomidou.mybatisplus.annotation.IdType;
10   -import com.baomidou.mybatisplus.annotation.TableField;
11 10 import com.baomidou.mybatisplus.annotation.TableId;
12 11 import com.baomidou.mybatisplus.annotation.TableName;
13 12  
... ... @@ -104,7 +103,6 @@ public class TaskHeader implements Serializable {
104 103 @ApiModelProperty(value = "目标出入口")
105 104 private String toPortCode;
106 105 @ApiModelProperty(value = "AGV关联任务ID")
107   - @TableField(value = "agvTaskId")
108 106 private int agvTaskId;
109 107 @ApiModelProperty(value = "生成agv任务")
110 108 private Integer sendAgv;
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... ... @@ -35,6 +35,13 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
35 35 boolean haveUncompleteTaskInNear(Location location);
36 36  
37 37 /**
  38 + * 通过AGV任务ID,获取任务信息
  39 + * @param agvTaskId
  40 + * @return
  41 + */
  42 + TaskHeader getTaskHeaderByAgvTaskId(int agvTaskId);
  43 +
  44 + /**
38 45 * 通过起始库位号,获取任务信息
39 46 * @param fromLocationCode
40 47 * @param warehouseCode
... ... @@ -179,6 +186,11 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
179 186 */
180 187 Result createManyEmptyOut(String containerCode, String toPortCode, String warehouseCode);
181 188  
  189 + /**
  190 + * 增加MES次数,每次加一
  191 + * @param taskHeader
  192 + * @return
  193 + */
182 194 Result addMesTryTimes(TaskHeader taskHeader);
183 195  
184 196 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -156,6 +156,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
156 156 }
157 157  
158 158 @Override
  159 + public TaskHeader getTaskHeaderByAgvTaskId(int agvTaskId) {
  160 + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  161 + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getAgvTaskId, agvTaskId);
  162 + TaskHeader taskHeader = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper);
  163 + return taskHeader;
  164 + }
  165 +
  166 + @Override
159 167 @Transactional(rollbackFor = Exception.class)
160 168 public Result createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode) {
161 169 if (StringUtils.isEmpty(fromLocationCode)) {
... ... @@ -1805,9 +1813,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1805 1813 if (StringUtils.isNotEmpty(lastStatus)) {
1806 1814 container.setStatus(lastStatus); // 解决空托盘组移库问题
1807 1815 }
1808   - success = containerService.havaLocationCodeByContainer(fromLocationCode, warehouseCode);
1809   - if (!success) {
1810   - throw new ServiceException("取消任务时, 库位表已经存在这个容器号,不能再写入");
  1816 + if (StringUtils.isNotEmpty(fromLocationCode)) {
  1817 + success = containerService.havaLocationCodeByContainer(fromLocationCode, warehouseCode);
  1818 + if (!success) {
  1819 + throw new ServiceException("取消任务时, 库位表已经存在这个容器号,不能再写入");
  1820 + }
1811 1821 }
1812 1822 container.setLastStatus(QuantityConstant.EMPTY_STRING);
1813 1823 container.setLocationCode(fromLocationCode);
... ...
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... ... @@ -376,8 +376,6 @@ public class QuantityConstant {
376 376  
377 377 // WCS任务下发
378 378 public static final String ADDRESS_WCS_TASK_ASSIGN = "WCS_TASK_ASSIGN";
379   - // WCS任务下发
380   - public static final String ADDRESS_WCS_TASK_LABEL = "WCS_GET_FROM_LABEL";
381 379 // WCS任务取消
382 380 public static final String ADDRESS_WCS_TASK_CANCEL = "WCS_TASK_CANCEL";
383 381 // WCS任务信息查询
... ...