Commit 64c4e6cac48eed1e23681ff9aebdaedc1a2b3ea7
1 parent
90d8a64d
feat:蓝牙打印出库物料明细和蓝牙打印入库物料明细接口,如果单据表查询不到接着去历史表查询
Showing
2 changed files
with
50 additions
and
15 deletions
src/main/java/com/huaheng/api/mes/controller/MesReceiptController.java
... | ... | @@ -32,10 +32,15 @@ import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactio |
32 | 32 | import com.huaheng.pc.momLog.service.IMomLogService; |
33 | 33 | import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; |
34 | 34 | import com.huaheng.pc.receipt.receiptDetail.service.ReceiptDetailService; |
35 | +import com.huaheng.pc.receipt.receiptDetailHistory.domain.ReceiptDetailHistory; | |
36 | +import com.huaheng.pc.receipt.receiptDetailHistory.service.ReceiptDetailHistoryService; | |
35 | 37 | import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; |
36 | 38 | import com.huaheng.pc.receipt.receiptHeader.service.ReceiptHeaderService; |
39 | +import com.huaheng.pc.receipt.receiptHeaderHistory.service.ReceiptHeaderHistoryService; | |
37 | 40 | import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; |
38 | 41 | import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; |
42 | +import com.huaheng.pc.shipment.shipmentDetailHistory.domain.ShipmentDetailHistory; | |
43 | +import com.huaheng.pc.shipment.shipmentDetailHistory.service.ShipmentDetailHistoryService; | |
39 | 44 | import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
40 | 45 | import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; |
41 | 46 | import com.huaheng.pc.shipment.shipmentHeaderHistory.domain.ShipmentHeaderHistory; |
... | ... | @@ -84,13 +89,18 @@ public class MesReceiptController extends BaseController { |
84 | 89 | |
85 | 90 | @Resource |
86 | 91 | private TaskDetailService taskDetailService; |
87 | - | |
92 | + @Resource | |
93 | + private ShipmentDetailHistoryService shipmentDetailHistoryService; | |
94 | + @Resource | |
95 | + private ReceiptDetailHistoryService receiptDetailHistoryService; | |
88 | 96 | @Resource |
89 | 97 | private InventoryTransactionService inventoryTransactionService; |
90 | 98 | |
91 | 99 | @Resource |
92 | 100 | private ShipmentHeaderHistoryService shipmentHeaderHistoryService; |
93 | 101 | @Resource |
102 | + private ReceiptHeaderHistoryService receiptHeaderHistoryService; | |
103 | + @Resource | |
94 | 104 | private MaterialService materialService; |
95 | 105 | |
96 | 106 | @Resource |
... | ... | @@ -997,35 +1007,48 @@ public class MesReceiptController extends BaseController { |
997 | 1007 | List<ReceiptDetail> snno = receiptDetailService.list(new LambdaQueryWrapper<ReceiptDetail>().eq(ReceiptDetail::getSNNO, code)); |
998 | 1008 | if (!snno.isEmpty()) { |
999 | 1009 | code = snno.get(0).getReceiptCode(); |
1010 | + } else { | |
1011 | + List<ReceiptDetail> list = receiptDetailService.list(new LambdaQueryWrapper<ReceiptDetail>().eq(ReceiptDetail::getReceiptCode, code)); | |
1012 | + return AjaxResult.success(list); | |
1000 | 1013 | } |
1001 | - | |
1002 | - List<ReceiptDetail> list = receiptDetailService.list(new LambdaQueryWrapper<ReceiptDetail>().eq(ReceiptDetail::getReceiptCode, code)); | |
1003 | - if (list.isEmpty()) { | |
1014 | + List<ReceiptDetailHistory> snno2 = receiptDetailHistoryService.list(new LambdaQueryWrapper<ReceiptDetailHistory>().eq(ReceiptDetailHistory::getSNNO, code)); | |
1015 | + if (!snno2.isEmpty()) { | |
1016 | + code = snno2.get(0).getReceiptCode(); | |
1017 | + } | |
1018 | + List<ReceiptDetailHistory> list2 = receiptDetailHistoryService.list(new LambdaQueryWrapper<ReceiptDetailHistory>().eq(ReceiptDetailHistory::getReceiptCode, code)); | |
1019 | + if (list2.isEmpty()) { | |
1004 | 1020 | return AjaxResult.error("没有查询到数据"); |
1005 | 1021 | } |
1006 | - return AjaxResult.success(list); | |
1022 | + return AjaxResult.success(list2); | |
1007 | 1023 | } |
1008 | 1024 | |
1009 | 1025 | |
1010 | 1026 | /** |
1011 | 1027 | * 蓝牙打印出库物料明细 |
1012 | 1028 | */ |
1013 | - //@RequiresPermissions("receipt:receiptDetail:printList") | |
1014 | - //@Log(title = "入库-入库单明细管理", operating = "查看入库单明细", action = BusinessType.GRANT) | |
1015 | 1029 | @PostMapping("/shipment/printList") |
1016 | - //@ApiLogger(apiName = "蓝牙打印出库物料明细", from = "PDA") | |
1017 | 1030 | @ResponseBody |
1018 | 1031 | public AjaxResult shipmentPrintList(String code) { |
1019 | 1032 | List<ShipmentDetail> list = shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getShipmentCode, code)); |
1020 | - if (list.isEmpty()) { | |
1021 | - return AjaxResult.error("没有查询到数据"); | |
1033 | + if (!list.isEmpty()) { | |
1034 | + for (ShipmentDetail shipmentDetail : list) { | |
1035 | + ShipmentHeader shipmentHeader = shipmentHeaderService.getById(shipmentDetail.getShipmentId()); | |
1036 | + shipmentDetail.setWarehouse(shipmentHeader.getWarehouse()); | |
1037 | + shipmentDetail.setWarehouseName(shipmentHeader.getWarehouseName()); | |
1038 | + } | |
1039 | + return AjaxResult.success(list); | |
1022 | 1040 | } |
1023 | - for (ShipmentDetail shipmentDetail : list) { | |
1024 | - ShipmentHeader shipmentHeader = shipmentHeaderService.getById(shipmentDetail.getShipmentId()); | |
1025 | - shipmentDetail.setWarehouse(shipmentHeader.getWarehouse()); | |
1026 | - shipmentDetail.setWarehouseName(shipmentHeader.getWarehouseName()); | |
1041 | + | |
1042 | + List<ShipmentDetailHistory> list2 = shipmentDetailHistoryService.list(new LambdaQueryWrapper<ShipmentDetailHistory>().eq(ShipmentDetailHistory::getShipmentCode, code)); | |
1043 | + if (!list2.isEmpty()) { | |
1044 | + for (ShipmentDetailHistory shipmentDetail : list2) { | |
1045 | + ShipmentHeaderHistory shipmentHeader = shipmentHeaderHistoryService.getById(shipmentDetail.getShipmentId()); | |
1046 | + shipmentDetail.setWarehouse(shipmentHeader.getWarehouse()); | |
1047 | + shipmentDetail.setWarehouseName(shipmentHeader.getWarehouseName()); | |
1048 | + } | |
1049 | + return AjaxResult.success(list); | |
1027 | 1050 | } |
1028 | - return AjaxResult.success(list); | |
1051 | + return AjaxResult.error("没有查询到数据"); | |
1029 | 1052 | } |
1030 | 1053 | |
1031 | 1054 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/domain/ShipmentDetailHistory.java
... | ... | @@ -387,4 +387,16 @@ public class ShipmentDetailHistory implements Serializable { |
387 | 387 | @TableField(value = "preMergerWorkshop") |
388 | 388 | @ApiModelProperty(value = "合并前车间") |
389 | 389 | private String preMergerWorkshop; |
390 | + | |
391 | + /** | |
392 | + * 原仓库编码 | |
393 | + */ | |
394 | + @TableField(exist = false) | |
395 | + private String warehouse; | |
396 | + | |
397 | + /** | |
398 | + * 原仓库名称 | |
399 | + */ | |
400 | + @TableField(exist = false) | |
401 | + private String warehouseName; | |
390 | 402 | } |
... | ... |