Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
6a13dee2
Commit
6a13dee2
authored
Jul 06, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字典调整
parent
a5e4688e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
14 deletions
+34
-14
TEmpContractAlertServiceImpl.java
...u/archives/service/impl/TEmpContractAlertServiceImpl.java
+1
-1
CacheConstants.java
...oud.plus.v1/yifu/common/core/constant/CacheConstants.java
+10
-0
CommonConstants.java
...ud.plus.v1/yifu/common/core/constant/CommonConstants.java
+1
-1
ExcelUtil.java
...m/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
+11
-6
RedisUtil.java
...m/yifu.cloud.plus.v1/yifu/common/core/util/RedisUtil.java
+0
-1
SysDictItemServiceImpl.java
...us.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
+1
-1
DictItemRedisInit.java
...yifu/cloud/plus/v1/yifu/admin/init/DictItemRedisInit.java
+10
-4
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpContractAlertServiceImpl.java
View file @
6a13dee2
...
...
@@ -268,8 +268,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert
.
setFileTown
(
Integer
.
toString
(
contract
.
getFileTown
()));
}
alert
.
setEmpType
(
contract
.
getEmpNatrue
());
alert
.
setContractType
(
contract
.
getContractName
());
alert
.
setContractTerm
(
contract
.
getContractType
());
alert
.
setContractTerm
(
contract
.
getContractTerm
());
if
(
Common
.
isNotNull
(
alert
.
getContractEnd
())){
if
(
Common
.
isNotNull
(
contract
.
getContractEnd
())
&&
contract
.
getContractEnd
().
before
(
nowDate
)){
alert
.
setDueFlag
(
CommonConstants
.
ONE_STRING
);
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CacheConstants.java
View file @
6a13dee2
...
...
@@ -91,4 +91,14 @@ public interface CacheConstants {
**/
String
EVERYDAY_EMP_CONTRACT_CODE
=
"everyday_emp_contract_code"
;
/**
* 区域数据--标签
*/
String
AREA_LABEL
=
"area_label:"
;
/**
* 区域数据--值
*/
String
AREA_VALUE
=
"area_value:"
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CommonConstants.java
View file @
6a13dee2
...
...
@@ -192,7 +192,7 @@ public interface CommonConstants {
//- 横
char
DOWN_LINE_CHAR
=
'_'
;
// 冒号 :
String
COLON_STRING
=
"
:
"
;
String
COLON_STRING
=
"
:
"
;
// - 横 分割线 中
String
CENTER_SPLIT_LINE_STRING
=
"-"
;
// 斜杠
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
View file @
6a13dee2
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ValidityConstants
;
...
...
@@ -46,8 +47,6 @@ public class ExcelUtil <T> implements Serializable {
private
Field
[]
fields
;
public
void
convertEntity
(
T
vo
,
String
[]
exportFields
,
Map
<
String
,
String
>
diyDicMap
,
String
dateFormat
)
{
String
provinceTemp
;
String
cityTemp
;
// 得到所有定义字段
Field
[]
allFields
=
clazz
.
getDeclaredFields
();
List
<
Field
>
fields
=
new
ArrayList
<>();
...
...
@@ -171,7 +170,10 @@ public class ExcelUtil <T> implements Serializable {
}
// 默认字典获取不到 去 缓存获取
if
(
Common
.
isEmpty
(
tempValue
)
&&
Common
.
isNotNull
(
attr
.
dataType
())){
Map
<
String
,
String
>
dicObj
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
().
get
(
attr
.
dataType
());
Map
<
String
,
String
>
dicObj
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
()
.
get
(
CacheConstants
.
DICT_DETAILS
+
CommonConstants
.
COLON_STRING
+
attr
.
dataType
());
if
(
dicObj
!=
null
)
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
dicObj
.
entrySet
())
{
if
(
Common
.
isNotNull
(
entry
.
getKey
())
&&
entry
.
getKey
().
equals
(
value
.
trim
()))
{
...
...
@@ -447,11 +449,11 @@ public class ExcelUtil <T> implements Serializable {
return
propertyValue
;
}
private
String
getAreaLabel
(
String
c
)
{
return
(
String
)
RedisUtil
.
redis
.
opsForValue
().
get
(
c
);
return
(
String
)
RedisUtil
.
redis
.
opsForValue
().
get
(
CacheConstants
.
AREA_VALUE
+
c
);
}
private
String
getAreaValue
(
String
c
,
String
tempStr
,
ExcelAttribute
attr
,
Integer
rowNum
,
ErrorMessage
errorTemp
)
{
tempStr
=
String
.
valueOf
(
RedisUtil
.
redis
.
opsForValue
().
get
(
c
));
tempStr
=
String
.
valueOf
(
RedisUtil
.
redis
.
opsForValue
().
get
(
CacheConstants
.
AREA_LABEL
+
c
));
if
(
Common
.
isEmpty
(
tempStr
)){
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
rowNum
,
attr
.
name
()
+
":"
+
c
.
trim
()
+
"校验异常,请联系管理人员"
),
errorTemp
);
return
CommonConstants
.
EMPTY_STRING
;
...
...
@@ -459,7 +461,10 @@ public class ExcelUtil <T> implements Serializable {
return
tempStr
;
}
private
String
getDicValue
(
String
c
,
String
tempStr
,
ExcelAttribute
attr
,
Integer
rowNum
,
ErrorMessage
errorTemp
)
{
Map
<
String
,
String
>
dicObj
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
().
get
(
attr
.
dataType
());
Map
<
String
,
String
>
dicObj
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
()
.
get
(
CacheConstants
.
DICT_DETAILS
+
CommonConstants
.
COLON_STRING
+
attr
.
dataType
());
boolean
flag
=
true
;
for
(
Map
.
Entry
<
String
,
String
>
entry:
dicObj
.
entrySet
()){
if
(
Common
.
isNotNull
(
entry
.
getValue
())
&&
entry
.
getValue
().
equals
(
c
.
trim
())){
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/RedisUtil.java
View file @
6a13dee2
...
...
@@ -96,7 +96,6 @@ public class RedisUtil {
}
return
result
;
}
/**
* 写入缓存
* @param key
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
View file @
6a13dee2
...
...
@@ -112,7 +112,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
private
void
extractedRedis
(
SysDictItem
item
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
updateDictItem
(
item
.
getType
(),
resultMap
);
updateDictItem
(
CacheConstants
.
DICT_DETAILS
+
CommonConstants
.
COLON_STRING
+
item
.
getType
(),
resultMap
);
redisUtil
.
set
(
item
.
getType
(),
resultMap
);
}
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/init/DictItemRedisInit.java
View file @
6a13dee2
...
...
@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.init;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysAreaService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
...
...
@@ -39,7 +40,9 @@ public class DictItemRedisInit {
Map
<
String
,
Object
>
dictItem
=
dictItemService
.
getAllDictItemSub
();
if
(
Common
.
isNotNull
(
dictItem
)){
for
(
Map
.
Entry
<
String
,
Object
>
entry:
dictItem
.
entrySet
()){
redisUtil
.
set
(
entry
.
getKey
(),
entry
.
getValue
());
redisUtil
.
set
(
CacheConstants
.
DICT_DETAILS
+
CommonConstants
.
COLON_STRING
+
entry
.
getKey
(),
entry
.
getValue
());
}
}
log
.
info
(
"字典数据加入缓存初始化结束..."
);
...
...
@@ -49,18 +52,21 @@ public class DictItemRedisInit {
if
(
Common
.
isNotNull
(
allAreas
)){
Map
<
String
,
SysArea
>
areaMap
=
new
HashMap
<>();
for
(
SysArea
area:
allAreas
){
redisUtil
.
set
(
"area_"
+
area
.
getId
(),
area
.
getAreaName
());
redisUtil
.
set
(
CacheConstants
.
AREA_LABEL
+
area
.
getId
(),
area
.
getAreaName
());
areaMap
.
put
(
area
.
getId
().
toString
(),
area
);
}
SysArea
temp
;
for
(
SysArea
area:
allAreas
){
if
(
Common
.
isNotNull
(
area
.
getParentId
())
&&
area
.
getParentId
().
intValue
()
>
0
){
temp
=
areaMap
.
get
(
area
.
getParentId
().
toString
());
redisUtil
.
set
(
"area_"
+
area
.
getAreaName
()
redisUtil
.
set
(
CacheConstants
.
AREA_VALUE
+
area
.
getAreaName
()
+
CommonConstants
.
DOWN_LINE_STRING
+(
Common
.
isNotNull
(
temp
)?
temp
.
getAreaName
():
""
),
area
.
getId
());
}
else
{
redisUtil
.
set
(
"area_"
+
area
.
getAreaName
(),
area
.
getId
());
redisUtil
.
set
(
CacheConstants
.
AREA_VALUE
+
area
.
getAreaName
(),
area
.
getId
());
}
}
}
...
...
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