武汉联特科技有限公司
parent
8fbf36fc8b
commit
fd45118dd7
@ -0,0 +1,26 @@
|
||||
## \u7B2C\u4E00\u5B66\u5386
|
||||
firstDegree=field29
|
||||
|
||||
## \u7B2C\u4E00\u5B66\u5386\u4E13\u4E1A
|
||||
firstDegreeMajor=field30
|
||||
|
||||
## \u6700\u9AD8\u5B66\u5386
|
||||
highestDegree=field31
|
||||
|
||||
## \u6700\u9AD8\u5B66\u5386\u4E13\u4E1A
|
||||
highestDegreeMajor=field32
|
||||
|
||||
## \u5E74\u9F84
|
||||
age=field33
|
||||
|
||||
## \u6700\u8FD1\u4E00\u4EFD\u5DE5\u4F5C\u5355\u4F4D\u540D\u79F0
|
||||
lastWorkunitName=field34
|
||||
|
||||
## \u6700\u8FD1\u4E00\u4EFD\u5DE5\u4F5C\u5C97\u4F4D
|
||||
lastJobName=field35
|
||||
|
||||
## \u4E2A\u4EBA\u4FE1\u606F
|
||||
scopeid=1
|
||||
|
||||
## \u6D88\u606F\u63D0\u9192ID
|
||||
messageRemindId=1186
|
@ -1,14 +0,0 @@
|
||||
package com.api.seclinktel.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/4 2:19 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Path("/seclinktel/resourceinfo")
|
||||
public class ResourceOtherInfoAction extends com.engine.seclinktel.web.ResourceOtherInfoAction {
|
||||
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
package com.engine.seclinktel.entity.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/4 2:32 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ResourceOtherInfoPo {
|
||||
|
||||
private Integer id;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package com.engine.seclinktel.service;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/4 2:22 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ResourceOtherInfoService {
|
||||
|
||||
int syncResourceInfo();
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.engine.seclinktel.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.seclinktel.service.ResourceOtherInfoService;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/4 2:22 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class ResourceOtherInfoServiceImpl extends Service implements ResourceOtherInfoService {
|
||||
@Override
|
||||
public int syncResourceInfo() {
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
package com.engine.seclinktel.web;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.seclinktel.service.ResourceOtherInfoService;
|
||||
import com.engine.seclinktel.service.impl.ResourceOtherInfoServiceImpl;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/4 2:21 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class ResourceOtherInfoAction {
|
||||
|
||||
private ResourceOtherInfoService getService(User user) {
|
||||
return ServiceUtil.getService(ResourceOtherInfoServiceImpl.class,user);
|
||||
}
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/sync")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String syncResourceInfo(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||
Map<String, Object> data = new HashMap<>(8);
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
data.put("datas",getService(user).syncResourceInfo());
|
||||
data.put("api_status", true);
|
||||
} catch (Exception e) {
|
||||
data.put("api_status", false);
|
||||
data.put("msg", "catch exception : " + e.getMessage());
|
||||
}
|
||||
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package weaver.interfaces.seclinktel.crob;
|
||||
|
||||
import com.weaver.general.Util;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.interfaces.schedule.BaseCronJob;
|
||||
import weaver.interfaces.seclinktel.entity.po.EducationModePo;
|
||||
import weaver.interfaces.seclinktel.entity.po.WorkInfoModePo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.function.BinaryOperator;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/5 4:10 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class ResourcePersonInfoCron extends BaseCronJob {
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
//1.工作经历
|
||||
List<WorkInfoModePo> workInfos = new ArrayList<>();
|
||||
rs.executeQuery("select xm,qgslzsj,gsmc,zw1 from uf_gzjl");
|
||||
while (rs.next()) {
|
||||
Integer userId = Util.getIntValue(rs.getString("xm"));
|
||||
String lastCompanyLeaveDate = Util.null2String(rs.getString("qgslzsj"));
|
||||
String lastWorkunitName = Util.null2String(rs.getString("gsmc"));
|
||||
String lastJobName = Util.null2String(rs.getString("zw1"));
|
||||
workInfos.add(WorkInfoModePo.builder().userId(userId).lastCompanyLeaveDate(lastCompanyLeaveDate).lastWorkunitName(lastWorkunitName).lastJobName(lastJobName).build());
|
||||
}
|
||||
|
||||
List<WorkInfoModePo> workResult = new ArrayList<>(workInfos.stream()
|
||||
.filter(workInfo -> workInfo.getLastCompanyLeaveDate() != null)
|
||||
.collect(Collectors.toMap(
|
||||
WorkInfoModePo::getUserId,
|
||||
Function.identity(),
|
||||
BinaryOperator.maxBy(Comparator.comparing(WorkInfoModePo::getLastCompanyLeaveDate))))
|
||||
.values());
|
||||
|
||||
//2.教育经历第一学历
|
||||
|
||||
List<EducationModePo> educationFirst = new ArrayList<>();
|
||||
rs.executeQuery("select xm,xl,zy from uf_jxjl where sfwdyxl = 0");
|
||||
while (rs.next()) {
|
||||
Integer userId = Util.getIntValue(rs.getString("xm"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//2.教育经历最高学历
|
||||
List<EducationModePo> educationHighest = new ArrayList<>();
|
||||
rs.executeQuery("select xm,xl,zy from uf_jxjl where sfwzgxl = 0");
|
||||
while (rs.next()) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package weaver.interfaces.seclinktel.entity.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/5 5:39 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EducationModePo {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer userId;
|
||||
|
||||
private String firstDegree;
|
||||
|
||||
private String firstDegreeMajor;
|
||||
|
||||
private String highestDegree;
|
||||
|
||||
private String highestDegreeMajor;
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package weaver.interfaces.seclinktel.entity.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/4 2:32 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ResourceOtherInfoPo {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String birthday;
|
||||
|
||||
private String firstDegree;
|
||||
|
||||
private String firstDegreeMajor;
|
||||
|
||||
private String highestDegree;
|
||||
|
||||
private String highestDegreeMajor;
|
||||
|
||||
private Integer age;
|
||||
|
||||
private String lastWorkunitName;
|
||||
|
||||
private String lastJobName;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package weaver.interfaces.seclinktel.entity.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/5 4:53 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WorkInfoModePo {
|
||||
|
||||
private Integer userId;
|
||||
|
||||
private String lastCompanyLeaveDate;
|
||||
|
||||
private String lastWorkunitName;
|
||||
|
||||
private String lastJobName;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package weaver.interfaces.seclinktel.util;
|
||||
|
||||
import com.weaver.general.Util;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.interfaces.seclinktel.entity.po.ResourceOtherInfoPo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.Period;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/4 3:44 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class DutyUtils {
|
||||
|
||||
public static List<ResourceOtherInfoPo> getHrmResource(){
|
||||
List<ResourceOtherInfoPo> infoPoList = new ArrayList<>();
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id,birthday from hrmresource");
|
||||
while (rs.next()) {
|
||||
|
||||
Integer id = Util.getIntValue(rs.getString("id"));
|
||||
String birthday = Util.null2String(rs.getString("birthday"));
|
||||
if (StringUtils.isNotBlank(birthday)) {
|
||||
infoPoList.add(ResourceOtherInfoPo.builder().id(id).birthday(birthday).build());
|
||||
}
|
||||
}
|
||||
return infoPoList;
|
||||
}
|
||||
|
||||
public static Integer getAge(String birthday) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
// 解析生日字符串为 LocalDate 对象
|
||||
LocalDate birthDate = LocalDate.parse(birthday, formatter);
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
return Period.between(birthDate, currentDate).getYears();
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue