Commit 707966ca6f9aef9224cdc2ef5382ac433889d51b
1 parent
d60bdd11
add 出库按库区完成
fix 出库完成 出库单状态不对 add 已出数量
Showing
11 changed files
with
196 additions
and
96 deletions
ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue
... | ... | @@ -157,11 +157,16 @@ export default { |
157 | 157 | dataIndex: 'qty' |
158 | 158 | }, |
159 | 159 | { |
160 | - title: '已出数量', | |
160 | + title: '配盘数量', | |
161 | 161 | align: "center", |
162 | 162 | dataIndex: 'taskQty' |
163 | 163 | }, |
164 | 164 | { |
165 | + title: '已出数量', | |
166 | + align: "center", | |
167 | + dataIndex: 'shipmentQty' | |
168 | + }, | |
169 | + { | |
165 | 170 | title: '可出数量', |
166 | 171 | align: "center", |
167 | 172 | dataIndex: 'availableQty' |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue
... | ... | @@ -5,6 +5,20 @@ |
5 | 5 | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
6 | 6 | <a-row :gutter="24"> |
7 | 7 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
8 | + <a-form-item label="库区"> | |
9 | + <a-select | |
10 | + show-search | |
11 | + placeholder="请选择库区" | |
12 | + option-filter-prop="children" | |
13 | + v-model="queryParam.zoneCode"> | |
14 | + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{ | |
15 | + item.name | |
16 | + }} | |
17 | + </a-select-option> | |
18 | + </a-select> | |
19 | + </a-form-item> | |
20 | + </a-col> | |
21 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
8 | 22 | <a-form-item label="出库单编码"> |
9 | 23 | <a-input placeholder="请输入出库单编码" v-model="queryParam.code"></a-input> |
10 | 24 | </a-form-item> |
... | ... | @@ -158,6 +172,12 @@ |
158 | 172 | </a-tag> |
159 | 173 | </span> |
160 | 174 | |
175 | + <span slot="zoneCode" slot-scope="zoneCode"> | |
176 | + <a-tag :key="zoneCode" color=blue> | |
177 | + {{ solutionZoneCode(zoneCode) }} | |
178 | + </a-tag> | |
179 | + </span> | |
180 | + | |
161 | 181 | <span slot="type" slot-scope="type"> |
162 | 182 | <a-tag :key="type" color=pink> |
163 | 183 | {{ solutionShipmentType(type) }} |
... | ... | @@ -197,8 +217,8 @@ |
197 | 217 | </a-popconfirm> |
198 | 218 | <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus <= 200)) |
199 | 219 | || (flowOff == '0' && record.lastStatus <= 200)" @click="autoShipmentCombine(record)" v-has="'shipmentHeader:autoShipmentCombine'"><a-button type="primary">自动配盘</a-button><a-divider type="vertical"/></a> |
200 | - <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus < 800)) | |
201 | - || (flowOff == '0' && record.lastStatus < 800)" @click="openAutoShipmentCombine(record)" v-has="'shipmentHeader:autoShipment'"><a-button type="primary">自动出库</a-button></a> | |
220 | + <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus <= 200)) | |
221 | + || (flowOff == '0' && record.lastStatus <= 200)" @click="openAutoShipmentCombine(record)" v-has="'shipmentHeader:autoShipment'"><a-button type="primary">自动出库</a-button></a> | |
202 | 222 | <a-dropdown v-if="(record.firstStatus > 0 && record.firstStatus <= 20 && flowOff=='1') || (record.firstStatus == 0 && record.lastStatus == 0 && record.referCode == null)"> |
203 | 223 | <a class="ant-dropdown-link"><a-divider type="vertical"/>更多 <a-icon type="down"/></a> |
204 | 224 | <a-menu slot="overlay"> |
... | ... | @@ -240,7 +260,7 @@ import {getAction} from '@/api/manage' |
240 | 260 | import ShipmentDetailList from './ShipmentDetailList' |
241 | 261 | import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
242 | 262 | import '@/assets/less/TableExpand.less' |
243 | -import {getCompanyList, backErpShipment} from '@/api/api' | |
263 | +import {getCompanyList, backErpShipment, getZoneList} from '@/api/api' | |
244 | 264 | import {getShipmentTypeList} from '@/api/api' |
245 | 265 | import {getCustomerList} from '@/api/api' |
246 | 266 | import {autoCombination} from '@/api/api' |
... | ... | @@ -266,6 +286,7 @@ export default { |
266 | 286 | selectIndex: null, |
267 | 287 | description: '出库单管理页面', |
268 | 288 | companyList: [], |
289 | + zoneList: [], | |
269 | 290 | shipmentTypeList: [], |
270 | 291 | customerList: [], |
271 | 292 | username: '', |
... | ... | @@ -285,6 +306,13 @@ export default { |
285 | 306 | dataIndex: 'code' |
286 | 307 | }, |
287 | 308 | { |
309 | + title: '库区', | |
310 | + align: "center", | |
311 | + dataIndex: 'zoneCode', | |
312 | + key: 'zoneCode', | |
313 | + scopedSlots: {customRender: 'zoneCode'} | |
314 | + }, | |
315 | + { | |
288 | 316 | title: '货主', |
289 | 317 | align: "center", |
290 | 318 | dataIndex: 'companyCode', |
... | ... | @@ -528,6 +556,12 @@ export default { |
528 | 556 | this.customerList = res.result |
529 | 557 | } |
530 | 558 | }); |
559 | + getZoneList().then((res) => { | |
560 | + if (res.success) { | |
561 | + this.zoneList = res.result | |
562 | + console.log("zoneList" + this.zoneList); | |
563 | + } | |
564 | + }); | |
531 | 565 | }, |
532 | 566 | batchPrint() { |
533 | 567 | if (this.selectedRowKeys.length <= 0) { |
... | ... | @@ -549,6 +583,17 @@ export default { |
549 | 583 | }) |
550 | 584 | return actions.join('') |
551 | 585 | }, |
586 | + solutionZoneCode(value) { | |
587 | + var actions = [] | |
588 | + console.log("solutionZoneCode " + this.zoneList); | |
589 | + Object.keys(this.zoneList).some((key) => { | |
590 | + if (this.zoneList[key].code == ('' + value)) { | |
591 | + actions.push(this.zoneList[key].name) | |
592 | + return true | |
593 | + } | |
594 | + }) | |
595 | + return actions.join('') | |
596 | + }, | |
552 | 597 | solutionShipmentType(value) { |
553 | 598 | var actions = [] |
554 | 599 | Object.keys(this.shipmentTypeList).some((key) => { |
... | ... | @@ -624,6 +669,7 @@ export default { |
624 | 669 | let fieldList = []; |
625 | 670 | fieldList.push({type: 'string', value: 'code', text: '出库单编码', dictCode: ''}) |
626 | 671 | fieldList.push({type: 'string', value: 'companyCode', text: '货主', dictCode: ''}) |
672 | + fieldList.push({type: 'string', value: 'zoneCode', text: '库区', dictCode: ''}) | |
627 | 673 | fieldList.push({type: 'string', value: 'type', text: '出库单类型', dictCode: ''}) |
628 | 674 | fieldList.push({type: 'int', value: 'firstStatus', text: '头状态', dictCode: 'shipment_status'}) |
629 | 675 | fieldList.push({type: 'int', value: 'lastStatus', text: '尾状态', dictCode: 'shipment_status'}) |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentHeaderModal.vue
... | ... | @@ -42,6 +42,21 @@ |
42 | 42 | </a-col> |
43 | 43 | |
44 | 44 | <a-col :span="24"> |
45 | + <a-form-model-item label="库区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zoneCode"> | |
46 | + <a-select | |
47 | + show-search | |
48 | + placeholder="请选择库区" | |
49 | + option-filter-prop="children" | |
50 | + v-model="model.zoneCode"> | |
51 | + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{ | |
52 | + item.name | |
53 | + }} | |
54 | + </a-select-option> | |
55 | + </a-select> | |
56 | + </a-form-model-item> | |
57 | + </a-col> | |
58 | + | |
59 | + <a-col :span="24"> | |
45 | 60 | <a-form-model-item label="客户编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="customerCode"> |
46 | 61 | <a-select |
47 | 62 | show-search |
... | ... | @@ -71,7 +86,7 @@ |
71 | 86 | |
72 | 87 | import {httpAction} from '@/api/manage' |
73 | 88 | import {validateDuplicateValue} from '@/utils/util' |
74 | -import {getCompanyList} from '@/api/api' | |
89 | +import {getCompanyList, getZoneList} from '@/api/api' | |
75 | 90 | import {getShipmentTypeList} from '@/api/api' |
76 | 91 | import {getCustomerList} from '@/api/api' |
77 | 92 | |
... | ... | @@ -83,6 +98,7 @@ export default { |
83 | 98 | companyList: [], |
84 | 99 | shipmentTypeList: [], |
85 | 100 | customerList: [], |
101 | + zoneList: [], | |
86 | 102 | title: "操作", |
87 | 103 | width: 800, |
88 | 104 | visible: false, |
... | ... | @@ -178,6 +194,11 @@ export default { |
178 | 194 | this.customerList = res.result |
179 | 195 | } |
180 | 196 | }); |
197 | + getZoneList().then((res) => { | |
198 | + if (res.success) { | |
199 | + this.zoneList = res.result | |
200 | + } | |
201 | + }); | |
181 | 202 | }, |
182 | 203 | |
183 | 204 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java
... | ... | @@ -241,7 +241,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
241 | 241 | if (StringUtils.isEmpty(roadWays)) { |
242 | 242 | return roadWay; |
243 | 243 | } |
244 | - roadWay = getRoadWayByMaxFreeLocation(roadWays, warehouseCode); | |
244 | + roadWay = locationAllocationService.getRoadWayByMaxFreeLocation(roadWays, warehouseCode); | |
245 | 245 | return roadWay; |
246 | 246 | } |
247 | 247 | |
... | ... | @@ -278,7 +278,12 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
278 | 278 | @Override |
279 | 279 | @Transactional(rollbackFor = Exception.class) |
280 | 280 | public List<Integer> removeRoadWaysByPreLocations(List<Integer> roadWays, String warehouseCode) { |
281 | + String value = parameterConfigurationService.getValueByCode(QuantityConstant.MAX_ROADWAY_RECEIPT); | |
281 | 282 | // 同巷道分配的库位大于等于2时,这个巷道就不能再分了 |
283 | + int maxRoadReceipt = 2; | |
284 | + if (StringUtils.isNotEmpty(value)) { | |
285 | + maxRoadReceipt = Integer.parseInt(value); | |
286 | + } | |
282 | 287 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
283 | 288 | taskHeaderLambdaQueryWrapper.lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED).ne(TaskHeader::getToLocationCode, |
284 | 289 | QuantityConstant.EMPTY_STRING); |
... | ... | @@ -288,7 +293,8 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
288 | 293 | List<Integer> removeRoadWayList = new ArrayList<>(); |
289 | 294 | for (Integer roadWay : roadWays) { |
290 | 295 | int i = Collections.frequency(roadWayList, roadWay); |
291 | - if (i >= 2) { | |
296 | + // 同巷道分配的库位大于等于2时,这个巷道就不能再分了 | |
297 | + if (i >= maxRoadReceipt) { | |
292 | 298 | removeRoadWayList.add(roadWay); |
293 | 299 | } |
294 | 300 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -98,6 +98,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
98 | 98 | String companyCode = shipmentDetail.getCompanyCode(); |
99 | 99 | String materialCode = shipmentDetail.getMaterialCode(); |
100 | 100 | String inventoryStatus = shipmentDetail.getInventoryStatus(); |
101 | + String zoneCode = shipmentDetail.getZoneCode(); | |
101 | 102 | if (StringUtils.isEmpty(warehouseCode)) { |
102 | 103 | throw new JeecgBootException("寻找库存详情时,出库详情没有仓库编码"); |
103 | 104 | } |
... | ... | @@ -114,6 +115,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
114 | 115 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode).eq(InventoryDetail::getCompanyCode, companyCode) |
115 | 116 | .eq(InventoryDetail::getMaterialCode, materialCode).eq(InventoryDetail::getInventoryStatus, inventoryStatus) |
116 | 117 | .eq(InventoryDetail::getEnable, QuantityConstant.INVENTORY_DETAIL_STATUS_ENABLE) |
118 | + .eq(StringUtils.isNotEmpty(zoneCode), InventoryDetail::getZoneCode, zoneCode) | |
117 | 119 | .eq(InventoryDetail::getContainerStatus, QuantityConstant.STATUS_CONTAINER_EMPTY); |
118 | 120 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); |
119 | 121 | return inventoryDetailList; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/entity/ShipmentDetail.java
... | ... | @@ -48,6 +48,10 @@ public class ShipmentDetail implements Serializable { |
48 | 48 | @Excel(name = "仓库编码", width = 15) |
49 | 49 | @ApiModelProperty(value = "仓库编码") |
50 | 50 | private String warehouseCode; |
51 | + /** 库区 */ | |
52 | + @Excel(name = "库区", width = 15) | |
53 | + @ApiModelProperty(value = "库区") | |
54 | + private String zoneCode; | |
51 | 55 | /** 货主编码 */ |
52 | 56 | @Excel(name = "货主编码", width = 15) |
53 | 57 | @ApiModelProperty(value = "货主编码") |
... | ... | @@ -72,10 +76,14 @@ public class ShipmentDetail implements Serializable { |
72 | 76 | @Excel(name = "单据数量", width = 15) |
73 | 77 | @ApiModelProperty(value = "单据数量") |
74 | 78 | private java.math.BigDecimal qty; |
75 | - /** 已出数量 */ | |
76 | - @Excel(name = "已出数量", width = 15) | |
77 | - @ApiModelProperty(value = "已出数量") | |
79 | + /** 配盘数量 */ | |
80 | + @Excel(name = "配盘数量", width = 15) | |
81 | + @ApiModelProperty(value = "配盘数量") | |
78 | 82 | private java.math.BigDecimal taskQty; |
83 | + /** 出库数量 */ | |
84 | + @Excel(name = "出库数量", width = 15) | |
85 | + @ApiModelProperty(value = "出库数量") | |
86 | + private java.math.BigDecimal shipmentQty; | |
79 | 87 | /** 可出数量 */ |
80 | 88 | @ApiModelProperty(value = "可出数量") |
81 | 89 | @TableField(exist = false) |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/entity/ShipmentHeader.java
... | ... | @@ -43,6 +43,10 @@ public class ShipmentHeader implements Serializable { |
43 | 43 | @Excel(name = "仓库编码", width = 15) |
44 | 44 | @ApiModelProperty(value = "仓库编码") |
45 | 45 | private String warehouseCode; |
46 | + /** 库区 */ | |
47 | + @Excel(name = "库区", width = 15) | |
48 | + @ApiModelProperty(value = "库区") | |
49 | + private String zoneCode; | |
46 | 50 | /** 货主编码 */ |
47 | 51 | @Excel(name = "货主编码", width = 15) |
48 | 52 | @ApiModelProperty(value = "货主编码") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java
... | ... | @@ -71,6 +71,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
71 | 71 | String warehouseCode = shipmentHeader.getWarehouseCode(); |
72 | 72 | String companyCode = shipmentHeader.getCompanyCode(); |
73 | 73 | String materialCode = shipmentDetail.getMaterialCode(); |
74 | + String zoneCode = shipmentHeader.getZoneCode(); | |
74 | 75 | Material material = materialService.getMaterialByCode(materialCode); |
75 | 76 | if (material == null) { |
76 | 77 | return Result.error("添加失败,没有找到物料信息," + materialCode); |
... | ... | @@ -85,6 +86,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
85 | 86 | shipmentDetail.setMaterialSpec(materialSpec); |
86 | 87 | shipmentDetail.setMaterialUnit(materialUnit); |
87 | 88 | shipmentDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD); |
89 | + shipmentDetail.setZoneCode(zoneCode); | |
88 | 90 | boolean success = shipmentDetailService.save(shipmentDetail); |
89 | 91 | if (!success) { |
90 | 92 | throw new JeecgBootException("添加失败, 保存出库单详情的时候报错"); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -873,6 +873,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
873 | 873 | } |
874 | 874 | // 保存历史任务表 |
875 | 875 | taskHeaderHistoryService.saveById(taskHeader.getId()); |
876 | + | |
876 | 877 | if (!taskHeaderService.removeById(taskId)) { |
877 | 878 | throw new JeecgBootException("取消任务失败, 删除任务失败"); |
878 | 879 | } |
... | ... | @@ -1258,7 +1259,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1258 | 1259 | if (StringUtils.isEmpty(fromLocationCode)) { |
1259 | 1260 | return Result.error("完成出库任务" + taskHeader.getId() + "没有起始库位,执行中止"); |
1260 | 1261 | } |
1261 | - if (StringUtils.isEmpty(toLocationCode) && taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) { | |
1262 | + if (StringUtils.isEmpty(toLocationCode) && (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT)) { | |
1262 | 1263 | return Result.error("完成出库任务,任务" + taskHeader.getId() + "没有目的库位,执行中止"); |
1263 | 1264 | } |
1264 | 1265 | InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); |
... | ... | @@ -1284,18 +1285,21 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1284 | 1285 | } |
1285 | 1286 | taskDetail.setShipmentCode(shipmentDetail.getShipmentCode()); |
1286 | 1287 | int shipmentDetailId = shipmentDetail.getId(); |
1288 | + BigDecimal shipmentQty = shipmentDetail.getShipmentQty(); | |
1289 | + shipmentQty = shipmentQty.add(taskDetail.getQty()); | |
1287 | 1290 | int status = QuantityConstant.SHIPMENT_HEADER_COMPLETED; |
1288 | - if (shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) == 0) { | |
1291 | + if (shipmentDetail.getQty().compareTo(shipmentQty) == 0) { | |
1289 | 1292 | status = QuantityConstant.SHIPMENT_HEADER_COMPLETED; |
1290 | - } else if (shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) > 0) { | |
1293 | + } else if (shipmentDetail.getQty().compareTo(shipmentQty) > 0) { | |
1291 | 1294 | status = QuantityConstant.SHIPMENT_HEADER_OFF_SHELF; |
1292 | - } else if (shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) < 0) { | |
1293 | - throw new JeecgBootException("完成出库任务时, 出库单 单据数量不能小于配盘数量"); | |
1295 | + } else if (shipmentDetail.getQty().compareTo(shipmentQty) < 0) { | |
1296 | + throw new JeecgBootException("完成出库任务时, 出库单 单据数量不能小于出库数量"); | |
1294 | 1297 | } |
1295 | 1298 | shipmentDetailList.add(shipmentDetail); |
1296 | 1299 | ShipmentDetail updateStatusShipmentDetail = new ShipmentDetail(); |
1297 | 1300 | updateStatusShipmentDetail.setId(shipmentDetailId); |
1298 | 1301 | updateStatusShipmentDetail.setStatus(status); |
1302 | + updateStatusShipmentDetail.setShipmentQty(shipmentQty); | |
1299 | 1303 | updateStatusShipmentDetailList.add(updateStatusShipmentDetail); |
1300 | 1304 | InventoryDetail inventoryDetail = inventoryDetailService.getById(taskDetail.getFromInventoryDetailId()); |
1301 | 1305 | if (inventoryDetail == null) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeaderHistory/service/impl/TaskHeaderHistoryServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.task.taskHeaderHistory.service.impl; |
2 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
3 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.util.Collection; | |
5 | +import java.util.List; | |
6 | + | |
7 | +import javax.annotation.Resource; | |
8 | + | |
4 | 9 | import org.jeecg.common.exception.JeecgBootException; |
5 | -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; | |
6 | -import org.jeecg.modules.wms.receipt.receiptHeaderHistory.entity.ReceiptDetailHistory; | |
7 | 10 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; |
8 | 11 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
9 | 12 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService; |
... | ... | @@ -15,100 +18,98 @@ import org.jeecg.modules.wms.task.taskHeaderHistory.mapper.TaskHeaderHistoryMapp |
15 | 18 | import org.jeecg.modules.wms.task.taskHeaderHistory.service.ITaskDetailHistoryService; |
16 | 19 | import org.jeecg.modules.wms.task.taskHeaderHistory.service.ITaskHeaderHistoryService; |
17 | 20 | import org.springframework.beans.BeanUtils; |
18 | -import org.springframework.stereotype.Service; | |
19 | 21 | import org.springframework.beans.factory.annotation.Autowired; |
22 | +import org.springframework.stereotype.Service; | |
20 | 23 | import org.springframework.transaction.annotation.Transactional; |
21 | 24 | import org.springframework.util.CollectionUtils; |
22 | 25 | |
23 | -import javax.annotation.Resource; | |
24 | -import java.io.Serializable; | |
25 | -import java.util.List; | |
26 | -import java.util.Collection; | |
26 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
27 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
27 | 28 | |
28 | 29 | /** |
29 | 30 | * @Description: task_header_history |
30 | - * @Author: jeecg-boot | |
31 | - * @Date: 2023-09-14 | |
32 | - * @Version: V1.0 | |
31 | + * @Author: jeecg-boot | |
32 | + * @Date: 2023-09-14 | |
33 | + * @Version: V1.0 | |
33 | 34 | */ |
34 | 35 | @Service |
35 | 36 | public class TaskHeaderHistoryServiceImpl extends ServiceImpl<TaskHeaderHistoryMapper, TaskHeaderHistory> implements ITaskHeaderHistoryService { |
36 | 37 | |
37 | - @Autowired | |
38 | - private TaskHeaderHistoryMapper taskHeaderHistoryMapper; | |
39 | - @Autowired | |
40 | - private TaskDetailHistoryMapper taskDetailHistoryMapper; | |
41 | - @Resource | |
42 | - private ITaskHeaderService taskHeaderService; | |
43 | - @Resource | |
44 | - private ITaskDetailService taskDetailService; | |
45 | - @Resource | |
46 | - private ITaskDetailHistoryService taskDetailHistoryService; | |
47 | - | |
38 | + @Autowired | |
39 | + private TaskHeaderHistoryMapper taskHeaderHistoryMapper; | |
40 | + @Autowired | |
41 | + private TaskDetailHistoryMapper taskDetailHistoryMapper; | |
42 | + @Resource | |
43 | + private ITaskHeaderService taskHeaderService; | |
44 | + @Resource | |
45 | + private ITaskDetailService taskDetailService; | |
46 | + @Resource | |
47 | + private ITaskDetailHistoryService taskDetailHistoryService; | |
48 | 48 | |
49 | - @Override | |
50 | - @Transactional | |
51 | - public void saveMain(TaskHeaderHistory taskHeaderHistory, List<TaskDetailHistory> taskDetailHistoryList) { | |
52 | - taskHeaderHistoryMapper.insert(taskHeaderHistory); | |
53 | - if(taskDetailHistoryList!=null && taskDetailHistoryList.size()>0) { | |
54 | - for(TaskDetailHistory entity:taskDetailHistoryList) { | |
55 | - //外键设置 | |
56 | - entity.setTaskHeaderId(taskHeaderHistory.getId()); | |
57 | - taskDetailHistoryMapper.insert(entity); | |
58 | - } | |
59 | - } | |
60 | - } | |
49 | + @Override | |
50 | + @Transactional | |
51 | + public void saveMain(TaskHeaderHistory taskHeaderHistory, List<TaskDetailHistory> taskDetailHistoryList) { | |
52 | + taskHeaderHistoryMapper.insert(taskHeaderHistory); | |
53 | + if (taskDetailHistoryList != null && taskDetailHistoryList.size() > 0) { | |
54 | + for (TaskDetailHistory entity : taskDetailHistoryList) { | |
55 | + // 外键设置 | |
56 | + entity.setTaskHeaderId(taskHeaderHistory.getId()); | |
57 | + taskDetailHistoryMapper.insert(entity); | |
58 | + } | |
59 | + } | |
60 | + } | |
61 | 61 | |
62 | - @Override | |
63 | - @Transactional | |
64 | - public void updateMain(TaskHeaderHistory taskHeaderHistory,List<TaskDetailHistory> taskDetailHistoryList) { | |
65 | - taskHeaderHistoryMapper.updateById(taskHeaderHistory); | |
62 | + @Override | |
63 | + @Transactional | |
64 | + public void updateMain(TaskHeaderHistory taskHeaderHistory, List<TaskDetailHistory> taskDetailHistoryList) { | |
65 | + taskHeaderHistoryMapper.updateById(taskHeaderHistory); | |
66 | 66 | |
67 | - //1.先删除子表数据 | |
68 | - //taskDetailHistoryMapper.deleteByMainId(taskHeaderHistory.getId()); | |
67 | + // 1.先删除子表数据 | |
68 | + // taskDetailHistoryMapper.deleteByMainId(taskHeaderHistory.getId()); | |
69 | 69 | |
70 | - //2.子表数据重新插入 | |
71 | - if(taskDetailHistoryList!=null && taskDetailHistoryList.size()>0) { | |
72 | - for(TaskDetailHistory entity:taskDetailHistoryList) { | |
73 | - //外键设置 | |
74 | - entity.setTaskHeaderId(taskHeaderHistory.getId()); | |
75 | - taskDetailHistoryMapper.insert(entity); | |
76 | - } | |
77 | - } | |
78 | - } | |
70 | + // 2.子表数据重新插入 | |
71 | + if (taskDetailHistoryList != null && taskDetailHistoryList.size() > 0) { | |
72 | + for (TaskDetailHistory entity : taskDetailHistoryList) { | |
73 | + // 外键设置 | |
74 | + entity.setTaskHeaderId(taskHeaderHistory.getId()); | |
75 | + taskDetailHistoryMapper.insert(entity); | |
76 | + } | |
77 | + } | |
78 | + } | |
79 | 79 | |
80 | - @Override | |
81 | - @Transactional | |
82 | - public void delMain(String id) { | |
83 | - taskDetailHistoryMapper.deleteByMainId(id); | |
84 | - taskHeaderHistoryMapper.deleteById(id); | |
85 | - } | |
80 | + @Override | |
81 | + @Transactional | |
82 | + public void delMain(String id) { | |
83 | + taskDetailHistoryMapper.deleteByMainId(id); | |
84 | + taskHeaderHistoryMapper.deleteById(id); | |
85 | + } | |
86 | 86 | |
87 | - @Override | |
88 | - @Transactional | |
89 | - public void delBatchMain(Collection<? extends Serializable> idList) { | |
90 | - for(Serializable id:idList) { | |
91 | - taskDetailHistoryMapper.deleteByMainId(id.toString()); | |
92 | - taskHeaderHistoryMapper.deleteById(id); | |
93 | - } | |
94 | - } | |
87 | + @Override | |
88 | + @Transactional | |
89 | + public void delBatchMain(Collection<? extends Serializable> idList) { | |
90 | + for (Serializable id : idList) { | |
91 | + taskDetailHistoryMapper.deleteByMainId(id.toString()); | |
92 | + taskHeaderHistoryMapper.deleteById(id); | |
93 | + } | |
94 | + } | |
95 | 95 | |
96 | - @Override | |
97 | - public void saveById(Integer id) { | |
98 | - TaskHeader taskHeader=taskHeaderService.getById(id); | |
99 | - TaskHeaderHistory taskHeaderHistory=new TaskHeaderHistory(); | |
100 | - BeanUtils.copyProperties(taskHeader,taskHeaderHistory); | |
101 | - taskHeaderHistoryMapper.insert(taskHeaderHistory); | |
102 | - List<TaskDetail>taskDetailList=taskDetailService.list(new LambdaQueryWrapper<TaskDetail>().eq(TaskDetail::getTaskHeaderId, taskHeader.getId())); | |
103 | - if (!CollectionUtils.isEmpty(taskDetailList)) { | |
104 | - for (TaskDetail detail : taskDetailList) { | |
105 | - TaskDetailHistory taskDetailHistory = new TaskDetailHistory(); | |
106 | - BeanUtils.copyProperties(detail, taskDetailHistory); | |
107 | - if (!taskDetailHistoryService.save(taskDetailHistory)) { | |
108 | - throw new JeecgBootException("批量新增失败"); | |
109 | - } | |
110 | - } | |
111 | - } | |
96 | + @Override | |
97 | + @Transactional | |
98 | + public void saveById(Integer id) { | |
99 | + TaskHeader taskHeader = taskHeaderService.getById(id); | |
100 | + TaskHeaderHistory taskHeaderHistory = new TaskHeaderHistory(); | |
101 | + BeanUtils.copyProperties(taskHeader, taskHeaderHistory); | |
102 | + taskHeaderHistoryMapper.insert(taskHeaderHistory); | |
103 | + List<TaskDetail> taskDetailList = taskDetailService.list(new LambdaQueryWrapper<TaskDetail>().eq(TaskDetail::getTaskHeaderId, taskHeader.getId())); | |
104 | + if (!CollectionUtils.isEmpty(taskDetailList)) { | |
105 | + for (TaskDetail detail : taskDetailList) { | |
106 | + TaskDetailHistory taskDetailHistory = new TaskDetailHistory(); | |
107 | + BeanUtils.copyProperties(detail, taskDetailHistory); | |
108 | + if (!taskDetailHistoryService.save(taskDetailHistory)) { | |
109 | + throw new JeecgBootException("批量新增失败"); | |
110 | + } | |
111 | + } | |
112 | + } | |
112 | 113 | |
113 | - } | |
114 | + } | |
114 | 115 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... | ... | @@ -484,6 +484,7 @@ public class QuantityConstant { |
484 | 484 | public static final String RULE_CALL_BOX_ALLOW_EMPTY = "callBoxAllowEmpty"; |
485 | 485 | public static final String DOUBLE_FORK_RESERVE_LOCATION = "doubleForkReserveLocation"; |
486 | 486 | public static final String DOUBLE_FORK_SEARCH_LOCATION = "doubleForkSearchLocation"; |
487 | + public static final String MAX_ROADWAY_RECEIPT = "maxRoadWayReceipt"; | |
487 | 488 | public static final String WAREHOUSING_WEIGHING = "warehousingWeighing"; |
488 | 489 | public static final String EXCEPTION_TO_CACHE = "exceptionToCache"; |
489 | 490 | public static final String CONTAINER_SPEC = "containerSpec"; |
... | ... |