Browse Source

* 新需求提交

顾绍勇 5 years ago
parent
commit
c5e5d4c3b7
20 changed files with 902 additions and 153 deletions
  1. 55
    0
      src/main/java/com/huiju/estateagents/bo/request/RaiseOrderRequestBO.java
  2. 85
    0
      src/main/java/com/huiju/estateagents/bo/request/RaiseRecordRequestBO.java
  3. 40
    36
      src/main/java/com/huiju/estateagents/common/CommConstant.java
  4. 1
    1
      src/main/java/com/huiju/estateagents/controller/TaHousingResourcesController.java
  5. 11
    3
      src/main/java/com/huiju/estateagents/controller/TaRaiseController.java
  6. 171
    46
      src/main/java/com/huiju/estateagents/controller/TaRaiseRecordController.java
  7. 64
    18
      src/main/java/com/huiju/estateagents/controller/TaSalesBatchController.java
  8. 12
    2
      src/main/java/com/huiju/estateagents/entity/TaRaise.java
  9. 35
    0
      src/main/java/com/huiju/estateagents/entity/TaRaiseRecord.java
  10. 20
    22
      src/main/java/com/huiju/estateagents/entity/TaSalesBatch.java
  11. 49
    0
      src/main/java/com/huiju/estateagents/mapper/TaRaiseRecordMapper.java
  12. 17
    2
      src/main/java/com/huiju/estateagents/mapper/TaSalesBatchMapper.java
  13. 6
    0
      src/main/java/com/huiju/estateagents/po/TaHousingResourcesPO.java
  14. 30
    0
      src/main/java/com/huiju/estateagents/service/ITaRaiseRecordService.java
  15. 23
    3
      src/main/java/com/huiju/estateagents/service/ITaSalesBatchService.java
  16. 38
    0
      src/main/java/com/huiju/estateagents/service/impl/TaRaiseRecordServiceImpl.java
  17. 41
    7
      src/main/java/com/huiju/estateagents/service/impl/TaSalesBatchServiceImpl.java
  18. 4
    1
      src/main/resources/mapper/TaHousingResourcesMapper.xml
  19. 119
    0
      src/main/resources/mapper/TaRaiseRecordMapper.xml
  20. 81
    12
      src/main/resources/mapper/TaSalesBatchMapper.xml

+ 55
- 0
src/main/java/com/huiju/estateagents/bo/request/RaiseOrderRequestBO.java View File

1
+package com.huiju.estateagents.bo.request;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * 查询认筹订单请求实体
7
+ *
8
+ * @Auther: gusy
9
+ * @Date: 2020/2/27 22:10
10
+ */
11
+@Data
12
+public class RaiseOrderRequestBO {
13
+
14
+    private Integer orgId;
15
+
16
+    /**
17
+     * 认筹ID
18
+     */
19
+    private Integer raiseId;
20
+
21
+    /**
22
+     * 订单表ID
23
+     */
24
+    private Integer orderId;
25
+
26
+    /**
27
+     * 认筹单表ID
28
+     */
29
+    private Integer raiseRecordId;
30
+
31
+    /**
32
+     * 认筹手机号
33
+     */
34
+    private String tel;
35
+
36
+    /**
37
+     * 用户手机号
38
+     */
39
+    private String personTel;
40
+
41
+    /**
42
+     * 微信流水号
43
+     */
44
+    private String transactionId ;
45
+
46
+    /**
47
+     * 微信退款号
48
+     */
49
+    private String refundNo;
50
+
51
+    /**
52
+     * 支付状态
53
+     */
54
+    private String payStatus;
55
+}

+ 85
- 0
src/main/java/com/huiju/estateagents/bo/request/RaiseRecordRequestBO.java View File

1
+package com.huiju.estateagents.bo.request;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * 认筹单记录查询请求实体
7
+ *
8
+ * @Auther: gusy
9
+ * @Date: 2020/2/27 18:39
10
+ */
11
+@Data
12
+public class RaiseRecordRequestBO {
13
+
14
+    private Integer orgId;
15
+
16
+    /**
17
+     * 房源ID
18
+     */
19
+    private String houseId;
20
+
21
+    /**
22
+     * 认筹表ID
23
+     */
24
+    private Integer raiseId;
25
+
26
+    /**
27
+     * 认筹单ID
28
+     */
29
+    private Integer raiseRecordId;
30
+
31
+    /**
32
+     * 期名
33
+     */
34
+    private String termName;
35
+
36
+    /**
37
+     * 楼栋名
38
+     */
39
+    private String blockName;
40
+
41
+    /**
42
+     * 单元名
43
+     */
44
+    private String unitName;
45
+
46
+    /**
47
+     * 楼层名
48
+     */
49
+    private String floorName;
50
+
51
+    /**
52
+     * 房间名
53
+     */
54
+    private String roomName;
55
+
56
+    /**
57
+     * 是否作废
58
+     */
59
+    private Integer status;
60
+
61
+    /**
62
+     * 房源锁定状态
63
+     */
64
+    private Integer lockingStatus;
65
+
66
+    /**
67
+     * 认筹手机号
68
+     */
69
+    private Integer tel;
70
+
71
+    /**
72
+     * 用户手机号
73
+     */
74
+    private Integer personTel;
75
+
76
+    /**
77
+     * 缴费状态
78
+     */
79
+    private String payStatus;
80
+
81
+    /**
82
+     * 缴费方式
83
+     */
84
+    private String payType;
85
+}

+ 40
- 36
src/main/java/com/huiju/estateagents/common/CommConstant.java View File

83
      * 兑换商品
83
      * 兑换商品
84
      */
84
      */
85
     public final static String POINTS_CHANGE_GOODS = "goods";
85
     public final static String POINTS_CHANGE_GOODS = "goods";
86
-    
86
+
87
     /**
87
     /**
88
      * 签到
88
      * 签到
89
      */
89
      */
90
     public final static String POINTS_CHANGE_CHECKIN = "checkin";
90
     public final static String POINTS_CHANGE_CHECKIN = "checkin";
91
-    
91
+
92
     /**
92
     /**
93
      * 分享
93
      * 分享
94
      */
94
      */
95
     public final static String POINTS_CHANGE_SHARE_POSTER = "share-poster";
95
     public final static String POINTS_CHANGE_SHARE_POSTER = "share-poster";
96
-    
96
+
97
     /**
97
     /**
98
      * 授权手机号
98
      * 授权手机号
99
      */
99
      */
100
     public final static String POINTS_CHANGE_SIGNUP_AGENT = "signup-agent";
100
     public final static String POINTS_CHANGE_SIGNUP_AGENT = "signup-agent";
101
-    
101
+
102
     /**
102
     /**
103
      * 拼团
103
      * 拼团
104
      */
104
      */
142
      * 未领取
142
      * 未领取
143
      */
143
      */
144
     public static final Integer STATUS_UNACCALIMED = 0;
144
     public static final Integer STATUS_UNACCALIMED = 0;
145
-    
145
+
146
     /**
146
     /**
147
      * 成功
147
      * 成功
148
      */
148
      */
149
     public static final String SUCCESS = "success";
149
     public static final String SUCCESS = "success";
150
 
150
 
151
 
151
 
152
-
153
     /**
152
     /**
154
      * 活动的当前状态1:进行中
153
      * 活动的当前状态1:进行中
155
      */
154
      */
222
     /**
221
     /**
223
      * 客户认购
222
      * 客户认购
224
      */
223
      */
225
-    public static final Integer CUSTOMER_PREORDER = 3 ;
224
+    public static final Integer CUSTOMER_PREORDER = 3;
226
 
225
 
227
     /**
226
     /**
228
      * 客户签约
227
      * 客户签约
247
 
246
 
248
     //=================  客户入口类型 start =======================
247
     //=================  客户入口类型 start =======================
249
     /*
248
     /*
250
-    * 自主进入
251
-    * */
249
+     * 自主进入
250
+     * */
252
     public static final String ENTRY_VOLUNTEER = "volunteer";
251
     public static final String ENTRY_VOLUNTEER = "volunteer";
253
     /*
252
     /*
254
     添加
253
     添加
255
     */
254
     */
256
     public static final String ENTRY_INPUT = "input";
255
     public static final String ENTRY_INPUT = "input";
257
     /*
256
     /*
258
-    * 报备
259
-    * */
257
+     * 报备
258
+     * */
260
     public static final String ENTRY_VERIFY = "verify";
259
     public static final String ENTRY_VERIFY = "verify";
261
     //=================  客户入口类型 end =======================
260
     //=================  客户入口类型 end =======================
262
 
261
 
423
     public static final String POSTER_CONTENT_TYPE_NEWS = "news";
422
     public static final String POSTER_CONTENT_TYPE_NEWS = "news";
424
     //人员
423
     //人员
425
     public static final String POSTER_CONTENT_TYPE_PERSON = "person";
424
     public static final String POSTER_CONTENT_TYPE_PERSON = "person";
426
-	
427
-	
428
-	public static final String GD_KEY = "c9fc664a9030aed2ec2183508c2ca476";
429
- 
430
-	//已参与微信端用
425
+
426
+
427
+    public static final String GD_KEY = "c9fc664a9030aed2ec2183508c2ca476";
428
+
429
+    //已参与微信端用
431
     public static final Integer ACTIVITY_STATUS_PARTNER = 3;
430
     public static final Integer ACTIVITY_STATUS_PARTNER = 3;
432
-    
431
+
433
     //发起者
432
     //发起者
