Commit 490b7d4f authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.12' into MVP1.7.12

parents b91ba2c8 9db81282
package com.yifu.cloud.plus.v1.yifu.archives.entity;
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.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -56,6 +53,7 @@ public class TEmployeeContractPre extends BaseEntity {
private String position;
@Schema(description = "入职日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date joinLeaveDate;
@Schema(description = "合同类型,标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同")
......@@ -86,6 +84,7 @@ public class TEmployeeContractPre extends BaseEntity {
private String errorInfo;
@Schema(description = "发起失败时间")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date errorTime;
@Schema(description = "法大大模版名称")
......@@ -98,17 +97,19 @@ public class TEmployeeContractPre extends BaseEntity {
* 预计确认时间
*/
@Schema(description = "预计确认时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
private LocalDateTime expectedConfirmTime;
@Schema(description = "预计发起时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
private LocalDateTime expectedCollectionTime;
@Schema(description = "合同起始时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date contractStart;
@Schema(description = "合同到期时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date contractEnd;
@Schema(description = "签订类型")
......@@ -124,9 +125,11 @@ public class TEmployeeContractPre extends BaseEntity {
private String contractDurationMonth;
@Schema(description = "合同试用期开始时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date tryPeriodStart;
@Schema(description = "合同试用期结束时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date tryPeriodEnd;
@Schema(description = "工作任务")
......
......@@ -46,7 +46,7 @@ public interface EmployeeRegistrationPreMapper extends BaseMapper<EmployeeRegist
MessageTempleteVo selectTempleteVo(@Param("id") String id);
EmployeeInfoMsgVo getEmployeeArchivesInfo(@Param("id") String id);
EmployeeInfoMsgVo getEmployeeArchivesInfo(@Param("id") String id,@Param("typeList") List<String> type);
/**
* @Description: 判断简档详档-优先从档案维护任务表
......
......@@ -54,6 +54,8 @@ import java.net.URL;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 入职待建档表
......@@ -1174,7 +1176,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
@Override
public R<EmployeeInfoMsgVo> getEmployeeInfo(String id) {
//获取人员档案id
EmployeeInfoMsgVo msgInfoVo = baseMapper.getEmployeeArchivesInfo(id);
EmployeeInfoMsgVo msgInfoVo = baseMapper.getEmployeeArchivesInfo(id,CommonConstants.preMainStatus);
if (Common.isEmpty(msgInfoVo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
......@@ -1196,7 +1198,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
@Override
public R<EmployeeInfoMsgVo> getGzEmployeeInfo(String id) {
//获取人员档案id
EmployeeInfoMsgVo msgInfoVo = baseMapper.getEmployeeArchivesInfo(id);
EmployeeInfoMsgVo msgInfoVo = baseMapper.getEmployeeArchivesInfo(id, Stream.of("4").collect(Collectors.toList()));
if (Common.isEmpty(msgInfoVo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
......@@ -1344,8 +1346,8 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
a.setAttaUrl(null != url ? url.toString(): "");
}
contract.setAttaList(attaContractInfo);
pre.setEmployeeContractPre(contract);
}
pre.setEmployeeContractPre(contract);
}
// 查询与员工相关的附件信息
......
......@@ -55,6 +55,8 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -90,7 +92,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private final TEmployeeProjectService tEmployeeProjectService;
private final TSettleDomainService tSettleDomainService;
private final TAttaInfoService tAttaInfoService;
private final TEmployeeContractAuditService tEmployeeContractAuditService;
private final TEmployeeContractAuditMapper tEmployeeContractAuditMapper;
private final TEmployeeLogService tEmployeeLogService;
private final TWorkHandlerInfoService workHandlerInfoService;
private final TPreEmpMainMapper preEmpMainMapper;
......@@ -175,6 +177,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
user = this.getNewYifuUser();
}
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
......@@ -496,6 +501,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过
this.judgeAuditStatus(tEmployeeContractInfo, user);
if (Common.isNotNull(tEmployeeContractInfo.getPreName())) {
tEmployeeContractInfo.setCreateName(tEmployeeContractInfo.getPreName());
tEmployeeContractInfo.setCreateTime(LocalDateTime.now());
}
baseMapper.updateById(tEmployeeContractInfo);
//如果是否同步终止合同、减项、减档为是则生成同步任务处理清单
......@@ -532,6 +541,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.TWO_STRING);
contractPre.setContractId(tEmployeeContractInfo.getId());
contractPre.setErrorInfo("");
contractPre.setErrorTime(null);
contractPreMapper.updateById(contractPre);
}
}
......@@ -624,9 +635,6 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TEmployeeContractAudit audit = new TEmployeeContractAudit();
if (CommonConstants.ONE_INT == tEmployeeContractInfo.getAuditStatus()) {
audit.setRootName("提交申请");
if (Common.isNotNull(tEmployeeContractInfo.getPreName())) {
audit.setCreateName(tEmployeeContractInfo.getPreName());
}
}
if (CommonConstants.dingleDigitIntArray[2] == tEmployeeContractInfo.getAuditStatus()) {
audit.setRootName("合同审核");
......@@ -640,7 +648,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
audit.setLinkId(tEmployeeContractInfo.getId());
audit.setLinkType(CommonConstants.ONE_INT);
tEmployeeContractAuditService.save(audit);
tEmployeeContractAuditMapper.insert(audit);
if (Common.isNotNull(tEmployeeContractInfo.getPreName())) {
audit.setCreateName(tEmployeeContractInfo.getPreName());
audit.setCreateBy("1");
audit.setCreateTime(LocalDateTime.now());
}
tEmployeeContractAuditMapper.updateById(audit);
}
}
......@@ -656,7 +670,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
audit.setRootName("终止合同联动");
audit.setLinkId(tEmployeeContractInfo.getId());
audit.setLinkType(CommonConstants.ONE_INT);
tEmployeeContractAuditService.save(audit);
tEmployeeContractAuditMapper.insert(audit);
}
/**
......@@ -671,7 +685,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
audit.setLinkId(id);
audit.setLinkType(CommonConstants.ONE_INT);
audit.setRemark(remark);
tEmployeeContractAuditService.save(audit);
tEmployeeContractAuditMapper.insert(audit);
}
private void updateEmployeeContractStatus(TEmployeeContractInfo tEmployeeContractInfo) {
......@@ -2285,4 +2299,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
private YifuUser getNewYifuUser() {
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
return new YifuUser("6", 1L, "", "自动化派单",
"自动化派单", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null,null);
}
}
......@@ -310,7 +310,6 @@
where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0 and a.emp_idcard = #{empIdCard} and a.dept_id = #{deptId}
</select>
<select id="getEmployeeArchivesInfo" resultMap="getEmployeeInfoMap">
SELECT
a.emp_idcard as card,
......@@ -320,5 +319,11 @@
a.warning_id as detailId
from t_registe_warning_employee a
where a.id = #{id}
<if test="typeList != null and typeList.size() > 0">
and a.type in
<foreach item="item" index="index" collection="typeList" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
</select>
</mapper>
......@@ -339,18 +339,11 @@
null contractSubName,
null reason,
a.signatory contractParty,
CASE WHEN a.CONTRACT_TERM=0 THEN "已完成一定工作任务为期限"
WHEN a.CONTRACT_TERM =1 THEN "固定期限"
WHEN a.CONTRACT_TERM =2 THEN "无固定期限"
ELSE a.CONTRACT_TERM END as contractType,
a.CONTRACT_TERM contractType,
a.CONTRACT_START as contractStart,
if(a.CONTRACT_TERM ='1',a.CONTRACT_END,null) as contractEnd,
a.post,
CASE WHEN a.CONTRACT_TERM=1 THEN "已完成一定工作任务为期限"
WHEN a.CONTRACT_TERM =2 THEN "固定期限"
WHEN a.CONTRACT_TERM =3 THEN "无固定期限"
WHEN a.CONTRACT_TERM =4 THEN "无固定期限"
ELSE a.CONTRACT_TERM END as workingHours,
a.working_hours as workingHours,
null contractNo,
null fileCabinetNo,
null leaveDate,
......
......@@ -727,15 +727,17 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
employeeContractPreVo.setExpectedConfirmTime(dataR.getData().getRegistDate());
} else {
employeeContractPreVo.setExpectedCollectionTime(registration.getJoinLeaveDate());
employeeContractPreVo.setExpectedConfirmTime(registration.getJoinLeaveDate()); }
employeeContractPreVo.setExpectedConfirmTime(registration.getJoinLeaveDate());
}
}
TEmployeeContractDateVo vo = new TEmployeeContractDateVo();
//合同开始日期、合同截止日期
//合同开始日期、合同截止日期--
if (Common.isEmpty(employeeContractPreVo.getContractStart())
&& Common.isEmpty(employeeContractPreVo.getContractEnd())
&& Common.isEmpty(employeeContractPreVo.getContractDurationYear())
&& Common.isEmpty(employeeContractPreVo.getContractDurationMonth())
&& Common.isNotNull(employeeContractPreVo.getContractEndType())) {
&& Common.isNotNull(employeeContractPreVo.getContractEndType())
&& CommonConstants.ONE_STRING.equals(employeeContractPreVo.getContractEndType())) {
employeeContractPreVo.setContractStart(employeeContractPreVo.getJoinLeaveDate());
EkpDeptContractInfoVo infoVo = new EkpDeptContractInfoVo();
infoVo.setDeptNo(registration.getDeptNo());
......@@ -749,10 +751,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
employeeContractPreVo.setContractEndType(null);
}
}
//合同年限推算
if (Common.isEmpty(employeeContractPreVo.getContractStart())
&& Common.isEmpty(employeeContractPreVo.getContractEnd())
&& Common.isNotNull(employeeContractPreVo.getContractDurationYear())
&& Common.isNotNull(employeeContractPreVo.getContractDurationMonth())) {
&& Common.isNotNull(employeeContractPreVo.getContractDurationMonth())
&& Common.isNotNull(employeeContractPreVo.getContractEndType())
&& CommonConstants.ZERO_STRING.equals(employeeContractPreVo.getContractEndType())) {
employeeContractPreVo.setContractStart(employeeContractPreVo.getJoinLeaveDate());
vo.setMonthAfter(Integer.parseInt(employeeContractPreVo.getContractDurationMonth()));
vo.setYearAfter(Integer.parseInt(employeeContractPreVo.getContractDurationYear()));
......@@ -799,10 +804,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
employeeContractPreVo.setPost(registration.getPosition());
}
// 预计提醒时间、预计合同发起时间
if (Common.isNotNull(employeeContractPreVo.getExpectedCollectionTime()) &&
Common.isNotNull(employeeContractPreVo.getExpectedConfirmTime())) {
employeeContractPreVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
employeeContractPreVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 9:00", DateUtil.DATETIME_PATTERN_MINUTE));
employeeContractPreVo.setExpectedConfirmTime(DateUtil.parseDate(DateUtil.dateToString(
employeeContractPreVo.getExpectedConfirmTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 8:30", DateUtil.DATETIME_PATTERN_MINUTE));
}
archivesDaprUtil.saveContractPreInfo(employeeContractPreVo);
}
......
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