| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | Set<String> exist = new HashSet<>(); |
| | | |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getQty()).orElse(0.0D); |
| | | BigDecimal a1 = new BigDecimal(orderDetl.getAnfme()); |
| | | BigDecimal b1 = new BigDecimal(orderDetl.getQty()); |
| | | Double c1 = a1.subtract(b1).doubleValue(); |
| | | double issued = Optional.of( c1 ).orElse(0.0D); |
| | | if (issued <= 0.0D) { continue; } |
| | | List<LocDetl> locDetls = locDetlService.queryStock2(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOwner()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | boolean sign = false; |
| | | if (issued > locDetl.getAnfme() || locDetl.getAnfme().equals(issued)){ |
| | | sign=true; |
| | | } |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | | issued >= locDetl.getAnfme() ? locDetl.getAnfme() : issued,locDetl.getOwner(),locDetl.getPayment()); |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103); |
| | | sign ? locDetl.getAnfme() : issued,locDetl.getOwner(),locDetl.getPayment()); |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), sign? 101 : 103); |
| | | // LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | | // locDetl.getAnfme(), issued < locDetl.getAnfme()? issued : locDetl.getAnfme()); |
| | | // //速腾只有全板,所以只能101全板出库 |
| | |
| | | locDto.setManu(locDetl.getManu()); |
| | | locDtos.add(locDto); |
| | | exist.add(locDetl.getLocNo()); |
| | | BigDecimal iss=new BigDecimal(Double.toString(issued)); |
| | | BigDecimal an=new BigDecimal(Double.toString(locDetl.getAnfme())); |
| | | // 剩余待出数量递减 |
| | | issued = issued - locDetl.getAnfme(); |
| | | issued=iss.subtract(an).doubleValue(); |
| | | } else { |
| | | break; |
| | | } |