Commit 9dabc75f authored by fangxinjiang's avatar fangxinjiang

批量办理 100%

parent 7a323d93
......@@ -200,4 +200,19 @@ public class EmpContractDispatchVo implements Serializable {
@ExcelAttribute(name = "项目", errorInfo = "项目不能为空", isOrgan = true, maxLength = 32)
@Schema(description = "项目", name = "settleDomain")
private String settleDomain;
/**
* 项目名称
*/
@Length(max = 128, message = "项目名称不能超过128个字符")
@ExcelAttribute(name = "项目名称", maxLength = 128)
@Schema(description = "项目名称", name = "subjectDepart")
private String subjectDepart;
/**
* 客户名称
*/
@Length(max = 128, message = "客户名称不能超过128个字符")
@ExcelAttribute(name = "客户名称", maxLength = 128)
@Schema(description = "客户名称", name = "subjectUnit")
private String subjectUnit;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author fxj
* @Date 2022/8/1
* @Description
* @Version 1.0
*/
@Data
public class UpdateEmpVo implements Serializable {
// 员工身份认证
String empIdCard;
// 项目编码
String projectNo;
// 合同开始时间
String contractName;
}
......@@ -23,10 +23,7 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchCheckVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchEmpVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDispatchAddVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorMessageVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
......@@ -466,5 +463,14 @@ public class TEmployeeInfoController {
public EmpDispatchAddVo addDispatchInfo(@RequestBody(required = true) EmpDispatchAddVo addVo) {
return tEmployeeInfoService.addDispatchInfo(addVo);
}
/**
* @Description: 派单审核通过 更新档案 合同 项目档案审核状态
* @Author: fxj
* @Date: 2022/08/01 18:52
**/
@Operation(summary = "通过EMP_ID查询人员档案变更日志", description = "通过EMP_ID查询人员档案变更日志")
@GetMapping("/inner/updateEmpInfo")
public Boolean updateEmpInfo(@RequestBody UpdateEmpVo vo) {
return tEmployeeInfoService.updateEmpInfo(vo);
}
}
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmpVo;
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;
......@@ -143,5 +144,4 @@ public class TEmployeeLogController {
return R.ok(tEmployeeLogService.list(Wrappers.<TEmployeeLog>query().eq("PROJECT_ID", projectId)
.eq("TYPE", CommonConstants.ONE_INT).orderByDesc(CommonConstants.CREATE_TIME)));
}
}
......@@ -95,7 +95,9 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
**/
R<List<ErrorMessage>> updateContract(TEmployeeContractInfo tEmployeeContractInfo);
/**
String getCode(boolean isNew);
/**
* @param tEmployeeContractInfo
* @Description: 审核
* @Author: hgw
......
......@@ -184,4 +184,6 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
Map<String,DispatchEmpVo> getDispatchEmpVo(DispatchCheckVo checkVo);
EmpDispatchAddVo addDispatchInfo(EmpDispatchAddVo addVo);
Boolean updateEmpInfo(UpdateEmpVo vo);
}
......@@ -30,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeContractConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractUpdateVO;
......@@ -75,7 +76,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private static final String EMPINFO_IS_NOT_EXITS_BYID = "未找到人员档案与项目档案!";
private final TEmployeeInfoService tEmployeeInfoService;
private final TEmployeeInfoMapper tEmployeeInfoMapper;
private final TEmployeeProjectService tEmployeeProjectService;
private final TSettleDomainService tSettleDomainService;
private final TCustomerInfoService tCustomerInfoService;
......@@ -127,7 +128,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private R<List<ErrorMessage>> setBaseInfo(TEmployeeContractInfo tEmployeeContractInfo, TEmployeeProject tEmployeeProject) {
// 获取人员档案
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(tEmployeeContractInfo.getEmpId());
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeContractInfo.getEmpId());
// 获取项目
if (tEmployeeProject == null) {
tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query()
......@@ -234,7 +235,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
* @Date: 2022/6/22 17:52
* @return: java.lang.String
**/
private synchronized String getCode(boolean isNew) {
@Override
public synchronized String getCode(boolean isNew) {
String nowDay = DateUtil.getThisDay();
int nowNums;
String empCode = null;
......@@ -398,7 +400,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private void updateEmployeeContractStatus(String empId) {
//查看未作废合同数
TEmployeeInfo employeeInfo = tEmployeeInfoService.getById(empId);
TEmployeeInfo employeeInfo = tEmployeeInfoMapper.selectById(empId);
if (employeeInfo != null) {
employeeInfo.setContractStatus(CommonConstants.ONE_INT);
}
......@@ -436,10 +438,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeProjectService.updateById(tEmployeeProject);
}
// 更新档案、项目合同状态为(1在用)
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(contractInfo.getEmpId());
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(contractInfo.getEmpId());
if (tEmployeeInfo != null) {
tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
tEmployeeInfoService.updateById(tEmployeeInfo);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
}
} else {
//先停用项目内的其他的员工合同————不要这个逻辑了
......@@ -475,7 +477,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
// 更新档案、项目合同状态为(0无合同 1在用 2不在用)
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(contractInfo.getEmpId());
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(contractInfo.getEmpId());
if (tEmployeeInfo != null) {
// 判断人员有无审核通过的其他合同
TEmployeeContractInfo contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query()
......@@ -488,7 +490,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} else {
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
}
tEmployeeInfoService.updateById(tEmployeeInfo);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
}
}
}
......
......@@ -84,7 +84,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private final TEmpEducationService tEmpEducationService;
private final TSettleDomainService tSettleDomainService;
private final TEmployeeContractInfoMapper contractMapper;
private final TEmployeeContractInfoService contractServicer;
@Override
public IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo, String sql) {
......@@ -2083,6 +2085,54 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return addVo;
}
/**
* @Author fxj
* @Description 派单审核通过 同步人员档案 项目档案 合同状态信息
* @Date 19:30 2022/8/1
* @Param
* @return
**/
@Override
public Boolean updateEmpInfo(UpdateEmpVo vo) {
if (Common.isEmpty(vo)){
if (Common.isEmpty(vo.getEmpIdCard())){
TEmployeeInfo employeeInfo = baseMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeInfo::getEmpIdcard,vo.getEmpIdCard())
.eq(TEmployeeInfo::getStatus,CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(employeeInfo)){
employeeInfo.setStatus(CommonConstants.ONE_INT);
baseMapper.updateById(employeeInfo);
}
if (Common.isNotNull(vo.getContractName())){
TEmployeeContractInfo c = contractServicer.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getEmpIdcard,vo.getEmpIdCard())
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.eq(TEmployeeContractInfo::getContractName,vo.getContractName())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(c)){
c.setAuditStatus(CommonConstants.TWO_INT);
contractServicer.updateById(c);
}
}
if (Common.isNotNull(vo.getProjectNo())){
TEmployeeProject p = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.ONE_STRING)
.eq(TEmployeeProject::getEmpIdcard,vo.getEmpIdCard())
.eq(TEmployeeProject::getDeptNo,vo.getProjectNo())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(p)){
tEmployeeProjectService.updateById(p);
}
}
}
}
return true;
}
private void saveContract(Map<String, EmpProjectDispatchVo> projectsMap,
Map<String, EmpContractDispatchVo> contractsMap,
Map<String, EmpAddDispatchVo> empAddsMap) {
......@@ -2112,7 +2162,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
contract.setFileTown(emp.getFileTown());
}
}
contractMapper.insert(contract);
contract.setApplyNo(contractServicer.getCode(false));
contractServicer.save(contract);
contractAdd.setId(contract.getId());
contractAdd.setEmpNo(contract.getEmpNo());
contractsMap.put(contractAdd.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + contractAdd.getDeptNo(), contractAdd);
......
......@@ -6,6 +6,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -14,6 +15,7 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -162,4 +164,27 @@ public class ArchivesDaprUtil {
}
return res;
}
/**
* @Author fxj
* @Description 派单审核通过 同步人员档案 项目档案 合同状态信息
* @Date 19:30 2022/8/1
* @Param
* @return
**/
public R<Boolean> updateEmpInfo(String empIdCard, String projectNo, String contractName){
if (Common.isEmpty(empIdCard) || Common.isEmpty(projectNo) || Common.isEmpty(contractName)){
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
UpdateEmpVo vo = new UpdateEmpVo();
vo.setEmpIdCard(empIdCard);
vo.setProjectNo(projectNo);
vo.setContractName(contractName);
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId()
,"/temployeeinfo/inner/updateEmpInfo" , JSON.toJSONString(vo), UpdateEmpVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("更新人员档案、项目档案、合同状态信息失败!");
}
return res;
}
}
......@@ -34,6 +34,14 @@ public class DispatchConstants {
public static final String DISPATCH_SOCIAL_REDUCE = "社保派减";
public static final String SOCIAL_RECORD_ROSTER_EXPORT = "社保花名册导出";
public static final String SOCIAL_RECORD_EXPORT = "公积金变更清册导出";
public static final String DISPATCH_PENSION = "养老、";
public static final String DISPATCH_MEDICAL = "医疗、";
public static final String DISPATCH_BIRTH = "生育、";
public static final String DISPATCH_INJURY = "工伤、";
public static final String DISPATCH_UNEMP = "失业、";
public static final String DISPATCH_BIGMAILMENT= "大病、";
public static final String DISPATCH_FUND= "公积金、";
/**
......
......@@ -257,8 +257,8 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 社保户
*/
@Length(max = 32, message = "社保户 不能超过32个字符" )
@ExcelAttribute(name = "社保户", maxLength = 32)
@Length(max = 50, message = "社保户 不能超过50个字符" )
@ExcelAttribute(name = "社保户", maxLength = 50)
@Schema(description = "社保户" )
@ExcelProperty("社保户" )
private String socialHousehold;
......@@ -362,8 +362,8 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 公积金户
*/
@Length(max = 32, message = "公积金户 不能超过32 个字符" )
@ExcelAttribute(name = "公积金户", maxLength = 32)
@Length(max = 50, message = "公积金户 不能超过50 个字符" )
@ExcelAttribute(name = "公积金户", maxLength = 50)
@Schema(description = "公积金户" )
@ExcelProperty("公积金户" )
private String providentHousehold;
......
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