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
7536152e
Commit
7536152e
authored
Jul 12, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单个编辑,手机号校验
parent
29000779
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
113 additions
and
10 deletions
+113
-10
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+0
-6
SysBaseSetInfoController.java
...s/v1/yifu/social/controller/SysBaseSetInfoController.java
+4
-4
SysBaseSetInfoService.java
...ud/plus/v1/yifu/social/service/SysBaseSetInfoService.java
+20
-0
TSocialLogService.java
.../cloud/plus/v1/yifu/social/service/TSocialLogService.java
+14
-0
SysBaseSetInfoServiceImpl.java
...1/yifu/social/service/impl/SysBaseSetInfoServiceImpl.java
+29
-0
TSocialLogServiceImpl.java
...us/v1/yifu/social/service/impl/TSocialLogServiceImpl.java
+46
-0
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
7536152e
...
@@ -1231,9 +1231,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
...
@@ -1231,9 +1231,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isNotNull
(
excel
.
getIsCollege
()))
{
if
(
Common
.
isNotNull
(
excel
.
getIsCollege
()))
{
if
(
CommonConstants
.
IS_TRUE
.
equals
(
excel
.
getIsCollege
()))
{
if
(
CommonConstants
.
IS_TRUE
.
equals
(
excel
.
getIsCollege
()))
{
saveEmp
.
setIsCollege
(
CommonConstants
.
ONE_INT
);
saveEmp
.
setIsCollege
(
CommonConstants
.
ONE_INT
);
if
(
Common
.
isEmpty
(
excel
.
getHignEducation
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR
,
excel
.
getEmpIdcard
()));
}
}
else
if
(
CommonConstants
.
IS_FALSE
.
equals
(
excel
.
getIsCollege
()))
{
}
else
if
(
CommonConstants
.
IS_FALSE
.
equals
(
excel
.
getIsCollege
()))
{
saveEmp
.
setIsCollege
(
CommonConstants
.
ZERO_INT
);
saveEmp
.
setIsCollege
(
CommonConstants
.
ZERO_INT
);
}
else
{
}
else
{
...
@@ -1745,9 +1742,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
...
@@ -1745,9 +1742,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isNotNull
(
excel
.
getIsCollege
()))
{
if
(
Common
.
isNotNull
(
excel
.
getIsCollege
()))
{
if
(
CommonConstants
.
IS_TRUE
.
equals
(
excel
.
getIsCollege
()))
{
if
(
CommonConstants
.
IS_TRUE
.
equals
(
excel
.
getIsCollege
()))
{
saveEmp
.
setIsCollege
(
CommonConstants
.
ONE_INT
);
saveEmp
.
setIsCollege
(
CommonConstants
.
ONE_INT
);
if
(
Common
.
isEmpty
(
excel
.
getHignEducation
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR
,
excel
.
getEmpIdcard
()));
}
}
else
if
(
CommonConstants
.
IS_FALSE
.
equals
(
excel
.
getIsCollege
()))
{
}
else
if
(
CommonConstants
.
IS_FALSE
.
equals
(
excel
.
getIsCollege
()))
{
saveEmp
.
setIsCollege
(
CommonConstants
.
ZERO_INT
);
saveEmp
.
setIsCollege
(
CommonConstants
.
ZERO_INT
);
}
else
{
}
else
{
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/SysBaseSetInfoController.java
View file @
7536152e
...
@@ -101,8 +101,8 @@ public class SysBaseSetInfoController {
...
@@ -101,8 +101,8 @@ public class SysBaseSetInfoController {
@SysLog
(
"新增基数设置表"
)
@SysLog
(
"新增基数设置表"
)
@PostMapping
@PostMapping
@PreAuthorize
(
"@pms.hasPermission('social_sysbasesetinfo_add')"
)
@PreAuthorize
(
"@pms.hasPermission('social_sysbasesetinfo_add')"
)
public
R
<
Boolean
>
save
(
@RequestBody
SysBaseSetInfo
sysBaseSetInfo
)
{
public
R
<
String
>
save
(
@RequestBody
SysBaseSetInfo
sysBaseSetInfo
)
{
return
R
.
ok
(
sysBaseSetInfoService
.
save
(
sysBaseSetInfo
)
);
return
sysBaseSetInfoService
.
saveSysBase
(
sysBaseSetInfo
);
}
}
/**
/**
...
@@ -115,8 +115,8 @@ public class SysBaseSetInfoController {
...
@@ -115,8 +115,8 @@ public class SysBaseSetInfoController {
@SysLog
(
"修改基数设置表"
)
@SysLog
(
"修改基数设置表"
)
@PutMapping
@PutMapping
@PreAuthorize
(
"@pms.hasPermission('social_sysbasesetinfo_edit')"
)
@PreAuthorize
(
"@pms.hasPermission('social_sysbasesetinfo_edit')"
)
public
R
<
Boolean
>
updateById
(
@RequestBody
SysBaseSetInfo
sysBaseSetInfo
)
{
public
R
<
String
>
updateById
(
@RequestBody
SysBaseSetInfo
sysBaseSetInfo
)
{
return
R
.
ok
(
sysBaseSetInfoService
.
updateById
(
sysBaseSetInfo
)
);
return
sysBaseSetInfoService
.
updateSysBase
(
sysBaseSetInfo
);
}
}
/**
/**
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/SysBaseSetInfoService.java
View file @
7536152e
...
@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
...
@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo
;
/**
/**
...
@@ -36,4 +37,23 @@ public interface SysBaseSetInfoService extends IService<SysBaseSetInfo> {
...
@@ -36,4 +37,23 @@ public interface SysBaseSetInfoService extends IService<SysBaseSetInfo> {
* @return
* @return
*/
*/
IPage
<
SysBaseSetInfo
>
getSysBaseSetInfoPage
(
Page
<
SysBaseSetInfo
>
page
,
SysBaseSetInfo
sysBaseSetInfo
);
IPage
<
SysBaseSetInfo
>
getSysBaseSetInfoPage
(
Page
<
SysBaseSetInfo
>
page
,
SysBaseSetInfo
sysBaseSetInfo
);
/**
* @param sysBaseSetInfo
* @Description: 新增
* @Author: hgw
* @Date: 2022/7/12 10:00
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R
<
String
>
saveSysBase
(
SysBaseSetInfo
sysBaseSetInfo
);
/**
* @param sysBaseSetInfo
* @Description: 修改
* @Author: hgw
* @Date: 2022/7/12 10:00
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R
<
String
>
updateSysBase
(
SysBaseSetInfo
sysBaseSetInfo
);
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TSocialLogService.java
View file @
7536152e
...
@@ -36,4 +36,18 @@ public interface TSocialLogService extends IService<TSocialLog> {
...
@@ -36,4 +36,18 @@ public interface TSocialLogService extends IService<TSocialLog> {
* @return
* @return
*/
*/
IPage
<
TSocialLog
>
getTSocialLogPage
(
Page
<
TSocialLog
>
page
,
TSocialLog
tSocialLog
);
IPage
<
TSocialLog
>
getTSocialLogPage
(
Page
<
TSocialLog
>
page
,
TSocialLog
tSocialLog
);
/**
* 生成修改记录
*
* @param type 类型:1社保基数配置;2公积金基数配置
* @param mainId 关联表id
* @param oldInfo
* @param newInfo
* @return
* @Author pwang
* @Date 2022-06-22 11:32
**/
<
T
>
TSocialLog
saveModificationRecord
(
Integer
type
,
String
mainId
,
T
oldInfo
,
T
newInfo
);
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/SysBaseSetInfoServiceImpl.java
View file @
7536152e
...
@@ -19,9 +19,15 @@ package com.yifu.cloud.plus.v1.yifu.social.service.impl;
...
@@ -19,9 +19,15 @@ package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
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.R
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -30,8 +36,11 @@ import org.springframework.stereotype.Service;
...
@@ -30,8 +36,11 @@ import org.springframework.stereotype.Service;
* @author hgw
* @author hgw
* @date 2022-07-11 18:21:23
* @date 2022-07-11 18:21:23
*/
*/
@RequiredArgsConstructor
@Service
@Service
public
class
SysBaseSetInfoServiceImpl
extends
ServiceImpl
<
SysBaseSetInfoMapper
,
SysBaseSetInfo
>
implements
SysBaseSetInfoService
{
public
class
SysBaseSetInfoServiceImpl
extends
ServiceImpl
<
SysBaseSetInfoMapper
,
SysBaseSetInfo
>
implements
SysBaseSetInfoService
{
private
final
TSocialLogService
tSocialLogService
;
/**
/**
* 基数设置表简单分页查询
* 基数设置表简单分页查询
*
*
...
@@ -42,4 +51,24 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
...
@@ -42,4 +51,24 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
public
IPage
<
SysBaseSetInfo
>
getSysBaseSetInfoPage
(
Page
<
SysBaseSetInfo
>
page
,
SysBaseSetInfo
sysBaseSetInfo
)
{
public
IPage
<
SysBaseSetInfo
>
getSysBaseSetInfoPage
(
Page
<
SysBaseSetInfo
>
page
,
SysBaseSetInfo
sysBaseSetInfo
)
{
return
baseMapper
.
getSysBaseSetInfoPage
(
page
,
sysBaseSetInfo
);
return
baseMapper
.
getSysBaseSetInfoPage
(
page
,
sysBaseSetInfo
);
}
}
@Override
public
R
<
String
>
saveSysBase
(
SysBaseSetInfo
sysBaseSetInfo
)
{
this
.
save
(
sysBaseSetInfo
);
return
R
.
ok
();
}
@Override
public
R
<
String
>
updateSysBase
(
SysBaseSetInfo
sysBaseSetInfo
)
{
SysBaseSetInfo
old
=
this
.
getById
(
sysBaseSetInfo
.
getId
());
if
(
old
==
null
||
Common
.
isEmpty
(
old
.
getId
()))
{
return
R
.
failed
(
"根据id未找到基数配置!"
+
sysBaseSetInfo
.
getId
());
}
this
.
updateById
(
sysBaseSetInfo
);
// 记录变更日志
tSocialLogService
.
saveModificationRecord
(
CommonConstants
.
ONE_INT
,
old
.
getId
(),
old
,
sysBaseSetInfo
);
return
R
.
ok
();
}
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialLogServiceImpl.java
View file @
7536152e
...
@@ -16,14 +16,22 @@
...
@@ -16,14 +16,22 @@
*/
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
service
.
impl
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialLog
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialLog
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialLogMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialLogMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
static
com
.
alibaba
.
fastjson
.
serializer
.
SerializerFeature
.*;
/**
/**
* 社保变更记录表
* 社保变更记录表
*
*
...
@@ -42,4 +50,42 @@ public class TSocialLogServiceImpl extends ServiceImpl<TSocialLogMapper, TSocial
...
@@ -42,4 +50,42 @@ public class TSocialLogServiceImpl extends ServiceImpl<TSocialLogMapper, TSocial
public
IPage
<
TSocialLog
>
getTSocialLogPage
(
Page
<
TSocialLog
>
page
,
TSocialLog
tSocialLog
)
{
public
IPage
<
TSocialLog
>
getTSocialLogPage
(
Page
<
TSocialLog
>
page
,
TSocialLog
tSocialLog
)
{
return
baseMapper
.
getTSocialLogPage
(
page
,
tSocialLog
);
return
baseMapper
.
getTSocialLogPage
(
page
,
tSocialLog
);
}
}
/**
* @param type 类型:1社保基数配置;2公积金基数配置
* @param mainId
* @Description:
* @Author: hgw
* @Date: 2022/7/12 9:52
* @return: com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog
**/
@Override
public
<
T
>
TSocialLog
saveModificationRecord
(
Integer
type
,
String
mainId
,
T
oldInfo
,
T
newInfo
)
{
try
{
//比较记录不影响业务逻辑,用try套住
//比较差异
String
differenceKey
=
HrEquator
.
comparisonValue
(
oldInfo
,
newInfo
);
//如果有差异保存差异
if
(!
Common
.
isEmpty
(
differenceKey
))
{
TSocialLog
record
=
new
TSocialLog
();
record
.
setType
(
type
);
record
.
setMainId
(
mainId
);
record
.
setCreateTime
(
LocalDateTime
.
now
());
record
.
setOldInfo
(
JSON
.
toJSONString
(
oldInfo
,
features
));
record
.
setNewInfo
(
JSON
.
toJSONString
(
newInfo
,
features
));
record
.
setDifferenceInfo
(
differenceKey
);
baseMapper
.
insert
(
record
);
return
record
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
JSON
.
toJSON
(
oldInfo
)
+
"【新增社保变更记录】报错>>>"
,
e
);
}
return
null
;
}
private
SerializerFeature
[]
features
=
new
SerializerFeature
[]{
WriteMapNullValue
,
WriteNullNumberAsZero
,
WriteNullListAsEmpty
,
WriteNullStringAsEmpty
,
WriteDateUseDateFormat
};
}
}
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