|
|
|
@@ -401,5 +401,38 @@ public class WxOrderController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("购物车订单详情接口") |
|
|
|
@GetMapping("goodsDetail") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) |
|
|
|
}) |
|
|
|
public ResultData goodsDetail(String mainOrderId) { |
|
|
|
if (StringUtils.isBlank(mainOrderId) || mainOrderId.equalsIgnoreCase(Constant.UNDEFINED)) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
// c端用户应该只能看到自己的订单细节 |
|
|
|
WxOrder wxOrder = new WxOrder(); |
|
|
|
Long composeOrderId = 0L; |
|
|
|
try { |
|
|
|
composeOrderId = Long.valueOf(mainOrderId); |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
logger.error("parse composeOrderId failed"); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常:"+mainOrderId); |
|
|
|
} |
|
|
|
wxOrder.setComposeOrderId(composeOrderId); |
|
|
|
Long memberId; |
|
|
|
try { |
|
|
|
memberId = getMemberId(); |
|
|
|
} catch (Exception e) { |
|
|
|
return new ResultData(Result.ERROR,e.getMessage()); |
|
|
|
} |
|
|
|
wxOrder.setCUserId(memberId); |
|
|
|
List<WxOrderCouponVo> wxOrders = wxOrderService.goodsDetailCUserVo(wxOrder); |
|
|
|
if (wxOrders == null) |
|
|
|
return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); |
|
|
|
|
|
|
|
return new ResultData(wxOrders); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |