Commit 64aeb87c authored by tianhongyang's avatar tianhongyang

Merge branch 'V20230915' of http://192.168.60.201/root/dsk-operate-sys into V20230915

parents 923f20ff acba8ba4
...@@ -40,7 +40,7 @@ public class CacheController { ...@@ -40,7 +40,7 @@ public class CacheController {
CACHES.add(new SysCache(GlobalConstants.CAPTCHA_CODE_KEY, "验证码")); CACHES.add(new SysCache(GlobalConstants.CAPTCHA_CODE_KEY, "验证码"));
CACHES.add(new SysCache(GlobalConstants.REPEAT_SUBMIT_KEY, "防重提交")); CACHES.add(new SysCache(GlobalConstants.REPEAT_SUBMIT_KEY, "防重提交"));
CACHES.add(new SysCache(GlobalConstants.RATE_LIMIT_KEY, "限流处理")); CACHES.add(new SysCache(GlobalConstants.RATE_LIMIT_KEY, "限流处理"));
CACHES.add(new SysCache(CacheNames.SYS_OSS_CONFIG, "OSS配置")); CACHES.add(new SysCache(GlobalConstants.SYS_OSS_CONFIG, "OSS配置"));
CACHES.add(new SysCache(GlobalConstants.PWD_ERR_CNT_KEY, "密码错误次数")); CACHES.add(new SysCache(GlobalConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
} }
......
...@@ -9,6 +9,7 @@ import com.dsk.common.core.domain.R; ...@@ -9,6 +9,7 @@ import com.dsk.common.core.domain.R;
import com.dsk.common.core.domain.model.DskAccessTokenVO; import com.dsk.common.core.domain.model.DskAccessTokenVO;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.enums.BusinessType; import com.dsk.common.enums.BusinessType;
import com.dsk.common.tenant.helper.TenantHelper;
import com.dsk.common.utils.poi.ExcelUtil; import com.dsk.common.utils.poi.ExcelUtil;
import com.dsk.system.domain.SysConfig; import com.dsk.system.domain.SysConfig;
import com.dsk.system.service.ISysConfigService; import com.dsk.system.service.ISysConfigService;
...@@ -87,6 +88,19 @@ public class SysConfigController extends BaseController { ...@@ -87,6 +88,19 @@ public class SysConfigController extends BaseController {
return R.ok(); return R.ok();
} }
/**
* 新增租户参数配置
*/
@SaCheckPermission("system:config:tenant:add")
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping("/tenant/add")
public R<Void> tenantAdd(@Validated @RequestBody SysConfig config) {
TenantHelper.ignore(() -> {
configService.insertTenantConfig(config);
});
return R.ok();
}
/** /**
* 修改参数配置 * 修改参数配置
*/ */
...@@ -137,8 +151,6 @@ public class SysConfigController extends BaseController { ...@@ -137,8 +151,6 @@ public class SysConfigController extends BaseController {
} }
/** /**
* 获取大司空open 插件访问token * 获取大司空open 插件访问token
*/ */
...@@ -146,7 +158,7 @@ public class SysConfigController extends BaseController { ...@@ -146,7 +158,7 @@ public class SysConfigController extends BaseController {
@Log(title = "获取dsk访问token", businessType = BusinessType.OTHER) @Log(title = "获取dsk访问token", businessType = BusinessType.OTHER)
@GetMapping("/dsk/accessToken") @GetMapping("/dsk/accessToken")
public R<DskAccessTokenVO> dskAccessToken() { public R<DskAccessTokenVO> dskAccessToken() {
DskAccessTokenVO dskAccessTokenVO= configService.getDskAccessToken(); DskAccessTokenVO dskAccessTokenVO = configService.getDskAccessToken();
return R.ok(dskAccessTokenVO); return R.ok(dskAccessTokenVO);
} }
} }
--- # 监控中心配置 --- # 监控中心配置
spring.boot.admin.client: spring.boot.admin.client:
# 增加客户端开关 # 增加客户端开关
enabled: true enabled: false
url: http://localhost:9090/admin url: http://localhost:9090/admin
instance: instance:
service-host-type: IP service-host-type: IP
......
...@@ -160,6 +160,8 @@ tenant: ...@@ -160,6 +160,8 @@ tenant:
- sys_client - sys_client
- sys_region - sys_region
- sys_user_file_record - sys_user_file_record
- sys_oss_config
- sys_region
- contact_info - contact_info
- customer_user - customer_user
- customer_follow_record - customer_follow_record
......
...@@ -48,4 +48,15 @@ public interface GlobalConstants { ...@@ -48,4 +48,15 @@ public interface GlobalConstants {
*/ */
String BATCH_IMPORT_FAIL_USERS = GLOBAL_REDIS_KEY + "batch_import_fail_users"; String BATCH_IMPORT_FAIL_USERS = GLOBAL_REDIS_KEY + "batch_import_fail_users";
/**
* OSS配置
*/
String SYS_OSS_CONFIG = GLOBAL_REDIS_KEY + "sys_oss_config";
/**
* 默认配置KEY
*/
String DEFAULT_CONFIG_KEY = GLOBAL_REDIS_KEY + "sys_oss:default_config";
} }
...@@ -51,7 +51,7 @@ public class JskCombineInfoController extends BaseController { ...@@ -51,7 +51,7 @@ public class JskCombineInfoController extends BaseController {
* 集团成员列表 * 集团成员列表
*/ */
@PostMapping("/memberList") @PostMapping("/memberList")
public AjaxResult memberList(@RequestBody JskCombineSearchDto dto) throws Exception { public TableDataInfo memberList(@RequestBody JskCombineSearchDto dto) throws Exception {
return baseService.memberList(dto); return baseService.memberList(dto);
} }
......
...@@ -27,6 +27,10 @@ public class JskCombineSearchDto implements Serializable { ...@@ -27,6 +27,10 @@ public class JskCombineSearchDto implements Serializable {
* 筛选参数 * 筛选参数
*/ */
private String searchValue; private String searchValue;
/**
* 筛选参数
*/
private String keys;
/** /**
* 集团层级 * 集团层级
*/ */
...@@ -59,6 +63,10 @@ public class JskCombineSearchDto implements Serializable { ...@@ -59,6 +63,10 @@ public class JskCombineSearchDto implements Serializable {
* 科技型企业类型 * 科技型企业类型
*/ */
private List<String> companyTypes; private List<String> companyTypes;
/**
* 招标采购分类
*/
private List<String> subjectMatters;
/** /**
* 企业类型 * 企业类型
*/ */
......
...@@ -52,9 +52,13 @@ public class JskCombineInfoService { ...@@ -52,9 +52,13 @@ public class JskCombineInfoService {
@Resource @Resource
private RedisCache redisCache; private RedisCache redisCache;
public AjaxResult memberList(JskCombineSearchDto dto) { // public AjaxResult memberList(JskCombineSearchDto dto) {
Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/enterprice/combine/memberList", BeanUtil.beanToMap(dto, false, false)); // Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/enterprice/combine/memberList", BeanUtil.beanToMap(dto, false, false));
return BeanUtil.toBean(map, AjaxResult.class); // return BeanUtil.toBean(map, AjaxResult.class);
// }
public TableDataInfo memberList(JskCombineSearchDto dto) throws Exception {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/combine/memberList", BeanUtil.beanToMap(dto, false, false));
return dskOpenApiUtil.responsePage(map);
} }
public R groupMemberCount(JskCombineSearchDto dto) { public R groupMemberCount(JskCombineSearchDto dto) {
......
...@@ -158,7 +158,9 @@ public class ExportService { ...@@ -158,7 +158,9 @@ public class ExportService {
Map<String, Object> dataMap = CommonUtils.assertAsMap(obj); Map<String, Object> dataMap = CommonUtils.assertAsMap(obj);
vo.setId(i++); vo.setId(i++);
vo.setCompanyName(MapUtil.getStr(dataMap, "companyName")); vo.setCompanyName(MapUtil.getStr(dataMap, "companyName"));
if (null!=pageDto.getKeys()){
vo.setCompanyName(MapUtil.getStr(dataMap, "companyName"));
}
StringBuilder domicile = new StringBuilder(); StringBuilder domicile = new StringBuilder();
if (null != dataMap.get("province")) { if (null != dataMap.get("province")) {
domicile.append(MapUtil.getStr(dataMap,"province")); domicile.append(MapUtil.getStr(dataMap,"province"));
...@@ -179,7 +181,7 @@ public class ExportService { ...@@ -179,7 +181,7 @@ public class ExportService {
//供应商 //供应商
vo.setSupplierCount(MapUtil.getInt(dataMap, "supplierCount")); vo.setSupplierCount(MapUtil.getInt(dataMap, "supplierCount"));
//债卷余额 //债卷余额
vo.setCreditBalance(MapUtil.getDouble(dataMap, "creditBalance")); vo.setCreditBalance(MapUtil.getDouble(dataMap, "bondBalance"));
//主体评级 //主体评级
vo.setBratingSubjectLevel(MapUtil.getStr(dataMap, "bratingSubjectLevel")); vo.setBratingSubjectLevel(MapUtil.getStr(dataMap, "bratingSubjectLevel"));
//行政级别 //行政级别
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="handleCancel()">取消</el-button> <el-button @click="handleCancel()">取消</el-button>
<el-button type="primary" @click="handleEXCEL">确认导出</el-button> <el-button type="primary" :loading="loading" @click="handleEXCEL">确认导出</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="dialogExportVisible1" width="348px" append-to-body class="dialogExport1" @close="handleCancel2"> <el-dialog :visible.sync="dialogExportVisible1" width="348px" append-to-body class="dialogExport1" @close="handleCancel2">
...@@ -68,13 +68,15 @@ export default { ...@@ -68,13 +68,15 @@ export default {
exportTableData:[], exportTableData:[],
forData:[], forData:[],
value:'', value:'',
title:this.data.title title:this.data.title,
loading:false,
} }
}, },
watch: { watch: {
'data.exportEXCEL':{ 'data.exportEXCEL':{
handler(newValue, oldValue) { handler(newValue, oldValue) {
if(newValue === true){ if(newValue === true){
this.loading = false;
this.dialogExportVisible=false; this.dialogExportVisible=false;
this.dialogExportVisible1=true; this.dialogExportVisible1=true;
} }
...@@ -91,6 +93,7 @@ export default { ...@@ -91,6 +93,7 @@ export default {
}, },
methods: { methods: {
handleEXCEL(){ handleEXCEL(){
this.loading = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$emit('clickEXCEL',this.value,this.title) this.$emit('clickEXCEL',this.value,this.title)
}) })
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
@sort-change="sortChange" @sort-change="sortChange"
> >
<template slot="companyName" slot-scope="scope"> <template slot="companyName" slot-scope="scope">
<router-link :to="scope.row.uipId?`/enterprise/${encodeStr(scope.row.companyId)}`:`/company/${encodeStr(scope.row.companyId)}`" tag="a" class="a-link" v-if="scope.row.companyId&&scope.row.companyName" v-html="scope.row.companyName"></router-link> <div v-if="scope.row.companyId&&scope.row.companyName" class="a-link" @click="getUipIdByCid(scope.row.companyId)" v-html="scope.row.companyName"></div>
<div v-else v-html="scope.row.companyName || '--'"></div> <div v-else v-html="scope.row.companyName || '--'"></div>
</template> </template>
<template slot="stockPercent" slot-scope="scope"> <template slot="stockPercent" slot-scope="scope">
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
<script> <script>
import {memberList,memberCount,memberListExport} from '@/api/detail/groupAccount/groupAccount' import {memberList,memberCount,memberListExport} from '@/api/detail/groupAccount/groupAccount'
import { getUipIdByCid } from '@/api/macro/macro'
import dataRegion from '@/assets/json/dataRegion' import dataRegion from '@/assets/json/dataRegion'
import { getDictType } from '@/api/main' import { getDictType } from '@/api/main'
import mixin from '../../party-a/mixins/mixin' import mixin from '../../party-a/mixins/mixin'
...@@ -301,8 +302,8 @@ ...@@ -301,8 +302,8 @@
this.isSkeleton = false this.isSkeleton = false
this.tableLoading = false this.tableLoading = false
if(res.code === 200){ if(res.code === 200){
this.tableData = res.data.list this.tableData = res.rows
this.tableDataTotal = res.data.total this.tableDataTotal = res.total
}else { }else {
this.tableData = [] this.tableData = []
} }
...@@ -479,10 +480,28 @@ ...@@ -479,10 +480,28 @@
this.handleQuery(params) this.handleQuery(params)
this.$emit('handle-scroll') this.$emit('handle-scroll')
}, },
getUipIdByCid(companyId){
var params=[companyId]
getUipIdByCid(params).then(res=>{
if (res.code==200) {
if(res.data&&res.data.length>0&&res.data[0].uipId){
this.$router.push({path: '/enterprise/'+this.encodeStr(companyId)})
}else{
this.$router.push({path: '/company/'+this.encodeStr(companyId)})
}
}
}).catch(error=>{
});
},
clickDialog(){ clickDialog(){
this.exportData.dialogExportVisible=true; this.exportData.dialogExportVisible=true;
}, },
clickEXCEL(value,title) { clickEXCEL(value,title) {
if(this.tableData.length === 0){
this.$message.error('当前信息列表数据为空,请重新筛选数据');
return
}
if(value > 2000){ if(value > 2000){
return return
} }
......
...@@ -315,6 +315,10 @@ ...@@ -315,6 +315,10 @@
this.exportData.dialogExportVisible=true; this.exportData.dialogExportVisible=true;
}, },
clickEXCEL(value,title) { clickEXCEL(value,title) {
if(this.tableData.length === 0){
this.$message.error('当前信息列表数据为空,请重新筛选数据');
return
}
if(value > 2000){ if(value > 2000){
return return
} }
......
...@@ -291,6 +291,10 @@ ...@@ -291,6 +291,10 @@
this.exportData.dialogExportVisible=true; this.exportData.dialogExportVisible=true;
}, },
clickEXCEL(value,title) { clickEXCEL(value,title) {
if(this.tableData.length === 0){
this.$message.error('当前信息列表数据为空,请重新筛选数据');
return
}
if(value > 2000){ if(value > 2000){
return return
} }
......
...@@ -1001,6 +1001,10 @@ export default { ...@@ -1001,6 +1001,10 @@ export default {
this.exportData.dialogExportVisible=true; this.exportData.dialogExportVisible=true;
}, },
clickEXCEL(value,title) { clickEXCEL(value,title) {
if(this.tableData.length === 0){
this.$message.error('当前信息列表数据为空,请重新筛选数据');
return
}
if(value > 2000){ if(value > 2000){
return return
} }
......
...@@ -3044,6 +3044,10 @@ export default { ...@@ -3044,6 +3044,10 @@ export default {
this.exportData.dialogExportVisible=true; this.exportData.dialogExportVisible=true;
}, },
clickEXCEL(value,title) { clickEXCEL(value,title) {
if(this.tableData.length === 0){
this.$message.error('当前信息列表数据为空,请重新筛选数据');
return
}
if(value > 2000){ if(value > 2000){
return return
} }
...@@ -3053,7 +3057,6 @@ export default { ...@@ -3053,7 +3057,6 @@ export default {
}else { }else {
this.dataEXCEL.exportCount=2000; this.dataEXCEL.exportCount=2000;
} }
console.log(this.exportData)
//企业资质 //企业资质
if(this.exportData.type === 1){ if(this.exportData.type === 1){
api.aptitudeExport(this.dataEXCEL).then(res => { api.aptitudeExport(this.dataEXCEL).then(res => {
......
...@@ -848,6 +848,10 @@ export default { ...@@ -848,6 +848,10 @@ export default {
this.exportData.dialogExportVisible=true; this.exportData.dialogExportVisible=true;
}, },
clickEXCEL(value,title) { clickEXCEL(value,title) {
if(this.tableData.length === 0){
this.$message.error('当前信息列表数据为空,请重新筛选数据');
return
}
if(value > 2000){ if(value > 2000){
return return
} }
......
...@@ -686,6 +686,10 @@ export default { ...@@ -686,6 +686,10 @@ export default {
this.exportData.dialogExportVisible=true; this.exportData.dialogExportVisible=true;
}, },
clickEXCEL(value,title) { clickEXCEL(value,title) {
if(this.tableData.length === 0){
this.$message.error('当前信息列表数据为空,请重新筛选数据');
return
}
if(value > 2000){ if(value > 2000){
return return
} }
......
package com.dsk.oss.factory; package com.dsk.oss.factory;
import com.dsk.common.constant.GlobalConstants;
import com.dsk.oss.constant.OssConstant; import com.dsk.oss.constant.OssConstant;
import com.dsk.oss.exception.OssException; import com.dsk.oss.exception.OssException;
import com.dsk.oss.properties.OssProperties; import com.dsk.oss.properties.OssProperties;
...@@ -30,6 +31,9 @@ public class OssFactory { ...@@ -30,6 +31,9 @@ public class OssFactory {
public static OssClient instance() { public static OssClient instance() {
// 获取redis 默认类型 // 获取redis 默认类型
String configKey = RedisUtils.getCacheObject(OssConstant.DEFAULT_CONFIG_KEY); String configKey = RedisUtils.getCacheObject(OssConstant.DEFAULT_CONFIG_KEY);
if (StringUtils.isEmpty(configKey)) {
configKey = RedisUtils.getCacheObject(GlobalConstants.DEFAULT_CONFIG_KEY);
}
if (StringUtils.isEmpty(configKey)) { if (StringUtils.isEmpty(configKey)) {
throw new OssException("文件存储服务类型无法找到!"); throw new OssException("文件存储服务类型无法找到!");
} }
...@@ -40,7 +44,7 @@ public class OssFactory { ...@@ -40,7 +44,7 @@ public class OssFactory {
* 根据类型获取实例 * 根据类型获取实例
*/ */
public static OssClient instance(String configKey) { public static OssClient instance(String configKey) {
String json = CacheUtils.get(CacheNames.SYS_OSS_CONFIG, configKey); String json = CacheUtils.get(GlobalConstants.SYS_OSS_CONFIG, configKey);
if (json == null) { if (json == null) {
throw new OssException("系统异常, '" + configKey + "'配置信息不存在!"); throw new OssException("系统异常, '" + configKey + "'配置信息不存在!");
} }
......
...@@ -55,6 +55,13 @@ public interface ISysConfigService { ...@@ -55,6 +55,13 @@ public interface ISysConfigService {
* @return 结果 * @return 结果
*/ */
String insertConfig(SysConfig config); String insertConfig(SysConfig config);
/**
* 新增租户参数配置
*
* @param config 参数配置信息
* @return 结果
*/
void insertTenantConfig(SysConfig config);
/** /**
* 修改参数配置 * 修改参数配置
......
...@@ -2,11 +2,14 @@ package com.dsk.system.service.impl; ...@@ -2,11 +2,14 @@ package com.dsk.system.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.common.constant.GlobalConstants;
import com.dsk.common.constant.TenantConstants;
import com.dsk.common.tenant.core.TenantEntity; import com.dsk.common.tenant.core.TenantEntity;
import com.dsk.common.tenant.helper.TenantHelper; import com.dsk.common.tenant.helper.TenantHelper;
import com.dsk.common.utils.StreamUtils; import com.dsk.common.utils.StreamUtils;
...@@ -67,6 +70,11 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { ...@@ -67,6 +70,11 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey); RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey);
} }
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config));
if(TenantConstants.DEFAULT_TENANT_ID.equals(config.getTenantId())){
RedisUtils.setCacheObject(GlobalConstants.DEFAULT_CONFIG_KEY, configKey);
CacheUtils.put(GlobalConstants.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config));
}
} }
} }
} finally { } finally {
......
...@@ -6,21 +6,21 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -6,21 +6,21 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.acc.openapi.api.AccClient; import com.dsk.acc.openapi.api.AccClient;
import com.dsk.acc.openapi.client.Config; import com.dsk.acc.openapi.client.Config;
import com.dsk.acc.openapi.client.util.CommonUtils; import com.dsk.acc.openapi.client.util.CommonUtils;
import com.dsk.common.config.DskOpenApiConfig; import com.dsk.common.constant.TenantConstants;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.exception.ServiceException; import com.dsk.common.tenant.helper.TenantHelper;
import com.dsk.system.domain.SysConfig; import com.dsk.system.domain.SysConfig;
import com.dsk.system.mapper.SysConfigMapper; import com.dsk.system.mapper.SysConfigMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@Slf4j
@Component @Component
public class DskOpenApiUtil { public class DskOpenApiUtil {
...@@ -74,6 +74,7 @@ public class DskOpenApiUtil { ...@@ -74,6 +74,7 @@ public class DskOpenApiUtil {
try { try {
if (ObjectUtils.isEmpty(config)) initApiConfig(); if (ObjectUtils.isEmpty(config)) initApiConfig();
AccClient.init(config); AccClient.init(config);
log.error(">>>>>>config:"+JSONUtil.toJsonStr(config));
Map<String, ?> res = AccClient.request(reqBodyType, path, bodyMap); Map<String, ?> res = AccClient.request(reqBodyType, path, bodyMap);
if (!res.containsKey("headers") || !res.containsKey("body")) { if (!res.containsKey("headers") || !res.containsKey("body")) {
throw new RuntimeException(String.format("请求无返回:path=%s", path)); throw new RuntimeException(String.format("请求无返回:path=%s", path));
...@@ -124,20 +125,15 @@ public class DskOpenApiUtil { ...@@ -124,20 +125,15 @@ public class DskOpenApiUtil {
return new TableDataInfo((List<?>) list, count); return new TableDataInfo((List<?>) list, count);
} }
private void initApiConfig() throws Exception { private void initApiConfig() {
DskOpenApiConfig dskOpenApiConfig = new DskOpenApiConfig(); TenantHelper.ignore(() -> {
Class<DskOpenApiConfig> clazz = DskOpenApiConfig.class; SysConfig accessKeyId = sysConfigMapper.selectOne(Wrappers.<SysConfig>lambdaQuery().eq(SysConfig::getTenantId, TenantConstants.DEFAULT_TENANT_ID).eq(SysConfig::getConfigKey, "dsk-Appkey"));
Field[] fields = clazz.getDeclaredFields(); SysConfig accessKeySecret = sysConfigMapper.selectOne(Wrappers.<SysConfig>lambdaQuery().eq(SysConfig::getTenantId, TenantConstants.DEFAULT_TENANT_ID).eq(SysConfig::getConfigKey, "dsk-AppSecret"));
for (int i = 0; i < fields.length; i++) { SysConfig endPoint = sysConfigMapper.selectOne(Wrappers.<SysConfig>lambdaQuery().eq(SysConfig::getTenantId, TenantConstants.DEFAULT_TENANT_ID).eq(SysConfig::getConfigKey, "dsk-Domain"));
fields[i].setAccessible(true); log.error(">>>>>>config:"+JSONUtil.toJsonStr(config));
SysConfig config = sysConfigMapper.selectOne(Wrappers.<SysConfig>lambdaQuery().eq(SysConfig::getConfigKey, "plugIn-".concat(fields[i].getName()))); config = new Config(accessKeyId.getConfigValue(), accessKeySecret.getConfigValue())
fields[i].set(dskOpenApiConfig, config.getConfigValue()); .setEndpoint(endPoint.getConfigValue());
} });
if (ObjectUtils.isEmpty(dskOpenApiConfig)) {
throw new ServiceException("DskOpenApiConfig 初始化失败!");
}
config = new Config(dskOpenApiConfig.accessKeyId, dskOpenApiConfig.accessKeySecret)
.setEndpoint(dskOpenApiConfig.endPoint);
} }
} }
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