Merge remote-tracking branch 'origin/develop' into feature/ml
# Conflicts: # src/com/engine/organization/service/impl/PersonnelResumeServiceImpl.java # src/com/engine/organization/web/PersonnelResumeController.java # src/com/engine/organization/wrapper/PersonnelResumeWrapper.java
This commit is contained in:
commit
90e6d7b765
|
|
@ -26,7 +26,7 @@ public class ResourceBO {
|
|||
tree.setName(item.getLastName());
|
||||
tree.setPid("0");
|
||||
tree.setSelected(false);
|
||||
tree.setType("3");
|
||||
tree.setType("4");
|
||||
tree.setParentComp(null == item.getJobId() ? "0" : item.getJobId().toString());
|
||||
tree.setOrderNum(null == item.getDspOrder() ? 0 : item.getDspOrder());
|
||||
return tree;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package com.engine.organization.entity.resume.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/12/30
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class HrmFamilyInfoPO {
|
||||
private Integer resourceId;
|
||||
private String member;
|
||||
private String title;
|
||||
private String company;
|
||||
private String jobTitle;
|
||||
private String address;
|
||||
private String uuid;
|
||||
private String birthday;
|
||||
private Integer whetherChildren;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.engine.organization.entity.resume.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/12/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PersonnelResumeColumn {
|
||||
private String name;
|
||||
private String value;
|
||||
private Integer colspans;
|
||||
private Integer rowspans;
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
package com.engine.organization.entity.resume.po;
|
||||
|
||||
import lombok.Data;
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.GCONST;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/12/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PersonnelResumePO {
|
||||
private String lastName;
|
||||
private String sex;
|
||||
private String birthday;
|
||||
// resourceImageId;
|
||||
private String image;
|
||||
private String nativePlace;
|
||||
// policy;
|
||||
private String politics;
|
||||
// departmentid;
|
||||
private String department;
|
||||
// maritalStatus;
|
||||
private String marriage;
|
||||
private String jobTitle;
|
||||
private String companyStartDate;
|
||||
private String workStartDate;
|
||||
// certificatenum
|
||||
private String idCard;
|
||||
// homeaddress
|
||||
private String address;
|
||||
private String telephone;
|
||||
private String email;
|
||||
private String selfStatement;
|
||||
|
||||
public String getSex() {
|
||||
if ("1".equals(sex)) {
|
||||
return "女";
|
||||
}
|
||||
return "男";
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
if (StringUtils.isBlank(image)) {
|
||||
return "";
|
||||
}
|
||||
ImageFileManager manager = new ImageFileManager();
|
||||
manager.getImageFileInfoById(Util.getIntValue(image));
|
||||
InputStream inputStream = manager.getInputStream();
|
||||
String imageStr = "";
|
||||
try {
|
||||
String outPutPath = GCONST.getRootPath() + "hrm" + File.separator + "import" + File.separator + "template" + File.separator
|
||||
+ manager.getImageFileName();
|
||||
File f = new File(outPutPath);
|
||||
if (!f.exists()) {
|
||||
String substring = outPutPath.substring(0, outPutPath.lastIndexOf(File.separator));
|
||||
File file = new File(substring);
|
||||
if (file.mkdirs()) {
|
||||
boolean newFile = f.createNewFile();
|
||||
if (!newFile) {
|
||||
throw new IOException(outPutPath + "文件创建失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
Thumbnails.of(inputStream).forceSize(100, 120).toFile(f);
|
||||
InputStream fileInputStream = Files.newInputStream(f.toPath());
|
||||
imageStr = "data:image/" + manager.getImageFileType() + ";base64," + Base64.getEncoder().encodeToString(IOUtils.toByteArray(fileInputStream));
|
||||
// 删除文件
|
||||
f.delete();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return imageStr;
|
||||
}
|
||||
|
||||
|
||||
public String getMarriage() {
|
||||
if (StringUtils.isBlank(marriage)) {
|
||||
return "未婚";
|
||||
}
|
||||
switch (marriage) {
|
||||
case "1":
|
||||
return "已婚";
|
||||
case "2":
|
||||
return "离异";
|
||||
case "0":
|
||||
default:
|
||||
return "未婚";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.engine.organization.entity.resume.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/12/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PersonnelResumeTable {
|
||||
private String title;
|
||||
private List<PersonnelResumeColumn> columns;
|
||||
private List<List<PersonnelResumeColumn>> datas;
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.engine.organization.mapper.resource;
|
||||
|
||||
import com.engine.organization.entity.hrmresource.po.ResourcePO;
|
||||
import com.engine.organization.entity.resume.po.HrmFamilyInfoPO;
|
||||
import com.engine.organization.entity.resume.po.PersonnelResumePO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -17,4 +19,8 @@ public interface HrmResourceMapper {
|
|||
|
||||
List<ResourcePO> listByFilter(@Param("resourcePO") ResourcePO resourcePO);
|
||||
|
||||
PersonnelResumePO getPersonnelResumeById(@Param("id") Integer id);
|
||||
|
||||
List<HrmFamilyInfoPO> getHrmFamilyInfoByUser(@Param("resourceId") Integer resourceId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,33 @@
|
|||
and jobtitle = #{resourcePO.jobtitle}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getPersonnelResumeById"
|
||||
resultType="com.engine.organization.entity.resume.po.PersonnelResumePO">
|
||||
select lastname,
|
||||
sex,
|
||||
birthday,
|
||||
resourceimageid as image,
|
||||
nativeplace,
|
||||
policy as politics,
|
||||
a.departmentname as department,
|
||||
maritalstatus as marriage,
|
||||
b.jobtitlename as jobTitle,
|
||||
companystartdate,
|
||||
workstartdate,
|
||||
certificatenum as idCard,
|
||||
residentplace as address,
|
||||
mobile as telephone,
|
||||
email
|
||||
from hrmresource h
|
||||
inner join hrmdepartment a on a.id = h.departmentid
|
||||
inner join hrmjobtitles b on b.id = h.jobtitle
|
||||
where h.id = #{id}
|
||||
</select>
|
||||
<select id="getHrmFamilyInfoByUser" resultType="com.engine.organization.entity.resume.po.HrmFamilyInfoPO">
|
||||
select *
|
||||
from HrmFamilyInfo
|
||||
where resourceid = #{resourceId}
|
||||
</select>
|
||||
|
||||
<sql id="likeSql">
|
||||
<if test="resourcePO.lastName != null and resourcePO.lastName != ''">
|
||||
|
|
|
|||
|
|
@ -18,6 +18,14 @@ public interface PersonnelResumeService {
|
|||
*/
|
||||
Map<String, Object> getSearchTree(SearchTreeParams params);
|
||||
|
||||
/**
|
||||
* 获取人员简历列表
|
||||
*
|
||||
* @param uId
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getResumeList(Integer uId);
|
||||
|
||||
/**
|
||||
* 获取列表页面按钮信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ import com.engine.organization.entity.hrmresource.bo.ResourceBO;
|
|||
import com.engine.organization.entity.hrmresource.po.ResourcePO;
|
||||
import com.engine.organization.entity.job.bo.JobBO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.resume.po.HrmFamilyInfoPO;
|
||||
import com.engine.organization.entity.resume.po.PersonnelResumeColumn;
|
||||
import com.engine.organization.entity.resume.po.PersonnelResumePO;
|
||||
import com.engine.organization.entity.resume.po.PersonnelResumeTable;
|
||||
import com.engine.organization.entity.searchtree.SearchTree;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.enums.ModuleTypeEnum;
|
||||
|
|
@ -19,6 +23,7 @@ import com.engine.organization.mapper.job.JobMapper;
|
|||
import com.engine.organization.mapper.resource.HrmResourceMapper;
|
||||
import com.engine.organization.service.PersonnelResumeService;
|
||||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.WordUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.engine.organization.util.detach.DetachUtil;
|
||||
|
|
@ -64,6 +69,77 @@ public class PersonnelResumeServiceImpl extends Service implements PersonnelResu
|
|||
return SearchTreeUtil.getSearchTree(type, treeList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getResumeList(Integer uId) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
// 根据ID查询用户信息
|
||||
PersonnelResumePO personnelResumePO = getHrmResourceMapper().getPersonnelResumeById(uId);
|
||||
OrganizationAssert.notNull(personnelResumePO, "未找到对应人员");
|
||||
resultMap.put("lastName", Util.null2String(personnelResumePO.getLastName()));
|
||||
resultMap.put("sex", Util.null2String(personnelResumePO.getSex()));
|
||||
resultMap.put("birthday", Util.null2String(personnelResumePO.getBirthday()));
|
||||
resultMap.put("image", Util.null2String(personnelResumePO.getImage()));
|
||||
resultMap.put("native", Util.null2String(personnelResumePO.getNativePlace()));
|
||||
resultMap.put("politics", Util.null2String(personnelResumePO.getPolitics()));
|
||||
resultMap.put("department", Util.null2String(personnelResumePO.getDepartment()));
|
||||
resultMap.put("marriage", Util.null2String(personnelResumePO.getMarriage()));
|
||||
resultMap.put("jobtitle", Util.null2String(personnelResumePO.getJobTitle()));
|
||||
resultMap.put("companystartdate", Util.null2String(personnelResumePO.getCompanyStartDate()));
|
||||
resultMap.put("workstartdate", Util.null2String(personnelResumePO.getWorkStartDate()));
|
||||
resultMap.put("idCard", Util.null2String(personnelResumePO.getIdCard()));
|
||||
resultMap.put("address", Util.null2String(personnelResumePO.getAddress()));
|
||||
resultMap.put("telephone", Util.null2String(personnelResumePO.getTelephone()));
|
||||
resultMap.put("email", Util.null2String(personnelResumePO.getEmail()));
|
||||
resultMap.put("selfStatement", "");
|
||||
|
||||
// 简历相关表格,待拓展
|
||||
List<PersonnelResumeTable> tables = new ArrayList<>();
|
||||
List<PersonnelResumeColumn> insurancesTitles = new ArrayList<>();
|
||||
List<PersonnelResumeColumn> familyInfoTitles = new ArrayList<>();
|
||||
|
||||
List<PersonnelResumeColumn> insuranceDatas = new ArrayList<>();
|
||||
insurancesTitles.add(PersonnelResumeColumn.builder().name("首次参保时间").colspans(2).rowspans(1).build());
|
||||
insurancesTitles.add(PersonnelResumeColumn.builder().name("养老保险").colspans(1).rowspans(1).build());
|
||||
insurancesTitles.add(PersonnelResumeColumn.builder().name("医疗保险").colspans(1).rowspans(1).build());
|
||||
insurancesTitles.add(PersonnelResumeColumn.builder().name("失业保险").colspans(1).rowspans(1).build());
|
||||
insurancesTitles.add(PersonnelResumeColumn.builder().name("住房公积金").colspans(1).rowspans(1).build());
|
||||
insurancesTitles.add(PersonnelResumeColumn.builder().name("企业年金").colspans(1).rowspans(1).build());
|
||||
|
||||
insuranceDatas.add(PersonnelResumeColumn.builder().value("2022-10-02").colspans(2).rowspans(1).build());
|
||||
insuranceDatas.add(PersonnelResumeColumn.builder().value("80").colspans(1).rowspans(1).build());
|
||||
insuranceDatas.add(PersonnelResumeColumn.builder().value("36").colspans(1).rowspans(1).build());
|
||||
insuranceDatas.add(PersonnelResumeColumn.builder().value("360").colspans(1).rowspans(1).build());
|
||||
insuranceDatas.add(PersonnelResumeColumn.builder().value("180").colspans(1).rowspans(1).build());
|
||||
insuranceDatas.add(PersonnelResumeColumn.builder().value("20000").colspans(1).rowspans(1).build());
|
||||
tables.add(PersonnelResumeTable.builder().title("二、社会保险及住房公积金缴纳情况(单位/元)").columns(insurancesTitles).datas(Collections.singletonList(insuranceDatas)).build());
|
||||
|
||||
// 家庭情况
|
||||
familyInfoTitles.add(PersonnelResumeColumn.builder().name("关系").colspans(1).rowspans(1).build());
|
||||
familyInfoTitles.add(PersonnelResumeColumn.builder().name("姓名").colspans(1).rowspans(1).build());
|
||||
familyInfoTitles.add(PersonnelResumeColumn.builder().name("工作单位").colspans(2).rowspans(1).build());
|
||||
familyInfoTitles.add(PersonnelResumeColumn.builder().name("职务").colspans(1).rowspans(1).build());
|
||||
familyInfoTitles.add(PersonnelResumeColumn.builder().name("住址").colspans(2).rowspans(1).build());
|
||||
|
||||
|
||||
List<HrmFamilyInfoPO> hrmFamilyInfoByUser = getHrmResourceMapper().getHrmFamilyInfoByUser(uId);
|
||||
List<List<PersonnelResumeColumn>> objects = new ArrayList<>();
|
||||
for (HrmFamilyInfoPO hrmFamilyInfoPO : hrmFamilyInfoByUser) {
|
||||
List<PersonnelResumeColumn> familyInfoDatas = new ArrayList<>();
|
||||
familyInfoDatas.add(PersonnelResumeColumn.builder().value(hrmFamilyInfoPO.getTitle()).colspans(1).rowspans(1).build());
|
||||
familyInfoDatas.add(PersonnelResumeColumn.builder().value(hrmFamilyInfoPO.getMember()).colspans(1).rowspans(1).build());
|
||||
familyInfoDatas.add(PersonnelResumeColumn.builder().value(hrmFamilyInfoPO.getCompany()).colspans(2).rowspans(1).build());
|
||||
familyInfoDatas.add(PersonnelResumeColumn.builder().value(hrmFamilyInfoPO.getJobTitle()).colspans(1).rowspans(1).build());
|
||||
familyInfoDatas.add(PersonnelResumeColumn.builder().value(hrmFamilyInfoPO.getAddress()).colspans(2).rowspans(1).build());
|
||||
objects.add(familyInfoDatas);
|
||||
}
|
||||
tables.add(PersonnelResumeTable.builder().title("三、家庭成员信息(包括父母、配偶、子女)").columns(familyInfoTitles).datas(objects).build());
|
||||
|
||||
|
||||
resultMap.put("tables", tables);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> hasRight() {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.PersonnelResumeWrapper;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -59,6 +60,21 @@ public class PersonnelResumeController {
|
|||
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getResumeList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getResumeList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
Integer uId = Integer.parseInt(Util.null2String(map.get("id")));
|
||||
return ReturnResult.successed(getPersonnelResumeWrapper(user).getResumeList(uId));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 左侧树接口
|
||||
*
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@ public class PersonnelResumeWrapper extends OrganizationWrapper {
|
|||
return getPersonnelResumeService(user).hasRight();
|
||||
}
|
||||
|
||||
public Map<String, Object> getResumeList(Integer uId) {
|
||||
return getPersonnelResumeService(user).getResumeList(uId);
|
||||
}
|
||||
|
||||
public Map<String, Object> downloadPerResume(SearchTreeParams params) {
|
||||
return getPersonnelResumeService(user).downloadPerResume(params);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue