自动化立体仓库 - WMS系统
#
lsh
2024-01-12 ee3a4804211a44fe9796caff493635ba15f1b764
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -61,6 +61,14 @@
    private WaitPakinService waitPakinService;
    @Autowired
    private CommonService commonService;
    @Autowired
    private LocDetlRullUpDetailService locDetlRullUpDetailService;
    @Autowired
    private WrkDetlSingleService wrkDetlSingleService;
    @Autowired
    private WrkMastStaService wrkMastStaService;
    @Autowired
    private WrkMastStaLogService wrkMastStaLogService;
    @Override
    @Transactional
@@ -741,6 +749,7 @@
        Date now = new Date();
        for (PalletizingCompleteParam.MatList matList:param.getMatLists()){
            long rollUp = new Date().getTime();
            Mat mat = matService.selectByMatnr(matList.getMatnr());
            if (Cools.isEmpty(mat)) {
                throw new CoolException(matList.getMatnr() + "商品档案不存在");
@@ -760,6 +769,16 @@
            waitPakin.setAppeTime(now);
            waitPakin.setModiUser(userId);
            waitPakin.setModiTime(now);
            waitPakin.setRollUp(rollUp);
            if (!Cools.isEmpty(matList.getMatDetlList())){
                for (PalletizingCompleteParam.MatDetlList matDetlList:matList.getMatDetlList()){
                    LocDetlRullUpDetail locDetlRullUpDetail = new LocDetlRullUpDetail();
                    locDetlRullUpDetail.setUuid(rollUp);
                    locDetlRullUpDetail.setRollNo(matDetlList.getBoxNoDetl());
                    locDetlRullUpDetail.setRollWeight(matDetlList.getWeightDetl().toString());
                    locDetlRullUpDetailService.insert(locDetlRullUpDetail);
                }
            }
            if (!waitPakinService.insert(waitPakin)) {
                throw new CoolException("保存入库通知档失败");
            }
@@ -793,20 +812,14 @@
    public void singleUnstackingComplete(SingleUnstackingCompleteParam param) {
        Long userId = 8888L;//桁架上位软件
        //判断param参数
        if (Cools.isEmpty(param.getBarcode())){
            throw new CoolException("参数:托盘码 barcode为空");
        }else if (Cools.isEmpty(param.getPalletizingNo())){
        if (Cools.isEmpty(param.getPalletizingNo())){
            throw new CoolException("参数:码垛位编号 palletizingNo为空");
        }else if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0){
            throw new CoolException("参数:物料明细 matLists为空");
        }
        WrkMast wrkMastMatrix = wrkMastService.selectByBarcode(param.getBarcode());
        if (Cools.isEmpty(wrkMastMatrix)){
            throw new CoolException("参数:托盘码查询工作档失败:"+param.getBarcode());
        }
        List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo());
        ArrayList<WrkDetl> wrkDetlsNew = new ArrayList<>();
        ArrayList<WrkDetlSingle> wrkDetlsOld = new ArrayList<>();
        //判断matLists参数
        for (SingleUnstackingCompleteParam.MatList matList:param.getMatLists()){
            if (Cools.isEmpty(matList.getPosition())){
@@ -814,12 +827,14 @@
            }else if (Cools.isEmpty(matList.getBoxNo())){
                throw new CoolException("参数:木箱编号 boxNo为空");
            }
            List<WrkDetlSingle> wrkDetlSingles = wrkDetlSingleService.selectList(new EntityWrapper<WrkDetlSingle>().eq("batch", matList.getBoxNo()));
            boolean sign=true;
            for (WrkDetl wrkDetl:wrkDetls){
                if (wrkDetl.getBatch().equals(matList.getBoxNo())){//木箱编码
                    wrkDetl.setInspect(1);
                    wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch()));
            for (WrkDetlSingle wrkDetlSingle:wrkDetlSingles){
                if (wrkDetlSingle.getBatch().equals(matList.getBoxNo())){//木箱编码
                    WrkDetl wrkDetl = new WrkDetl();
                    wrkDetl.sync(wrkDetlSingle);
                    wrkDetlsNew.add(wrkDetl);
                    wrkDetlsOld.add(wrkDetlSingle);
                    sign=false;
                    break;
                }
@@ -861,6 +876,13 @@
            }
        }
        for (WrkDetlSingle wrkDetlSingle : wrkDetlsOld) {
            wrkDetlSingleService.delete(new EntityWrapper<WrkDetlSingle>()
                    .eq("batch",wrkDetlSingle.getBatch())
                    .eq("wrk_no",wrkDetlSingle.getWrkNo())
                    .eq("io_time",wrkDetlSingle.getIoTime()));
        }
    }
    /*
@@ -873,49 +895,50 @@
        //判断param参数
        if (Cools.isEmpty(param.getBarcode())){
            throw new CoolException("参数:托盘码 barcode为空");
        }else if (Cools.isEmpty(param.getPalletizingNo())){
            throw new CoolException("参数:码垛位编号 palletizingNo为空");
        }
//        else if (Cools.isEmpty(param.getPalletizingNo())){
//            throw new CoolException("参数:码垛位编号 palletizingNo为空");
//        }
        WrkMast wrkMastMatrix = wrkMastService.selectByBarcode(param.getBarcode());
        if (Cools.isEmpty(wrkMastMatrix)){
            throw new CoolException("参数:托盘码查询工作档失败:"+param.getBarcode());
        }else {
            if (!wrkMastMatrix.getIoType().equals(101)){
                List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo());
                if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0 || param.getMatLists().size()!=wrkDetls.size()){
                    throw new CoolException("返回物料明细数为"+param.getMatLists().size()+",托盘码:"+param.getBarcode()+"应剩余物料数:"+wrkDetls.size());
                }
                ArrayList<String> orgin = new ArrayList<>();
                //判断matLists参数
                for (SingleMountUnstackingCompleteParam.MatList matList : param.getMatLists()){
                    if (Cools.isEmpty(matList.getPosition())){
                        throw new CoolException("参数:码垛位置 position为空");
                    }else if (Cools.isEmpty(matList.getBoxNo())){
                        throw new CoolException("参数:木箱编号 boxNo为空");
                    }
                    if (!orgin.contains(matList.getPosition())){
                        orgin.add(matList.getPosition());
                    }else {
                        throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+",木箱位置存在重复");
                    }
                    boolean sign=true;
                    for (WrkDetl wrkDetl:wrkDetls){
                        if (wrkDetl.getBatch().equals(matList.getBoxNo())){//木箱编码
                            wrkDetl.setOrigin(matList.getPosition());
                            wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch()));
                            sign=false;
                            break;
                        }
                    }
                    if (sign){
                        throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+"未查询到对应的工作明细!");
                    }
                }
            }
//            if (wrkMastMatrix.getIoType().equals(103)){
//                List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo());
//                if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0 || param.getMatLists().size()!=wrkDetls.size()){
//                    throw new CoolException("返回物料明细数为"+param.getMatLists().size()+",托盘码:"+param.getBarcode()+"应剩余物料数:"+wrkDetls.size());
//                }
//
//                ArrayList<String> orgin = new ArrayList<>();
//                //判断matLists参数
//                for (SingleMountUnstackingCompleteParam.MatList matList : param.getMatLists()){
//                    if (Cools.isEmpty(matList.getPosition())){
//                        throw new CoolException("参数:码垛位置 position为空");
//                    }else if (Cools.isEmpty(matList.getBoxNo())){
//                        throw new CoolException("参数:木箱编号 boxNo为空");
//                    }
//                    if (!orgin.contains(matList.getPosition())){
//                        orgin.add(matList.getPosition());
//                    }else {
//                        throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+",木箱位置存在重复");
//                    }
//                    boolean sign=true;
//                    for (WrkDetl wrkDetl:wrkDetls){
//                        if (wrkDetl.getBatch().equals(matList.getBoxNo())){//木箱编码
//                            wrkDetl.setOrigin(matList.getPosition());
//                            wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch()));
//                            sign=false;
//                            break;
//                        }
//                    }
//                    if (sign){
//                        throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+"未查询到对应的工作明细!");
//                    }
//                }
//            }
        }
        wrkMastMatrix.setSheetNo("1");
        wrkMastMatrix.setSheetNo("2");
        if (!wrkMastService.updateById(wrkMastMatrix)){
            throw new CoolException("更新工作档失败==》桁架上位软件:单托拆垛完成通知");
        }
@@ -951,7 +974,15 @@
    @Override
    @Transactional
    public void cs3() {
        //拆盘
        WrkMastSta wrkMastSta1 = new WrkMastSta(new Date(),119);
        wrkMastSta1.setType(2);
        wrkMastSta1.setWrkType(2);
        wrkMastStaService.insert(wrkMastSta1);
        WrkMastSta wrkMastSta2 = new WrkMastSta(new Date(),121);
        wrkMastSta2.setType(2);
        wrkMastSta2.setWrkType(2);
        wrkMastStaService.insert(wrkMastSta2);
    }
    /*...........................上饶江铜..............以上.............徐工汉云...........................*/