|
@@ -131,29 +131,29 @@ public class WxPayController extends BladeController {
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperation(value = "jspai下单API", notes = "jspai下单API")
|
|
@ApiOperation(value = "jspai下单API", notes = "jspai下单API")
|
|
public R jsapiPay(@ApiParam(value = "订单号", required = true) @RequestParam String orderNo,
|
|
public R jsapiPay(@ApiParam(value = "订单号", required = true) @RequestParam String orderNo,
|
|
- @ApiParam(value = "openid", required = true) @RequestParam String openid) {
|
|
|
|
|
|
+ @ApiParam(value = "openid", required = true) @RequestParam String openId) {
|
|
try {
|
|
try {
|
|
- Order order = orderService.getByOrderNo(orderNo);
|
|
|
|
- if (OrderTypeEnum.NORMAL.getValue().equals(order.getOrderType())) {
|
|
|
|
- // 判断团购是否结束
|
|
|
|
- OrderGroupon orderGroupon = orderGrouponService.lambdaQuery().eq(OrderGroupon::getOrderId, order.getId()).one();
|
|
|
|
- Groupon groupon = grouponService.getById(orderGroupon.getGrouponId());
|
|
|
|
- if (groupon.getGrouponEndTime().isBefore(LocalDateTime.now())) {
|
|
|
|
- // 团购已结束则取消订单
|
|
|
|
- orderService.orderCancel(order.getId());
|
|
|
|
- return R.fail("团购已结束!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// Order order = orderService.getByOrderNo(orderNo);
|
|
|
|
+// if (OrderTypeEnum.NORMAL.getValue().equals(order.getOrderType())) {
|
|
|
|
+// // 判断团购是否结束
|
|
|
|
+// OrderGroupon orderGroupon = orderGrouponService.lambdaQuery().eq(OrderGroupon::getOrderId, order.getId()).one();
|
|
|
|
+// Groupon groupon = grouponService.getById(orderGroupon.getGrouponId());
|
|
|
|
+// if (groupon.getGrouponEndTime().isBefore(LocalDateTime.now())) {
|
|
|
|
+// // 团购已结束则取消订单
|
|
|
|
+// orderService.orderCancel(order.getId());
|
|
|
|
+// return R.fail("团购已结束!");
|
|
|
|
+// }
|
|
|
|
+// }
|
|
boolean profitSharing = false;
|
|
boolean profitSharing = false;
|
|
- DistributionConfig config = distributionConfigService.lambdaQuery().one();
|
|
|
|
- // 是否开启分销
|
|
|
|
- if (config != null && config.getIsOpen()) {
|
|
|
|
- // 查询用户是否有绑定上级
|
|
|
|
- Embers embers = embersService.lambdaQuery().eq(Embers::getBindUserId, order.getUserId())
|
|
|
|
- .eq(Embers::getState,0).one();
|
|
|
|
- profitSharing = embers != null;
|
|
|
|
- }
|
|
|
|
- Map<String, Object> map = this.generalOrder(WxApiType.JS_API_PAY, orderNo, openid, profitSharing);
|
|
|
|
|
|
+// DistributionConfig config = distributionConfigService.lambdaQuery().one();
|
|
|
|
+// // 是否开启分销
|
|
|
|
+// if (config != null && config.getIsOpen()) {
|
|
|
|
+// // 查询用户是否有绑定上级
|
|
|
|
+// Embers embers = embersService.lambdaQuery().eq(Embers::getBindUserId, order.getUserId())
|
|
|
|
+// .eq(Embers::getState,0).one();
|
|
|
|
+// profitSharing = embers != null;
|
|
|
|
+// }
|
|
|
|
+ Map<String, Object> map = this.generalOrder(WxApiType.JS_API_PAY, orderNo, openId, profitSharing);
|
|
return R.data(map);
|
|
return R.data(map);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|