顾绍勇 5 gadus atpakaļ
vecāks
revīzija
d893dd4b61

+ 1
- 1
src/main/java/com/huiju/estateagents/common/CommConstant.java Parādīt failu

465
      * 审核通知  预选/认筹
465
      * 审核通知  预选/认筹
466
      * 必须存在表   td_miniapp_template_type 中
466
      * 必须存在表   td_miniapp_template_type 中
467
      */
467
      */
468
-    public static final String MESSAGE_CONTENT_OF_CHECK = "check-result";
468
+    public static final String MESSAGE_CONTENT_OF_HOUSE = "house";
469
     
469
     
470
     /**
470
     /**
471
      * 活动以结束
471
      * 活动以结束

+ 1
- 1
src/main/java/com/huiju/estateagents/controller/TaPersonVisitRecordController.java Parādīt failu

394
                     e.setHouseShareNum(shareNum);
394
                     e.setHouseShareNum(shareNum);
395
                     break;
395
                     break;
396
                 case CommConstant.LIVE:
396
                 case CommConstant.LIVE:
397
-                    e.setLiveSareNum(shareNum);
397
+                    e.setLiveShareNum(shareNum);
398
                     break;
398
                     break;
399
             }
399
             }
400
         });
400
         });

+ 1
- 1
src/main/java/com/huiju/estateagents/entity/TaConsultantInfo.java Parādīt failu

38
 
38
 
39
     private String priceType;
39
     private String priceType;
40
 
40
 
41
-    private Integer liveSareNum;
41
+    private Integer liveShareNum;
42
 }
42
 }

+ 11
- 0
src/main/java/com/huiju/estateagents/entity/TaLiveActivity.java Parādīt failu

146
 
146
 
147
     @TableField(exist = false)
147
     @TableField(exist = false)
148
     private String cityName;
148
     private String cityName;
149
+
150
+    @TableField(exist = false)
151
+    private String liveAppName;
152
+
153
+    @TableField(exist = false)
154
+    private String liveAppAppId;
155
+
156
+    @TableField(exist = false)
157
+    private String liveAppPath;
158
+
159
+
149
 }
160
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/service/IMiniAppService.java Parādīt failu

30
 
30
 
31
     void sendGroupMessage(TaPerson toUser, String link, String result, String activityName, LocalDateTime dt);
31
     void sendGroupMessage(TaPerson toUser, String link, String result, String activityName, LocalDateTime dt);
32
 
32
 
33
-    void sendCheckMessage(TaPerson toUser, String link, String name, String result, String programName, String failReason, String remark, LocalDateTime dt);
33
+    void sendCheckMessage(TaPerson toUser, String link, String name, String result, String programName, String failReason, String remark, LocalDateTime dt, Boolean isSuccess);
34
 
34
 
35
     ResponseBean getQrCode(String paramsStr, String appid);
35
     ResponseBean getQrCode(String paramsStr, String appid);
36
 
36
 

+ 9
- 9
src/main/java/com/huiju/estateagents/service/impl/MiniAppServiceImpl.java Parādīt failu

268
 
268
 
269
     @Override
269
     @Override
270
     public void sendCheckMessage(TaPerson toUser, String link, String name, String result, String programName,
270
     public void sendCheckMessage(TaPerson toUser, String link, String name, String result, String programName,
271
-                                 String failReason, String remark, LocalDateTime dt) {
271
+                                 String failReason, String remark, LocalDateTime dt, Boolean isSuccess) {
272
         TaMiniapp miniapp = taMiniappMapper.selectById(toUser.getMiniappId());
272
         TaMiniapp miniapp = taMiniappMapper.selectById(toUser.getMiniappId());
273
         if (null == miniapp) {
273
         if (null == miniapp) {
274
             log.error("小程序 {} 不存在", toUser.getMiniappId());
274
             log.error("小程序 {} 不存在", toUser.getMiniappId());
276
         }
276
         }
277
 
277
 
278
         // 消息内容类型
278
         // 消息内容类型
279
-        String contentType = CommConstant.MESSAGE_CONTENT_OF_CHECK;
279
+        String contentType = CommConstant.MESSAGE_CONTENT_OF_HOUSE;
280
         TaMiniappTemplate tpl = getTplByType(contentType, toUser.getMiniappId());
280
         TaMiniappTemplate tpl = getTplByType(contentType, toUser.getMiniappId());
281
         boolean isSubscribe = null != tpl && (null == tpl.getIsSubscribe() ? false : tpl.getIsSubscribe());
281
         boolean isSubscribe = null != tpl && (null == tpl.getIsSubscribe() ? false : tpl.getIsSubscribe());
282
         // 消息发送类型
282
         // 消息发送类型
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
 
285
 
286
-        String[] smsParams = {miniapp.getName() + "小程序-" + name};
286
+        String[] smsParams = {miniapp.getName() + "小程序-" + programName + name};
287
 
287
 
288
         if (null == tpl) {
288
         if (null == tpl) {
289
-            log.error("小程序 {} 无通知消息模板 {}", toUser.getMiniappId(), contentType);
290
-
291
-            // 短信发送
292
-            sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
289
+            if (isSuccess) {
290
+                log.error("小程序 {} 无通知消息模板 {}", toUser.getMiniappId(), contentType);
291
+                // 短信发送
292
+                sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
293
+            }
293
         } else {
294
         } else {
294
             if (isSubscribe) {
295
             if (isSubscribe) {
295
                 String[] data = new String[]{name, result, programName, remark, failReason, DateUtils.cutSecond(dt)};
296
                 String[] data = new String[]{name, result, programName, remark, failReason, DateUtils.cutSecond(dt)};
296
                 ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
297
                 ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
297
-                if (res.getCode() != ResponseBean.CODE_SUCCESS) {
298
+                if (res.getCode() != ResponseBean.CODE_SUCCESS && isSuccess) {
298
                     // 使用短信发送
299
                     // 使用短信发送
299
                     sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
300
                     sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
300
                     messageType = CommConstant.MESSAGE_TYPE_OF_SMS;
301
                     messageType = CommConstant.MESSAGE_TYPE_OF_SMS;
301
                 }
302
                 }
302
             } else {
303
             } else {
303
                 log.info("发送模板消息");
304
                 log.info("发送模板消息");
304
-
305
             }
305
             }
306
         }
306
         }
307
         // TODO 写消息发送日志
307
         // TODO 写消息发送日志

+ 22
- 6
src/main/java/com/huiju/estateagents/service/impl/TaLiveActivityServiceImpl.java Parādīt failu

9
 import com.huiju.estateagents.common.CommConstant;
9
 import com.huiju.estateagents.common.CommConstant;
10
 import com.huiju.estateagents.entity.*;
10
 import com.huiju.estateagents.entity.*;
11
 import com.huiju.estateagents.mapper.TaLiveActivityMapper;
11
 import com.huiju.estateagents.mapper.TaLiveActivityMapper;
12
+import com.huiju.estateagents.mapper.TdLiveDictMapper;
12
 import com.huiju.estateagents.service.*;
13
 import com.huiju.estateagents.service.*;
13
 import org.apache.commons.collections.CollectionUtils;
14
 import org.apache.commons.collections.CollectionUtils;
14
 import org.apache.commons.lang3.StringUtils;
15
 import org.apache.commons.lang3.StringUtils;
56
     @Autowired
57
     @Autowired
57
     private TdPosterTemplateServiceImpl posterTemplateService;
58
     private TdPosterTemplateServiceImpl posterTemplateService;
58
 
59
 
60
+    @Autowired
61
+    private TdLiveDictMapper tdLiveDictMapper;
62
+
59
 
63
 
60
     @Override
64
     @Override
61
     public ResponseBean taLiveActivityAdd(TaLiveActivity taLiveActivity) {
65
     public ResponseBean taLiveActivityAdd(TaLiveActivity taLiveActivity) {
102
 
106
 
103
     @Override
107
     @Override
104
     public IPage<TaLiveActivity> listLiveActivityByCondition(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle,
108
     public IPage<TaLiveActivity> listLiveActivityByCondition(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle,
105
-                                                    String cityId, String buildingId, Integer status) {
109
+                                                             String cityId, String buildingId, Integer status) {
106
         logger.info("TaLiveActivityServiceImpl.listLiveActivityByCondition 接收参数:pageNum:{},pageSize:{},orgId:{}," +
110
         logger.info("TaLiveActivityServiceImpl.listLiveActivityByCondition 接收参数:pageNum:{},pageSize:{},orgId:{}," +
107
                     "liveActivityTitle:{},cityId:{},buildingId:{},liveDetailType:{},status:{}", pageNum, pageSize,
111
                     "liveActivityTitle:{},cityId:{},buildingId:{},liveDetailType:{},status:{}", pageNum, pageSize,
108
                 liveActivityTitle, cityId, buildingId, status);
112
                 liveActivityTitle, cityId, buildingId, status);
124
     }
128
     }
125
 
129
 
126
     @Override
130
     @Override
127
-    public ResponseBean getLiveActivityDetailById(String id,Integer orgId) {
128
-        logger.info("getLiveActivityDetailById 接收参数:id:{},orgId:{}", id,orgId);
131
+    public ResponseBean getLiveActivityDetailById(String id, Integer orgId) {
132
+        logger.info("getLiveActivityDetailById 接收参数:id:{},orgId:{}", id, orgId);
129
 
133
 
130
         ResponseBean responseBean = new ResponseBean();
134
         ResponseBean responseBean = new ResponseBean();
131
         QueryWrapper<TaLiveActivity> liveActivityQueryWrapper = new QueryWrapper<>();
135
         QueryWrapper<TaLiveActivity> liveActivityQueryWrapper = new QueryWrapper<>();
132
-        liveActivityQueryWrapper.eq("live_activity_id",id);
133
-        liveActivityQueryWrapper.eq("org_id",orgId);
136
+        liveActivityQueryWrapper.eq("live_activity_id", id);
137
+        liveActivityQueryWrapper.eq("org_id", orgId);
134
         TaLiveActivity result = taLiveActivityMapper.selectOne(liveActivityQueryWrapper);
138
         TaLiveActivity result = taLiveActivityMapper.selectOne(liveActivityQueryWrapper);
135
         if (result == null) {
139
         if (result == null) {
136
             responseBean.addSuccess(null);
140
             responseBean.addSuccess(null);
137
             return responseBean;
141
             return responseBean;
138
         }
142
         }
139
 
143
 
144
+        // 获取直播小程序信息
145
+        QueryWrapper<TdLiveDict> tdLiveDictQueryWrapper = new QueryWrapper<>();
146
+        tdLiveDictQueryWrapper.eq("id", result.getLiveApp());
147
+        tdLiveDictQueryWrapper.eq("status", "1");
148
+        TdLiveDict tdLiveDict = tdLiveDictMapper.selectOne(tdLiveDictQueryWrapper);
149
+        if(tdLiveDict == null){
150
+            responseBean.addSuccess(null);
151
+            return responseBean;
152
+        }
153
+        result.setLiveAppName(tdLiveDict.getLivePlatName());
154
+        result.setLiveAppAppId(tdLiveDict.getLivePlatValue());
155
+
140
         // 获取海报信息
156
         // 获取海报信息
141
         QueryWrapper<TaPoster> queryWrapper = new QueryWrapper<>();
157
         QueryWrapper<TaPoster> queryWrapper = new QueryWrapper<>();
142
         queryWrapper.eq("target_id", id + "");
158
         queryWrapper.eq("target_id", id + "");
169
     @Override
185
     @Override
170
     public ResponseBean delLiveActivityList(Integer orgId, List<TaLiveActivity> liveActivityList) {
186
     public ResponseBean delLiveActivityList(Integer orgId, List<TaLiveActivity> liveActivityList) {
171
         ResponseBean responseBean = new ResponseBean();
187
         ResponseBean responseBean = new ResponseBean();
172
-        taLiveActivityMapper.updateLiveActivityStatus(orgId,liveActivityList);
188
+        taLiveActivityMapper.updateLiveActivityStatus(orgId, liveActivityList);
173
         return responseBean;
189
         return responseBean;
174
     }
190
     }
175
 }
191
 }

+ 17
- 15
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionRecordServiceImpl.java Parādīt failu

114
         TaPreselectionRecord record = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
114
         TaPreselectionRecord record = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
115
         if (record != null) {
115
         if (record != null) {
116
             tip = "已预选过此房源,请到选房记录中查看。";
116
             tip = "已预选过此房源,请到选房记录中查看。";
117
-            sendSubscribeMsg(houseId, personId, checkType, "失败", tip);
117
+            sendSubscribeMsg(houseId, personId, checkType, "失败", tip, false);
118
             responseBean.addError(tip);
118
             responseBean.addError(tip);
119
             return responseBean;
119
             return responseBean;
120
         }
120
         }
122
         TaHousingResourcesPO resourcesPO = taHousingResourcesMapper.getHousingDetailById(taPreselectionRecord.getHouseId(), "0");
122
         TaHousingResourcesPO resourcesPO = taHousingResourcesMapper.getHousingDetailById(taPreselectionRecord.getHouseId(), "0");
123
         if (resourcesPO == null) {
123
         if (resourcesPO == null) {
124
             tip = "未知原因失败,请联系置业顾问。";
124
             tip = "未知原因失败,请联系置业顾问。";
125
-            sendSubscribeMsg(houseId, personId, checkType, "失败", tip);
125
+            sendSubscribeMsg(houseId, personId, checkType, "失败", tip, false);
126
             responseBean.addError(tip);
126
             responseBean.addError(tip);
127
             return responseBean;
127
             return responseBean;
128
         }
128
         }
130
         // 校验当前批次状态是否为已发布
130
         // 校验当前批次状态是否为已发布
131
         if (resourcesPO.getSaleBatchStatus() != 1) {
131
         if (resourcesPO.getSaleBatchStatus() != 1) {
132
             tip = "当前销售批次已临时取消发布,请稍后再试或联系置业顾问了解详情。";
132
             tip = "当前销售批次已临时取消发布,请稍后再试或联系置业顾问了解详情。";
133
-            sendSubscribeMsg(houseId, personId, checkType, "失败", tip);
133
+            sendSubscribeMsg(houseId, personId, checkType, "失败", tip, false);
134
             responseBean.addError(tip);
134
             responseBean.addError(tip);
135
             return responseBean;
135
             return responseBean;
136
         }
136
         }
138
         // 校验当前房源状态是否为已发布
138
         // 校验当前房源状态是否为已发布
139
         if (1 != resourcesPO.getStatus()) {
139
         if (1 != resourcesPO.getStatus()) {
140
             tip = "当前房源已临时取消发布,请稍后再试或联系置业顾问了解详情。";
140
             tip = "当前房源已临时取消发布,请稍后再试或联系置业顾问了解详情。";
141
-            sendSubscribeMsg(houseId, personId, checkType, "失败", tip);
141
+            sendSubscribeMsg(houseId, personId, checkType, "失败", tip, false);
142
             responseBean.addError(tip);
142
             responseBean.addError(tip);
143
             return responseBean;
143
             return responseBean;
144
         }
144
         }
146
         // 校验预选操作时间是否在规定范围内
146
         // 校验预选操作时间是否在规定范围内
147
         if (!DateUtils.checkTimeRange(resourcesPO.getPreselectionStartTime(), resourcesPO.getPreselectionEndTime(), null)) {
147
         if (!DateUtils.checkTimeRange(resourcesPO.getPreselectionStartTime(), resourcesPO.getPreselectionEndTime(), null)) {
148
             tip = "当前时间不在预选时间范围内,请联系置业顾问了解详情。";
148
             tip = "当前时间不在预选时间范围内,请联系置业顾问了解详情。";
149
-            sendSubscribeMsg(houseId, personId, checkType, "失败", tip);
149
+            sendSubscribeMsg(houseId, personId, checkType, "失败", tip, false);
150
             responseBean.addError(tip);
150
             responseBean.addError(tip);
151
             return responseBean;
151
             return responseBean;
152
         }
152
         }
160
         // 更新房源表热度
160
         // 更新房源表热度
161
         Boolean result = taHousingResourcesMapper.updateForAddHeat(taPreselectionRecord.getHouseId());
161
         Boolean result = taHousingResourcesMapper.updateForAddHeat(taPreselectionRecord.getHouseId());
162
         if (result) {
162
         if (result) {
163
-            sendSubscribeMsg(houseId, personId, checkType, "成功", "");
163
+            sendSubscribeMsg(houseId, personId, checkType, "成功", "", true);
164
             responseBean.addSuccess(taPreselectionRecord);
164
             responseBean.addSuccess(taPreselectionRecord);
165
             return responseBean;
165
             return responseBean;
166
         }
166
         }
167
         tip = "未知原因失败,请联系置业顾问。";
167
         tip = "未知原因失败,请联系置业顾问。";
168
-        sendSubscribeMsg(houseId, personId, checkType, "失败", tip);
168
+        sendSubscribeMsg(houseId, personId, checkType, "失败", tip, false);
169
         responseBean.addError(tip);
169
         responseBean.addError(tip);
170
         return responseBean;
170
         return responseBean;
171
     }
171
     }
183
         TaPreselectionRecord preselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
183
         TaPreselectionRecord preselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
184
         if (preselectionRecord == null) {
184
         if (preselectionRecord == null) {
185
             tip = "未预选过此房源,或已取消预选此房源";
185
             tip = "未预选过此房源,或已取消预选此房源";
186
-            sendSubscribeMsg(houseId,personId,checkType,"失败",tip);
186
+            sendSubscribeMsg(houseId, personId, checkType, "失败", tip, false);
187
             responseBean.addError(tip);
187
             responseBean.addError(tip);
188
             return responseBean;
188
             return responseBean;
189
         }
189
         }
191
         TaHousingResourcesPO resourcesPO = taHousingResourcesMapper.getHousingDetailById(houseId, "0");
191
         TaHousingResourcesPO resourcesPO = taHousingResourcesMapper.getHousingDetailById(houseId, "0");
192
         if (resourcesPO == null || 1 != resourcesPO.getStatus()) {
192
         if (resourcesPO == null || 1 != resourcesPO.getStatus()) {
193
             tip = "当前房源已临时取消发布,请稍后再试或联系置业顾问了解详情。";
193
             tip = "当前房源已临时取消发布,请稍后再试或联系置业顾问了解详情。";
194
-            sendSubscribeMsg(houseId,personId,checkType,"失败",tip);
194
+            sendSubscribeMsg(houseId, personId, checkType, "失败", tip, false);
195
             responseBean.addError(tip);
195
             responseBean.addError(tip);
196
             return responseBean;
196
             return responseBean;
197
         }
197
         }
199
         // 校验当前批次状态是否为已发布
199
         // 校验当前批次状态是否为已发布
200
         if (resourcesPO.getSaleBatchStatus() != 1) {
200
         if (resourcesPO.getSaleBatchStatus() != 1) {
201
             tip = "当前销售批次已临时取消发布,请稍后再试或联系置业顾问了解详情。";
201
             tip = "当前销售批次已临时取消发布,请稍后再试或联系置业顾问了解详情。";
202
-            sendSubscribeMsg(houseId,personId,checkType,"失败",tip);
202
+            sendSubscribeMsg(houseId, personId, checkType, "失败", tip, false);
203
             responseBean.addError(tip);
203
             responseBean.addError(tip);
204
             return responseBean;
204
             return responseBean;
205
         }
205
         }
215
         Boolean result = taHousingResourcesMapper.updateForSubtractHeat(houseId);
215
         Boolean result = taHousingResourcesMapper.updateForSubtractHeat(houseId);
216
         if (result) {
216
         if (result) {
217
             responseBean.addSuccess(result);
217
             responseBean.addSuccess(result);
218
+            sendSubscribeMsg(houseId, personId, checkType, "成功", "无", true);
218
             return responseBean;
219
             return responseBean;
219
         }
220
         }
220
         tip = "未知原因失败,请联系置业顾问。";
221
         tip = "未知原因失败,请联系置业顾问。";
221
-        sendSubscribeMsg(houseId,personId,checkType,"失败",tip);
222
+        sendSubscribeMsg(houseId, personId, checkType, "失败", tip, false);
222
         responseBean.addError(tip);
223
         responseBean.addError(tip);
223
         return responseBean;
224
         return responseBean;
224
     }
225
     }
240
      * @param checkType  审核类型
241
      * @param checkType  审核类型
241
      * @param result     审核结果
242
      * @param result     审核结果
242
      * @param failReason 失败原因
243
      * @param failReason 失败原因
244
+     * @param isSuccess  是否成功 true是(只有成功才发送短信)
243
      */
