|
@@ -13,6 +13,7 @@ import com.example.wholeestate.model.*;
|
13
|
13
|
import com.example.wholeestate.service.IBuildingService;
|
14
|
14
|
import com.fasterxml.jackson.databind.util.ArrayBuilders;
|
15
|
15
|
import com.sun.org.apache.bcel.internal.generic.NEW;
|
|
16
|
+import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
|
16
|
17
|
import org.springframework.beans.factory.annotation.Autowired;
|
17
|
18
|
import org.springframework.stereotype.Service;
|
18
|
19
|
|
|
@@ -43,12 +44,16 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
43
|
44
|
|
44
|
45
|
@Autowired
|
45
|
46
|
private BuildingImgMapper buildingImgMapper;
|
|
47
|
+
|
46
|
48
|
@Autowired
|
47
|
49
|
private ApartmentImgMapper apartmentImgMapper;
|
48
|
50
|
|
49
|
51
|
@Autowired
|
50
|
52
|
private BuildingApartmentMapper buildingApartmentMapper;
|
51
|
53
|
|
|
54
|
+// @Autowired
|
|
55
|
+// private ApartmentImgMapper apartmentImgMapper;
|
|
56
|
+
|
52
|
57
|
private IdGen idGen = IdGen.get();
|
53
|
58
|
|
54
|
59
|
@Override
|
|
@@ -122,36 +127,34 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
122
|
127
|
}
|
123
|
128
|
|
124
|
129
|
@Override
|
125
|
|
- public ResponseBean appointmentList(Integer pageNum,Integer pageSize,Integer buildingId,String username) {
|
|
130
|
+ public ResponseBean appointmentList(Integer pageNum,Integer pageSize,String buildingId,String username,String phone,String status) {
|
126
|
131
|
ResponseBean response= new ResponseBean();
|
127
|
132
|
Page<Appointment> page = new Page<>();
|
128
|
133
|
page.setSize(pageSize == null ? 10 : pageSize);
|
129
|
|
- page.setCurrent(pageNum == null ? 1 : pageNum);
|
130
|
|
- IPage<Appointment> building= AppointmentMapper.appendableList(page,buildingId,username);
|
|
134
|
+ page.setCurrent(pageNum == null ? 0 : pageNum);
|
|
135
|
+ IPage<Appointment> building= AppointmentMapper.appendableList(page,buildingId,username,phone,status);
|
131
|
136
|
List<Appointment> buildingList=building.getRecords();
|
132
|
137
|
//预约的用户,
|
133
|
|
- ArrayList arrayListUser= new ArrayList<>();
|
|
138
|
+// ArrayList arrayListUser= new ArrayList<>();
|
134
|
139
|
|
135
|
140
|
//预约的楼盘,
|
136
|
|
- ArrayList arrayListbuilding= new ArrayList<>();
|
137
|
|
- for (Appointment bui:buildingList){
|
138
|
|
- Building buil= new Building();
|
139
|
|
- QueryWrapper<Building> buildingtWrapper = new QueryWrapper<>();
|
140
|
|
- buildingtWrapper.lambda().eq(Building::getStatus,0);
|
141
|
|
- buildingtWrapper.lambda().eq(Building::getBuildingId,bui.getBuildingId());
|
142
|
|
- Building bu= buildingMapper.selectOne(buildingtWrapper);
|
143
|
|
- arrayListUser.add(bu);
|
144
|
|
-
|
145
|
|
- QueryWrapper<Customer> customerWrapper = new QueryWrapper<>();
|
146
|
|
- customerWrapper.lambda().eq(Customer::getStatus,0);
|
147
|
|
- customerWrapper.lambda().eq(Customer::getCustomerId,bui.getCustomerId());
|
148
|
|
- Customer cust= customerMapper.selectOne(customerWrapper);
|
149
|
|
- arrayListbuilding.add(cust);
|
150
|
|
-
|
151
|
|
- bui.setArrayListUser(arrayListUser);
|
152
|
|
- bui.setArrayListbuilding(arrayListbuilding);
|
153
|
|
- }
|
154
|
|
-
|
|
141
|
+// ArrayList arrayListbuilding= new ArrayList<>();
|
|
142
|
+// for (Appointment bui:buildingList){
|
|
143
|
+// Building buil= new Building();
|
|
144
|
+// QueryWrapper<Building> buildingtWrapper = new QueryWrapper<>();
|
|
145
|
+// buildingtWrapper.lambda().eq(Building::getStatus,0);
|
|
146
|
+// buildingtWrapper.lambda().eq(Building::getBuildingId,bui.getBuildingId());
|
|
147
|
+// Building bu= buildingMapper.selectOne(buildingtWrapper);
|
|
148
|
+// arrayListUser.add(bu);
|
|
149
|
+//
|
|
150
|
+// QueryWrapper<Customer> customerWrapper = new QueryWrapper<>();
|
|
151
|
+// customerWrapper.lambda().eq(Customer::getStatus,0);
|
|
152
|
+// customerWrapper.lambda().eq(Customer::getCustomerId,bui.getCustomerId());
|
|
153
|
+// Customer cust= customerMapper.selectOne(customerWrapper);
|
|
154
|
+// arrayListbuilding.add(cust);
|
|
155
|
+// bui.setArrayListUser(arrayListUser);
|
|
156
|
+// bui.setArrayListbuilding(arrayListbuilding);
|
|
157
|
+// }
|
155
|
158
|
HashMap hashMap= new HashMap<>();
|
156
|
159
|
hashMap.put("list",buildingList);
|
157
|
160
|
hashMap.put("total",building.getTotal());
|
|
@@ -320,7 +323,49 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
320
|
323
|
return responseBean;
|
321
|
324
|
}
|
322
|
325
|
|
323
|
|
-
|
|
326
|
+ @Override
|
|
327
|
+ public ResponseBean buildingApartmentSelectId(String id) {
|
|
328
|
+ ResponseBean responseBean = new ResponseBean();
|
|
329
|
+ //查询户型详情
|
|
330
|
+ QueryWrapper<BuildingApartment> buildingApartmentQueryWrapper = new QueryWrapper<>();
|
|
331
|
+ buildingApartmentQueryWrapper.eq("apartment_id", id);
|
|
332
|
+ //拿到当前户型信息
|
|
333
|
+ BuildingApartment buildingApartment = buildingApartmentMapper.selectOne(buildingApartmentQueryWrapper);
|
|
334
|
+ if ( null == buildingApartment ){
|
|
335
|
+ responseBean.addSuccess("此楼盘没有户型图请上传");
|
|
336
|
+ return responseBean;
|
|
337
|
+ }
|
|
338
|
+ //根据户型ID查楼盘户型对应图片表
|
|
339
|
+ ArrayList arrayList= new ArrayList<>();
|
|
340
|
+ QueryWrapper< ApartmentImg> ApartmentImgQueryWrapper = new QueryWrapper<>();
|
|
341
|
+ ApartmentImgQueryWrapper.eq("apartment_id", buildingApartment.getApartmentId());
|
|
342
|
+ List<ApartmentImg> buildingImg= apartmentImgMapper.selectList(ApartmentImgQueryWrapper);
|
|
343
|
+ for (ApartmentImg apartmentImg:buildingImg){
|
|
344
|
+ QueryWrapper<BuildingImg> buildingImgQueryWrapper = new QueryWrapper<>();
|
|
345
|
+ buildingImgQueryWrapper.eq("img_id",apartmentImg.getImgId());
|
|
346
|
+ List<BuildingImg> buildingImgList= buildingImgMapper.selectList(buildingImgQueryWrapper);
|
|
347
|
+ arrayList.add(buildingImgList);
|
|
348
|
+ }
|
|
349
|
+ buildingApartment.setBuildingImgList(arrayList);
|
|
350
|
+ responseBean .addSuccess(buildingApartment);
|
|
351
|
+ return responseBean;
|
|
352
|
+ }
|
|
353
|
+
|
|
354
|
+ @Override
|
|
355
|
+ public ResponseBean appointmentUpdate(String id,String writeoffRemark) {
|
|
356
|
+ ResponseBean responseBean= new ResponseBean();
|
|
357
|
+ Appointment appointment= new Appointment();
|
|
358
|
+ appointment.setAppointmentId(id);
|
|
359
|
+ appointment.setWriteoffRemark(writeoffRemark);
|
|
360
|
+ appointment.setStatus(2);
|
|
361
|
+// new DateTimeLiteralExpression.DateTime()
|
|
362
|
+// appointment.setWriteoffDate(LocalDateTime.now());
|
|
363
|
+ QueryWrapper<Appointment> AppointmentQueryWrapper = new QueryWrapper<>();
|
|
364
|
+ AppointmentQueryWrapper.eq("appointment_id", id);
|
|
365
|
+ AppointmentMapper.update(appointment,AppointmentQueryWrapper);
|
|
366
|
+ responseBean.addSuccess("成功");
|
|
367
|
+ return responseBean;
|
|
368
|
+ }
|
324
|
369
|
|
325
|
370
|
|
326
|
371
|
}
|