Commit d7e19c1a authored by wujiang's avatar wujiang

添加获取监管机构接口

parent 07232074
...@@ -135,7 +135,7 @@ public class InspectionController { ...@@ -135,7 +135,7 @@ public class InspectionController {
FeignClientResult<CompanyModel> company = Privilege.companyClient.seleteOne(Long.valueOf(selectValue)); FeignClientResult<CompanyModel> company = Privilege.companyClient.seleteOne(Long.valueOf(selectValue));
FeignClientResult<Page<AgencyUserModel>> result = new FeignClientResult<Page<AgencyUserModel>>(); FeignClientResult<Page<AgencyUserModel>> result = new FeignClientResult<Page<AgencyUserModel>>();
if (company.getResult() != null) { if (company.getResult() != null) {
result = Privilege.agencyUserClient.queryForPageByCompany(company.getResult().getOrgCode(), "county", result = Privilege.agencyUserClient.queryForPageByCompany(company.getResult().getOrgCode(), "headquarter,prefecture-level,county",
mobile, realName, current, size); mobile, realName, current, size);
} }
return ResponseHelper.buildResponse(result.getResult()); return ResponseHelper.buildResponse(result.getResult());
......
package com.yeejoin.amos.boot.module.tzs.biz.controller; package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import java.util.Collection;
import com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService; import java.util.List;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -17,14 +12,16 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -17,14 +12,16 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.Collection; import com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService;
import java.util.HashMap; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import java.util.HashSet; import com.yeejoin.amos.feign.privilege.Privilege;
import java.util.Iterator; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import java.util.List; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import java.util.Map; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import java.util.Set;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/** /**
* 特种设备权限controller * 特种设备权限controller
...@@ -79,5 +76,36 @@ public class TzsAuthController extends BaseController { ...@@ -79,5 +76,36 @@ public class TzsAuthController extends BaseController {
} }
/**
* 获取用户监管机构
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserRegulator")
@ApiOperation(httpMethod = "GET", value = "获取用户组织机构树", notes = "获取用户组织机构树")
public ResponseModel<String> getUserRegulator () {
String name="";
FeignClientResult<AgencyUserModel> result=Privilege.agencyUserClient.getme();
if(result.getResult()!=null)
{
List<CompanyModel> list = result.getResult().getCompanys();
if(list!=null&&!list.isEmpty())
{
CompanyModel company = list.get(0);
if("company".equals(company.getLevel()))
{
FeignClientResult<CompanyModel> cResult =Privilege.companyClient.seleteOne(company.getParentId());
if(cResult.getResult()!=null)
{
name = cResult.getResult().getCompanyName();
}
}else
{
name=company.getCompanyName();
}
}
}
result.getResult().getCompanys();
return ResponseHelper.buildResponse(name);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment