自动化立体仓库 - WMS系统
#
mrzhssss
2023-02-17 bd88f87c7a26242017ec7ec1124f76a6f3dae3e0
src/main/java/com/zy/asrs/controller/OutController.java
@@ -14,9 +14,11 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.stream.Collectors;
/**
 * Created by vincent on 2022/3/26
@@ -40,6 +42,14 @@
    @Autowired
    private BasDevpService basDevpService;
    @PostMapping("/out/pakout/orderDetlIds/auth")
    @ManagerAuth
    public R pakoutOrderDetlIds(@RequestParam Long orderId) throws InterruptedException {
        Thread.sleep(200);
        return R.ok().add(orderDetlService.selectByOrderId(orderId).stream().map(OrderDetl::getId).distinct().collect(Collectors.toList()));
    }
    @PostMapping("/out/pakout/preview/auth")
    @ManagerAuth
    public R pakoutPreview(@RequestBody List<Long> ids) {
@@ -54,13 +64,16 @@
        for (OrderDetl orderDetl : orderDetls) {
            double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getQty()).orElse(0.0D);
            if (issued <= 0.0D) { continue; }
            List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), null);
            List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), null, exist);
            for (LocDetl locDetl : locDetls) {
//                if (exist.contains(locDetl.getLocNo())) { continue; }
                if (issued > 0) {
                    LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(),
                            issued >= locDetl.getAnfme() ? locDetl.getAnfme() : issued);
                    List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 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全板出库
//                    List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), 101);
                    locDto.setStaNos(staNos);
                    locDtos.add(locDto);
                    exist.add(locDetl.getLocNo());
@@ -72,6 +85,7 @@
            }
            if (issued > 0) {
                LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued);
//                LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), 0.0,issued);
                locDto.setLack(Boolean.TRUE);
                locDtos.add(locDto);
            }