|
@@ -12,8 +12,9 @@ import common.model.OrderLog;
|
|
|
import common.model.User;
|
|
import common.model.User;
|
|
|
import common.utils.bsn.BsnSDK;
|
|
import common.utils.bsn.BsnSDK;
|
|
|
import common.utils.http.MyRet;
|
|
import common.utils.http.MyRet;
|
|
|
|
|
+import modules.nftt.NfttService;
|
|
|
import modules.user.UserService;
|
|
import modules.user.UserService;
|
|
|
-import modules.user.UserTeamService;
|
|
|
|
|
|
|
+import modules.user.UserTeamShareTask;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
@@ -24,6 +25,8 @@ import java.util.stream.Collectors;
|
|
|
public class OrderService {
|
|
public class OrderService {
|
|
|
@Inject
|
|
@Inject
|
|
|
UserService userService;
|
|
UserService userService;
|
|
|
|
|
+ @Inject
|
|
|
|
|
+ NfttService nfttService;
|
|
|
|
|
|
|
|
public String hello() {
|
|
public String hello() {
|
|
|
return "Hello order";
|
|
return "Hello order";
|
|
@@ -164,6 +167,12 @@ public class OrderService {
|
|
|
|
|
|
|
|
public MyRet findOrderById(long orderId, long userId) {
|
|
public MyRet findOrderById(long orderId, long userId) {
|
|
|
List<Order> orderList = Order.dao.find("SELECT * FROM t_order WHERE id=? and user_id=?", orderId, userId);
|
|
List<Order> orderList = Order.dao.find("SELECT * FROM t_order WHERE id=? and user_id=?", orderId, userId);
|
|
|
|
|
+
|
|
|
|
|
+ // 给用户订单封装商品信息
|
|
|
|
|
+ for (Order order : orderList) {
|
|
|
|
|
+ order.put("nftt", nfttService.findNfttById(order.getNfttId() + ""));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
List<Map<String, Object>> resultList = encapsulateOrdersWithLogs(orderList);
|
|
List<Map<String, Object>> resultList = encapsulateOrdersWithLogs(orderList);
|
|
|
|
|
|
|
|
if (!resultList.isEmpty()) {
|
|
if (!resultList.isEmpty()) {
|
|
@@ -228,7 +237,7 @@ public class OrderService {
|
|
|
AppConfig.LOGGER.info("该订单已确权:{}", order);
|
|
AppConfig.LOGGER.info("该订单已确权:{}", order);
|
|
|
|
|
|
|
|
// 异步执行分润过程
|
|
// 异步执行分润过程
|
|
|
- AppConfig.TaskScheduler.submit(new UserTeamService(order, userService));
|
|
|
|
|
|
|
+ AppConfig.TaskScheduler.submit(new UserTeamShareTask(order, userService));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// status为2时是交付失败,自动执行退款
|
|
// status为2时是交付失败,自动执行退款
|
|
@@ -296,6 +305,11 @@ public class OrderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 给用户订单封装商品信息
|
|
|
|
|
+ for (Order order : orderList) {
|
|
|
|
|
+ order.put("nftt", nfttService.findNfttById(order.getNfttId() + ""));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 调用重用方法封装日志
|
|
// 调用重用方法封装日志
|
|
|
List<Map<String, Object>> resultList = encapsulateOrdersWithLogs(orderList);
|
|
List<Map<String, Object>> resultList = encapsulateOrdersWithLogs(orderList);
|