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
95702c74
Commit
95702c74
authored
Jul 12, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基数配置提交2
parent
2d515686
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
153 additions
and
6 deletions
+153
-6
SysBaseSetInfo.java
...yifu/cloud/plus/v1/yifu/social/entity/SysBaseSetInfo.java
+6
-0
SysBaseSetInfoController.java
...s/v1/yifu/social/controller/SysBaseSetInfoController.java
+26
-2
SysBaseSetInfoServiceImpl.java
...1/yifu/social/service/impl/SysBaseSetInfoServiceImpl.java
+121
-4
No files found.
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/entity/SysBaseSetInfo.java
View file @
95702c74
...
...
@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.social.entity;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
...
...
@@ -28,6 +29,7 @@ import lombok.EqualsAndHashCode;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
/**
* 社保、公积金基数配置
...
...
@@ -450,4 +452,8 @@ public class SysBaseSetInfo extends BaseEntity {
@ExcelProperty
(
"社保户名称"
)
private
String
departName
;
@Schema
(
description
=
"公积金比例List(保存时前端传参用)"
)
@TableField
(
exist
=
false
)
private
List
<
SysPayProportion
>
fundProList
;
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/SysBaseSetInfoController.java
View file @
95702c74
...
...
@@ -25,7 +25,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysPayProportion
;
import
com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.SysPayProportionService
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.security.SecurityRequirement
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
...
@@ -50,6 +52,7 @@ import java.util.List;
public
class
SysBaseSetInfoController
{
private
final
SysBaseSetInfoService
sysBaseSetInfoService
;
private
final
SysPayProportionService
sysPayProportionService
;
/**
...
...
@@ -73,7 +76,6 @@ public class SysBaseSetInfoController {
*/
@Operation
(
summary
=
"不分页查询"
,
description
=
"不分页查询"
)
@PostMapping
(
"/noPage"
)
//@PreAuthorize("@pms.hasPermission('social_sysbasesetinfo_get')" )
public
R
<
List
<
SysBaseSetInfo
>>
getSysBaseSetInfoNoPage
(
@RequestBody
SysBaseSetInfo
sysBaseSetInfo
)
{
return
R
.
ok
(
sysBaseSetInfoService
.
list
(
Wrappers
.
query
(
sysBaseSetInfo
).
orderByDesc
(
CommonConstants
.
CREATE_TIME
)));
}
...
...
@@ -88,7 +90,11 @@ public class SysBaseSetInfoController {
@GetMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('social_sysbasesetinfo_get')"
)
public
R
<
SysBaseSetInfo
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
return
R
.
ok
(
sysBaseSetInfoService
.
getById
(
id
));
SysBaseSetInfo
baseSetInfo
=
sysBaseSetInfoService
.
getById
(
id
);
if
(
null
!=
baseSetInfo
&&
CommonConstants
.
ONE_STRING
.
equals
(
baseSetInfo
.
getBaseType
())){
baseSetInfo
.
setFundProList
(
sysPayProportionService
.
list
(
Wrappers
.<
SysPayProportion
>
query
().
lambda
().
eq
(
SysPayProportion:
:
getSysBaseSetId
,
id
)));
}
return
R
.
ok
(
baseSetInfo
);
}
/**
...
...
@@ -133,4 +139,22 @@ public class SysBaseSetInfoController {
return
R
.
ok
(
sysBaseSetInfoService
.
removeById
(
id
));
}
/**
* 通过id禁用启用一条记录
* @param id
* @return R
*/
@Operation
(
summary
=
"启用禁用"
,
description
=
"启用禁用:hasPermission('social_sysbasesetinfo_enable') 0.在用 1.终止 2.过期"
)
@SysLog
(
"禁用启用基数设置表"
)
@PostMapping
(
"/disableOrEnableById"
)
@PreAuthorize
(
"@pms.hasPermission('wxhr:social_sysbasesetinfo_enable')"
)
public
R
disableOrEnableById
(
@RequestParam
String
id
,
@RequestParam
Integer
status
)
{
SysBaseSetInfo
baseSetInfo
=
sysBaseSetInfoService
.
getById
(
id
);
if
(
null
==
baseSetInfo
){
return
R
.
failed
(
"无对应ID的数据!"
);
}
baseSetInfo
.
setStatus
(
status
);
return
new
R
<>(
sysBaseSetInfoService
.
updateById
(
baseSetInfo
));
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/SysBaseSetInfoServiceImpl.java
View file @
95702c74
...
...
@@ -17,19 +17,25 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysPayProportion
;
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.SysPayProportionService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 基数设置表
*
...
...
@@ -41,6 +47,9 @@ import org.springframework.stereotype.Service;
public
class
SysBaseSetInfoServiceImpl
extends
ServiceImpl
<
SysBaseSetInfoMapper
,
SysBaseSetInfo
>
implements
SysBaseSetInfoService
{
private
final
TSocialLogService
tSocialLogService
;
private
final
SysPayProportionService
sysPayProportionService
;
/**
* 基数设置表简单分页查询
*
...
...
@@ -54,21 +63,129 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
@Override
public
R
<
String
>
saveSysBase
(
SysBaseSetInfo
sysBaseSetInfo
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
null
==
user
)
{
return
R
.
failed
(
"获取用户登录信息失败!"
);
}
SysBaseSetInfo
baseSetInfo
=
null
;
if
(
null
!=
sysBaseSetInfo
.
getTown
())
{
baseSetInfo
=
this
.
getOne
(
Wrappers
.<
SysBaseSetInfo
>
query
().
lambda
()
.
eq
(
SysBaseSetInfo:
:
getBaseType
,
sysBaseSetInfo
.
getBaseType
())
.
eq
(
SysBaseSetInfo:
:
getDepartId
,
sysBaseSetInfo
.
getDepartId
())
.
eq
(
SysBaseSetInfo:
:
getTown
,
sysBaseSetInfo
.
getTown
())
.
le
(
SysBaseSetInfo:
:
getApplyStartDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
ge
(
SysBaseSetInfo:
:
getApplyEndDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
if
(
null
!=
sysBaseSetInfo
.
getCity
()
&&
null
==
sysBaseSetInfo
.
getTown
())
{
baseSetInfo
=
this
.
getOne
(
Wrappers
.<
SysBaseSetInfo
>
query
().
lambda
()
.
eq
(
SysBaseSetInfo:
:
getBaseType
,
sysBaseSetInfo
.
getBaseType
())
.
eq
(
SysBaseSetInfo:
:
getDepartId
,
sysBaseSetInfo
.
getDepartId
())
.
eq
(
SysBaseSetInfo:
:
getCity
,
sysBaseSetInfo
.
getCity
())
.
isNull
(
SysBaseSetInfo:
:
getTown
)
.
le
(
SysBaseSetInfo:
:
getApplyStartDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
ge
(
SysBaseSetInfo:
:
getApplyEndDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
if
(
null
!=
sysBaseSetInfo
.
getProvince
()
&&
null
==
sysBaseSetInfo
.
getCity
())
{
baseSetInfo
=
this
.
getOne
(
Wrappers
.<
SysBaseSetInfo
>
query
().
lambda
()
.
eq
(
SysBaseSetInfo:
:
getBaseType
,
sysBaseSetInfo
.
getBaseType
())
.
eq
(
SysBaseSetInfo:
:
getDepartId
,
sysBaseSetInfo
.
getDepartId
())
.
eq
(
SysBaseSetInfo:
:
getProvince
,
sysBaseSetInfo
.
getProvince
())
.
isNull
(
SysBaseSetInfo:
:
getCity
)
.
le
(
SysBaseSetInfo:
:
getApplyStartDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
ge
(
SysBaseSetInfo:
:
getApplyEndDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
if
(
null
!=
baseSetInfo
)
{
return
R
.
failed
(
"对应户、地市、有效期的基数配置已存在!"
);
}
this
.
save
(
sysBaseSetInfo
);
this
.
saveOrUpdateBaseAndFundPro
(
sysBaseSetInfo
);
return
R
.
ok
();
}
@Override
public
R
<
String
>
updateSysBase
(
SysBaseSetInfo
sysBaseSetInfo
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
null
==
user
)
{
return
R
.
failed
(
"获取用户登录信息失败!"
);
}
SysBaseSetInfo
old
=
this
.
getById
(
sysBaseSetInfo
.
getId
());
if
(
old
==
null
||
Common
.
isEmpty
(
old
.
getId
()))
{
return
R
.
failed
(
"根据id未找到基数配置!"
+
sysBaseSetInfo
.
getId
());
}
this
.
updateById
(
sysBaseSetInfo
);
SysBaseSetInfo
baseSetInfo
=
null
;
if
(
null
!=
sysBaseSetInfo
.
getTown
())
{
baseSetInfo
=
this
.
getOne
(
Wrappers
.<
SysBaseSetInfo
>
query
().
lambda
()
.
eq
(
SysBaseSetInfo:
:
getBaseType
,
sysBaseSetInfo
.
getBaseType
())
.
eq
(
SysBaseSetInfo:
:
getDepartId
,
sysBaseSetInfo
.
getDepartId
())
.
eq
(
SysBaseSetInfo:
:
getTown
,
sysBaseSetInfo
.
getTown
())
.
le
(
SysBaseSetInfo:
:
getApplyStartDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
ge
(
SysBaseSetInfo:
:
getApplyEndDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
ne
(
SysBaseSetInfo:
:
getId
,
sysBaseSetInfo
.
getId
())
.
eq
(
SysBaseSetInfo:
:
getStatus
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
if
(
null
!=
sysBaseSetInfo
.
getCity
()
&&
null
==
sysBaseSetInfo
.
getTown
())
{
baseSetInfo
=
this
.
getOne
(
Wrappers
.<
SysBaseSetInfo
>
query
().
lambda
()
.
eq
(
SysBaseSetInfo:
:
getBaseType
,
sysBaseSetInfo
.
getBaseType
())
.
eq
(
SysBaseSetInfo:
:
getDepartId
,
sysBaseSetInfo
.
getDepartId
())
.
eq
(
SysBaseSetInfo:
:
getCity
,
sysBaseSetInfo
.
getCity
())
.
isNull
(
SysBaseSetInfo:
:
getTown
)
.
le
(
SysBaseSetInfo:
:
getApplyStartDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
ge
(
SysBaseSetInfo:
:
getApplyEndDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
ne
(
SysBaseSetInfo:
:
getId
,
sysBaseSetInfo
.
getId
())
.
eq
(
SysBaseSetInfo:
:
getStatus
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
if
(
null
!=
sysBaseSetInfo
.
getProvince
()
&&
null
==
sysBaseSetInfo
.
getCity
())
{
baseSetInfo
=
this
.
getOne
(
Wrappers
.<
SysBaseSetInfo
>
query
().
lambda
()
.
eq
(
SysBaseSetInfo:
:
getBaseType
,
sysBaseSetInfo
.
getBaseType
())
.
eq
(
SysBaseSetInfo:
:
getDepartId
,
sysBaseSetInfo
.
getDepartId
())
.
eq
(
SysBaseSetInfo:
:
getProvince
,
sysBaseSetInfo
.
getProvince
())
.
isNull
(
SysBaseSetInfo:
:
getCity
)
.
le
(
SysBaseSetInfo:
:
getApplyStartDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
ge
(
SysBaseSetInfo:
:
getApplyEndDate
,
sysBaseSetInfo
.
getApplyStartDate
())
.
ne
(
SysBaseSetInfo:
:
getId
,
sysBaseSetInfo
.
getId
())
.
eq
(
SysBaseSetInfo:
:
getStatus
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
if
(
null
!=
baseSetInfo
)
{
return
R
.
failed
(
"对应户、地市、有效期的基数配置已存在!"
);
}
this
.
saveOrUpdateBaseAndFundPro
(
sysBaseSetInfo
);
// 记录变更日志
tSocialLogService
.
saveModificationRecord
(
CommonConstants
.
ONE_INT
,
old
.
getId
(),
old
,
sysBaseSetInfo
);
return
R
.
ok
();
}
/**
* @param sysBaseSetInfo
* @Description: 新增、编辑社保、公积金基数
* @Author: hgw
* @Date: 2022/7/12 14:33
* @return: void
**/
private
void
saveOrUpdateBaseAndFundPro
(
SysBaseSetInfo
sysBaseSetInfo
)
{
if
(
Common
.
isNotNull
(
sysBaseSetInfo
.
getId
()))
{
baseMapper
.
updateById
(
sysBaseSetInfo
);
}
else
{
sysBaseSetInfo
.
setStatus
(
CommonConstants
.
ZERO_INT
);
sysBaseSetInfo
.
setDeleteFlag
(
CommonConstants
.
ZERO_STRING
);
baseMapper
.
insert
(
sysBaseSetInfo
);
}
List
<
SysPayProportion
>
payProportionList
=
sysBaseSetInfo
.
getFundProList
();
if
(
Common
.
isNotNull
(
payProportionList
))
{
for
(
SysPayProportion
payProportion
:
payProportionList
)
{
if
(
Common
.
isNotNull
(
payProportion
.
getId
()))
{
sysPayProportionService
.
updateById
(
payProportion
);
}
else
{
payProportion
.
setSysBaseSetId
(
sysBaseSetInfo
.
getId
());
sysPayProportionService
.
save
(
payProportion
);
}
}
}
}
}
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