|
@@ -2,6 +2,7 @@ package com.example.wholeestate.service.impl;
|
2
|
2
|
|
3
|
3
|
import com.alibaba.fastjson.JSONObject;
|
4
|
4
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
5
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
5
|
6
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
6
|
7
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
7
|
8
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -14,6 +15,7 @@ import com.example.wholeestate.model.Appointment;
|
14
|
15
|
import com.example.wholeestate.model.Customer;
|
15
|
16
|
import com.example.wholeestate.model.Dict;
|
16
|
17
|
import com.example.wholeestate.service.IAppointmentService;
|
|
18
|
+import org.apache.http.HttpStatus;
|
17
|
19
|
import org.springframework.beans.factory.annotation.Autowired;
|
18
|
20
|
import org.springframework.stereotype.Service;
|
19
|
21
|
|
|
@@ -64,4 +66,31 @@ public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appoi
|
64
|
66
|
responseBean.addSuccess("操作成功!");
|
65
|
67
|
return responseBean;
|
66
|
68
|
}
|
|
69
|
+
|
|
70
|
+ @Override
|
|
71
|
+ public ResponseBean deleteWxAppointment(String appointmentId) {
|
|
72
|
+ ResponseBean responseBean = new ResponseBean();
|
|
73
|
+
|
|
74
|
+ QueryWrapper<Appointment> queryWrapper = new QueryWrapper<>();
|
|
75
|
+ queryWrapper.eq("appointment_id", appointmentId);
|
|
76
|
+ Appointment appointment = appointmentMapper.selectOne(queryWrapper);
|
|
77
|
+ if (null == appointment) {
|
|
78
|
+ responseBean.addError(HttpStatus.SC_BAD_REQUEST, "未找到需要删除的数据");
|
|
79
|
+ return responseBean;
|
|
80
|
+ }
|
|
81
|
+
|
|
82
|
+ // todo 一些删除校验
|
|
83
|
+
|
|
84
|
+ UpdateWrapper<Appointment> updateWrapper = new UpdateWrapper<>();
|
|
85
|
+ updateWrapper.set("status", -1);
|
|
86
|
+ updateWrapper.eq("appointment_id", appointmentId);
|
|
87
|
+
|
|
88
|
+ int rows = appointmentMapper.update(appointment, updateWrapper);
|
|
89
|
+ if (rows < 1) {
|
|
90
|
+ responseBean.addError(HttpStatus.SC_INTERNAL_SERVER_ERROR, "删数据失败");
|
|
91
|
+ return responseBean;
|
|
92
|
+ }
|
|
93
|
+
|
|
94
|
+ return responseBean;
|
|
95
|
+ }
|
67
|
96
|
}
|