Commit 6906a06f1d0a5fd5b25b44731472014960d0da0f
1 parent
e3d5e811
fix:出库单打印做出新调整:A、表格明细物料剩余库存数,改为当前托盘的剩余库存数。B、表格明细新增来源库位的巷道、任务类型、合并前单据号。
Showing
2 changed files
with
60 additions
and
40 deletions
src/main/java/com/huaheng/pc/shipment/shipmentHeader/domain/ShipmentPrintVo.java
... | ... | @@ -10,40 +10,47 @@ import java.util.List; |
10 | 10 | |
11 | 11 | public class ShipmentPrintVo { |
12 | 12 | public String template = "haiwang"; |
13 | - public ShipHeader data = new ShipHeader(); | |
13 | + public ShipHeader voHeader = new ShipHeader(); | |
14 | 14 | |
15 | - public void setHeader(ShipmentHeader header, String totalLines, String totalQty, String pageNumber, String zoneInfo, String unionCode) { | |
16 | - data.created = DataUtils.formate(header.getCreated()); | |
17 | - data.qty = totalQty;//头表当前页明细总数 | |
18 | - data.count = totalLines;//头表当前页明细条数 | |
19 | - data.shipmentCode = header.getCode(); | |
20 | - data.workshop = header.getWorkshop(); | |
21 | - data.noticeNo = header.getNoticeNo(); | |
22 | - data.superiorName = header.getSuperiorName(); | |
23 | - data.superiorCode = header.getSuperiorCode(); | |
24 | - data.warehouseName = header.getWarehouseName(); | |
25 | - data.transferWarehouseName = header.getTransferWarehouseName(); | |
26 | - data.remark = header.getShipmentNote(); | |
27 | - data.unionCode = unionCode; | |
28 | - data.zoneInfo = zoneInfo; | |
29 | - data.pageNumber = pageNumber; | |
30 | - if (header.getShipmentType().equals("208")) { | |
31 | - data.footRight = "形态转换单据得重新维护编码,并重新入库"; | |
15 | + public void setHeader(ShipmentHeader shipmentHeader, String totalLines, String totalQty, String pageNumber, String zoneInfo, String unionCode) { | |
16 | + voHeader.created = DataUtils.formate(shipmentHeader.getCreated()); | |
17 | + voHeader.qty = totalQty;//头表当前页明细总数 | |
18 | + voHeader.count = totalLines;//头表当前页明细条数 | |
19 | + voHeader.shipmentCode = shipmentHeader.getCode(); | |
20 | + voHeader.workshop = shipmentHeader.getWorkshop(); | |
21 | + voHeader.noticeNo = shipmentHeader.getNoticeNo(); | |
22 | + voHeader.superiorName = shipmentHeader.getSuperiorName(); | |
23 | + voHeader.superiorCode = shipmentHeader.getSuperiorCode(); | |
24 | + voHeader.warehouseName = shipmentHeader.getWarehouseName(); | |
25 | + voHeader.transferWarehouseName = shipmentHeader.getTransferWarehouseName(); | |
26 | + voHeader.remark = shipmentHeader.getShipmentNote(); | |
27 | + voHeader.unionCode = unionCode;//合并单号 | |
28 | + voHeader.zoneInfo = zoneInfo; | |
29 | + voHeader.pageNumber = pageNumber;//页码 | |
30 | + if (shipmentHeader.getShipmentType().equals("208")) { | |
31 | + voHeader.footRight = "形态转换单据得重新维护编码,并重新入库"; | |
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | - public ShipDetail addShipDetail(TaskDetail taskDetail) { | |
36 | - ShipDetail detail = new ShipDetail(); | |
35 | + public ShipDetail addShipDetail(TaskDetail taskDetail, String roadway) { | |
36 | + ShipDetail voDetail = new ShipDetail(); | |
37 | 37 | if (taskDetail.getFlat() == null || taskDetail.getFlat() != 1) { |
38 | - detail.containerCode = taskDetail.getContainerCode(); | |
38 | + voDetail.containerCode = taskDetail.getContainerCode(); | |
39 | 39 | } |
40 | - detail.zone = taskDetail.getZoneName(); | |
41 | - detail.materialCode = taskDetail.getMaterialCode(); | |
42 | - detail.materialName = taskDetail.getMaterialName(); | |
43 | - detail.qty = taskDetail.getQty().stripTrailingZeros().toPlainString(); | |
44 | - detail.taskId = String.valueOf(taskDetail.getTaskId()); | |
45 | - data.details.add(detail); | |
46 | - return detail; | |
40 | + if (taskDetail.getTaskType() == 300) { | |
41 | + voDetail.type = "整盘"; | |
42 | + } else { | |
43 | + voDetail.type = "分拣"; | |
44 | + } | |
45 | + voDetail.zone = taskDetail.getZoneName(); | |
46 | + voDetail.materialCode = taskDetail.getMaterialCode(); | |
47 | + voDetail.materialName = taskDetail.getMaterialName(); | |
48 | + voDetail.qty = taskDetail.getQty().stripTrailingZeros().toPlainString(); | |
49 | + voDetail.taskId = String.valueOf(taskDetail.getTaskId()); | |
50 | + voDetail.roadway = roadway;//巷道 | |
51 | + voDetail.recordCode = taskDetail.getRecordCode();//合并前单号 | |
52 | + voHeader.details.add(voDetail); | |
53 | + return voDetail; | |
47 | 54 | } |
48 | 55 | |
49 | 56 | public class ShipHeader { |
... | ... | @@ -85,6 +92,9 @@ public class ShipmentPrintVo { |
85 | 92 | public String materialName = ""; |
86 | 93 | public String qty; |
87 | 94 | public String invQty; |
95 | + private String roadway;//巷道 | |
96 | + private String type;//任务类型 | |
97 | + private String recordCode;//合并前单号 | |
88 | 98 | } |
89 | 99 | |
90 | 100 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java
... | ... | @@ -17,6 +17,8 @@ import com.huaheng.pc.config.address.service.AddressService; |
17 | 17 | import com.huaheng.pc.config.company.service.CompanyService; |
18 | 18 | import com.huaheng.pc.config.customer.domain.Customer; |
19 | 19 | import com.huaheng.pc.config.customer.service.CustomerServiceImpl; |
20 | +import com.huaheng.pc.config.location.domain.Location; | |
21 | +import com.huaheng.pc.config.location.service.LocationService; | |
20 | 22 | import com.huaheng.pc.config.material.service.MaterialService; |
21 | 23 | import com.huaheng.pc.config.shipmentType.service.ShipmentTypeService; |
22 | 24 | import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; |
... | ... | @@ -51,7 +53,7 @@ import java.util.stream.Collectors; |
51 | 53 | @Service |
52 | 54 | public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, ShipmentHeader> implements ShipmentHeaderService { |
53 | 55 | |
54 | - @Autowired | |
56 | + @Resource | |
55 | 57 | private IDictDataService dictDataService; |
56 | 58 | @Resource |
57 | 59 | private AddressService addressService; |
... | ... | @@ -59,13 +61,13 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
59 | 61 | private InventoryDetailService inventoryDetailService; |
60 | 62 | @Resource |
61 | 63 | private ShipmentHeaderMapper shipmentHeaderMapper; |
62 | - @Autowired | |
64 | + @Resource | |
63 | 65 | private ShipmentDetailService shipmentDetailService; |
64 | - @Autowired | |
66 | + @Resource | |
65 | 67 | private ShipmentContainerHeaderService shipmentContainerHeaderService; |
66 | - @Autowired | |
68 | + @Resource | |
67 | 69 | private ShipmentHeaderHistoryService shipmentHeaderHistoryService; |
68 | - @Autowired | |
70 | + @Resource | |
69 | 71 | private ShipmentDetailHistoryService shipmentDetailHistoryService; |
70 | 72 | @Resource |
71 | 73 | private CompanyService companyService; |
... | ... | @@ -77,6 +79,8 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
77 | 79 | private ShipmentTypeService shipmentTypeService; |
78 | 80 | @Resource |
79 | 81 | private TaskDetailService taskDetailService; |
82 | + @Resource | |
83 | + private LocationService locationService; | |
80 | 84 | |
81 | 85 | //新增出库主单 |
82 | 86 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -504,17 +508,23 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
504 | 508 | String totalQty = String.valueOf(currentPage.stream().map(TaskDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add)); |
505 | 509 | ShipmentPrintVo vo = new ShipmentPrintVo(); |
506 | 510 | vo.setHeader(shipmentHeader, totalLines, totalQty, pageNumber, zoneInfo, unionCode); |
507 | - currentPage.forEach(it -> { | |
511 | + | |
512 | + currentPage.forEach(taskDetail -> { | |
513 | + String roadway = ""; | |
514 | + Location location = locationService.getOne(new LambdaQueryWrapper<Location>().eq(Location::getCode, taskDetail.getFromLocation())); | |
515 | + if (location != null) { | |
516 | + roadway = location.getRoadway(); | |
517 | + } | |
508 | 518 | InventoryDetail inventory = new InventoryDetail(); |
509 | - inventory.setWarehouseCode(it.getWarehouseCode()); | |
510 | - inventory.setMaterialCode(it.getMaterialCode()); | |
511 | - inventory.setInventorySts(it.getInventorySts()); | |
512 | - vo.addShipDetail(it).invQty = inventoryDetailService.getSumQty(inventory).stripTrailingZeros().toPlainString(); | |
519 | + inventory.setWarehouseCode(taskDetail.getWarehouseCode()); | |
520 | + inventory.setMaterialCode(taskDetail.getMaterialCode()); | |
521 | + inventory.setInventorySts(taskDetail.getInventorySts()); | |
522 | + inventory.setContainerCode(taskDetail.getContainerCode()); | |
523 | + vo.addShipDetail(taskDetail, roadway).invQty = inventoryDetailService.getSumQty(inventory).stripTrailingZeros().toPlainString(); | |
513 | 524 | }); |
514 | 525 | |
515 | 526 | String jsonParam = JSON.toJSONString(vo); |
516 | - String url = "http://127.0.0.1:52099/print"; | |
517 | - url = addressService.selectAddress(QuantityConstant.PRINT_SER1VER_URL, shipmentHeader.getWarehouseCode(), "1"); | |
527 | + String url = addressService.selectAddress(QuantityConstant.PRINT_SER1VER_URL, shipmentHeader.getWarehouseCode(), "1"); | |
518 | 528 | |
519 | 529 | ResponseEntity<JSONObject> result = RestUtil.request_post(url, "CS0001", jsonParam); |
520 | 530 | if (result != null && result.getBody() != null) { |
... | ... |