|
@@ -14,9 +14,11 @@ import com.huiju.estateagents.center.taUser.service.impl.TaUserServiceImpl;
|
14
|
14
|
import com.huiju.estateagents.common.CommConstant;
|
15
|
15
|
import com.huiju.estateagents.entity.*;
|
16
|
16
|
import com.huiju.estateagents.mapper.*;
|
|
17
|
+import com.huiju.estateagents.po.TaHousingResourcesPO;
|
17
|
18
|
import com.huiju.estateagents.service.ITaRaiseRecordService;
|
18
|
19
|
import com.huiju.estateagents.service.ITaUvService;
|
19
|
20
|
import jodd.util.StringUtil;
|
|
21
|
+import org.apache.commons.lang3.StringUtils;
|
20
|
22
|
import org.slf4j.Logger;
|
21
|
23
|
import org.slf4j.LoggerFactory;
|
22
|
24
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -24,6 +26,8 @@ import org.springframework.stereotype.Service;
|
24
|
26
|
|
25
|
27
|
import java.time.LocalDateTime;
|
26
|
28
|
import java.util.List;
|
|
29
|
+import java.util.concurrent.ExecutorService;
|
|
30
|
+import java.util.concurrent.Executors;
|
27
|
31
|
|
28
|
32
|
/**
|
29
|
33
|
* <p>
|
|
@@ -59,6 +63,15 @@ public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, T
|
59
|
63
|
@Autowired
|
60
|
64
|
private TaUserServiceImpl taUserService;
|
61
|
65
|
|
|
66
|
+ @Autowired
|
|
67
|
+ private MiniAppServiceImpl miniAppService;
|
|
68
|
+
|
|
69
|
+ @Autowired
|
|
70
|
+ private TaPersonServiceImpl taPersonService;
|
|
71
|
+
|
|
72
|
+ @Autowired
|
|
73
|
+ private TaBuildingMapper taBuildingMapper;
|
|
74
|
+
|
62
|
75
|
@Override
|
63
|
76
|
public ResponseBean listHousingRaiseByCondition(HousingRaiseRequestBO requestBO, Integer pageNumber, Integer pageSize) {
|
64
|
77
|
logger.info("TaRaiseRecordServiceImpl.listRaiseRecordByCondition 接收参数:bo:{},pageNumber:{},pageSize:{}", JSONObject.toJSONString(requestBO), pageNumber, pageSize);
|
|
@@ -238,4 +251,43 @@ public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, T
|
238
|
251
|
taHousingResources.setHouseLockingStatus(CommConstant.HOUSE_LOCKING_STATUS_LOCKED);
|
239
|
252
|
taHousingResourcesMapper.updateById(taHousingResources);
|
240
|
253
|
}
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+ /**
|
|
257
|
+ * 发送认筹订阅消息
|
|
258
|
+ *
|
|
259
|
+ * @param raiseRecordId 认筹单ID
|
|
260
|
+ * @param personId 用户ID
|
|
261
|
+ * @param title 审核类型
|
|
262
|
+ * @param result 审核结果
|
|
263
|
+ * @param failReason 失败原因
|
|
264
|
+ * @param isSuccess 是否成功 true是(只有成功才发送短信)
|
|
265
|
+ */
|
|
266
|
+ public void sendRaiseMsg(Integer raiseRecordId, String personId, String title, String result, String failReason,String remark, Boolean isSuccess) {
|
|
267
|
+ logger.info("sendSubscribeMsg 接收参数:houseId:{},checkType:{},result:{},failReason:{}",
|
|
268
|
+ raiseRecordId, title, result, failReason);
|
|
269
|
+
|
|
270
|
+ ExecutorService threadPool = Executors.newCachedThreadPool();
|
|
271
|
+ threadPool.execute(() -> {
|
|
272
|
+ logger.info("sendSubscribeMsg 开始");
|
|
273
|
+
|
|
274
|
+ // 获取房源详情
|
|
275
|
+ TaRaiseRecord taRaiseRecord = taRaiseRecordMapper.selectById(raiseRecordId);
|
|
276
|
+ if (null == taRaiseRecord) {
|
|
277
|
+ logger.info("sendSubscribeMsg 未找到认筹单。");
|
|
278
|
+ return;
|
|
279
|
+ }
|
|
280
|
+ TaBuilding taBuilding = taBuildingMapper.selectById(taRaiseRecord.getBuildingId());
|
|
281
|
+ // 获取用户信息
|
|
282
|
+ TaPerson toUser = taPersonService.getById(personId);
|
|
283
|
+ if (toUser == null) {
|
|
284
|
+ return;
|
|
285
|
+ }
|
|
286
|
+
|
|
287
|
+ String link = String.format(CommConstant.RAISE_DETAIL_PATH, raiseRecordId);
|
|
288
|
+
|
|
289
|
+ miniAppService.sendCheckMessage(toUser, link, title, result, taBuilding.getBuildingName(), failReason, remark, LocalDateTime.now(), isSuccess);
|
|
290
|
+ logger.info("sendSubscribeMsg 结束");
|
|
291
|
+ });
|
|
292
|
+ }
|
241
|
293
|
}
|