Commit 4bc3e205b39f5261a943fed7fe7332054e75df7d
1 parent
1c9e341c
替代锁定库位的方法
Showing
9 changed files
with
35 additions
and
59 deletions
ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | show-search |
22 | 22 | placeholder="请选择库区" |
23 | 23 | option-filter-prop="children" |
24 | - | |
24 | + | |
25 | 25 | v-model="queryParam.zoneCode"> |
26 | 26 | <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code"> |
27 | 27 | {{item.name}} |
... | ... | @@ -148,20 +148,7 @@ |
148 | 148 | <a-divider type="vertical"/></a> |
149 | 149 | <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 |
150 | 150 | <a-divider type="vertical"/></a> |
151 | - <a v-if="record.status < 100" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消<a-divider type="vertical"/></a> | |
152 | - <a-dropdown> | |
153 | - <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> | |
154 | - <a-menu slot="overlay"> | |
155 | - <a-menu-item v-has="'taskHeader:edit'"> | |
156 | - <a @click="handleEdit(record)">编辑</a> | |
157 | - </a-menu-item> | |
158 | - <a-menu-item v-has="'taskHeader:delete'"> | |
159 | - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
160 | - <a>删除</a> | |
161 | - </a-popconfirm> | |
162 | - </a-menu-item> | |
163 | - </a-menu> | |
164 | - </a-dropdown> | |
151 | + <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消<a-divider type="vertical"/></a> | |
165 | 152 | </span> |
166 | 153 | |
167 | 154 | </a-table> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
... | ... | @@ -141,7 +141,7 @@ |
141 | 141 | <a-divider type="vertical"/></a> |
142 | 142 | <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 |
143 | 143 | <a-divider type="vertical"/></a> |
144 | - <a v-if="record.status < 100" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)" >取消</a> | |
144 | + <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)" >取消</a> | |
145 | 145 | </span> |
146 | 146 | |
147 | 147 | </a-table> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
... | ... | @@ -143,21 +143,8 @@ |
143 | 143 | <a-divider type="vertical"/></a> |
144 | 144 | <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 |
145 | 145 | <a-divider type="vertical"/></a> |
146 | - <a v-if="record.status < 100" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消 | |
146 | + <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消 | |
147 | 147 | <a-divider type="vertical"/></a> |
148 | - <a-dropdown> | |
149 | - <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> | |
150 | - <a-menu slot="overlay"> | |
151 | - <a-menu-item v-has="'taskHeader:edit'"> | |
152 | - <a @click="handleEdit(record)">编辑</a> | |
153 | - </a-menu-item> | |
154 | - <a-menu-item v-has="'taskHeader:delete'"> | |
155 | - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
156 | - <a>删除</a> | |
157 | - </a-popconfirm> | |
158 | - </a-menu-item> | |
159 | - </a-menu> | |
160 | - </a-dropdown> | |
161 | 148 | </span> |
162 | 149 | |
163 | 150 | </a-table> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.vue
... | ... | @@ -147,20 +147,7 @@ |
147 | 147 | <a-divider type="vertical"/></a> |
148 | 148 | <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 |
149 | 149 | <a-divider type="vertical"/></a> |
150 | - <a v-if="record.status < 100" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消<a-divider type="vertical"/></a> | |
151 | - <a-dropdown> | |
152 | - <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> | |
153 | - <a-menu slot="overlay"> | |
154 | - <a-menu-item v-has="'taskHeader:edit'"> | |
155 | - <a @click="handleEdit(record)">编辑</a> | |
156 | - </a-menu-item> | |
157 | - <a-menu-item v-has="'taskHeader:delete'"> | |
158 | - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
159 | - <a>删除</a> | |
160 | - </a-popconfirm> | |
161 | - </a-menu-item> | |
162 | - </a-menu> | |
163 | - </a-dropdown> | |
150 | + <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消<a-divider type="vertical"/></a> | |
164 | 151 | </span> |
165 | 152 | |
166 | 153 | </a-table> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... | ... | @@ -172,7 +172,8 @@ public class WcsServiceImpl implements WcsService { |
172 | 172 | throw new JeecgBootException("分配库位时,更新库位状态失败"); |
173 | 173 | } |
174 | 174 | if (StringUtils.isNotEmpty(taskHeader.getToLocationCode()) && !locationCode.equals(taskHeader.getToLocationCode())) { |
175 | - success = locationService.updateStatus(taskHeader.getToLocationCode(), QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
175 | + success = locationService.updateStatusByOldStatus(taskHeader.getToLocationCode(), QuantityConstant.STATUS_LOCATION_EMPTY, | |
176 | + QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
176 | 177 | if (!success) { |
177 | 178 | throw new JeecgBootException("分配库位时,更新之前分配的库位状态失败"); |
178 | 179 | } |
... | ... | @@ -593,7 +594,8 @@ public class WcsServiceImpl implements WcsService { |
593 | 594 | } |
594 | 595 | } |
595 | 596 | // 6. 锁定WMS分配的库位 |
596 | - boolean success = locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
597 | + boolean success = | |
598 | + locationService.updateStatusByOldStatus(locationCode, QuantityConstant.STATUS_LOCATION_LOCK, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
597 | 599 | if (!success) { |
598 | 600 | throw new JeecgBootException("重入处理失败, 更新库位状态失败"); |
599 | 601 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -127,14 +127,16 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
127 | 127 | String fromLocationCode = receiptContainerHeader.getFromLocationCode(); |
128 | 128 | String toLocaitonCode = receiptContainerHeader.getToLocationCode(); |
129 | 129 | if (StringUtils.isNotEmpty(fromLocationCode)) { |
130 | - success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
130 | + success = locationService.updateStatusByOldStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, QuantityConstant.STATUS_LOCATION_EMPTY, | |
131 | + warehouseCode); | |
131 | 132 | if (!success) { |
132 | 133 | throw new JeecgBootException("更新起始库位状态失败"); |
133 | 134 | } |
134 | 135 | } |
135 | 136 | String zoneCode = null; |
136 | 137 | if (StringUtils.isNotEmpty(toLocaitonCode)) { |
137 | - success = locationService.updateStatus(toLocaitonCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
138 | + success = locationService.updateStatusByOldStatus(toLocaitonCode, QuantityConstant.STATUS_LOCATION_LOCK, QuantityConstant.STATUS_LOCATION_EMPTY, | |
139 | + warehouseCode); | |
138 | 140 | if (!success) { |
139 | 141 | throw new JeecgBootException("更新目标库位状态失败"); |
140 | 142 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -475,7 +475,8 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
475 | 475 | if (!success) { |
476 | 476 | throw new JeecgBootException("生成出库任务时, 更新容器失败" + containerCode); |
477 | 477 | } |
478 | - success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
478 | + success = | |
479 | + locationService.updateStatusByOldStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
479 | 480 | if (!success) { |
480 | 481 | throw new JeecgBootException("生成出库任务时, 更新库位失败" + fromLocationCode); |
481 | 482 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
... | ... | @@ -8,6 +8,7 @@ import java.util.List; |
8 | 8 | import javax.annotation.Resource; |
9 | 9 | |
10 | 10 | import org.jeecg.common.api.vo.Result; |
11 | +import org.jeecg.common.exception.JeecgBootException; | |
11 | 12 | import org.jeecg.modules.wms.config.container.entity.Container; |
12 | 13 | import org.jeecg.modules.wms.config.container.service.impl.ContainerServiceImpl; |
13 | 14 | import org.jeecg.modules.wms.config.location.entity.Location; |
... | ... | @@ -34,7 +35,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
34 | 35 | import org.springframework.stereotype.Service; |
35 | 36 | import org.springframework.transaction.annotation.Transactional; |
36 | 37 | |
37 | -import org.jeecg.common.exception.JeecgBootException; | |
38 | 38 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
39 | 39 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
40 | 40 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
... | ... | @@ -223,8 +223,11 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
223 | 223 | } |
224 | 224 | |
225 | 225 | // 生成任务同时锁定库位 |
226 | - locationService.updateStatus(location.getCode(), QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
227 | - | |
226 | + boolean success = locationService.updateStatusByOldStatus(location.getCode(), QuantityConstant.STATUS_LOCATION_LOCK, QuantityConstant.STATUS_LOCATION_EMPTY, | |
227 | + warehouseCode); | |
228 | + if (!success) { | |
229 | + throw new JeecgBootException("更新库位状态失败"); | |
230 | + } | |
228 | 231 | // 生成任务同时锁定容器 |
229 | 232 | containerServiceImpl.updateStatus(location.getContainerCode(), QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); |
230 | 233 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -352,7 +352,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
352 | 352 | throw new JeecgBootException("创建出库查看任务时,更新库存详情失败"); |
353 | 353 | } |
354 | 354 | } |
355 | - success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
355 | + success = | |
356 | + locationService.updateStatusByOldStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
356 | 357 | if (!success) { |
357 | 358 | throw new JeecgBootException("创建出库查看任务时,更新库位状态失败"); |
358 | 359 | } |
... | ... | @@ -528,7 +529,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
528 | 529 | if (!toLocation.getStatus().equals(QuantityConstant.STATUS_LOCATION_EMPTY)) { |
529 | 530 | return Result.error("创建空托盘组入库任务时,目标库位状态不是空闲"); |
530 | 531 | } |
531 | - success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
532 | + success = locationService.updateStatusByOldStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, QuantityConstant.STATUS_LOCATION_EMPTY, | |
533 | + warehouseCode); | |
532 | 534 | if (!success) { |
533 | 535 | throw new JeecgBootException("创建空托盘组入库任务时, 更新库位状态失败"); |
534 | 536 | } |
... | ... | @@ -584,7 +586,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
584 | 586 | if (!success) { |
585 | 587 | throw new JeecgBootException("创建空托盘组出库任务时, 更新容器状态失败"); |
586 | 588 | } |
587 | - success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
589 | + success = | |
590 | + locationService.updateStatusByOldStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
588 | 591 | if (!success) { |
589 | 592 | throw new JeecgBootException("创建空托盘组出库任务时, 更新库位状态失败"); |
590 | 593 | } |
... | ... | @@ -979,7 +982,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
979 | 982 | if (!QuantityConstant.STATUS_LOCATION_EMPTY.equals(toLocation.getStatus())) { |
980 | 983 | return Result.error("创建空托盘入库时, 目标库位非空闲"); |
981 | 984 | } |
982 | - boolean success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
985 | + boolean success = locationService.updateStatusByOldStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, QuantityConstant.STATUS_LOCATION_EMPTY, | |
986 | + warehouseCode); | |
983 | 987 | if (!success) { |
984 | 988 | throw new JeecgBootException("创建空托盘入库时,更新库位状态失败"); |
985 | 989 | } |
... | ... | @@ -1045,7 +1049,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1045 | 1049 | if (port == null) { |
1046 | 1050 | return Result.error("创建空托盘出库时, 没有找到出库口" + toPortCode); |
1047 | 1051 | } |
1048 | - boolean success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
1052 | + boolean success = | |
1053 | + locationService.updateStatusByOldStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
1049 | 1054 | if (!success) { |
1050 | 1055 | throw new JeecgBootException("创建空托盘出库时,更新库位状态失败"); |
1051 | 1056 | } |
... | ... | @@ -2250,13 +2255,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2250 | 2255 | |
2251 | 2256 | boolean success = false; |
2252 | 2257 | if (StringUtils.isNotEmpty(fromLocationCode)) { |
2253 | - success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
2258 | + success = locationService.updateStatusByOldStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, QuantityConstant.STATUS_LOCATION_LOCK, | |
2259 | + warehouseCode); | |
2254 | 2260 | if (!success) { |
2255 | 2261 | throw new JeecgBootException("取消任务时, 更新起始库位状态失败"); |
2256 | 2262 | } |
2257 | 2263 | } |
2258 | 2264 | if (StringUtils.isNotEmpty(toLocationCode)) { |
2259 | - success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
2265 | + success = locationService.updateStatusByOldStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, QuantityConstant.STATUS_LOCATION_LOCK, | |
2266 | + warehouseCode); | |
2260 | 2267 | if (!success) { |
2261 | 2268 | throw new JeecgBootException("取消任务时, 更新目标库位状态失败"); |
2262 | 2269 | } |
... | ... |