Przeglądaj źródła

fix : 修正蜀山cpOrderId前端不正确问题

bilingfeng 7 miesięcy temu
rodzic
commit
74e57664f7

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java

@@ -23,7 +23,7 @@ public class SDKApplication {
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <订单回传优化> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <修正蜀山cpOrderId前端不正确问题> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +
                 "\\ `--.| | | | |/ / \n" +

+ 10 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/OrderServiceImpl.java

@@ -16,6 +16,7 @@ import com.zanxiang.module.util.bean.BeanUtil;
 import com.zanxiang.module.util.exception.BaseException;
 import com.zanxiang.module.util.exception.BaseException;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -90,7 +91,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
 
     private Order transform(UserData userData, String orderNum, ProductPayParam payParam, User user, GameUser gameUser,
     private Order transform(UserData userData, String orderNum, ProductPayParam payParam, User user, GameUser gameUser,
                             Game game, GameUserRole gameUserRole, GamePayWayDTO gamePayWayDTO) {
                             Game game, GameUserRole gameUserRole, GamePayWayDTO gamePayWayDTO) {
-        return Order.builder()
+        Order order = Order.builder()
                 .orderId(orderNum)
                 .orderId(orderNum)
                 .cpOrderId(payParam.getOrderId())
                 .cpOrderId(payParam.getOrderId())
                 .agentId(user.getAgentId())
                 .agentId(user.getAgentId())
@@ -117,6 +118,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 .createTime(LocalDateTime.now())
                 .createTime(LocalDateTime.now())
                 .updateTime(LocalDateTime.now())
                 .updateTime(LocalDateTime.now())
                 .build();
                 .build();
+        //蜀山天下, sdk前端存在bug, cp订单id参数修正
+        if (game.getId() == 29 && !order.getCpOrderId().contains("NZW")) {
+            //ext中记录了正确的cp订单id, 修正订单数据
+            if (Strings.isNotBlank(order.getExt()) && order.getExt().contains("NZW")) {
+                order.setCpOrderId(order.getExt());
+            }
+        }
+        return order;
     }
     }
 
 
     @Override
     @Override