| | |
| | | top.setUpdateTime(new Date()); |
| | | Integer insert = this.baseMapper.insert(top); |
| | | if (insert == 0) { |
| | | throw new CoolException("服务器异常"); |
| | | throw new CoolException("response.server_exception"); |
| | | } |
| | | } |
| | | return top; |
| | |
| | | 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()) |
| | |
| | | |
| | | |
| | | } |
| | | return R.ok("入库成功"); |
| | | return R.ok("response.inbound_success"); |
| | | } |
| | | |
| | | @Transactional |
| | |
| | | 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>() |
| | |
| | | } |
| | | } |
| | | } |
| | | return R.ok("出库成功"); |
| | | return R.ok("response.outbound_success"); |
| | | } |
| | | |
| | | @Transactional |
| | |
| | | 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()) |