| | |
| | | NccSaleXsfhmxWms nccSaleXsfhmxWms = list.get(0); |
| | | BigDecimal orderStock = nccSaleXsfhmxWms.getNastnum(); |
| | | |
| | | //实际出库数量 |
| | | double realWeight = 0D; |
| | | BigDecimal diff = orderStock.subtract(BigDecimal.valueOf(isused)); |
| | | if (diff.doubleValue() >= 0) { |
| | | nccSaleXsfhmxWms.setNastnum(diff); |
| | | list.set(0, nccSaleXsfhmxWms); |
| | | matnrMap.put(wrkDetl.getMatnr(), list); |
| | | realWeight = isused; |
| | | }else { |
| | | list.remove(0); |
| | | matnrMap.put(wrkDetl.getMatnr(), list); |
| | | realWeight = orderStock.doubleValue(); |
| | | } |
| | | |
| | | //计算主数量 |
| | | Double anfme = MatUtils.calcAnfmeFromWeight(wrkDetl.getMatnr(), realWeight); |
| | | |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(wrkDetl); |
| | | orderDetl.setQty(wrkDetl.getAnfme()); |
| | | orderDetl.setQty(anfme); |
| | | orderDetl.setWeight(realWeight); |
| | | orderDetl.setOrderId(orderSou.getId()); |
| | | orderDetl.setOrderNo(orderSou.getOrderNo()); |
| | | orderDetl.setStatus(1); |