自动化立体仓库 - WMS系统
13
zhang
3 天以前 82de5a307466894bbb0258f8a63a26a7bb96d80d
src/main/java/com/zy/asrs/controller/OutController.java
@@ -17,8 +17,6 @@
import com.zy.common.model.ExistDto;
import com.zy.common.model.LocDto;
import com.zy.common.model.TaskDto;
import com.zy.common.utils.OutStockInterceptUtil;
import com.zy.common.utils.RoleUtils;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@@ -78,7 +76,9 @@
        return R.ok().add(result);
    }
    /** 处理订单出库货位分配
    /**
     * 处理订单出库货位分配
     *
     * @param jsonObject 请求参数(包含订单明细ID列表和出库数量)
     */
    @PostMapping("/out/pakout/OrderOutGetLoc.number/auth")
@@ -109,6 +109,7 @@
    /**
     * 处理单个订单明细的货位分配
     *
     * @param orderDetl 订单明细
     * @param requiredAmount 需求出库量
     * @param processedLocs 已处理的货位集合(用于去重)
@@ -165,7 +166,9 @@
        return result;
    }
    /** 创建缺量DTO */
    /**
     * 创建缺量DTO
     */
    private LocDto createShortageDto(OrderDetl orderDetl, double qty) {
        LocDto dto = new LocDto(null, orderDetl.getMatnr(),
                              orderDetl.getMaktx(), orderDetl.getBatch(),
@@ -174,7 +177,9 @@
        return dto;
    }
    /** 处理普通货位 */
    /**
     * 处理普通货位
     */
    private void processNormalLocation(LocDetl stock, OrderDetl orderDetl, double remaining,
                                      Set<ExistDto> processedStock, List<LocDto> result) {
        ExistDto exist = new ExistDto()
@@ -188,7 +193,9 @@
        }
    }
    /** 处理7号堆垛机货位 */
    /**
     * 处理7号堆垛机货位
     */
    private void processCrn7Location(LocMast baseLoc, LocDetl stock, OrderDetl orderDetl,
                                    double remaining, Set<ExistDto> processedStock,
                                    List<LocDto> result) {
@@ -205,7 +212,9 @@
            .forEach(loc -> processCrn7SubLocation(loc, stock, orderDetl, remaining, processedStock, result));
    }
    /** 处理7号堆垛机子货位 */
    /**
     * 处理7号堆垛机子货位
     */
    private void processCrn7SubLocation(LocMast loc, LocDetl stock, OrderDetl orderDetl,
                                       double remaining, Set<ExistDto> processedStock,
                                       List<LocDto> result) {
@@ -228,7 +237,9 @@
        }
    }
    /** 构建货位DTO通用方法 */
    /**
     * 构建货位DTO通用方法
     */
    private LocDto buildLocDto(LocDetl stock, OrderDetl orderDetl, double qty) {
        LocDto dto = new LocDto(
            stock.getLocNo(), stock.getMatnr(), stock.getMaktx(),
@@ -340,7 +351,9 @@
//    }
    /** 四向库订单出库 **/
    /**
     * 四向库订单出库
     **/
    @PostMapping("/out/pakout/previewCustomQuantity/auth/sxk")
    @ManagerAuth
    public R pakoutPreviewCustomQuantitySXK(@RequestBody JSONObject jsonObject) {
@@ -363,7 +376,9 @@
                }
                issued = amount;
            }
            if (issued <= 0.0D) { continue; }
            if (issued <= 0.0D) {
                continue;
            }
            List<LocDetl> locDetls = new ArrayList<>();
            locDetls = locDetlService.queryStockFour(orderDetl.getMatnr(), orderDetl.getBatch(), null, exist,orderDetl.getSupp(),orderDetl.getTemp1(),orderDetl.getTemp2());
            for (LocDetl locDetl : locDetls) {
@@ -424,7 +439,9 @@
        for (OrderDetl orderDetl : orderDetls) {
            double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D);
            if (issued <= 0.0D) { continue; }
            if (issued <= 0.0D) {
                continue;
            }
            List<LocDetl> locDetls = new ArrayList<>();
            locDetls = locDetlService.queryStockFour(orderDetl.getMatnr(), orderDetl.getBatch(), null, exist,orderDetl.getSupp(),orderDetl.getTemp1(),orderDetl.getTemp2());
            for (LocDetl locDetl : locDetls) {
@@ -471,7 +488,9 @@
        return R.ok().add(locDtos);
    }
    /** ctu订单出库 **/
    /**
     * ctu订单出库
     **/
    @PostMapping("/out/pakout/previewCustomQuantity/auth/ctu")
    @ManagerAuth
    public R pakoutPreviewCustomQuantityCTU(@RequestBody JSONObject jsonObject) {
@@ -494,7 +513,9 @@
                }
                issued = amount;
            }
            if (issued <= 0.0D) { continue; }
            if (issued <= 0.0D) {
                continue;
            }
            List<LocDetl> locDetls = new ArrayList<>();
            locDetls = locDetlService.queryStockMinAnfme(orderDetl.getMatnr(), orderDetl.getBatch(), null, exist,orderDetl.getSupp(),orderDetl.getTemp1(),orderDetl.getTemp2());
            for (LocDetl locDetl : locDetls) {
@@ -546,7 +567,9 @@
        for (OrderDetl orderDetl : orderDetls) {
            double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D);
            if (issued <= 0.0D) { continue; }
            if (issued <= 0.0D) {
                continue;
            }
            List<LocDetl> locDetls = new ArrayList<>();
            locDetls = locDetlService.queryStockMinAnfme(orderDetl.getMatnr(), orderDetl.getBatch(), null, exist,orderDetl.getSupp(),orderDetl.getTemp1(),orderDetl.getTemp2());
            for (LocDetl locDetl : locDetls) {
@@ -584,7 +607,9 @@
        return R.ok().add(locDtos);
    }
    /** crn订单出库 **/
    /**
     * crn订单出库
     **/
    @PostMapping("/out/pakout/previewCustomQuantity/auth/crn")
    @ManagerAuth
    public R pakoutPreviewCustomQuantityCRN(@RequestBody JSONObject jsonObject) {
@@ -607,7 +632,9 @@
                }
                issued = amount;
            }
            if (issued <= 0.0D) { continue; }
            if (issued <= 0.0D) {
                continue;
            }
            List<LocDetl> locDetls = new ArrayList<>();
            locDetls = locDetlService.queryStockCrn(orderDetl.getMatnr(), orderDetl.getBatch(), null, exist,orderDetl.getSupp(),orderDetl.getTemp1(),orderDetl.getTemp2());
            for (LocDetl locDetl : locDetls) {
@@ -659,7 +686,9 @@
        for (OrderDetl orderDetl : orderDetls) {
            double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D);
            if (issued <= 0.0D) { continue; }
            if (issued <= 0.0D) {
                continue;
            }
            List<LocDetl> locDetls = new ArrayList<>();
            locDetls = locDetlService.queryStockCrn(orderDetl.getMatnr(), orderDetl.getBatch(), null, exist,orderDetl.getSupp(),orderDetl.getTemp1(),orderDetl.getTemp2());
            for (LocDetl locDetl : locDetls) {
@@ -698,10 +727,6 @@
    }
    @PostMapping("/out/pakout/auth")
    @ManagerAuth(memo = "订单出库")
    public synchronized R pakout(@RequestBody List<LocDto> locDtos) throws InterruptedException {
@@ -726,7 +751,9 @@
        List<TaskDto> taskDtos = new ArrayList<>();
        // 根据 (库位 & 出库站) 分组; 理想状态:一组为一次出库任务
        for (LocDto locDto : locDtos) {
            if (locDto.isLack()) { continue; }
            if (locDto.isLack()) {
                continue;
            }
            TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getStaNo(), locDto);
            if (TaskDto.has(taskDtos, taskDto)) {
                TaskDto dto = TaskDto.find(taskDtos, taskDto);
@@ -768,7 +795,9 @@
        List<TaskDto> taskDtos = new ArrayList<>();
        // 根据 (库位 & 出库站) 分组; 理想状态:一组为一次出库任务
        for (LocDto locDto : locDtos) {
            if (locDto.isLack()) { continue; }
            if (locDto.isLack()) {
                continue;
            }
            TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getStaNo(), locDto);
            if (TaskDto.has(taskDtos, taskDto)) {
                TaskDto dto = TaskDto.find(taskDtos, taskDto);