魏超 преди 5 години
родител
ревизия
9f376124d3

+ 1
- 1
src/main/java/com/huiju/estateagents/controller/TaPreselectionController.java Целия файл

@@ -208,7 +208,7 @@ public class TaPreselectionController extends BaseController {
208 208
      * @param taPreselection 实体对象
209 209
      * @return
210 210
      */
211
-    @RequestMapping(value = "/taPreselection/{id}", method = RequestMethod.PUT)
211
+    @RequestMapping(value = "/admin/taPreselection/{id}", method = RequestMethod.PUT)
212 212
     public ResponseBean taPreselectionUpdate(@PathVariable Integer id,
213 213
                                              @RequestBody TaPreselection taPreselection,
214 214
                                              HttpServletRequest request) {

+ 17
- 0
src/main/java/com/huiju/estateagents/entity/TaPreselection.java Целия файл

@@ -56,6 +56,11 @@ public class TaPreselection implements Serializable {
56 56
      */
57 57
     private Integer status;
58 58
 
59
+    /**
60
+     * 项目id
61
+     */
62
+    private String buildingId;
63
+
59 64
     /**
60 65
      * 创建时间
61 66
      */
@@ -79,6 +84,12 @@ public class TaPreselection implements Serializable {
79 84
     @TableField(exist = false)
80 85
     private String salesBatchName;
81 86
 
87
+    /**
88
+     * 备注
89
+     */
90
+    @TableField(exist = false)
91
+    private String remark;
92
+
82 93
     /**
83 94
      * 二维码
84 95
      */
@@ -90,4 +101,10 @@ public class TaPreselection implements Serializable {
90 101
      */
91 102
     @TableField(exist = false)
92 103
     private Integer realHeat;
104
+
105
+    /**
106
+     * 预选实际热度
107
+     */
108
+    @TableField(exist = false)
109
+    private Integer preNum;
93 110
 }

+ 2
- 2
src/main/java/com/huiju/estateagents/entity/TaPreselectionRecord.java Целия файл

@@ -76,7 +76,7 @@ public class TaPreselectionRecord implements Serializable {
76 76
     private String buildingId;
77 77
 
78 78
     /**
79
-     * 预选id
79
+     * 预选idtaSalesBatch
80 80
      */
81
-    private String preselectId;
81
+    private String preselectionId;
82 82
 }

+ 8
- 2
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionServiceImpl.java Целия файл

@@ -47,7 +47,13 @@ public class TaPreselectionServiceImpl extends ServiceImpl<TaPreselectionMapper,
47 47
 
48 48
         ResponseBean responseBean = new ResponseBean();
49 49
         IPage<TaPreselection> pg = new Page<>(pageNum, pageSize);
50
-        responseBean.addSuccess(taPreselectionMapper.listPresecretByCondition(pg, salesBatchName, buildingId, orgId, status, taPersonBuildingListByUserId));
50
+        IPage<TaPreselection>  taPreselectionIPage = taPreselectionMapper.listPresecretByCondition(pg, salesBatchName, buildingId, orgId, status, taPersonBuildingListByUserId);
51
+        taPreselectionIPage.getRecords().forEach(e->{
52
+            QueryWrapper<TaPreselectionRecord> taPreselectionRecordQueryWrapper = new QueryWrapper<>();
53
+            taPreselectionRecordQueryWrapper.eq("sales_batch_id", e.getSalesBatchId());
54
+            e.setPreNum(taPreselectionRecordMapper.selectCount(taPreselectionRecordQueryWrapper));
55
+        });
56
+        responseBean.addSuccess(taPreselectionIPage);
51 57
         return responseBean;
52 58
     }
53 59
 
@@ -65,7 +71,7 @@ public class TaPreselectionServiceImpl extends ServiceImpl<TaPreselectionMapper,
65 71
             preselectionRecordQueryWrapper.eq("status", 1);
66 72
             List<TaPreselectionRecord> tpList = taPreselectionRecordMapper.selectList(preselectionRecordQueryWrapper);
67 73
             if (CollectionUtils.isNotEmpty(tpList)) {
68
-                responseBean.addError(String.format("销售批次%s已有用户预选,请先删除预选记录。", tp.getSalesBatchId()));
74
+                responseBean.addError(String.format("销售批次%s已有用户预选,请先删除预选记录。", tp.getSalesBatchName()));
69 75
                 return responseBean;
70 76
             }
71 77
         }

+ 3
- 4
src/main/resources/mapper/TaPreselectionMapper.xml Целия файл

@@ -5,13 +5,13 @@
5 5
     <select id="listPresecretByCondition" resultType="com.huiju.estateagents.entity.TaPreselection">
6 6
         SELECT
7 7
         t.*,
8
-        t2.sales_number,
8
+        t2.sales_number,t2.sales_batch_name,t2.remark,
9 9
         t3.building_name,
10 10
         ( SELECT sum( th.real_heat ) FROM ta_housing_resources th WHERE th.sales_batch_id = t2.sales_batch_id AND th.`status` = 1 ) real_heat
11 11
         FROM
12 12
         ta_preselection t
13 13
         LEFT JOIN ta_sales_batch t2 ON t.sales_batch_id = t2.sales_batch_id
14
-        LEFT JOIN ta_building t3 ON t2.building_id = t3.building_id
14
+        LEFT JOIN ta_building t3 ON t.building_id = t3.building_id
15 15
         WHERE
16 16
         t.org_id = #{orgId}
17 17
         AND t.STATUS != - 1
@@ -43,8 +43,7 @@
43 43
         SELECT
44 44
             t.*,
45 45
             t2.qr_code,
46
-            t2.sales_batch_name,
47
-            t2.building_id
46
+            t2.sales_batch_name
48 47
         FROM
49 48
             ta_preselection t,
50 49
             ta_sales_batch t2