Browse Source

fix 代充账号增加订单号返回

zoujiajian 1 năm trước cách đây
mục cha
commit
a257e14e6e

+ 4 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GroupsRelationRechargeView.java

@@ -3,6 +3,7 @@ package com.cyksj.model.views;
 import com.cyksj.model.entity.GoodsDon;
 import com.cyksj.model.entity.GroupsRelation;
 import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.DbIgnore;
 import com.ejlchina.searcher.bean.SearchBean;
 import lombok.Getter;
 import lombok.Setter;
@@ -89,4 +90,7 @@ public class GroupsRelationRechargeView {
 
 	@DbField("g.special_type")
 	private GoodsDon.SpecialType specialType;
+
+	@DbIgnore
+	private String orderNo;
 }

+ 11 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/group/CmsGroupRelationController.java

@@ -110,6 +110,17 @@ public class CmsGroupRelationController {
         SearchResult<GroupsRelationRechargeView> search = beanSearcher.search(GroupsRelationRechargeView.class, builder
                 .field(GroupsRelationRechargeView::getStatus, List.of(GroupsRelation.Status.validity.name(), GroupsRelation.Status.outside.name())).op(Operator.InList)
                 .build());
+        search.getDataList().forEach(data->{
+            OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
+                    .eq(OrderDon::getUserId, data.getUserId())
+                    .eq(OrderDon::getRelationId, data.getRelationId())
+                    .notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
+                    .orderByDesc(OrderDon::getId)
+                    .last("limit 1"));
+            if (orderDon != null) {
+                data.setOrderNo(orderDon.getOrderNo());
+            }
+        });
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);
     }