|
@@ -276,12 +276,72 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
276
|
276
|
if (null == taRaise) {
|
277
|
277
|
resourcesPO.setRaiseBtn(false);
|
278
|
278
|
} else {
|
|
279
|
+ //有认筹表的情况下判断是否认筹过这个房源
|
|
280
|
+ boolean raiseBtnStatus = checkRaiseBtn(taRaise,salesBatchId,personId,houseId,orgId);
|
279
|
281
|
resourcesPO.setTaRaise(taRaise);
|
280
|
282
|
}
|
281
|
283
|
|
282
|
284
|
return resourcesPO;
|
283
|
285
|
}
|
284
|
286
|
|
|
287
|
+ /**
|
|
288
|
+ * 校验认筹状态的按钮
|
|
289
|
+ * @param taRaise
|
|
290
|
+ * @param salesBatchId
|
|
291
|
+ * @param personId
|
|
292
|
+ * @param houseId
|
|
293
|
+ * @param orgId
|
|
294
|
+ * @return
|
|
295
|
+ */
|
|
296
|
+ private boolean checkRaiseBtn(TaRaise taRaise, Integer salesBatchId, String personId, Integer houseId, Integer orgId) {
|
|
297
|
+ if (taRaise.getStatus() != CommConstant.STATUS_NORMAL){
|
|
298
|
+ return false;
|
|
299
|
+ }
|
|
300
|
+ if (taRaise.getNeedPreselection()){
|
|
301
|
+ //查看是否有当前房源的预选记录
|
|
302
|
+ QueryWrapper<TaPreselectionRecord> preselectionRecordQueryWrapper = new QueryWrapper<>();
|
|
303
|
+ preselectionRecordQueryWrapper.eq("sales_batch_id",salesBatchId);
|
|
304
|
+ preselectionRecordQueryWrapper.eq("building_id",taRaise.getBuildingId());
|
|
305
|
+ preselectionRecordQueryWrapper.eq("org_id",orgId);
|
|
306
|
+ preselectionRecordQueryWrapper.eq("house_id",houseId);
|
|
307
|
+ preselectionRecordQueryWrapper.eq("person_id",personId);
|
|
308
|
+ TaPreselectionRecord taPreselectionRecord = taPreselectionRecordMapper.selectOne(preselectionRecordQueryWrapper);
|
|
309
|
+ if (null == taPreselectionRecord){
|
|
310
|
+ return false;
|
|
311
|
+ }
|
|
312
|
+ }
|
|
313
|
+ //判断是否在时间之内
|
|
314
|
+ LocalDateTime raiseStartTime = taRaise.getRaiseStartTime();
|
|
315
|
+ LocalDateTime raiseEndTime = taRaise.getRaiseEndTime();
|
|
316
|
+ LocalDateTime now = LocalDateTime.now();
|
|
317
|
+ if (now.isBefore(raiseStartTime) || now.isAfter(raiseEndTime)){
|
|
318
|
+ return false;
|
|
319
|
+ }
|
|
320
|
+ //销售批次校验
|
|
321
|
+ TaSalesBatch taSalesBatch = taSalesBatchMapper.selectById(salesBatchId);
|
|
322
|
+ if (taSalesBatch.getStatus() != CommConstant.STATUS_NORMAL){
|
|
323
|
+ return false;
|
|
324
|
+ }
|
|
325
|
+
|
|
326
|
+ //房源信息
|
|
327
|
+ TaHousingResources taHousingResources = taHousingResourcesMapper.selectById(houseId);
|
|
328
|
+ if (taHousingResources.getStatus() != CommConstant.STATUS_NORMAL || CommConstant.HOUSE_LOCKING_STATUS_LOCKED.equals(taHousingResources.getHouseLockingStatus())){
|
|
329
|
+ return false;
|
|
330
|
+ }
|
|
331
|
+
|
|
332
|
+ //查询我的认筹记录表
|
|
333
|
+ QueryWrapper<TaRaiseHouse> taRaiseHouseQueryWrapper = new QueryWrapper<>();
|
|
334
|
+ taRaiseHouseQueryWrapper.eq("org_id",orgId);
|
|
335
|
+ taRaiseHouseQueryWrapper.eq("house_id",houseId);
|
|
336
|
+ taRaiseHouseQueryWrapper.eq("person_id",personId);
|
|
337
|
+ List<TaRaiseHouse> list = taRaiseHouseService.list(taRaiseHouseQueryWrapper);
|
|
338
|
+ if (list.size() > 0){
|
|
339
|
+ return false;
|
|
340
|
+ }
|
|
341
|
+
|
|
342
|
+ return true;
|
|
343
|
+ }
|
|
344
|
+
|
285
|
345
|
/**
|
286
|
346
|
* 校验楼栋信息存不存在
|
287
|
347
|
*
|