顾绍勇 5 jaren geleden
bovenliggende
commit
0ed7d7e8d2

+ 26
- 9
src/main/java/com/huiju/estateagents/controller/TaSalesBatchController.java Bestand weergeven

312
 
312
 
313
     @RequestMapping(value = "/admin/salesBatchList", method = RequestMethod.GET)
313
     @RequestMapping(value = "/admin/salesBatchList", method = RequestMethod.GET)
314
     public ResponseBean salesBatchList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
314
     public ResponseBean salesBatchList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
315
-                                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
316
-                                         @RequestParam(value = "salesBatchName", required = false) String salesBatchName,
317
-                                         @RequestParam(value = "buildingId", required = false) String buildingId,
318
-                                         @RequestParam(value = "status", required = false) Integer status, HttpServletRequest request) {
315
+                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
316
+                                       @RequestParam(value = "salesBatchName", required = false) String salesBatchName,
317
+                                       @RequestParam(value = "buildingId", required = false) String buildingId,
318
+                                       @RequestParam(value = "status", required = false) Integer status, HttpServletRequest request) {
319
         ResponseBean responseBean = new ResponseBean();
319
         ResponseBean responseBean = new ResponseBean();
320
         try {
320
         try {
321
             //使用分页插件
321
             //使用分页插件
334
 
334
 
335
     /**
335
     /**
336
      * 查询销售批次列表--小程序
336
      * 查询销售批次列表--小程序
337
-     *
338
      */
337
      */
339
     @RequestMapping(value = "/wx/taSalesBatch/choice", method = RequestMethod.GET)
338
     @RequestMapping(value = "/wx/taSalesBatch/choice", method = RequestMethod.GET)
340
-    public ResponseBean taSalesBatchGetForMiniApp(@RequestParam(value = "buildingId", required = false) String buildingId,HttpServletRequest request) {
339
+    public ResponseBean taSalesBatchGetForMiniApp(@RequestParam(value = "buildingId", required = false) String buildingId, HttpServletRequest request) {
341
         ResponseBean responseBean = new ResponseBean();
340
         ResponseBean responseBean = new ResponseBean();
342
         try {
341
         try {
343
             QueryWrapper<TaSalesBatch> taSalesBatchQueryWrapper = new QueryWrapper<>();
342
             QueryWrapper<TaSalesBatch> taSalesBatchQueryWrapper = new QueryWrapper<>();
344
-            taSalesBatchQueryWrapper.eq("org_id",getOrgId(request));
345
-            taSalesBatchQueryWrapper.eq(!StringUtils.isEmpty(buildingId),"building_id",buildingId);
346
-            taSalesBatchQueryWrapper.eq("status",CommConstant.STATUS_NORMAL);
343
+            taSalesBatchQueryWrapper.eq("org_id", getOrgId(request));
344
+            taSalesBatchQueryWrapper.eq(!StringUtils.isEmpty(buildingId), "building_id", buildingId);
345
+            taSalesBatchQueryWrapper.eq("status", CommConstant.STATUS_NORMAL);
347
             List<TaSalesBatch> list = iTaSalesBatchService.list(taSalesBatchQueryWrapper);
346
             List<TaSalesBatch> list = iTaSalesBatchService.list(taSalesBatchQueryWrapper);
348
             responseBean.addSuccess(list);
347
             responseBean.addSuccess(list);
349
         } catch (Exception e) {
348
         } catch (Exception e) {
354
         return responseBean;
353
         return responseBean;
355
     }
354
     }
356
 
355
 
356
+    /**
357
+     * 根据销售批次查询项目信息
358
+     *
359
+     * @param request
360
+     * @return
361
+     */
362
+    @RequestMapping(value = "/admin/taSalesBatch/getBuildingById/{id}", method = RequestMethod.GET)
363
+    public ResponseBean getBuildingById(@PathVariable("id") Integer id, HttpServletRequest request) {
364
+        ResponseBean responseBean = new ResponseBean();
365
+        try {
366
+            responseBean = iTaSalesBatchService.getBuildingById(id, getOrgId(request));
367
+        } catch (Exception e) {
368
+            logger.error("taSalesBatchGetForMiniApp -=- {}", e);
369
+            responseBean.addError(e.getMessage());
370
+        }
371
+        return responseBean;
372
+    }
373
+
357
 }
374
 }

+ 6
- 0
src/main/java/com/huiju/estateagents/entity/TaPreselection.java Bestand weergeven

107
      */
107
      */
108
     @TableField(exist = false)
108
     @TableField(exist = false)
109
     private Integer preNum;
109
     private Integer preNum;
110
+
111
+    /**
112
+     * 销售批次状态
113
+     */
114
+    @TableField(exist = false)
115
+    private Integer salesBatchStatus;
110
 }
116
 }

+ 6
- 0
src/main/java/com/huiju/estateagents/entity/TaRaise.java Bestand weergeven

156
      */
156
      */
157
     @TableField(exist = false)
157
     @TableField(exist = false)
158
     private TaRaiseRecord record;
158
     private TaRaiseRecord record;
159
+
160
+    /**
161
+     * 销售批次状态
162
+     */
163
+    @TableField(exist = false)
164
+    private Integer salesBatchStatus;
159
 }
