|
|
@@ -38,6 +38,7 @@ import com.cyksj.model.request.*;
|
|
|
import com.cyksj.model.views.*;
|
|
|
import com.cyksj.service.mange.CmsOrderDonService;
|
|
|
import com.cyksj.service.order.OrderDonCommentService;
|
|
|
+import com.cyksj.service.user.UserBindRelationService;
|
|
|
import com.cyksj.service.user.UserService;
|
|
|
import com.cyksj.web.util.EasyExcelUtils;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
@@ -111,6 +112,8 @@ public class CmsOrderController {
|
|
|
|
|
|
private final MidjourneyUserMapper midjourneyUserMapper;
|
|
|
|
|
|
+ private final UserBindRelationService userBindRelationService;
|
|
|
+
|
|
|
|
|
|
@GetMapping("/get")
|
|
|
@SaCheckPermission("order:view")
|
|
|
@@ -1005,4 +1008,54 @@ public class CmsOrderController {
|
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(midjourneyUserDetailView);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户退款详情
|
|
|
+ */
|
|
|
+ @GetMapping("/get/user/refund/detail")
|
|
|
+ public Result<OrderDonUserRefundDetailView> getUserRefundDetail(Long userId) {
|
|
|
+ if (userId == null || userId == 0) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ List<Long> userIdList = null;
|
|
|
+ try {
|
|
|
+ userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ String userIds = null;
|
|
|
+ if (CollUtil.isNotEmpty(userIdList)) {
|
|
|
+ userIds = userIdList.toString().replaceAll("\\[", "").replaceAll("]", "");
|
|
|
+ }
|
|
|
+ MapBuilder builder = MapUtils.builder();
|
|
|
+ if (StrUtil.isNotBlank(userIds)) {
|
|
|
+ builder.put("uid", String.format(" and user_id in (%s)", userIds));
|
|
|
+ } else {
|
|
|
+ builder.put("uid", String.format(" and user_id = %s", userId));
|
|
|
+ }
|
|
|
+ OrderDonUserRefundDetailView orderDonUserRefundDetailView = beanSearcher.searchFirst(OrderDonUserRefundDetailView.class, builder.build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(orderDonUserRefundDetailView);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户订单列表
|
|
|
+ */
|
|
|
+ @GetMapping("/get/user/orders")
|
|
|
+ public Result<SearchResult<OrderDonUserRefundDetailView.OrderDonDetailView>> getUserOrdersDetail(Long userId) {
|
|
|
+ if (userId == null || userId == 0) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ List<Long> userIdList = null;
|
|
|
+ try {
|
|
|
+ userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ if (userIdList == null) {
|
|
|
+ userIdList = new ArrayList<>();
|
|
|
+ userIdList.add(userId);
|
|
|
+ }
|
|
|
+ SearchResult<OrderDonUserRefundDetailView.OrderDonDetailView> search = beanSearcher.search(OrderDonUserRefundDetailView.OrderDonDetailView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
+ .field(OrderDonUserRefundDetailView.OrderDonDetailView::getUserId, userIdList).op(Operator.InList)
|
|
|
+ .build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
+ }
|
|
|
}
|