Browse Source

* bug修复

顾绍勇 5 years ago
parent
commit
d591e95d87

+ 3
- 4
src/main/java/com/huiju/estateagents/controller/TaPreselectionRecordController.java View File

167
     /**
167
     /**
168
      * 取消房源预选
168
      * 取消房源预选
169
      *
169
      *
170
-     * @param personId 用户ID
171
      * @return
170
      * @return
172
      */
171
      */
173
     @RequestMapping(value = "/wx/taPreselectionRecordCancel", method = RequestMethod.DELETE)
172
     @RequestMapping(value = "/wx/taPreselectionRecordCancel", method = RequestMethod.DELETE)
174
-    public ResponseBean taPreselectionRecordCancel(@RequestParam("personId") String personId,
175
-                                                   @RequestParam("houseId") String houseId) {
173
+    public ResponseBean taPreselectionRecordCancel(@RequestParam("houseId") String houseId,
174
+                                                   @RequestParam("preselectionRecordId") String preselectionRecordId) {
176
         ResponseBean responseBean = new ResponseBean();
175
         ResponseBean responseBean = new ResponseBean();
177
         try {
176
         try {
178
-            responseBean = iTaPreselectionRecordService.taPreselectionRecordCancel(personId, houseId);
177
+            responseBean = iTaPreselectionRecordService.taPreselectionRecordCancel( houseId, preselectionRecordId);
179
         } catch (Exception e) {
178
         } catch (Exception e) {
180
             logger.error("taPreselectionRecordCancel -=- {}", e);
179
             logger.error("taPreselectionRecordCancel -=- {}", e);
181
             responseBean.addError(e.getMessage());
180
             responseBean.addError(e.getMessage());

+ 3
- 12
src/main/java/com/huiju/estateagents/service/ITaPreselectionRecordService.java View File

38
     /**
38
     /**
39
      * 取消预选
39
      * 取消预选
40
      *
40
      *
41
-     * @param personId 用户ID
42
-     * @param houseId  房源ID
41
+     * @param houseId     房源ID
42
+     * @param preselectionRecordId 预选表ID
43
      * @return
43
      * @return
44
      */
44
      */
45
-    ResponseBean taPreselectionRecordCancel(String personId, String houseId);
46
-
47
-    /**
48
-     * 校验用户是否预选
49
-     *
50
-     * @param personId 用户ID
51
-     * @param houseId  房源ID
52
-     * @return
53
-     */
54
-    TaPreselectionRecord checkPreselect(String personId, String houseId);
45
+    ResponseBean taPreselectionRecordCancel(String houseId, String preselectionRecordId);
55
 
46
 
56
     ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status);
47
     ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status);
57
 
48
 

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaHousingResourcesServiceImpl.java View File

161
 
161
 
162
         // 获取该用户是否预选房源信息
162
         // 获取该用户是否预选房源信息
163
         TaPreselectionRecord taPreselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
163
         TaPreselectionRecord taPreselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
164
-        if (taPreselectionRecord != null && taPreselectionRecord.getStatus() == 1) {
164
+        if (taPreselectionRecord != null) {
165
             resourcesPO.setIsPreselect(true);
165
             resourcesPO.setIsPreselect(true);
166
         } else {
166
         } else {
167
             resourcesPO.setIsPreselect(false);
167
             resourcesPO.setIsPreselect(false);

+ 4
- 11
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionRecordServiceImpl.java View File

99
         // 校验用户是否已经预选房源
99
         // 校验用户是否已经预选房源
100
         TaPreselectionRecord record = taPreselectionRecordMapper
100
         TaPreselectionRecord record = taPreselectionRecordMapper
101
                 .getRecordByPersonIdAndHouseId(taPreselectionRecord.getPersonId(), taPreselectionRecord.getHouseId());
101
                 .getRecordByPersonIdAndHouseId(taPreselectionRecord.getPersonId(), taPreselectionRecord.getHouseId());
102
-        if (record != null && 1 == record.getStatus()) {
102
+        if (record != null) {
103
             responseBean.addError("已预选过此房源,请到选房记录中查看。");
103
             responseBean.addError("已预选过此房源,请到选房记录中查看。");
104
             return responseBean;
104
             return responseBean;
105
         }
105
         }
146
 
146
 
147
     @Override
147
     @Override
148
     @Transactional
148
     @Transactional
149
-    public ResponseBean taPreselectionRecordCancel(String personId, String houseId) {
150
-        logger.info("taPreselectionRecordCancel 接收参数:personId:{},houseId:{}", personId, houseId);
149
+    public ResponseBean taPreselectionRecordCancel(String houseId, String preselectionRecordId) {
150
+        logger.info("taPreselectionRecordCancel 接收参数:houseId:{},preselectionRecordId:{}", houseId, preselectionRecordId);
151
 
151
 
152
         ResponseBean responseBean = new ResponseBean<>();
152
         ResponseBean responseBean = new ResponseBean<>();
153
         // 校验是否已经取消
153
         // 校验是否已经取消
154
-        TaPreselectionRecord preselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
154
+        TaPreselectionRecord preselectionRecord = getById(preselectionRecordId);
155
         if (preselectionRecord == null || 1 != preselectionRecord.getStatus()) {
155
         if (preselectionRecord == null || 1 != preselectionRecord.getStatus()) {
156
             responseBean.addError("未预选过此房源,或已取消预选此房源");
156
             responseBean.addError("未预选过此房源,或已取消预选此房源");
157
             return responseBean;
157
             return responseBean;
181
         return responseBean;
181
         return responseBean;
182
     }
182
     }
183
 
183
 
184
-    @Override
185
-    public TaPreselectionRecord checkPreselect(String personId, String houseId) {
186
-        logger.info("checkPreselect 接收参数:personId:{},houseId:{}", personId, houseId);
187
-
188
-        return taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
189
-    }
190
-
191
     @Override
184
     @Override
192
     public ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status) {
185
     public ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status) {
193
         Page page = new Page(pageNum, pageSize);
186
         Page page = new Page(pageNum, pageSize);

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

57
             AND t.`status` > 0
57
             AND t.`status` > 0
58
           ) t5
58
           ) t5
59
         ORDER BY
59
         ORDER BY
60
-            REPLACE ( CONVERT ( t5.termName USING ascii ), '?', '' ) + 0,
61
-            REPLACE ( CONVERT ( t5.block_name USING ascii ), '?', '' ) + 0,
62
-            REPLACE ( CONVERT ( t5.unit_name USING ascii ), '?', '' ) + 0,
63
-            REPLACE ( CONVERT ( t5.floor_name USING ascii ), '?', '' ) + 0 desc ,
64
-            REPLACE ( CONVERT ( t5.room_name USING ascii ), '?', '' ) + 0
60
+            REPLACE ( CONVERT ( t5.termName USING ascii ), '?', '' ) ,
61
+            REPLACE ( CONVERT ( t5.block_name USING ascii ), '?', '' ) ,
62
+            REPLACE ( CONVERT ( t5.unit_name USING ascii ), '?', '' ) ,
63
+            REPLACE ( CONVERT ( t5.floor_name USING ascii ), '?', '' ) desc ,
64
+            REPLACE ( CONVERT ( t5.room_name USING ascii ), '?', '' )
65
     </select>
65
     </select>
66
 
66
 
67
     <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">
67
     <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">

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

47
         WHERE
47
         WHERE
48
             t.person_id = #{personId}
48
             t.person_id = #{personId}
49
             AND t.house_id = #{houseId}
49
             AND t.house_id = #{houseId}
50
+            AND t.status = 1
50
     </select>
51
     </select>
51
 
52
 
52
     <select id="selectPreSelectRecordList" resultType="com.huiju.estateagents.po.TaPreselectionRecordPO">
53
     <select id="selectPreSelectRecordList" resultType="com.huiju.estateagents.po.TaPreselectionRecordPO">