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
569ed22e
Commit
569ed22e
authored
Jun 28, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
0b9efb53
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
5 deletions
+60
-5
EmpCertificateExcelVO.java
...cloud/plus/v1/yifu/archives/vo/EmpCertificateExcelVO.java
+1
-1
TEmpProfessionalQualificationServiceImpl.java
...ervice/impl/TEmpProfessionalQualificationServiceImpl.java
+6
-0
ErrorCodes.java
....cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
+4
-0
DateUtil.java
...om/yifu.cloud.plus.v1/yifu/common/core/util/DateUtil.java
+9
-0
messages_zh_CN.properties
...on-core/src/main/resources/i18n/messages_zh_CN.properties
+2
-1
DictController.java
...u.cloud.plus.v1/yifu/admin/controller/DictController.java
+1
-2
SysDictItemService.java
....cloud.plus.v1/yifu/admin/service/SysDictItemService.java
+2
-0
SysDictItemServiceImpl.java
...us.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
+35
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpCertificateExcelVO.java
View file @
569ed22e
...
...
@@ -74,7 +74,7 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable {
/**
* 申报年度
*/
@ExcelAttribute
(
name
=
"申报年度"
)
@ExcelAttribute
(
name
=
"申报年度"
,
isInteger
=
true
)
@ExcelProperty
(
value
=
"申报年度"
)
private
String
declareYear
;
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpProfessionalQualificationServiceImpl.java
View file @
569ed22e
...
...
@@ -46,6 +46,7 @@ import org.springframework.stereotype.Service;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -100,6 +101,11 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
// 已有验证报错直接下一个
EmpCertificateExcelVO
excel
=
excelVOList
.
get
(
i
);
if
(
Common
.
isNotNull
(
excel
.
getDeclareYear
())
&&
Integer
.
parseInt
(
excel
.
getDeclareYear
())
>
DateUtil
.
getYearOfInt
(
new
Date
())){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_CERTIFICATE_DECLARE_YEAR_ERROR
)));
continue
;
}
emp
=
employeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
View file @
569ed22e
...
...
@@ -275,4 +275,8 @@ public interface ErrorCodes {
* 导入的文件格式不正确
*/
String
IMPORT_FILE_TYPE_ERROR
=
"import.file.type.error"
;
/**
* 申请年份不可为未来年份
*/
String
ARCHIVES_EMP_CERTIFICATE_DECLARE_YEAR_ERROR
=
"archives.emp.certificate.declare.year.error"
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/DateUtil.java
View file @
569ed22e
...
...
@@ -515,6 +515,15 @@ public class DateUtil {
return
formater
.
format
(
date
);
}
/**
* @param date
* @return string
*/
public
static
int
getYearOfInt
(
Date
date
)
{
SimpleDateFormat
formater
=
new
SimpleDateFormat
(
"yyyy"
);
return
Integer
.
parseInt
(
formater
.
format
(
date
));
}
/**
* @param date
* @return string
...
...
yifu-common/yifu-common-core/src/main/resources/i18n/messages_zh_CN.properties
View file @
569ed22e
...
...
@@ -61,7 +61,8 @@ checks.reduce.project.error=\u5B58\u5728\u5DF2\u51CF\u9879\u7684\u9879\u76EE\uFF
checks.emp.exit.error
=
\u
4EBA
\u5458\u
4E0D
\u5728\u
8BE5
\u9879\u
76EE
\u
FF0C
\u
65E0
\u
6CD5
\u
66F4
\u
65B0
checks.project.delete.error
=
\u9879\u
76EE
\u6863\u6848\u
72B6
\u6001\u
4E3A
\u
5DF2
\u
5BA1
\u6838\u
FF0C
\u7981\u
6B62
\u5220\u9664
archives.emp.certificate.name.existing
=
\u
5DF2
\u
5B58
\u5728\u
5BF9
\u
5E94
\u
8EAB
\u
4EFD
\u
8BC1
\u7684\u
8BC1
\u
4E66
\u
4FE1
\u
606F
archives.emp.certificate.name.existing
=
\u
8BE5
\u5458\u
5DE5
\u
5DF2
\u
5B58
\u5728\u
5BF9
\u
5E94
\u
8EAB
\u
4EFD
\u
8BC1
\u7684\u
8BC1
\u
4E66
\u
4FE1
\u
606F
archives.emp.certificate.declare.year.error
=
\u7533\u
8BF7
\u
5E74
\u
4EFD
\u
4E0D
\u
53EF
\u
4E3A
\u
672A
\u6765\u
5E74
\u
4EFD
checks.change.emp.project
=
\u
5F85
\u5212\u
8F6C
\u5458\u
5DE5
\u
5DF2
\u5728\u
76EE
\u6807\u9879\u
76EE
\u
4E0B
\u
4E0D
\u
53EF
\u5212\u
8F6C
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/DictController.java
View file @
569ed22e
...
...
@@ -238,7 +238,6 @@ public class DictController {
*/
@SysLog
(
"新增字典项"
)
@PostMapping
(
"/item"
)
@CacheEvict
(
value
=
CacheConstants
.
DICT_DETAILS
,
allEntries
=
true
)
public
R
<
Boolean
>
save
(
@RequestBody
SysDictItem
sysDictItem
)
{
SysDictItem
item
=
sysDictItemService
.
getOne
(
Wrappers
.<
SysDictItem
>
query
().
lambda
()
.
eq
(
SysDictItem:
:
getType
,
sysDictItem
.
getType
())
...
...
@@ -248,7 +247,7 @@ public class DictController {
if
(
Common
.
isNotNull
(
item
)){
return
R
.
failed
(
MsgUtils
.
getMessage
(
ErrorCodes
.
SYS_DICT_ITEM_ADD_VALUE_EXIST
));
}
return
R
.
ok
(
sysDictItemService
.
save
(
sysDictItem
)
);
return
sysDictItemService
.
saveDiy
(
sysDictItem
);
}
/**
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysDictItemService.java
View file @
569ed22e
...
...
@@ -82,4 +82,6 @@ public interface SysDictItemService extends IService<SysDictItem> {
Map
<
String
,
Object
>
getAllDictItemSub
();
void
clearDictItemCache
();
R
<
Boolean
>
saveDiy
(
SysDictItem
sysDictItem
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
View file @
569ed22e
...
...
@@ -37,7 +37,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.Assert
;
...
...
@@ -61,6 +63,9 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
private
final
SysDictService
dictService
;
@Autowired
private
RedisUtil
redisUtil
;
/**
* 删除字典项
* @param id 字典项ID
...
...
@@ -94,9 +99,38 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
// 系统内置
Assert
.
state
(!
DictTypeEnum
.
SYSTEM
.
getType
().
equals
(
dict
.
getSystemFlag
()),
MsgUtils
.
getMessage
(
ErrorCodes
.
SYS_DICT_UPDATE_SYSTEM
));
// 更新字典
extractedRedis
(
item
);
return
this
.
updateById
(
item
);
}
private
void
extractedRedis
(
SysDictItem
item
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
updateDictItem
(
item
.
getType
(),
resultMap
);
redisUtil
.
set
(
item
.
getType
(),
resultMap
);
}
@CacheEvict
(
value
=
CacheConstants
.
DICT_DETAILS
,
allEntries
=
true
)
@Override
public
R
<
Boolean
>
saveDiy
(
SysDictItem
sysDictItem
)
{
// 更新字典
extractedRedis
(
sysDictItem
);
int
res
=
baseMapper
.
insert
(
sysDictItem
);
if
(
res
<
0
){
return
R
.
failed
();
}
return
R
.
ok
();
}
private
void
updateDictItem
(
String
type
,
Map
<
String
,
Object
>
resultMap
){
List
<
SysDictItem
>
allList
=
baseMapper
.
selectList
(
Wrappers
.<
SysDictItem
>
query
().
lambda
()
.
in
(
SysDictItem:
:
getType
,
type
)
.
eq
(
SysDictItem:
:
getDelFlag
,
CommonConstants
.
ZERO_STRING
));
extracted
(
allList
,
resultMap
);
}
/**
* 构建树查询 1. 不是懒加载情况,查询全部 2. 是懒加载,根据parentId 查询 2.1 父节点为空,则查询ID -1
* @param lazy 是否是懒加载
...
...
@@ -170,6 +204,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
public
R
<
Map
<
String
,
Object
>>
getAllDictItem
()
{
return
R
.
ok
(
getAllDictItemSub
());
}
@Override
public
Map
<
String
,
Object
>
getAllDictItemSub
(){
List
<
SysDictItem
>
allList
=
baseMapper
.
selectList
(
Wrappers
.<
SysDictItem
>
query
().
lambda
()
...
...
@@ -188,7 +223,6 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
public
void
clearDictItemCache
()
{
}
private
void
extracted
(
List
<
SysDictItem
>
allList
,
Map
<
String
,
Object
>
resultMap
)
{
if
(
Common
.
isNotNull
(
allList
)){
for
(
SysDictItem
item
:
allList
)
{
...
...
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