自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-07-12 00a880b7a1f31795967d79c87674ac4c42f7558f
src/main/java/com/zy/asrs/task/handler/WorkLogHandler.java
@@ -14,6 +14,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -44,13 +45,14 @@
    public ReturnT<String> start(WrkMast wrkMast) {
        try {
            List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
            // 修改订单状态 作业中 ===>> 已完成
            // 区分订单任务
            List<WrkDetl> wrkDetlsKeyOrder = new ArrayList<>();
            if (!Cools.isEmpty(wrkDetls)) {
                Iterator<WrkDetl> iterator = wrkDetls.iterator();
                while (iterator.hasNext()) {
                    WrkDetl wrkDetl = iterator.next();
                    if (!Cools.isEmpty(wrkDetl.getOrderNo())) {
                        orderService.checkComplete(wrkDetl.getOrderNo());
                        wrkDetlsKeyOrder.add(wrkDetl);
                        iterator.remove();
                    }
                }
@@ -111,6 +113,10 @@
            if (!wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()))) {
//                exceptionHandle("删除工作明细档[workNo={0}]失败", wrkMast.getWrkNo());
            }
            // 修改订单状态 作业中 ===>> 已完成
            for (WrkDetl wrkDetl : wrkDetlsKeyOrder) {
                orderService.checkComplete(wrkDetl.getOrderNo());
            }
        } catch (Exception e) {
            log.error("fail", e);
            e.printStackTrace();