oms发单
This commit is contained in:
@@ -205,4 +205,34 @@ public class UserShipperAPI extends BaseController {
|
||||
public AjaxResult<?> getShipperSummaryData(@PathVariable Long userId) {
|
||||
return AjaxResult.success(userShipperApplicationService.getShipperSummaryData(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID查询货主信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 货主信息
|
||||
*/
|
||||
@ApiOperation("根据用户ID查询货主信息")
|
||||
@GetMapping("/getShipperByUserId/{userId}")
|
||||
public AjaxResult<?> getShipperByUserId(@PathVariable("userId") Long userId) {
|
||||
try {
|
||||
// 参数校验
|
||||
if (userId == null || userId <= 0) {
|
||||
return AjaxResult.error("用户ID不能为空");
|
||||
}
|
||||
|
||||
// 调用服务层方法查询货主信息
|
||||
UserShipperPo userShipperPo = userShipperApplicationService.getShipperByUserId(userId);
|
||||
|
||||
if (userShipperPo != null) {
|
||||
return AjaxResult.success(userShipperPo);
|
||||
} else {
|
||||
return AjaxResult.error("未找到对应的货主信息");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("根据用户ID查询货主信息异常,userId:{}", userId, e);
|
||||
return AjaxResult.error("查询货主信息失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user