|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
6
|
6
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
7
|
7
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
8
|
8
|
import com.example.wholeestate.common.resp.ResponseBean;
|
|
9
|
+import com.example.wholeestate.common.uuid.IdGen;
|
9
|
10
|
import com.example.wholeestate.dao.AppointmentMapper;
|
10
|
11
|
import com.example.wholeestate.dao.BuildingMapper;
|
11
|
12
|
import com.example.wholeestate.model.Building;
|
|
@@ -34,6 +35,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
34
|
35
|
|
35
|
36
|
@Autowired
|
36
|
37
|
private AppointmentMapper AppointmentMapper;
|
|
38
|
+
|
|
39
|
+ private IdGen idGen = IdGen.get();
|
|
40
|
+
|
37
|
41
|
@Override
|
38
|
42
|
public ResponseBean buildingList(Integer pageNum,Integer pageSize) {
|
39
|
43
|
ResponseBean response= new ResponseBean();
|
|
@@ -112,20 +116,22 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
112
|
116
|
JSONObject object= JSONObject.parseObject(parameter);
|
113
|
117
|
|
114
|
118
|
Building building = JSONObject.parseObject(parameter,Building.class);
|
115
|
|
- if (!"".equals(building.getBuildingId())&&null!=building.getBuildingId()){
|
116
|
|
- response.addError("楼盘名称不能为空");
|
117
|
|
- return response;
|
118
|
|
- }
|
119
|
|
- if (!"".equals(building.getPrice())&&null!=building.getPrice()){
|
120
|
|
- response.addError("价格不能为空");
|
121
|
|
- return response;
|
122
|
|
- }
|
123
|
|
- if (!"".equals(building.getOpeningDate())&&null!=building.getOpeningDate()){
|
124
|
|
- response.addError("开盘时间");
|
125
|
|
- return response;
|
126
|
|
- }
|
|
119
|
+// if (!"".equals(building.getBuildingId())&&null!=building.getBuildingId()){
|
|
120
|
+// response.addError("楼盘名称不能为空");
|
|
121
|
+// return response;
|
|
122
|
+// }
|
|
123
|
+// if (!"".equals(building.getPrice())&&null!=building.getPrice()){
|
|
124
|
+// response.addError("价格不能为空");
|
|
125
|
+// return response;
|
|
126
|
+// }
|
|
127
|
+// if (!"".equals(building.getOpeningDate())&&null!=building.getOpeningDate()){
|
|
128
|
+// response.addError("开盘时间");
|
|
129
|
+// return response;
|
|
130
|
+// }
|
|
131
|
+ building.setBuildingId(idGen.nextId()+"");
|
127
|
132
|
building.setOpeningDate(object.getDate("openingDate"));
|
128
|
133
|
building.setCreateDate(LocalDateTime.now());
|
|
134
|
+ building.setStatus(0);
|
129
|
135
|
buildingMapper.insert(building);
|
130
|
136
|
response.addSuccess("成功");
|
131
|
137
|
return response;
|