瀏覽代碼

新需求

weichaochao 5 年之前
父節點
當前提交
5a47a39c69

+ 21
- 0
src/main/java/com/huiju/estateagents/controller/TaShareController.java 查看文件

@@ -80,4 +80,25 @@ public class TaShareController extends BaseController {
80 80
         }
81 81
         return responseBean;
82 82
     }
83
+
84
+    @RequestMapping(value = "/admin/taLiveShare", method = RequestMethod.GET)
85
+    public ResponseBean taLiveShare(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
86
+                                         @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
87
+                                         @RequestParam(value = "shareType", required = false)String shareType,
88
+                                         @RequestParam(value = "personType", required = false)String personType,
89
+                                         @RequestParam(value = "phone", required = false)String phone,
90
+                                         @RequestParam(value = "liveActivityId")Integer liveActivityId, HttpServletRequest request){
91
+        ResponseBean responseBean = new ResponseBean();
92
+        try {
93
+            if (liveActivityId == null){
94
+                return ResponseBean.success("");
95
+            }
96
+            responseBean = taShareService.selectLiveShareList(pageNum, pageSize, getOrgId(request), personType, shareType, phone, liveActivityId);
97
+        }catch (Exception e){
98
+            e.printStackTrace();
99
+            logger.error("taShareCountList -=- {}",e.toString());
100
+            responseBean.addError(e.getMessage());
101
+        }
102
+        return responseBean;
103
+    }
83 104
 }

+ 3
- 0
src/main/java/com/huiju/estateagents/mapper/TaShareMapper.java 查看文件

@@ -19,4 +19,7 @@ import java.util.List;
19 19
 @Mapper
20 20
 public interface TaShareMapper extends BaseMapper<TaShare> {
21 21
     List<TaShare> selectHouseShareList(Page page, @Param("orgId") Integer orgId, @Param("personType") String personType, @Param("shareType")String shareType, @Param("phone")String phone, @Param("saleBatchId")Integer saleBatchId);
22
+
23
+    List<TaShare> selectLiveShareList(Page page, @Param("orgId") Integer orgId, @Param("personType") String personType, @Param("shareType")String shareType, @Param("phone")String phone, @Param("saleBatchId")Integer saleBatchId);
24
+
22 25
 }

+ 2
- 0
src/main/java/com/huiju/estateagents/service/ITaShareService.java 查看文件

@@ -21,4 +21,6 @@ public interface ITaShareService extends IService<TaShare> {
21 21
     void makeSure(String openid, String typeOf, String id, Integer orgId);
22 22
 
23 23
     ResponseBean selectHouseShareList(Integer pageNum, Integer pageSize, Integer orgId, String personType, String shareType, String phone, Integer saleBatchId);
24
+
25
+    ResponseBean selectLiveShareList(Integer pageNum, Integer pageSize, Integer orgId, String personType, String shareType, String phone, Integer liveActivityId);
24 26
 }

+ 20
- 4
src/main/java/com/huiju/estateagents/service/impl/TaShareServiceImpl.java 查看文件

@@ -51,6 +51,9 @@ public class TaShareServiceImpl extends ServiceImpl<TaShareMapper, TaShare> impl
51 51
     @Autowired
52 52
     private TaSalesBatchMapper taSalesBatchMapper;
53 53
 
54
+    @Autowired
55
+    private TaLiveActivityMapper taLiveActivityMapper;
56
+
54 57
     @Resource
55 58
     private ApplicationContext applicationContext;
56 59
 
@@ -143,6 +146,19 @@ public class TaShareServiceImpl extends ServiceImpl<TaShareMapper, TaShare> impl
143 146
         return ResponseBean.success(result);
144 147
     }
145 148
 
149
+    @Override
150
+    public ResponseBean selectHouseShareList(Integer pageNum, Integer pageSize, Integer orgId, String personType, String shareType, String phone, Integer saleBatchId) {
151
+        Page page = new Page(pageNum,pageSize);
152
+        // 分页查询
153
+        List<TaShare> list = taShareMapper.selectHouseShareList(page, orgId, personType, shareType, phone, saleBatchId);
154
+        TaSalesBatch taSalesBatch = taSalesBatchMapper.selectById(saleBatchId);
155
+        list.forEach(e -> {
156
+            e.setSalesBatchName(taSalesBatch.getSalesBatchName());
157
+        });
158
+        page.setRecords(list);
159
+        return ResponseBean.success(page);
160
+    }
161
+
146 162
     @Override
147 163
     public void makeSure(String openid, String typeOf, String id, Integer orgId) {
148 164
         // 查找分享记录
@@ -186,13 +202,13 @@ public class TaShareServiceImpl extends ServiceImpl<TaShareMapper, TaShare> impl
186 202
     }
187 203
 
188 204
     @Override
189
-    public ResponseBean selectHouseShareList(Integer pageNum, Integer pageSize, Integer orgId, String personType, String shareType, String phone, Integer saleBatchId) {
205
+    public ResponseBean selectLiveShareList(Integer pageNum, Integer pageSize, Integer orgId, String personType, String shareType, String phone, Integer liveActivityId) {
190 206
         Page page = new Page(pageNum,pageSize);
191 207
         // 分页查询
192
-        List<TaShare> list = taShareMapper.selectHouseShareList(page, orgId, personType, shareType, phone, saleBatchId);
193
-        TaSalesBatch taSalesBatch = taSalesBatchMapper.selectById(saleBatchId);
208
+        List<TaShare> list = taShareMapper.selectLiveShareList(page, orgId, personType, shareType, phone, liveActivityId);
209
+        TaLiveActivity taLiveActivity = taLiveActivityMapper.selectById(liveActivityId);
194 210
         list.forEach(e -> {
195
-            e.setSalesBatchName(taSalesBatch.getSalesBatchName());
211
+            e.setSalesBatchName(taLiveActivity.getLiveActivityTitle());
196 212
         });
197 213
         page.setRecords(list);
198 214
         return ResponseBean.success(page);

+ 19
- 0
src/main/resources/mapper/TaShareMapper.xml 查看文件

@@ -20,4 +20,23 @@
20 20
       </if>
21 21
         order by t.create_date desc
22 22
     </select>
23
+
24
+    <select id="selectLiveShareList" resultType="com.huiju.estateagents.entity.TaShare">
25
+        select a.avatarurl as photoOravatar, a.nickname as nameOrnick, a.name, a.phone, a.person_type, t.tagert_type, t.create_date From ta_share_count t
26
+        left join ta_person a on t.person_id = a.person_id
27
+        left join td_live_dict b on t.be_share = b.live_activity_id
28
+        where a.org_id = #{orgId}
29
+        and t.tagert_type in ('livePost','liveApp')
30
+        and b.live_activity_id = #{liveActivityId}
31
+        <if test="personType != null and personType != ''">
32
+            and a.person_Type = #{personType}
33
+        </if>
34
+        <if test="shareType != null and shareType != ''">
35
+            and t.tagert_type = #{shareType}
36
+        </if>
37
+        <if test="phone != null and phone != ''">
38
+            and a.phone = #{phone}
39
+        </if>
40
+        order by t.create_date desc
41
+    </select>
23 42
 </mapper>