Commit 18b7146e authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 37a1bc04 9505633b
......@@ -50,10 +50,10 @@ public class TEmployeeContractAudit extends BaseEntity {
private String remark;
/**
* 审核状态:2 审核通过;3审核不通过
* 审核状态:审核通过;审核不通过
*/
@Schema(description = "审核状态:2 审核通过;3审核不通过(0:待提交;1:待审核;)")
private Integer auditStatus;
@Schema(description = "审核状态:审核通过;审核不通过")
private String auditStatus;
/**
* 合同ID
......@@ -67,5 +67,8 @@ public class TEmployeeContractAudit extends BaseEntity {
@Schema(description = "类型:1合同")
private Integer linkType;
@Schema(description = "节点名称")
private String rootName;
}
......@@ -210,7 +210,7 @@ public class TEmployeeContractInfoController {
* @return R
*/
@Operation(summary = "归档-员工合同(主键:ID;合同编号contractNo;档案柜号fileCabinetNo;附件List<String> attaList)权限temployeecontractinfo_filing", description = "归档-员工合同")
@SysLog("审核员工合同")
@SysLog("归档员工合同")
@PostMapping("/filingContract")
@PreAuthorize("@pms.hasPermission('temployeecontractinfo_filing')")
public R<String> filingContract(@RequestBody TEmployeeContractInfo tEmployeeContractInfo) {
......
......@@ -354,14 +354,40 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(tEmployeeContractInfo.getAuditStatus())
&& CommonConstants.ZERO_INT != tEmployeeContractInfo.getAuditStatus()) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setAuditStatus(tEmployeeContractInfo.getAuditStatus());
if (CommonConstants.ONE_INT == tEmployeeContractInfo.getAuditStatus()) {
audit.setRootName("提交申请");
}
if (CommonConstants.dingleDigitIntArray[2] == tEmployeeContractInfo.getAuditStatus()) {
audit.setRootName("合同审核");
audit.setAuditStatus("审核通过");
audit.setRemark(tEmployeeContractInfo.getAuditRemark());
}
if (CommonConstants.dingleDigitIntArray[3] == tEmployeeContractInfo.getAuditStatus()) {
audit.setRootName("合同审核");
audit.setAuditStatus("审核不通过");
audit.setRemark(tEmployeeContractInfo.getAuditRemark());
}
audit.setLinkId(tEmployeeContractInfo.getId());
audit.setLinkType(CommonConstants.ONE_INT);
audit.setRemark(tEmployeeContractInfo.getAuditRemark());
tEmployeeContractAuditService.save(audit);
}
}
/**
* @Description: 合同归档记录
* @Author: hgw
* @Date: 2022/7/7 10:28
* @return: void
**/
private void setFileInfo(String id, String remark) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("合同归档");
audit.setLinkId(id);
audit.setLinkType(CommonConstants.ONE_INT);
audit.setRemark(remark);
tEmployeeContractAuditService.save(audit);
}
private void updateEmployeeContractStatus(String empId) {
//查看未作废合同数
TEmployeeInfo employeeInfo = tEmployeeInfoService.getById(empId);
......@@ -376,9 +402,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isEmpty(tEmployeeContractInfo.getId()) || Common.isEmpty(tEmployeeContractInfo.getAuditStatus())) {
return R.failed("id、意见必填");
}
TEmployeeContractInfo contractInfo = this.getById(tEmployeeContractInfo.getId());
if (contractInfo.getAuditStatus() != CommonConstants.ONE_INT) {
return R.failed("不是待审核状态!");
}
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[2]) {
TEmployeeContractInfo contractInfo = this.getById(tEmployeeContractInfo.getId());
// 作废、终止,不变为在用
if (Common.isEmpty(contractInfo.getSituation())
|| (!CommonConstants.dingleDigitStrArray[6].equals(contractInfo.getSituation())
......@@ -469,13 +497,15 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return R.failed("合同编号、档案柜号必填!");
}
if (tEmployeeContractInfo.getContractNo().length() > 50
|| tEmployeeContractInfo.getContractNo().length() > 50) {
|| tEmployeeContractInfo.getFileCabinetNo().length() > 50) {
return R.failed("合同编号、档案柜号不可超过50字!");
}
//档案柜存在就自动归档
if (Common.isNotNull(tEmployeeContractInfo.getAttaList())) {
this.setFileInfo(tEmployeeContractInfo.getId(), "添加附件");
tEmployeeContractInfo.setIsFile(CommonConstants.ZERO_STRING);
} else {
this.setFileInfo(tEmployeeContractInfo.getId(), "清空附件");
tEmployeeContractInfo.setIsFile(CommonConstants.ONE_STRING);
}
this.updateById(tEmployeeContractInfo);
......
......@@ -34,5 +34,6 @@
<result property="auditStatus" column="AUDIT_STATUS"/>
<result property="linkId" column="LINK_ID"/>
<result property="linkType" column="LINK_TYPE"/>
<result property="rootName" column="ROOT_NAME"/>
</resultMap>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment