Procházet zdrojové kódy

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents into dev

weichaochao před 5 roky
rodič
revize
439cf8e1ce

+ 3
- 4
src/main/java/com/huiju/estateagents/controller/TaPreselectionRecordController.java Zobrazit soubor

@@ -167,15 +167,14 @@ public class TaPreselectionRecordController extends BaseController {
167 167
     /**
168 168
      * 取消房源预选
169 169
      *
170
-     * @param personId 用户ID
171 170
      * @return
172 171
      */
173 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 175
         ResponseBean responseBean = new ResponseBean();
177 176
         try {
178
-            responseBean = iTaPreselectionRecordService.taPreselectionRecordCancel(personId, houseId);
177
+            responseBean = iTaPreselectionRecordService.taPreselectionRecordCancel( houseId, preselectionRecordId);
179 178
         } catch (Exception e) {
180 179
             logger.error("taPreselectionRecordCancel -=- {}", e);
181 180
             responseBean.addError(e.getMessage());

+ 3
- 12
src/main/java/com/huiju/estateagents/service/ITaPreselectionRecordService.java Zobrazit soubor

@@ -38,20 +38,11 @@ public interface ITaPreselectionRecordService extends IService<TaPreselectionRec
38 38
     /**
39 39
      * 取消预选
40 40
      *
41
-     * @param personId 用户ID
42
-     * @param houseId  房源ID
41
+     * @param houseId     房源ID
42
+     * @param preselectionRecordId 预选表ID
43 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 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 Zobrazit soubor

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

+ 4
- 11
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionRecordServiceImpl.java Zobrazit soubor

@@ -99,7 +99,7 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
99 99
         // 校验用户是否已经预选房源
100 100
         TaPreselectionRecord record = taPreselectionRecordMapper
101 101
                 .getRecordByPersonIdAndHouseId(taPreselectionRecord.getPersonId(), taPreselectionRecord.getHouseId());
102
-        if (record != null && 1 == record.getStatus()) {
102
+        if (record != null) {
103 103
             responseBean.addError("已预选过此房源,请到选房记录中查看。");
104 104
             return responseBean;
105 105
         }
@@ -146,12 +146,12 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
146 146
 
147 147
     @Override
148 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 152
         ResponseBean responseBean = new ResponseBean<>();
153 153
         // 校验是否已经取消
154
-        TaPreselectionRecord preselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
154
+        TaPreselectionRecord preselectionRecord = getById(preselectionRecordId);
155 155
         if (preselectionRecord == null || 1 != preselectionRecord.getStatus()) {
156 156
             responseBean.addError("未预选过此房源,或已取消预选此房源");
157 157
             return responseBean;
@@ -181,13 +181,6 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
181 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 184
     @Override
192 185
     public ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status) {
193 186
         Page page = new Page(pageNum, pageSize);

+ 5
- 5
src/main/resources/mapper/TaHousingResourcesMapper.xml Zobrazit soubor

@@ -57,11 +57,11 @@
57 57
             AND t.`status` > 0
58 58
           ) t5
59 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 65
     </select>
66 66
 
67 67
     <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">

+ 1
- 0
src/main/resources/mapper/TaPreselectionRecordMapper.xml Zobrazit soubor

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