顾绍勇 hace 5 años
padre
commit
3588ed65b6

+ 2
- 2
src/main/java/com/huiju/estateagents/controller/TaPreselectionRecordController.java Ver fichero

@@ -171,10 +171,10 @@ public class TaPreselectionRecordController extends BaseController {
171 171
      */
172 172
     @RequestMapping(value = "/wx/taPreselectionRecordCancel", method = RequestMethod.DELETE)
173 173
     public ResponseBean taPreselectionRecordCancel(@RequestParam("houseId") String houseId,
174
-                                                   @RequestParam("preselectionRecordId") String preselectionRecordId) {
174
+                                                   @RequestParam("personId") String personId) {
175 175
         ResponseBean responseBean = new ResponseBean();
176 176
         try {
177
-            responseBean = iTaPreselectionRecordService.taPreselectionRecordCancel( houseId, preselectionRecordId);
177
+            responseBean = iTaPreselectionRecordService.taPreselectionRecordCancel(personId, houseId);
178 178
         } catch (Exception e) {
179 179
             logger.error("taPreselectionRecordCancel -=- {}", e);
180 180
             responseBean.addError(e.getMessage());

+ 3
- 3
src/main/java/com/huiju/estateagents/service/ITaPreselectionRecordService.java Ver fichero

@@ -38,11 +38,11 @@ public interface ITaPreselectionRecordService extends IService<TaPreselectionRec
38 38
     /**
39 39
      * 取消预选
40 40
      *
41
-     * @param houseId     房源ID
42
-     * @param preselectionRecordId 预选表ID
41
+     * @param personId
42
+     * @param houseId  房源ID
43 43
      * @return
44 44
      */
45
-    ResponseBean taPreselectionRecordCancel(String houseId, String preselectionRecordId);
45
+    ResponseBean taPreselectionRecordCancel(String personId, String houseId);
46 46
 
47 47
     ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status);
48 48
 

+ 4
- 4
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionRecordServiceImpl.java Ver fichero

@@ -146,13 +146,13 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
146 146
 
147 147
     @Override
148 148
     @Transactional
149
-    public ResponseBean taPreselectionRecordCancel(String houseId, String preselectionRecordId) {
150
-        logger.info("taPreselectionRecordCancel 接收参数:houseId:{},preselectionRecordId:{}", houseId, preselectionRecordId);
149
+    public ResponseBean taPreselectionRecordCancel(String personId, String houseId) {
150
+        logger.info("taPreselectionRecordCancel 接收参数:personId:{},houseId:{}", personId, houseId);
151 151
 
152 152
         ResponseBean responseBean = new ResponseBean<>();
153 153
         // 校验是否已经取消
154
-        TaPreselectionRecord preselectionRecord = getById(preselectionRecordId);
155
-        if (preselectionRecord == null || 1 != preselectionRecord.getStatus()) {
154
+        TaPreselectionRecord preselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
155
+        if (preselectionRecord == null) {
156 156
             responseBean.addError("未预选过此房源,或已取消预选此房源");
157 157
             return responseBean;
158 158
         }