瀏覽代碼

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents into dev

傅行帆 5 年之前
父節點
當前提交
32bf2ef12b

+ 6
- 18
src/main/java/com/huiju/estateagents/controller/TaLiveActivityController.java 查看文件

1
 package com.huiju.estateagents.controller;
1
 package com.huiju.estateagents.controller;
2
 
2
 
3
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
-import com.baomidou.mybatisplus.extension.api.R;
6
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.huiju.estateagents.base.BaseController;
4
 import com.huiju.estateagents.base.BaseController;
8
 import com.huiju.estateagents.base.ResponseBean;
5
 import com.huiju.estateagents.base.ResponseBean;
9
-import com.huiju.estateagents.common.CommConstant;
10
 import com.huiju.estateagents.entity.TaLiveActivity;
6
 import com.huiju.estateagents.entity.TaLiveActivity;
11
 import com.huiju.estateagents.service.ITaLiveActivityService;
7
 import com.huiju.estateagents.service.ITaLiveActivityService;
12
 import org.slf4j.Logger;
8
 import org.slf4j.Logger;
15
 import org.springframework.web.bind.annotation.*;
11
 import org.springframework.web.bind.annotation.*;
16
 
12
 
17
 import javax.servlet.http.HttpServletRequest;
13
 import javax.servlet.http.HttpServletRequest;
18
-import java.time.LocalDateTime;
14
+import java.util.List;
19
 
15
 
20
 /**
16
 /**
21
  * <p>
17
  * <p>
93
      * @param id 实体ID
89
      * @param id 实体ID
94
      */
90
      */
95
     @ResponseBody
91
     @ResponseBody
