自动化立体仓库 - WMS系统
#
zjj
2023-12-26 79f209a5ec9236adfd4576285d50a7b860da7230
src/main/java/com/zy/common/web/WcsController.java
@@ -8,6 +8,7 @@
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.EmptyPlateOutParam;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.Utils;
import com.zy.common.CodeRes;
import com.zy.common.model.LocTypeDto;
import com.zy.common.model.StartupDto;
@@ -143,17 +144,42 @@
    @PostMapping("auto/emptyOut/v1")
    @ResponseBody
    public R autoEmptyOut(){
        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                .eq("loc_sts", "D"));
        if (Cools.isEmpty(locMast)) {
    public R autoEmptyOut(@RequestParam("crnNo") Integer crnNo) {
        List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
                .eq("loc_sts", "D")
                .eq("crn_no", crnNo)
                .orderBy("lev1,bay1,row1"));
        if (locMasts.isEmpty()) {
            return R.error("库存没有空板");
        }
        EmptyPlateOutParam emptyPlateOutParam = new EmptyPlateOutParam();
        emptyPlateOutParam.setOutSite(12);
        emptyPlateOutParam.setLocNos(new ArrayList<String>(){{add(locMast.getLocNo()+"");}});
        WrkMast wrkMast = workService.emptyPlateOut(emptyPlateOutParam);
        return R.ok(!Cools.isEmpty(wrkMast)? R.ok("自动空托出库成功,工作号:" + wrkMast.getWrkNo()) : R.error("生成自动空托出库失败"));
        for (LocMast locMast : locMasts) {
            LocMast locMast0 = null;
            List<String> outerLocNo = Utils.getGroupLocNo(locMast.getLocNo(), false);
            for (String loc : outerLocNo) {
                LocMast locMast1 = locMastService.selectByLoc(loc);
                if (locMast1 == null) {
                    continue;
                }
                if (locMast1.getLocSts().equals("D")) {
                    locMast0 = locMast1;
                    break;
                }
            }
            if (locMast0 == null) {
                continue;
            }
            EmptyPlateOutParam emptyPlateOutParam = new EmptyPlateOutParam();
            ArrayList<String> locNos = new ArrayList<>();
            locNos.add(locMast0.getLocNo());
            emptyPlateOutParam.setLocNos(locNos);
            WrkMast wrkMast = workService.emptyPlateOut(emptyPlateOutParam);
            return R.ok(!Cools.isEmpty(wrkMast) ? R.ok("自动空托出库成功,工作号:" + wrkMast.getWrkNo()) : R.error("生成自动空托出库失败"));
        }
        return R.error("生成自动空托出库失败");
    }
    /**
@@ -166,12 +192,12 @@
        // 检索库位
        List<String> matNos = waitPakins.stream().map(WaitPakin::getMatnr).distinct().collect(Collectors.toList());
        int rowCount = rowLastnoService.selectCount(null);
        Integer integer = 1;
        Integer integer = 2;
        for (int i = 1; i <= rowCount; i++) {
            integer = rowLastnoService.selectNextWhsType();
            BasCrnp crn_no = basCrnpService.selectOne(new EntityWrapper<BasCrnp>()
                    .eq("crn_no", i));
            if (crn_no.getInEnable().equals("Y") && crn_no.getCrnSts().equals("3")){
                    .eq("crn_no", integer));
            if (crn_no.getInEnable().equals("Y") && crn_no.getCrnSts() == 3){
                break;
            }
        }
@@ -206,12 +232,17 @@
        }
        // 生成工作档明细
        waitPakins.forEach(waitPakin -> {
            String uuid = String.valueOf(System.currentTimeMillis());
            WrkDetl wrkDetl = new WrkDetl();
            wrkDetl.sync(waitPakin);
            wrkDetl.setWrkNo(wrkMast.getWrkNo());
            wrkDetl.setIoTime(wrkMast.getIoTime());
            wrkDetl.setAppeTime(now);
            wrkDetl.setModiTime(now);
            wrkDetl.setUuid(uuid);
            wrkDetl.setWeight(waitPakin.getWeight());
            wrkDetl.setOwner(waitPakin.getOwner());
            wrkDetl.setPayment(waitPakin.getPayment());
            if (!wrkDetlService.insert(wrkDetl)) {
                throw new CoolException("保存工作明细失败");
            }
@@ -251,12 +282,13 @@
        // 源站点状态检测
        BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true);
        int rowCount = rowLastnoService.selectCount(null);
        Integer integer = 1;
        Integer integer = 2;
        for (int i = 1; i <= rowCount; i++) {
            integer = rowLastnoService.selectNextWhsType();
            BasCrnp crn_no = basCrnpService.selectOne(new EntityWrapper<BasCrnp>()
                    .eq("crn_no", integer));
            if (crn_no.getInEnable().equals("Y") && crn_no.getCrnSts().equals("3")){
            if (crn_no.getInEnable().equals("Y")
                    && crn_no.getCrnSts() == 3){
                break;
            }
        }