Commit cfc89bbd authored by chenyuxi's avatar chenyuxi

feat: 瓜子档案详情接口

parent 578369c2
......@@ -178,7 +178,7 @@ public class TGzEmpInfo extends BaseEntity {
* 婚姻状态
*/
@ExcelAttribute(name = "婚姻状态", maxLength = 1)
@Length(max = 1, message = "婚姻状态不能超过1个字符")
@Length(max = 3, message = "婚姻状态不能超过1个字符")
@ExcelProperty("婚姻状态")
@Schema(description = "婚姻状态")
private String marStatus;
......@@ -193,10 +193,10 @@ public class TGzEmpInfo extends BaseEntity {
/**
* 是否新参社保(Y:是 N:否)
*/
@ExcelAttribute(name = "是否新参社保(Y:是 N:否)", maxLength = 1)
@Length(max = 1, message = "是否新参社保(Y:是 N:否)不能超过1个字符")
@ExcelProperty("是否新参社保(Y:是 N:否)")
@Schema(description = "是否新参社保(Y:是 N:否)")
@ExcelAttribute(name = "是否新参社保", maxLength = 3)
@Length(max = 3, message = "是否新参社保不能超过3个字符")
@ExcelProperty("是否新参社保")
@Schema(description = "是否新参社保")
private String insuranceSta;
/**
* 驾照类型
......
......@@ -16,10 +16,12 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo;
import lombok.Data;
import java.util.List;
/**
* 瓜子档案表
*
......@@ -46,4 +48,34 @@ public class TGzEmpInfoSearchVo extends TGzEmpInfo {
**/
private int limitEnd;
/**
* 紧急联系人列表
*/
private List<TGzEmpContactInfo> emergContactList;
/**
* 教育经历列表
*/
private List<TGzEmpEducation> eduExpList;
/**
* 家庭成员列表
*/
private List<TGzEmpFamily> familyList;
/**
* 工作经历列表
*/
private List<TGzEmpWork> workExpList;
/**
* 技能证书列表
*/
private List<TGzEmpSkill> skillList;
/**
* 附件列表
*/
private List<TAttaInfo> attaList;
}
......@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzEmpInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoSearchVo;
import lombok.extern.log4j.Log4j2;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -76,6 +77,18 @@ public class TGzEmpInfoController {
return R.ok(tGzEmpInfoService.noPageDiy(tGzEmpInfo));
}
/**
* 通过OfferId查询瓜子档案详情
*
* @param offerId OfferId
* @return R
*/
@Operation(summary = "通过OfferId查询瓜子档案详情")
@GetMapping("/getInfoByOfferId")
public R<TGzEmpInfoSearchVo> getInfoByOfferId(@Param("offerId") Integer offerId) {
return tGzEmpInfoService.getInfoByOfferId(offerId);
}
/**
* 通过id查询瓜子档案表
*
......@@ -135,8 +148,6 @@ public class TGzEmpInfoController {
/**
* 瓜子档案表 批量导出
*
* @author chenyx
* @date 2025-06-13 15:19:03
**/
@Operation(description = "导出瓜子档案表 hasPermission('archives_tgzempinfo-export')")
@PostMapping("/export")
......
......@@ -47,4 +47,12 @@ public interface TGzEmpInfoService extends IService<TGzEmpInfo> {
void listExport(HttpServletResponse response, TGzEmpInfoSearchVo searchVo);
List<TGzEmpInfo> noPageDiy(TGzEmpInfoSearchVo searchVo);
/**
* 通过OfferId查询瓜子档案详情
*
* @param offerId OfferId
* @return R
*/
R<TGzEmpInfoSearchVo> getInfoByOfferId(Integer offerId);
}
......@@ -16,12 +16,17 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TGzEmpInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzEmpInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzOfferInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.util.IdCardUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -29,6 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.net.URL;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
......@@ -63,6 +69,25 @@ import java.util.ArrayList;
@Service
@RequiredArgsConstructor
public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpInfo> implements TGzEmpInfoService {
private final TGzOfferInfoService gzOfferInfoService;
private final TGzEmpContactInfoMapper gzEmpContactInfoMapper;
private final TGzEmpEducationMapper gzEmpEducationMapper;
private final TGzEmpFamilyMapper gzEmpFamilyMapper;
private final TGzEmpSkillMapper gzEmpSkillMapper;
private final TGzEmpWorkMapper gzEmpWorkMapper;
private final TAttaInfoService attaInfoService;
@Autowired
private OSSUtil ossUtil;
/**
* 瓜子档案表简单分页查询
*
......@@ -74,6 +99,115 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
return baseMapper.getTGzEmpInfoPage(page, tGzEmpInfo);
}
/**
* 通过OfferId查询瓜子档案详情
*
* @param offerId OfferId
* @return R
*/
@Override
public R<TGzEmpInfoSearchVo> getInfoByOfferId(Integer offerId) {
TGzEmpInfoSearchVo gzEmpInfoVo = new TGzEmpInfoSearchVo();
TGzOfferInfo gzOfferInfo = gzOfferInfoService.getOne(Wrappers.<TGzOfferInfo>query().lambda()
.eq(TGzOfferInfo::getId, offerId)
.eq(TGzOfferInfo::getDelFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if(Common.isEmpty(gzOfferInfo)){
return R.failed("数据异常,禁止操作");
}
if(!CommonConstants.NINE_STRING.equals(gzOfferInfo.getOfferStatus())){
return R.failed("当前Offer不符合档案采集状态,禁止操作");
}
TGzEmpInfo gzEmpInfo = this.getOne(Wrappers.<TGzEmpInfo>query().lambda()
.eq(TGzEmpInfo::getOfferId, offerId)
.eq(TGzEmpInfo::getDelFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
// 还未生成档案,取offer里的信息
if(Common.isEmpty(gzEmpInfo)){
gzEmpInfoVo.setOfferId(offerId);
gzEmpInfoVo.setName(gzOfferInfo.getName());
gzEmpInfoVo.setNameAc(gzOfferInfo.getNameAc());
gzEmpInfoVo.setNationalIdType(gzOfferInfo.getNationalIdType());
gzEmpInfoVo.setNationalId(gzOfferInfo.getNationalId());
// 根据身份证得出 出生日期和性别
if(Common.isNotNull(gzEmpInfoVo.getNationalId()) && gzEmpInfoVo.getNationalId().length() > 14){
String idCard = gzEmpInfoVo.getNationalId();
gzEmpInfoVo.setBirthdate(IdCardUtil.getBirthdate(idCard));
// 性别: F:女,M:男
if (idCard.length() > 17) {
if (Integer.parseInt(idCard.substring(16, 17)) % 2 == 1) {
gzEmpInfoVo.setSex("M");
} else {
gzEmpInfoVo.setSex("F");
}
}
}
gzEmpInfoVo.setPhone(gzOfferInfo.getPhone());
gzEmpInfoVo.setMail(gzOfferInfo.getEmail());
// 地址类型: 系统存默认值“现住址”:1A
gzEmpInfoVo.setAddressType("1A");
} else {
BeanUtil.copyProperties(gzEmpInfo, gzEmpInfoVo);
// 获取瓜子档案附属信息
// 紧急联系人
LambdaQueryWrapper<TGzEmpContactInfo> queryContactInfo = Wrappers.<TGzEmpContactInfo>lambdaQuery()
.eq(TGzEmpContactInfo::getEmpId, gzEmpInfo.getId())
.eq(TGzEmpContactInfo::getDelFlag, CommonConstants.ZERO_STRING)
.eq(TGzEmpContactInfo::getPrimaryNid, "Y")
.last(" limit 1 ");
List<TGzEmpContactInfo> emergContactList = gzEmpContactInfoMapper.selectList(queryContactInfo);
gzEmpInfoVo.setEmergContactList(emergContactList);
// 教育经历
LambdaQueryWrapper<TGzEmpEducation> queryEduInfo = Wrappers.<TGzEmpEducation>lambdaQuery()
.eq(TGzEmpEducation::getEmpId, gzEmpInfo.getId())
.eq(TGzEmpEducation::getDelFlag, CommonConstants.ZERO_STRING)
.eq(TGzEmpEducation::getHighEduQualFlag, "Y")
.last(" limit 1 ");
List<TGzEmpEducation> eduList = gzEmpEducationMapper.selectList(queryEduInfo);
gzEmpInfoVo.setEduExpList(eduList);
// 工作经历列表
LambdaQueryWrapper<TGzEmpWork> queryWorkInfo = Wrappers.<TGzEmpWork>lambdaQuery()
.eq(TGzEmpWork::getEmpId, gzEmpInfo.getId())
.eq(TGzEmpWork::getDelFlag, CommonConstants.ZERO_STRING)
.orderByAsc(TGzEmpWork::getCreateTime).orderByAsc(TGzEmpWork::getId);
List<TGzEmpWork> workList = gzEmpWorkMapper.selectList(queryWorkInfo);
gzEmpInfoVo.setWorkExpList(workList);
// 家庭成员列表
LambdaQueryWrapper<TGzEmpFamily> queryFamilyInfo = Wrappers.<TGzEmpFamily>lambdaQuery()
.eq(TGzEmpFamily::getEmpId, gzEmpInfo.getId())
.eq(TGzEmpFamily::getDelFlag, CommonConstants.ZERO_STRING)
.orderByAsc(TGzEmpFamily::getCreateTime).orderByAsc(TGzEmpFamily::getId);
List<TGzEmpFamily> familyList = gzEmpFamilyMapper.selectList(queryFamilyInfo);
gzEmpInfoVo.setFamilyList(familyList);
// 技能证书列表
LambdaQueryWrapper<TGzEmpSkill> querySkillInfo = Wrappers.<TGzEmpSkill>lambdaQuery()
.eq(TGzEmpSkill::getEmpId, gzEmpInfo.getId())
.eq(TGzEmpSkill::getDelFlag, CommonConstants.ZERO_STRING)
.orderByAsc(TGzEmpSkill::getCreateTime).orderByAsc(TGzEmpSkill::getId);
List<TGzEmpSkill> skillList = gzEmpSkillMapper.selectList(querySkillInfo);
gzEmpInfoVo.setSkillList(skillList);
// 附件
List<TAttaInfo> attaInfos = attaInfoService.list(Wrappers.<TAttaInfo>query().lambda().eq(TAttaInfo::getDomainId, gzEmpInfo.getId()));
if (Common.isNotNull(attaInfos)) {
URL url;
for (TAttaInfo atta : attaInfos) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
if (Common.isNotNull(url)) {
atta.setAttaUrl(url.toString());
}
}
}
gzEmpInfoVo.setAttaList(attaInfos);
}
return R.ok(gzEmpInfoVo);
}
/**
* 瓜子档案表批量导出
*
......
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