|
@@ -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;
|
|
@@ -10,11 +11,11 @@ import com.example.wholeestate.common.resp.ResponseBean;
|
10
|
11
|
import com.example.wholeestate.common.uuid.IdGen;
|
11
|
12
|
import com.example.wholeestate.dao.CustomerMapper;
|
12
|
13
|
|
13
|
|
-import com.example.wholeestate.model.Building;
|
14
|
14
|
import com.example.wholeestate.model.Customer;
|
15
|
15
|
import com.example.wholeestate.service.ICustomerService;
|
16
|
16
|
import com.example.wholeestate.utils.BeanTools;
|
17
|
17
|
import com.example.wholeestate.wx.mini.IWxMini;
|
|
18
|
+import org.apache.http.HttpStatus;
|
18
|
19
|
import org.springframework.beans.factory.annotation.Autowired;
|
19
|
20
|
import org.springframework.stereotype.Service;
|
20
|
21
|
|
|
@@ -134,4 +135,25 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
134
|
135
|
responseBean.addSuccess(customer);
|
135
|
136
|
return responseBean;
|
136
|
137
|
}
|
|
138
|
+
|
|
139
|
+ @Override
|
|
140
|
+ public ResponseBean updateCustomer(String parameter) {
|
|
141
|
+ ResponseBean responseBean = new ResponseBean();
|
|
142
|
+ Customer customer = JSONObject.parseObject(parameter, Customer.class);
|
|
143
|
+
|
|
144
|
+ UpdateWrapper<Customer> updateWrapper = new UpdateWrapper<>();
|
|
145
|
+ updateWrapper.set("customerName", customer.getCustomerName());
|
|
146
|
+ updateWrapper.set("name", customer.getName());
|
|
147
|
+ updateWrapper.set("phone", customer.getPhone());
|
|
148
|
+ updateWrapper.set("idNum", customer.getIdNum());
|
|
149
|
+ updateWrapper.set("remark", customer.getRemark());
|
|
150
|
+ updateWrapper.eq("customer_id", customer.getCustomerId());
|
|
151
|
+
|
|
152
|
+ int success = customerMapper.update(customer, updateWrapper);
|
|
153
|
+ if (success >= 0) {
|
|
154
|
+ responseBean.addError(HttpStatus.SC_INTERNAL_SERVER_ERROR, "更新用户信息失败");
|
|
155
|
+ }
|
|
156
|
+
|
|
157
|
+ return responseBean;
|
|
158
|
+ }
|
137
|
159
|
}
|