Browse Source

新需求

weichaochao 5 years ago
parent
commit
370c0dd8d0

+ 24
- 2
src/main/java/com/huiju/estateagents/controller/TaPreselectionRecordController.java View File

@@ -15,6 +15,8 @@ import org.slf4j.LoggerFactory;
15 15
 import org.springframework.beans.factory.annotation.Autowired;
16 16
 import org.springframework.web.bind.annotation.*;
17 17
 
18
+import javax.servlet.http.HttpServletRequest;
19
+
18 20
 /**
19 21
  * <p>
20 22
  * 预选记录表  前端控制器
@@ -24,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
24 26
  * @since 2020-02-10
25 27
  */
26 28
 @RestController
27
-@RequestMapping("/")
29
+@RequestMapping("/api")
28 30
 public class TaPreselectionRecordController extends BaseController {
29 31
 
30 32
     private final Logger logger = LoggerFactory.getLogger(TaPreselectionRecordController.class);
@@ -41,7 +43,7 @@ public class TaPreselectionRecordController extends BaseController {
41 43
      * @return
42 44
      * @author gushaoyong
43 45
      */
44
-    @RequestMapping(value = "/taPreselectionRecord", method = RequestMethod.GET)
46
+    @RequestMapping(value = "/admin/taPreselectionRecord", method = RequestMethod.GET)
45 47
     public ResponseBean taPreselectionRecordList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
46 48
                                                  @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
47 49
         ResponseBean responseBean = new ResponseBean();
@@ -223,4 +225,24 @@ public class TaPreselectionRecordController extends BaseController {
223 225
         }
224 226
         return responseBean;
225 227
     }
228
+
229
+    @RequestMapping(value = "/admin/taPreselectRecord", method = RequestMethod.GET)
230
+    public ResponseBean selectPreSelectRecordList(@RequestParam(value = "pageNum", defaultValue = "1")Integer pageNum,
231
+                                                  @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize,
232
+                                                  @RequestParam(value = "salesBatchId")String salesBatchId,
233
+                                                  @RequestParam(value = "houseId", required = false)Integer houseId,
234
+                                                  @RequestParam(value = "phone", required = false) String phone,
235
+                                                  @RequestParam(value = "apartmentId", required = false) String apartmentId,
236
+                                                  @RequestParam(value = "status", required = false) Integer status,
237
+                                                  HttpServletRequest request){
238
+        ResponseBean responseBean = new ResponseBean();
239
+        try {
240
+            responseBean = iTaPreselectionRecordService.selectPreSelectRecordList(pageNum, pageSize, salesBatchId, houseId, getOrgId(request), phone, apartmentId, status);
241
+        } catch (Exception e) {
242
+            e.printStackTrace();
243
+            logger.error("taHousingResourcesList -=- {}", e.toString());
244
+            responseBean.addError(e.getMessage());
245
+        }
246
+        return responseBean;
247
+    }
226 248
 }

+ 22
- 0
src/main/java/com/huiju/estateagents/mapper/TaPreselectionRecordMapper.java View File

@@ -2,12 +2,15 @@ package com.huiju.estateagents.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 6
 import com.huiju.estateagents.entity.TaPreselectionRecord;
6 7
 import com.huiju.estateagents.po.TaPreselectionRecordPO;
7 8
 import org.apache.ibatis.annotations.Mapper;
8 9
 import org.apache.ibatis.annotations.Param;
9 10
 import org.springframework.stereotype.Component;
10 11
 
12
+import java.util.List;
13
+
11 14
 /**
12 15
  * <p>
13 16
  * 预选记录表  Mapper 接口
@@ -38,4 +41,23 @@ public interface TaPreselectionRecordMapper extends BaseMapper<TaPreselectionRec
38 41
      */
39 42
     TaPreselectionRecord getRecordByPersonIdAndHouseId(@Param("personId") String personId,
40 43
                                                        @Param("houseId") String houseId);
44
+
45
+    /**
46
+     * 查询预选记录表
47
+     * @param page
48
+     * @param salesBatchId
49
+     * @param houseId
50
+     * @param orgId
51
+     * @param phone
52
+     * @param apartmentId
53
+     * @param status
54
+     * @return
55
+     */
56
+    List<TaPreselectionRecord> selectPreSelectRecordList(Page page,
57
+                                                         @Param("salesBatchId") String salesBatchId,
58
+                                                         @Param("houseId") Integer houseId,
59
+                                                         @Param("orgId") Integer orgId,
60
+                                                         @Param("phone") String phone,
61
+                                                         @Param("apartmentId") String apartmentId,
62
+                                                         @Param("status") Integer status);
41 63
 }

