|
@@ -9,13 +9,17 @@ import com.example.wholeestate.common.resp.ResponseBean;
|
9
|
9
|
import com.example.wholeestate.common.uuid.IdGen;
|
10
|
10
|
import com.example.wholeestate.dao.AppointmentMapper;
|
11
|
11
|
import com.example.wholeestate.dao.BuildingMapper;
|
|
12
|
+import com.example.wholeestate.dao.CustomerMapper;
|
|
13
|
+import com.example.wholeestate.model.Appointment;
|
12
|
14
|
import com.example.wholeestate.model.Building;
|
|
15
|
+import com.example.wholeestate.model.Customer;
|
13
|
16
|
import com.example.wholeestate.service.IBuildingService;
|
14
|
17
|
import com.fasterxml.jackson.databind.util.ArrayBuilders;
|
15
|
18
|
import org.springframework.beans.factory.annotation.Autowired;
|
16
|
19
|
import org.springframework.stereotype.Service;
|
17
|
20
|
|
18
|
21
|
import java.time.LocalDateTime;
|
|
22
|
+import java.util.ArrayList;
|
19
|
23
|
import java.util.Date;
|
20
|
24
|
import java.util.HashMap;
|
21
|
25
|
import java.util.List;
|
|
@@ -36,6 +40,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
36
|
40
|
@Autowired
|
37
|
41
|
private AppointmentMapper AppointmentMapper;
|
38
|
42
|
|
|
43
|
+ @Autowired
|
|
44
|
+ private CustomerMapper customerMapper;
|
39
|
45
|
private IdGen idGen = IdGen.get();
|
40
|
46
|
|
41
|
47
|
@Override
|
|
@@ -61,6 +67,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
61
|
67
|
ResponseBean response= new ResponseBean();
|
62
|
68
|
QueryWrapper<Building> buildingtWrapper = new QueryWrapper<>();
|
63
|
69
|
buildingtWrapper.lambda().eq(Building::getStatus,0);
|
|
70
|
+ buildingtWrapper.lambda().eq(Building::getBuildingId,id);
|
64
|
71
|
Building building= buildingMapper.selectOne(buildingtWrapper);
|
65
|
72
|
response.addSuccess(building);
|
66
|
73
|
return response;
|
|
@@ -94,13 +101,35 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
|
94
|
101
|
}
|
95
|
102
|
|
96
|
103
|
@Override
|
97
|
|
- public ResponseBean appointmentList(Integer pageNum,Integer pageSize) {
|
|
104
|
+ public ResponseBean appointmentList(Integer pageNum,Integer pageSize,Integer buildingId,String username) {
|
98
|
105
|
ResponseBean response= new ResponseBean();
|
99
|
|
- Page<Appendable> page = new Page<>();
|
|
106
|
+ Page<Appointment> page = new Page<>();
|
100
|
107
|
page.setSize(pageSize == null ? 10 : pageSize);
|
101
|
108
|
page.setCurrent(pageNum == null ? 1 : pageNum);
|
102
|
|
- IPage<Appendable> building= AppointmentMapper.appendableList(page);
|
103
|
|
- List<Appendable> buildingList=building.getRecords();
|
|
109
|
+ IPage<Appointment> building= AppointmentMapper.appendableList(page,buildingId,username);
|
|
110
|
+ List<Appointment> buildingList=building.getRecords();
|
|
111
|
+ //预约的用户,
|
|
112
|
+ ArrayList arrayListUser= new ArrayList<>();
|
|
113
|
+
|
|
114
|
+ //预约的楼盘,
|
|
115
|
+ ArrayList arrayListbuilding= new ArrayList<>();
|
|
116
|
+ for (Appointment bui:buildingList){
|
|
117
|
+ Building buil= new Building();
|
|
118
|
+ QueryWrapper<Building> buildingtWrapper = new QueryWrapper<>();
|
|
119
|
+ buildingtWrapper.lambda().eq(Building::getStatus,0);
|
|
120
|
+ buildingtWrapper.lambda().eq(Building::getBuildingId,bui.getBuildingId());
|
|
121
|
+ Building bu= buildingMapper.selectOne(buildingtWrapper);
|
|
122
|
+ arrayListUser.add(bu);
|
|
123
|
+
|
|
124
|
+ QueryWrapper<Customer> customerWrapper = new QueryWrapper<>();
|
|
125
|
+ customerWrapper.lambda().eq(Customer::getStatus,0);
|
|
126
|
+ customerWrapper.lambda().eq(Customer::getCustomerId,bui.getCustomerId());
|
|
127
|
+ Customer cust= customerMapper.selectOne(customerWrapper);
|
|
128
|
+ arrayListbuilding.add(cust);
|
|
129
|
+
|
|
130
|
+ bui.setArrayListUser(arrayListUser);
|
|
131
|
+ bui.setArrayListbuilding(arrayListbuilding);
|
|
132
|
+ }
|
104
|
133
|
|
105
|
134
|
HashMap hashMap= new HashMap<>();
|
106
|
135
|
hashMap.put("list",buildingList);
|