Commit 797acdb8 authored by tianyiming's avatar tianyiming

监管-部分公共接口修改

parent a3eb9d9c
...@@ -16,5 +16,7 @@ import java.util.Map; ...@@ -16,5 +16,7 @@ import java.util.Map;
public interface CommonMapper extends BaseMapper<EquipmentCategory> { public interface CommonMapper extends BaseMapper<EquipmentCategory> {
List<Map<String, Object>> getUnitListByType(String type); List<Map<String, Object>> getUnitListByType(String type);
List<Map<String, Object>> getSecurityAdmin(String companyCode);
} }
...@@ -14,4 +14,16 @@ ...@@ -14,4 +14,16 @@
WHERE WHERE
unit_type LIKE CONCAT('%',#{type},'%') AND is_delete = '0'; unit_type LIKE CONCAT('%',#{type},'%') AND is_delete = '0';
</select> </select>
<select id="getSecurityAdmin" resultType="java.util.Map">
SELECT
name,
phone,
certificate_num
FROM
"tzs_user_info"
WHERE
unit_code = #{companyCode}
AND post_name LIKE '%安全管理员%'
</select>
</mapper> </mapper>
...@@ -71,4 +71,16 @@ public class CommonController extends BaseController { ...@@ -71,4 +71,16 @@ public class CommonController extends BaseController {
public ResponseModel<List<Map<String,Object>>> getUnitList(@RequestParam(value = "type") String type) { public ResponseModel<List<Map<String,Object>>> getUnitList(@RequestParam(value = "type") String type) {
return ResponseHelper.buildResponse(commonService.getUnitListByType(type)); return ResponseHelper.buildResponse(commonService.getUnitListByType(type));
} }
/**
* 查找当前公司下所属的安全管理员
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getSecurityAdmin")
@ApiOperation(httpMethod = "GET", value = "查找当前公司下所属的安全管理员", notes = "查找当前公司下所属的安全管理员")
public ResponseModel<List<Map<String,Object>>> getSecurityAdmin() {
return ResponseHelper.buildResponse(commonService.getSecurityAdmin());
}
} }
...@@ -24,4 +24,6 @@ public interface ICommonService { ...@@ -24,4 +24,6 @@ public interface ICommonService {
List<LinkedHashMap> creatTree(); List<LinkedHashMap> creatTree();
List<Map<String,Object>> getUnitListByType(String type); List<Map<String,Object>> getUnitListByType(String type);
List<Map<String,Object>> getSecurityAdmin();
} }
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
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.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService; import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.PrivilegeFeginService; import com.yeejoin.amos.boot.module.jg.flc.api.fegin.PrivilegeFeginService;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory; import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgFactoryInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
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;
...@@ -159,6 +167,14 @@ public class CommonServiceImpl implements ICommonService { ...@@ -159,6 +167,14 @@ public class CommonServiceImpl implements ICommonService {
return commonMapper.getUnitListByType(type); return commonMapper.getUnitListByType(type);
} }
@Override
public List<Map<String, Object>> getSecurityAdmin() {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
CompanyBo company = reginParams.getCompany();
String companyCode = company.getCompanyCode();
return commonMapper.getSecurityAdmin(companyCode);
}
/** /**
* 将管辖机构树中children为[]的修改为null * 将管辖机构树中children为[]的修改为null
* *
......
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