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
5b31cd4c
Commit
5b31cd4c
authored
Jul 01, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同优化
parent
db5c4786
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
159 additions
and
30 deletions
+159
-30
TEmployeeContractInfo.java
...d/plus/v1/yifu/archives/entity/TEmployeeContractInfo.java
+5
-5
TEmployeeContractInfoController.java
.../archives/controller/TEmployeeContractInfoController.java
+71
-5
TEmployeeContractInfoMapper.java
.../v1/yifu/archives/mapper/TEmployeeContractInfoMapper.java
+6
-3
TEmployeeContractInfoService.java
...1/yifu/archives/service/TEmployeeContractInfoService.java
+14
-5
TEmployeeContractInfoServiceImpl.java
...chives/service/impl/TEmployeeContractInfoServiceImpl.java
+60
-11
TEmployeeContractInfoMapper.xml
...src/main/resources/mapper/TEmployeeContractInfoMapper.xml
+3
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmployeeContractInfo.java
View file @
5b31cd4c
...
...
@@ -141,12 +141,12 @@ public class TEmployeeContractInfo extends BaseEntity {
@Schema
(
description
=
"合同年限"
,
name
=
"contractTerm"
)
private
Double
contractTerm
;
/**
* 合同编
码
* 合同编
号
*/
@NotBlank
(
message
=
"合同编
码
不能为空"
)
@Length
(
max
=
128
,
message
=
"合同编
码
不能超过128个字符"
)
@ExcelAttribute
(
name
=
"合同编
码
"
,
maxLength
=
128
)
@Schema
(
description
=
"合同编
码
"
,
name
=
"contractNo"
)
@NotBlank
(
message
=
"合同编
号
不能为空"
)
@Length
(
max
=
128
,
message
=
"合同编
号
不能超过128个字符"
)
@ExcelAttribute
(
name
=
"合同编
号
"
,
maxLength
=
128
)
@Schema
(
description
=
"合同编
号
"
,
name
=
"contractNo"
)
private
String
contractNo
;
/**
* 备注
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeContractInfoController.java
View file @
5b31cd4c
...
...
@@ -17,6 +17,7 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService
;
...
...
@@ -53,6 +54,39 @@ public class TEmployeeContractInfoController {
private
final
TEmployeeContractInfoService
tEmployeeContractInfoService
;
/**
* 申请、归档分页查询
* @param page 分页对象
* @param tEmployeeContractInfo 员工合同
* @return
*/
@Operation
(
summary
=
"申请分页查询(全部的数据(后面加上权限:自己创建的))"
,
description
=
"申请分页查询"
)
@GetMapping
(
"/applyPage"
)
public
R
<
IPage
<
TEmployeeContractInfo
>>
getApplyPage
(
Page
<
TEmployeeContractInfo
>
page
,
TEmployeeContractInfo
tEmployeeContractInfo
)
{
return
new
R
<>(
tEmployeeContractInfoService
.
getTEmployeeContractInfoPage
(
page
,
tEmployeeContractInfo
));
}
@Operation
(
summary
=
"归档分页查询(审核通过的数据(后面加上权限:自己创建的))"
,
description
=
"归档分页查询"
)
@GetMapping
(
"/filingPage"
)
public
R
<
IPage
<
TEmployeeContractInfo
>>
getFilingPage
(
Page
<
TEmployeeContractInfo
>
page
,
TEmployeeContractInfo
tEmployeeContractInfo
)
{
tEmployeeContractInfo
.
setAuditStatus
(
CommonConstants
.
dingleDigitIntArray
[
2
]);
return
new
R
<>(
tEmployeeContractInfoService
.
getTEmployeeContractInfoPage
(
page
,
tEmployeeContractInfo
));
}
/**
* 合同审核分页查询
*
* @param page 分页对象
* @param tEmployeeContractInfo 员工合同
* @return
*/
@Operation
(
summary
=
"合同审核分页查询(待审核的数据)"
,
description
=
"合同审核分页查询"
)
@GetMapping
(
"/auditPage"
)
public
R
<
IPage
<
TEmployeeContractInfo
>>
getAuditPage
(
Page
<
TEmployeeContractInfo
>
page
,
TEmployeeContractInfo
tEmployeeContractInfo
)
{
tEmployeeContractInfo
.
setAuditStatus
(
CommonConstants
.
ONE_INT
);
return
new
R
<>(
tEmployeeContractInfoService
.
getTEmployeeContractInfoPage
(
page
,
tEmployeeContractInfo
));
}
/**
* 分页查询
*
...
...
@@ -60,9 +94,9 @@ public class TEmployeeContractInfoController {
* @param tEmployeeContractInfo 员工合同
* @return
*/
@Operation
(
summary
=
"
分页查询"
,
description
=
"分页
查询"
)
@Operation
(
summary
=
"
合同查询(全部的数据)"
,
description
=
"合同
查询"
)
@GetMapping
(
"/page"
)
public
R
gettemployeecontractinfoPage
(
Page
<
TEmployeeContractInfo
>
page
,
TEmployeeContractInfo
tEmployeeContractInfo
)
{
public
R
<
IPage
<
TEmployeeContractInfo
>>
gettemployeecontractinfoPage
(
Page
<
TEmployeeContractInfo
>
page
,
TEmployeeContractInfo
tEmployeeContractInfo
)
{
return
new
R
<>(
tEmployeeContractInfoService
.
getTEmployeeContractInfoPage
(
page
,
tEmployeeContractInfo
));
}
...
...
@@ -75,7 +109,7 @@ public class TEmployeeContractInfoController {
*/
@Operation
(
summary
=
"通过id查询"
,
description
=
"通过id查询"
)
@GetMapping
(
"/{id}"
)
public
R
getById
(
@PathVariable
(
"id"
)
String
id
)
{
public
R
<
TEmployeeContractInfo
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
return
R
.
ok
(
tEmployeeContractInfoService
.
getById
(
id
));
}
...
...
@@ -85,7 +119,7 @@ public class TEmployeeContractInfoController {
* @param tEmployeeContractInfo 员工合同
* @return R
*/
@Operation
(
summary
=
"新增员工合同auditStatus审核状态,前端传参(0:保存为待提交;1:提交为待审核)temployeecontractinfo_add附件传参attaList"
,
description
=
"新增员工合同:hasPermission('temployeecontractinfo_add')"
)
@Operation
(
summary
=
"新增
-
员工合同auditStatus审核状态,前端传参(0:保存为待提交;1:提交为待审核)temployeecontractinfo_add附件传参attaList"
,
description
=
"新增员工合同:hasPermission('temployeecontractinfo_add')"
)
@SysLog
(
"新增员工合同"
)
@PostMapping
(
"/saveNewContract"
)
@PreAuthorize
(
"@pms.hasPermission('temployeecontractinfo_add')"
)
...
...
@@ -99,7 +133,7 @@ public class TEmployeeContractInfoController {
* @param tEmployeeContractInfo 员工合同
* @return R
*/
@Operation
(
summary
=
"编辑
员工合同auditStatus审核状态,前端传参(0:保存为待提交;1:提交为待审核)temployeecontractinfo_edit编辑的附件,前端操作,可以不
传参attaList"
,
description
=
"修改员工合同:hasPermission('temployeecontractinfo_edit')"
)
@Operation
(
summary
=
"编辑
-员工合同auditStatus审核状态,前端传参(0:保存为待提交;1:提交为待审核)temployeecontractinfo_edit编辑的附件,前端操作,要
传参attaList"
,
description
=
"修改员工合同:hasPermission('temployeecontractinfo_edit')"
)
@SysLog
(
"修改员工合同"
)
@PostMapping
(
"/updateContract"
)
@PreAuthorize
(
"@pms.hasPermission('temployeecontractinfo_edit')"
)
...
...
@@ -139,6 +173,38 @@ public class TEmployeeContractInfoController {
}
}
/**
* 审核员工合同
* 审核通过后,变为在用,项目内其他的合同不再用
* @param tEmployeeContractInfo 员工合同
* @return R
*/
@Operation
(
summary
=
"审核-员工合同(主键:ID;审核意见auditStatus(2审核通过;3审核不通过);审核说明auditRemark;)权限temployeecontractinfo_audit"
,
description
=
"审核-员工合同"
)
@SysLog
(
"审核员工合同"
)
@PostMapping
(
"/auditContract"
)
@PreAuthorize
(
"@pms.hasPermission('temployeecontractinfo_audit')"
)
public
R
<
String
>
auditContract
(
@RequestBody
TEmployeeContractInfo
tEmployeeContractInfo
)
{
if
(
Common
.
isEmpty
(
tEmployeeContractInfo
.
getAuditStatus
()))
{
return
R
.
failed
(
"审核意见必填!"
);
}
if
(
Common
.
isNotNull
(
tEmployeeContractInfo
.
getAuditRemark
())
&&
tEmployeeContractInfo
.
getAuditRemark
().
length
()
>
200
)
{
return
R
.
failed
(
"审核说明不可超过200字!"
);
}
return
tEmployeeContractInfoService
.
auditContract
(
tEmployeeContractInfo
);
}
/**
* 审核员工合同
* 审核通过后,变为在用,项目内其他的合同不再用
* @param tEmployeeContractInfo 员工合同
* @return R
*/
@Operation
(
summary
=
"归档-员工合同(主键:ID;合同编号contractNo;档案柜号fileCabinetNo;附件List<String> attaList)权限temployeecontractinfo_filing"
,
description
=
"归档-员工合同"
)
@SysLog
(
"审核员工合同"
)
@PostMapping
(
"/filingContract"
)
@PreAuthorize
(
"@pms.hasPermission('temployeecontractinfo_filing')"
)
public
R
<
String
>
filingContract
(
@RequestBody
TEmployeeContractInfo
tEmployeeContractInfo
)
{
return
tEmployeeContractInfoService
.
filingContract
(
tEmployeeContractInfo
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TEmployeeContractInfoMapper.java
View file @
5b31cd4c
...
...
@@ -39,17 +39,20 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
* @param tEmployeeContractInfo 员工合同信息表
* @return
*/
IPage
<
TEmployeeContractInfo
>
getTEmployeeContractInfoPage
(
Page
<
TEmployeeContractInfo
>
page
,
@Param
(
"tEmployeeContractInfo"
)
TEmployeeContractInfo
tEmployeeContractInfo
);
IPage
<
TEmployeeContractInfo
>
getTEmployeeContractInfoPage
(
Page
<
TEmployeeContractInfo
>
page
,
@Param
(
"tEmployeeContractInfo"
)
TEmployeeContractInfo
tEmployeeContractInfo
);
/**
* 更新合同在用状态
* 更新
项目内的其他的
合同在用状态
* @Author fxj
* @Date 2019-10-17
* @param empId
* @param deptId
* @param id
* @param status
* @return
**/
int
updateInUseStatusById
(
@Param
(
"empId"
)
String
empId
,
@Param
(
"id"
)
String
id
,
@Param
(
"status"
)
String
status
);
int
updateInUseStatusById
(
@Param
(
"empId"
)
String
empId
,
@Param
(
"deptId"
)
String
deptId
,
@Param
(
"id"
)
String
id
,
@Param
(
"status"
)
String
status
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeContractInfoService.java
View file @
5b31cd4c
...
...
@@ -62,12 +62,21 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
R
<
List
<
ErrorMessage
>>
updateContract
(
TEmployeeContractInfo
tEmployeeContractInfo
);
/**
* 保存员工合同表及附件关系表
* @Author fxj
* @Date 2019-09-09
* @param tEmployeeContractInfo
* @return
* @Description: 审核
* @Author: hgw
* @Date: 2022/7/1 10:23
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R
<
String
>
auditContract
(
TEmployeeContractInfo
tEmployeeContractInfo
);
/**
* @param tEmployeeContractInfo
* @Description: 归档
* @Author: hgw
* @Date: 2022/7/1 10:32
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
boolean
saveContractAndAtta
(
TEmployeeContractInfo
tEmployeeContractInfo
);
R
<
String
>
filingContract
(
TEmployeeContractInfo
tEmployeeContractInfo
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeContractInfoServiceImpl.java
View file @
5b31cd4c
...
...
@@ -234,9 +234,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
* @Author fxj
* @Date 2019-09-09
**/
@Transactional
@Override
public
boolean
saveContractAndAtta
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
private
boolean
saveContractAndAtta
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
//档案柜存在就自动归档
if
(
Common
.
isNotNull
(
tEmployeeContractInfo
.
getAttaList
()))
{
tEmployeeContractInfo
.
setIsFile
(
CommonConstants
.
ZERO_STRING
);
...
...
@@ -267,7 +265,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TAttaInfo
contractAtta
;
for
(
String
attaId
:
attaList
)
{
contractAtta
=
tAttaInfoService
.
getById
(
attaId
);
if
(
contractAtta
!=
null
)
{
if
(
contractAtta
!=
null
&&
Common
.
isEmpty
(
contractAtta
.
getDomainId
())
)
{
contractAtta
.
setDomainId
(
tEmployeeContractInfo
.
getId
());
tAttaInfoService
.
updateById
(
contractAtta
);
}
...
...
@@ -278,8 +276,23 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
baseMapper
.
updateById
(
tEmployeeContractInfo
);
}
// 不是待提交,记录审核记录
this
.
setAuditInfo
(
tEmployeeContractInfo
);
// 更新档案合同状态
this
.
updateEmployeeContractStatus
(
tEmployeeContractInfo
.
getEmpId
());
return
true
;
}
/**
* @param tEmployeeContractInfo
* @Description: 保存审核操作记录
* @Author: hgw
* @Date: 2022/7/1 10:16
* @return: void
**/
private
void
setAuditInfo
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
if
(
Common
.
isNotNull
(
tEmployeeContractInfo
.
getAuditStatus
())
&&
CommonConstants
.
ZERO_INT
!=
tEmployeeContractInfo
.
getAuditStatus
())
{
&&
CommonConstants
.
ZERO_INT
!=
tEmployeeContractInfo
.
getAuditStatus
())
{
TEmployeeContractAudit
audit
=
new
TEmployeeContractAudit
();
audit
.
setAuditStatus
(
tEmployeeContractInfo
.
getAuditStatus
());
audit
.
setLinkId
(
tEmployeeContractInfo
.
getId
());
...
...
@@ -287,12 +300,6 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
audit
.
setRemark
(
tEmployeeContractInfo
.
getAuditRemark
());
tEmployeeContractAuditService
.
save
(
audit
);
}
//先停用所有在用的员工合同
baseMapper
.
updateInUseStatusById
(
tEmployeeContractInfo
.
getEmpId
(),
tEmployeeContractInfo
.
getId
(),
CommonConstants
.
ONE_STRING
);
// 更新档案合同状态
this
.
updateEmployeeContractStatus
(
tEmployeeContractInfo
.
getEmpId
());
return
true
;
}
private
void
updateEmployeeContractStatus
(
String
empId
)
{
...
...
@@ -303,5 +310,47 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
@Override
public
R
<
String
>
auditContract
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
if
(
tEmployeeContractInfo
!=
null
)
{
if
(
Common
.
isEmpty
(
tEmployeeContractInfo
.
getId
())
||
Common
.
isEmpty
(
tEmployeeContractInfo
.
getAuditStatus
()))
{
return
R
.
failed
(
"id、意见必填"
);
}
if
(
tEmployeeContractInfo
.
getAuditStatus
()
==
CommonConstants
.
dingleDigitIntArray
[
2
])
{
TEmployeeContractInfo
contractInfo
=
this
.
getById
(
tEmployeeContractInfo
.
getId
());
tEmployeeContractInfo
.
setInUse
(
CommonConstants
.
ZERO_STRING
);
//先停用项目内的其他的员工合同
baseMapper
.
updateInUseStatusById
(
contractInfo
.
getEmpId
(),
contractInfo
.
getSettleDomain
()
,
contractInfo
.
getId
(),
CommonConstants
.
ONE_STRING
);
}
// 不是待提交,记录审核记录
this
.
setAuditInfo
(
tEmployeeContractInfo
);
this
.
updateById
(
tEmployeeContractInfo
);
return
R
.
ok
();
}
return
R
.
failed
(
"参数不可为空"
);
}
@Override
public
R
<
String
>
filingContract
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
if
(
tEmployeeContractInfo
!=
null
)
{
if
(
Common
.
isEmpty
(
tEmployeeContractInfo
.
getContractNo
())
||
Common
.
isEmpty
(
tEmployeeContractInfo
.
getFileCabinetNo
()))
{
return
R
.
failed
(
"合同编号、档案柜号必填!"
);
}
if
(
tEmployeeContractInfo
.
getContractNo
().
length
()
>
50
||
tEmployeeContractInfo
.
getContractNo
().
length
()
>
50
)
{
return
R
.
failed
(
"合同编号、档案柜号不可超过50字!"
);
}
//档案柜存在就自动归档
if
(
Common
.
isNotNull
(
tEmployeeContractInfo
.
getAttaList
()))
{
tEmployeeContractInfo
.
setIsFile
(
CommonConstants
.
ZERO_STRING
);
}
else
{
tEmployeeContractInfo
.
setIsFile
(
CommonConstants
.
ONE_STRING
);
}
this
.
updateById
(
tEmployeeContractInfo
);
return
R
.
ok
();
}
return
R
.
failed
(
"参数不可为空"
);
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeContractInfoMapper.xml
View file @
5b31cd4c
...
...
@@ -310,7 +310,9 @@
<!-- 根据员工ID更新合同在用状态 -->
<update
id=
"updateInUseStatusById"
>
update t_employee_contract_info set IN_USE = #{status} where EMP_ID = #{empId} and ID != #{id}
update t_employee_contract_info
set IN_USE = #{status}
where EMP_ID = #{empId} and SETTLE_DOMAIN = #{deptId} and ID != #{id}
</update>
</mapper>
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