Эх сурвалжийг харах

解绑渠道 订单金额佣金;0元订单续费;pc微信登录回调url

zoujiajian 2 жил өмнө
parent
commit
2bdfde8d5e

+ 31 - 0
netflix-dao/src/main/java/com/cyksj/model/views/UserDistributeUnbindOrderMoneyView.java

@@ -0,0 +1,31 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: UserDistributeUnbindOrderMoneyView
+ * 创建者: JavaZou
+ * 创建时间:2023/12/20 17:23
+ */
+@Getter
+@Setter
+@SearchBean(tables = "user_distribute_shared_relate_unbind unb inner join order_don o on o.user_id = unb.user_id and o.created_time > unb.update_time" +
+		" inner join user_distribute_shared us on us.user_id = unb.user_id" +
+		" inner join user_distribute ud on ud.user_id = us.shared_id and ud.deleted = 1",
+		where = "o.status not in ('close','noPayment','refund') and o.is_distribute = 0")
+public class UserDistributeUnbindOrderMoneyView {
+
+
+	@DbField("cast(sum(o.money)/100 as decimal(10,2))")
+	private BigDecimal orderMoney;
+
+
+	@DbField("cast(sum(o.money * (select rate from user_plat_distribute_rate ur where ur.goods_id = o.goods_id and ur.distribute_id = ud.id limit 1))/10000 as decimal(10,2))")
+	private BigDecimal takerMoney;
+}

+ 8 - 5
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -945,11 +945,6 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		//扣除使用优惠券、余额的订单金额
 		deductOrderMoney(orderDon, couponUser, payRequest.getBalance(), user, sku.getPrice(), goodsDon.getType(), payRequest.getGcCash(), payRequest.getGcpIds());
 		this.saveOrUpdate(orderDon);
-		//订单金额为0 且订单为已完成 更新虚物车票
-		if (orderDon.getMoney().compareTo(BigDecimal.ZERO) == 0) {
-			orderDon.setStatus(goodsDon.getType() == 1 && goodsDon.getSecondType() == 2 ? OrderDon.Status.complete : OrderDon.Status.hasPayment);
-			updateGroupsTicket(orderDon, goodsDon, sku);
-		}
 		if (orderDon.getStatus() == OrderDon.Status.noPayment) {
 			jobManager.addJob(EXPIRY_TIME, () -> {
 				closeOrder(orderDon.getId(), null);
@@ -973,6 +968,14 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			}
 			corpInteractiveUserOrderRelationMapper.insert(corpInteractiveUserOrderRelation);
 		}
+		//订单金额为0 且订单为已完成 更新虚物车票
+		if (orderDon.getMoney().compareTo(BigDecimal.ZERO) == 0) {
+			OrderDon updateOrder = orderDonMapper.selectById(orderDon.getId());
+			updateOrder.setStatus(goodsDon.getType() == 1 && goodsDon.getSecondType() == 2 ? OrderDon.Status.complete : OrderDon.Status.hasPayment);
+			updateGroupsTicket(updateOrder, goodsDon, sku);
+			orderDonMapper.updateById(updateOrder);
+			return updateOrder;
+		}
 		return orderDon;
 	}
 

+ 9 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/distribute/DistributeController.java

@@ -1165,4 +1165,13 @@ public class DistributeController {
 		distributeService.unbindUserDistributeShared(userBind);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
+
+	/**
+	 * 解绑渠道关系下单金额,以及佣金
+	 */
+	@GetMapping("/get/unbind/orderMoney/detail")
+	public Result<UserDistributeUnbindOrderMoneyView> getUnbindDistributeOrderMoneyDetail() {
+		UserDistributeUnbindOrderMoneyView userDistributeUnbindOrderMoneyView = beanSearcher.searchFirst(UserDistributeUnbindOrderMoneyView.class, MapUtils.flatBuilder(request.getParameterMap()).build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(userDistributeUnbindOrderMoneyView);
+	}
 }

+ 4 - 2
netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java

@@ -210,9 +210,9 @@ public class AuthorizationController {
      * 网页微信授权登录
      */
     @GetMapping("/wx/authLogin")
-    public Result<String> wxAuthorize(Long sharedId, Integer dsType, Long popularizeId, String dsCode, String type, String callbackType, String callback) throws Exception {
+    public Result<String> wxAuthorize(Long sharedId, Integer dsType, Long popularizeId, String dsCode, String type, String callbackType, String callback, String returnUrl) throws Exception {
         Long mappingId = SEQUENCE.nextId();
-        String loginUrl = wxOpenPlatYHLXLoginConfig.getLoginUrl();
+        String loginUrl = Optional.ofNullable(returnUrl).orElse(wxOpenPlatYHLXLoginConfig.getLoginUrl());
         if (StrUtil.isNotBlank(type)) {
             loginUrl = String.format("https://nf.video/%s/web", type);
         }
@@ -232,6 +232,7 @@ public class AuthorizationController {
      * 微信网页统一授权登录
      */
     @GetMapping("/wx/unified/login")
+    @Deprecated
     public Result<String> wxUnifiedLogin(Long sharedId, Integer dsType, Long popularizeId, String dsCode, String type, String callbackType, String callback, String wt, String customId) throws Exception {
         if (StrUtil.isEmpty(wt)) {
             return GatewayResponse.SUCCESS.newBuilder().toResult();
@@ -261,6 +262,7 @@ public class AuthorizationController {
      * 网页微信授权后统一跳转
      */
     @GetMapping("/wx/unified/baseRedirect")
+    @Deprecated
     public void wxUnifiedRedirect(String code, String state, HttpServletResponse response) throws Exception {
         // 转跳参数
         String json = Codec.DoBase64.custom().setData(state).decodeAsText();