245
      */
244
-    public void sendSubscribeMsg(String houseId, String personId, String checkType, String result, String failReason) {
246
+    public void sendSubscribeMsg(String houseId, String personId, String checkType, String result, String failReason, Boolean isSuccess) {
245
         logger.info("sendSubscribeMsg 接收参数:houseId:{},checkType:{},result:{},failReason:{}",
247
         logger.info("sendSubscribeMsg 接收参数:houseId:{},checkType:{},result:{},failReason:{}",
246
                 houseId, checkType, result, failReason);
248
                 houseId, checkType, result, failReason);
247
 
249
 
263
             }
265
             }
264
 
266
 
265
             String link = "";
267
             String link = "";
266
-            String remark = "";
267
-            String progranName = po.getBuildingName() + po.getTermName() + po.getBlockName() + po.getUnitName() + po.getFloorName() + po.getRoomName();
268
-            miniAppService.sendCheckMessage(toUser, link, checkType, result, progranName, failReason, remark, LocalDateTime.now());
268
+            String progranName = (po.getBuildingName() + po.getTermName() + po.getBlockName() + po.getUnitName() + po.getFloorName() + po.getRoomName()).replace("null", "");
269
+            String remark = progranName;
270
+            miniAppService.sendCheckMessage(toUser, link, checkType, result, progranName, failReason, remark, LocalDateTime.now(), isSuccess);
269
             logger.info("sendSubscribeMsg 结束");
271
             logger.info("sendSubscribeMsg 结束");
270
         });
272
         });
271
     }
273
     }

+ 1
- 1
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Parādīt failu

366
 						'2' AS building_name,
366
 						'2' AS building_name,
367
 						'3' AS address,
367
 						'3' AS address,
368
 						1 AS building_type_id,
368
 						1 AS building_type_id,
369
-						LEFT ( t.tagert_type, 5 ) AS eventType,
369
+						LEFT ( t.tagert_type, 4 ) AS eventType,
370
 						t.create_date AS visit_time
370
 						t.create_date AS visit_time
371
 					FROM
371
 					FROM
372
 						ta_share t
372
 						ta_share t