+ 25
- 0
src/main/java/com/huiju/estateagents/po/TaPreselectionRecordPO.java View File

@@ -58,4 +58,29 @@ public class TaPreselectionRecordPO extends TaPreselectionRecord {
58 58
      */
59 59
     @TableField(exist = false)
60 60
     private List<TaBuildingImg> buildingImgList;
61
+
62
+    /**
63
+     * 用户昵称
64
+     */
65
+    private String nameOrnick;
66
+
67
+    /**
68
+     * 用户U型明
69
+     */
70
+    private String name;
71
+
72
+    /**
73
+     * 用户头像
74
+     */
75
+    private String avatarurl;
76
+
77
+    /**
78
+     * 手机号
79
+     */
80
+    private String phone;
81
+
82
+    /**
83
+     * 最后修改人
84
+     */
85
+    private String updateName;
61 86
 }

+ 2
- 0
src/main/java/com/huiju/estateagents/service/ITaPreselectionRecordService.java View File

@@ -52,4 +52,6 @@ public interface ITaPreselectionRecordService extends IService<TaPreselectionRec
52 52
      */
53 53
     TaPreselectionRecord checkPreselect(String personId, String houseId);
54 54
 
55
+    ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status);
56
+
55 57
 }

+ 10
- 0
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionRecordServiceImpl.java View File

@@ -11,6 +11,7 @@ import com.huiju.estateagents.common.DateUtils;
11 11
 import com.huiju.estateagents.entity.TaApartmentImg;
12 12
 import com.huiju.estateagents.entity.TaBuildingImg;
13 13
 import com.huiju.estateagents.entity.TaPreselectionRecord;
14
+import com.huiju.estateagents.entity.TaSharePersonFrom;
14 15
 import com.huiju.estateagents.mapper.TaApartmentImgMapper;
15 16
 import com.huiju.estateagents.mapper.TaBuildingImgMapper;
16 17
 import com.huiju.estateagents.mapper.TaHousingResourcesMapper;
@@ -162,4 +163,13 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
162 163
 
163 164
         return taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
164 165
     }
166
+
167
+    @Override
168
+    public ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status) {
169
+        Page page = new Page(pageNum, pageSize);
170
+        // 分页查询
171
+        List<TaPreselectionRecord> list = taPreselectionRecordMapper.selectPreSelectRecordList(page, salesBatchId, houseId, orgId, phone, apartmentId, status);
172
+        page.setRecords(list);
173
+        return ResponseBean.success(page);
174
+    }
165 175
 }

+ 32
- 0
src/main/resources/mapper/TaPreselectionRecordMapper.xml View File

@@ -39,4 +39,36 @@
39 39
             AND t.house_id = #{houseId}
40 40
     </select>
41 41
 
42
+    <select id="selectPreSelectRecordList" resultType="com.huiju.estateagents.po.TaPreselectionRecordPO">
43
+        select t.house_id,
44
+        a.block_id as blockName,
45
+        a.unit_id as unitName,
46
+        a.floor_id as floorName,
47
+        a.room_id as roomName,
48
+        a.apartment_id,
49
+        b.nickname as nameOrnick,
50
+        b.`name`,
51
+        b.avatarurl,
52
+        b.phone,
53
+        t.`status`,
54
+        t.update_date,
55
+        (select name from ta_person t where (t.user_id = t.update_user || t.person_id = t.update_user)) as updateName
56
+        from ta_preselection_record t
57
+        left join ta_housing_resources a on t.house_id = a.house_id
58
+        left join ta_person b on t.person_id = b.person_id
59
+        where b.org_id = #{orgId} and a.sales_batch_id = #{salesBatchId}
60
+        <if test="houseId != null and houseId !=''">
61
+          and t.house_id = #{houseId}
62
+        </if>
63
+        <if test="phone != null and phone != ''">
64
+          and b.phone = #{phone}
65
+        </if>
66
+        <if test="apartmentId != null and apartmentId != ''">
67
+          and a.apartment_id = #{apartmentId}
68
+        </if>
69
+        <if test="status != null">
70
+          and t.status = #{status}
71
+        </if>
72
+    </select>
73
+
42 74
 </mapper>