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
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 {
...
@@ -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
(
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
,
"密码错误次数"
));
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;
...
@@ -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
);
}
}
}
}
dsk-admin/src/main/resources/application-test.yml
View file @
64aeb87c
---
# 监控中心配置
---
# 监控中心配置
spring.boot.admin.client
:
spring.boot.admin.client
:
# 增加客户端开关
# 增加客户端开关
enabled
:
tru
e
enabled
:
fals
e
url
:
http://localhost:9090/admin
url
:
http://localhost:9090/admin
instance
:
instance
:
service-host-type
:
IP
service-host-type
:
IP
...
...
dsk-admin/src/main/resources/application.yml
View file @
64aeb87c
...
@@ -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
...
...
dsk-common/src/main/java/com/dsk/common/constant/GlobalConstants.java
View file @
64aeb87c
...
@@ -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"
;
}
}
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 {
...
@@ -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
);
}
}
...
...
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 {
...
@@ -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
;
/**
/**
* 企业类型
* 企业类型
*/
*/
...
...
dsk-module/dsk-biz-api/src/main/java/com/dsk/jsk/service/JskCombineInfoService.java
View file @
64aeb87c
...
@@ -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
)
{
...
...
dsk-module/dsk-biz-api/src/main/java/com/dsk/search/service/ExportService.java
View file @
64aeb87c
...
@@ -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
,
"
credit
Balance"
));
vo
.
setCreditBalance
(
MapUtil
.
getDouble
(
dataMap
,
"
bond
Balance"
));
//主体评级
//主体评级
vo
.
setBratingSubjectLevel
(
MapUtil
.
getStr
(
dataMap
,
"bratingSubjectLevel"
));
vo
.
setBratingSubjectLevel
(
MapUtil
.
getStr
(
dataMap
,
"bratingSubjectLevel"
));
//行政级别
//行政级别
...
...
dsk-operate-ui/src/views/component/export-dialog.vue
View file @
64aeb87c
...
@@ -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
)
})
})
...
...
dsk-operate-ui/src/views/detail/groupAccount/component/members.vue
View file @
64aeb87c
...
@@ -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
}
}
...
...
dsk-operate-ui/src/views/detail/groupAccount/component/performance.vue
View file @
64aeb87c
...
@@ -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
}
}
...
...
dsk-operate-ui/src/views/detail/groupAccount/component/zbxmmx.vue
View file @
64aeb87c
...
@@ -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
}
}
...
...
dsk-operate-ui/src/views/enterpriseData/components/Owner/index.vue
View file @
64aeb87c
...
@@ -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
}
}
...
...
dsk-operate-ui/src/views/enterpriseData/components/SearchEnterprise/index.vue
View file @
64aeb87c
...
@@ -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
=>
{
...
...
dsk-operate-ui/src/views/macro/urban/index.vue
View file @
64aeb87c
...
@@ -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
}
}
...
...
dsk-operate-ui/src/views/radar/components/MajorProject/index.vue
View file @
64aeb87c
...
@@ -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
}
}
...
...
dsk-oss/src/main/java/com/dsk/oss/factory/OssFactory.java
View file @
64aeb87c
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
(
CacheName
s
.
SYS_OSS_CONFIG
,
configKey
);
String
json
=
CacheUtils
.
get
(
GlobalConstant
s
.
SYS_OSS_CONFIG
,
configKey
);
if
(
json
==
null
)
{
if
(
json
==
null
)
{
throw
new
OssException
(
"系统异常, '"
+
configKey
+
"'配置信息不存在!"
);
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 {
...
@@ -55,6 +55,13 @@ public interface ISysConfigService {
* @return 结果
* @return 结果
*/
*/
String
insertConfig
(
SysConfig
config
);
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
...
@@ -10,32 +10,35 @@ import cn.hutool.core.util.StrUtil;
...
@@ -10,32 +10,35 @@ import cn.hutool.core.util.StrUtil;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
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.CacheNames
;
import
com.dsk.common.constant.CacheNames
;
import
com.dsk.common.constant.TenantConstants
;
import
com.dsk.common.constant.UserConstants
;
import
com.dsk.common.constant.UserConstants
;
import
com.dsk.common.core.domain.PageQuery
;
import
com.dsk.common.core.domain.PageQuery
;
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.core.service.ConfigService
;
import
com.dsk.common.core.service.ConfigService
;
import
com.dsk.common.exception.ServiceException
;
import
com.dsk.common.exception.ServiceException
;
import
com.dsk.common.tenant.helper.TenantHelper
;
import
com.dsk.common.utils.JsonUtils
;
import
com.dsk.common.utils.JsonUtils
;
import
com.dsk.common.utils.StringUtils
;
import
com.dsk.common.utils.StringUtils
;
import
com.dsk.common.utils.redis.CacheUtils
;
import
com.dsk.common.utils.redis.CacheUtils
;
import
com.dsk.common.utils.spring.SpringUtils
;
import
com.dsk.common.utils.spring.SpringUtils
;
import
com.dsk.system.domain.SysConfig
;
import
com.dsk.system.domain.SysConfig
;
import
com.dsk.system.domain.SysTenant
;
import
com.dsk.system.mapper.SysConfigMapper
;
import
com.dsk.system.mapper.SysConfigMapper
;
import
com.dsk.system.mapper.SysTenantMapper
;
import
com.dsk.system.service.ISysConfigService
;
import
com.dsk.system.service.ISysConfigService
;
import
jodd.bean.BeanException
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cache.annotation.CachePut
;
import
org.springframework.cache.annotation.CachePut
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Arrays
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 参数配置 服务层实现
* 参数配置 服务层实现
...
@@ -49,15 +52,17 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -49,15 +52,17 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
private
final
SysConfigMapper
baseMapper
;
private
final
SysConfigMapper
baseMapper
;
private
final
SysTenantMapper
tenantMapper
;
@Override
@Override
public
TableDataInfo
<
SysConfig
>
selectPageConfigList
(
SysConfig
config
,
PageQuery
pageQuery
)
{
public
TableDataInfo
<
SysConfig
>
selectPageConfigList
(
SysConfig
config
,
PageQuery
pageQuery
)
{
Map
<
String
,
Object
>
params
=
config
.
getParams
();
Map
<
String
,
Object
>
params
=
config
.
getParams
();
LambdaQueryWrapper
<
SysConfig
>
lqw
=
new
LambdaQueryWrapper
<
SysConfig
>()
LambdaQueryWrapper
<
SysConfig
>
lqw
=
new
LambdaQueryWrapper
<
SysConfig
>()
.
like
(
StringUtils
.
isNotBlank
(
config
.
getConfigName
()),
SysConfig:
:
getConfigName
,
config
.
getConfigName
())
.
like
(
StringUtils
.
isNotBlank
(
config
.
getConfigName
()),
SysConfig:
:
getConfigName
,
config
.
getConfigName
())
.
eq
(
StringUtils
.
isNotBlank
(
config
.
getConfigType
()),
SysConfig:
:
getConfigType
,
config
.
getConfigType
())
.
eq
(
StringUtils
.
isNotBlank
(
config
.
getConfigType
()),
SysConfig:
:
getConfigType
,
config
.
getConfigType
())
.
like
(
StringUtils
.
isNotBlank
(
config
.
getConfigKey
()),
SysConfig:
:
getConfigKey
,
config
.
getConfigKey
())
.
like
(
StringUtils
.
isNotBlank
(
config
.
getConfigKey
()),
SysConfig:
:
getConfigKey
,
config
.
getConfigKey
())
.
between
(
params
.
get
(
"beginTime"
)
!=
null
&&
params
.
get
(
"endTime"
)
!=
null
,
.
between
(
params
.
get
(
"beginTime"
)
!=
null
&&
params
.
get
(
"endTime"
)
!=
null
,
SysConfig:
:
getCreateTime
,
params
.
get
(
"beginTime"
),
params
.
get
(
"endTime"
));
SysConfig:
:
getCreateTime
,
params
.
get
(
"beginTime"
),
params
.
get
(
"endTime"
));
Page
<
SysConfig
>
page
=
baseMapper
.
selectPage
(
pageQuery
.
build
(),
lqw
);
Page
<
SysConfig
>
page
=
baseMapper
.
selectPage
(
pageQuery
.
build
(),
lqw
);
return
TableDataInfo
.
build
(
page
);
return
TableDataInfo
.
build
(
page
);
}
}
...
@@ -84,7 +89,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -84,7 +89,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
@Override
@Override
public
String
selectConfigByKey
(
String
configKey
)
{
public
String
selectConfigByKey
(
String
configKey
)
{
SysConfig
retConfig
=
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
SysConfig
>()
SysConfig
retConfig
=
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
SysConfig
>()
.
eq
(
SysConfig:
:
getConfigKey
,
configKey
));
.
eq
(
SysConfig:
:
getConfigKey
,
configKey
));
if
(
ObjectUtil
.
isNotNull
(
retConfig
))
{
if
(
ObjectUtil
.
isNotNull
(
retConfig
))
{
return
retConfig
.
getConfigValue
();
return
retConfig
.
getConfigValue
();
}
}
...
@@ -115,11 +120,11 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -115,11 +120,11 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
public
List
<
SysConfig
>
selectConfigList
(
SysConfig
config
)
{
public
List
<
SysConfig
>
selectConfigList
(
SysConfig
config
)
{
Map
<
String
,
Object
>
params
=
config
.
getParams
();
Map
<
String
,
Object
>
params
=
config
.
getParams
();
LambdaQueryWrapper
<
SysConfig
>
lqw
=
new
LambdaQueryWrapper
<
SysConfig
>()
LambdaQueryWrapper
<
SysConfig
>
lqw
=
new
LambdaQueryWrapper
<
SysConfig
>()
.
like
(
StringUtils
.
isNotBlank
(
config
.
getConfigName
()),
SysConfig:
:
getConfigName
,
config
.
getConfigName
())
.
like
(
StringUtils
.
isNotBlank
(
config
.
getConfigName
()),
SysConfig:
:
getConfigName
,
config
.
getConfigName
())
.
eq
(
StringUtils
.
isNotBlank
(
config
.
getConfigType
()),
SysConfig:
:
getConfigType
,
config
.
getConfigType
())
.
eq
(
StringUtils
.
isNotBlank
(
config
.
getConfigType
()),
SysConfig:
:
getConfigType
,
config
.
getConfigType
())
.
like
(
StringUtils
.
isNotBlank
(
config
.
getConfigKey
()),
SysConfig:
:
getConfigKey
,
config
.
getConfigKey
())
.
like
(
StringUtils
.
isNotBlank
(
config
.
getConfigKey
()),
SysConfig:
:
getConfigKey
,
config
.
getConfigKey
())
.
between
(
params
.
get
(
"beginTime"
)
!=
null
&&
params
.
get
(
"endTime"
)
!=
null
,
.
between
(
params
.
get
(
"beginTime"
)
!=
null
&&
params
.
get
(
"endTime"
)
!=
null
,
SysConfig:
:
getCreateTime
,
params
.
get
(
"beginTime"
),
params
.
get
(
"endTime"
));
SysConfig:
:
getCreateTime
,
params
.
get
(
"beginTime"
),
params
.
get
(
"endTime"
));
return
baseMapper
.
selectList
(
lqw
);
return
baseMapper
.
selectList
(
lqw
);
}
}
...
@@ -139,6 +144,42 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -139,6 +144,42 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
throw
new
ServiceException
(
"操作失败"
);
throw
new
ServiceException
(
"操作失败"
);
}
}
/**
* 新增参数配置
*
* @param config 参数配置信息
* @return 结果
*/
@Override
public
void
insertTenantConfig
(
SysConfig
config
)
{
//重复验证
boolean
exists
=
baseMapper
.
exists
(
Wrappers
.<
SysConfig
>
lambdaQuery
().
eq
(
SysConfig:
:
getConfigKey
,
config
.
getConfigKey
()));
if
(
exists
){
throw
new
BeanException
(
"当前配置键已存在!"
);
}
List
<
SysConfig
>
list
=
new
ArrayList
<>();
SysConfig
admin
=
new
SysConfig
();
BeanUtil
.
copyProperties
(
config
,
admin
);
admin
.
setTenantId
(
TenantConstants
.
DEFAULT_TENANT_ID
);
list
.
add
(
admin
);
List
<
SysTenant
>
sysTenants
=
tenantMapper
.
selectList
();
if
(!
CollectionUtils
.
isEmpty
(
sysTenants
))
{
for
(
SysTenant
sysTenant
:
sysTenants
)
{
SysConfig
bean
=
new
SysConfig
();
BeanUtil
.
copyProperties
(
config
,
bean
);
bean
.
setTenantId
(
sysTenant
.
getTenantId
());
list
.
add
(
bean
);
}
}
boolean
b
=
baseMapper
.
insertBatch
(
list
);
if
(!
b
)
{
throw
new
ServiceException
(
"操作失败"
);
}
}
/**
/**
* 修改参数配置
* 修改参数配置
*
*
...
@@ -157,7 +198,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -157,7 +198,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
row
=
baseMapper
.
updateById
(
config
);
row
=
baseMapper
.
updateById
(
config
);
}
else
{
}
else
{
row
=
baseMapper
.
update
(
config
,
new
LambdaQueryWrapper
<
SysConfig
>()
row
=
baseMapper
.
update
(
config
,
new
LambdaQueryWrapper
<
SysConfig
>()
.
eq
(
SysConfig:
:
getConfigKey
,
config
.
getConfigKey
()));
.
eq
(
SysConfig:
:
getConfigKey
,
config
.
getConfigKey
()));
}
}
if
(
row
>
0
)
{
if
(
row
>
0
)
{
return
config
.
getConfigValue
();
return
config
.
getConfigValue
();
...
@@ -189,7 +230,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -189,7 +230,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
public
void
loadingConfigCache
()
{
public
void
loadingConfigCache
()
{
List
<
SysConfig
>
configsList
=
selectConfigList
(
new
SysConfig
());
List
<
SysConfig
>
configsList
=
selectConfigList
(
new
SysConfig
());
configsList
.
forEach
(
config
->
configsList
.
forEach
(
config
->
CacheUtils
.
put
(
CacheNames
.
SYS_CONFIG
,
config
.
getConfigKey
(),
config
.
getConfigValue
()));
CacheUtils
.
put
(
CacheNames
.
SYS_CONFIG
,
config
.
getConfigKey
(),
config
.
getConfigValue
()));
}
}
/**
/**
...
@@ -228,10 +269,10 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -228,10 +269,10 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
@Override
@Override
public
DskAccessTokenVO
getDskAccessToken
()
{
public
DskAccessTokenVO
getDskAccessToken
()
{
List
<
SysConfig
>
dskName
=
queryListByKey
(
"dsk"
);
List
<
SysConfig
>
dskName
=
queryListByKey
(
"dsk"
);
Assert
.
notEmpty
(
dskName
,
"大司空数据APPkey配置异常"
);
Assert
.
notEmpty
(
dskName
,
"大司空数据APPkey配置异常"
);
Map
<
String
,
Object
>
dskConfig
=
new
HashMap
<>();
Map
<
String
,
Object
>
dskConfig
=
new
HashMap
<>();
for
(
SysConfig
sysConfig
:
dskName
)
{
for
(
SysConfig
sysConfig
:
dskName
)
{
dskConfig
.
put
(
sysConfig
.
getConfigKey
(),
sysConfig
.
getConfigValue
());
dskConfig
.
put
(
sysConfig
.
getConfigKey
(),
sysConfig
.
getConfigValue
());
}
}
String
domain
=
(
String
)
dskConfig
.
get
(
"dsk-Domain"
);
String
domain
=
(
String
)
dskConfig
.
get
(
"dsk-Domain"
);
...
@@ -240,19 +281,19 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -240,19 +281,19 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
String
appSecret
=
(
String
)
dskConfig
.
get
(
"dsk-AppSecret"
);
String
appSecret
=
(
String
)
dskConfig
.
get
(
"dsk-AppSecret"
);
Map
<
String
,
Object
>
dskAccessTokenDto
=
new
HashMap
<>();
Map
<
String
,
Object
>
dskAccessTokenDto
=
new
HashMap
<>();
dskAccessTokenDto
.
put
(
"appKey"
,
appkey
);
dskAccessTokenDto
.
put
(
"appKey"
,
appkey
);
dskAccessTokenDto
.
put
(
"appSecret"
,
appSecret
);
dskAccessTokenDto
.
put
(
"appSecret"
,
appSecret
);
String
post
=
HttpUtil
.
post
(
domain
+
accessTokenAPI
,
JsonUtils
.
toJsonString
(
dskAccessTokenDto
));
String
post
=
HttpUtil
.
post
(
domain
+
accessTokenAPI
,
JsonUtils
.
toJsonString
(
dskAccessTokenDto
));
Assert
.
notEmpty
(
post
,
"大司空数据accessTokenAPI响应异常"
);
Assert
.
notEmpty
(
post
,
"大司空数据accessTokenAPI响应异常"
);
log
.
info
(
"大司空数据accessToken API响应:"
+
post
);
log
.
info
(
"大司空数据accessToken API响应:"
+
post
);
Dict
dict
=
JsonUtils
.
parseMap
(
post
);
Dict
dict
=
JsonUtils
.
parseMap
(
post
);
Object
dataObj
=
dict
.
getObj
(
"data"
);
Object
dataObj
=
dict
.
getObj
(
"data"
);
if
(
dict
.
getInt
(
"code"
)
!=
200
||
ObjectUtil
.
isEmpty
(
dataObj
))
{
if
(
dict
.
getInt
(
"code"
)
!=
200
||
ObjectUtil
.
isEmpty
(
dataObj
))
{
throw
new
ServiceException
(
"API数据accessTokenAPI响应异常"
,
500
);
throw
new
ServiceException
(
"API数据accessTokenAPI响应异常"
,
500
);
}
}
return
BeanUtil
.
toBean
(
dataObj
,
DskAccessTokenVO
.
class
);
return
BeanUtil
.
toBean
(
dataObj
,
DskAccessTokenVO
.
class
);
}
}
/**
/**
...
@@ -267,9 +308,9 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -267,9 +308,9 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
}
}
public
List
<
SysConfig
>
queryListByKey
(
String
keyName
){
public
List
<
SysConfig
>
queryListByKey
(
String
keyName
)
{
LambdaQueryWrapper
<
SysConfig
>
dsk
=
new
LambdaQueryWrapper
<
SysConfig
>().
likeRight
(
SysConfig:
:
getConfigKey
,
keyName
);
LambdaQueryWrapper
<
SysConfig
>
dsk
=
new
LambdaQueryWrapper
<
SysConfig
>().
likeRight
(
SysConfig:
:
getConfigKey
,
keyName
);
return
baseMapper
.
selectList
(
dsk
);
return
TenantHelper
.
ignore
(()
->
baseMapper
.
selectList
(
dsk
)
);
}
}
}
}
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;
...
@@ -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
{
...
...
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;
...
@@ -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.con
fig.DskOpenApiConfig
;
import
com.dsk.common.con
stant.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
);
}
}
}
}
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