434
-	public static final String HELP_STATUS_INITIATE = "Initiate";
435
-	
436
-	//助力活动
437
-	public static final Object HELP_ACTIVITY = "helpActivity";
438
-	
439
-	//分享活动
440
-	public static final Object GROUP_ACTIVITY = "groupActivity";
441
-	public static final String TARGET_TYPE_H5 = "H5";
433
+    public static final String HELP_STATUS_INITIATE = "Initiate";
434
+
435
+    //助力活动
436
+    public static final Object HELP_ACTIVITY = "helpActivity";
437
+
438
+    //分享活动
439
+    public static final Object GROUP_ACTIVITY = "groupActivity";
440
+    public static final String TARGET_TYPE_H5 = "H5";
442
     public static final String ACTIVITY_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"pages/checkin/index\"}";
441
     public static final String ACTIVITY_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"pages/checkin/index\"}";
443
     public static final String LIVE_ACTIVITY_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"onlineSelling/pages/live/index\"}";
442
     public static final String LIVE_ACTIVITY_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"onlineSelling/pages/live/index\"}";
444
     public static final String DRAINAGE_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"pages/project/h5Page\"}";
443
     public static final String DRAINAGE_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"pages/project/h5Page\"}";
445
     public static final String HOUSE_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"onlineSelling/pages/houseList/index\"}";
444
     public static final String HOUSE_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"onlineSelling/pages/houseList/index\"}";
446
-    
445
+
447
     /**
446
     /**
448
      * 消息通知
447
      * 消息通知
449
      * 必须存在表   td_miniapp_template_type 中
448
      * 必须存在表   td_miniapp_template_type 中
450
      */
449
      */
451
     public static final String MESSAGE_CONTENT_OF_NOTICE = "notice";
450
     public static final String MESSAGE_CONTENT_OF_NOTICE = "notice";
452
-    
451
+
453
     /**
452
     /**
454
      * 助力通知
453
      * 助力通知
455
      * 必须存在表   td_miniapp_template_type 中
454
      * 必须存在表   td_miniapp_template_type 中
456
      */
455
      */
457
     public static final String MESSAGE_CONTENT_OF_HELP = "help-result";
456
     public static final String MESSAGE_CONTENT_OF_HELP = "help-result";
458
-    
457
+
459
     /**
458
     /**
460
      * 拼团通知
459
      * 拼团通知
461
      * 必须存在表   td_miniapp_template_type 中
460
      * 必须存在表   td_miniapp_template_type 中
467
      * 必须存在表   td_miniapp_template_type 中
466
      * 必须存在表   td_miniapp_template_type 中
468
      */
467
      */
469
     public static final String MESSAGE_CONTENT_OF_HOUSE = "house";
468
     public static final String MESSAGE_CONTENT_OF_HOUSE = "house";
470
-    
469
+
471
     /**
470
     /**
472
      * 活动以结束
471
      * 活动以结束
473
      */
472
      */
474
     public static final Integer ACTIVITY_STATUS_FINISH = 2;
473
     public static final Integer ACTIVITY_STATUS_FINISH = 2;
475
-    
474
+
476
     /**
475
     /**
477
      * 客户统计类型:跟进客户
476
      * 客户统计类型:跟进客户
478
      */
477
      */
479
-	public static final String CUSTOMER_TYPE_FOLLOW = "follow";
480
-    
478
+    public static final String CUSTOMER_TYPE_FOLLOW = "follow";
479
+
481
     /**
480
     /**
482
      * 客户统计类型:新增客户
481
      * 客户统计类型:新增客户
483
      */
482
      */
484
     public static final String CUSTOMER_TYPE_NEW = "new";
483
     public static final String CUSTOMER_TYPE_NEW = "new";
485
-    
484
+
486
     /**
485
     /**
487
      * 客户统计类型:到访客户
486
      * 客户统计类型:到访客户
488
      */
487
      */
509
      * 户型图
508
      * 户型图
510
      */
509
      */
511
     public static final String BUILDING_IMG_APARMENT = "aparment";
510
     public static final String BUILDING_IMG_APARMENT = "aparment";
512
-    
511
+
513
     /**
512
     /**
514
      * 高德地图url
513
      * 高德地图url
515
      */
514
      */
516
-	public static final String AMAP_HTTP = "https://restapi.amap.com/v3/geocode/regeo";
517
-    
515
+    public static final String AMAP_HTTP = "https://restapi.amap.com/v3/geocode/regeo";
516
+
518
     /**
517
     /**
519
      * 高德地图key
518
      * 高德地图key
520
      */
519
      */
671
      * 已退费
670
      * 已退费
672
      */
671
      */
673
     public static final String PAY_STATUS_REFUNDED = "refunded";
672
     public static final String PAY_STATUS_REFUNDED = "refunded";
673
+
674
+    /**
675
+     * 最大认筹金额
676
+     */
677
+    public static final Integer MAX_RAISE_PRICE = 5000;
674
 }
678
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/controller/TaHousingResourcesController.java View File

245
                                                     HttpServletRequest request) {
245
                                                     HttpServletRequest request) {
246
         ResponseBean responseBean = new ResponseBean();
246
         ResponseBean responseBean = new ResponseBean();
247
         Integer orgId = getOrgId(request);
247
         Integer orgId = getOrgId(request);
248
-
249
         try {
248
         try {
250
             responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, "", "", "", 0));
249
             responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, "", "", "", 0));
251
         } catch (Exception e) {
250
         } catch (Exception e) {
351
         }
350
         }
352
         return responseBean;
351
         return responseBean;
353
     }
352
     }
353
+
354
 }
354
 }

+ 11
- 3
src/main/java/com/huiju/estateagents/controller/TaRaiseController.java View File

5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.huiju.estateagents.base.BaseController;
6
 import com.huiju.estateagents.base.BaseController;
7
 import com.huiju.estateagents.base.ResponseBean;
7
 import com.huiju.estateagents.base.ResponseBean;
8
+import com.huiju.estateagents.common.CommConstant;
8
 import com.huiju.estateagents.entity.TaRaise;
9
 import com.huiju.estateagents.entity.TaRaise;
9
 import com.huiju.estateagents.service.ITaRaiseService;
10
 import com.huiju.estateagents.service.ITaRaiseService;
10
 import org.slf4j.Logger;
11
 import org.slf4j.Logger;
21
  * @since 2020-02-26
22
  * @since 2020-02-26
22
  */
23
  */
23
 @RestController
24
 @RestController
