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
982466bc
Commit
982466bc
authored
Dec 14, 2023
by
lcl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u and a
parent
2337ae84
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
235 additions
and
5 deletions
+235
-5
SysConfigController.java
...va/com/dsk/web/controller/system/SysConfigController.java
+19
-0
SysPushController.java
...main/java/com/dsk/cscec/controller/SysPushController.java
+66
-0
SysPush.java
...k-biz-api/src/main/java/com/dsk/cscec/domain/SysPush.java
+47
-0
SysPushMapper.java
...api/src/main/java/com/dsk/cscec/mapper/SysPushMapper.java
+15
-0
ISysPushService.java
.../src/main/java/com/dsk/cscec/service/ISysPushService.java
+19
-0
SysPushServiceImpl.java
...n/java/com/dsk/cscec/service/impl/SysPushServiceImpl.java
+32
-0
SysUserImportListener.java
...n/java/com/dsk/system/listener/SysUserImportListener.java
+1
-1
ISysConfigService.java
...c/main/java/com/dsk/system/service/ISysConfigService.java
+11
-1
SysConfigServiceImpl.java
...ava/com/dsk/system/service/impl/SysConfigServiceImpl.java
+25
-3
No files found.
dsk-admin/src/main/java/com/dsk/web/controller/system/SysConfigController.java
View file @
982466bc
...
@@ -71,6 +71,16 @@ public class SysConfigController extends BaseController {
...
@@ -71,6 +71,16 @@ public class SysConfigController extends BaseController {
*/
*/
@GetMapping
(
value
=
"/configKey/{configKey}"
)
@GetMapping
(
value
=
"/configKey/{configKey}"
)
public
R
<
Void
>
getConfigKey
(
@PathVariable
String
configKey
)
{
public
R
<
Void
>
getConfigKey
(
@PathVariable
String
configKey
)
{
return
R
.
ok
(
configService
.
selectConfigValueByKey
(
configKey
));
}
/**
* 根据参数键名查询参数值
*
* @param configKey 参数Key
*/
@GetMapping
(
value
=
"/{configKey}"
)
public
R
<
SysConfig
>
getConfig
(
@PathVariable
String
configKey
)
{
return
R
.
ok
(
configService
.
selectConfigByKey
(
configKey
));
return
R
.
ok
(
configService
.
selectConfigByKey
(
configKey
));
}
}
...
@@ -161,4 +171,13 @@ public class SysConfigController extends BaseController {
...
@@ -161,4 +171,13 @@ public class SysConfigController extends BaseController {
DskAccessTokenVO
dskAccessTokenVO
=
configService
.
getDskAccessToken
();
DskAccessTokenVO
dskAccessTokenVO
=
configService
.
getDskAccessToken
();
return
R
.
ok
(
dskAccessTokenVO
);
return
R
.
ok
(
dskAccessTokenVO
);
}
}
/**
* 根据键修改值
*/
@PutMapping
(
value
=
"/updateValue"
)
public
R
<
Void
>
updateByConfigKey
(
@RequestBody
SysConfig
config
)
{
configService
.
updateByConfigKey
(
config
);
return
R
.
ok
();
}
}
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/controller/SysPushController.java
0 → 100644
View file @
982466bc
package
com
.
dsk
.
cscec
.
controller
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.dsk.common.core.controller.BaseController
;
import
com.dsk.common.core.domain.PageQuery
;
import
com.dsk.common.core.domain.R
;
import
com.dsk.common.core.page.TableDataInfo
;
import
com.dsk.cscec.domain.SysPush
;
import
com.dsk.cscec.service.ISysPushService
;
import
org.apache.ibatis.annotations.Delete
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
/**
* 系统推送(SysPush)表控制层
*
* @author lcl
* @since 2023-12-14 10:09:24
*/
@RestController
@RequestMapping
(
"sysPush"
)
public
class
SysPushController
extends
BaseController
{
/**
* 服务对象
*/
@Autowired
private
ISysPushService
baseService
;
/**
* 推送分页列表
*/
@GetMapping
(
"/pageList"
)
public
TableDataInfo
<
SysPush
>
pageList
(
SysPush
bean
,
PageQuery
query
)
{
return
baseService
.
pageList
(
bean
,
query
);
}
/**
* 添加推送人
*/
@PostMapping
public
R
<
Void
>
add
(
@RequestBody
SysPush
bean
)
{
return
toAjax
(
baseService
.
save
(
bean
));
}
/**
* 修改推送状态
*/
@PutMapping
(
"/updateStatus"
)
public
R
<
Void
>
updateStatus
(
@RequestBody
SysPush
bean
)
{
return
toAjax
(
baseService
.
update
(
Wrappers
.<
SysPush
>
lambdaUpdate
()
.
set
(
SysPush:
:
getStatus
,
bean
.
getStatus
()).
eq
(
SysPush:
:
getId
,
bean
.
getId
())));
}
/**
* 删除推送人
*/
@DeleteMapping
(
"/{id}"
)
public
R
<
Void
>
del
(
@PathVariable
Long
id
)
{
return
toAjax
(
baseService
.
removeById
(
id
));
}
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/domain/SysPush.java
0 → 100644
View file @
982466bc
package
com
.
dsk
.
cscec
.
domain
;
import
java.util.Date
;
import
java.io.Serializable
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
/**
* 系统推送(SysPush)表实体类
*
* @author lcl
* @since 2023-12-14 10:09:24
*/
@Data
public
class
SysPush
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
)
private
Long
id
;
/**
* 推送类型编码
*/
private
String
pushTypeCode
;
/**
* 推送类型
*/
private
String
pushType
;
/**
* 姓名
*/
private
String
name
;
/**
* 联系方式
*/
private
String
contact
;
/**
* 状态 0:正常 1:停用
*/
private
Integer
status
;
private
Date
createTime
;
private
String
tanentId
;
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/mapper/SysPushMapper.java
0 → 100644
View file @
982466bc
package
com
.
dsk
.
cscec
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.dsk.cscec.domain.SysPush
;
/**
* 系统推送(SysPush)表数据库访问层
*
* @author lcl
* @since 2023-12-14 10:09:24
*/
public
interface
SysPushMapper
extends
BaseMapper
<
SysPush
>
{
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/service/ISysPushService.java
0 → 100644
View file @
982466bc
package
com
.
dsk
.
cscec
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.dsk.common.core.domain.PageQuery
;
import
com.dsk.common.core.page.TableDataInfo
;
import
com.dsk.cscec.domain.SysPush
;
/**
* 系统推送(SysPush)表服务接口
*
* @author lcl
* @since 2023-12-14 10:09:24
*/
public
interface
ISysPushService
extends
IService
<
SysPush
>
{
TableDataInfo
<
SysPush
>
pageList
(
SysPush
bean
,
PageQuery
query
);
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/service/impl/SysPushServiceImpl.java
0 → 100644
View file @
982466bc
package
com
.
dsk
.
cscec
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.dsk.common.core.domain.PageQuery
;
import
com.dsk.common.core.page.TableDataInfo
;
import
com.dsk.common.exception.ServiceException
;
import
com.dsk.cscec.mapper.SysPushMapper
;
import
com.dsk.cscec.domain.SysPush
;
import
com.dsk.cscec.service.ISysPushService
;
import
jodd.bean.BeanException
;
import
org.springframework.stereotype.Service
;
/**
* 系统推送(SysPush)表服务实现类
*
* @author lcl
* @since 2023-12-14 10:09:24
*/
@Service
public
class
SysPushServiceImpl
extends
ServiceImpl
<
SysPushMapper
,
SysPush
>
implements
ISysPushService
{
@Override
public
TableDataInfo
<
SysPush
>
pageList
(
SysPush
bean
,
PageQuery
query
)
{
if
(
ObjectUtils
.
isEmpty
(
bean
.
getPushTypeCode
()))
throw
new
BeanException
(
"推送类型code不能为空!"
);
return
TableDataInfo
.
build
(
baseMapper
.
selectPage
(
query
.
build
(),
Wrappers
.<
SysPush
>
lambdaQuery
()
.
eq
(
SysPush:
:
getPushTypeCode
,
bean
.
getPushTypeCode
())
.
orderByDesc
(
SysPush:
:
getCreateTime
)));
}
}
dsk-system/src/main/java/com/dsk/system/listener/SysUserImportListener.java
View file @
982466bc
...
@@ -48,7 +48,7 @@ public class SysUserImportListener extends AnalysisEventListener<SysUserImportVo
...
@@ -48,7 +48,7 @@ public class SysUserImportListener extends AnalysisEventListener<SysUserImportVo
private
final
StringBuilder
failureMsg
=
new
StringBuilder
();
private
final
StringBuilder
failureMsg
=
new
StringBuilder
();
public
SysUserImportListener
(
Boolean
isUpdateSupport
)
{
public
SysUserImportListener
(
Boolean
isUpdateSupport
)
{
String
initPassword
=
SpringUtils
.
getBean
(
ISysConfigService
.
class
).
selectConfigByKey
(
"sys.user.initPassword"
);
String
initPassword
=
SpringUtils
.
getBean
(
ISysConfigService
.
class
).
selectConfig
Value
ByKey
(
"sys.user.initPassword"
);
this
.
userService
=
SpringUtils
.
getBean
(
ISysUserService
.
class
);
this
.
userService
=
SpringUtils
.
getBean
(
ISysUserService
.
class
);
this
.
deptService
=
SpringUtils
.
getBean
(
ISysDeptService
.
class
);
this
.
deptService
=
SpringUtils
.
getBean
(
ISysDeptService
.
class
);
this
.
roleService
=
SpringUtils
.
getBean
(
ISysRoleService
.
class
);
this
.
roleService
=
SpringUtils
.
getBean
(
ISysRoleService
.
class
);
...
...
dsk-system/src/main/java/com/dsk/system/service/ISysConfigService.java
View file @
982466bc
...
@@ -31,7 +31,14 @@ public interface ISysConfigService {
...
@@ -31,7 +31,14 @@ public interface ISysConfigService {
* @param configKey 参数键名
* @param configKey 参数键名
* @return 参数键值
* @return 参数键值
*/
*/
String
selectConfigByKey
(
String
configKey
);
String
selectConfigValueByKey
(
String
configKey
);
/**
* 根据键名查询参数配置信息
*
* @param configKey 参数键名
* @return 参数键值
*/
SysConfig
selectConfigByKey
(
String
configKey
);
/**
/**
* 获取验证码开关
* 获取验证码开关
...
@@ -102,4 +109,7 @@ public interface ISysConfigService {
...
@@ -102,4 +109,7 @@ public interface ISysConfigService {
boolean
checkConfigKeyUnique
(
SysConfig
config
);
boolean
checkConfigKeyUnique
(
SysConfig
config
);
DskAccessTokenVO
getDskAccessToken
();
DskAccessTokenVO
getDskAccessToken
();
void
updateByConfigKey
(
SysConfig
config
);
}
}
dsk-system/src/main/java/com/dsk/system/service/impl/SysConfigServiceImpl.java
View file @
982466bc
...
@@ -87,7 +87,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -87,7 +87,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
*/
*/
@Cacheable
(
cacheNames
=
CacheNames
.
SYS_CONFIG
,
key
=
"#configKey"
)
@Cacheable
(
cacheNames
=
CacheNames
.
SYS_CONFIG
,
key
=
"#configKey"
)
@Override
@Override
public
String
selectConfigByKey
(
String
configKey
)
{
public
String
selectConfig
Value
ByKey
(
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
))
{
...
@@ -96,6 +96,18 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -96,6 +96,18 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
return
StringUtils
.
EMPTY
;
return
StringUtils
.
EMPTY
;
}
}
/**
* 根据键名查询参数配置信息
*
* @param configKey 参数key
* @return 参数键值
*/
@Override
public
SysConfig
selectConfigByKey
(
String
configKey
)
{
return
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
SysConfig
>()
.
eq
(
SysConfig:
:
getConfigKey
,
configKey
));
}
/**
/**
* 获取验证码开关
* 获取验证码开关
*
*
...
@@ -103,7 +115,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -103,7 +115,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
*/
*/
@Override
@Override
public
boolean
selectCaptchaEnabled
()
{
public
boolean
selectCaptchaEnabled
()
{
String
captchaEnabled
=
SpringUtils
.
getAopProxy
(
this
).
selectConfigByKey
(
"sys.account.captchaEnabled"
);
String
captchaEnabled
=
SpringUtils
.
getAopProxy
(
this
).
selectConfig
Value
ByKey
(
"sys.account.captchaEnabled"
);
if
(
StringUtils
.
isEmpty
(
captchaEnabled
))
{
if
(
StringUtils
.
isEmpty
(
captchaEnabled
))
{
return
true
;
return
true
;
}
}
...
@@ -296,6 +308,16 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -296,6 +308,16 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
return
BeanUtil
.
toBean
(
dataObj
,
DskAccessTokenVO
.
class
);
return
BeanUtil
.
toBean
(
dataObj
,
DskAccessTokenVO
.
class
);
}
}
@Override
public
void
updateByConfigKey
(
SysConfig
config
)
{
int
update
=
baseMapper
.
update
(
config
,
Wrappers
.<
SysConfig
>
lambdaUpdate
()
.
set
(
SysConfig:
:
getConfigValue
,
config
.
getConfigValue
())
.
eq
(
SysConfig:
:
getConfigKey
,
config
.
getConfigKey
()));
if
(
update
==
0
){
throw
new
ServiceException
(
"修改失败!"
);
}
}
/**
/**
* 根据参数 key 获取参数值
* 根据参数 key 获取参数值
*
*
...
@@ -304,7 +326,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
...
@@ -304,7 +326,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
*/
*/
@Override
@Override
public
String
getConfigValue
(
String
configKey
)
{
public
String
getConfigValue
(
String
configKey
)
{
return
SpringUtils
.
getAopProxy
(
this
).
selectConfigByKey
(
configKey
);
return
SpringUtils
.
getAopProxy
(
this
).
selectConfig
Value
ByKey
(
configKey
);
}
}
...
...
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