Commit edfb42dc authored by tangwei's avatar tangwei

Merge branch 'develop_ccs' of http://172.16.10.76/moa/amos-boot-biz into develop_ccs

parents 76ba99fe 1599d8c4
...@@ -104,7 +104,7 @@ public interface FireTeamMapper extends BaseMapper<FireTeam> { ...@@ -104,7 +104,7 @@ public interface FireTeamMapper extends BaseMapper<FireTeam> {
*/ */
List<FireTeam> byTeamId(Long teamId); List<FireTeam> byTeamId(Long teamId);
List<FireTeamDto> listFireTeamDto(Boolean isDelete, String nodeId, String nodeType, String name, String typeCode,List<String> nodeIds); List<FireTeamDto> listFireTeamDto(Boolean isDelete, String nodeId, String nodeType, String name, String typeCode,List<String> nodeIds, String bizOrgCode);
List<FireTeamDto> listFireTeamDtoTree(Boolean isDelete); List<FireTeamDto> listFireTeamDtoTree(Boolean isDelete);
......
...@@ -66,7 +66,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -66,7 +66,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List< Map<String,Object>> getparent(); List< Map<String,Object>> getparent();
List< OrgUsrExcelDto> exportToExcel(String parentId ,String bizOrgName,String internalPositionCode ,String positionType); List< OrgUsrExcelDto> exportToExcel(String parentId ,String bizOrgCode,String internalPositionCode ,String positionType);
/** /**
* 查询单位基本信息列表和单位下所有的重点部位数量。 * 查询单位基本信息列表和单位下所有的重点部位数量。
......
...@@ -213,6 +213,8 @@ public interface IOrgUsrService { ...@@ -213,6 +213,8 @@ public interface IOrgUsrService {
*/ */
List<OrgMenuDto> companyTreeByUserAndType(ReginParams reginParams, String type); List<OrgMenuDto> companyTreeByUserAndType(ReginParams reginParams, String type);
List<OrgUsr> companyTreeByUserAndTypeNoTree(ReginParams reginParams, String type) ;
/** /**
* 根据登陆人获取公司列表(关联重点部位) * 根据登陆人获取公司列表(关联重点部位)
*/ */
......
...@@ -99,6 +99,9 @@ ...@@ -99,6 +99,9 @@
<if test='typeCode!=null and typeCode!=""'> <if test='typeCode!=null and typeCode!=""'>
and t.type_code = #{typeCode} and t.type_code = #{typeCode}
</if> </if>
<if test='bizOrgCode!=null and bizOrgCode!=""'>
and t.biz_org_code = #{bizOrgCode}
</if>
</select> </select>
<select id="listFireTeamDtoTree" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto"> <select id="listFireTeamDtoTree" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto">
select t.*, p.name parentName select t.*, p.name parentName
......
...@@ -548,8 +548,8 @@ GROUP BY ...@@ -548,8 +548,8 @@ GROUP BY
<if test="parentId != null and parentId != '' and parentId != '-1'"> <if test="parentId != null and parentId != '' and parentId != '-1'">
and a.parent_id = #{parentId} and a.parent_id = #{parentId}
</if> </if>
<if test="bizOrgName != null and bizOrgName != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND a.biz_org_name LIKE CONCAT( '%',#{bizOrgName}, '%') AND a.biz_org_code LIKE CONCAT( '%',#{bizOrgCode}, '%')
</if> </if>
<if test="internalPositionCode != null and internalPositionCode != ''"> <if test="internalPositionCode != null and internalPositionCode != ''">
and b.internalPositionCode = #{internalPositionCode} and b.internalPositionCode = #{internalPositionCode}
......
...@@ -9,12 +9,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -9,12 +9,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant; import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; 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.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; 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.Menu;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom; import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser; import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
...@@ -26,6 +30,7 @@ import org.apache.commons.lang3.ObjectUtils; ...@@ -26,6 +30,7 @@ import org.apache.commons.lang3.ObjectUtils;
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.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.exception.BaseException; import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -57,6 +62,9 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -57,6 +62,9 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
@Autowired @Autowired
DataDictionaryServiceImpl iDataDictionaryService; DataDictionaryServiceImpl iDataDictionaryService;
@Autowired
private RedisUtils redisUtils;
/** /**
* 获取监控大队列表 * 获取监控大队列表
...@@ -133,13 +141,17 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -133,13 +141,17 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
} }
public List<FireTeamDto> queryFireTeamForList(Boolean isDelete, Map map) { public List<FireTeamDto> queryFireTeamForList(Boolean isDelete, Map map) {
// 权限处理
String bizOrgCode = map.containsKey("bizOrgCode") ? map.get("bizOrgCode").toString() : null;
if (map == null || map.size() < 1) { if (map == null || map.size() < 1) {
return fireTeamMapper.listFireTeamDto(isDelete, null, null, null, null, null); return fireTeamMapper.listFireTeamDto(isDelete, null, null, null, null, null,bizOrgCode);
} }
String nodeId = map.containsKey("nodeId") ? map.get("nodeId").toString() : null; String nodeId = map.containsKey("nodeId") ? map.get("nodeId").toString() : null;
String nodeType = map.containsKey("nodeType") ? map.get("nodeType").toString() : null; String nodeType = map.containsKey("nodeType") ? map.get("nodeType").toString() : null;
String name = map.containsKey("name") ? map.get("name").toString() : null; String name = map.containsKey("name") ? map.get("name").toString() : null;
String typeCode = map.containsKey("typeCode") ? map.get("typeCode").toString() : null; String typeCode = map.containsKey("typeCode") ? map.get("typeCode").toString() : null;
List<String> nodeIdsList = null; List<String> nodeIdsList = null;
// 查询单位 // 查询单位
if (Objects.equals("1", nodeType)) { if (Objects.equals("1", nodeType)) {
...@@ -151,7 +163,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -151,7 +163,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
List<FireTeam> teamList = listFireTeamById(Long.parseLong(nodeId)); List<FireTeam> teamList = listFireTeamById(Long.parseLong(nodeId));
nodeIdsList = teamList.stream().map(e -> e.getSequenceNbr().toString()).collect(Collectors.toList()); nodeIdsList = teamList.stream().map(e -> e.getSequenceNbr().toString()).collect(Collectors.toList());
} }
return fireTeamMapper.listFireTeamDto(isDelete, nodeId, nodeType, name, typeCode, nodeIdsList); return fireTeamMapper.listFireTeamDto(isDelete, nodeId, nodeType, name, typeCode, nodeIdsList,bizOrgCode);
} }
/** /**
...@@ -451,7 +463,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -451,7 +463,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
} }
/** /**
* @param name * @param
* @return * @return
* @throws Exception * @throws Exception
*/ */
......
...@@ -1296,12 +1296,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1296,12 +1296,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override @Override
public List<OrgUsrExcelDto> exportToExcel(Map par) { public List<OrgUsrExcelDto> exportToExcel(Map par) {
String parentId = par.containsKey("parentId") ? par.get("parentId").toString() : null; String parentId = par.containsKey("parentId") ? par.get("parentId").toString() : null;
String bizOrgName = par.containsKey("bizOrgName") ? par.get("bizOrgName").toString() : null; String bizOrgCode = par.containsKey("bizOrgCode") ? par.get("bizOrgCode").toString() : null;
String internalPositionCode = par.containsKey("internalPositionCode") String internalPositionCode = par.containsKey("internalPositionCode")
? par.get("internalPositionCode").toString() ? par.get("internalPositionCode").toString()
: null; : null;
String positionType = par.containsKey("positionType") ? par.get("positionType").toString() : null; String positionType = par.containsKey("positionType") ? par.get("positionType").toString() : null;
return orgUsrMapper.exportToExcel(parentId, bizOrgName, internalPositionCode, positionType); return orgUsrMapper.exportToExcel(parentId, bizOrgCode, internalPositionCode, positionType);
} }
@Override @Override
...@@ -1407,6 +1407,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1407,6 +1407,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @Override
public List<OrgUsr> companyTreeByUserAndTypeNoTree(ReginParams reginParams, String type) {
Map<String, Object> param = new HashMap<>();
param.put("bizOrgCode", reginParams.getPersonIdentity().getBizOrgCode());
param.put("type", type);
List<OrgUsr> list = orgUsrMapper.companyTreeByUserAndType(param);
return list;
}
@Override
public List<CheckObjectDto> companyListByUser(AgencyUserModel user) { public List<CheckObjectDto> companyListByUser(AgencyUserModel user) {
List<CheckObjectDto> list = new ArrayList<>(); List<CheckObjectDto> list = new ArrayList<>();
// 需要角色为机场单位或管理员,其余角色返回空 // 需要角色为机场单位或管理员,其余角色返回空
......
...@@ -67,7 +67,7 @@ public class ExcelController extends BaseController { ...@@ -67,7 +67,7 @@ public class ExcelController extends BaseController {
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "下载模板") @ApiOperation(value = "下载模板")
@GetMapping("/download/template/{type}") @GetMapping("/download/template/{type}")
public void downloadTemplate(HttpServletResponse response, @PathVariable(value = "type") String type) { public void downloadTemplate(HttpServletResponse response, @PathVariable(value = "type") String type) {
...@@ -92,7 +92,7 @@ public class ExcelController extends BaseController { ...@@ -92,7 +92,7 @@ public class ExcelController extends BaseController {
* date 2021/9/13 * date 2021/9/13
* </PRE> * </PRE>
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类") @ApiOperation(value = "导出公用类")
@GetMapping("/export/{type}") @GetMapping("/export/{type}")
public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type, public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type,
......
...@@ -4,9 +4,14 @@ import com.alibaba.fastjson.JSONArray; ...@@ -4,9 +4,14 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper; import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom; import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto; import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto; import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto; import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
...@@ -15,6 +20,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; ...@@ -15,6 +20,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany; import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.ExcelSelectData; import com.yeejoin.amos.boot.module.common.api.enums.ExcelSelectData;
import com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.common.api.excel.DataSources; import com.yeejoin.amos.boot.module.common.api.excel.DataSources;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService; import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
...@@ -26,12 +32,15 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; ...@@ -26,12 +32,15 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import net.sf.cglib.beans.BeanMap;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
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;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -65,6 +74,9 @@ public class DataSourcesImpl implements DataSources { ...@@ -65,6 +74,9 @@ public class DataSourcesImpl implements DataSources {
@Autowired @Autowired
ILinkageUnitService linkageUnitServiceImpl; ILinkageUnitService linkageUnitServiceImpl;
@Autowired
private RedisUtils redisUtils;
@Autowired @Autowired
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
...@@ -293,8 +305,15 @@ public class DataSourcesImpl implements DataSources { ...@@ -293,8 +305,15 @@ public class DataSourcesImpl implements DataSources {
} }
private String[] getCompanyDetailTree() throws Exception { private String[] getCompanyDetailTree() throws Exception {
List<OrgMenuDto> orgUsrTree = orgUsrService.getTree(null, orgUsrService.getCompanyDetailTree(), // 导出模板增加权限
OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType"); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理
PermissionInterceptorContext.setDataAuthRule("fire_team_info");
List<OrgMenuDto> orgUsrTree = iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey());
// List<OrgMenuDto> orgUsrTree = orgUsrService.getTree(null, orgUsrService.getCompanyDetailTree(),
// OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
//
List<String> stringList = new ArrayList<String>(); List<String> stringList = new ArrayList<String>();
initCompanyList(orgUsrTree, stringList); initCompanyList(orgUsrTree, stringList);
String[] str = stringList.toArray(new String[stringList.size()]); String[] str = stringList.toArray(new String[stringList.size()]);
...@@ -303,8 +322,24 @@ public class DataSourcesImpl implements DataSources { ...@@ -303,8 +322,24 @@ public class DataSourcesImpl implements DataSources {
private String[] getparent() throws Exception { private String[] getparent() throws Exception {
// 导出模板增加权限
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理
PermissionInterceptorContext.setDataAuthRule("org_user_info");
List<OrgUsr> orgMenuDtoList = iOrgUsrService.companyTreeByUserAndTypeNoTree(reginParams, null);
List<Map<String, Object>> orgUsrTree = new ArrayList<>();
for (OrgUsr org: orgMenuDtoList
) {
Map<String, Object> map = Maps.newHashMap();
BeanMap beanMap = BeanMap.create(org);
map.put("name",beanMap.get("bizOrgName"));
map.put("id",beanMap.get("sequenceNbr"));
orgUsrTree.add(map);
}
String[] str = null; String[] str = null;
List<Map<String, Object>> orgUsrTree = orgUsrService.getparent(); // List<Map<String, Object>> orgUsrTree = orgUsrService.getparent();
if (orgUsrTree != null && orgUsrTree.size() > 0) { if (orgUsrTree != null && orgUsrTree.size() > 0) {
List<String> buildingNames = orgUsrTree.stream().map(item -> { List<String> buildingNames = orgUsrTree.stream().map(item -> {
return item.get("name") + "@" + item.get("id"); return item.get("name") + "@" + item.get("id");
......
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