自动化立体仓库 - WMS系统
whycq
2022-08-06 7d7090b098add475808ffdebebff8b4e2a3b98ff
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -69,6 +69,11 @@
    private StaDescService staDescService;
    @Autowired
    private CommonService commonService;
    @Autowired
    private NodeService nodeService;
    @Autowired
    private ManLocDetlService manLocDetlService;
    @Override
    @Transactional
@@ -183,6 +188,39 @@
    }
    @Override
    public void onSale(CombParam param) {
        // 获取库位号
        String locno = param.getLocno();
        Node node = nodeService.selectByUuid(locno);
        if (Cools.isEmpty(node)) {
            throw new CoolException(param.getLocno() + ":库位不存在");
        }
        // 获取商品列表
        for(CombParam.CombMat combMat : param.getCombMats()){
            Mat mat = matService.selectByMatnr(combMat.getMatnr());
            if (Cools.isEmpty(mat)){
                throw new CoolException(combMat.getMatnr() + ":商品档案不存在!");
            }
            if (Cools.isEmpty(combMat.getAnfme()) || combMat.getAnfme()==0){
                throw new CoolException(combMat.getMatnr() + ":商品数量有误!");
            }
            if (Cools.isEmpty(combMat.getBatch())){
                throw new CoolException(combMat.getMatnr() + ":商品批号有误!");
            }
            ManLocDetl manLocDetl = new ManLocDetl();
            manLocDetl.setLocNo(locno);
            manLocDetl.setNodeId(node.getId());
            manLocDetl.setMatnr(combMat.getMatnr());
            manLocDetl.setBatch(combMat.getBatch());
            manLocDetl.setAnfme(combMat.getAnfme());
            if (!manLocDetlService.insert(manLocDetl)) {
                throw new CoolException("商品上架失败!");
            }
        }
    }
    @Override
    @Transactional
    public void adjust(MobileAdjustParam param, Long userId) {
        BasDevp basDevp = basDevpService.selectById(param.getStaNo());