人员标识调整
This commit is contained in:
parent
3eb5e5861c
commit
7c6d30421d
|
|
@ -28,7 +28,7 @@ public class EmployeeIdentifiedDAO {
|
|||
public List<Rybs> getAllList() {
|
||||
RecordSet rs = new RecordSet();
|
||||
ArrayList<Rybs> rybs = new ArrayList<>();
|
||||
String sql="select * from uf_rybs WHERE rz=0 or zz=0 or dd=0 or lz=0";
|
||||
String sql="select * from uf_rybs";
|
||||
rs.execute(sql);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
while (rs.next()){
|
||||
|
|
@ -77,4 +77,12 @@ public class EmployeeIdentifiedDAO {
|
|||
rs.execute(sql);
|
||||
}
|
||||
}
|
||||
|
||||
public void addInfo(ArrayList<Rybs> needAddInfo) {
|
||||
RecordSet rs = new RecordSet();
|
||||
for(Rybs rybs : needAddInfo){
|
||||
String sql = "update uf_RYBS set RZ= "+rybs.getRz() + " ,zz= " + rybs.getZz() +" ,dd= " +rybs.getDd() + " ,lz= " +rybs.getLz() + " ,JNJW = "+rybs.getJnjw() + " ,sxfx= "+rybs.getSxfx() + "where id =" + rybs.getId();
|
||||
rs.execute(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,8 @@ import com.engine.bjcj220907.service.EmployeeIdentifiedService;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.weaver.general.BaseBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -37,6 +35,10 @@ public class EmployeeIdentifiedServiceImpl extends Service implements EmployeeId
|
|||
// 获取所有含有入职、转正、调岗、离职信息的人员标识信息
|
||||
List<Rybs> list = getEmployeeIdentifiedDAO().getAllList();
|
||||
baseBean.writeLog("获取所有含有入职、转正、调岗、离职信息的人员标识信息,共:"+list.size());
|
||||
// 根据时间给入转调离赋值
|
||||
ArrayList<Rybs> needAddInfo = new ArrayList<>();
|
||||
addRybsInfo(list, needAddInfo, cal);
|
||||
getEmployeeIdentifiedDAO().addInfo(needAddInfo);
|
||||
// 获取更新入转调离信息
|
||||
List<Rybs> updateRybsInfo = getUpdateRybsInfo(list, cal);
|
||||
baseBean.writeLog("获取更新入转调离信息,共"+updateRybsInfo.size()+"条,:",updateRybsInfo);
|
||||
|
|
@ -51,6 +53,70 @@ public class EmployeeIdentifiedServiceImpl extends Service implements EmployeeId
|
|||
baseBean.writeLog("更新境内外信息");
|
||||
}
|
||||
|
||||
// 根据时间给入转调离赋值
|
||||
private void addRybsInfo(List<Rybs> list, List<Rybs> needAddInfo, Calendar cal) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date today = cal.getTime();
|
||||
String todayStr = sdf.format(today);
|
||||
list.stream().forEach(info -> {
|
||||
boolean flag = false;
|
||||
// 境内境外
|
||||
if(Objects.equals(info.getJnjw(), -1)){
|
||||
if(info.getKsczrq() != null && todayStr.equals(sdf.format(info.getKsczrq()))){
|
||||
info.setJnjw(EmployeeIdentifiedConstant.JW_EMPLOYEE);
|
||||
}else {
|
||||
info.setJnjw(EmployeeIdentifiedConstant.JN_EMPLOYEE);
|
||||
}
|
||||
flag =true;
|
||||
}
|
||||
|
||||
// 入职
|
||||
if(Objects.equals(info.getRz(), -1) ){
|
||||
if(info.getRzrq() != null){
|
||||
if( todayStr.equals(sdf.format(info.getRzrq())) || today.after(info.getRzrq())){
|
||||
info.setRz(0);
|
||||
// 下发薪
|
||||
info.setSxfx(1);
|
||||
flag =true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 转正
|
||||
if(Objects.equals(info.getZz(), -1) ){
|
||||
if(info.getZzrq() != null){
|
||||
if( todayStr.equals(sdf.format(info.getZzrq())) || today.after(info.getZzrq())){
|
||||
info.setZz(0);
|
||||
// 上发薪
|
||||
info.setSxfx(0);
|
||||
flag =true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 调动
|
||||
if(Objects.equals(info.getDd(), -1) ){
|
||||
if(info.getDdrq() != null){
|
||||
if( todayStr.equals(sdf.format(info.getDdrq())) || today.after(info.getDdrq())){
|
||||
info.setDd(0);
|
||||
flag =true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 离职
|
||||
if(Objects.equals(info.getLz(), -1) ){
|
||||
if(info.getLzrq() != null){
|
||||
if( todayStr.equals(sdf.format(info.getLzrq())) || today.after(info.getLzrq())){
|
||||
info.setLz(0);
|
||||
flag =true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(flag == true){
|
||||
needAddInfo.add(info);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 获取更新人员入转调离标识信息
|
||||
|
|
@ -143,7 +209,7 @@ public class EmployeeIdentifiedServiceImpl extends Service implements EmployeeId
|
|||
}
|
||||
}
|
||||
}else {
|
||||
// 有开始常驻日期,判断是否在常驻期内
|
||||
// 有结束常驻日期,判断是否在常驻期内
|
||||
boolean inRange = isInRange(cal.getTime(), ksczrq, jsczrq);
|
||||
if(inRange){
|
||||
// 在常驻期内
|
||||
|
|
|
|||
Loading…
Reference in New Issue