feat(wms): 添加钢卷复活功能

- 在 IWmsMaterialCoilService 中新增 reviveCoil 方法定义
- 在 WmsMaterialCoilController 中添加 /reviveCoil/{coilId} 接口
- 在 WmsMaterialCoilServiceImpl 中实现复活逻辑
- 实现将 dataType=0 的历史钢卷恢复为 dataType=1 的当前钢卷
- 添加实际库位绑定清空和钢卷号重复检查功能
- 完善异常处理和事务回滚机制
This commit is contained in:
2026-01-19 14:11:06 +08:00
parent e2d0f07b40
commit 2d9795e16a
3 changed files with 105 additions and 0 deletions

View File

@@ -300,5 +300,31 @@ public class WmsMaterialCoilController extends BaseController {
return R.ok(result);
}
/**
* 复活历史钢卷
* 将dataType=0的历史钢卷恢复为dataType=1的当前钢卷
* 同时清空实际库位绑定,并检查当前钢卷号是否重复
*
* @param coilId 钢卷ID
* @return 复活结果包含success状态、错误信息、钢卷ID和当前钢卷号
*/
@Log(title = "钢卷物料表", businessType = BusinessType.UPDATE)
@GetMapping("/reviveCoil/{coilId}")
public R<Map<String, Object>> reviveCoil(
@NotNull(message = "钢卷ID不能为空")
@PathVariable("coilId") Long coilId) {
try {
Map<String, Object> result = iWmsMaterialCoilService.reviveCoil(coilId);
// 根据业务结果返回成功/失败的统一响应
if (Boolean.TRUE.equals(result.get("success"))) {
return R.ok(result);
} else {
return R.fail(result.get("message").toString(), result);
}
} catch (Exception e) {
return R.fail("复活钢卷失败:" + e.getMessage());
}
}
}