Commit b54bba59 authored by hongguangwu's avatar hongguangwu

优化

parent ea9e491a
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 员工合同审批记录表
*
* @author hgw
* @date 2022-06-30 20:39:54
*/
@Data
@TableName("t_employee_contract_audit")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "员工合同审批记录表")
public class TEmployeeContractAudit extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "id")
private String id;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
/**
* 审核状态:2 审核通过;3审核不通过
*/
@Schema(description = "审核状态:2 审核通过;3审核不通过(0:待提交;1:待审核;)")
private Integer auditStatus;
/**
* 合同ID
*/
@Schema(description = "合同ID")
private String linkId;
/**
* 类型:1合同
*/
@Schema(description = "类型:1合同")
private Integer linkType;
}
...@@ -374,6 +374,19 @@ public class TEmployeeContractInfo extends BaseEntity { ...@@ -374,6 +374,19 @@ public class TEmployeeContractInfo extends BaseEntity {
@Schema(description ="审核状态(0:待提交;1:待审核;2审核通过;3审核不通过)") @Schema(description ="审核状态(0:待提交;1:待审核;2审核通过;3审核不通过)")
private Integer auditStatus; private Integer auditStatus;
/**
* 删除状态(0未删除;1已删除)
*/
@Schema(description ="删除状态(0未删除;1已删除)")
private Integer deleteFlag;
/**
* 审核原因
*/
@Schema(description ="审核说明,前端传参用,字段不存数据库,数据库存审核记录")
@TableField(exist = false)
private String auditRemark;
@Schema(description ="附件idList") @Schema(description ="附件idList")
@TableField(exist = false) @TableField(exist = false)
private List<String> attaList; private List<String> attaList;
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAudit;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractAuditService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 员工合同审批记录表
*
* @author hgw
* @date 2022-06-30 20:39:54
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/temployeecontractaudit")
@Tag(name = "员工合同审批记录表管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TEmployeeContractAuditController {
private final TEmployeeContractAuditService tEmployeeContractAuditService;
/**
* 获取list
*
* @param tEmployeeContractAudit 员工合同审批记录表
* @return
*/
@Operation(summary = "获取list", description = "获取list")
@GetMapping("/getContractAuditList")
public R<List<TEmployeeContractAudit>> getContractAuditList(TEmployeeContractAudit tEmployeeContractAudit) {
return R.ok(tEmployeeContractAuditService.list(Wrappers.query(tEmployeeContractAudit)));
}
}
...@@ -20,9 +20,13 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller; ...@@ -20,9 +20,13 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService;
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.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; 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.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -69,7 +73,7 @@ public class TEmployeeContractInfoController { ...@@ -69,7 +73,7 @@ public class TEmployeeContractInfoController {
* @param id id * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('temployeecontractinfo_get')") @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}") @GetMapping("/{id}")
public R getById(@PathVariable("id") String id) { public R getById(@PathVariable("id") String id) {
return R.ok(tEmployeeContractInfoService.getById(id)); return R.ok(tEmployeeContractInfoService.getById(id));
...@@ -81,11 +85,11 @@ public class TEmployeeContractInfoController { ...@@ -81,11 +85,11 @@ public class TEmployeeContractInfoController {
* @param tEmployeeContractInfo 员工合同 * @param tEmployeeContractInfo 员工合同
* @return R * @return R
*/ */
@Operation(summary = "新增员工合同", description = "新增员工合同:hasPermission('temployeecontractinfo_add')") @Operation(summary = "新增员工合同auditStatus审核状态,前端传参(0:保存为待提交;1:提交为待审核)temployeecontractinfo_add附件传参attaList", description = "新增员工合同:hasPermission('temployeecontractinfo_add')")
@SysLog("新增员工合同") @SysLog("新增员工合同")
@PostMapping @PostMapping("/saveNewContract")
@PreAuthorize("@pms.hasPermission('temployeecontractinfo_add')") @PreAuthorize("@pms.hasPermission('temployeecontractinfo_add')")
public R<List<ErrorMessage>> save(@RequestBody TEmployeeContractInfo tEmployeeContractInfo) { public R<List<ErrorMessage>> saveNewContract(@RequestBody TEmployeeContractInfo tEmployeeContractInfo) {
return tEmployeeContractInfoService.saveNewContract(tEmployeeContractInfo); return tEmployeeContractInfoService.saveNewContract(tEmployeeContractInfo);
} }
...@@ -95,12 +99,12 @@ public class TEmployeeContractInfoController { ...@@ -95,12 +99,12 @@ public class TEmployeeContractInfoController {
* @param tEmployeeContractInfo 员工合同 * @param tEmployeeContractInfo 员工合同
* @return R * @return R
*/ */
@Operation(summary = "修改员工合同", description = "修改员工合同:hasPermission('temployeecontractinfo_edit')") @Operation(summary = "编辑员工合同auditStatus审核状态,前端传参(0:保存为待提交;1:提交为待审核)temployeecontractinfo_edit编辑的附件,前端操作,可以不传参attaList", description = "修改员工合同:hasPermission('temployeecontractinfo_edit')")
@SysLog("修改员工合同") @SysLog("修改员工合同")
@PutMapping @PostMapping("/updateContract")
@PreAuthorize("@pms.hasPermission('temployeecontractinfo_edit')") @PreAuthorize("@pms.hasPermission('temployeecontractinfo_edit')")
public R updateById(@RequestBody TEmployeeContractInfo tEmployeeContractInfo) { public R<List<ErrorMessage>> updateContract(@RequestBody TEmployeeContractInfo tEmployeeContractInfo) {
return R.ok(tEmployeeContractInfoService.updateById(tEmployeeContractInfo)); return tEmployeeContractInfoService.updateContract(tEmployeeContractInfo);
} }
/** /**
...@@ -109,12 +113,30 @@ public class TEmployeeContractInfoController { ...@@ -109,12 +113,30 @@ public class TEmployeeContractInfoController {
* @param id id * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id删除员工合同", description = "通过id删除员工合同:hasPermission('temployeecontractinfo_del')") @Operation(summary = "通过id假删除员工合同temployeecontractinfo_del", description = "通过id删除员工合同:hasPermission('temployeecontractinfo_del')")
@SysLog("通过id删除员工合同") @SysLog("通过id删除员工合同")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('temployeecontractinfo_del')") @PreAuthorize("@pms.hasPermission('temployeecontractinfo_del')")
public R removeById(@PathVariable String id) { public R<String> removeById(@PathVariable String id) {
return R.ok(tEmployeeContractInfoService.removeById(id)); YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
TEmployeeContractInfo contractInfo = tEmployeeContractInfoService.getById(id);
if (contractInfo == null) {
return R.failed("未找到记录");
} else {
if (!user.getId().equals(contractInfo.getCreateBy())) {
return R.failed("不是合同创建人,无法删除");
}
if (contractInfo.getAuditStatus() != CommonConstants.ZERO_INT
&& contractInfo.getAuditStatus() != CommonConstants.dingleDigitIntArray[3]) {
return R.failed("不是待审核或审核不通过,无法删除");
}
contractInfo.setDeleteFlag(CommonConstants.ONE_INT);
tEmployeeContractInfoService.updateById(contractInfo);
return R.ok();
}
} }
} }
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAudit;
import org.apache.ibatis.annotations.Mapper;
/**
* 员工合同审批记录表
*
* @author hgw
* @date 2022-06-30 20:39:54
*/
@Mapper
public interface TEmployeeContractAuditMapper extends BaseMapper<TEmployeeContractAudit> {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAudit;
/**
* 员工合同审批记录表
*
* @author hgw
* @date 2022-06-30 20:39:54
*/
public interface TEmployeeContractAuditService extends IService<TEmployeeContractAudit> {
}
...@@ -43,16 +43,31 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract ...@@ -43,16 +43,31 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
*/ */
IPage<TEmployeeContractInfo> getTEmployeeContractInfoPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo); IPage<TEmployeeContractInfo> getTEmployeeContractInfoPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo);
/**
* @param tEmployeeContractInfo
* @Description: 新增
* @Author: hgw
* @Date: 2022/6/30 20:34
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage>>
**/
R<List<ErrorMessage>> saveNewContract(TEmployeeContractInfo tEmployeeContractInfo); R<List<ErrorMessage>> saveNewContract(TEmployeeContractInfo tEmployeeContractInfo);
/**
* @param tEmployeeContractInfo
* @Description: 编辑
* @Author: hgw
* @Date: 2022/6/30 20:34
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage>>
**/
R<List<ErrorMessage>> updateContract(TEmployeeContractInfo tEmployeeContractInfo);
/** /**
* 保存员工合同表及附件关系表 * 保存员工合同表及附件关系表
* @Author fxj * @Author fxj
* @Date 2019-09-09 * @Date 2019-09-09
* @param tEmployeeContractInfo * @param tEmployeeContractInfo
* @param tEmployeeInfo
* @return * @return
**/ **/
boolean saveContractAndAtta(TEmployeeContractInfo tEmployeeContractInfo, TEmployeeInfo tEmployeeInfo); boolean saveContractAndAtta(TEmployeeContractInfo tEmployeeContractInfo);
} }
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAudit;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractAuditMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractAuditService;
import org.springframework.stereotype.Service;
/**
* 员工合同审批记录表
*
* @author hgw
* @date 2022-06-30 20:39:54
*/
@Service
public class TEmployeeContractAuditServiceImpl extends ServiceImpl<TEmployeeContractAuditMapper, TEmployeeContractAudit> implements TEmployeeContractAuditService {
}
...@@ -49,6 +49,7 @@ import java.util.List; ...@@ -49,6 +49,7 @@ import java.util.List;
@RequiredArgsConstructor @RequiredArgsConstructor
public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContractInfoMapper, TEmployeeContractInfo> implements TEmployeeContractInfoService { public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContractInfoMapper, TEmployeeContractInfo> implements TEmployeeContractInfoService {
private static final String ID_NOT_EMPTY = "ID,EMP_ID不可为空";
private static final String EMPID_NOT_EMPTY = "员工ID、项目ID不可为空"; private static final String EMPID_NOT_EMPTY = "员工ID、项目ID不可为空";
private static final String EMPINFO_IS_NOT_EXITS_BYID = "未找到人员档案与项目档案!"; private static final String EMPINFO_IS_NOT_EXITS_BYID = "未找到人员档案与项目档案!";
...@@ -58,6 +59,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -58,6 +59,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private final TSettleDomainService tSettleDomainService; private final TSettleDomainService tSettleDomainService;
private final TCustomerInfoService tCustomerInfoService; private final TCustomerInfoService tCustomerInfoService;
private final TAttaInfoService tAttaInfoService; private final TAttaInfoService tAttaInfoService;
private final TEmployeeContractAuditService tEmployeeContractAuditService;
// 缓存信息 // 缓存信息
private final CacheManager cacheManager; private final CacheManager cacheManager;
...@@ -108,7 +110,41 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -108,7 +110,41 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL); return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL);
} }
if (this.saveContractAndAtta(tEmployeeContractInfo, tEmployeeInfo)) { if (this.saveContractAndAtta(tEmployeeContractInfo)) {
return R.ok();
} else {
return R.failed();
}
} catch (Exception e) {
log.error("员工合同保存异常:" + e.getMessage());
return R.failed("员工合同保存系统异常!");
}
}
@Override
public R<List<ErrorMessage>> updateContract(TEmployeeContractInfo tEmployeeContractInfo) {
try {
if (Common.isEmpty(tEmployeeContractInfo.getId()) || Common.isEmpty(tEmployeeContractInfo.getEmpId())) {
return R.failed(ID_NOT_EMPTY);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
// 初始化
tEmployeeContractInfo.setUpdateBy(user.getId());
tEmployeeContractInfo.setUpdateTime(LocalDateTime.now());
//是否在用:是
tEmployeeContractInfo.setInUse(CommonConstants.ZERO_STRING);
ExcelAttributeValidityUtil<TEmployeeContractInfo> validity = new ExcelAttributeValidityUtil<>(TEmployeeContractInfo.class);
validity.ValidityObj(tEmployeeContractInfo);
if (null != validity.getErrorInfo() && !validity.getErrorInfo().isEmpty()) {
return R.failed(validity.getErrorInfo(), ResultConstants.VALIDITY_FAIL);
}
if (this.saveContractAndAtta(tEmployeeContractInfo)) {
return R.ok(); return R.ok();
} else { } else {
return R.failed(); return R.failed();
...@@ -146,6 +182,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -146,6 +182,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeContractInfo.setWorkingStatusSub(CommonConstants.ZERO_STRING); tEmployeeContractInfo.setWorkingStatusSub(CommonConstants.ZERO_STRING);
//是否作废:否 //是否作废:否
tEmployeeContractInfo.setIsObsolete(CommonConstants.ZERO_STRING); tEmployeeContractInfo.setIsObsolete(CommonConstants.ZERO_STRING);
tEmployeeContractInfo.setDeleteFlag(CommonConstants.ZERO_INT);
if (Common.isEmpty(tEmployeeContractInfo.getApplyNo())) { if (Common.isEmpty(tEmployeeContractInfo.getApplyNo())) {
tEmployeeContractInfo.setApplyNo(this.getCode()); tEmployeeContractInfo.setApplyNo(this.getCode());
} }
...@@ -191,14 +228,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -191,14 +228,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
* 保存员工合同表及附件关系表 * 保存员工合同表及附件关系表
* *
* @param tEmployeeContractInfo * @param tEmployeeContractInfo
* @param tEmployeeInfo
* @return * @return
* @Author fxj * @Author fxj
* @Date 2019-09-09 * @Date 2019-09-09
**/ **/
@Transactional @Transactional
@Override @Override
public boolean saveContractAndAtta(TEmployeeContractInfo tEmployeeContractInfo, TEmployeeInfo tEmployeeInfo) { public boolean saveContractAndAtta(TEmployeeContractInfo tEmployeeContractInfo) {
//档案柜存在就自动归档 //档案柜存在就自动归档
if (Common.isNotNull(tEmployeeContractInfo.getAttaList())) { if (Common.isNotNull(tEmployeeContractInfo.getAttaList())) {
tEmployeeContractInfo.setIsFile(CommonConstants.ZERO_STRING); tEmployeeContractInfo.setIsFile(CommonConstants.ZERO_STRING);
...@@ -221,17 +257,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -221,17 +257,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
} }
} }
if (Common.isEmpty(tEmployeeContractInfo.getId())) {
// 如果存在工时制且合同为最新在用合同更新档案的工时制——档案没工时制了 baseMapper.insert(tEmployeeContractInfo);
if (baseMapper.insert(tEmployeeContractInfo) > 0) {
//先停用所有在用的员工合同
baseMapper.updateInUseStatusById(tEmployeeContractInfo.getEmpId(), tEmployeeContractInfo.getId(), CommonConstants.ONE_STRING);
if (Common.isNotNull(tEmployeeContractInfo.getAttaList()) && Common.isNotNull(tEmployeeContractInfo.getId())) { if (Common.isNotNull(tEmployeeContractInfo.getAttaList()) && Common.isNotNull(tEmployeeContractInfo.getId())) {
List<String> attaList = tEmployeeContractInfo.getAttaList(); List<String> attaList = tEmployeeContractInfo.getAttaList();
if (null != attaList && !attaList.isEmpty()) { if (null != attaList && !attaList.isEmpty()) {
TAttaInfo contractAtta = null; TAttaInfo contractAtta;
for (String attaId : attaList) { for (String attaId : attaList) {
contractAtta = tAttaInfoService.getById(attaId); contractAtta = tAttaInfoService.getById(attaId);
if (contractAtta != null) { if (contractAtta != null) {
...@@ -241,11 +272,25 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -241,11 +272,25 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
} }
} }
// 更新档案合同状态 } else {
this.updateEmployeeContractStatus(tEmployeeInfo.getId()); baseMapper.updateById(tEmployeeContractInfo);
return true;
} }
return false; // 不是待提交,记录审核记录
if (Common.isNotNull(tEmployeeContractInfo.getAuditStatus())
&& CommonConstants.ZERO_INT != tEmployeeContractInfo.getAuditStatus()) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setAuditStatus(tEmployeeContractInfo.getAuditStatus());
audit.setLinkId(tEmployeeContractInfo.getId());
audit.setLinkType(CommonConstants.ONE_INT);
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) { private void updateEmployeeContractStatus(String empId) {
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractAuditMapper">
<resultMap id="tEmployeeContractAuditMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAudit">
<id property="id" column="id"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="remark" column="REMARK"/>
<result property="auditStatus" column="AUDIT_STATUS"/>
<result property="linkId" column="LINK_ID"/>
<result property="linkType" column="LINK_TYPE"/>
</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