Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fill-system
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖旭伟
fill-system
Commits
fa6b84b2
Commit
fa6b84b2
authored
Oct 08, 2022
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加基础设置接口
parent
046c6fdf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
261 additions
and
0 deletions
+261
-0
fill-manager/doc/api.md
fill-manager/doc/api.md
+73
-0
fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/ParamService.java
...m/mortals/xhx/base/system/param/service/ParamService.java
+24
-0
fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/impl/ParamServiceImpl.java
.../xhx/base/system/param/service/impl/ParamServiceImpl.java
+65
-0
fill-manager/src/main/java/com/mortals/xhx/module/home/pdu/BasicSettingsPdu.java
...ava/com/mortals/xhx/module/home/pdu/BasicSettingsPdu.java
+11
-0
fill-manager/src/main/java/com/mortals/xhx/module/home/web/BasicSettingsController.java
.../mortals/xhx/module/home/web/BasicSettingsController.java
+88
-0
No files found.
fill-manager/doc/api.md
View file @
fa6b84b2
...
@@ -1654,6 +1654,79 @@ data|object|数据对象
...
@@ -1654,6 +1654,79 @@ data|object|数据对象
"data":[]
"data":[]
}
}
}
}
```
## 基础设置
### 查看基础设置
**请求URL:**
setting/info
**请求方式:**
POST
**内容类型:**
application/json;charset=utf-8
**简要描述:**
查看基础设置
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|-
data|object|数据对象|-
  
hotWords|String|热门搜索词汇|-
  
printDisplay|Integer|空白打印材料展示数量|-
**响应消息样例:**
```
{
"code":1,
"data":{
}
}
```
### 保存基础设置
**请求URL:**
setting/save
**请求方式:**
POST
**内容类型:**
application/json;charset=utf-8
**简要描述:**
保存基础设置
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:-------
hotWords|String|是|热门搜索词汇
printDisplay|Integer|是|空白打印材料展示数量
**请求样例:**
```
{
"hotWords": "测试,hahaha",
"printDisplay": 10
}
```
**响应参数:**
参数名称 |参数类型|描述
:---|:---|:------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|object|数据对象
**响应消息样例:**
```
{
"msg":"保存成功",
"code":1,
"data":{}
}
}
```
```
## 字典附录
## 字典附录
...
...
fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/ParamService.java
View file @
fa6b84b2
...
@@ -5,6 +5,7 @@ import com.mortals.framework.service.ICRUDCacheService;
...
@@ -5,6 +5,7 @@ import com.mortals.framework.service.ICRUDCacheService;
import
com.mortals.framework.service.IParamService
;
import
com.mortals.framework.service.IParamService
;
import
com.mortals.xhx.base.system.param.model.ParamEntity
;
import
com.mortals.xhx.base.system.param.model.ParamEntity
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -44,4 +45,27 @@ public interface ParamService extends ICRUDCacheService<ParamEntity, Long>, IPar
...
@@ -44,4 +45,27 @@ public interface ParamService extends ICRUDCacheService<ParamEntity, Long>, IPar
*/
*/
Map
<
String
,
String
>
getParamBySecondOrganize
(
String
firstOrganize
,
String
secondOrganize
,
String
...
excludeParamKeys
);
Map
<
String
,
String
>
getParamBySecondOrganize
(
String
firstOrganize
,
String
secondOrganize
,
String
...
excludeParamKeys
);
/**
* 获取热词列表
* @return
*/
String
getHotWords
();
/**
* 设置热词列表
* @return
*/
void
setHotWords
(
String
value
);
/**
* 空白打印材料展示数量
* @return
*/
int
getPrintDisplayQuantity
();
/**
* 设置空白打印材料展示数量
* @return
*/
void
setPrintDisplayQuantity
(
int
value
);
}
}
\ No newline at end of file
fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/impl/ParamServiceImpl.java
View file @
fa6b84b2
...
@@ -13,6 +13,7 @@ import com.mortals.xhx.base.system.param.service.ParamService;
...
@@ -13,6 +13,7 @@ import com.mortals.xhx.base.system.param.service.ParamService;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -29,6 +30,9 @@ import java.util.stream.Collectors;
...
@@ -29,6 +30,9 @@ import java.util.stream.Collectors;
@Service
(
"paramService"
)
@Service
(
"paramService"
)
public
class
ParamServiceImpl
extends
AbstractCRUDCacheServiceImpl
<
ParamDao
,
ParamEntity
,
Long
>
public
class
ParamServiceImpl
extends
AbstractCRUDCacheServiceImpl
<
ParamDao
,
ParamEntity
,
Long
>
implements
ParamService
{
implements
ParamService
{
private
final
String
HOT_WORDS
=
"HotWords"
;
private
final
String
PRINT_QUANTITY
=
"PrintDisplayQuantity"
;
@Override
@Override
protected
String
getCacheName
()
{
protected
String
getCacheName
()
{
return
"ParamEntity.paramKey"
;
return
"ParamEntity.paramKey"
;
...
@@ -61,6 +65,67 @@ public class ParamServiceImpl extends AbstractCRUDCacheServiceImpl<ParamDao, Par
...
@@ -61,6 +65,67 @@ public class ParamServiceImpl extends AbstractCRUDCacheServiceImpl<ParamDao, Par
).
collect
(
Collectors
.
toMap
(
ParamEntity:
:
getParamKey
,
ParamEntity:
:
getParamValue
,
(
o
,
n
)
->
n
));
).
collect
(
Collectors
.
toMap
(
ParamEntity:
:
getParamKey
,
ParamEntity:
:
getParamValue
,
(
o
,
n
)
->
n
));
}
}
@Override
public
String
getHotWords
()
{
return
this
.
getParamValue
(
HOT_WORDS
);
}
@Override
public
void
setHotWords
(
String
value
)
{
List
<
ParamEntity
>
list
=
this
.
getCacheList
();
ParamEntity
entity
=
null
;
for
(
ParamEntity
paramEntity:
list
){
if
(
HOT_WORDS
.
equals
(
paramEntity
.
getParamKey
())){
entity
=
paramEntity
;
break
;
}
}
if
(
entity
!=
null
){
entity
.
setParamValue
(
value
);
this
.
update
(
entity
);
}
else
{
entity
=
new
ParamEntity
();
entity
.
setParamValue
(
value
);
entity
.
setParamKey
(
HOT_WORDS
);
entity
.
setName
(
"热门搜索词汇"
);
entity
.
setCreateTime
(
new
Date
());
entity
.
setCreateUserId
(
1
l
);
entity
.
setCreateUserName
(
"系统管理员"
);
this
.
save
(
entity
);
}
}
@Override
public
int
getPrintDisplayQuantity
()
{
String
printV
=
this
.
getParamValue
(
PRINT_QUANTITY
);
return
DataUtil
.
converStr2Int
(
printV
,
20
);
}
@Override
public
void
setPrintDisplayQuantity
(
int
value
)
{
List
<
ParamEntity
>
list
=
this
.
getCacheList
();
ParamEntity
entity
=
null
;
for
(
ParamEntity
paramEntity:
list
){
if
(
PRINT_QUANTITY
.
equals
(
paramEntity
.
getParamKey
())){
entity
=
paramEntity
;
break
;
}
}
if
(
entity
!=
null
){
entity
.
setParamValue
(
String
.
valueOf
(
value
));
this
.
update
(
entity
);
}
else
{
entity
=
new
ParamEntity
();
entity
.
setParamValue
(
String
.
valueOf
(
value
));
entity
.
setParamKey
(
PRINT_QUANTITY
);
entity
.
setName
(
"空白打印材料展示数量"
);
entity
.
setCreateTime
(
new
Date
());
entity
.
setCreateUserId
(
1
l
);
entity
.
setCreateUserName
(
"系统管理员"
);
this
.
save
(
entity
);
}
}
@Override
@Override
public
boolean
needRefresh
()
{
public
boolean
needRefresh
()
{
...
...
fill-manager/src/main/java/com/mortals/xhx/module/home/pdu/BasicSettingsPdu.java
0 → 100644
View file @
fa6b84b2
package
com.mortals.xhx.module.home.pdu
;
import
lombok.Data
;
@Data
public
class
BasicSettingsPdu
{
/** 热搜词 */
private
String
hotWords
;
/** 空白打印材料展示数量 */
private
Integer
printDisplay
;
}
fill-manager/src/main/java/com/mortals/xhx/module/home/web/BasicSettingsController.java
0 → 100644
View file @
fa6b84b2
package
com.mortals.xhx.module.home.web
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.IUser
;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.web.BaseJsonBodyController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.feign.base.pdu.DeptPdu
;
import
com.mortals.xhx.feign.base.pdu.SitePdu
;
import
com.mortals.xhx.feign.rsp.ApiResp
;
import
com.mortals.xhx.module.home.pdu.BasicSettingsPdu
;
import
com.mortals.xhx.module.home.pdu.HomeQueryPdu
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
@RestController
@RequestMapping
(
"setting"
)
public
class
BasicSettingsController
extends
BaseJsonBodyController
{
@Autowired
private
ParamService
paramService
;
@PostMapping
({
"info"
})
public
Rest
<
Object
>
list
()
{
IUser
user
=
this
.
getCurUser
();
if
(
user
==
null
){
throw
new
AppException
(
"用户未登录"
);
}
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
String
busiDesc
=
"查询基础设置"
;
int
code
=
1
;
try
{
model
.
put
(
"hotWords"
,
paramService
.
getHotWords
());
model
.
put
(
"printDisplay"
,
paramService
.
getPrintDisplayQuantity
());
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var9
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var9
);
}
ret
.
setCode
(
code
);
ret
.
setData
(
model
);
ret
.
setDict
(
model
.
get
(
"dict"
));
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
@PostMapping
({
"save"
})
public
Rest
<
Object
>
deptList
(
@RequestBody
BasicSettingsPdu
queryPdu
)
{
IUser
user
=
this
.
getCurUser
();
if
(
user
==
null
){
throw
new
AppException
(
"用户未登录"
);
}
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
String
busiDesc
=
"保存基础设置"
;
int
code
=
1
;
try
{
paramService
.
setHotWords
(
queryPdu
.
getHotWords
());
paramService
.
setPrintDisplayQuantity
(
queryPdu
.
getPrintDisplay
());
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var9
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var9
);
}
ret
.
setCode
(
code
);
ret
.
setData
(
model
);
ret
.
setDict
(
model
.
get
(
"dict"
));
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
}
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