Commit f0baea23 by 杨卫

fix(1028423): 重构4S店信息修改功能的事务处理和异常管理

- 在MerchantEditRemoteImpl中添加@Transactional注解确保数据一致性
- 将业务逻辑分离到doUpdateMerchantInfo方法中实现事务控制
- 实现异常兜底机制,在Dubbo入口处统一捕获和处理异常
- 修复RpcServiceException构造函数调用方式确保错误码正确传递
- 优化MerchantEditController中的异常处理逻辑提高系统稳定性
1 parent f6afb129
......@@ -63,7 +63,11 @@ public class MerchantEditController {
RpcResponse<Boolean> rpcResponse = merchantEditRemote.updateMerchantInfo(rpcRequest);
if (rpcResponse.isFailed()) {
log.error("4S店信息修改失败: {}", rpcResponse.getMessage());
throw new RpcServiceException(rpcResponse.getError(), rpcResponse.getMessage());
throw new RpcServiceException(
rpcResponse.getError(),
Optional.ofNullable(rpcResponse.getException()).map(RpcServiceException::getErrId).orElse(DefaultErrorEnum.SERVICE_ERROR.getValue()),
rpcResponse.getMessage()
);
}
return RopResponse.success(merchantEditConvert.toEditResponse(rpcResponse.getResult()));
} catch (RpcServiceException e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!