Commit a309432fe13f30080756d9fecf03a27fd650657e
1 parent
299be2ed
出入库类型修改成动态
Showing
2 changed files
with
23 additions
and
15 deletions
src/main/java/com/huaheng/api/general/service/ReceiptApiService.java
... | ... | @@ -102,13 +102,14 @@ public class ReceiptApiService { |
102 | 102 | if(receiptDetails.isEmpty()) { |
103 | 103 | return AjaxResult.error("入库子单为空"); |
104 | 104 | } |
105 | - switch (receiptHeader.getReferType()){ | |
106 | - case "01receipt" : | |
107 | - receiptHeader.setReceiptType("SHUZ"); | |
108 | - break; | |
109 | - default: | |
110 | - return AjaxResult.error(receiptHeader.getReferType()+":没有这入库单类型"); | |
105 | + LambdaQueryWrapper<ReceiptType> receiptTypeQuery = Wrappers.lambdaQuery(); | |
106 | + receiptTypeQuery.eq(ReceiptType::getReferType,receiptHeader.getReferType()); | |
107 | + ReceiptType receiptType = receiptTypeService.getOne(receiptTypeQuery); | |
108 | + if (receiptType==null) | |
109 | + { | |
110 | + return AjaxResult.error("入库单类型不存在 请检查配置"); | |
111 | 111 | } |
112 | + receiptHeader.setReceiptType(receiptType.getCode()); | |
112 | 113 | |
113 | 114 | checkReceiptBill(receiptHeader.getReferCode(),receiptHeader.getReceiptType()); |
114 | 115 | |
... | ... |
src/main/java/com/huaheng/api/general/service/ShipmentApiService.java
... | ... | @@ -8,12 +8,15 @@ import com.huaheng.common.exception.service.ServiceException; |
8 | 8 | import com.huaheng.common.utils.StringUtils; |
9 | 9 | import com.huaheng.common.utils.security.ShiroUtils; |
10 | 10 | import com.huaheng.framework.web.domain.AjaxResult; |
11 | +import com.huaheng.mobile.shipment.Shipment; | |
11 | 12 | import com.huaheng.pc.config.company.domain.Company; |
12 | 13 | import com.huaheng.pc.config.company.service.CompanyService; |
13 | 14 | import com.huaheng.pc.config.customer.domain.Customer; |
14 | 15 | import com.huaheng.pc.config.customer.service.CustomerServiceImpl; |
15 | 16 | import com.huaheng.pc.config.material.domain.Material; |
16 | 17 | import com.huaheng.pc.config.material.service.MaterialService; |
18 | +import com.huaheng.pc.config.receiptType.domain.ReceiptType; | |
19 | +import com.huaheng.pc.config.receiptType.service.ReceiptTypeService; | |
17 | 20 | import com.huaheng.pc.config.shipmentType.domain.ShipmentType; |
18 | 21 | import com.huaheng.pc.config.shipmentType.service.ShipmentTypeService; |
19 | 22 | import com.huaheng.pc.config.warehouse.domain.Warehouse; |
... | ... | @@ -81,6 +84,8 @@ public class ShipmentApiService { |
81 | 84 | @Resource |
82 | 85 | private ShipmentContainerDetailService shipmentContainerDetailService; |
83 | 86 | |
87 | + | |
88 | + | |
84 | 89 | /** |
85 | 90 | * 出库单下发 |
86 | 91 | * |
... | ... | @@ -108,16 +113,18 @@ public class ShipmentApiService { |
108 | 113 | if(shipmentDetails.size() < 1 || shipmentDetails == null ){ |
109 | 114 | return AjaxResult.error("出库子单为空"); |
110 | 115 | } |
111 | - switch (shipmentHeader.getReferType()){ | |
112 | - case "04release" : | |
113 | - shipmentHeader.setShipmentType("SHUZ"); | |
114 | - break; | |
115 | - case "06transferOutbound" : | |
116 | - shipmentHeader.setShipmentType("QTCK"); | |
117 | - break; | |
118 | - default: | |
119 | - return AjaxResult.error(shipmentHeader.getReferType()+":没有这出库单类型"); | |
116 | + | |
117 | + | |
118 | + LambdaQueryWrapper<ShipmentType> shipmentTypeLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
119 | + shipmentTypeLambdaQueryWrapper.eq(ShipmentType::getReferType,shipmentHeader.getReferType()); | |
120 | + ShipmentType shipmentType = shipmentTypeService.getOne(shipmentTypeLambdaQueryWrapper); | |
121 | + if (shipmentType==null) | |
122 | + { | |
123 | + return AjaxResult.error("入库单类型不存在 请检查配置"); | |
120 | 124 | } |
125 | + | |
126 | + shipmentHeader.setShipmentType(shipmentType.getCode()); | |
127 | + | |
121 | 128 | checkShipmentBill(shipmentHeader.getReferCode(),shipmentHeader.getShipmentType()); |
122 | 129 | |
123 | 130 | //2、检查出库主单的合法性 |
... | ... |