自动化立体仓库 - WMS系统
#
lty
4 天以前 dea586adf232c722e8d2dfa833c3d7711a1019df
src/main/java/com/zy/asrs/service/impl/NodeServiceImpl.java
@@ -52,7 +52,7 @@
            top.setUpdateTime(new Date());
            Integer insert = this.baseMapper.insert(top);
            if (insert == 0) {
                throw new CoolException("服务器异常");
                throw new CoolException("response.server_exception");
            }
        }
        return top;
@@ -85,17 +85,17 @@
            node = nodeService.selectById(param.getNodeId());
        }
        if (node == null) {
            return R.error("货位不存在");
            return R.error("response.node_not_exist");
        }
        if (Cools.isEmpty(param.getMats())) {
            return R.error("入库物料不能为空");
            return R.error("response.inbound_material_empty");
        }
        Date now = new Date();
        for (MatnrDto dto : param.getMats()) {
            Mat mat = matService.selectByMatnr(dto.getMatnr());
            if (mat == null) {
                throw new CoolException("物料数据错误,请联系管理员");
                throw new CoolException("response.material_data_error");
            }
            ManLocDetl check = manLocDetlService.selectOne(new EntityWrapper<ManLocDetl>()
                    .eq("loc_no", node.getUuid())
@@ -126,7 +126,7 @@
        }
        return R.ok("入库成功");
        return R.ok("response.inbound_success");
    }
    @Transactional
@@ -141,13 +141,19 @@
                Node node = nodeService.selectOne(new EntityWrapper<Node>()
                        .eq("id", param.getNodeId()));
                if (node == null) {
                    return R.error("找不到该库位,请联系管理员:" + param.getNodeId() );
                    R r = R.error("response.node_not_found");
                    r.put("nodeId", param.getNodeId());
                    return r;
                }
                if (manLocDetl == null) {
                    return R.error("物料:"+ param.getMatnr() + " 在库位中不存在");
                    R r = R.error("response.material_not_found");
                    r.put("matnr", param.getMatnr());
                    return r;
                }
                if (manLocDetl.getAnfme() - param.getCount() < 0) {
                    return R.error("物料:"+ param.getMatnr() + " 在库位中数量不足");
                    R r = R.error("response.quantity_insufficient");
                    r.put("matnr", param.getMatnr());
                    return r;
                } else if (manLocDetl.getAnfme() - param.getCount() == 0) {
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount());
                    manLocDetlService.delete(new EntityWrapper<ManLocDetl>()
@@ -163,7 +169,7 @@
                }
            }
        }
        return R.ok("出库成功");
        return R.ok("response.outbound_success");
    }
    @Transactional
@@ -177,7 +183,7 @@
            Node sourceNode = nodeService.selectOne(new EntityWrapper<Node>()
                    .eq("uuid", sourceLocNo));
            if (targetNode == null || targetNode.equals("")) {
                throw new RuntimeException("无法查询到移库的目标库位");
                throw new RuntimeException("response.target_node_not_found");
            }
            ManLocDetl check = manLocDetlService.selectOne(new EntityWrapper<ManLocDetl>()
                    .eq("loc_no", targetNode.getUuid())