Commit b890852ff67de4eb0eebcea570f3887c8c47e1a0
1 parent
4cb3546d
修改成品入库数量为0bug
Showing
6 changed files
with
16 additions
and
24 deletions
src/main/java/com/huaheng/api/erp/service/TaskReturnServiceImpl.java
... | ... | @@ -228,7 +228,7 @@ public class TaskReturnServiceImpl implements TaskReturnService { |
228 | 228 | for (int i = 0; i < barCodeDetailList.size(); i++) { |
229 | 229 | Fentity fentity = new Fentity(); |
230 | 230 | fentity.setFmaterial(barCodeDetailList.get(i).getMaterialCode()); |
231 | - fentity.setFqty1(barCodeDetailList.get(i).getQty()); | |
231 | + fentity.setFqty1(barCodeDetailList.get(i).getTotalQty()); | |
232 | 232 | fentity.setFstock("CK002"); |
233 | 233 | fentities.add(fentity); |
234 | 234 | } |
... | ... |
src/main/java/com/huaheng/api/general/service/BarCodeApiService.java
... | ... | @@ -88,7 +88,6 @@ public class BarCodeApiService { |
88 | 88 | if(qty == null){ |
89 | 89 | return AjaxResult.error("数量不存在 qty"); |
90 | 90 | } |
91 | - | |
92 | 91 | String sn = barCodeDetail.getSn(); |
93 | 92 | } |
94 | 93 | return AjaxResult.success(); |
... | ... | @@ -100,11 +99,7 @@ public class BarCodeApiService { |
100 | 99 | public AjaxResult addBarCodeApi(BarCodeDomain barCodeDomain){ |
101 | 100 | boolean result = false; |
102 | 101 | BarCodeHeader header = barCodeDomain.getBarCodeHeader(); |
103 | - //原料批次 | |
104 | 102 | String materialBatch = header.getMaterialBatch(); |
105 | -// if(materialBatch ==null){ | |
106 | -// return AjaxResult.error("包装信息头错误:原料批次不存在"); | |
107 | -// } | |
108 | 103 | String barCodeHeaderCode = header.getCode(); |
109 | 104 | String fbillno = header.getFbillno(); |
110 | 105 | if(barCodeHeaderCode == null || "".equals(barCodeHeaderCode)){ |
... | ... | @@ -151,7 +146,6 @@ public class BarCodeApiService { |
151 | 146 | barCodeDetail.setCompanyCode(QuantityConstant.DEFAULT_COMPANYCODE); |
152 | 147 | barCodeDetail.setReceiptId(barCodeHeader.getId()); |
153 | 148 | barCodeDetail.setCode(detail.getCode()); |
154 | -// barCodeDetail.setPower(detail.getPower()); | |
155 | 149 | barCodeDetail.setReceiptCode(barCodeHeader.getCode()); |
156 | 150 | String materialCode = detail.getMaterialCode(); |
157 | 151 | String materialUnit = detail.getMaterialUnit(); |
... | ... | @@ -159,14 +153,13 @@ public class BarCodeApiService { |
159 | 153 | BigDecimal weight = detail.getWeight(); |
160 | 154 | BarCodeHeader oneBarCodeHeader = barCodeHeaderService.getOne(new LambdaQueryWrapper<BarCodeHeader>().eq(BarCodeHeader::getId, barCodeHeader.getId())); |
161 | 155 | if(weight.compareTo(BigDecimal.ZERO) == 0){ |
162 | - System.out.println("重量为0,就是装配"); | |
163 | - oneBarCodeHeader.setProType("1"); | |
156 | + oneBarCodeHeader.setProType("1");//重量为0,就是装配 | |
164 | 157 | }else { |
165 | - oneBarCodeHeader.setProType("2"); | |
158 | + oneBarCodeHeader.setProType("2");//有重量就是拆解 | |
166 | 159 | } |
167 | 160 | barCodeHeaderService.updateById(oneBarCodeHeader); |
168 | - if(qty.compareTo(BigDecimal.ZERO) == 0){ | |
169 | - System.out.println("数量为0,就是零件,只有重量,把重量放到qty中"); | |
161 | + | |
162 | + if (detail.getCode()==null&&"".equals(detail.getCode())) { //没有字条码,属于拆解中的散装,只有重量没有数量,重量赋值给数量 | |
170 | 163 | qty=weight; |
171 | 164 | } |
172 | 165 | totalQty.add(qty); |
... | ... | @@ -180,10 +173,9 @@ public class BarCodeApiService { |
180 | 173 | barCodeDetail.setMaterialName(material.getName()); |
181 | 174 | barCodeDetail.setMaterialSpec(material.getSpec()); |
182 | 175 | barCodeDetail.setMaterialUnit(material.getUnit()); |
183 | - barCodeDetail.setQty(qty); | |
176 | + barCodeDetail.setTotalQty(qty); | |
184 | 177 | barCodeDetail.setSn(detail.getSn()); |
185 | 178 | barCodeDetail.setWeight(weight); |
186 | - | |
187 | 179 | barCodeDetail.setConstitute(detail.getConstitute()); |
188 | 180 | barCodeDetail.setProductType(detail.getProductType()); |
189 | 181 | barCodeDetail.setBatteryModel(detail.getBatteryModel()); |
... | ... |
src/main/java/com/huaheng/pc/barcode/barcodeDetail/domain/BarCodeDetail.java
... | ... | @@ -101,6 +101,12 @@ public class BarCodeDetail implements Serializable { |
101 | 101 | @ApiModelProperty(value = "批次") |
102 | 102 | private String batch; |
103 | 103 | /** |
104 | + * 数量 | |
105 | + */ | |
106 | + @TableField(value = "qty") | |
107 | + @ApiModelProperty(value = "数量") | |
108 | + private BigDecimal qty; | |
109 | + /** | |
104 | 110 | * 总数量 |
105 | 111 | */ |
106 | 112 | @TableField(value = "totalQty") |
... | ... | @@ -219,12 +225,6 @@ public class BarCodeDetail implements Serializable { |
219 | 225 | @ApiModelProperty(value = "序列号") |
220 | 226 | private String sn; |
221 | 227 | |
222 | - /** | |
223 | - * 数量 | |
224 | - */ | |
225 | - @TableField(value = "qty") | |
226 | - @ApiModelProperty(value = "数量") | |
227 | - private BigDecimal qty; | |
228 | 228 | |
229 | 229 | /** |
230 | 230 | * 总重量 |
... | ... |
src/main/java/com/huaheng/pc/monitor/job/task/RyTask.java
... | ... | @@ -199,7 +199,7 @@ public class RyTask extends BaseController { |
199 | 199 | for (int i = 0; i < barCodeDetailList.size(); i++) { |
200 | 200 | Fentity fentity = new Fentity(); |
201 | 201 | fentity.setFmaterial(barCodeDetailList.get(i).getMaterialCode()); |
202 | - fentity.setFqty1(barCodeDetailList.get(i).getQty()); | |
202 | + fentity.setFqty1(barCodeDetailList.get(i).getTotalQty()); | |
203 | 203 | fentity.setFstock("CK002"); |
204 | 204 | fentities.add(fentity); |
205 | 205 | } |
... | ... | @@ -298,7 +298,7 @@ public class RyTask extends BaseController { |
298 | 298 | for (int i = 0; i < barCodeDetailList.size(); i++) { |
299 | 299 | Fentity fentity = new Fentity(); |
300 | 300 | fentity.setFmaterial(barCodeDetailList.get(i).getMaterialCode()); |
301 | - fentity.setFqty1(barCodeDetailList.get(i).getQty()); | |
301 | + fentity.setFqty1(barCodeDetailList.get(i).getTotalQty()); | |
302 | 302 | fentity.setFstock("CK002"); |
303 | 303 | fentities.add(fentity); |
304 | 304 | } |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -798,7 +798,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
798 | 798 | receiptContainerDetail.setMaterialSpec(receiptDetail.getMaterialSpec()); |
799 | 799 | receiptContainerDetail.setMaterialUnit(barCodeDetail.getMaterialUnit()); |
800 | 800 | receiptContainerDetail.setWeights(receiptDetail.getOpenWeight()); |
801 | - receiptContainerDetail.setQty(barCodeDetail.getQty()); | |
801 | + receiptContainerDetail.setQty(barCodeDetail.getTotalQty()); | |
802 | 802 | receiptContainerDetail.setSn(barCodeDetail.getSn()); |
803 | 803 | receiptContainerDetail.setSupplierCode(receiptDetail.getSupplierCode()); |
804 | 804 | receiptContainerDetail.setBatch(barCodeDetail.getBatch()); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java
... | ... | @@ -874,7 +874,7 @@ public class ReceiptTaskService { |
874 | 874 | for (BarCodeDetail barCodeDetail : barCodeDetailList) { |
875 | 875 | taskDetail.setTaskId(taskHeader.getId()); |
876 | 876 | taskDetail.setTaskType(QuantityConstant.TASK_TYPE_WHOLERECEIPT); |
877 | - taskDetail.setQty(barCodeDetail.getQty()); | |
877 | + taskDetail.setQty(barCodeDetail.getTotalQty()); | |
878 | 878 | taskDetail.setBillCode(barCodeDetail.getCode()); |
879 | 879 | taskDetail.setWarehouseCode("CS0001"); |
880 | 880 | taskDetail.setCompanyCode("BHF"); |
... | ... |