Commit a1376379 authored by hongguangwu's avatar hongguangwu

MVP1.7.12-保存

parent 45c549c5
......@@ -60,9 +60,13 @@ public class TAttaInfo extends BaseEntity {
* 关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招投标7业务评估8二维码9身份证 10 户口本
* ;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件);0(最高教育经历);2(执业资格证书);24 身份证国徽
* 25 户口本本人页26学信27预入职其他附件28户配置 31入离职登记身份证正面 32入离职登记身份证反面
* 41(瓜子申明签名);42(瓜子确认签名);43(瓜子pdf文件)
* CONTRACT(合同) NID_A(证件正面) NID_B(证件反面) BANK_FLOW(银行流水)
* EDUQ(学历) DEGRE(学位) PHOTO(头像) BANK_A(银行卡正面)
* BANK_B(银行卡反面) LEAVE_PRO(离职证明) EXAM_RPT(体检报告)
*/
@NotBlank(message = "关系类型不能为空")
@Length(max = 2, message = "关系类型不能超过2个字符")
@Length(max = 20, message = "关系类型不能超过2个字符")
@Schema(description = "关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招投标7业务评估8二维码9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件);0(最高教育经历);2(执业资格证书);24 身份证国徽 25 户口本本人页26学信28户配置 31入离职登记身份证正面 32入离职登记身份证反面)")
private String relationType;
/**
......
......@@ -16,11 +16,11 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDate;
import java.util.List;
/**
......@@ -36,56 +36,67 @@ public class TGzEmpInfoSearchVo extends TGzEmpInfo {
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
@TableField(exist = false)
private String ids;
/**
* 查询使用:提交档案时间开始
*/
@TableField(exist = false)
private String createTimeStart;
/**
* 查询使用:提交档案时间结束
*/
@TableField(exist = false)
private String createTimeEnd;
/**
* @Author fxj
* 查询数据起
**/
@TableField(exist = false)
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@TableField(exist = false)
private int limitEnd;
/**
* 紧急联系人列表
* 紧急联系人列表————只取第一个(2025-6-20 10:52:16 倩倩)
*/
@TableField(exist = false)
private List<TGzEmpContactInfo> emergContactList;
/**
* 教育经历列表
*/
@TableField(exist = false)
private List<TGzEmpEducation> eduExpList;
/**
* 家庭成员列表
*/
@TableField(exist = false)
private List<TGzEmpFamily> familyList;
/**
* 工作经历列表
*/
@TableField(exist = false)
private List<TGzEmpWork> workExpList;
/**
* 技能证书列表
*/
@TableField(exist = false)
private List<TGzEmpSkill> skillList;
/**
* 附件列表
*/
@TableField(exist = false)
private List<TAttaInfo> attaList;
}
......@@ -38,4 +38,8 @@ public interface TGzEmpContactInfoMapper extends BaseMapper<TGzEmpContactInfo> {
* @return
*/
IPage<TGzEmpContactInfo> getTGzEmpContactInfoPage(Page<TGzEmpContactInfo> page, @Param("tGzEmpContactInfo") TGzEmpContactInfo tGzEmpContactInfo);
// 保存是先删后增 hgw 2025-6-20 11:06:38
int deleteByEmpId(@Param("empId") String empId);
}
......@@ -38,4 +38,7 @@ public interface TGzEmpEducationMapper extends BaseMapper<TGzEmpEducation> {
* @return
*/
IPage<TGzEmpEducation> getTGzEmpEducationPage(Page<TGzEmpEducation> page, @Param("tGzEmpEducation") TGzEmpEducation tGzEmpEducation);
// 保存是先删后增 hgw 2025-6-20 11:06:38
int deleteByEmpId(@Param("empId") String empId);
}
......@@ -39,4 +39,7 @@ public interface TGzEmpFamilyMapper extends BaseMapper<TGzEmpFamily> {
* @return
*/
IPage<TGzEmpFamily> getTGzEmpFamilyPage(Page<TGzEmpFamily> page, @Param("tGzEmpFamily") TGzEmpFamily tGzEmpFamily);
// 保存是先删后增 hgw 2025-6-20 11:06:38
int deleteByEmpId(@Param("empId") String empId);
}
......@@ -39,4 +39,7 @@ public interface TGzEmpSkillMapper extends BaseMapper<TGzEmpSkill> {
* @return
*/
IPage<TGzEmpSkill> getTGzEmpSkillPage(Page<TGzEmpSkill> page, @Param("tGzEmpSkill") TGzEmpSkill tGzEmpSkill);
// 保存是先删后增 hgw 2025-6-20 11:06:38
int deleteByEmpId(@Param("empId") String empId);
}
......@@ -39,4 +39,7 @@ public interface TGzEmpWorkMapper extends BaseMapper<TGzEmpWork> {
* @return
*/
IPage<TGzEmpWork> getTGzEmpWorkPage(Page<TGzEmpWork> page, @Param("tGzEmpWork") TGzEmpWork tGzEmpWork);
// 保存是先删后增 hgw 2025-6-20 11:06:38
int deleteByEmpId(@Param("empId") String empId);
}
......@@ -37,6 +37,7 @@ 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;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
......@@ -44,17 +45,18 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
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 javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.time.LocalDateTime;
import java.util.*;
/**
* 瓜子档案表
......@@ -408,6 +410,25 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
return wrapper;
}
/**
* @Description: 瓜子保存新建用户
* @Author: hgw
* @Date: 2025/6/20 12:01
* @return: com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
**/
private YifuUser getNewYifuUser() {
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
return new YifuUser("3", 1L, "", "瓜子",
"瓜子", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null,null);
}
/**
* @Description: 保存瓜子档案表
* @Author: hgw
......@@ -415,8 +436,120 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Override
@Transactional
public R<Boolean> saveTGzEmpInfo(TGzEmpInfoSearchVo tGzEmpInfoVo) {
// TODO 保存员工信息
YifuUser user = getNewYifuUser();
TGzEmpInfo tGzEmpInfo = tGzEmpInfoVo;
String bizId = tGzEmpInfoVo.getBizId();
if (Common.isEmpty(bizId)) {
return R.failed("请传参流程ID!");
} else {
TGzOfferInfo gzOfferInfo = gzOfferInfoService.getById(bizId);
if(gzOfferInfo == null || Common.isEmpty(gzOfferInfo) || Common.isEmpty(gzOfferInfo.getBizId())){
return R.failed("未找到瓜子Offer数据,Offer的ID="+ bizId);
}
if (Common.isEmpty(gzOfferInfo.getOfferStatus()) || !"9".equals(gzOfferInfo.getOfferStatus())) {
return R.failed("瓜子Offer状态不对("+gzOfferInfo.getOfferStatus()+"),不可编辑,Offer的ID="+ bizId);
}
gzOfferInfo.setOfferStatus("12");
gzOfferInfoService.updateById(gzOfferInfo);
}
String gzEmpId = tGzEmpInfoVo.getId();
if (Common.isEmpty(gzEmpId)) {
tGzEmpInfo.setCreateBy(user.getId());
tGzEmpInfo.setCreateName(user.getNickname());
tGzEmpInfo.setCreateTime(LocalDateTime.now());
this.save(tGzEmpInfo);
gzEmpId = tGzEmpInfo.getId();
} else {
tGzEmpInfo.setUpdateBy(user.getId());
tGzEmpInfo.setUpdateTime(LocalDateTime.now());
this.updateById(tGzEmpInfo);
}
// 获取瓜子档案附属信息:先删除后增加:
// 紧急联系人
gzEmpContactInfoMapper.deleteByEmpId(gzEmpId);
List<TGzEmpContactInfo> emergContactList = tGzEmpInfoVo.getEmergContactList();
if (emergContactList != null && !emergContactList.isEmpty()) {
for (TGzEmpContactInfo a : emergContactList) {
a.setEmpId(gzEmpId);
a.setCreateBy(user.getId());
a.setCreateName(user.getNickname());
a.setCreateTime(LocalDateTime.now());
gzEmpContactInfoMapper.insert(a);
}
}
// 教育经历
gzEmpEducationMapper.deleteByEmpId(gzEmpId);
List<TGzEmpEducation> eduExpList = tGzEmpInfoVo.getEduExpList();
if (eduExpList != null && !eduExpList.isEmpty()) {
for (TGzEmpEducation a : eduExpList) {
a.setEmpId(gzEmpId);
a.setCreateBy(user.getId());
a.setCreateName(user.getNickname());
a.setCreateTime(LocalDateTime.now());
gzEmpEducationMapper.insert(a);
}
}
// 工作经历列表
gzEmpWorkMapper.deleteByEmpId(gzEmpId);
List<TGzEmpWork> workList = tGzEmpInfoVo.getWorkExpList();
if (workList != null && !workList.isEmpty()) {
for (TGzEmpWork a : workList) {
a.setEmpId(gzEmpId);
a.setCreateBy(user.getId());
a.setCreateName(user.getNickname());
a.setCreateTime(LocalDateTime.now());
gzEmpWorkMapper.insert(a);
}
}
// 家庭成员列表
gzEmpFamilyMapper.deleteByEmpId(gzEmpId);
List<TGzEmpFamily> familyList = tGzEmpInfoVo.getFamilyList();
if (familyList != null && !familyList.isEmpty()) {
for (TGzEmpFamily a : familyList) {
a.setEmpId(gzEmpId);
a.setCreateBy(user.getId());
a.setCreateName(user.getNickname());
a.setCreateTime(LocalDateTime.now());
gzEmpFamilyMapper.insert(a);
}
}
// 技能证书列表
gzEmpSkillMapper.deleteByEmpId(gzEmpId);
List<TGzEmpSkill> skillList = tGzEmpInfoVo.getSkillList();
if (skillList != null && !skillList.isEmpty()) {
for (TGzEmpSkill a : skillList) {
a.setEmpId(gzEmpId);
a.setCreateBy(user.getId());
a.setCreateName(user.getNickname());
a.setCreateTime(LocalDateTime.now());
gzEmpSkillMapper.insert(a);
}
}
// 附件
// * 41(瓜子申明签名);42(瓜子确认签名);43(瓜子pdf文件)
// * CONTRACT(合同) NID_A(证件正面) NID_B(证件反面) BANK_FLOW(银行流水)
// * EDUQ(学历) DEGRE(学位) PHOTO(头像) BANK_A(银行卡正面)
// * BANK_B(银行卡反面) LEAVE_PRO(离职证明) EXAM_RPT(体检报告)
attaInfoService.deleteByDomainId(gzEmpId);
List<TAttaInfo> attaList = tGzEmpInfoVo.getAttaList();
if (attaList != null && !attaList.isEmpty()) {
for (TAttaInfo a : attaList) {
a.setDomainId(gzEmpId);
a.setCreateBy(user.getId());
a.setCreateName(user.getNickname());
a.setCreateTime(LocalDateTime.now());
}
attaInfoService.saveBatch(attaList);
}
// TODO - 宇茜加保存日志,加完后删除TODO
return R.ok();
}
......
......@@ -106,4 +106,10 @@
<include refid="tGzEmpContactInfo_where"/>
</where>
</select>
<!-- 删除 -->
<delete id="deleteByEmpId">
delete FROM t_gz_emp_contact_info where emp_id = #{empId}
</delete>
</mapper>
......@@ -136,4 +136,10 @@
<include refid="tGzEmpEducation_where"/>
</where>
</select>
<!-- 删除 -->
<delete id="deleteByEmpId">
delete FROM t_gz_emp_education where emp_id = #{empId}
</delete>
</mapper>
......@@ -116,4 +116,10 @@
<include refid="tGzEmpFamily_where"/>
</where>
</select>
<!-- 删除 -->
<delete id="deleteByEmpId">
delete FROM t_gz_emp_family where emp_id = #{empId}
</delete>
</mapper>
......@@ -101,4 +101,10 @@
<include refid="tGzEmpSkill_where"/>
</where>
</select>
<!-- 删除 -->
<delete id="deleteByEmpId">
delete FROM t_gz_emp_skill where emp_id = #{empId}
</delete>
</mapper>
......@@ -116,4 +116,10 @@
<include refid="tGzEmpWork_where"/>
</where>
</select>
<!-- 删除 -->
<delete id="deleteByEmpId">
delete FROM t_gz_emp_work where emp_id = #{empId}
</delete>
</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