Commit ab8cbcca1659b56efae62fdacbd39e33e671ddb4
1 parent
cb38ccdc
封装入库组盘参数
Showing
4 changed files
with
155 additions
and
42 deletions
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/domain/BatteryBean.java
0 → 100644
1 | +package com.huaheng.pc.receipt.receiptContainerHeader.domain; | |
2 | + | |
3 | +import java.math.BigDecimal; | |
4 | + | |
5 | +public class BatteryBean { | |
6 | + | |
7 | + private BigDecimal electricQuantity; | |
8 | + private String batteryTypes; | |
9 | + private String completeness; | |
10 | + private String storageType; | |
11 | + private String type; | |
12 | + private BigDecimal materialTareWeight; | |
13 | + private BigDecimal materialNetWeight; | |
14 | + private BigDecimal materialGrossWeight; | |
15 | + private String countryCode; | |
16 | + private String remark; | |
17 | + private String recycler; | |
18 | + private BigDecimal batteryQty; | |
19 | + | |
20 | + public BigDecimal getBatteryQty() { | |
21 | + return batteryQty; | |
22 | + } | |
23 | + | |
24 | + public void setBatteryQty(BigDecimal batteryQty) { | |
25 | + this.batteryQty = batteryQty; | |
26 | + } | |
27 | + | |
28 | + public String getCountryCode() { | |
29 | + return countryCode; | |
30 | + } | |
31 | + | |
32 | + public void setCountryCode(String countryCode) { | |
33 | + this.countryCode = countryCode; | |
34 | + } | |
35 | + | |
36 | + public String getRemark() { | |
37 | + return remark; | |
38 | + } | |
39 | + | |
40 | + public void setRemark(String remark) { | |
41 | + this.remark = remark; | |
42 | + } | |
43 | + | |
44 | + public BigDecimal getElectricQuantity() { | |
45 | + return electricQuantity; | |
46 | + } | |
47 | + | |
48 | + public void setElectricQuantity(BigDecimal electricQuantity) { | |
49 | + this.electricQuantity = electricQuantity; | |
50 | + } | |
51 | + | |
52 | + public String getBatteryTypes() { | |
53 | + return batteryTypes; | |
54 | + } | |
55 | + | |
56 | + public void setBatteryTypes(String batteryTypes) { | |
57 | + this.batteryTypes = batteryTypes; | |
58 | + } | |
59 | + | |
60 | + public String getCompleteness() { | |
61 | + return completeness; | |
62 | + } | |
63 | + | |
64 | + public void setCompleteness(String completeness) { | |
65 | + this.completeness = completeness; | |
66 | + } | |
67 | + | |
68 | + public String getStorageType() { | |
69 | + return storageType; | |
70 | + } | |
71 | + | |
72 | + public void setStorageType(String storageType) { | |
73 | + this.storageType = storageType; | |
74 | + } | |
75 | + | |
76 | + public String getType() { | |
77 | + return type; | |
78 | + } | |
79 | + | |
80 | + public void setType(String type) { | |
81 | + this.type = type; | |
82 | + } | |
83 | + | |
84 | + public BigDecimal getMaterialTareWeight() { | |
85 | + return materialTareWeight; | |
86 | + } | |
87 | + | |
88 | + public void setMaterialTareWeight(BigDecimal materialTareWeight) { | |
89 | + this.materialTareWeight = materialTareWeight; | |
90 | + } | |
91 | + | |
92 | + public BigDecimal getMaterialNetWeight() { | |
93 | + return materialNetWeight; | |
94 | + } | |
95 | + | |
96 | + public void setMaterialNetWeight(BigDecimal materialNetWeight) { | |
97 | + this.materialNetWeight = materialNetWeight; | |
98 | + } | |
99 | + | |
100 | + public BigDecimal getMaterialGrossWeight() { | |
101 | + return materialGrossWeight; | |
102 | + } | |
103 | + | |
104 | + public void setMaterialGrossWeight(BigDecimal materialGrossWeight) { | |
105 | + this.materialGrossWeight = materialGrossWeight; | |
106 | + } | |
107 | + | |
108 | + public String getRecycler() { | |
109 | + return recycler; | |
110 | + } | |
111 | + | |
112 | + public void setRecycler(String recycler) { | |
113 | + this.recycler = recycler; | |
114 | + } | |
115 | +} | |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderService.java
... | ... | @@ -3,6 +3,7 @@ package com.huaheng.pc.receipt.receiptContainerHeader.service; |
3 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
4 | 4 | import com.huaheng.framework.web.domain.AjaxResult; |
5 | 5 | import com.huaheng.mobile.receipt.ReceiptBill; |
6 | +import com.huaheng.pc.receipt.receiptContainerHeader.domain.BatteryBean; | |
6 | 7 | import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; |
7 | 8 | import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerView; |
8 | 9 | import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; |
... | ... | @@ -42,8 +43,8 @@ public interface ReceiptContainerHeaderService extends IService<ReceiptContainer |
42 | 43 | AjaxResult saveContainer(String receiptCode, String containerCode, Integer receiptDetailId, |
43 | 44 | BigDecimal batteryPackageWeight, |
44 | 45 | String locationCode, BigDecimal qty, String locatingRule, |
45 | - String barCodeHeaderCode,String area,String barCodeHeaderId, | |
46 | - ReceiptDetail receiptDetail); | |
46 | + String barCodeHeaderCode, String area, String barCodeHeaderId, | |
47 | + BatteryBean batteryBean); | |
47 | 48 | |
48 | 49 | /** |
49 | 50 | * 取消组盘 |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -33,6 +33,7 @@ import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; |
33 | 33 | import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService; |
34 | 34 | import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; |
35 | 35 | import com.huaheng.pc.receipt.receiptContainerDetail.service.ReceiptContainerDetailService; |
36 | +import com.huaheng.pc.receipt.receiptContainerHeader.domain.BatteryBean; | |
36 | 37 | import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; |
37 | 38 | import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerView; |
38 | 39 | import com.huaheng.pc.receipt.receiptContainerHeader.mapper.ReceiptContainerHeaderMapper; |
... | ... | @@ -129,10 +130,10 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
129 | 130 | Integer receiptDetailId, |
130 | 131 | BigDecimal batteryPackageWeight, String locationCode, BigDecimal qty, |
131 | 132 | String locatingRule, String barCodeHeaderCode, |
132 | - String area,String barCodeHeaderId,ReceiptDetail receiptdetail) { | |
133 | + String area,String barCodeHeaderId,BatteryBean batteryBean) { | |
133 | 134 | ReceiptDetail detail = receiptDetailService.getById(receiptDetailId); |
134 | - detail.setType(receiptdetail.getType()); | |
135 | - detail.setStorageType(receiptdetail.getStorageType()); | |
135 | + detail.setType(batteryBean.getType()); | |
136 | + detail.setStorageType(batteryBean.getStorageType()); | |
136 | 137 | receiptDetailService.updateById(detail); |
137 | 138 | |
138 | 139 | //超收检查 |
... | ... | @@ -141,7 +142,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
141 | 142 | //检查电池类必填项 |
142 | 143 | if(detail.getMaterialIsBattery()==1){ |
143 | 144 | // 检查电池类必填项和保存入库详情 |
144 | - checkBatteryDataSaveReceipt(receiptdetail,qty,detail); | |
145 | + checkBatteryDataSaveReceipt(batteryBean,qty,detail); | |
145 | 146 | } |
146 | 147 | |
147 | 148 | }else{ |
... | ... | @@ -273,7 +274,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
273 | 274 | //组盘详情 |
274 | 275 | //更新入库单详情数据 |
275 | 276 | receiptContainerDetailAdd(receiptContainerHeaders.get(0), receiptDetail, qty, batteryPackageWeight, |
276 | - containerCode, locationCode,barCodeHeaderCode,barCodeDetails,receiptdetail); | |
277 | + containerCode, locationCode,barCodeHeaderCode,barCodeDetails,batteryBean); | |
277 | 278 | //更新入库header表状态,保存主条码 |
278 | 279 | receiptDetailService.updateReceiptHeaderLastStatusByReceiptHeaderId(receiptDetail.getReceiptId(), |
279 | 280 | barCodeHeaderCode,barCodeHeader.getProType()); |
... | ... | @@ -293,7 +294,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
293 | 294 | //更新入库单详情数据 |
294 | 295 | receiptContainerDetailAdd(receiptContainerHeaders.get(0), receiptDetail, |
295 | 296 | qty,batteryPackageWeight, containerCode, |
296 | - locationCode,barCodeHeaderCode,null,receiptdetail); | |
297 | + locationCode,barCodeHeaderCode,null,batteryBean); | |
297 | 298 | //如果单据数量等于已收数量,更新入库详情状态和入库单状态 |
298 | 299 | if (receiptDetail.getTotalQty().compareTo(receiptDetail.getOpenQty()) == 0){ |
299 | 300 | if (StringUtils.isNotEmpty(locationCode)){ |
... | ... | @@ -314,18 +315,19 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
314 | 315 | } |
315 | 316 | return AjaxResult.success("success"); |
316 | 317 | } |
317 | - public void checkBatteryDataSaveReceipt(ReceiptDetail receiptdetail,BigDecimal qty,ReceiptDetail receiptdetail1){ | |
318 | - BigDecimal batteryQty=receiptdetail.getBatteryQty(); | |
319 | - String batteryPackType=receiptdetail.getBatteryPackType(); | |
320 | - String batteryTypes=receiptdetail.getBatteryTypes(); | |
321 | - String completeness=receiptdetail.getCompleteness(); | |
322 | - BigDecimal materialTareWeight=receiptdetail.getMaterialTareWeight(); | |
323 | - BigDecimal materialGrossWeight=receiptdetail.getMaterialGrossWeight(); | |
324 | - BigDecimal materialNetWeight=receiptdetail.getMaterialNetWeight(); | |
325 | - BigDecimal electricQuantity=receiptdetail.getElectricQuantity(); | |
326 | - String recycler=receiptdetail.getRecycler(); | |
327 | - if(StringUtils.isEmpty(batteryPackType) | |
328 | - ||StringUtils.isEmpty(batteryTypes) | |
318 | + public void checkBatteryDataSaveReceipt(BatteryBean batteryBean,BigDecimal qty,ReceiptDetail receiptdetail1){ | |
319 | + BigDecimal batteryQty=batteryBean.getBatteryQty(); | |
320 | +// String batteryPackType=batteryBean.getBatteryPackType(); | |
321 | + String batteryTypes=batteryBean.getBatteryTypes(); | |
322 | + String completeness=batteryBean.getCompleteness(); | |
323 | + BigDecimal materialTareWeight=batteryBean.getMaterialTareWeight(); | |
324 | + BigDecimal materialGrossWeight=batteryBean.getMaterialGrossWeight(); | |
325 | + BigDecimal materialNetWeight=batteryBean.getMaterialNetWeight(); | |
326 | + BigDecimal electricQuantity=batteryBean.getElectricQuantity(); | |
327 | + String recycler=batteryBean.getRecycler(); | |
328 | + if( | |
329 | +// StringUtils.isEmpty(batteryPackType)|| | |
330 | + StringUtils.isEmpty(batteryTypes) | |
329 | 331 | ||StringUtils.isEmpty(completeness) |
330 | 332 | ||StringUtils.isEmpty(recycler) |
331 | 333 | ||null==electricQuantity |
... | ... | @@ -341,7 +343,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
341 | 343 | //保存进入库表 |
342 | 344 | ReceiptDetail receiptDetailsave =receiptdetail1; |
343 | 345 | receiptDetailsave.setBatteryTypes(batteryTypes); |
344 | - receiptDetailsave.setBatteryPackType(batteryPackType); | |
346 | +// receiptDetailsave.setBatteryPackType(batteryPackType); | |
345 | 347 | receiptDetailsave.setCompleteness(completeness); |
346 | 348 | receiptDetailsave.setRecycler(recycler); |
347 | 349 | receiptDetailsave.setElectricQuantity(electricQuantity); |
... | ... | @@ -349,8 +351,8 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
349 | 351 | receiptDetailsave.setMaterialGrossWeight(materialGrossWeight); |
350 | 352 | receiptDetailsave.setMaterialNetWeight(materialNetWeight); |
351 | 353 | receiptDetailsave.setMaterialTareWeight(materialTareWeight); |
352 | - receiptDetailsave.setType(receiptdetail.getType()); | |
353 | - receiptDetailsave.setStorageType(receiptdetail.getStorageType()); | |
354 | + receiptDetailsave.setType(batteryBean.getType()); | |
355 | + receiptDetailsave.setStorageType(batteryBean.getStorageType()); | |
354 | 356 | //电池类才生成电池包二维码 |
355 | 357 | String batteryPackTwoCode=findBatteryPackTwoCode(receiptDetailsave); |
356 | 358 | receiptDetailsave.setBatteryPackTwoCode(batteryPackTwoCode); |
... | ... | @@ -836,7 +838,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
836 | 838 | @Transactional |
837 | 839 | public AjaxResult receiptContainerDetailAdd(ReceiptContainerHeader receiptContainerHeader, ReceiptDetail receiptDetail, BigDecimal qty, |
838 | 840 | BigDecimal batteryPackageWeight ,String containerCode,String locationCode, |
839 | - String barCodeHeaderCode,List<BarCodeDetail> barCodeDetails,ReceiptDetail receiptdetail){ | |
841 | + String barCodeHeaderCode,List<BarCodeDetail> barCodeDetails,BatteryBean batteryBean){ | |
840 | 842 | |
841 | 843 | int receiptContainerHeaderId = receiptContainerHeader.getId(); |
842 | 844 | LambdaQueryWrapper<ReceiptContainerDetail> lambda = Wrappers.lambdaQuery(); |
... | ... | @@ -871,13 +873,13 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
871 | 873 | String materialCode=receiptDetail1.getMaterialCode(); |
872 | 874 | BigDecimal barcodeqty=receiptDetail1.getOpenQty(); |
873 | 875 | AjaxResult result=savereceiptContainerDetail(receiptContainerDetail,receiptHeader,receiptDetail1, |
874 | - locationCode,container,receiptContainerHeader,receiptDetail1.getOpenQty(),barCodeHeaderCode,receiptdetail); | |
876 | + locationCode,container,receiptContainerHeader,receiptDetail1.getOpenQty(),barCodeHeaderCode,batteryBean); | |
875 | 877 | } |
876 | 878 | return AjaxResult.success("保存入库组盘详情成功"); |
877 | 879 | }else{ |
878 | 880 | String materialCode=receiptDetail.getMaterialCode(); |
879 | 881 | AjaxResult result=savereceiptContainerDetail(receiptContainerDetail,receiptHeader,receiptDetail, |
880 | - locationCode,container,receiptContainerHeader,qty,barCodeHeaderCode,receiptdetail); | |
882 | + locationCode,container,receiptContainerHeader,qty,barCodeHeaderCode,batteryBean); | |
881 | 883 | return result; |
882 | 884 | } |
883 | 885 | //receiptContainerDetail 不等于空的话 |
... | ... | @@ -912,7 +914,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
912 | 914 | //Integer receiptContainerHeaderId, |
913 | 915 | String locationCode,Container container, |
914 | 916 | ReceiptContainerHeader receiptContainerHeader, |
915 | - BigDecimal qty,String barCodeHeaderCode,ReceiptDetail receiptdetail){ | |
917 | + BigDecimal qty,String barCodeHeaderCode,BatteryBean batteryBean){ | |
916 | 918 | |
917 | 919 | receiptContainerDetail.setQty(qty); |
918 | 920 | receiptContainerDetail.setReceiptContainerId(receiptContainerHeader.getId()); |
... | ... | @@ -961,8 +963,8 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
961 | 963 | receiptContainerDetail.setMaterialNetWeight(receiptDetail.getMaterialNetWeight()); |
962 | 964 | receiptContainerDetail.setMaterialTareWeight(receiptDetail.getMaterialTareWeight()); |
963 | 965 | receiptContainerDetail.setRecycler(receiptDetail.getRecycler()); |
964 | - receiptContainerDetail.setCountryCode(receiptdetail.getCountryCode()); | |
965 | - receiptContainerDetail.setRemark(receiptdetail.getRemark()); | |
966 | + receiptContainerDetail.setCountryCode(batteryBean.getCountryCode()); | |
967 | + receiptContainerDetail.setRemark(batteryBean.getRemark()); | |
966 | 968 | |
967 | 969 | if (!receiptContainerDetailService.save(receiptContainerDetail)){ |
968 | 970 | return AjaxResult.error("保存入库组盘详情失败"); |
... | ... |
src/main/resources/templates/receipt/receiving/receiving.html
... | ... | @@ -115,7 +115,7 @@ |
115 | 115 | <div id="batteryHidden" hidden> |
116 | 116 | <li ><span class="selectClass">电池包类型:</span> |
117 | 117 | <select id="batteryPackType" name="batteryPackType" class="form-control" th:with="batteryPackType=${@dict.getType('batteryPackType')}" placeholder="电池类必填"> |
118 | - <option value="">电池包类型</option> | |
118 | + <option value="">--请选择--</option> | |
119 | 119 | <option th:each="dict : ${batteryPackType}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option> |
120 | 120 | </select> |
121 | 121 | <!--电池包类型:<input type="text" id="batteryPackType" placeholder="电池类必填"/></li>--> |
... | ... | @@ -123,7 +123,8 @@ |
123 | 123 | <li > |
124 | 124 | <span class="selectClass">电池类型:</span> |
125 | 125 | <select id="batteryTypes" name="batteryTypes" class="form-control" placeholder="电池类必填"> |
126 | - <option value="">电池类型</option> | |
126 | + <option value="">--请选择--</option> | |
127 | + <option value="1">电池包</option> | |
127 | 128 | <option value="2">电池模块</option> |
128 | 129 | <option value="3">电池单体</option> |
129 | 130 | </select> |
... | ... | @@ -131,14 +132,14 @@ |
131 | 132 | <li > |
132 | 133 | <span class="selectClass">完整程度:</span> |
133 | 134 | <select id="completeness" name="completeness" class="form-control" th:with="completeness=${@dict.getType('completeness')}"> |
134 | - <option value="">完整程度</option> | |
135 | + <option value="">--请选择--</option> | |
135 | 136 | <option th:each="dict : ${completeness}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option> |
136 | 137 | </select> |
137 | 138 | </li> |
138 | 139 | <li > |
139 | 140 | <span class="selectClass">利用类型:</span> |
140 | 141 | <select id="storageType" name="storageType" class="form-control" placeholder="电池类必填"> |
141 | - <option value="">利用类型</option> | |
142 | + <option value="">--请选择--</option> | |
142 | 143 | <option value="0">再生利用</option> |
143 | 144 | <option value="1">梯次利用</option> |
144 | 145 | </select> |
... | ... | @@ -146,14 +147,14 @@ |
146 | 147 | <li > |
147 | 148 | <span class="selectClass">再生利用类型:</span> |
148 | 149 | <select id="type" name="type" class="form-control" placeholder="电池类必填"> |
149 | - <option value="">再生利用类型</option> | |
150 | + <option value="">--请选择--</option> | |
150 | 151 | <option value="1">废旧动力蓄电池</option> |
151 | 152 | <option value="2">次品动力蓄电池</option> |
152 | 153 | <option value="3">其他领域废旧电池</option> |
153 | 154 | </select> |
154 | 155 | </li> |
155 | - <li>回收人:<select type="text" style="width: 80px" id="recycler" th:with="completeness=${@dict.getType('completeness')}"> | |
156 | - <option th:each="dict : ${completeness}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option> | |
156 | + <li>回收人:<select type="text" style="width: 80px" id="recycler" th:with="completeness=${@UserServiceImpl.getRecover()}"> | |
157 | + <option th:each="dict : ${completeness}" th:text="${dict.userName}" th:value="${dict.userName}"></option> | |
157 | 158 | </select></li> |
158 | 159 | <li>电量:<input type="text" id="electricQuantity" placeholder="电池类必填"/></li> |
159 | 160 | <li>皮重:<input type="text" id="materialTareWeight"/><button class="btn btn-sm btn-success" onclick="getWeight()">取重</button></li> |
... | ... | @@ -433,12 +434,6 @@ |
433 | 434 | $("#type").val(res.data.curBill.type) |
434 | 435 | $("#batteryTypes").val(res.data.curBill.batteryTypes) |
435 | 436 | $("#completeness").val(res.data.curBill.completeness) |
436 | - $("#materialNetWeight").val(res.data.curBill.materialNetWeight) | |
437 | - $("#materialTareWeight").val(res.data.curBill.materialTareWeight) | |
438 | - $("#materialGrossWeight").val(res.data.curBill.materialGrossWeight) | |
439 | - $("#electricQuantity").val(res.data.curBill.electricQuantity) | |
440 | - $("#electricQuantity").val(res.data.curBill.electricQuantity) | |
441 | - | |
442 | 437 | // $("#bootstrap-table3").bootstrapTable('load',res.data.containerList); |
443 | 438 | } |
444 | 439 | }) |
... | ... |