DESKTOP-71BH0QO\L、ming
2021-03-26 3abb261e5a10b11b20f4bc1712a524be9cbc82f1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
package com.panzhihua.service_community.api;
 
import com.panzhihua.common.model.dtos.community.*;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.service_community.service.ComMngCarService;
import com.panzhihua.service_community.service.ComMngProvinceService;
import com.panzhihua.service_community.service.ComMngRealAssetsService;
import com.panzhihua.service_community.service.ComMngRealCompanyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * @description: 社区管理/基础数据
 * @author: Null
 * @date: 2021/3/11 13:19
 */
@Slf4j
@RestController
@RequestMapping("/common/data")
public class CommonDataApi {
 
    @Resource
    private ComMngCarService comMngCarService;
 
    @Resource
    private ComMngRealCompanyService comMngRealCompanyService;
 
    @Resource
    private ComMngRealAssetsService comMngRealAssetsService;
 
    @Resource
    private ComMngProvinceService comMngProvinceService;
 
    /**
     * 小程序用户车辆登记
     * @param comCvtBusinessDTO
     * @return
     */
    @PostMapping("/car/user/register")
    public R addComCvtBusiness(@RequestBody ComMngCarAppletDTO comCvtBusinessDTO) {
        return comMngCarService.addComMngCarApplet(comCvtBusinessDTO);
    }
 
    /**
     * 小程序用户车辆列表
     * @param userId
     * @return
     */
    @GetMapping("/car/user/list")
    public R userComMngCarList(@RequestParam("userId") Long userId) {
        return comMngCarService.userComMngCarList(userId);
    }
 
    /**
     * 社区后台车辆管理列表
     * @param pageComMngCarDTO
     * @return
     */
    @PostMapping("/car/page")
    public R pageQueryComMngCar(@RequestBody PageComMngCarDTO pageComMngCarDTO) {
        return comMngCarService.pageQueryComMngCar(pageComMngCarDTO);
    }
 
    /**
     * 社区后台添加修改车辆
     * @param comMngCarSaveDTO
     * @return
     */
    @PostMapping("/car/save")
    public R saveComMngCar(@RequestBody ComMngCarSaveDTO comMngCarSaveDTO) {
        return comMngCarService.saveComMngCar(comMngCarSaveDTO);
    }
 
    /**
     * 社区后台删除车辆
     * @param id
     * @return
     */
    @DeleteMapping("/car/delete")
    public R deleteComMngCar(@RequestParam(value = "id") Long id) {
        return comMngCarService.deleteComMngCar(id);
    }
    /**
     * 社区后台导入车辆
     * @param list 车辆列表
     * @param communityId 社区编号
     * @return
     */
    @PostMapping("/car/import")
    public R listSaveMngCarExcelVO(@RequestBody List<ComMngCarExcelVO> list, @RequestParam("communityId") Long communityId){
        return comMngCarService.listSaveMngCarExcelVO(list,communityId);
    }
 
    /**
     * 社区后台实有单位管理列表
     * @param pageComMngRealCompanyDTO
     * @return
     */
    @PostMapping("/company/page")
    public R pageQueryComMngRealCompany(@RequestBody PageComMngRealCompanyDTO pageComMngRealCompanyDTO) {
        return comMngRealCompanyService.pageQueryComMngRealCompany(pageComMngRealCompanyDTO);
    }
 
    /**
     * 社区后台添加修改实有单位
     * @param comMngRealCompanyVO
     * @return
     */
    @PostMapping("/company/save")
    public R saveComMngRealCompany(@RequestBody ComMngRealCompanyVO comMngRealCompanyVO) {
        return comMngRealCompanyService.saveComMngRealCompany(comMngRealCompanyVO);
    }
 
    /**
     * 社区后台删除实有单位
     * @param id
     * @return
     */
    @DeleteMapping("/company/delete")
    public R deleteComMngRealCompany(@RequestParam(value = "id") Long id) {
        return comMngRealCompanyService.deleteComMngRealCompany(id);
    }
 
    @GetMapping("/company/detail")
    public R detailComMngRealCompany(@RequestParam(value = "id") Long id) {
        return comMngRealCompanyService.detailComMngRealCompany(id);
    }
 
    /**
     * 社区后台导入实有单位
     * @param list 车实有单位列表
     * @param communityId 社区编号
     * @return
     */
    @PostMapping("/company/import")
    public R listSaveMngRealCompanyExcelVO(@RequestBody List<ComMngRealCompanyExcelVO> list, @RequestParam("communityId") Long communityId){
        return comMngRealCompanyService.listSaveMngRealCompanyExcelVO(list,communityId);
    }
 
    /**
     * 导出实有单位
     * @param exportRealCompanyExcelDTO 实有单位导出查询参数
     * @return
     */
    @PostMapping("/company/export")
    public R exportRealCompanyExcel(@RequestBody ExportRealCompanyExcelDTO exportRealCompanyExcelDTO ){
        return comMngRealCompanyService.exportRealCompanyExcel(exportRealCompanyExcelDTO);
    }
 
 
    /**
     * 社区后台实有资产管理列表
     * @param pageComMngRealAssetsDTO
     * @return
     */
    @PostMapping("/assets/page")
    public R pageQueryComMngRealAssets(@RequestBody PageComMngRealAssetsDTO pageComMngRealAssetsDTO) {
        return comMngRealAssetsService.pageQueryComMngRealAssets(pageComMngRealAssetsDTO);
    }
 
    /**
     * 社区后台添加修改实有资产
     * @param comMngRealAssetsVO
     * @return
     */
    @PostMapping("/assets/save")
    public R saveComMngRealAssets(@RequestBody ComMngRealAssetsVO comMngRealAssetsVO) {
        return comMngRealAssetsService.saveComMngRealAssets(comMngRealAssetsVO);
    }
 
    /**
     * 社区后台删除实有资产
     * @param id
     * @return
     */
    @DeleteMapping("/assets/delete")
    public R deleteComMngRealAssets(@RequestParam(value = "id") Long id) {
        return comMngRealAssetsService.deleteComMngRealAssets(id);
    }
 
    @GetMapping("/assets/detail")
    public R detailComMngRealAssets(@RequestParam(value = "id") Long id) {
        return comMngRealAssetsService.detailComMngRealAssets(id);
    }
 
    /**
     * 社区后台导入实有资产
     * @param list 车实有资产列表
     * @param communityId 社区编号
     * @return
     */
    @PostMapping("/assets/import")
    public R listSaveMngRealAssetsExcelVO(@RequestBody List<ComMngRealAssetsExcelVO> list, @RequestParam("communityId") Long communityId){
        return comMngRealAssetsService.listSaveMngRealAssetsExcelVO(list,communityId);
    }
 
    /**
     * 导出实有资产
     * @param exportRealAssetsExcelDTO 实有资产导出查询参数
     * @return
     */
    @PostMapping("/assets/export")
    public R exportRealAssetsExcel(@RequestBody ExportRealAssetsExcelDTO exportRealAssetsExcelDTO ){
        return comMngRealAssetsService.exportRealAssetsExcel(exportRealAssetsExcelDTO);
    }
 
    /**
     * 查询所有省份
     * @return
     */
    @GetMapping("/province")
    public R getProvince() {
        return comMngProvinceService.getProvince();
    }
 
    /**
     * 查询省份下所有的城市
     * @param provinceAdcode
     * @return
     */
    @GetMapping("/city")
    public R getCityByProvinceCode(@RequestParam(value = "provinceAdcode") Integer provinceAdcode){
        return comMngProvinceService.getCityByProvinceCode(provinceAdcode);
    }
 
    /**
     * 查询城市下所有的区县
     * @param cityAdcode
     * @return
     */
    @GetMapping("/district")
    R getDistrictByCityCode(@RequestParam(value = "cityAdcode") Integer cityAdcode){
        return comMngProvinceService.getDistrictByCityCode(cityAdcode);
    }
 
    /**
     * 查询特定省下所有区域 tree结构
     * @param provinceAdcode
     * @return
     */
    @GetMapping("/area/all")
    R getCityTreeByProvinceCode(@RequestParam(value = "provinceAdcode") Integer provinceAdcode){
        return comMngProvinceService.getCityTreeByProvinceCode(provinceAdcode);
    }
}