From fb811f77f58c149c71654fae5f41a890d48832d9 Mon Sep 17 00:00:00 2001
From: cedoo <chendong@inwhoop.com>
Date: 星期二, 30 三月 2021 15:49:02 +0800
Subject: [PATCH] add: 实有单位归属地查询

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java |   75 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java
index f356d90..e7a33bf 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java
@@ -3,10 +3,9 @@
 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.ComMngRealAssetsService;
-import com.panzhihua.service_community.service.ComMngRealCompanyService;
+import com.panzhihua.service_community.service.*;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -30,6 +29,11 @@
 
     @Resource
     private ComMngRealAssetsService comMngRealAssetsService;
+
+    @Resource
+    private ComMngProvinceService comMngProvinceService;
+    @Resource
+    private ComMngPopulationService comMngPopulationService;
 
     /**
      * 小程序用户车辆登记
@@ -126,6 +130,10 @@
         return comMngRealCompanyService.detailComMngRealCompany(id);
     }
 
+    @GetMapping("/company/belongs")
+    public R belongsComMngRealCompany(@RequestBody ComMngRealCompanyBelongsDTO comMngRealCompanyBelongsDTO) {
+        return comMngRealCompanyService.belongsComMngRealCompany(comMngRealCompanyBelongsDTO);
+    }
     /**
      * 社区后台导入实有单位
      * @param list 车实有单位列表
@@ -203,4 +211,65 @@
     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);
+    }
+
+    /**
+     * 社区后台实有人口管理列表
+     * @param comMngPopulationVO 查询参数
+     * @return  实有人口分页查询结果
+     */
+    @PostMapping("/population/page")
+    public R pagePopulation(@RequestBody ComMngPopulationDTO comMngPopulationVO) {
+        return comMngPopulationService.pagePopulation(comMngPopulationVO);
+    }
+
+    /**
+     * 社区后台导入实有人口
+     * @param list 数据
+     * @param communityId 社区编号
+     * @return
+     */
+    @PostMapping("/population/import")
+    @Transactional(rollbackFor = Exception.class)
+    public R listSavePopulationExcelVO(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId){
+        return comMngPopulationService.listSavePopulation(list,communityId);
+    }
 }

--
Gitblit v1.7.1