165
 }

+ 10
- 0
src/main/java/com/huiju/estateagents/mapper/TaSalesBatchMapper.java Bestand weergeven

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;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.huiju.estateagents.entity.TaBuilding;
5
 import com.huiju.estateagents.entity.TaHousingResources;
6
 import com.huiju.estateagents.entity.TaHousingResources;
6
 import com.huiju.estateagents.entity.TaPersonBuilding;
7
 import com.huiju.estateagents.entity.TaPersonBuilding;
7
 import com.huiju.estateagents.entity.TaSalesBatch;
8
 import com.huiju.estateagents.entity.TaSalesBatch;
42
      */
43
      */
43
     Map<String, Object> getTotalHousesAndHeat(@Param("salesBatchId") Integer salesBatchId);
44
     Map<String, Object> getTotalHousesAndHeat(@Param("salesBatchId") Integer salesBatchId);
44
 
45
 
46
+    /**
47
+     * 根据销售批次获取项目信息
48
+     *
49
+     * @param salesBatchId
50
+     * @param orgId
51
+     * @return
52
+     */
53
+    TaBuilding getBuildingById(@Param("salesBatchId") Integer salesBatchId,
54
+                               @Param("orgId") Integer orgId);
45
 }
55
 }

+ 8
- 0
src/main/java/com/huiju/estateagents/service/ITaSalesBatchService.java Bestand weergeven

36
      * @return
36
      * @return
37
      */
37
      */
38
     ResponseBean getSalesBatchById(Integer salesBatchId);
38
     ResponseBean getSalesBatchById(Integer salesBatchId);
39
+
40
+    /**
41
+     *
42
+     * @param salesBatchId
43
+     * @param orgId
44
+     * @return
45
+     */
46
+    ResponseBean getBuildingById(Integer salesBatchId,Integer orgId);
39
 }
47
 }

+ 7
- 0
src/main/java/com/huiju/estateagents/service/impl/TaSalesBatchServiceImpl.java Bestand weergeven

195
         responseBean.addSuccess(result);
195
         responseBean.addSuccess(result);
196
         return responseBean;
196
         return responseBean;
197
     }
197
     }
198
+
199
+    @Override
200
+    public ResponseBean getBuildingById(Integer salesBatchId, Integer orgId) {
201
+        ResponseBean responseBean = new ResponseBean();
202
+        responseBean.addSuccess(taSalesBatchMapper.getBuildingById(salesBatchId, orgId));
203
+        return responseBean;
204
+    }
198
 }
205
 }

+ 3
- 1
src/main/resources/mapper/TaPreselectionMapper.xml Bestand weergeven

8
             t2.sales_number,t2.sales_batch_name,t2.remark,
