| | |
| | | for (ReplenishDto param : params.getList()) { |
| | | Mat mat = matService.selectByMatnr(param.getMatnr()); |
| | | List<Prior> priors = priorService.selectList(new EntityWrapper<Prior>().eq("matnr", param.getMatnr())); |
| | | Node node; |
| | | // 有推荐货位 |
| | | if (!Cools.isEmpty(priors)) { |
| | | Prior prior = priors.get(0); |
| | | Node node = nodeService.selectById(prior.getNodeId()); |
| | | |
| | | // 保存入库记录 |
| | | Pakin pakin = new Pakin( |
| | | "BC" + String.valueOf(snowflakeIdWorker.nextId()), // 任务号[非空] |
| | | null, // 工作状态 |
| | | null, // 托盘号 |
| | | param.getCount(), // 入库数量 |
| | | node.getId(), // 关联货位[非空] |
| | | node.getUuid(), // 货位[非空] |
| | | mat.getMatnr(), // 商品编码[非空] |
| | | null, // 商品名称 |
| | | null, // 名称 |
| | | null, // 尺码 |
| | | null, // 型号 |
| | | null, // 批号 |
| | | null, // 单位 |
| | | null, // SKC |
| | | null, // 单据类型 |
| | | null, // 单据编号 |
| | | null, // 客户名称 |
| | | null, // 品项数 |
| | | null, // 数量 |
| | | null, // 重量 |
| | | 1, // 状态 |
| | | 9527L, // 添加人员 |
| | | now, // 添加时间 |
| | | 9527L, // 修改人员 |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | VersionUtils.setPakin(pakin, mat); |
| | | if (!pakinService.insert(pakin)) { |
| | | throw new CoolException("保存入库记录失败"); |
| | | } |
| | | node = nodeService.selectById(prior.getNodeId()); |
| | | |
| | | LocDetl locDetl = locDetlService.getLocDetl(node.getId(), param.getMatnr()); |
| | | if (locDetl == null) { |
| | |
| | | |
| | | // 没有推荐货物 |
| | | } else { |
| | | Node node = nodeService.selectByUuid(Parameter.get().getUniNode()); |
| | | node = nodeService.selectByUuid(Parameter.get().getUniNode()); |
| | | |
| | | LocDetl locDetl = locDetlService.getLocDetl(node.getId(), param.getMatnr()); |
| | | if (locDetl == null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 保存入库记录 |
| | | Pakin pakin = new Pakin( |
| | | "BC" + String.valueOf(snowflakeIdWorker.nextId()), // 任务号[非空] |
| | | null, // 工作状态 |
| | | null, // 托盘号 |
| | | param.getCount(), // 入库数量 |
| | | node.getId(), // 关联货位[非空] |
| | | node.getUuid(), // 货位[非空] |
| | | mat.getMatnr(), // 商品编码[非空] |
| | | null, // 商品名称 |
| | | null, // 名称 |
| | | null, // 尺码 |
| | | null, // 型号 |
| | | null, // 批号 |
| | | null, // 单位 |
| | | null, // SKC |
| | | null, // 单据类型 |
| | | null, // 单据编号 |
| | | null, // 客户名称 |
| | | null, // 品项数 |
| | | null, // 数量 |
| | | null, // 重量 |
| | | 1, // 状态 |
| | | 9527L, // 添加人员 |
| | | now, // 添加时间 |
| | | 9527L, // 修改人员 |
| | | now, // 修改时间 |
| | | "补仓入库" // 备注 |
| | | ); |
| | | VersionUtils.setPakin(pakin, mat); |
| | | if (!pakinService.insert(pakin)) { |
| | | throw new CoolException("保存入库记录失败"); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |