|
|
@ -14,13 +14,16 @@
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String id = Util.null2String(request.getParameter("id"));
|
|
|
|
String id = Util.null2String(request.getParameter("id"));
|
|
|
|
String currentDate = Util.null2String(request.getParameter("date"));
|
|
|
|
String currentDate = Util.null2String(request.getParameter("date"));
|
|
|
|
if (StringUtils.isBlank(id) || StringUtils.isBlank(currentDate)) {
|
|
|
|
if (StringUtils.isBlank(currentDate)) {
|
|
|
|
throw new RuntimeException("id or date is null");
|
|
|
|
throw new RuntimeException("date is null");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rs.writeLog("EmployeeTransferJob---start");
|
|
|
|
rs.writeLog("EmployeeTransferJob---start");
|
|
|
|
//String currentDate = DateUtil.getCurrentDate();
|
|
|
|
|
|
|
|
// 查询归档流程,明细表中,调用生效日期为当前日期的数据
|
|
|
|
// 查询归档流程,明细表中,调用生效日期为当前日期的数据
|
|
|
|
rs.executeQuery("select * from uf_ygddxx where ydsxrq = ? and id = ?", currentDate, id);
|
|
|
|
if(StringUtils.isNotBlank(id)){
|
|
|
|
|
|
|
|
rs.executeQuery("select * from uf_ygddxx where ydsxrq = ? and id = ?", currentDate, id);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
rs.executeQuery("select * from uf_ygddxx where ydsxrq = ? ", currentDate);
|
|
|
|
|
|
|
|
}
|
|
|
|
while (rs.next()) {
|
|
|
|
while (rs.next()) {
|
|
|
|
RecordSet rst = new RecordSet();
|
|
|
|
RecordSet rst = new RecordSet();
|
|
|
|
// 调动人
|
|
|
|
// 调动人
|
|
|
@ -209,12 +212,15 @@
|
|
|
|
// 更新“调动人”的【考勤组】为:新考勤组;
|
|
|
|
// 更新“调动人”的【考勤组】为:新考勤组;
|
|
|
|
// 更新“调动人”的新考勤组中的“生效日期”=调动生效日期;
|
|
|
|
// 更新“调动人”的新考勤组中的“生效日期”=调动生效日期;
|
|
|
|
// 更新“调动人”的原考勤组中的“失效日期”=调动生效日期 - 1天;
|
|
|
|
// 更新“调动人”的原考勤组中的“失效日期”=调动生效日期 - 1天;
|
|
|
|
String sql = "insert into kq_groupmember(groupid,typevalue,type,seclevel,seclevelto,validatefrom,validateto) values(?,?,1,0,100,?,'2999-12-31')";
|
|
|
|
String sql = "select * from kq_groupmember where type = 1 and ISNULL(isDelete,0) != 1 and typevalue = ? and groupid = ? ";
|
|
|
|
rst.executeUpdate(sql, xkqz, ddr, ddsxrq);
|
|
|
|
rst.executeQuery(sql, ddr, xkqz);
|
|
|
|
// 如果生效日期小于失效日期,将生效日期也改为失效日期
|
|
|
|
// 查询新考勤组是否有数据,如果数据则更新,没有则插入一条数据
|
|
|
|
rst.executeQuery("select * from kq_groupmember where type = 1 and ISNULL(isDelete,0) != 1 and typevalue = ? and groupid = ?", ddr, kqGroupId);
|
|
|
|
|
|
|
|
if(rst.next()){
|
|
|
|
if(rst.next()){
|
|
|
|
String validatefrom = rst.getString("validatefrom");
|
|
|
|
sql = "update kq_groupmember set validatefrom = ? ,validateto = ? where type = 1 and ISNULL(isDelete,0) != 1 and typevalue = ? and groupid = ?";
|
|
|
|
|
|
|
|
rst.executeUpdate(sql, ddsxrq, "2999-12-31", ddr, xkqz);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
sql = "insert into kq_groupmember(groupid,typevalue,type,seclevel,seclevelto,validatefrom,validateto) values(?,?,1,0,100,?,'2999-12-31')";
|
|
|
|
|
|
|
|
rst.executeUpdate(sql, xkqz, ddr, ddsxrq);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sql = "update kq_groupmember set validateto = ? where type = 1 and ISNULL(isDelete,0) != 1 and typevalue = ? and groupid = ?";
|
|
|
|
sql = "update kq_groupmember set validateto = ? where type = 1 and ISNULL(isDelete,0) != 1 and typevalue = ? and groupid = ?";
|
|
|
|