自动化立体仓库 - WMS系统
#
LSH
2022-12-13 f1e8863e65a15e9c3117d81a6fa6b28cb5fdfce2
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -191,6 +191,7 @@
    }
    // 商品上架
    @Override
    public void onSale(CombParam param) {
        Date now = new Date();
@@ -211,14 +212,14 @@
                throw new CoolException(combMat.getMatnr() + ":商品数量有误!");
            }
            if (Cools.isEmpty(combMat.getBatch())){
                throw new CoolException(combMat.getMatnr() + ":商品批号有误!");
//                throw new CoolException(combMat.getMatnr() + ":商品批号有误!");
            }
            ManLocDetl manLocDetl = new ManLocDetl();
            manLocDetl.setLocNo(locno);
            manLocDetl.setNodeId(node.getId());
            manLocDetl.setMaktx(mat.getMaktx());
            manLocDetl.setMatnr(mat.getMatnr());
            manLocDetl.setBatch(combMat.getBatch());
            manLocDetl.setBatch(Cools.isEmpty(combMat.getBatch()) ? "" : combMat.getBatch());
            manLocDetl.setAnfme(combMat.getAnfme());
            manLocDetl.setModiTime(now);
            if (!manLocDetlService.insert(manLocDetl)) {
@@ -227,15 +228,25 @@
        }
    }
    // 商品下架
    @Override
    public void offSale(OffSaleParam offSaleParam) {
        List<ManLocDetl> manLocDetls = manLocDetlMapper.selectLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr());
        if (Cools.isEmpty(manLocDetls)){
            throw new CoolException("商品下架失败!");
        ManLocDetl manLocDetl = manLocDetlMapper.selectLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr());
        if (Cools.isEmpty(manLocDetl)){
            throw new CoolException("无此商品!");
        }
        int i = manLocDetlMapper.deleteLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr());
        System.out.println(i);
        double anfme = manLocDetl.getAnfme() - offSaleParam.getAnfme();
        if (anfme < 0) {
            throw new CoolException("商品库存不足!");
        } else if (anfme == 0){
            manLocDetlMapper.deleteLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr());
        }
        manLocDetlMapper.updateAnfme0(anfme,manLocDetl.getNodeId());
    }
    // 查找商品
    @Override
    @Transactional
    public void adjust(MobileAdjustParam param, Long userId) {