Commit 222a74d9 authored by chenzhao's avatar chenzhao

提交代码

parent e1a1c3a4
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import java.util.Arrays; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.biz.common.controller.DataDictionaryController;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -71,6 +75,9 @@ import io.swagger.annotations.ApiOperation; ...@@ -71,6 +75,9 @@ import io.swagger.annotations.ApiOperation;
public class OrgUsrController extends BaseController { public class OrgUsrController extends BaseController {
@Autowired @Autowired
DataDictionaryServiceImpl iDataDictionaryService;
@Autowired
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
@Autowired @Autowired
...@@ -83,6 +90,9 @@ public class OrgUsrController extends BaseController { ...@@ -83,6 +90,9 @@ public class OrgUsrController extends BaseController {
FireTeamMapper fireTeamMapper; FireTeamMapper fireTeamMapper;
@Autowired @Autowired
OrgUsrMapper orgUsrMapper;
@Autowired
EmqKeeper emqKeeper; EmqKeeper emqKeeper;
@Value("${jcs.company.topic.delete:jcs/company/topic/delete}") @Value("${jcs.company.topic.delete:jcs/company/topic/delete}")
private String airportDeleteTopic; private String airportDeleteTopic;
...@@ -90,6 +100,12 @@ public class OrgUsrController extends BaseController { ...@@ -90,6 +100,12 @@ public class OrgUsrController extends BaseController {
@Autowired @Autowired
EquipFeignClient equipFeignClient; EquipFeignClient equipFeignClient;
@Autowired
DataDictionaryController dataDictionaryController;
@Value("special-dept")
String deptKey;
@Value("special-deptType")
String deptTypeKey;
/** /**
* 新增单位信息 * 新增单位信息
* *
...@@ -742,15 +758,35 @@ public class OrgUsrController extends BaseController { ...@@ -742,15 +758,35 @@ public class OrgUsrController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "根据机构类型(逗号分割),机构编码获取列表不分页", notes = "根据机构类型(逗号分割),机构编码获取列表不分页") @ApiOperation(httpMethod = "GET", value = "根据机构类型(逗号分割),机构编码获取列表不分页", notes = "根据机构类型(逗号分割),机构编码获取列表不分页")
@GetMapping(value = "/{authKey}/listWithAuth") @GetMapping(value = "/{authKey}/listWithAuth")
public ResponseModel<List<OrgUsr>> getListWithAuth(@RequestParam(required = false) String orgTypes, public ResponseModel<List<OrgUsr>> getListWithAuth(@RequestParam(required = false) String orgTypes,
@PathVariable String authKey) { @PathVariable String authKey) throws Exception {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity(); ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String bizOrgCode = personIdentity.getBizOrgCode(); String bizOrgCode = personIdentity.getBizOrgCode();
//拿到数据字典中存储的 特殊类型 特殊部门
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "01").or().eq("type", "02");
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
ArrayList<String> objects = new ArrayList<>();
list.stream().forEach(e->objects.add(e.getName()));
if (objects.contains(authKey)){
if (objects.contains(personIdentity.getCompanyId())) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr::getParentId,personIdentity.getCompanyId());
wrapper.eq(BaseEntity::getIsDelete,false);
OrgUsr orgUsr = orgUsrMapper.selectOne(wrapper);
personIdentity.setBizOrgCode(orgUsr.getBizOrgCode() != null? orgUsr.getBizOrgCode() : personIdentity.getBizOrgCode());
}
}
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
return ResponseHelper.buildResponse(iOrgUsrService.getListByBizOrgTypeCode(orgTypes, bizOrgCode)); return ResponseHelper.buildResponse(iOrgUsrService.getListByBizOrgTypeCode(orgTypes, bizOrgCode));
} }
@PersonIdentify @PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{authKey}/treeWithAuth", method = RequestMethod.GET) @RequestMapping(value = "/{authKey}/treeWithAuth", method = RequestMethod.GET)
......
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