自动化立体仓库 - WMS系统
#
野心家
2023-05-15 98b770b88b356b682260065f0449d4f453ba7c3b
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -67,6 +67,8 @@
    @Value("${mes.inPath}")
    private String inpath;
    @Value("${mes.url}")
    private String mesUrl;
    @Override
    @Transactional
@@ -594,11 +596,24 @@
            throw new CoolException("重复申请" + param.getPackNo());
        }
        // 生成入库通知档
//        Mat mat = matService.selectByMatnr(param.getPackName());
//        if (Cools.isEmpty(mat)) {
//         生成入库通知档
        Mat mat = matService.selectByMatnr(param.getPackName());
        if (Cools.isEmpty(mat)) {
            Tag tag = tagService.selectByName("全部", 1);
            Mat matNew = new Mat();
            matNew.setTagId(tag.getId());
            matNew.setMatnr(param.getPackName());
            matNew.setMaktx(param.getPackName());
            matNew.setDeadWarn(mat.getDeadWarn());
            matNew.setCreateBy(9999L);//9999表示erp下发
            matNew.setCreateTime(new Date());
            matNew.setUpdateBy(9999L);//9999表示erp下发
            matNew.setUpdateTime(new Date());
            if (!matService.insert(matNew)){
                throw new CoolException(param.getPackName() + "商品档案自动生成失败");
            }
//            throw new CoolException(param.getPackName() + "商品档案不存在");
//        }
        }
        WaitPakin waitPakin = new WaitPakin();
//        waitPakin.sync(mat);
        waitPakin.setMatnr(param.getPackName());
@@ -700,7 +715,7 @@
                    combParam.setLocNo(locMast.getLocNo());
                    combParam.setPackSts(7);
                    combParam.setRequestTime(DateUtils.convert(new Date()));
                    new PostMesDataUtils().postMesData(inpath,combParam);
                    new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam);
                    if (!locMastService.updateById(locMast)) {
                        throw new CoolException("预约库位状态失败,库位号:"+locMast.getLocNo());
@@ -746,14 +761,9 @@
                    throw new CoolException("更新测试状态失败");
                }
                locMast.setPackStatus(2);
                CombParam combParam = new CombParam();
                combParam.setPackNo(locMast.getBarcode());
                combParam.setLocNo(locMast.getLocNo());
                combParam.setPackSts(2);
                combParam.setRequestTime(DateUtils.convert(new Date()));
                new PostMesDataUtils().postMesData(inpath,combParam);
                if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo()))){
                    throw new CoolException("更新产品状态失败");
                }
            } else if (Cools.isEmpty(testMast.getStatus())){
@@ -793,7 +803,7 @@
                combParam.setLocNo(locMast.getLocNo());
                combParam.setPackSts(3);
                combParam.setRequestTime(DateUtils.convert(new Date()));
                new PostMesDataUtils().postMesData(inpath,combParam);
                new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam);
                if (!locMastService.update(locMast, new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo()))){
                    throw new CoolException("更改产品状态失败");
@@ -834,7 +844,7 @@
                combParam.setLocNo(locMast.getLocNo());
                combParam.setPackSts(4);
                combParam.setRequestTime(DateUtils.convert(new Date()));
                new PostMesDataUtils().postMesData(inpath,combParam);
                new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam);
                if (!locMastService.update(locMast, new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo()))){
                    throw new CoolException("更改产品状态失败");