| | |
| | | return mergePreviewDtos;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 波次出库预览
|
| | | * @param param
|
| | | * @return
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public List<MergePreviewResultDto> orderOutMergeLocPreview(List<MergePreviewDto> param) {
|
| | | if (param == null) {
|
| | |
| | | //查询平库中符合条件的库存
|
| | | List<LocDetl> locs = locDetlService.queryFlatStock(pars.getMatnr(), pars.getBatch(), pars.getFieldParams());
|
| | | if (!locs.isEmpty()) {
|
| | | double anfme = pars.getAnfme() - pars.getWorkQty();
|
| | | Double anfme = pars.getAnfme() - pars.getWorkQty();
|
| | | for (LocDetl detl : locs) {
|
| | | Loc loc = locService.getById(detl.getLocId());
|
| | | if (loc == null) {
|
| | |
| | | continue;
|
| | | }
|
| | | //波次数量减去库位可用数量后,盈余数量
|
| | | anfme = anfme - surplusQty;
|
| | | if (anfme > 0) {
|
| | | anfme = Math.round((anfme - surplusQty) * 10000) / 10000.0;
|
| | | if (anfme.compareTo(0.0) > 0) {
|
| | | //当前可使用数量
|
| | | resultDto.setFetchQty(surplusQty);
|
| | | //余下需求数量
|