24
-@RequestMapping("/")
25
+@RequestMapping("/api")
25
 public class TaRaiseController extends BaseController {
26
 public class TaRaiseController extends BaseController {
26
 
27
 
27
     private final Logger logger = LoggerFactory.getLogger(TaRaiseController.class);
28
     private final Logger logger = LoggerFactory.getLogger(TaRaiseController.class);
36
      * @param pageSize
37
      * @param pageSize
37
      * @return
38
      * @return
38
      */
39
      */
39
-    @RequestMapping(value="/taRaise",method= RequestMethod.GET)
40
+    @RequestMapping(value="/admin/taRaise",method= RequestMethod.GET)
40
     public ResponseBean taRaiseList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
41
     public ResponseBean taRaiseList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
41
                                     @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
42
                                     @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
42
         ResponseBean responseBean = new ResponseBean();
43
         ResponseBean responseBean = new ResponseBean();
61
      * @param taRaise 实体对象
62
      * @param taRaise 实体对象
62
      * @return
63
      * @return
63
      */
64
      */
64
-    @RequestMapping(value="/taRaise",method= RequestMethod.POST)
65
+    @RequestMapping(value="/admin/taRaise",method= RequestMethod.POST)
65
     public ResponseBean taRaiseAdd(@RequestBody TaRaise taRaise){
66
     public ResponseBean taRaiseAdd(@RequestBody TaRaise taRaise){
66
         ResponseBean responseBean = new ResponseBean();
67
         ResponseBean responseBean = new ResponseBean();
67
         try {
68
         try {
69
+            // 参数校验
70
+            Integer raisePrice = taRaise.getRaisePrice();
71
+            if(raisePrice != null && raisePrice > CommConstant.MAX_RAISE_PRICE){
72
+                responseBean.addError("认筹金额最高50000");
73
+                return responseBean;
74
+            }
75
+
68
             if (iTaRaiseService.save(taRaise)){
76
             if (iTaRaiseService.save(taRaise)){
69
                 responseBean.addSuccess(taRaise);
77
                 responseBean.addSuccess(taRaise);
70
             }else {
78
             }else {

+ 171
- 46
src/main/java/com/huiju/estateagents/controller/TaRaiseRecordController.java View File

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;
5
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
3
+import com.alibaba.fastjson.JSONObject;
6
 import com.huiju.estateagents.base.BaseController;
4
 import com.huiju.estateagents.base.BaseController;
7
 import com.huiju.estateagents.base.ResponseBean;
5
 import com.huiju.estateagents.base.ResponseBean;
6
+import com.huiju.estateagents.bo.request.RaiseOrderRequestBO;
7
+import com.huiju.estateagents.bo.request.RaiseRecordRequestBO;
8
+import com.huiju.estateagents.common.CommConstant;
8
 import com.huiju.estateagents.entity.TaRaiseRecord;
9
 import com.huiju.estateagents.entity.TaRaiseRecord;
9
 import com.huiju.estateagents.service.ITaRaiseRecordService;
10
 import com.huiju.estateagents.service.ITaRaiseRecordService;
11
+import org.apache.commons.collections.CollectionUtils;
12
+import org.apache.commons.lang3.StringUtils;
10
 import org.slf4j.Logger;
13
 import org.slf4j.Logger;
11
 import org.slf4j.LoggerFactory;
14
 import org.slf4j.LoggerFactory;
12
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.beans.factory.annotation.Autowired;
16
+import org.springframework.format.annotation.DateTimeFormat;
13
 import org.springframework.web.bind.annotation.*;
17
 import org.springframework.web.bind.annotation.*;
14
 
18
 
19
+import javax.servlet.http.HttpServletRequest;
20
+import java.time.LocalDateTime;
21
+import java.util.List;
22
+
15
 /**
23
 /**
16
  * <p>
24
  * <p>
17
-    * 认筹单(认筹记录表)  前端控制器
18
-    * </p>
25
+ * 认筹单(认筹记录表)  前端控制器
26
+ * </p>
19
  *
27
  *
20
  * @author jobob
28
  * @author jobob
21
  * @since 2020-02-26
29
  * @since 2020-02-26
22
  */
30
  */
23
 @RestController
31
 @RestController
24
-@RequestMapping("/")
32
+@RequestMapping("/api")
25
 public class TaRaiseRecordController extends BaseController {
33
 public class TaRaiseRecordController extends BaseController {
26
 
34
 
27
     private final Logger logger = LoggerFactory.getLogger(TaRaiseRecordController.class);
35
     private final Logger logger = LoggerFactory.getLogger(TaRaiseRecordController.class);
31
 
39
 
32
 
40
 
33
     /**
41
     /**
34
-     * 分页查询列表
35
-     * @param pageNum
42
+     * 条件查询认筹单
43
+     *
44
+     * @param recordRequestBO
45
+     * @param startTime
46
+     * @param endTime
47
+     * @param pageNumber
36
      * @param pageSize
48
      * @param pageSize
49
+     * @param request
37
      * @return
50
      * @return
38
      */
51
      */
39
-    @RequestMapping(value="/taRaiseRecord",method= RequestMethod.GET)
40
-    public ResponseBean taRaiseRecordList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
41
-                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
52
+    @RequestMapping(value = "/admin/listRaiseRecordByCondition", method = RequestMethod.GET)
53
+    public ResponseBean listRaiseRecordByCondition(RaiseRecordRequestBO recordRequestBO,
54
+                                                   @RequestParam(value = "startTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startTime,
55
+                                                   @RequestParam(value = "endTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endTime,
56
+                                                   @RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber,
57
+                                                   @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
58
+                                                   HttpServletRequest request) {
59
+        logger.info("TaRaiseRecordController.listRaiseRecordByCondition 接收参数:bo:{},startTime:{},endTime:{},pageNumber:{},pageSize:{}", JSONObject.toJSONString(recordRequestBO),
60
+                startTime, endTime, pageNumber, pageSize);
61
+
42
         ResponseBean responseBean = new ResponseBean();
62
         ResponseBean responseBean = new ResponseBean();
43
         try {
63
         try {
44
-            //使用分页插件
45
-		    IPage<TaRaiseRecord> pg = new Page<>(pageNum, pageSize);
46
-            QueryWrapper<TaRaiseRecord> queryWrapper = new QueryWrapper<>();
47
-            queryWrapper.orderByDesc("create_date");
48
-
49
-            IPage<TaRaiseRecord> result = iTaRaiseRecordService.page(pg, queryWrapper);
50
-            responseBean.addSuccess(result);
51
-        }catch (Exception e){
52
-            e.printStackTrace();
53
-            logger.error("taRaiseRecordList -=- {}",e.toString());
64
+            // 校验参数
65
+            if (null == recordRequestBO.getRaiseId()) {
66
+                responseBean.addError("参数错误");
67
+                return responseBean;
68
+            }
69
+
70
+            recordRequestBO.setOrgId(getOrgId(request));
71
+            responseBean = iTaRaiseRecordService.listRaiseRecordByCondition(recordRequestBO, startTime, endTime, pageNumber, pageSize);
72
+            logger.info("TaRaiseRecordController.listRaiseRecordByCondition 返回:{}", JSONObject.toJSONString(responseBean));
73
+        } catch (Exception e) {
74
+            logger.error("TaRaiseRecordController.taRaiseRecordList -=- {}", e);
75
+            responseBean.addError(e.getMessage());
76
+        }
77
+        return responseBean;
78
+    }
79
+
80
+    /**
81
+     * 条件查询缴费单
82
+     *
83
+     * @param orderRequestBO
84
+     * @param payStartTime
85
+     * @param payEndTime
86
+     * @param pageNumber
87
+     * @param pageSize
88
+     * @param request
89
+     * @return
90
+     */
91
+    @RequestMapping(value = "/admin/listRaiseOrderByCondition", method = RequestMethod.GET)
92
+    public ResponseBean listRaiseOrderByCondition(RaiseOrderRequestBO orderRequestBO,
93
+                                             @RequestParam(value = "payStartTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime payStartTime,
94
+                                             @RequestParam(value = "payEndTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime payEndTime,
95
+                                             @RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber,
96
+                                             @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
97
+                                             HttpServletRequest request) {
98
+        logger.info("TaRaiseRecordController.listOrderByCondition 接收参数:bo:{},startTime:{},endTime:{},pageNumber:{},pageSize:{}", JSONObject.toJSONString(orderRequestBO),
99
+                payStartTime, payEndTime, pageNumber, pageSize);
100
+
101
+        ResponseBean responseBean = new ResponseBean();
102
+        try {
103
+            orderRequestBO.setOrgId(getOrgId(request));
104
+            responseBean = iTaRaiseRecordService.listRaiseOrderByCondition(orderRequestBO, payStartTime, payEndTime, pageNumber, pageSize);
105
+            logger.info("TaRaiseRecordController.listOrderByCondition 返回:{}", JSONObject.toJSONString(responseBean));
106
+        } catch (Exception e) {
107
+            logger.error("TaRaiseRecordController.listOrderByCondition -=- {}", e);
108
+            responseBean.addError(e.getMessage());
109
+        }
110
+        return responseBean;
111
+
112
+    }
113
+
114
+    /**
115
+     * 批量作废
116
+     *
117
+     * @param raiseRecordList
118
+     * @param invalidReason
119
+     * @return
120
+     */
121
+    @RequestMapping(value = "/admin/batchInvalidRaiseRecord", method = RequestMethod.PUT)
122
+    public ResponseBean batchInvalidRaiseRecord(@RequestBody List<TaRaiseRecord> raiseRecordList, String invalidReason) {
123
+
124
+        logger.info("TaRaiseRecordController.batchInvalidRaiseRecord 接收参数:list:{},invalidReason:{}", JSONObject.toJSONString(raiseRecordList), invalidReason);
125
+
126
+        ResponseBean responseBean = new ResponseBean();
127
+        try {
128
+            // 校验参数
129
+            if (CollectionUtils.isEmpty(raiseRecordList) || StringUtils.isBlank(invalidReason)) {
130
+                responseBean.addError("参数错误");
131
+                return responseBean;
132
+            }
133
+
134
+            raiseRecordList.stream().forEach(record -> record.setInvalidReason(invalidReason));
135
+
136
+            if (iTaRaiseRecordService.updateBatchById(raiseRecordList)) {
137
+                responseBean.addSuccess("success");
138
+            } else {
139
+                responseBean.addError("fail");
140
+            }
141
+        } catch (Exception e) {
142
+            logger.error("TaRaiseRecordController.taRaiseRecordList -=- {}", e);
143
+            responseBean.addError(e.getMessage());
144
+        }
145
+        return responseBean;
146
+    }
147
+
148
+    /**
149
+     * 批量删除
150
+     *
151
+     * @param raiseRecordList
152
+     * @return
153
+     */
154
+    @RequestMapping(value = "/admin/batchDeleteRaiseRecord", method = RequestMethod.PUT)
155
+    public ResponseBean batchDeleteRaiseRecord(@RequestBody List<TaRaiseRecord> raiseRecordList) {
156
+        logger.info("TaRaiseRecordController.batchDeleteRaiseRecord 接收参数:{}", JSONObject.toJSONString(raiseRecordList));
157
+
158
+        ResponseBean responseBean = new ResponseBean();
159
+        try {
160
+            // 参数错误
161
+            if (CollectionUtils.isEmpty(raiseRecordList)) {
162
+                responseBean.addError("参数错误");
163
+                return responseBean;
164
+            }
165
+
166
+            raiseRecordList.stream().forEach(record -> record.setStatus(CommConstant.STATUS_DELETE));
167
+
168
+            if (iTaRaiseRecordService.updateBatchById(raiseRecordList)) {
169
+                responseBean.addSuccess("success");
170
+            } else {
171
+                responseBean.addError("fail");
172
+            }
173
+        } catch (Exception e) {
174
+            logger.error("TaRaiseRecordController.taRaiseRecordList -=- {}", e);
54
             responseBean.addError(e.getMessage());
175
             responseBean.addError(e.getMessage());
55
         }
176
         }
56
         return responseBean;
177
         return responseBean;
58
 
179
 
59
     /**
180
     /**
60
      * 保存对象
181
      * 保存对象
182
+     *
61
      * @param taRaiseRecord 实体对象
183
      * @param taRaiseRecord 实体对象
62
      * @return
184
      * @return
63
      */
185
      */
64
-    @RequestMapping(value="/taRaiseRecord",method= RequestMethod.POST)
65
-    public ResponseBean taRaiseRecordAdd(@RequestBody TaRaiseRecord taRaiseRecord){
186
+    @RequestMapping(value = "/taRaiseRecord", method = RequestMethod.POST)
187
+    public ResponseBean taRaiseRecordAdd(@RequestBody TaRaiseRecord taRaiseRecord) {
66
         ResponseBean responseBean = new ResponseBean();
188
         ResponseBean responseBean = new ResponseBean();
67
         try {
189
         try {
68
-            if (iTaRaiseRecordService.save(taRaiseRecord)){
190
+            if (iTaRaiseRecordService.save(taRaiseRecord)) {
69
                 responseBean.addSuccess(taRaiseRecord);
191
                 responseBean.addSuccess(taRaiseRecord);
70
-            }else {
192
+            } else {
71
                 responseBean.addError("fail");
193
                 responseBean.addError("fail");
72
             }
194
             }
73
-        }catch (Exception e){
195
+        } catch (Exception e) {
74
             e.printStackTrace();
196
             e.printStackTrace();
75
-            logger.error("taRaiseRecordAdd -=- {}",e.toString());
197
+            logger.error("taRaiseRecordAdd -=- {}", e.toString());
76
             responseBean.addError(e.getMessage());
198
             responseBean.addError(e.getMessage());
77
         }
199
         }
78
         return responseBean;
200
         return responseBean;
80
 
202
 
81
     /**
203
     /**
82
      * 根据id删除对象
204
      * 根据id删除对象
83
-     * @param id  实体ID
205
+     *
206
+     * @param id 实体ID
84
      */
207
      */
85
     @ResponseBody
208
     @ResponseBody
86
-    @RequestMapping(value="/taRaiseRecord/{id}", method= RequestMethod.DELETE)
87
-    public ResponseBean taRaiseRecordDelete(@PathVariable Integer id){
209
+    @RequestMapping(value = "/taRaiseRecord/{id}", method = RequestMethod.DELETE)
210
+    public ResponseBean taRaiseRecordDelete(@PathVariable Integer id) {
88
         ResponseBean responseBean = new ResponseBean();
211
         ResponseBean responseBean = new ResponseBean();
89
         try {
212
         try {
90
-            if(iTaRaiseRecordService.removeById(id)){
213
+            if (iTaRaiseRecordService.removeById(id)) {
91
                 responseBean.addSuccess("success");
214
                 responseBean.addSuccess("success");
92
-            }else {
215
+            } else {
93
                 responseBean.addError("fail");
216
                 responseBean.addError("fail");
94
             }
217
             }
95
-        }catch (Exception e){
218
+        } catch (Exception e) {
96
             e.printStackTrace();
219
             e.printStackTrace();
97
-            logger.error("taRaiseRecordDelete -=- {}",e.toString());
220
+            logger.error("taRaiseRecordDelete -=- {}", e.toString());
98
             responseBean.addError(e.getMessage());
221
             responseBean.addError(e.getMessage());
99
         }
222
         }
100
         return responseBean;
223
         return responseBean;
102
 
225
 
103
     /**
226
     /**
104
      * 修改对象
227
      * 修改对象
105
-     * @param id  实体ID
228
+     *
229
+     * @param id            实体ID
106
      * @param taRaiseRecord 实体对象
230
      * @param taRaiseRecord 实体对象
107
      * @return
231
      * @return
108
      */
232
      */
109
-    @RequestMapping(value="/taRaiseRecord/{id}",method= RequestMethod.PUT)
233
+    @RequestMapping(value = "/taRaiseRecord/{id}", method = RequestMethod.PUT)
110
     public ResponseBean taRaiseRecordUpdate(@PathVariable Integer id,
234
     public ResponseBean taRaiseRecordUpdate(@PathVariable Integer id,
111
-                                        @RequestBody TaRaiseRecord taRaiseRecord){
235
+                                            @RequestBody TaRaiseRecord taRaiseRecord) {
112
         ResponseBean responseBean = new ResponseBean();
236
         ResponseBean responseBean = new ResponseBean();
113
         try {
237
         try {
114
-            if (iTaRaiseRecordService.updateById(taRaiseRecord)){
238
+            if (iTaRaiseRecordService.updateById(taRaiseRecord)) {
115
                 responseBean.addSuccess(taRaiseRecord);
239
                 responseBean.addSuccess(taRaiseRecord);
116
-            }else {
240
+            } else {
117
                 responseBean.addError("fail");
241
                 responseBean.addError("fail");
118
             }
242
             }
119
-        }catch (Exception e){
243
+        } catch (Exception e) {
120
             e.printStackTrace();
244
             e.printStackTrace();
121
-            logger.error("taRaiseRecordUpdate -=- {}",e.toString());
245
+            logger.error("taRaiseRecordUpdate -=- {}", e.toString());
122
             responseBean.addError(e.getMessage());
246
             responseBean.addError(e.getMessage());
123
         }
247
         }
124
         return responseBean;
248
         return responseBean;
126
 
250
 
127
     /**
251
     /**
128
      * 根据id查询对象
252
      * 根据id查询对象
129
-     * @param id  实体ID
253
+     *
254
+     * @param id 实体ID
130
      */
255
      */
131
-    @RequestMapping(value="/taRaiseRecord/{id}",method= RequestMethod.GET)
132
-    public ResponseBean taRaiseRecordGet(@PathVariable Integer id){
256
+    @RequestMapping(value = "/taRaiseRecord/{id}", method = RequestMethod.GET)
257
+    public ResponseBean taRaiseRecordGet(@PathVariable Integer id) {
133
         ResponseBean responseBean = new ResponseBean();
258
         ResponseBean responseBean = new ResponseBean();
134
         try {
259
         try {
135
             responseBean.addSuccess(iTaRaiseRecordService.getById(id));
260
             responseBean.addSuccess(iTaRaiseRecordService.getById(id));
136
-        }catch (Exception e){
261
+        } catch (Exception e) {
137
             e.printStackTrace();
262
             e.printStackTrace();
138
-            logger.error("taRaiseRecordDelete -=- {}",e.toString());
263
+            logger.error("taRaiseRecordDelete -=- {}", e.toString());
139
             responseBean.addError(e.getMessage());
264
             responseBean.addError(e.getMessage());
140
         }
265
         }
141
         return responseBean;
266
         return responseBean;

+ 64
- 18
src/main/java/com/huiju/estateagents/controller/TaSalesBatchController.java View File

1
 package com.huiju.estateagents.controller;
1
 package com.huiju.estateagents.controller;
2
 
2
 
3
+import com.alibaba.fastjson.JSONObject;
3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
115
             shareContent.setCreateDate(LocalDateTime.now());
116
             shareContent.setCreateDate(LocalDateTime.now());
116
             taShareContentService.save(shareContent);
117
             taShareContentService.save(shareContent);
117
 
118
 
118
-            // 保存认筹信息
119
-            TaRaise taRaise = new TaRaise();
120
-            taRaise.setOrgId(orgId);
121
-            taRaise.setSalesBatchId(taSalesBatch.getSalesBatchId());
122
-            taRaise.setRaiseStartTime(taSalesBatch.getRaiseStartTime());
123
-            taRaise.setRaiseEndTime(taSalesBatch.getRaiseEndTime());
124
-            taRaise.setHouseLockingType(taSalesBatch.getHouseLockingType());
125
-            taRaise.setRaisePrice(taSalesBatch.getRaisePrice());
126
-            taRaise.setNeedPreselection(taSalesBatch.getNeedPreselection());
127
-            taRaise.setDisplayHousePrice(taSalesBatch.getDisplayHousePrice());
128
-            taRaise.setPayType(taSalesBatch.getPayType());
129
-            taRaise.setPayDescription(taSalesBatch.getPayDescription());
130
-            taRaise.setPayProtocol(taSalesBatch.getPayProtocol());
131
-            taRaise.setStatus(taSalesBatch.getStatus());
132
-            taRaise.setCreateDate(LocalDateTime.now());
133
-            taRaiseService.save(taRaise);
134
-
135
-            taSalesBatch.setRaiseId(taRaise.getRaiseId());
136
             responseBean.addSuccess(taSalesBatch);
119
             responseBean.addSuccess(taSalesBatch);
137
         } catch (Exception e) {
120
         } catch (Exception e) {
138
             e.printStackTrace();
121
             e.printStackTrace();
295
         }
278
         }
296
         return responseBean;
279
         return responseBean;
297
     }
280
     }
281
+
282
+    /**
283
+     * 获取销售批次列表-预选
284
+     *
285
+     * @param pageNum
286
+     * @param pageSize
287
+     * @param buildingId
288
+     * @param salesBatchName
289
+     * @param status
290
+     * @param request
291
+     * @return
292
+     */
293
+    @RequestMapping(value = "admin/listSalesBatchForPreselect", method = RequestMethod.GET)
294
+    public ResponseBean listSalesBatchForPreselect(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
295
+                                                   @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
296
+                                                   String buildingId, String salesBatchName, Integer status,
297
+                                                   HttpServletRequest request) {
298
+        ResponseBean responseBean = new ResponseBean();
299
+
300
+        try {
301
+            Integer orgId = getOrgId(request);
302
+            List<TaPersonBuilding> personBuildingList = getTaPersonBuildingListByUserId(request);
303
+
304
+            responseBean = iTaSalesBatchService.listSalesBatchForPreselect(pageSize, pageNum, salesBatchName, buildingId, orgId, status, personBuildingList);
305
+            logger.info("listSalesBatchForPreselect 返回结果:{}", JSONObject.toJSONString(responseBean));
306
+        } catch (Exception e) {
307
+            logger.error("listSalesBatchForPreselect -=- {}", e);
308
+            responseBean.addError(e.getMessage());
309
+        }
310
+        return responseBean;
311
+    }
312
+
313
+    /**
314
+     * 获取销售批次列表-认筹
315
+     *
316
+     * @param pageNum
317
+     * @param pageSize
318
+     * @param buildingId
319
+     * @param salesBatchName
320
+     * @param status
321
+     * @param request
322
+     * @return
323
+     */
324
+    @RequestMapping(value = "admin/listSalesBatchForRaise", method = RequestMethod.GET)
325
+    public ResponseBean listSalesBatchForRaise(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
326
+                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
327
+                                               String buildingId, String salesBatchName, Integer status,
328
+                                               HttpServletRequest request) {
329
+        ResponseBean responseBean = new ResponseBean();
330
+
331
+        try {
332
+            Integer orgId = getOrgId(request);
333
+            orgId = 84;
334
+            List<TaPersonBuilding> personBuildingList = getTaPersonBuildingListByUserId(request);
335
+
336
+            responseBean = iTaSalesBatchService.listSalesBatchForRaise(pageSize, pageNum, salesBatchName, buildingId, orgId, status, personBuildingList);
337
+            logger.info("listSalesBatchForRaise 返回结果:{}", JSONObject.toJSONString(responseBean));
338
+        } catch (Exception e) {
339
+            logger.error("listSalesBatchForRaise -=- {}", e);
340
+            responseBean.addError(e.getMessage());
341
+        }
342
+        return responseBean;
343
+    }
298
 }
344
 }

+ 12
- 2
src/main/java/com/huiju/estateagents/entity/TaRaise.java View File

76
     private String payType;
76
     private String payType;
77
 
77
 
78
     /**
78
     /**
79
-     * 缴费说明
79
+     * 线上缴费说明
80
      */
80
      */
81
-    private String payDescription;
81
+    private String payDescriptionOnline;
82
+
83
+    /**
84
+     * 线下缴费说明
85
+     */
86
+    private String payDescriptionOffline;
82
 
87
 
83
     /**
88
     /**
84
      * 线上选房协议
89
      * 线上选房协议
95
      */
100
      */
96
     private LocalDateTime createDate;
101
     private LocalDateTime createDate;
97
 
102
 
103
+    /**
104
+     * 基础热度
105
+     */
106
+    private Integer heat;
107
+
98
 
108
 
99
 }
109
 }

+ 35
- 0
src/main/java/com/huiju/estateagents/entity/TaRaiseRecord.java View File

1
 package com.huiju.estateagents.entity;
1
 package com.huiju.estateagents.entity;
2
 
2
 
3
 import com.baomidou.mybatisplus.annotation.IdType;
3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4
 import com.baomidou.mybatisplus.annotation.TableId;
5
 import com.baomidou.mybatisplus.annotation.TableId;
5
 import lombok.Data;
6
 import lombok.Data;
6
 import lombok.EqualsAndHashCode;
7
 import lombok.EqualsAndHashCode;
135
      */
136
      */
136
     private Integer orderId;
137
     private Integer orderId;
137
 
138
 
139
+    /**
140
+     * 用户手机号
141
+     */
142
+    @TableField(exist = false)
143
+    private String personTel;
144
+
145
+    /**
146
+     * 支付时间
147
+     */
148
+    @TableField(exist = false)
149
+    private LocalDateTime payTime;
150
+
151
+    /**
152
+     * 微信订单号
153
+     */
154
+    @TableField(exist = false)
155
+    private String tradeNo;
138
 
156
 
157
+    /**
158
+     * 微信订单号
159
+     */
160
+    @TableField(exist = false)
161
+    private String transactionId;
162
+
163
+    /**
164
+     * 微信退款单号
165
+     */
166
+    @TableField(exist = false)
167
+    private String refundNo;
168
+
169
+    /**
170
+     * 实付金额
171
+     */
172
+    @TableField(exist = false)
173
+    private String totalFee;
139
 }
174
 }

+ 20
- 22
src/main/java/com/huiju/estateagents/entity/TaSalesBatch.java View File

105
     private List<TaShareContent> shareContents;
105
     private List<TaShareContent> shareContents;
106
 
106
 
107
     /**
107
     /**
108
-     * V3.5.12增加
108
+     * 是否展示房源价格
109
      */
109
      */
110
+    private Boolean displayHousePrice;
110
 
111
 
111
     /**
112
     /**
112
-     * 缴费方式 onLine线上offLine线下
113
+     * V3.5.12 新增
114
+     */
115
+
116
+    /**
117
+     * 认筹id
113
      */
118
      */
114
     @TableField(exist = false)
119
     @TableField(exist = false)
115
-    private String payType;
120
+    private Integer raiseId;
116
 
121
 
117
     /**
122
     /**
118
-     * 认筹是否预选
123
+     * 认筹状态
119
      */
124
      */
120
     @TableField(exist = false)
125
     @TableField(exist = false)
121
-    private Boolean needPreselection;
126
+    private Integer raiseStaus;
122
 
127
 
123
     /**
128
     /**
124
-     * 认筹金额 单位是分!
129
+     * 锁房方式 auto自动锁房,manual手动锁房
125
      */
130
      */
126
     @TableField(exist = false)
131
     @TableField(exist = false)
127
-    private Integer raisePrice;
132
+    private String houseLockingType;
128
 
133
 
129
     /**
134
     /**
130
      * 认筹开始时间
135
      * 认筹开始时间
139
     private LocalDateTime raiseEndTime;
144
     private LocalDateTime raiseEndTime;
140
 
145
 
141
     /**
146
     /**
142
-     * 是否展示房源价格
143
-     */
144
-    @TableField(exist = false)
145
-    private Boolean displayHousePrice;
146
-
147
-    /**
148
-     * 线上选房协议
147
+     * 认筹金额 单位是分!
149
      */
148
      */
150
     @TableField(exist = false)
149
     @TableField(exist = false)
151
-    private String payProtocol;
150
+    private Integer raisePrice;
152
 
151
 
153
     /**
152
     /**
154
-     * 缴费说明
153
+     * 缴费方式 onLine线上offLine线下
155
      */
154
      */
156
     @TableField(exist = false)
155
     @TableField(exist = false)
157
-    private String payDescription;
156
+    private String payType;
158
 
157
 
159
     /**
158
     /**
160
-     * 锁房方式 auto自动锁房,manual手动锁房
159
+     * 认筹数量
161
      */
160
      */
162
     @TableField(exist = false)
161
     @TableField(exist = false)
163
-    private String houseLockingType;
162
+    private Integer raiseCount;
164
 
163
 
165
     /**
164
     /**
166
-     * 认筹Id
165
+     * 预选数量
167
      */
166
      */
168
     @TableField(exist = false)
167
     @TableField(exist = false)
169
-    private Integer raiseId;
170
-
168
+    private Integer preselectCount;
171
 }
169
 }

+ 49
- 0
src/main/java/com/huiju/estateagents/mapper/TaRaiseRecordMapper.java View File

1
 package com.huiju.estateagents.mapper;
1
 package com.huiju.estateagents.mapper;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.huiju.estateagents.bo.request.RaiseOrderRequestBO;
6
+import com.huiju.estateagents.bo.request.RaiseRecordRequestBO;
4
 import com.huiju.estateagents.entity.TaRaiseRecord;
7
 import com.huiju.estateagents.entity.TaRaiseRecord;
5
 import org.apache.ibatis.annotations.Mapper;
8
 import org.apache.ibatis.annotations.Mapper;
9
+import org.apache.ibatis.annotations.Param;
10
+import org.springframework.stereotype.Component;
11
+
12
+import java.time.LocalDateTime;
13
+import java.util.List;
6
 
14
 
7
 /**
15
 /**
8
  * <p>
16
  * <p>
13
  * @since 2020-02-26
21
  * @since 2020-02-26
14
  */
22
  */
15
 @Mapper
23
 @Mapper
24
+@Component
16
 public interface TaRaiseRecordMapper extends BaseMapper<TaRaiseRecord> {
25
 public interface TaRaiseRecordMapper extends BaseMapper<TaRaiseRecord> {
17
 
26
 
27
+    /**
28
+     * 条件查询认筹单
29
+     *
30
+     * @param page
31
+     * @param bo
32
+     * @param startTime
33
+     * @param endTime
34
+     * @return
35
+     */
36
+    IPage<TaRaiseRecord> listRaiseRecordByCondition(IPage<TaRaiseRecord> page,
37
+                                                    @Param("bo") RaiseRecordRequestBO bo,
38
+                                                    @Param("startTime") LocalDateTime startTime,
39
+                                                    @Param("endTime") LocalDateTime endTime);
40
+
41
+    /**
42
+     * 条件查询缴费单
43
+     *
44
+     * @param page
45
+     * @param bo
46
+     * @param startTime
47
+     * @param endTime
48
+     * @return
49
+     */
50
+    IPage<TaRaiseRecord> listRaiseOrderByCondition(IPage<TaRaiseRecord> page,
51
+                                              @Param("bo") RaiseOrderRequestBO bo,
52
+                                              @Param("startTime") LocalDateTime startTime,
53
+                                              @Param("endTime") LocalDateTime endTime);
54
+
55
+    /**
56
+     * 批量更新
57
+     *
58
+     * @param recordList
59
+     * @param orgId
60
+     * @param payType
61
+     * @return
62
+     */
63
+    Boolean batchUpdateById(@Param("recordList") List<TaRaiseRecord> recordList,
64
+                            @Param("orgId") Integer orgId,
65
+                            @Param("payType") String payType);
66
+
18
 }
67
 }

+ 17
- 2
src/main/java/com/huiju/estateagents/mapper/TaSalesBatchMapper.java View File

20
  */
20
  */
21
 @Mapper
21
 @Mapper
22
 public interface TaSalesBatchMapper extends BaseMapper<TaSalesBatch> {
22
 public interface TaSalesBatchMapper extends BaseMapper<TaSalesBatch> {
23
-    IPage<TaSalesBatch> selectByCondition(IPage<TaSalesBatch> page, @Param("salesBatchName") String salesBatchName, @Param("buildingId") String buildingId, @Param("status") Integer status, @Param("orgId") Integer orgId,@Param("personBuildingList")  List<TaPersonBuilding> personBuildingList);
23
+    IPage<TaSalesBatch> selectByCondition(IPage<TaSalesBatch> page, @Param("salesBatchName") String salesBatchName, @Param("buildingId") String buildingId, @Param("status") Integer status, @Param("orgId") Integer orgId, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
24
 
24
 
25
     /**
25
     /**
26
      * 根据批次号统计预选数据
26
      * 根据批次号统计预选数据
39
      * @param salesBatchId
39
      * @param salesBatchId
40
      * @return
40
      * @return
41
      */
41
      */
42
-    Map<String,Object> getTotalHousesAndHeat(@Param("salesBatchId") Integer salesBatchId);
42
+    Map<String, Object> getTotalHousesAndHeat(@Param("salesBatchId") Integer salesBatchId);
43
+
44
+    IPage<TaSalesBatch> listSalesBatchForPreselect(IPage<TaSalesBatch> page,
45
+                                                   @Param("salesBatchName") String salesBatchName,
46
+                                                   @Param("buildingId") String buildingId,
47
+                                                   @Param("orgId") Integer orgId,
48
+                                                   @Param("status") Integer status,
49
+                                                   @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
50
+
51
+
52
+    IPage<TaSalesBatch> listSalesBatchForRaise(IPage<TaSalesBatch> page,
53
+                                               @Param("salesBatchName") String salesBatchName,
54
+                                               @Param("buildingId") String buildingId,
55
+                                               @Param("orgId") Integer orgId,
56
+                                               @Param("status") Integer status,
57
+                                               @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
43
 }
58
 }

+ 6
- 0
src/main/java/com/huiju/estateagents/po/TaHousingResourcesPO.java View File

55
      * 楼盘名称
55
      * 楼盘名称
56
      */
56
      */
57
     private String buildingName;
57
     private String buildingName;
58
+
59
+    /**
60
+     * 认筹实际热度
61
+     */
62
+    @TableField(exist = false)
63
+    private Integer raiseRealHeat;
58
 }
64
 }

+ 30
- 0
src/main/java/com/huiju/estateagents/service/ITaRaiseRecordService.java View File

1
 package com.huiju.estateagents.service;
1
 package com.huiju.estateagents.service;
2
 
2
 
3
 import com.baomidou.mybatisplus.extension.service.IService;
3
 import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.huiju.estateagents.base.ResponseBean;
5
+import com.huiju.estateagents.bo.request.RaiseOrderRequestBO;
6
+import com.huiju.estateagents.bo.request.RaiseRecordRequestBO;
4
 import com.huiju.estateagents.entity.TaRaiseRecord;
7
 import com.huiju.estateagents.entity.TaRaiseRecord;
8
+import org.springframework.web.bind.annotation.RequestParam;
9
+
10
+import java.time.LocalDateTime;
11
+import java.util.List;
5
 
12
 
6
 /**
13
 /**
7
  * <p>
14
  * <p>
13
  */
20
  */
14
 public interface ITaRaiseRecordService extends IService<TaRaiseRecord> {
21
 public interface ITaRaiseRecordService extends IService<TaRaiseRecord> {
15
 
22
 
23
+    /**
24
+     * 条件查询认筹单
25
+     *
26
+     * @param recordRequestBO
27
+     * @param startTime
28
+     * @param endTime
29
+     * @param pageNumber
30
+     * @param pageSize
31
+     * @return
32
+     */
33
+    ResponseBean listRaiseRecordByCondition(RaiseRecordRequestBO recordRequestBO, LocalDateTime startTime, LocalDateTime endTime, Integer pageNumber, Integer pageSize);
34
+
35
+    /**
36
+     * 条件查询缴费单
37
+     *
38
+     * @param orderRequestBO
39
+     * @param payStartTime
40
+     * @param payEndTime
41
+     * @param pageNumber
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    ResponseBean listRaiseOrderByCondition(RaiseOrderRequestBO orderRequestBO, LocalDateTime payStartTime, LocalDateTime payEndTime, Integer pageNumber, Integer pageSize);
16
 }
46
 }

+ 23
- 3
src/main/java/com/huiju/estateagents/service/ITaSalesBatchService.java View File

38
     ResponseBean getSalesBatchById(Integer salesBatchId);
38
     ResponseBean getSalesBatchById(Integer salesBatchId);
39
 
39
 
40
     /**
40
     /**
41
-     * 获取销售批次详情 cms端
41
+     * 获取销售批次列表 - 预选
42
      *
42
      *
43
-     * @param salesBatchId
43
+     * @param pageSize
44
+     * @param pageNum
45
+     * @param salesBatchName
46
+     * @param buildingId
47
+     * @param orgId
48
+     * @param status
49
+     * @return
50
+     */
51
+    ResponseBean listSalesBatchForPreselect(Integer pageSize, Integer pageNum, String salesBatchName, String buildingId,
52
+                                            Integer orgId, Integer status, List<TaPersonBuilding> taPersonBuildingListByUserId);
53
+
54
+    /**
55
+     * 获取销售批次列表 - 认筹
56
+     *
57
+     * @param pageSize
58
+     * @param pageNum
59
+     * @param salesBatchName
60
+     * @param buildingId
61
+     * @param orgId
62
+     * @param status
44
      * @return
63
      * @return
45
      */
64
      */
46
-    ResponseBean getSalesBatchDetailForCms(Integer salesBatchId);
65
+    ResponseBean listSalesBatchForRaise(Integer pageSize, Integer pageNum, String salesBatchName, String buildingId,
66
+                                        Integer orgId, Integer status, List<TaPersonBuilding> taPersonBuildingListByUserId);
47
 }
67
 }

+ 38
- 0
src/main/java/com/huiju/estateagents/service/impl/TaRaiseRecordServiceImpl.java View File

1
 package com.huiju.estateagents.service.impl;
1
 package com.huiju.estateagents.service.impl;
2
 
2
 
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
3
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import com.huiju.estateagents.base.ResponseBean;
8
+import com.huiju.estateagents.bo.request.RaiseOrderRequestBO;
9
+import com.huiju.estateagents.bo.request.RaiseRecordRequestBO;
4
 import com.huiju.estateagents.entity.TaRaiseRecord;
10
 import com.huiju.estateagents.entity.TaRaiseRecord;
5
 import com.huiju.estateagents.mapper.TaRaiseRecordMapper;
11
 import com.huiju.estateagents.mapper.TaRaiseRecordMapper;
6
 import com.huiju.estateagents.service.ITaRaiseRecordService;
12
 import com.huiju.estateagents.service.ITaRaiseRecordService;
13
+import org.slf4j.Logger;
14
+import org.slf4j.LoggerFactory;
15
+import org.springframework.beans.factory.annotation.Autowired;
7
 import org.springframework.stereotype.Service;
16
 import org.springframework.stereotype.Service;
8
 
17
 
18
+import java.time.LocalDateTime;
19
+import java.util.List;
20
+
9
 /**
21
 /**
10
  * <p>
22
  * <p>
11
  * 认筹单(认筹记录表)  服务实现类
23
  * 认筹单(认筹记录表)  服务实现类
17
 @Service
29
 @Service
18
 public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, TaRaiseRecord> implements ITaRaiseRecordService {
30
 public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, TaRaiseRecord> implements ITaRaiseRecordService {
19
 
31
 
32
+    private Logger logger = LoggerFactory.getLogger(TaRaiseRecordServiceImpl.class);
33
+
34
+    @Autowired
35
+    private TaRaiseRecordMapper taRaiseRecordMapper;
36
+
37
+    @Override
38
+    public ResponseBean listRaiseRecordByCondition(RaiseRecordRequestBO recordRequestBO, LocalDateTime startTime, LocalDateTime endTime, Integer pageNumber, Integer pageSize) {
39
+        logger.info("TaRaiseRecordServiceImpl.listRaiseRecordByCondition 接收参数:bo:{},startTime:{},endTime:{},pageNumber:{},pageSize:{}", JSONObject.toJSONString(recordRequestBO),
40
+                startTime, endTime, pageNumber, pageSize);
41
+
42
+        ResponseBean responseBean = new ResponseBean();
43
+        IPage<TaRaiseRecord> pg = new Page<>(pageNumber, pageSize);
44
+        responseBean.addSuccess(taRaiseRecordMapper.listRaiseRecordByCondition(pg, recordRequestBO, startTime, endTime));
45
+        return responseBean;
46
+    }
47
+
48
+    @Override
49
+    public ResponseBean listRaiseOrderByCondition(RaiseOrderRequestBO orderRequestBO, LocalDateTime payStartTime, LocalDateTime payEndTime, Integer pageNumber, Integer pageSize) {
50
+        logger.info("TaRaiseRecordServiceImpl.listOrderByCondition 接收参数:bo:{},startTime:{},endTime:{},pageNumber:{},pageSize:{}", JSONObject.toJSONString(orderRequestBO),
51
+                payStartTime, payEndTime, pageNumber, pageSize);
52
+
53
+        ResponseBean responseBean = new ResponseBean();
54
+        IPage<TaRaiseRecord> pg = new Page<>(pageNumber, pageSize);
55
+        responseBean.addSuccess(taRaiseRecordMapper.listRaiseOrderByCondition(pg, orderRequestBO, payStartTime, payEndTime));
56
+        return responseBean;
57
+    }
20
 }
58
 }

+ 41
- 7
src/main/java/com/huiju/estateagents/service/impl/TaSalesBatchServiceImpl.java View File

3
 import com.alibaba.fastjson.JSONObject;
3
 import com.alibaba.fastjson.JSONObject;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
 import com.huiju.estateagents.base.ResponseBean;
8
 import com.huiju.estateagents.base.ResponseBean;
8
 import com.huiju.estateagents.common.CommConstant;
9
 import com.huiju.estateagents.common.CommConstant;
67
 
68
 
68
     @Override
69
     @Override
69
     public IPage<TaSalesBatch> selectByCondition(IPage<TaSalesBatch> page, String salesBatchName, String buildingId, Integer status, Integer orgId, List<TaPersonBuilding> taPersonBuildingListByUserId) {
70
     public IPage<TaSalesBatch> selectByCondition(IPage<TaSalesBatch> page, String salesBatchName, String buildingId, Integer status, Integer orgId, List<TaPersonBuilding> taPersonBuildingListByUserId) {
70
-        return taSalesBatchMapper.selectByCondition(page, salesBatchName, buildingId, status, orgId,taPersonBuildingListByUserId);
71
+        return taSalesBatchMapper.selectByCondition(page, salesBatchName, buildingId, status, orgId, taPersonBuildingListByUserId);
71
     }
72
     }
72
 
73
 
73
     @Override
74
     @Override
79
             return responseBean;
80
             return responseBean;
80
         }
81
         }
81
         //无预选状态下删除销售批次的同时删除房源信息
82
         //无预选状态下删除销售批次的同时删除房源信息
82
-        List<TaHousingResources> housingList =taHousingResourcesMapper.selectHousingList(orgId,taSalesBatchList);
83
+        List<TaHousingResources> housingList = taHousingResourcesMapper.selectHousingList(orgId, taSalesBatchList);
83
         List<TaBuildingRoom> taBuildingRoomList = new ArrayList<>();
84
         List<TaBuildingRoom> taBuildingRoomList = new ArrayList<>();
84
         housingList.forEach(e -> {
85
         housingList.forEach(e -> {
85
             e.setStatus(CommConstant.STATUS_DELETE);
86
             e.setStatus(CommConstant.STATUS_DELETE);
90
         });
91
         });
91
 
92
 
92
         //房源改为无效
93
         //房源改为无效
93
-        if (CollectionUtils.isNotEmpty(housingList)){
94
+        if (CollectionUtils.isNotEmpty(housingList)) {
94
             taHousingResourcesService.updateBatchById(housingList);
95
             taHousingResourcesService.updateBatchById(housingList);
95
         }
96
         }
96
 
97
 
97
-        if (CollectionUtils.isNotEmpty(taBuildingRoomList)){
98
+        if (CollectionUtils.isNotEmpty(taBuildingRoomList)) {
98
             taBuildingRoomService.updateBatchById(taBuildingRoomList);
99
             taBuildingRoomService.updateBatchById(taBuildingRoomList);
99
         }
100
         }
100
 
101
 
162
 
163
 
163
         // 获取楼盘名称
164
         // 获取楼盘名称
164
         TaBuilding taBuilding = taBuildingService.getById(result.getBuildingId());
165
         TaBuilding taBuilding = taBuildingService.getById(result.getBuildingId());
165
-        if(taBuilding != null){
166
+        if (taBuilding != null) {
166
             result.setBuildingName(taBuilding.getBuildingName());
167
             result.setBuildingName(taBuilding.getBuildingName());
167
         }
168
         }
168
 
169
 
195
         return responseBean;
196
         return responseBean;
196
     }
197
     }
197
 
198
 
199
+    /**
200
+     * @param pageSize
201
+     * @param pageNum
202
+     * @param salesBatchName
203
+     * @param buildingId
204
+     * @param orgId
205
+     * @param status
206
+     * @return
207
+     */
198
     @Override
208
     @Override
199
-    public ResponseBean getSalesBatchDetailForCms(Integer salesBatchId) {
200
-        return null;
209
+    public ResponseBean listSalesBatchForPreselect(Integer pageSize, Integer pageNum, String salesBatchName, String buildingId,
210
+                                                   Integer orgId, Integer status, List<TaPersonBuilding> taPersonBuildingListByUserId) {
211
+
212
+        logger.info("listSalesBatchForPreselect 接收参数:pageSize:{},pageNum:{},salesBatchName:{},buildilgId:{},orgId:{},status:{},taPersonBuildingListByUserId:{}",
213
+                pageSize, pageNum, salesBatchName, buildingId, orgId, status,JSONObject.toJSONString(taPersonBuildingListByUserId));
214
+
215
+        ResponseBean responseBean = new ResponseBean();
216
+
217
+        IPage<TaSalesBatch> pg = new Page<>(pageNum, pageSize);
218
+        responseBean.addSuccess(taSalesBatchMapper.listSalesBatchForPreselect(pg, salesBatchName, buildingId, orgId, status, taPersonBuildingListByUserId));
219
+        return responseBean;
201
     }
220
     }
221
+
222
+    @Override
223
+    public ResponseBean listSalesBatchForRaise(Integer pageSize, Integer pageNum, String salesBatchName, String buildingId,
224
+                                               Integer orgId, Integer status, List<TaPersonBuilding> taPersonBuildingListByUserId) {
225
+
226
+        logger.info("listSalesBatchForRaise 接收参数:pageSize:{},pageNum:{},salesBatchName:{},buildilgId:{},orgId:{},status:{},taPersonBuildingListByUserId:{}",
227
+                pageSize, pageNum, salesBatchName, buildingId, orgId, status,JSONObject.toJSONString(taPersonBuildingListByUserId));
228
+
229
+        ResponseBean responseBean = new ResponseBean();
230
+
231
+        IPage<TaSalesBatch> pg = new Page<>(pageNum, pageSize);
232
+        responseBean.addSuccess(taSalesBatchMapper.listSalesBatchForRaise(pg, salesBatchName, buildingId, orgId, status, taPersonBuildingListByUserId));
233
+        return responseBean;
234
+    }
235
+
202
 }
236
 }

+ 4
- 1
src/main/resources/mapper/TaHousingResourcesMapper.xml View File

47
             t2.building_area,
47
             t2.building_area,
48
             t2.apartment_name,
48
             t2.apartment_name,
49
             t3.term_id,
49
             t3.term_id,
50
-            t.term_name
50
+            t.term_name,
51
+            t4.house_locking_status,
52
+            (select count(*) from ta_raise_house tr where tr.house_id = t.house_id) raiseRealHeat
51
         FROM
53
         FROM
52
           ta_housing_resources t
54
           ta_housing_resources t
53
         LEFT JOIN ta_building_apartment t2 ON t.apartment_id = t2.apartment_id
55
         LEFT JOIN ta_building_apartment t2 ON t.apartment_id = t2.apartment_id
54
         LEFT JOIN ta_building_block t3 ON t.block_id = t3.block_id
56
         LEFT JOIN ta_building_block t3 ON t.block_id = t3.block_id
57
+        LEFT JOIN ta_raise_house t4 ON t.house_id = t4.house_id
55
         WHERE
58
         WHERE
56
             t.sales_batch_id = #{salesBatchId}
59
             t.sales_batch_id = #{salesBatchId}
57
             AND t.org_id = #{orgId}
60
             AND t.org_id = #{orgId}

+ 119
- 0
src/main/resources/mapper/TaRaiseRecordMapper.xml View File

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.huiju.estateagents.mapper.TaRaiseRecordMapper">
3
 <mapper namespace="com.huiju.estateagents.mapper.TaRaiseRecordMapper">
4
 
4
 
5
+    <select id="listRaiseRecordByCondition" resultType="com.huiju.estateagents.entity.TaRaiseRecord">
6
+        SELECT
7
+            t.*,
8
+            t3.house_id,
9
+            t3.term_name,
10
+            t3.block_name,
11
+            t3.unit_name,
12
+            t3.floor_name,
13
+            t3.room_name,
14
+            t3.apartment_id,
15
+            t4.apartment_name,
16
+            t5.tel personTel
17
+        FROM
18
+            ta_raise_record t
19
+            LEFT JOIN ta_raise_house t2 ON t.raise_record_id = t2.raise_record_id
20
+            LEFT JOIN ta_housing_resources t3 ON t2.house_id = t3.house_id
21
+            LEFT JOIN ta_building_apartment t4 ON t3.apartment_id = t4.apartment_id
22
+            LEFT JOIN ta_person t5 ON t.person_id = t5.person_id
23
+        WHERE
24
+            t.org_id = #{bo.orgId}
25
+            AND t.`status` != - 1
26
+            AND t3.`status` != - 1
27
+        <if test="bo.raiseId != null and bo.raiseId != ''">
28
+            AND t.raise_id =#{bo.raiseId}
29
+        </if>
30
+        <if test="bo.houseId != null and bo.houseId != ''">
31
+            AND t3.house_id =  =#{bo.houseId}
32
+        </if>
33
+        <if test="bo.raiseRecordId != null and bo.raiseRecordId != ''">
34
+            AND t.raise_record_id = #{bo.raiseRecordId}
35
+        </if>
36
+        <if test="bo.termName != null and bo.termName != ''">
37
+            AND t3.term_name like CONCAT('%',#{bo.termName}, '%')
38
+        </if>
39
+        <if test="bo.blockName != null and bo.blockName != ''">
40
+            AND t3.block_name like CONCAT('%',#{bo.blockName}, '%')
41
+        </if>
42
+        <if test="bo.unitName != null and bo.unitName != ''">
43
+            AND t3.unit_name like CONCAT('%',#{bo.unitName}, '%')
44
+        </if>
45
+        <if test="bo.floorName != null and bo.floorName != ''">
46
+            AND t3.floor_name like CONCAT('%',#{bo.floorName}, '%')
47
+        </if>
48
+        <if test="bo.roomName != null and bo.roomName != ''">
49
+            AND t3.room_name like CONCAT('%',#{bo.roomName}, '%')
50
+        </if>
51
+        <if test="bo.status != null">
52
+            AND t.status = #{bo.status}
53
+        </if>
54
+        <if test="bo.lockingStatus != null and bo.lockingStatus != ''">
55
+            AND t.house_locking_status = #{bo.lockingStatus}
56
+        </if>
57
+        <if test="bo.tel != null and bo.tel != ''">
58
+            AND t.tel = #{bo.tel}
59
+        </if>
60
+        <if test="bo.personTel != null and bo.personTel != ''">
61
+            AND t5.tel = #{bo.personTel}
62
+        </if>
63
+        <if test="bo.payStatus != null and bo.payStatus != ''">
64
+            AND t.pay_status = #{bo.payStatus}
65
+        </if>
66
+        <if test="bo.payType != null and bo.payType != ''">
67
+            AND t.pay_type = #{bo.payType}
68
+        </if>
69
+        <if test = 'startTime != null'>
70
+            AND t.create_date &gt;= #{startTime}
71
+        </if>
72
+        <if test = 'endTime != null'>
73
+            AND t.create_date &lt;= #{endTime}
74
+        </if>
75
+    </select>
76
+
77
+    <select id ="listRaiseOrderByCondition" resultType="com.huiju.estateagents.entity.TaRaiseRecord">
78
+        SELECT
79
+            t.*,
80
+            t2.order_id,
81
+            t2.pay_time,
82
+            t2.trade_no,
83
+            t2.transaction_id,
84
+            t2.refund_no,
85
+            t2.total_fee
86
+        FROM
87
+            ta_raise_record t
88
+            INNER JOIN ta_order t2 ON t.order_id = t2.order_id
89
+            LEFT JOIN ta_person t3 ON t2.person_id = t3.person_id
90
+        WHERE
91
+            t.org_id = #{bo.orgId}
92
+            AND t.`status` != - 1
93
+            <if test = "bo.raiseId != null and bo.raiseId != ''">
94
+                AND t.raise_id = #{bo.raiseId}
95
+            </if>
96
+            <if test = "bo.orderId != null and bo.orderId != ''">
97
+                AND t2.order_id = #{bo.orderId}
98
+            </if>
99
+            <if test = "bo.raiseRecordId != null and bo.raiseRecordId != ''">
100
+                AND t.raise_record_id = #{bo.raiseRecordId}
101
+            </if>
102
+            <if test = "bo.tel != null and bo.tel != ''">
103
+                AND t.tel = #{bo.tel}
104
+            </if>
105
+            <if test = "bo.personTel != null and bo.personTel != ''">
106
+                AND t3.tel = #{bo.personTel}
107
+            </if>
108
+            <if test = "bo.transactionId != null and bo.transactionId != ''">
109
+                AND t2.transaction_id = #{bo.transactionId}
110
+            </if>
111
+            <if test = "bo.refundNo != null and bo.refundNo != ''">
112
+                AND t2.refund_no = #{bo.refundNo}
113
+            </if>
114
+            <if test = "bo.payStatus != null and bo.payStatus != ''">
115
+                AND t.pay_status = #{bo.payStatus}
116
+            </if>
117
+            <if test = "payStartTime != null and payStartTime != ''">
118
+                AND t2.pay_time &gt;= #{payStartTime}
119
+            </if>
120
+            <if test = "payEndTime != null and payEndTime != ''">
121
+                AND t2.pay_time &lt;= #{payEndTime}
122
+            </if>
123
+    </select>
5
 </mapper>
124
 </mapper>

+ 81
- 12
src/main/resources/mapper/TaSalesBatchMapper.xml View File

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.huiju.estateagents.mapper.TaSalesBatchMapper">
3
 <mapper namespace="com.huiju.estateagents.mapper.TaSalesBatchMapper">
4
     <update id="updateSalesBatchStatus">
4
     <update id="updateSalesBatchStatus">
5
-      update ta_sales_batch t set t.status = -1
6
-      where t.org_id = #{orgId}
7
-      and t.sales_batch_id in
8
-      <foreach collection="taSalesBatchList" item="taSalesBatch" open="(" close=")" separator=",">
9
-         #{taSalesBatch.salesBatchId}
10
-      </foreach>
5
+        update ta_sales_batch t set t.status = -1
6
+        where t.org_id = #{orgId}
7
+        and t.sales_batch_id in
8
+        <foreach collection="taSalesBatchList" item="taSalesBatch" open="(" close=")" separator=",">
9
+            #{taSalesBatch.salesBatchId}
10
+        </foreach>
11
     </update>
11
     </update>
12
 
12
 
13
     <select id="selectByCondition" resultType="com.huiju.estateagents.entity.TaSalesBatch">
13
     <select id="selectByCondition" resultType="com.huiju.estateagents.entity.TaSalesBatch">
32
     </select>
32
     </select>
33
 
33
 
34
     <select id="countPreSelectRecord" resultType="java.lang.Integer">
34
     <select id="countPreSelectRecord" resultType="java.lang.Integer">
35
-      select count(*) from ta_preselection_record t
36
-      where t.org_id = #{orgId}
37
-      and t.sales_batch_id in
38
-      <foreach collection="taSalesBatchList" item="taSalesBatch" open="(" close=")" separator=",">
39
-          #{taSalesBatch.salesBatchId}
40
-      </foreach>
35
+        select count(*) from ta_preselection_record t
36
+        where t.org_id = #{orgId}
37
+        and t.sales_batch_id in
38
+        <foreach collection="taSalesBatchList" item="taSalesBatch" open="(" close=")" separator=",">
39
+            #{taSalesBatch.salesBatchId}
40
+        </foreach>
41
     </select>
41
     </select>
42
 
42
 
43
     <select id="getTotalHousesAndHeat" resultType="java.util.Map">
43
     <select id="getTotalHousesAndHeat" resultType="java.util.Map">
50
         WHERE
50
         WHERE
51
             t.STATUS = 1 and t.sales_batch_id = #{salesBatchId}
51
             t.STATUS = 1 and t.sales_batch_id = #{salesBatchId}
52
     </select>
52
     </select>
53
+
54
+    <select id="listSalesBatchForPreselect" resultType="com.huiju.estateagents.entity.TaSalesBatch">
55
+            SELECT
56
+                t.*,
57
+                a.building_name,
58
+                a.real_heat preselectCount
59
+            FROM
60
+                ta_sales_batch t
61
+            LEFT JOIN ta_housing_resources a ON t.building_id = a.building_id
62
+            WHERE
63
+                t.org_id = #{orgId}
64
+                AND t.STATUS != - 1
65
+                AND t.preselection_start_time IS NOT NULL
66
+                AND t.preselection_end_time IS NOT NULL
67
+            <if test="buildingId != null and buildingId != ''">
68
+                and t.building_id = #{buildingId}
69
+            </if>
70
+            <if test="salesBatchName != null and salesBatchName != ''">
71
+                and t.sales_batch_name like CONCAT('%',#{salesBatchName}, '%')
72
+            </if>
73
+            <if test="status != null">
74
+                and t.status = #{status}
75
+            </if>
76
+            <if test="personBuildingList != null and personBuildingList.size > 0">
77
+                AND t.building_id in
78
+                <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
79
+                    #{personBuilding.buildingId}
80
+                </foreach>
81
+            </if>
82
+
83
+    </select>
84
+
85
+
86
+    <select id="listSalesBatchForRaise" resultType="com.huiju.estateagents.entity.TaSalesBatch">
87
+        SELECT
88
+            t.*,
89
+            a.building_name,
90
+            r.raise_id ,
91
+            r.`status` raiseStaus,
92
+            r.house_locking_type ,
93
+            r.raise_start_time ,
94
+            r.raise_end_time ,
95
+            r.raise_price ,
96
+            r.pay_type ,
97
+            (SELECT COUNT( * ) FROM ta_raise_record r2  where r2.raise_id = r.raise_id and r2.`status` != -1) raiseCount
98
+        FROM
99
+            ta_sales_batch t
100
+            LEFT JOIN ta_building a ON t.building_id = a.building_id
101
+            INNER JOIN ta_raise r ON t.sales_batch_id = r.sales_batch_id
102
+        WHERE
103
+            t.org_id = #{orgId}
104
+            AND t.STATUS != - 1
105
+            AND r.`status` != -1
106
+        <if test="buildingId != null and buildingId != ''">
107
+            and t.building_id = #{buildingId}
108
+        </if>
109
+        <if test="salesBatchName != null and salesBatchName != ''">
110
+            and t.sales_batch_name like CONCAT('%',#{salesBatchName}, '%')
111
+        </if>
112
+        <if test="status != null">
113
+            and t.status = #{status}
114
+        </if>
115
+        <if test="personBuildingList != null and personBuildingList.size > 0">
116
+            AND t.building_id in
117
+            <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
118
+                #{personBuilding.buildingId}
119
+            </foreach>
120
+        </if>
121
+    </select>
53
 </mapper>
122
 </mapper>