Commit e6b1203b454a61f18f588e001d46855634ae5f9b
1 parent
c16aca8c
1. 库存交易 增加字段
2. 库区查询 支持多选
Showing
4 changed files
with
80 additions
and
18 deletions
ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue
... | ... | @@ -6,15 +6,13 @@ |
6 | 6 | <a-row :gutter="24"> |
7 | 7 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
8 | 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 | - </a-select-option> | |
17 | - </a-select> | |
9 | + <a-form-model-item prop="zoneOptions"> | |
10 | + <j-multi-select-tag | |
11 | + v-model="queryParam.zoneCode" | |
12 | + :options="zoneOptions" | |
13 | + placeholder="请选择"> | |
14 | + </j-multi-select-tag> | |
15 | + </a-form-model-item> | |
18 | 16 | </a-form-item> |
19 | 17 | </a-col> |
20 | 18 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
... | ... | @@ -171,6 +169,7 @@ export default { |
171 | 169 | return { |
172 | 170 | zoneList: [], |
173 | 171 | description: '库存表管理页面', |
172 | + zoneOptions:[], | |
174 | 173 | // 表头 |
175 | 174 | columns: [ |
176 | 175 | { |
... | ... | @@ -347,6 +346,14 @@ export default { |
347 | 346 | getZoneList().then((res) => { |
348 | 347 | if (res.success) { |
349 | 348 | this.zoneList = res.result |
349 | + //延迟半秒执行,避免组件未加载完,数据已经加载完 | |
350 | + setTimeout(()=>{ | |
351 | + //slice可以在数组的任何位置进行删除/添加操作 | |
352 | + this.zoneOptions.splice(0, 1); | |
353 | + for (let i = 0; i < res.result.length; i++) { | |
354 | + this.zoneOptions.push({value:res.result[i].code,text:res.result[i].name}) | |
355 | + } | |
356 | + },500) | |
350 | 357 | } |
351 | 358 | }); |
352 | 359 | }, |
... | ... |
ant-design-vue-jeecg/src/views/system/modules/UserModal.vue
... | ... | @@ -162,7 +162,7 @@ import moment from 'moment' |
162 | 162 | import Vue from 'vue' |
163 | 163 | import {ACCESS_TOKEN} from "@/store/mutation-types" |
164 | 164 | import {getAction} from '@/api/manage' |
165 | -import {addUser, editUser, queryUserRole, queryall, queryWarehouse, getAllWarehouseList, getZoneList} from '@/api/api' | |
165 | +import {addUser, editUser, queryUserRole, queryall, queryWarehouse, getAllWarehouseList, getZoneList, getAllZoneList} from '@/api/api' | |
166 | 166 | import {disabledAuthFilter} from "@/utils/authFilter" |
167 | 167 | import {duplicateCheck} from '@/api/api' |
168 | 168 | |
... | ... | @@ -327,7 +327,7 @@ export default { |
327 | 327 | }); |
328 | 328 | }, |
329 | 329 | initZoneList() { |
330 | - getZoneList().then((res) => { | |
330 | + getAllZoneList().then((res) => { | |
331 | 331 | if (res.success) { |
332 | 332 | this.zoneOptions = res.result.map((item, index, arr) => { |
333 | 333 | let c = {label: item.name, value: item.code} |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryTransaction/entity/InventoryTransaction.java
... | ... | @@ -47,6 +47,10 @@ public class InventoryTransaction implements Serializable { |
47 | 47 | @Excel(name = "容器编码", width = 15) |
48 | 48 | @ApiModelProperty(value = "容器编码") |
49 | 49 | private String containerCode; |
50 | + /** 库区编码 */ | |
51 | + @Excel(name = "库区编码", width = 15) | |
52 | + @ApiModelProperty(value = "库区编码") | |
53 | + private String zoneCode; | |
50 | 54 | /** 起始库位编码 */ |
51 | 55 | @Excel(name = "起始库位编码", width = 15) |
52 | 56 | @ApiModelProperty(value = "起始库位编码") |
... | ... | @@ -64,6 +68,14 @@ public class InventoryTransaction implements Serializable { |
64 | 68 | @Excel(name = "出库单id", width = 15) |
65 | 69 | @ApiModelProperty(value = "出库单id") |
66 | 70 | private Integer shipmentId; |
71 | + /** 出库单编码 */ | |
72 | + @Excel(name = "出库单编码", width = 15) | |
73 | + @ApiModelProperty(value = "出库单编码") | |
74 | + private String shipmentCode; | |
75 | + /** 出库单编码 */ | |
76 | + @Excel(name = "出库单类型", width = 15) | |
77 | + @ApiModelProperty(value = "出库单类型") | |
78 | + private String shipmentType; | |
67 | 79 | /** 出库详情id */ |
68 | 80 | @Excel(name = "出库详情id", width = 15) |
69 | 81 | @ApiModelProperty(value = "出库详情id") |
... | ... | @@ -76,6 +88,14 @@ public class InventoryTransaction implements Serializable { |
76 | 88 | @Excel(name = "入库单id", width = 15) |
77 | 89 | @ApiModelProperty(value = "入库单id") |
78 | 90 | private Integer receiptId; |
91 | + /** 入库单编码 */ | |
92 | + @Excel(name = "入库单编码", width = 15) | |
93 | + @ApiModelProperty(value = "入库单编码") | |
94 | + private String receiptCode; | |
95 | + /** 入库单编码 */ | |
96 | + @Excel(name = "入库单类型", width = 15) | |
97 | + @ApiModelProperty(value = "入库单类型") | |
98 | + private String receiptType; | |
79 | 99 | /** 入库单详情id */ |
80 | 100 | @Excel(name = "入库单详情id", width = 15) |
81 | 101 | @ApiModelProperty(value = "入库单详情id") |
... | ... | @@ -109,19 +129,27 @@ public class InventoryTransaction implements Serializable { |
109 | 129 | @Excel(name = "数量", width = 15) |
110 | 130 | @ApiModelProperty(value = "数量") |
111 | 131 | private BigDecimal qty; |
132 | + /** 入库数量 */ | |
133 | + @Excel(name = "入库数量", width = 15) | |
134 | + @ApiModelProperty(value = "入库数量") | |
135 | + private BigDecimal receiptQty; | |
136 | + /** 出库数量 */ | |
137 | + @Excel(name = "出库数量", width = 15) | |
138 | + @ApiModelProperty(value = "出库数量") | |
139 | + private BigDecimal shipmentQty; | |
112 | 140 | /** 库存数量 */ |
113 | 141 | @Excel(name = "库存数量", width = 15) |
114 | 142 | @ApiModelProperty(value = "库存数量") |
115 | 143 | private BigDecimal inventoryQty; |
116 | - /** 批次 */ | |
144 | + /** 批次, 批次主要用于成品,比如以生产日期为批次 */ | |
117 | 145 | @Excel(name = "批次", width = 15) |
118 | 146 | @ApiModelProperty(value = "批次") |
119 | 147 | private String batch; |
120 | - /** 批号 */ | |
148 | + /** 批号, 批号主要用于原料,记录原料是哪一批 */ | |
121 | 149 | @Excel(name = "批号", width = 15) |
122 | 150 | @ApiModelProperty(value = "批号") |
123 | 151 | private String lot; |
124 | - /** 项目号 */ | |
152 | + /** 项目号, 项目号蛀牙用于记录项目 */ | |
125 | 153 | @Excel(name = "项目号", width = 15) |
126 | 154 | @ApiModelProperty(value = "项目号") |
127 | 155 | private String project; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -1076,6 +1076,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1076 | 1076 | if (receiptDetail == null) { |
1077 | 1077 | throw new JeecgBootException("未找到ID:" + taskDetail.getReceiptDetailId() + "入库单明细"); |
1078 | 1078 | } |
1079 | + ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); | |
1080 | + if (receiptHeader == null) { | |
1081 | + throw new JeecgBootException("未找到ID:" + receiptDetail.getReceiptId() + "入库单头"); | |
1082 | + } | |
1079 | 1083 | // 操作记录统计用 |
1080 | 1084 | taskDetail.setReceiptCode(receiptDetail.getReceiptCode()); |
1081 | 1085 | BigDecimal taskQty = receiptDetail.getTaskQty(); |
... | ... | @@ -1117,12 +1121,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1117 | 1121 | inventoryTransaction.setWarehouseCode(taskDetail.getWarehouseCode()); |
1118 | 1122 | inventoryTransaction.setCompanyCode(taskDetail.getCompanyCode()); |
1119 | 1123 | inventoryTransaction.setContainerCode(containerCode); |
1124 | + inventoryTransaction.setZoneCode(zoneCode); | |
1120 | 1125 | inventoryTransaction.setToLocationCode(toLocationCode); |
1121 | 1126 | inventoryTransaction.setMaterialCode(taskDetail.getMaterialCode()); |
1122 | 1127 | inventoryTransaction.setMaterialName(taskDetail.getMaterialName()); |
1123 | 1128 | inventoryTransaction.setMaterialSpec(taskDetail.getMaterialSpec()); |
1124 | 1129 | inventoryTransaction.setMaterialUnit(taskDetail.getMaterialUnit()); |
1125 | 1130 | inventoryTransaction.setReceiptId(taskDetail.getReceiptId()); |
1131 | + inventoryTransaction.setReceiptCode(receiptHeader.getCode()); | |
1132 | + inventoryTransaction.setReceiptType(receiptHeader.getType()); | |
1126 | 1133 | inventoryTransaction.setReceiptDetailId(taskDetail.getReceiptDetailId()); |
1127 | 1134 | inventoryTransaction.setReceiptContainerDetailId(taskDetail.getReceiptContainerDetailId()); |
1128 | 1135 | inventoryTransaction.setBatch(taskDetail.getBatch()); |
... | ... | @@ -1130,6 +1137,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1130 | 1137 | inventoryTransaction.setProject(taskDetail.getProject()); |
1131 | 1138 | inventoryTransaction.setInventoryStatus(taskDetail.getInventoryStatus()); |
1132 | 1139 | inventoryTransaction.setQty(receiptQty); |
1140 | + inventoryTransaction.setReceiptQty(receiptQty); | |
1133 | 1141 | // 获得库存数量 |
1134 | 1142 | BigDecimal inventoryQty = inventoryDetailService.getSumQty(inventoryDetail); |
1135 | 1143 | inventoryQty = inventoryQty.add(receiptQty); |
... | ... | @@ -1207,6 +1215,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1207 | 1215 | String fromLocationCode = taskHeader.getFromLocationCode(); |
1208 | 1216 | String toLocationCode = taskHeader.getToLocationCode(); |
1209 | 1217 | String containerCode = taskHeader.getContainerCode(); |
1218 | + String zoneCode = taskHeader.getZoneCode(); | |
1210 | 1219 | int taskType = taskHeader.getTaskType(); |
1211 | 1220 | List<TaskDetail> taskDetailList = taskDetailService.getTaskDetailListByTaskId(taskHeader.getId()); |
1212 | 1221 | boolean success = false; |
... | ... | @@ -1254,6 +1263,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1254 | 1263 | if (shipmentDetail == null) { |
1255 | 1264 | throw new JeecgBootException("完成出库任务, 出库任务没有找到出库详情" + taskDetail.getShipmentDetailId()); |
1256 | 1265 | } |
1266 | + ShipmentHeader shipmentHeader = shipmentHeaderService.getById(shipmentDetail.getShipmentId()); | |
1267 | + if (shipmentHeader == null) { | |
1268 | + throw new JeecgBootException("完成出库任务, 出库任务没有找到出库单" + shipmentDetail.getShipmentId()); | |
1269 | + } | |
1257 | 1270 | taskDetail.setShipmentCode(shipmentDetail.getShipmentCode()); |
1258 | 1271 | int shipmentDetailId = shipmentDetail.getId(); |
1259 | 1272 | int status = QuantityConstant.SHIPMENT_HEADER_COMPLETED; |
... | ... | @@ -1302,6 +1315,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1302 | 1315 | inventoryTransaction.setWarehouseCode(warehouseCode); |
1303 | 1316 | inventoryTransaction.setCompanyCode(inventoryDetail.getCompanyCode()); |
1304 | 1317 | inventoryTransaction.setContainerCode(containerCode); |
1318 | + inventoryTransaction.setZoneCode(zoneCode); | |
1305 | 1319 | inventoryTransaction.setFromLocationCode(fromLocationCode); |
1306 | 1320 | inventoryTransaction.setMaterialCode(inventoryDetail.getMaterialCode()); |
1307 | 1321 | inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName()); |
... | ... | @@ -1309,12 +1323,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1309 | 1323 | inventoryTransaction.setMaterialUnit(inventoryDetail.getMaterialUnit()); |
1310 | 1324 | inventoryTransaction.setInventoryStatus(inventoryDetail.getInventoryStatus()); |
1311 | 1325 | inventoryTransaction.setShipmentId(taskDetail.getShipmentId()); |
1326 | + inventoryTransaction.setShipmentCode(shipmentHeader.getCode()); | |
1327 | + inventoryTransaction.setShipmentType(shipmentHeader.getType()); | |
1312 | 1328 | inventoryTransaction.setShipmentDetailId(taskDetail.getShipmentDetailId()); |
1313 | 1329 | inventoryTransaction.setShipmentContainerDetailId(taskDetail.getShipmentContainerDetailId()); |
1314 | 1330 | inventoryTransaction.setBatch(inventoryDetail.getBatch()); |
1315 | 1331 | inventoryTransaction.setLot(inventoryDetail.getLot()); |
1316 | 1332 | inventoryTransaction.setProject(inventoryDetail.getProject()); |
1317 | 1333 | inventoryTransaction.setQty(taskDetail.getQty()); |
1334 | + inventoryTransaction.setShipmentQty(taskDetail.getQty()); | |
1318 | 1335 | BigDecimal inventoryQty = inventoryDetailService.getSumQty(inventoryDetail); |
1319 | 1336 | inventoryTransaction.setInventoryQty(inventoryQty); |
1320 | 1337 | inventoryTransactionList.add(inventoryTransaction); |
... | ... | @@ -1810,6 +1827,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1810 | 1827 | String containerCode = taskHeader.getContainerCode(); |
1811 | 1828 | String fromLocationCode = taskHeader.getFromLocationCode(); |
1812 | 1829 | String toLocationCode = taskHeader.getToLocationCode(); |
1830 | + String zoneCode = taskHeader.getZoneCode(); | |
1813 | 1831 | boolean success = false; |
1814 | 1832 | if (StringUtils.isEmpty(fromLocationCode)) { |
1815 | 1833 | return Result.error("完成盘点任务时,起始库位编码为空"); |
... | ... | @@ -1933,17 +1951,21 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1933 | 1951 | InventoryTransaction inventoryTransaction = new InventoryTransaction(); |
1934 | 1952 | inventoryTransaction.setWarehouseCode(taskHeader.getWarehouseCode()); |
1935 | 1953 | inventoryTransaction.setCompanyCode(taskHeader.getCompanyCode()); |
1954 | + inventoryTransaction.setZoneCode(zoneCode); | |
1936 | 1955 | inventoryTransaction.setContainerCode(child.getContainerCode()); |
1937 | 1956 | inventoryTransaction.setToLocationCode(child.getLocationCode()); |
1938 | 1957 | inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_CYCLEINTO); |
1939 | - inventoryTransaction.setReceiptId(warehousingOrderId); | |
1940 | - inventoryTransaction.setReceiptDetailId(receiptDetail.getReceiptId()); | |
1958 | + inventoryTransaction.setReceiptId(receiptDetail.getReceiptId()); | |
1959 | + inventoryTransaction.setReceiptCode(receiptDetail.getReceiptCode()); | |
1960 | + inventoryTransaction.setReceiptType(QuantityConstant.RECEIPT_BILL_TYPE_QTR); | |
1961 | + inventoryTransaction.setReceiptDetailId(receiptDetail.getId()); | |
1941 | 1962 | inventoryTransaction.setMaterialCode(child.getMaterialCode()); |
1942 | 1963 | inventoryTransaction.setMaterialName(child.getMaterialName()); |
1943 | 1964 | inventoryTransaction.setMaterialSpec(child.getMaterialSpec()); |
1944 | 1965 | inventoryTransaction.setMaterialUnit(child.getMaterialUnit()); |
1945 | 1966 | inventoryTransaction.setInventoryStatus(child.getInventoryStatus()); |
1946 | 1967 | inventoryTransaction.setQty(child.getCountedQty()); |
1968 | + inventoryTransaction.setReceiptQty(child.getCountedQty()); | |
1947 | 1969 | inventoryTransaction.setBatch(child.getBatch()); |
1948 | 1970 | inventoryTransaction.setLot(child.getLot()); |
1949 | 1971 | success = inventoryTransactionService.save(inventoryTransaction); |
... | ... | @@ -2006,9 +2028,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2006 | 2028 | inventoryTransaction.setWarehouseCode(taskHeader.getWarehouseCode()); |
2007 | 2029 | inventoryTransaction.setCompanyCode(taskHeader.getCompanyCode()); |
2008 | 2030 | inventoryTransaction.setContainerCode(child.getContainerCode()); |
2031 | + inventoryTransaction.setZoneCode(zoneCode); | |
2009 | 2032 | inventoryTransaction.setFromLocationCode(child.getLocationCode()); |
2010 | 2033 | inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_CYCLEOUT); |
2011 | - inventoryTransaction.setShipmentId(outboundOrderId); | |
2034 | + inventoryTransaction.setShipmentId(shipmentDetail.getShipmentId()); | |
2035 | + inventoryTransaction.setShipmentCode(shipmentDetail.getShipmentCode()); | |
2036 | + inventoryTransaction.setShipmentType(QuantityConstant.SHIPMENT_BILL_TYPE_QTC); | |
2012 | 2037 | inventoryTransaction.setShipmentDetailId(shipmentDetail.getId()); |
2013 | 2038 | inventoryTransaction.setMaterialCode(child.getMaterialCode()); |
2014 | 2039 | inventoryTransaction.setMaterialName(child.getMaterialName()); |
... | ... | @@ -2016,6 +2041,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2016 | 2041 | inventoryTransaction.setMaterialUnit(child.getMaterialUnit()); |
2017 | 2042 | inventoryTransaction.setInventoryStatus(child.getInventoryStatus()); |
2018 | 2043 | inventoryTransaction.setQty(child.getCountedQty()); |
2044 | + inventoryTransaction.setShipmentQty(child.getCountedQty()); | |
2019 | 2045 | inventoryTransaction.setBatch(child.getBatch()); |
2020 | 2046 | inventoryTransaction.setLot(child.getLot()); |
2021 | 2047 | success = inventoryTransactionService.save(inventoryTransaction); |
... | ... | @@ -2128,7 +2154,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2128 | 2154 | String containerCode = taskHeader.getContainerCode(); |
2129 | 2155 | String fromLocationCode = taskHeader.getFromLocationCode(); |
2130 | 2156 | String toLocationCode = taskHeader.getToLocationCode(); |
2131 | - | |
2157 | + String zoneCode = taskHeader.getZoneCode(); | |
2132 | 2158 | if (StringUtils.isEmpty(containerCode)) { |
2133 | 2159 | return Result.error("完成移库任务时, 托盘号为空"); |
2134 | 2160 | } |
... | ... | @@ -2151,6 +2177,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
2151 | 2177 | inventoryDetail.setLocationCode(toLocationCode); |
2152 | 2178 | InventoryTransaction inventoryTransaction = new InventoryTransaction(); |
2153 | 2179 | inventoryTransaction.setWarehouseCode(inventoryDetail.getWarehouseCode()); |
2180 | + inventoryTransaction.setZoneCode(zoneCode); | |
2154 | 2181 | inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode()); |
2155 | 2182 | inventoryTransaction.setCompanyCode(inventoryDetail.getCompanyCode()); |
2156 | 2183 | inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_TRANSFER); |
... | ... |