Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fulixin
dsk-operate-sys-cscec
Commits
64aeb87c
Commit
64aeb87c
authored
Nov 24, 2023
by
tianhongyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'V20230915' of
http://192.168.60.201/root/dsk-operate-sys
into V20230915
parents
923f20ff
acba8ba4
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
206 additions
and
66 deletions
+206
-66
CacheController.java
.../java/com/dsk/web/controller/monitor/CacheController.java
+1
-1
SysConfigController.java
...va/com/dsk/web/controller/system/SysConfigController.java
+15
-3
application-test.yml
dsk-admin/src/main/resources/application-test.yml
+1
-1
application.yml
dsk-admin/src/main/resources/application.yml
+2
-0
GlobalConstants.java
...rc/main/java/com/dsk/common/constant/GlobalConstants.java
+11
-0
JskCombineInfoController.java
...java/com/dsk/jsk/controller/JskCombineInfoController.java
+1
-1
JskCombineSearchDto.java
...src/main/java/com/dsk/jsk/domain/JskCombineSearchDto.java
+8
-0
JskCombineInfoService.java
.../main/java/com/dsk/jsk/service/JskCombineInfoService.java
+7
-3
ExportService.java
...i/src/main/java/com/dsk/search/service/ExportService.java
+4
-2
export-dialog.vue
dsk-operate-ui/src/views/component/export-dialog.vue
+5
-2
members.vue
...te-ui/src/views/detail/groupAccount/component/members.vue
+22
-3
performance.vue
...i/src/views/detail/groupAccount/component/performance.vue
+4
-0
zbxmmx.vue
...ate-ui/src/views/detail/groupAccount/component/zbxmmx.vue
+4
-0
index.vue
...te-ui/src/views/enterpriseData/components/Owner/index.vue
+4
-0
index.vue
...iews/enterpriseData/components/SearchEnterprise/index.vue
+4
-1
index.vue
dsk-operate-ui/src/views/macro/urban/index.vue
+4
-0
index.vue
...rate-ui/src/views/radar/components/MajorProject/index.vue
+4
-0
OssFactory.java
dsk-oss/src/main/java/com/dsk/oss/factory/OssFactory.java
+5
-1
ISysConfigService.java
...c/main/java/com/dsk/system/service/ISysConfigService.java
+7
-0
SysConfigServiceImpl.java
...ava/com/dsk/system/service/impl/SysConfigServiceImpl.java
+71
-30
SysOssConfigServiceImpl.java
.../com/dsk/system/service/impl/SysOssConfigServiceImpl.java
+8
-0
DskOpenApiUtil.java
...em/src/main/java/com/dsk/system/utils/DskOpenApiUtil.java
+14
-18
No files found.
dsk-admin/src/main/java/com/dsk/web/controller/monitor/CacheController.java
View file @
64aeb87c
...
...
@@ -40,7 +40,7 @@ public class CacheController {
CACHES
.
add
(
new
SysCache
(
GlobalConstants
.
CAPTCHA_CODE_KEY
,
"验证码"
));
CACHES
.
add
(
new
SysCache
(
GlobalConstants
.
REPEAT_SUBMIT_KEY
,
"防重提交"
));
CACHES
.
add
(
new
SysCache
(
GlobalConstants
.
RATE_LIMIT_KEY
,
"限流处理"
));
CACHES
.
add
(
new
SysCache
(
CacheName
s
.
SYS_OSS_CONFIG
,
"OSS配置"
));
CACHES
.
add
(
new
SysCache
(
GlobalConstant
s
.
SYS_OSS_CONFIG
,
"OSS配置"
));
CACHES
.
add
(
new
SysCache
(
GlobalConstants
.
PWD_ERR_CNT_KEY
,
"密码错误次数"
));
}
...
...
dsk-admin/src/main/java/com/dsk/web/controller/system/SysConfigController.java
View file @
64aeb87c
...
...
@@ -9,6 +9,7 @@ import com.dsk.common.core.domain.R;
import
com.dsk.common.core.domain.model.DskAccessTokenVO
;
import
com.dsk.common.core.page.TableDataInfo
;
import
com.dsk.common.enums.BusinessType
;
import
com.dsk.common.tenant.helper.TenantHelper
;
import
com.dsk.common.utils.poi.ExcelUtil
;
import
com.dsk.system.domain.SysConfig
;
import
com.dsk.system.service.ISysConfigService
;
...
...
@@ -87,6 +88,19 @@ public class SysConfigController extends BaseController {
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 {
}
/**
* 获取大司空open 插件访问token
*/
...
...
@@ -146,7 +158,7 @@ public class SysConfigController extends BaseController {
@Log
(
title
=
"获取dsk访问token"
,
businessType
=
BusinessType
.
OTHER
)
@GetMapping
(
"/dsk/accessToken"
)
public
R
<
DskAccessTokenVO
>
dskAccessToken
()
{
DskAccessTokenVO
dskAccessTokenVO
=
configService
.
getDskAccessToken
();
DskAccessTokenVO
dskAccessTokenVO
=
configService
.
getDskAccessToken
();
return
R
.
ok
(
dskAccessTokenVO
);
}
}
dsk-admin/src/main/resources/application-test.yml
View file @
64aeb87c
---
# 监控中心配置
spring.boot.admin.client
:
# 增加客户端开关
enabled
:
tru
e
enabled
:
fals
e
url
:
http://localhost:9090/admin
instance
:
service-host-type
:
IP
...
...
dsk-admin/src/main/resources/application.yml
View file @
64aeb87c
...
...
@@ -160,6 +160,8 @@ tenant:
-
sys_client
-
sys_region
-
sys_user_file_record
-
sys_oss_config
-
sys_region
-
contact_info
-
customer_user
-
customer_follow_record
...
...
dsk-common/src/main/java/com/dsk/common/constant/GlobalConstants.java
View file @
64aeb87c
...
...
@@ -48,4 +48,15 @@ public interface GlobalConstants {
*/
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"
;
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/jsk/controller/JskCombineInfoController.java
View file @
64aeb87c
...
...
@@ -51,7 +51,7 @@ public class JskCombineInfoController extends BaseController {
* 集团成员列表
*/
@PostMapping
(
"/memberList"
)
public
AjaxResult
memberList
(
@RequestBody
JskCombineSearchDto
dto
)
throws
Exception
{
public
TableDataInfo
memberList
(
@RequestBody
JskCombineSearchDto
dto
)
throws
Exception
{
return
baseService
.
memberList
(
dto
);
}
...
...
dsk-module/dsk-biz-api/src/main/java/com/dsk/jsk/domain/JskCombineSearchDto.java
View file @
64aeb87c
...
...
@@ -27,6 +27,10 @@ public class JskCombineSearchDto implements Serializable {
* 筛选参数
*/
private
String
searchValue
;
/**
* 筛选参数
*/
private
String
keys
;
/**
* 集团层级
*/
...
...
@@ -59,6 +63,10 @@ public class JskCombineSearchDto implements Serializable {
* 科技型企业类型
*/
private
List
<
String
>
companyTypes
;
/**
* 招标采购分类
*/
private
List
<
String
>
subjectMatters
;
/**
* 企业类型
*/
...
...
dsk-module/dsk-biz-api/src/main/java/com/dsk/jsk/service/JskCombineInfoService.java
View file @
64aeb87c
...
...
@@ -52,9 +52,13 @@ public class JskCombineInfoService {
@Resource
private
RedisCache
redisCache
;
public
AjaxResult
memberList
(
JskCombineSearchDto
dto
)
{
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/enterprice/combine/memberList"
,
BeanUtil
.
beanToMap
(
dto
,
false
,
false
));
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
// public AjaxResult memberList(JskCombineSearchDto dto) {
// Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/enterprice/combine/memberList", BeanUtil.beanToMap(dto, false, false));
// 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
)
{
...
...
dsk-module/dsk-biz-api/src/main/java/com/dsk/search/service/ExportService.java
View file @
64aeb87c
...
...
@@ -158,7 +158,9 @@ public class ExportService {
Map
<
String
,
Object
>
dataMap
=
CommonUtils
.
assertAsMap
(
obj
);
vo
.
setId
(
i
++);
vo
.
setCompanyName
(
MapUtil
.
getStr
(
dataMap
,
"companyName"
));
if
(
null
!=
pageDto
.
getKeys
()){
vo
.
setCompanyName
(
MapUtil
.
getStr
(
dataMap
,
"companyName"
));
}
StringBuilder
domicile
=
new
StringBuilder
();
if
(
null
!=
dataMap
.
get
(
"province"
))
{
domicile
.
append
(
MapUtil
.
getStr
(
dataMap
,
"province"
));
...
...
@@ -179,7 +181,7 @@ public class ExportService {
//供应商
vo
.
setSupplierCount
(
MapUtil
.
getInt
(
dataMap
,
"supplierCount"
));
//债卷余额
vo
.
setCreditBalance
(
MapUtil
.
getDouble
(
dataMap
,
"
credit
Balance"
));
vo
.
setCreditBalance
(
MapUtil
.
getDouble
(
dataMap
,
"
bond
Balance"
));
//主体评级
vo
.
setBratingSubjectLevel
(
MapUtil
.
getStr
(
dataMap
,
"bratingSubjectLevel"
));
//行政级别
...
...
dsk-operate-ui/src/views/component/export-dialog.vue
View file @
64aeb87c
...
...
@@ -30,7 +30,7 @@
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<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>
</el-dialog>
<el-dialog
:visible
.
sync=
"dialogExportVisible1"
width=
"348px"
append-to-body
class=
"dialogExport1"
@
close=
"handleCancel2"
>
...
...
@@ -68,13 +68,15 @@ export default {
exportTableData
:[],
forData
:[],
value
:
''
,
title
:
this
.
data
.
title
title
:
this
.
data
.
title
,
loading
:
false
,
}
},
watch
:
{
'data.exportEXCEL'
:{
handler
(
newValue
,
oldValue
)
{
if
(
newValue
===
true
){
this
.
loading
=
false
;
this
.
dialogExportVisible
=
false
;
this
.
dialogExportVisible1
=
true
;
}
...
...
@@ -91,6 +93,7 @@ export default {
},
methods
:
{
handleEXCEL
(){
this
.
loading
=
true
;
this
.
$nextTick
(()
=>
{
this
.
$emit
(
'clickEXCEL'
,
this
.
value
,
this
.
title
)
})
...
...
dsk-operate-ui/src/views/detail/groupAccount/component/members.vue
View file @
64aeb87c
...
...
@@ -63,7 +63,7 @@
@
sort-change=
"sortChange"
>
<
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>
</
template
>
<
template
slot=
"stockPercent"
slot-scope=
"scope"
>
...
...
@@ -76,6 +76,7 @@
<
script
>
import
{
memberList
,
memberCount
,
memberListExport
}
from
'@/api/detail/groupAccount/groupAccount'
import
{
getUipIdByCid
}
from
'@/api/macro/macro'
import
dataRegion
from
'@/assets/json/dataRegion'
import
{
getDictType
}
from
'@/api/main'
import
mixin
from
'../../party-a/mixins/mixin'
...
...
@@ -301,8 +302,8 @@
this
.
isSkeleton
=
false
this
.
tableLoading
=
false
if
(
res
.
code
===
200
){
this
.
tableData
=
res
.
data
.
list
this
.
tableDataTotal
=
res
.
data
.
total
this
.
tableData
=
res
.
rows
this
.
tableDataTotal
=
res
.
total
}
else
{
this
.
tableData
=
[]
}
...
...
@@ -479,10 +480,28 @@
this
.
handleQuery
(
params
)
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
(){
this
.
exportData
.
dialogExportVisible
=
true
;
},
clickEXCEL
(
value
,
title
)
{
if
(
this
.
tableData
.
length
===
0
){
this
.
$message
.
error
(
'当前信息列表数据为空,请重新筛选数据'
);
return
}
if
(
value
>
2000
){
return
}
...
...
dsk-operate-ui/src/views/detail/groupAccount/component/performance.vue
View file @
64aeb87c
...
...
@@ -315,6 +315,10 @@
this
.
exportData
.
dialogExportVisible
=
true
;
},
clickEXCEL
(
value
,
title
)
{
if
(
this
.
tableData
.
length
===
0
){
this
.
$message
.
error
(
'当前信息列表数据为空,请重新筛选数据'
);
return
}
if
(
value
>
2000
){
return
}
...
...
dsk-operate-ui/src/views/detail/groupAccount/component/zbxmmx.vue
View file @
64aeb87c
...
...
@@ -291,6 +291,10 @@
this
.
exportData
.
dialogExportVisible
=
true
;
},
clickEXCEL
(
value
,
title
)
{
if
(
this
.
tableData
.
length
===
0
){
this
.
$message
.
error
(
'当前信息列表数据为空,请重新筛选数据'
);
return
}
if
(
value
>
2000
){
return
}
...
...
dsk-operate-ui/src/views/enterpriseData/components/Owner/index.vue
View file @
64aeb87c
...
...
@@ -1001,6 +1001,10 @@ export default {
this
.
exportData
.
dialogExportVisible
=
true
;
},
clickEXCEL
(
value
,
title
)
{
if
(
this
.
tableData
.
length
===
0
){
this
.
$message
.
error
(
'当前信息列表数据为空,请重新筛选数据'
);
return
}
if
(
value
>
2000
){
return
}
...
...
dsk-operate-ui/src/views/enterpriseData/components/SearchEnterprise/index.vue
View file @
64aeb87c
...
...
@@ -3044,6 +3044,10 @@ export default {
this
.
exportData
.
dialogExportVisible
=
true
;
},
clickEXCEL
(
value
,
title
)
{
if
(
this
.
tableData
.
length
===
0
){
this
.
$message
.
error
(
'当前信息列表数据为空,请重新筛选数据'
);
return
}
if
(
value
>
2000
){
return
}
...
...
@@ -3053,7 +3057,6 @@ export default {
}
else
{
this
.
dataEXCEL
.
exportCount
=
2000
;
}
console
.
log
(
this
.
exportData
)
//企业资质
if
(
this
.
exportData
.
type
===
1
){
api
.
aptitudeExport
(
this
.
dataEXCEL
).
then
(
res
=>
{
...
...
dsk-operate-ui/src/views/macro/urban/index.vue
View file @
64aeb87c
...
...
@@ -848,6 +848,10 @@ export default {
this
.
exportData
.
dialogExportVisible
=
true
;
},
clickEXCEL
(
value
,
title
)
{
if
(
this
.
tableData
.
length
===
0
){
this
.
$message
.
error
(
'当前信息列表数据为空,请重新筛选数据'
);
return
}
if
(
value
>
2000
){
return
}
...
...
dsk-operate-ui/src/views/radar/components/MajorProject/index.vue
View file @
64aeb87c
...
...
@@ -686,6 +686,10 @@ export default {
this
.
exportData
.
dialogExportVisible
=
true
;
},
clickEXCEL
(
value
,
title
)
{
if
(
this
.
tableData
.
length
===
0
){
this
.
$message
.
error
(
'当前信息列表数据为空,请重新筛选数据'
);
return
}
if
(
value
>
2000
){
return
}
...
...
dsk-oss/src/main/java/com/dsk/oss/factory/OssFactory.java
View file @
64aeb87c
package
com
.
dsk
.
oss
.
factory
;
import
com.dsk.common.constant.GlobalConstants
;
import
com.dsk.oss.constant.OssConstant
;
import
com.dsk.oss.exception.OssException
;
import
com.dsk.oss.properties.OssProperties
;
...
...
@@ -30,6 +31,9 @@ public class OssFactory {
public
static
OssClient
instance
()
{
// 获取redis 默认类型
String
configKey
=
RedisUtils
.
getCacheObject
(
OssConstant
.
DEFAULT_CONFIG_KEY
);
if
(
StringUtils
.
isEmpty
(
configKey
))
{
configKey
=
RedisUtils
.
getCacheObject
(
GlobalConstants
.
DEFAULT_CONFIG_KEY
);
}
if
(
StringUtils
.
isEmpty
(
configKey
))
{
throw
new
OssException
(
"文件存储服务类型无法找到!"
);
}
...
...
@@ -40,7 +44,7 @@ public class OssFactory {
* 根据类型获取实例
*/
public
static
OssClient
instance
(
String
configKey
)
{
String
json
=
CacheUtils
.
get
(
CacheName
s
.
SYS_OSS_CONFIG
,
configKey
);
String
json
=
CacheUtils
.
get
(
GlobalConstant
s
.
SYS_OSS_CONFIG
,
configKey
);
if
(
json
==
null
)
{
throw
new
OssException
(
"系统异常, '"
+
configKey
+
"'配置信息不存在!"
);
}
...
...
dsk-system/src/main/java/com/dsk/system/service/ISysConfigService.java
View file @
64aeb87c
...
...
@@ -55,6 +55,13 @@ public interface ISysConfigService {
* @return 结果
*/
String
insertConfig
(
SysConfig
config
);
/**
* 新增租户参数配置
*
* @param config 参数配置信息
* @return 结果
*/
void
insertTenantConfig
(
SysConfig
config
);
/**
* 修改参数配置
...
...
dsk-system/src/main/java/com/dsk/system/service/impl/SysConfigServiceImpl.java
View file @
64aeb87c
This diff is collapsed.
Click to expand it.
dsk-system/src/main/java/com/dsk/system/service/impl/SysOssConfigServiceImpl.java
View file @
64aeb87c
...
...
@@ -2,11 +2,14 @@ package com.dsk.system.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
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.helper.TenantHelper
;
import
com.dsk.common.utils.StreamUtils
;
...
...
@@ -67,6 +70,11 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
RedisUtils
.
setCacheObject
(
OssConstant
.
DEFAULT_CONFIG_KEY
,
configKey
);
}
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
{
...
...
dsk-system/src/main/java/com/dsk/system/utils/DskOpenApiUtil.java
View file @
64aeb87c
...
...
@@ -6,21 +6,21 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.dsk.acc.openapi.api.AccClient
;
import
com.dsk.acc.openapi.client.Config
;
import
com.dsk.acc.openapi.client.util.CommonUtils
;
import
com.dsk.common.con
fig.DskOpenApiConfig
;
import
com.dsk.common.con
stant.TenantConstants
;
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.mapper.SysConfigMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.MapUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
javax.annotation.Resource
;
import
java.lang.reflect.Field
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@Component
public
class
DskOpenApiUtil
{
...
...
@@ -74,6 +74,7 @@ public class DskOpenApiUtil {
try
{
if
(
ObjectUtils
.
isEmpty
(
config
))
initApiConfig
();
AccClient
.
init
(
config
);
log
.
error
(
">>>>>>config:"
+
JSONUtil
.
toJsonStr
(
config
));
Map
<
String
,
?>
res
=
AccClient
.
request
(
reqBodyType
,
path
,
bodyMap
);
if
(!
res
.
containsKey
(
"headers"
)
||
!
res
.
containsKey
(
"body"
))
{
throw
new
RuntimeException
(
String
.
format
(
"请求无返回:path=%s"
,
path
));
...
...
@@ -124,20 +125,15 @@ public class DskOpenApiUtil {
return
new
TableDataInfo
((
List
<?>)
list
,
count
);
}
private
void
initApiConfig
()
throws
Exception
{
DskOpenApiConfig
dskOpenApiConfig
=
new
DskOpenApiConfig
();
Class
<
DskOpenApiConfig
>
clazz
=
DskOpenApiConfig
.
class
;
Field
[]
fields
=
clazz
.
getDeclaredFields
();
for
(
int
i
=
0
;
i
<
fields
.
length
;
i
++)
{
fields
[
i
].
setAccessible
(
true
);
SysConfig
config
=
sysConfigMapper
.
selectOne
(
Wrappers
.<
SysConfig
>
lambdaQuery
().
eq
(
SysConfig:
:
getConfigKey
,
"plugIn-"
.
concat
(
fields
[
i
].
getName
())));
fields
[
i
].
set
(
dskOpenApiConfig
,
config
.
getConfigValue
());
}
if
(
ObjectUtils
.
isEmpty
(
dskOpenApiConfig
))
{
throw
new
ServiceException
(
"DskOpenApiConfig 初始化失败!"
);
}
config
=
new
Config
(
dskOpenApiConfig
.
accessKeyId
,
dskOpenApiConfig
.
accessKeySecret
)
.
setEndpoint
(
dskOpenApiConfig
.
endPoint
);
private
void
initApiConfig
()
{
TenantHelper
.
ignore
(()
->
{
SysConfig
accessKeyId
=
sysConfigMapper
.
selectOne
(
Wrappers
.<
SysConfig
>
lambdaQuery
().
eq
(
SysConfig:
:
getTenantId
,
TenantConstants
.
DEFAULT_TENANT_ID
).
eq
(
SysConfig:
:
getConfigKey
,
"dsk-Appkey"
));
SysConfig
accessKeySecret
=
sysConfigMapper
.
selectOne
(
Wrappers
.<
SysConfig
>
lambdaQuery
().
eq
(
SysConfig:
:
getTenantId
,
TenantConstants
.
DEFAULT_TENANT_ID
).
eq
(
SysConfig:
:
getConfigKey
,
"dsk-AppSecret"
));
SysConfig
endPoint
=
sysConfigMapper
.
selectOne
(
Wrappers
.<
SysConfig
>
lambdaQuery
().
eq
(
SysConfig:
:
getTenantId
,
TenantConstants
.
DEFAULT_TENANT_ID
).
eq
(
SysConfig:
:
getConfigKey
,
"dsk-Domain"
));
log
.
error
(
">>>>>>config:"
+
JSONUtil
.
toJsonStr
(
config
));
config
=
new
Config
(
accessKeyId
.
getConfigValue
(),
accessKeySecret
.
getConfigValue
())
.
setEndpoint
(
endPoint
.
getConfigValue
());
});
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment