Commit 0b4420025187ddf3a8f7e7cde5fa1fe7f39612bb
1 parent
f1077cb7
入库单删除 调整
Showing
2 changed files
with
13 additions
and
5 deletions
src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java
... | ... | @@ -35,6 +35,7 @@ import org.springframework.ui.ModelMap; |
35 | 35 | import org.springframework.web.bind.annotation.*; |
36 | 36 | |
37 | 37 | import javax.annotation.Resource; |
38 | +import java.math.BigDecimal; | |
38 | 39 | import java.util.ArrayList; |
39 | 40 | import java.util.Arrays; |
40 | 41 | import java.util.List; |
... | ... | @@ -285,12 +286,19 @@ public class ReceiptHeaderController extends BaseController { |
285 | 286 | if (receiptHeader == null) { |
286 | 287 | return AjaxResult.error("没有找到单据" + String.valueOf(id)); |
287 | 288 | } |
288 | - if(receiptHeader.getFirstStatus() >= QuantityConstant.RECEIPT_HEADER_POOL) { | |
289 | +/* if(receiptHeader.getFirstStatus() >= QuantityConstant.RECEIPT_HEADER_POOL) { | |
289 | 290 | return AjaxResult.error("订单状态大于100不能删除"); |
290 | - } | |
291 | + }*/ | |
291 | 292 | LambdaQueryWrapper<ReceiptDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
292 | 293 | lambdaQueryWrapper.eq(ReceiptDetail::getReceiptId, id); |
293 | 294 | List<ReceiptDetail> list = receiptDetailService.list(lambdaQueryWrapper); |
295 | + BigDecimal finishQty = BigDecimal.ZERO; | |
296 | + for (ReceiptDetail receiptDetail : list) { | |
297 | + finishQty = finishQty.add(receiptDetail.getTaskQty()); | |
298 | + } | |
299 | + if(finishQty.compareTo(BigDecimal.ZERO) >0){ | |
300 | + return AjaxResult.error("入库的那删除:已收数量不为零不能删除入库单"); | |
301 | + } | |
294 | 302 | List<ReceiptDetailHistory> receiptDetailHistoryList = new ArrayList<>(); |
295 | 303 | if (!receiptHeaderService.removeById(receiptHeader)) { |
296 | 304 | throw new ServiceException("删除头表失败"); |
... | ... |
src/main/resources/templates/receipt/receiptHeader/receiptHeader.html
... | ... | @@ -261,11 +261,11 @@ |
261 | 261 | actions.push('<a class="btn btn-primary btn-xs to-receive" ' +addFlag+ ' onclick="Toreceiving(\''+ row.code + '\')"><i class="fa fa-cart-plus"></i>收货</a> '); |
262 | 262 | if (row.firstStatus < 100) { |
263 | 263 | actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
264 | - actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); | |
265 | 264 | } |
266 | 265 | if (row.firstStatus == 800 && row.lastStatus == 800) { |
267 | 266 | actions.push('<a class="btn btn-info btn-xs ' + receiveFlag + '" href="#" onclick="backERP(\''+row.id+'\')"><i class="fa fa-upload"></i>回传</a>'); |
268 | 267 | } |
268 | + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); | |
269 | 269 | return actions.join(''); |
270 | 270 | } |
271 | 271 | }, |
... | ... | @@ -401,7 +401,7 @@ |
401 | 401 | { |
402 | 402 | field : 'lastUpdated', |
403 | 403 | title : '最后修改时间', |
404 | - visible:true, | |
404 | + visible:false, | |
405 | 405 | }, |
406 | 406 | { |
407 | 407 | field : 'lastUpdatedBy', |
... | ... | @@ -595,7 +595,7 @@ |
595 | 595 | { |
596 | 596 | field : 'lastUpdated', |
597 | 597 | title : '最后修改时间', |
598 | - visible:true | |
598 | + visible:false | |
599 | 599 | }, |
600 | 600 | { |
601 | 601 | field : 'productionWorkerName', |
... | ... |