96
-    @RequestMapping(value = "/taLiveActivity/{id}", method = RequestMethod.DELETE)
97
-    public ResponseBean taLiveActivityDelete(@PathVariable Integer id) {
92
+    @RequestMapping(value = "/taLiveActivity", method = RequestMethod.DELETE)
93
+    public ResponseBean taLiveActivityDelete(@RequestBody List<TaLiveActivity> taLiveActivity, HttpServletRequest request) {
98
         ResponseBean responseBean = new ResponseBean();
94
         ResponseBean responseBean = new ResponseBean();
99
         try {
95
         try {
100
-            TaLiveActivity taLiveActivity = new TaLiveActivity();
101
-            taLiveActivity.setLiveActivityId(id);
102
-            taLiveActivity.setStatus(CommConstant.STATUS_UNACCALIMED);
103
-            taLiveActivity.setUpdateDate(LocalDateTime.now());
104
-
105
-            if (iTaLiveActivityService.updateById(taLiveActivity)) {
106
-                responseBean.addSuccess("success");
107
-            } else {
108
-                responseBean.addError("fail");
109
-            }
96
+            responseBean = iTaLiveActivityService.delLiveActivityList(getOrgId(request), taLiveActivity);
110
         } catch (Exception e) {
97
         } catch (Exception e) {
111
             e.printStackTrace();
98
             e.printStackTrace();
112
             logger.error("taLiveActivityDelete -=- {}", e.toString());
99
             logger.error("taLiveActivityDelete -=- {}", e.toString());
127
                                              @RequestBody TaLiveActivity taLiveActivity) {
114
                                              @RequestBody TaLiveActivity taLiveActivity) {
128
         ResponseBean responseBean = new ResponseBean();
115
         ResponseBean responseBean = new ResponseBean();
129
         try {
116
         try {
117
+            taLiveActivity.setLiveActivityId(id);
130
             if (iTaLiveActivityService.updateById(taLiveActivity)) {
118
             if (iTaLiveActivityService.updateById(taLiveActivity)) {
131
                 responseBean.addSuccess(taLiveActivity);
119
                 responseBean.addSuccess(taLiveActivity);
132
             } else {
120
             } else {
145
      *
133
      *
146
      * @param id 实体ID
134
      * @param id 实体ID
147
      */
135
      */
148
-    @RequestMapping(value = "/taLiveActivity/{id}", method = RequestMethod.GET)
136
+    @RequestMapping(value = "/admin/taLiveActivity/{id}", method = RequestMethod.GET)
149
     public ResponseBean taLiveActivityGet(@PathVariable Integer id) {
137
     public ResponseBean taLiveActivityGet(@PathVariable Integer id) {
150
         ResponseBean responseBean = new ResponseBean();
138
         ResponseBean responseBean = new ResponseBean();
151
         try {
139
         try {

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

114
         return responseBean;
114
         return responseBean;
115
     }
115
     }
116
 
116
 
117
+    /**
118
+     * 根据id查询对象
119
+     */
120
+    @RequestMapping(value="api/admin/taLiveVisit",method= RequestMethod.GET)
121
+    public ResponseBean taLiveActivityVisit(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
122
+                                               @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
123
+                                               @RequestParam(value = "sceneType", required = false)String sceneType,
124
+                                               @RequestParam(value = "personType", required = false)String personType,
125
+                                               @RequestParam(value = "phone", required = false)String phone,
126
+                                               @RequestParam(value = "liveActivityId")String liveActivityId, HttpServletRequest request){
127
+        ResponseBean responseBean = new ResponseBean();
128
+        try {
129
+            if (liveActivityId == null){
130
+                return ResponseBean.success("");
131
+            }
132
+            responseBean = iTaSharePersonFromService.selectLiveActivityVisitList(pageNum, pageSize, getOrgId(request), personType, sceneType, phone, liveActivityId);
133
+        }catch (Exception e){
134
+            e.printStackTrace();
135
+            logger.error("taShareCountList -=- {}",e.toString());
136
+            responseBean.addError(e.getMessage());
137
+        }
138
+        return responseBean;
139
+    }
140
+
117
     /**
141
     /**
118
      * 修改对象
142
      * 修改对象
119
      * @param id  实体ID
143
      * @param id  实体ID

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

92
 
92
 
93
     @TableField(exist = false)
93
     @TableField(exist = false)
94
     private String salesBatchName;
94
     private String salesBatchName;
95
+
96
+    @TableField(exist = false)
97
+    private String liveActivityTitle;
95
 }
98
 }

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

7
 import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.Param;
8
 import org.springframework.stereotype.Component;
8
 import org.springframework.stereotype.Component;
9
 
9
 
10
+import java.util.List;
11
+
10
 /**
12
 /**
11
  * <p>
13
  * <p>
12
  * Mapper 接口
14
  * Mapper 接口
28
     Boolean addVisitNum(@Param("id") String id);
30
     Boolean addVisitNum(@Param("id") String id);
29
 
31
 
30
     IPage<TaLiveActivity> selectLiveListByCondition(IPage<TaLiveActivity> pg, @Param("liveActivityTitle") String liveActivityTitle, @Param("cityId") String cityId, @Param("buildingId") String buildingId, @Param("status") Integer status, @Param("orgId")Integer orgId);
32
     IPage<TaLiveActivity> selectLiveListByCondition(IPage<TaLiveActivity> pg, @Param("liveActivityTitle") String liveActivityTitle, @Param("cityId") String cityId, @Param("buildingId") String buildingId, @Param("status") Integer status, @Param("orgId")Integer orgId);
33
+    /**
34
+     * 批量更新直播活动状态
35
+     *
36
+     * @param orgId
37
+     * @param taLiveActivityList
38
+     */
39
+    void updateLiveActivityStatus(@Param("orgId") Integer orgId, @Param("taLiveActivityList") List<TaLiveActivity> taLiveActivityList);
40
+
41
+
31
 }
42
 }

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

19
 @Mapper
19
 @Mapper
20
 public interface TaSharePersonFromMapper extends BaseMapper<TaSharePersonFrom> {
20
 public interface TaSharePersonFromMapper extends BaseMapper<TaSharePersonFrom> {
21
     Integer countViewNum(@Param("userId") Integer userId, @Param("orgId")Integer orgId, @Param("personId")String personId, @Param("startCreateDate") String startCreateDate, @Param("endCreateDate") String endCreateDate);
21
     Integer countViewNum(@Param("userId") Integer userId, @Param("orgId")Integer orgId, @Param("personId")String personId, @Param("startCreateDate") String startCreateDate, @Param("endCreateDate") String endCreateDate);
22
+
23
+    /**
24
+     * 查询房源访问记录
25
+     * @param page
26
+     * @param orgId
27
+     * @param personType
28
+     * @param sceneType
29
+     * @param phone
30
+     * @param saleBatchId
31
+     * @return
32
+     */
22
     List<TaSharePersonFrom> selectHouseVisitList(Page page, @Param("orgId") Integer orgId, @Param("personType") String personType, @Param("sceneType")String sceneType, @Param("phone")String phone, @Param("saleBatchId")String saleBatchId);
33
     List<TaSharePersonFrom> selectHouseVisitList(Page page, @Param("orgId") Integer orgId, @Param("personType") String personType, @Param("sceneType")String sceneType, @Param("phone")String phone, @Param("saleBatchId")String saleBatchId);
34
+
35
+    /**
36
+     * 查询直播活动访问记录
37
+     * @param page
38
+     * @param orgId
39
+     * @param personType
40
+     * @param sceneType
41
+     * @param phone
42
+     * @param liveActivityId
43
+     * @return
44
+     */
45
+    List<TaSharePersonFrom> selectLiveActivityVisitList(Page page, @Param("orgId") Integer orgId, @Param("personType") String personType, @Param("sceneType")String sceneType, @Param("phone")String phone, @Param("liveActivityId")String liveActivityId);
46
+
23
 }
47
 }

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

5
 import com.huiju.estateagents.base.ResponseBean;
5
 import com.huiju.estateagents.base.ResponseBean;
6
 import com.huiju.estateagents.entity.TaLiveActivity;
6
 import com.huiju.estateagents.entity.TaLiveActivity;
7
 
7
 
8
+import java.util.List;
9
+
8
 /**
10
 /**
9
  * <p>
11
  * <p>
10
  * 服务类
12
  * 服务类
54
      * @return
56
      * @return
55
      */
57
      */
56
     ResponseBean getLiveActivityDetailById(String id);
58
     ResponseBean getLiveActivityDetailById(String id);
59
+
60
+    ResponseBean delLiveActivityList(Integer orgId, List<TaLiveActivity> liveActivityList);
57
 }
61
 }

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

26
     TaSharePersonFrom addSharePersonRecord(String personId, Integer orgId, String from, String recommender, String targetId);
26
     TaSharePersonFrom addSharePersonRecord(String personId, Integer orgId, String from, String recommender, String targetId);
27
 
27
 
28
     ResponseBean selectHouseVisitList(Integer pageNum, Integer pageSize, Integer orgId, String personType, String sceneType, String phone, String saleBatchId);
28
     ResponseBean selectHouseVisitList(Integer pageNum, Integer pageSize, Integer orgId, String personType, String sceneType, String phone, String saleBatchId);
29
+
30
+    ResponseBean selectLiveActivityVisitList(Integer pageNum, Integer pageSize, Integer orgId, String personType, String sceneType, String phone, String liveActivityId);
29
 }
31
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/MiniAppServiceImpl.java 查看文件

283
         String messageType = null == tpl ? CommConstant.MESSAGE_TYPE_OF_SMS :
283
         String messageType = null == tpl ? CommConstant.MESSAGE_TYPE_OF_SMS :
284
                 isSubscribe ? CommConstant.MESSAGE_TYPE_OF_MINIAPP_SUBSCRIBE : CommConstant.MESSAGE_TYPE_OF_MINIAPP_TEMPLATE;
284
                 isSubscribe ? CommConstant.MESSAGE_TYPE_OF_MINIAPP_SUBSCRIBE : CommConstant.MESSAGE_TYPE_OF_MINIAPP_TEMPLATE;
285
         if (isSubscribe) {
285
         if (isSubscribe) {
286
-            String[] data = new String[]{name, result, programName, failReason, DateUtils.cutSecond(dt)};
286
+            String[] data = new String[]{name, result, programName, remark, failReason, DateUtils.cutSecond(dt)};
287
             sendSubscribeMessage(tpl, toUser, link, data);
287
             sendSubscribeMessage(tpl, toUser, link, data);
288
         }
288
         }
289
 
289
 

+ 7
- 0
src/main/java/com/huiju/estateagents/service/impl/TaLiveActivityServiceImpl.java 查看文件

162
         responseBean.addSuccess(result);
162
         responseBean.addSuccess(result);
163
         return responseBean;
163
         return responseBean;
164
     }
164
     }
165
+
166
+    @Override
167
+    public ResponseBean delLiveActivityList(Integer orgId, List<TaLiveActivity> liveActivityList) {
168
+        ResponseBean responseBean = new ResponseBean();
169
+        taLiveActivityMapper.updateLiveActivityStatus(orgId,liveActivityList);
170
+        return responseBean;
171
+    }
165
 }
172
 }

+ 16
- 0
src/main/java/com/huiju/estateagents/service/impl/TaSharePersonFromServiceImpl.java 查看文件

43
     @Autowired
43
     @Autowired
44
     private  TaSalesBatchMapper taSalesBatchMapper;
44
     private  TaSalesBatchMapper taSalesBatchMapper;
45
 
45
 
46
+    @Autowired
47
+    private TaLiveActivityMapper taLiveActivityMapper;
48
+
46
     /**
49
     /**
47
      * 添加客户分享记录
50
      * 添加客户分享记录
48
      *
51
      *
118
         page.setRecords(list);
121
         page.setRecords(list);
119
         return ResponseBean.success(page);
122
         return ResponseBean.success(page);
120
     }
123
     }
124
+
125
+    @Override
126
+    public ResponseBean selectLiveActivityVisitList(Integer pageNum, Integer pageSize, Integer orgId, String personType, String sceneType, String phone, String liveActivityId) {
127
+        Page page = new Page(pageNum,pageSize);
128
+        // 分页查询
129
+        List<TaSharePersonFrom> list = taSharePersonFromMapper.selectLiveActivityVisitList(page, orgId, personType, sceneType, phone, liveActivityId);
130
+        TaLiveActivity taLiveActivity = taLiveActivityMapper.selectById(liveActivityId);
131
+        list.forEach(e -> {
132
+            e.setLiveActivityTitle(taLiveActivity.getLiveActivityTitle());
133
+        });
134
+        page.setRecords(list);
135
+        return ResponseBean.success(page);
136
+    }
121
 }
137
 }

+ 12
- 0
src/main/resources/mapper/TaLiveActivityMapper.xml 查看文件

9
             t.live_activity_id = #{id}
9
             t.live_activity_id = #{id}
10
     </update>
10
     </update>
11
 
11
 
12
+    <update id ="updateLiveActivityStatus" >
13
+        UPDATE ta_live_activity t
14
+            SET t.`status` = 0,
15
+        t.update_date = CURRENT_TIME
16
+        WHERE
17
+        t.org_id = #{orgId}
18
+	    AND t.live_activity_id in
19
+        <foreach collection="taLiveActivityList" item="taLiveActivity" open="(" close=")" separator=",">
20
+            #{taLiveActivity.liveActivityId}
21
+        </foreach>
22
+    </update>
23
+
12
     <select id="selectLiveListByCondition" resultType="com.huiju.estateagents.entity.TaLiveActivity">
24
     <select id="selectLiveListByCondition" resultType="com.huiju.estateagents.entity.TaLiveActivity">
13
      select a.building_name,b.name as city_name, t.* From ta_live_activity t
25
      select a.building_name,b.name as city_name, t.* From ta_live_activity t
14
      left join ta_building a on t.building_id = a.building_id
26
      left join ta_building a on t.building_id = a.building_id

+ 20
- 0
src/main/resources/mapper/TaSharePersonFromMapper.xml 查看文件

54
         GROUP BY t.target_id,t.target_type,t.person_id,t.share_person
54
         GROUP BY t.target_id,t.target_type,t.person_id,t.share_person
55
         order by t.create_date desc
55
         order by t.create_date desc
56
     </select>
56
     </select>
57
+
58
+    <select id="selectLiveActivityVisitList" resultType="com.huiju.estateagents.entity.TaSharePersonFrom">
59
+        select c.avatarurl as photoOravatar, c.nickname as nameOrnick, c.name, c.phone, c.person_type as sharePersonType, t.create_date
60
+        From ta_share_person_from t
61
+        LEFT JOIN ta_person_from_record a on t.person_id = a.person_id
62
+        left join ta_person c on t.person_id = c.person_id
63
+        left join ta_live_activity d on d.live_activity_id = t.target_id
64
+        where a.org_id = #{orgId}
65
+        and t.target_type = 'live_share'
66
+        and t.target_id = #{liveActivityId}
67
+        <if test="personType != null and personType != ''">
68
+            and c.person_Type = #{personType}
69
+        </if>
70
+        <if test="phone != null and phone != ''">
71
+            and c.phone = #{phone}
72
+        </if>
73
+        and t.share_person != t.person_id
74
+        GROUP BY t.target_id,t.target_type,t.person_id,t.share_person
75
+        order by t.create_date desc
76
+    </select>
57
 </mapper>
77
 </mapper>