| | |
| | | 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; |
| | | |
| | |
| | | } |
| | | List<OrderDetl> orderDetls = orderDetlService.selectBatchIds(ids); |
| | | List<LocDto> locDtos = new ArrayList<>(); |
| | | for (OrderDetl o: orderDetls) { |
| | | if (o.getAnfme().equals(o.getWorkQty())){ |
| | | return R.error("出库的明细中有已出库物料"); |
| | | } |
| | | } |
| | | |
| | | Set<String> exist = new HashSet<>(); |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | manPakOut.setMatnr(locDto.getMatnr()); |
| | | manPakOut.setMaktx(locDto.getMaktx()); |
| | | manPakOut.setDocNum(locDto.getOrderNo()); |
| | | manPakOut.setCount(0); |
| | | manPakOut.setCount(0.0); |
| | | manPakOut.setStatus(0); |
| | | manPakOut.setCreateTime(new Date()); |
| | | manPakOut.setBatch(locDto.getBatch()); |