Commit 80d74a35cc30ac2e26b4867981ce63b9f95ba511
1 parent
ebee70b3
完善入库质检功能
Showing
6 changed files
with
105 additions
and
26 deletions
ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue
@@ -307,6 +307,11 @@ export default { | @@ -307,6 +307,11 @@ export default { | ||
307 | scopedSlots: {customRender: 'inventoryStatus_dictText'} | 307 | scopedSlots: {customRender: 'inventoryStatus_dictText'} |
308 | }, | 308 | }, |
309 | { | 309 | { |
310 | + title: '数量', | ||
311 | + align: "center", | ||
312 | + dataIndex: 'qty' | ||
313 | + }, | ||
314 | + { | ||
310 | title: '入库数量', | 315 | title: '入库数量', |
311 | align: "center", | 316 | align: "center", |
312 | dataIndex: 'receiptQty' | 317 | dataIndex: 'receiptQty' |
ant-design-vue-jeecg/src/views/system/receipt/ReceiveHeaderList.vue
@@ -163,16 +163,16 @@ | @@ -163,16 +163,16 @@ | ||
163 | </template> | 163 | </template> |
164 | 164 | ||
165 | <span slot="action" slot-scope="text, record"> | 165 | <span slot="action" slot-scope="text, record"> |
166 | - <a @click="receive(record)"> | ||
167 | - <a-button v-has="'receiveHeader:receive'" v-if="(record.lastStatus < 200)" type="primary">收货</a-button><a-divider type="vertical"/> | 166 | + <a v-has="'receiveHeader:receive'" v-if="(record.lastStatus < 200)" @click="receive(record)"> |
167 | + <a-button type="primary">收货</a-button><a-divider type="vertical"/> | ||
168 | </a> | 168 | </a> |
169 | - <a @click="receiveHeader(record.id)"> | ||
170 | - <a-button v-has="'receiveHeader:receive'" v-if="(record.lastStatus < 200)" type="primary">全部收货</a-button><a-divider type="vertical"/> | 169 | + <a v-has="'receiveHeader:receive'" v-if="(record.lastStatus < 200)" @click="receiveHeader(record.id)"> |
170 | + <a-button type="primary">全部收货</a-button><a-divider type="vertical"/> | ||
171 | </a> | 171 | </a> |
172 | - <a @click="receiveHeaderToQuality(record.id)"> | ||
173 | - <a-button v-has="'receiveHeader:quality'" v-if="(record.lastStatus == 200)" type="primary">全部质检</a-button><a-divider type="vertical"/> | 172 | + <a v-has="'receiveHeader:quality'" v-if="(record.lastStatus == 200)" @click="receiveHeaderToQuality(record.id)"> |
173 | + <a-button type="primary">全部质检</a-button><a-divider type="vertical"/> | ||
174 | </a> | 174 | </a> |
175 | - <a v-has="'receiveHeader:edit'" @click="handleEdit(record)"> | 175 | + <a v-has="'receiveHeader:edit'" v-if="(record.firstStatus == 0)" @click="handleEdit(record)"> |
176 | <a-button type="primary">编辑</a-button><a-divider type="vertical"/> | 176 | <a-button type="primary">编辑</a-button><a-divider type="vertical"/> |
177 | </a> | 177 | </a> |
178 | <a-popconfirm v-has="'receiveHeader:remove'" v-if="(record.firstStatus == 0)" title="确定删除吗?" @confirm="() => handleDelete(record.id)" > | 178 | <a-popconfirm v-has="'receiveHeader:remove'" v-if="(record.firstStatus == 0)" title="确定删除吗?" @confirm="() => handleDelete(record.id)" > |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/service/impl/QualityDetailServiceImpl.java
1 | package org.jeecg.modules.wms.receipt.qualityHeader.service.impl; | 1 | package org.jeecg.modules.wms.receipt.qualityHeader.service.impl; |
2 | 2 | ||
3 | import java.math.BigDecimal; | 3 | import java.math.BigDecimal; |
4 | +import java.util.ArrayList; | ||
4 | import java.util.List; | 5 | import java.util.List; |
5 | 6 | ||
6 | import javax.annotation.Resource; | 7 | import javax.annotation.Resource; |
7 | 8 | ||
8 | import org.jeecg.common.api.vo.Result; | 9 | import org.jeecg.common.api.vo.Result; |
9 | import org.jeecg.common.exception.JeecgBootException; | 10 | import org.jeecg.common.exception.JeecgBootException; |
11 | +import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; | ||
12 | +import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; | ||
10 | import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityDetail; | 13 | import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityDetail; |
11 | import org.jeecg.modules.wms.receipt.qualityHeader.mapper.QualityDetailMapper; | 14 | import org.jeecg.modules.wms.receipt.qualityHeader.mapper.QualityDetailMapper; |
12 | import org.jeecg.modules.wms.receipt.qualityHeader.service.IQualityDetailService; | 15 | import org.jeecg.modules.wms.receipt.qualityHeader.service.IQualityDetailService; |
@@ -33,6 +36,8 @@ public class QualityDetailServiceImpl extends ServiceImpl<QualityDetailMapper, Q | @@ -33,6 +36,8 @@ public class QualityDetailServiceImpl extends ServiceImpl<QualityDetailMapper, Q | ||
33 | private IQualityDetailService qualityDetailService; | 36 | private IQualityDetailService qualityDetailService; |
34 | @Resource | 37 | @Resource |
35 | private IQualityHeaderService qualityHeaderService; | 38 | private IQualityHeaderService qualityHeaderService; |
39 | + @Resource | ||
40 | + private IInventoryTransactionService inventoryTransactionService; | ||
36 | 41 | ||
37 | @Override | 42 | @Override |
38 | public List<QualityDetail> selectByMainId(String mainId) { | 43 | public List<QualityDetail> selectByMainId(String mainId) { |
@@ -68,6 +73,45 @@ public class QualityDetailServiceImpl extends ServiceImpl<QualityDetailMapper, Q | @@ -68,6 +73,45 @@ public class QualityDetailServiceImpl extends ServiceImpl<QualityDetailMapper, Q | ||
68 | if (!qualityHeaderService.updateQualityHeaderStatus(qualityDetail.getQualityId())) { | 73 | if (!qualityHeaderService.updateQualityHeaderStatus(qualityDetail.getQualityId())) { |
69 | throw new JeecgBootException("质检失败,更新质检状态失败"); | 74 | throw new JeecgBootException("质检失败,更新质检状态失败"); |
70 | } | 75 | } |
76 | + | ||
77 | + List<InventoryTransaction> inventoryTransactionList = new ArrayList<>(); | ||
78 | + if (qualityfiedQty.compareTo(BigDecimal.ZERO) > 0) { | ||
79 | + InventoryTransaction inventoryTransaction = new InventoryTransaction(); | ||
80 | + inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_QUALITY); | ||
81 | + inventoryTransaction.setWarehouseCode(qualityDetail.getWarehouseCode()); | ||
82 | + inventoryTransaction.setCompanyCode(qualityDetail.getCompanyCode()); | ||
83 | + inventoryTransaction.setReceiptCode(qualityDetail.getQualityCode()); | ||
84 | + inventoryTransaction.setMaterialCode(qualityDetail.getMaterialCode()); | ||
85 | + inventoryTransaction.setMaterialName(qualityDetail.getMaterialName()); | ||
86 | + inventoryTransaction.setMaterialSpec(qualityDetail.getMaterialSpec()); | ||
87 | + inventoryTransaction.setMaterialUnit(qualityDetail.getMaterialUnit()); | ||
88 | + inventoryTransaction.setBatch(qualityDetail.getBatch()); | ||
89 | + inventoryTransaction.setLot(qualityDetail.getLot()); | ||
90 | + inventoryTransaction.setProject(qualityDetail.getProject()); | ||
91 | + inventoryTransaction.setInventoryStatus(QuantityConstant.QUALITY_GOOD); | ||
92 | + inventoryTransaction.setQty(qualityfiedQty); | ||
93 | + inventoryTransactionList.add(inventoryTransaction); | ||
94 | + } | ||
95 | + if (unqualityfiedQty.compareTo(BigDecimal.ZERO) > 0) { | ||
96 | + InventoryTransaction inventoryTransaction = new InventoryTransaction(); | ||
97 | + inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_QUALITY); | ||
98 | + inventoryTransaction.setWarehouseCode(qualityDetail.getWarehouseCode()); | ||
99 | + inventoryTransaction.setCompanyCode(qualityDetail.getCompanyCode()); | ||
100 | + inventoryTransaction.setReceiptCode(qualityDetail.getQualityCode()); | ||
101 | + inventoryTransaction.setMaterialCode(qualityDetail.getMaterialCode()); | ||
102 | + inventoryTransaction.setMaterialName(qualityDetail.getMaterialName()); | ||
103 | + inventoryTransaction.setMaterialSpec(qualityDetail.getMaterialSpec()); | ||
104 | + inventoryTransaction.setMaterialUnit(qualityDetail.getMaterialUnit()); | ||
105 | + inventoryTransaction.setBatch(qualityDetail.getBatch()); | ||
106 | + inventoryTransaction.setLot(qualityDetail.getLot()); | ||
107 | + inventoryTransaction.setProject(qualityDetail.getProject()); | ||
108 | + inventoryTransaction.setInventoryStatus(QuantityConstant.QUALITY_DEFECTIVE); | ||
109 | + inventoryTransaction.setQty(unqualityfiedQty); | ||
110 | + inventoryTransactionList.add(inventoryTransaction); | ||
111 | + } | ||
112 | + if (!inventoryTransactionService.saveBatch(inventoryTransactionList)) { | ||
113 | + throw new JeecgBootException("质检失败,增加库存交易记录失败"); | ||
114 | + } | ||
71 | return Result.ok("质检成功"); | 115 | return Result.ok("质检成功"); |
72 | } | 116 | } |
73 | 117 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/service/impl/QualityHeaderServiceImpl.java
@@ -80,8 +80,12 @@ public class QualityHeaderServiceImpl extends ServiceImpl<QualityHeaderMapper, Q | @@ -80,8 +80,12 @@ public class QualityHeaderServiceImpl extends ServiceImpl<QualityHeaderMapper, Q | ||
80 | } | 80 | } |
81 | if (maxCode != null) { | 81 | if (maxCode != null) { |
82 | String day = maxCode.substring(maxCode.length() - 13, maxCode.length() - 5); | 82 | String day = maxCode.substring(maxCode.length() - 13, maxCode.length() - 5); |
83 | - Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); | ||
84 | - code = qualityType + df.format(now) + String.format("%05d", Count + 1); | 83 | + if (day.equals(df.format(now))) { |
84 | + Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); | ||
85 | + code = qualityType + df.format(now) + String.format("%05d", Count + 1); | ||
86 | + } else { | ||
87 | + code = qualityType + df.format(now) + String.format("%05d", 0000 + 1); | ||
88 | + } | ||
85 | } else { | 89 | } else { |
86 | code = qualityType + df.format(now) + String.format("%05d", 0000 + 1); | 90 | code = qualityType + df.format(now) + String.format("%05d", 0000 + 1); |
87 | } | 91 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiveHeader/service/impl/ReceiveDetailServiceImpl.java
@@ -199,8 +199,7 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | @@ -199,8 +199,7 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | ||
199 | inventoryTransaction.setLot(receiveDetail.getLot()); | 199 | inventoryTransaction.setLot(receiveDetail.getLot()); |
200 | inventoryTransaction.setProject(receiveDetail.getProject()); | 200 | inventoryTransaction.setProject(receiveDetail.getProject()); |
201 | inventoryTransaction.setInventoryStatus(receiveDetail.getInventoryStatus()); | 201 | inventoryTransaction.setInventoryStatus(receiveDetail.getInventoryStatus()); |
202 | - inventoryTransaction.setQty(receiveQty); | ||
203 | - inventoryTransaction.setReceiptQty(receiveQty); | 202 | + inventoryTransaction.setQty(taskQty); |
204 | inventoryTransactionList.add(inventoryTransaction); | 203 | inventoryTransactionList.add(inventoryTransaction); |
205 | } | 204 | } |
206 | if (CollectionUtils.isEmpty(receiveDetailList)) { | 205 | if (CollectionUtils.isEmpty(receiveDetailList)) { |
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
@@ -12,7 +12,7 @@ package org.jeecg.utils.constant; | @@ -12,7 +12,7 @@ package org.jeecg.utils.constant; | ||
12 | * 8、波次状态 | 12 | * 8、波次状态 |
13 | * 9、质检状态 | 13 | * 9、质检状态 |
14 | * 10、盘点状态 | 14 | * 10、盘点状态 |
15 | - * 11、INVENTORY_TRANSACTION_RECEIPT | 15 | + * 11、库存交易记录 |
16 | * 12、调整单状态 | 16 | * 12、调整单状态 |
17 | * 13、任务内部类型 | 17 | * 13、任务内部类型 |
18 | * 14、质检单类型 | 18 | * 14、质检单类型 |
@@ -307,6 +307,12 @@ public class QuantityConstant { | @@ -307,6 +307,12 @@ public class QuantityConstant { | ||
307 | /** 移库 */ | 307 | /** 移库 */ |
308 | public static final Integer INVENTORY_TRANSACTION_TRANSFER = 50; | 308 | public static final Integer INVENTORY_TRANSACTION_TRANSFER = 50; |
309 | 309 | ||
310 | + /** 收货 */ | ||
311 | + public static final Integer INVENTORY_TRANSACTION_RECEIVE = 60; | ||
312 | + | ||
313 | + /** 质检 */ | ||
314 | + public static final Integer INVENTORY_TRANSACTION_QUALITY = 70; | ||
315 | + | ||
310 | // 12、调整单状态 | 316 | // 12、调整单状态 |
311 | 317 | ||
312 | // 未批准 | 318 | // 未批准 |
@@ -402,7 +408,22 @@ public class QuantityConstant { | @@ -402,7 +408,22 @@ public class QuantityConstant { | ||
402 | public static final Integer RECEIVE_HEADER_HALF = 100; | 408 | public static final Integer RECEIVE_HEADER_HALF = 100; |
403 | // 收货单完成收货状态 | 409 | // 收货单完成收货状态 |
404 | public static final Integer RECEIVE_HEADER_COMPLETE = 200; | 410 | public static final Integer RECEIVE_HEADER_COMPLETE = 200; |
405 | - | 411 | + // 生成质检单 |
412 | + public static final Integer RECEIVE_HEADER_QUALITY = 300; | ||
413 | + | ||
414 | + // 新建 | ||
415 | + public static final Integer QUALITY_HEADER_BUILD = 0; | ||
416 | + // 部分质检 | ||
417 | + public static final Integer QUALITY_HEADER_HALF = 100; | ||
418 | + // 质检完成 | ||
419 | + public static final Integer QUALITY_HEADER_COMPLETE = 200; | ||
420 | + | ||
421 | + /** 来料质检 */ | ||
422 | + public static final String QUALITY_TYPE_INCOMING = "QI"; | ||
423 | + /** 库内全检 */ | ||
424 | + public static final String QUALITY_TYPE_INHOUSE_FULL = "QIF"; | ||
425 | + /** 库内抽检 */ | ||
426 | + public static final String QUALITY_TYPE_INHOUSE_PART = "QIP"; | ||
406 | 427 | ||
407 | /** 对接WCS可用巷道API */ | 428 | /** 对接WCS可用巷道API */ |
408 | public static final String ADDRESS_WCS_AVAILABLE_ROWDWAY = "WCS_AVAILABLE_ROWDWAY"; | 429 | public static final String ADDRESS_WCS_AVAILABLE_ROWDWAY = "WCS_AVAILABLE_ROWDWAY"; |
@@ -451,8 +472,14 @@ public class QuantityConstant { | @@ -451,8 +472,14 @@ public class QuantityConstant { | ||
451 | public static final String PLATFORM_CODING = "赋码系统"; | 472 | public static final String PLATFORM_CODING = "赋码系统"; |
452 | public static final String PLATFORM_ERP = "ERP"; | 473 | public static final String PLATFORM_ERP = "ERP"; |
453 | public static final String PLATFORM_WMS = "WMS"; | 474 | public static final String PLATFORM_WMS = "WMS"; |
454 | - // good | 475 | + // 良品 |
455 | public static final String QUALITY_GOOD = "good"; | 476 | public static final String QUALITY_GOOD = "good"; |
477 | + // 次品 | ||
478 | + public static final String QUALITY_DEFECTIVE = "defective"; | ||
479 | + // 报废品 | ||
480 | + public static final String QUALITY_SCRAP = "scrap"; | ||
481 | + // 待确认 | ||
482 | + public static final String QUALITY_DISUSSED = "discussed"; | ||
456 | 483 | ||
457 | // 发送AGV任务成功 | 484 | // 发送AGV任务成功 |
458 | public static final int AGV_NEED_SEND = 0; | 485 | public static final int AGV_NEED_SEND = 0; |
@@ -515,25 +542,25 @@ public class QuantityConstant { | @@ -515,25 +542,25 @@ public class QuantityConstant { | ||
515 | * 出库依赖库区 | 542 | * 出库依赖库区 |
516 | */ | 543 | */ |
517 | public static final int SHIPMENT_BY_ZONE = 1; | 544 | public static final int SHIPMENT_BY_ZONE = 1; |
518 | - | ||
519 | - /** 对接WCS可用巷道API:关闭 */ | 545 | + |
546 | + /** 对接WCS可用巷道API:关闭 */ | ||
520 | public static final String AVAILABLE_ROWDWAY_CLOSE = "0"; | 547 | public static final String AVAILABLE_ROWDWAY_CLOSE = "0"; |
521 | - | 548 | + |
522 | /** 对接WCS可用巷道API:开启 */ | 549 | /** 对接WCS可用巷道API:开启 */ |
523 | public static final String AVAILABLE_ROWDWAY_OPEN = "1"; | 550 | public static final String AVAILABLE_ROWDWAY_OPEN = "1"; |
524 | - | 551 | + |
525 | /** 启用获取可用巷道API */ | 552 | /** 启用获取可用巷道API */ |
526 | public static final String RULE_AVAILABLE_ROWDWAY_STATUS = "availableRowdwayStatus"; | 553 | public static final String RULE_AVAILABLE_ROWDWAY_STATUS = "availableRowdwayStatus"; |
527 | - | ||
528 | - /** 接口异常响应通知配置 */ | ||
529 | - | ||
530 | - /** 定时任务异常响应通知配置 */ | 554 | + |
555 | + /** 接口异常响应通知配置 */ | ||
556 | + | ||
557 | + /** 定时任务异常响应通知配置 */ | ||
531 | public static final String RULE_JOB_EXCEPTION_NOTICE_ROLE_OR_NAME = "jobExceptionNoticeRoleOrName"; | 558 | public static final String RULE_JOB_EXCEPTION_NOTICE_ROLE_OR_NAME = "jobExceptionNoticeRoleOrName"; |
532 | - | ||
533 | - /** 接口异常响应通知配置 */ | 559 | + |
560 | + /** 接口异常响应通知配置 */ | ||
534 | public static final String RULE_API_EXCEPTION_NOTICE_ROLE_OR_NAME = "apiExceptionNoticeRoleOrName"; | 561 | public static final String RULE_API_EXCEPTION_NOTICE_ROLE_OR_NAME = "apiExceptionNoticeRoleOrName"; |
535 | - | ||
536 | - /** 定时任务执行消息通知配置 */ | 562 | + |
563 | + /** 定时任务执行消息通知配置 */ | ||
537 | public static final String RULE_TASK_RUN_NOTICE_CLASS_NAME = "taskRunNoticeClassName"; | 564 | public static final String RULE_TASK_RUN_NOTICE_CLASS_NAME = "taskRunNoticeClassName"; |
538 | 565 | ||
539 | public static final int RULE_TASK_NOT_CLEAR = 0; | 566 | public static final int RULE_TASK_NOT_CLEAR = 0; |