傅行帆 il y a 5 ans
Parent
révision
f0252f901d

+ 13
- 0
src/main/java/com/huiju/estateagents/controller/TaPointsExchangeController.java Voir le fichier

@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.huiju.estateagents.base.BaseController;
7 7
 import com.huiju.estateagents.base.ResponseBean;
8 8
 import com.huiju.estateagents.common.CommConstant;
9
+import com.huiju.estateagents.entity.TaGoods;
9 10
 import com.huiju.estateagents.entity.TaPointsExchange;
11
+import com.huiju.estateagents.service.ITaGoodsService;
10 12
 import com.huiju.estateagents.service.ITaPointsExchangeService;
11 13
 import org.slf4j.Logger;
12 14
 import org.slf4j.LoggerFactory;
@@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
21 23
 
22 24
 import javax.servlet.http.HttpServletRequest;
23 25
 import java.time.LocalDateTime;
26
+import java.util.List;
24 27
 
25 28
 /**
26 29
  * <p>
@@ -39,6 +42,8 @@ public class TaPointsExchangeController extends BaseController {
39 42
     @Autowired
40 43
     public ITaPointsExchangeService iTaPointsExchangeService;
41 44
 
45
+    @Autowired
46
+    private ITaGoodsService taGoodsService;
42 47
 
43 48
     /**
44 49
      * 分页查询列表
@@ -226,6 +231,14 @@ public class TaPointsExchangeController extends BaseController {
226 231
             queryWrapper.orderByDesc("create_date");
227 232
             
228 233
             IPage<TaPointsExchange> result = iTaPointsExchangeService.page(pg, queryWrapper);
234
+            List<TaPointsExchange> records = result.getRecords();
235
+            records.forEach(e -> {
236
+                if (null == e.getStatus() || e.getStatus().equals(CommConstant.STATUS_UNACCALIMED)){
237
+                    TaGoods goods = taGoodsService.getById(e.getTargetId());
238
+                    e.setAddress(goods.getAddress());
239
+                }
240
+            });
241
+            result.setRecords(records);
229 242
             responseBean.addSuccess(result);
230 243
         }catch (Exception e){
231 244
             e.printStackTrace();

+ 3
- 1
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Voir le fichier

@@ -99,7 +99,7 @@
99 99
 	        d.name as activity_name,
100 100
 	        d.create_date
101 101
         FROM
102
-            ( SELECT * FROM ta_person_visit_record WHERE org_id = #{orgId} and event_type = #{eventType} AND consultant_id = #{userId} and person_id != #{personId} ORDER BY visit_time DESC ) t
102
+            ( SELECT * FROM ta_person_visit_record WHERE org_id = #{orgId} and event_type = #{eventType} AND consultant_id = #{userId} and person_id != #{personId} ORDER BY visit_time DESC LIMIT 999) t
103 103
             left JOIN ta_person p on t.person_id = p.person_id
104 104
             LEFT join ta_drainage d on t.target_id = d.drainage_id
105 105
         GROUP BY
@@ -117,6 +117,8 @@
117 117
                 LEFT JOIN ta_drainage d ON t.target_id = d.drainage_id
118 118
             GROUP BY
119 119
                 t.target_id
120
+            ORDER BY
121
+	            t.visit_time DESC
120 122
     </select>
121 123
 
122 124
     <select id="getDrainageVisitRecord" resultType="com.huiju.estateagents.entity.TaPersonVisitRecord">