|
@@ -1,7 +1,9 @@
|
|
|
package com.ruoyi.resource.controller;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.Map;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import com.ruoyi.common.core.utils.SecurityUtils;
|
|
@@ -9,6 +11,8 @@ import com.ruoyi.resource.domain.ZnylKhzh;
|
|
|
import com.ruoyi.resource.domain.ZnylYgry;
|
|
|
import com.ruoyi.resource.service.IZnylKhzhService;
|
|
|
import com.ruoyi.resource.service.IZnylYgryService;
|
|
|
+import com.ruoyi.system.api.RemoteDeptJlService;
|
|
|
+import com.ruoyi.system.api.domain.SysDeptJl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -24,7 +28,6 @@ import com.ruoyi.common.security.annotation.PreAuthorize;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
-import io.swagger.annotations.ApiImplicitParams;
|
|
|
import com.ruoyi.resource.domain.ZnylXqdw;
|
|
|
import com.ruoyi.resource.service.IZnylXqdwService;
|
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
@@ -52,6 +55,8 @@ public class ZnylXqdwController extends BaseController
|
|
|
@Autowired
|
|
|
private IZnylYgryService znylYgryService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RemoteDeptJlService remoteDeptJlService;
|
|
|
/**
|
|
|
* 查询智能养老_小区单位信息列表
|
|
|
*/
|
|
@@ -78,13 +83,59 @@ public class ZnylXqdwController extends BaseController
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询小区单位信息列表")
|
|
|
-// @PreAuthorize(hasPermi = "resource:xqdw:getXqdwList")
|
|
|
@GetMapping("/getXqdwList")
|
|
|
public AjaxResult getXqdwList(ZnylXqdw znylXqdw)
|
|
|
{
|
|
|
+ if(null != znylXqdw.getRegioncode()){
|
|
|
+ SysDeptJl sysDeptJl = remoteDeptJlService.selectSysDeptJlByCode(znylXqdw.getRegioncode());
|
|
|
+ String level = String.valueOf(sysDeptJl.getLevel());
|
|
|
+ if (level.equals("1")) { //查全部
|
|
|
+ znylXqdw.setRegioncode("");
|
|
|
+ } else if (level.equals("2")) { // 所有下级区划
|
|
|
+ List<SysDeptJl> childDept = remoteDeptJlService.getDeptList(sysDeptJl.getId());
|
|
|
+ List<String> deptIdsList = new ArrayList<>();
|
|
|
+ for (int i = 0; childDept.size() > i; i++) {
|
|
|
+ deptIdsList.add(childDept.get(i).getCode());
|
|
|
+ }
|
|
|
+ Map<String,Object> map = znylXqdw.getParams();
|
|
|
+ map.put("orgCodes",deptIdsList);
|
|
|
+ znylXqdw.setRegioncode("");
|
|
|
+ znylXqdw.setParams(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
return AjaxResult.success(znylXqdwService.selectZnylXqdwList(znylXqdw));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 区划
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getDeptListByCode")
|
|
|
+ public AjaxResult getDeptListByCode()
|
|
|
+ {
|
|
|
+ List<SysDeptJl> list = new ArrayList<>();
|
|
|
+ Long userId = SecurityUtils.getUserId();
|
|
|
+ if (userId != 1) {
|
|
|
+ String code = "";
|
|
|
+ ZnylYgry ygry = znylYgryService.selectByAccountno(SecurityUtils.getUsername());
|
|
|
+ if (null != ygry) {
|
|
|
+ code = ygry.getRegioncode();
|
|
|
+ } else {
|
|
|
+ ZnylKhzh khzh = znylKhzhService.selectByAccountno(SecurityUtils.getUsername());
|
|
|
+ code = khzh.getRegioncode();
|
|
|
+ }
|
|
|
+ SysDeptJl sysDeptJl = remoteDeptJlService.selectSysDeptJlByCode(code);
|
|
|
+// List<SysDeptJl> list = remoteDeptJlService.getDeptList(sysDeptJl.getId());
|
|
|
+ list = remoteDeptJlService.getDeptList(sysDeptJl.getId());
|
|
|
+// list.add(sysDeptJl);
|
|
|
+ return AjaxResult.success(list);
|
|
|
+ } else {
|
|
|
+ list = remoteDeptJlService.getDeptList(null);
|
|
|
+ return AjaxResult.success(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 导出智能养老_小区单位信息列表
|
|
|
*/
|