8
             t2.sales_number,t2.sales_batch_name,t2.remark,
9
             t2.sales_number,
9
             t2.sales_number,
10
             t2.remark,
10
             t2.remark,
11
+            t2.status salesBatchStatus,
11
             t3.building_name,
12
             t3.building_name,
12
             ( 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
13
             ( 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
13
         FROM
14
         FROM
17
         WHERE
18
         WHERE
18
             t.org_id = #{orgId}
19
             t.org_id = #{orgId}
19
             AND t.STATUS != - 1
20
             AND t.STATUS != - 1
21
+            AND t2.STATUS != -1
20
         <if test="buildingId != null and buildingId != ''">
22
         <if test="buildingId != null and buildingId != ''">
21
             and t2.building_id = #{buildingId}
23
             and t2.building_id = #{buildingId}
22
         </if>
24
         </if>
24
             and t2.sales_batch_name like CONCAT('%',#{salesBatchName}, '%')
26
             and t2.sales_batch_name like CONCAT('%',#{salesBatchName}, '%')
25
         </if>
27
         </if>
26
         <if test="status != null">
28
         <if test="status != null">
27
-            and t.status = #{status}
29
+            and t2.status = #{status}
28
         </if>
30
         </if>
29
         <if test="personBuildingList != null and personBuildingList.size > 0">
31
         <if test="personBuildingList != null and personBuildingList.size > 0">
30
             AND t2.building_id in
32
             AND t2.building_id in

+ 3
- 1
src/main/resources/mapper/TaRaiseMapper.xml Bestand weergeven

8
             t2.sales_batch_name,
8
             t2.sales_batch_name,
9
             t2.sales_number,
9
             t2.sales_number,
10
             t2.remark,
10
             t2.remark,
11
+            t2.status salesBatchStatus,
11
             t3.building_name,
12
             t3.building_name,
12
             ( SELECT sum( th.raise_real_heat ) FROM ta_housing_resources th WHERE th.sales_batch_id = t2.sales_batch_id AND th.`status` = 1 ) raise_real_heat
13
             ( SELECT sum( th.raise_real_heat ) FROM ta_housing_resources th WHERE th.sales_batch_id = t2.sales_batch_id AND th.`status` = 1 ) raise_real_heat
13
         FROM
14
         FROM
17
         WHERE
18
         WHERE
18
             t.org_id = #{orgId}
19
             t.org_id = #{orgId}
19
             AND t.`status` != - 1
20
             AND t.`status` != - 1
21
+            AND t2.status != -1
20
         <if test="buildingId != null and buildingId != ''">
22
         <if test="buildingId != null and buildingId != ''">
21
             and t3.building_id = #{buildingId}
23
             and t3.building_id = #{buildingId}
22
         </if>
24
         </if>
24
             and t2.sales_batch_name like CONCAT('%',#{salesBatchName}, '%')
26
             and t2.sales_batch_name like CONCAT('%',#{salesBatchName}, '%')
25
         </if>
27
         </if>
26
         <if test="status != null">
28
         <if test="status != null">
27
-            and t.status = #{status}
29
+            and t2.status = #{status}
28
         </if>
30
         </if>
29
         <if test="personBuildingList != null and personBuildingList.size > 0">
31
         <if test="personBuildingList != null and personBuildingList.size > 0">
30
             AND t2.building_id in
32
             AND t2.building_id in

+ 15
- 0
src/main/resources/mapper/TaSalesBatchMapper.xml Bestand weergeven

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="getBuildingById" resultType="com.huiju.estateagents.entity.TaBuilding">
55
+
56
+        SELECT
57
+            t2.*
58
+        FROM
59
+            ta_sales_batch t,
60
+            ta_building t2
61
+        WHERE
62
+            t.building_id = t2.building_id
63
+            AND t.sales_batch_id = #{salesBatchId}
64
+            AND t.org_id = #{orgId}
65
+            AND t.`status` != -1
66
+
67
+    </select>
53
 </mapper>
68
 </mapper>