|
@@ -12,6 +12,7 @@ import com.qs.mp.channel.domain.ChannelOrderDetail;
|
|
|
import com.qs.mp.channel.domain.vo.ChannelOrderInfoVO;
|
|
|
import com.qs.mp.channel.domain.vo.ChannelOrderItemVO;
|
|
|
import com.qs.mp.channel.service.IChannelOrderDetailService;
|
|
|
+import com.qs.mp.common.constant.Constants;
|
|
|
import com.qs.mp.common.domain.DeliveryCompany;
|
|
|
import com.qs.mp.common.enums.*;
|
|
|
import com.qs.mp.common.service.IDeliveryCompanyService;
|
|
@@ -365,6 +366,35 @@ public class ChannelOrderController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 订单支付
|
|
|
+ */
|
|
|
+ @PostMapping("/dg/order/pay")
|
|
|
+ @ApiOperation(value = "订单支付" , notes = "在订单列表页面支付")
|
|
|
+ public AjaxResult dgPay(@Valid @RequestBody OrderPayParam param) {
|
|
|
+ Long userId = SecurityUtils.getLoginUser().getUserId();
|
|
|
+ SysUser sysUser = sysUserService.selectUserById(userId);
|
|
|
+ String channelOpenId = "";
|
|
|
+ if (StringUtils.isNotBlank(param.getOpenId())) {
|
|
|
+ channelOpenId = param.getOpenId();
|
|
|
+ } else {
|
|
|
+ channelOpenId = sysUser.getChannelOpenId();
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(channelOpenId)) {
|
|
|
+ return AjaxResult.error(ErrorCodeEnum.ERROR_CODE_1005);
|
|
|
+ }
|
|
|
+ ChannelOrder channelOrder = channelOrderService.getById(param.getOrderId());
|
|
|
+ JSONObject jsonObject;
|
|
|
+ try {
|
|
|
+ jsonObject = walletService.dgWxPay(BizTypeEnum.CHANNEL_ORDER, param.getOrderId(), channelOpenId, channelOrder.getPayAmt(), channelOrder.getTitle(), AppSourceEnum.CHANNEL.getValue(), Constants.PAY_STYLE_WX);
|
|
|
+ }catch (ServiceException e) {
|
|
|
+ LogUtil.error(logger, e, "根据经销商采购订单创建支付单失败。userId:{0},orderId:{1}", new Object[]{userId, param.getOrderId()});
|
|
|
+ return AjaxResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ return AjaxResult.success(jsonObject);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@PostMapping("/order/confirm")
|
|
|
@ApiOperation("订单确认收货")
|