|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alipay.api.domain.RecordDetail;
|
|
|
|
import com.alipay.api.domain.RecordDetail;
|
|
|
|
import com.engine.kq.biz.KQFormatBiz;
|
|
|
|
import com.engine.kq.biz.KQFormatBiz;
|
|
|
|
|
|
|
|
import com.engine.kq.biz.KQLeaveRulesBiz;
|
|
|
|
import com.engine.kq.biz.KQLeaveRulesComInfo;
|
|
|
|
import com.engine.kq.biz.KQLeaveRulesComInfo;
|
|
|
|
import com.engine.kq.timer.KQQueue;
|
|
|
|
import com.engine.kq.timer.KQQueue;
|
|
|
|
import com.engine.kq.timer.KQTaskBean;
|
|
|
|
import com.engine.kq.timer.KQTaskBean;
|
|
|
@ -47,7 +48,13 @@ public class DeductTrainTimesJob extends BaseCronJob {
|
|
|
|
bb.writeLog("-----DeductTrainTimesJob start-----");
|
|
|
|
bb.writeLog("-----DeductTrainTimesJob start-----");
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
|
|
|
RecordSet rs2 = new RecordSet();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取事假类型
|
|
|
|
|
|
|
|
String calLeaveTypeId = bb.getPropValue("project_sskj", "calLeaveId");
|
|
|
|
|
|
|
|
//获取事假单位规则
|
|
|
|
|
|
|
|
KQLeaveRulesComInfo kqLeaveRulesComInfo = new KQLeaveRulesComInfo();
|
|
|
|
|
|
|
|
String minimumUnit = kqLeaveRulesComInfo.getMinimumUnit(calLeaveTypeId);
|
|
|
|
//获取当前年月日
|
|
|
|
//获取当前年月日
|
|
|
|
String nowDay = DateUtil.format(new Date(),"yyyy-MM-dd");
|
|
|
|
String nowDay = DateUtil.format(new Date(),"yyyy-MM-dd");
|
|
|
|
String firstDayOfMonth = DateUtil.format(DateUtil.beginOfMonth(new Date()),"yyyy-MM-dd");
|
|
|
|
String firstDayOfMonth = DateUtil.format(DateUtil.beginOfMonth(new Date()),"yyyy-MM-dd");
|
|
|
@ -55,10 +62,12 @@ public class DeductTrainTimesJob extends BaseCronJob {
|
|
|
|
Map<String, Object> trainInfo = new HashMap<>();
|
|
|
|
Map<String, Object> trainInfo = new HashMap<>();
|
|
|
|
List< Map<String, Object>> trainInfos = new ArrayList<>();
|
|
|
|
List< Map<String, Object>> trainInfos = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
String acqTrainInfoSql = "select a.pxsj, a.kssj1, a.jssj1, b.xm, b.id " +
|
|
|
|
String acqTrainInfoSql = "select a.pxsj, a.kssj1, a.jssj1, a.ksh, b.xm, b.id, c.departmentid, c.subcompanyid1, c.jobtitle " +
|
|
|
|
" from uf_pxjl a " +
|
|
|
|
" from uf_pxjl a " +
|
|
|
|
" left join uf_pxjl_dt1 b " +
|
|
|
|
" left join uf_pxjl_dt1 b " +
|
|
|
|
" on b.mainid = a.id " +
|
|
|
|
" on b.mainid = a.id " +
|
|
|
|
|
|
|
|
" left join hrmresource c " +
|
|
|
|
|
|
|
|
" on c.id = b.xm " +
|
|
|
|
" where (b.isdeduct is null or b.isdeduct = 0) and b.xm is not null " +
|
|
|
|
" where (b.isdeduct is null or b.isdeduct = 0) and b.xm is not null " +
|
|
|
|
" and a.pxsj is not null and a.kssj1 is not null and a.jssj1 is not null " +
|
|
|
|
" and a.pxsj is not null and a.kssj1 is not null and a.jssj1 is not null " +
|
|
|
|
" and a.pxsj >='" + firstDayOfMonth + "' and a.pxsj <='" + nowDay + "' ";
|
|
|
|
" and a.pxsj >='" + firstDayOfMonth + "' and a.pxsj <='" + nowDay + "' ";
|
|
|
@ -71,19 +80,25 @@ public class DeductTrainTimesJob extends BaseCronJob {
|
|
|
|
String jssj = Util.null2String(rs.getString("jssj1"));
|
|
|
|
String jssj = Util.null2String(rs.getString("jssj1"));
|
|
|
|
String xm = Util.null2String(rs.getString("xm"));
|
|
|
|
String xm = Util.null2String(rs.getString("xm"));
|
|
|
|
String detailId = Util.null2String(rs.getString("id"));
|
|
|
|
String detailId = Util.null2String(rs.getString("id"));
|
|
|
|
|
|
|
|
String ksh = Util.null2String(rs.getString("ksh"));
|
|
|
|
|
|
|
|
String departmentid = Util.null2String(rs.getString("departmentid"));
|
|
|
|
|
|
|
|
String subcompanyid = Util.null2String(rs.getString("subcompanyid1"));
|
|
|
|
|
|
|
|
String jobtitle = Util.null2String(rs.getString("jobtitle"));
|
|
|
|
trainInfo.put("detailId",detailId);
|
|
|
|
trainInfo.put("detailId",detailId);
|
|
|
|
trainInfo.put("pxsj",pxsj);
|
|
|
|
trainInfo.put("pxsj",pxsj);
|
|
|
|
trainInfo.put("kssj",kssj);
|
|
|
|
trainInfo.put("kssj",kssj);
|
|
|
|
trainInfo.put("jssj",jssj);
|
|
|
|
trainInfo.put("jssj",jssj);
|
|
|
|
trainInfo.put("xm",xm);
|
|
|
|
trainInfo.put("xm",xm);
|
|
|
|
|
|
|
|
trainInfo.put("ksh",ksh);
|
|
|
|
|
|
|
|
trainInfo.put("departmentid",departmentid);
|
|
|
|
|
|
|
|
trainInfo.put("subcompanyid",subcompanyid);
|
|
|
|
|
|
|
|
trainInfo.put("jobtitle",jobtitle);
|
|
|
|
trainInfos.add(trainInfo);
|
|
|
|
trainInfos.add(trainInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( trainInfos.size() > 0) {
|
|
|
|
if ( trainInfos.size() > 0) {
|
|
|
|
List deduIdList = new ArrayList<>();//记录满足减去培训时长的加班数据
|
|
|
|
|
|
|
|
Map< String, Object > deduTiaoxiuMap = new HashMap<>();//记录调休扣减的数据
|
|
|
|
String modTrainStatusSql = "update uf_pxjl_dt1 set isdeduct = ? where id = ?";
|
|
|
|
Map< String, Integer > overtimeTiaoxiuMap = new HashMap<>();//记录加班和调休id
|
|
|
|
|
|
|
|
List< List > deduOvertimeList = new ArrayList<>();//批量修改加班时长的数据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for ( Map<String, Object> train: trainInfos) {
|
|
|
|
for ( Map<String, Object> train: trainInfos) {
|
|
|
|
String detailId = Util.null2String(train.get("detailId"));
|
|
|
|
String detailId = Util.null2String(train.get("detailId"));
|
|
|
@ -91,196 +106,79 @@ public class DeductTrainTimesJob extends BaseCronJob {
|
|
|
|
String kssj = Util.null2String(train.get("kssj"));
|
|
|
|
String kssj = Util.null2String(train.get("kssj"));
|
|
|
|
String jssj = Util.null2String(train.get("jssj"));
|
|
|
|
String jssj = Util.null2String(train.get("jssj"));
|
|
|
|
String xm = Util.null2String(train.get("xm"));
|
|
|
|
String xm = Util.null2String(train.get("xm"));
|
|
|
|
String acqOverTimeSql = "select id, duration_min, tiaoxiuid from kq_flow_overtime where resourceid = ? and belongdate = ? " +
|
|
|
|
String departmentid = Util.null2String(train.get("departmentid"));
|
|
|
|
"and fromtimedb <='" + kssj + "' and totimedb >='" + jssj + "' ";
|
|
|
|
String subcompanyid = Util.null2String(train.get("subcompanyid"));
|
|
|
|
rs.executeQuery(acqOverTimeSql, xm, pxsj);
|
|
|
|
String jobtitle = Util.null2String(train.get("jobtitle"));
|
|
|
|
while ( rs.next()) {
|
|
|
|
double ksh = Util.getDoubleValue(Util.null2String(train.get("ksh")));
|
|
|
|
Integer id = Util.getIntValue(Util.null2String(rs.getString("id")));
|
|
|
|
//查找加班记录
|
|
|
|
Integer durationMin = Util.getIntValue(Util.null2String(rs.getString("duration_min")));
|
|
|
|
SskjUtil sskjUtil = new SskjUtil();
|
|
|
|
String tiaoxiuid = Util.null2String(rs.getString("tiaoxiuid"));
|
|
|
|
String tableName = sskjUtil.getTableName(xm, pxsj);
|
|
|
|
//加班时长减去培训时长
|
|
|
|
if (StringUtils.isNotBlank(tableName)) {
|
|
|
|
long minutesDifference = 0;
|
|
|
|
String acqOverTimeSql = "select count(*) as number from " + tableName + " where jbry = ? and belongdate = ? and kssj <='" + kssj + "' " +
|
|
|
|
if ( durationMin> 0 ) {
|
|
|
|
" and jssj >='" + jssj + "' ";
|
|
|
|
List deduId = new ArrayList();
|
|
|
|
String[] split = tableName.split("_dt");
|
|
|
|
deduId.add(detailId);
|
|
|
|
String addTraNa = "";
|
|
|
|
deduIdList.add(deduId);
|
|
|
|
String addLeaNa = "";
|
|
|
|
LocalTime timeStart = LocalTime.parse(pxsj +" " + kssj);
|
|
|
|
String addOverNa = "";
|
|
|
|
LocalTime timeEnd = LocalTime.parse(pxsj +" " + jssj);
|
|
|
|
if (split.length > 0) {
|
|
|
|
|
|
|
|
addTraNa = split[0] + "_dt5";
|
|
|
|
minutesDifference = ChronoUnit.MINUTES.between(timeStart, timeEnd);
|
|
|
|
addLeaNa = split[0] + "_dt6";
|
|
|
|
|
|
|
|
addOverNa = split[0];
|
|
|
|
durationMin = durationMin - ((int) minutesDifference);
|
|
|
|
}
|
|
|
|
if ( durationMin < 0) {
|
|
|
|
String addTrainSql = "insert into " + addTraNa + " (pxry, pxrq, kssj, jssj, pxsc) values (?,?,?,?,?)";
|
|
|
|
durationMin = 0;
|
|
|
|
String addLeaSql = "insert into " + addLeaNa + " (qjry, qjlx, qjrq, kssj, jssj, sfdk, qjbid, qjsc) values (?,?,?,?,?,?,?,?)";
|
|
|
|
}
|
|
|
|
String acqOverSql = "select jbzsy from " + addOverNa + " where xm = ? and ny = ? ";
|
|
|
|
}
|
|
|
|
String addCaslLeaSql = "insert into kq_flow_split_leave (resourceid, fromdate, fromtime, todate, totime, newleavetype, " +
|
|
|
|
List deduOvertime = new ArrayList<>();
|
|
|
|
" duration, durationrule, fromdatedb, fromtimedb, todatedb, totimedb, durationdb, belongdate, subcompanyid, " +
|
|
|
|
deduOvertime.add(durationMin);
|
|
|
|
" departmentid, jobtitle, changetype, casleaveuuid ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
|
|
|
deduOvertime.add(id);
|
|
|
|
String acqCasLeaveSql = "select id from kq_flow_split_leave where casleaveuuid = ?";
|
|
|
|
deduOvertimeList.add(deduOvertime);
|
|
|
|
String modTrainSql = "update " + addOverNa + " set pxzsc = (select sum(pxsc) from " + addTraNa + " as dt_table where " +
|
|
|
|
|
|
|
|
" dt_table.mainid = " + addOverNa + ".id ) where xm = ? and ny = ? ";
|
|
|
|
//记录调休id
|
|
|
|
String modOverSql = "update " + addOverNa + " set jbzsy = (psjbsy + zmjbsy + jrjbsy - pxzsc) where xm = ? and ny = ? ";
|
|
|
|
if (StringUtils.isNotBlank(tiaoxiuid)) {
|
|
|
|
|
|
|
|
deduTiaoxiuMap.put(tiaoxiuid,minutesDifference);
|
|
|
|
|
|
|
|
//记录加班和调休id
|
|
|
|
|
|
|
|
overtimeTiaoxiuMap.put(tiaoxiuid,id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//先扣除掉加班的时长
|
|
|
|
|
|
|
|
String subOverTimeSql = "update kq_flow_overtime set duration_min = ? where id = ?";
|
|
|
|
|
|
|
|
boolean subOverTimeSqlFlag = rs.executeBatchSql(subOverTimeSql, deduOvertimeList);
|
|
|
|
|
|
|
|
bb.writeLog("subOverTimeSqlFlag: " + subOverTimeSqlFlag);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//再回写培训台账
|
|
|
|
|
|
|
|
String syncTrainSql = "update uf_pxjl set isdeduct = 1 where id = ? ";
|
|
|
|
|
|
|
|
boolean syncTrainSqlFlag = rs.executeBatchSql(syncTrainSql, deduIdList);
|
|
|
|
|
|
|
|
bb.writeLog("syncTrainSqlFlag: " + syncTrainSqlFlag);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//处理调休时长
|
|
|
|
|
|
|
|
String tiaoxiuLeaveId = Util.null2String(bb.getPropValue("project_sskj","tiaoxiuleaveid"));
|
|
|
|
|
|
|
|
String casualLeaveId = Util.null2String(bb.getPropValue("project_sskj","casualleaveid"));
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(tiaoxiuLeaveId) && StringUtils.isNotBlank(casualLeaveId) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String overtimeSubTrainModeId = bb.getPropValue("project_sskj", "overtimeSubTrainModeId");
|
|
|
|
|
|
|
|
Integer modedatacreater = 1;
|
|
|
|
|
|
|
|
Integer modedatacreatertype = 0;
|
|
|
|
|
|
|
|
String modedatacreatedate = DateUtil.format(new Date(), "yyyy-MM-dd");
|
|
|
|
|
|
|
|
String modedatacreatetime = DateUtil.format(new Date(), "HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取在职员工的信息
|
|
|
|
|
|
|
|
Map<String, List<String>> resInfos = new HashMap<>();
|
|
|
|
|
|
|
|
String acqResSql = "select id, subcompanyid1, departmentid, jobtitle from hrmresource where status in (0,1,2,3)";
|
|
|
|
|
|
|
|
rs.executeQuery(acqResSql);
|
|
|
|
|
|
|
|
while ( rs.next()) {
|
|
|
|
|
|
|
|
String id = Util.null2String(rs.getString("id"));
|
|
|
|
|
|
|
|
String subcompanyid = Util.null2String(rs.getString("subcompanyid1"));
|
|
|
|
|
|
|
|
String departmentid = Util.null2String(rs.getString("departmentid"));
|
|
|
|
|
|
|
|
String jobtitle = Util.null2String(rs.getString("jobtitle"));
|
|
|
|
|
|
|
|
List<String> infos = new ArrayList<>();
|
|
|
|
|
|
|
|
infos.add(subcompanyid);
|
|
|
|
|
|
|
|
infos.add(departmentid);
|
|
|
|
|
|
|
|
infos.add(jobtitle);
|
|
|
|
|
|
|
|
resInfos.put(id, infos);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取事假最小请假单位
|
|
|
|
|
|
|
|
String minimumUnit = new KQLeaveRulesComInfo().getMinimumUnit(casualLeaveId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//调休时长扣减
|
|
|
|
|
|
|
|
List<List> tiaoxiuSubList = new ArrayList<>();
|
|
|
|
|
|
|
|
//转事假
|
|
|
|
|
|
|
|
List<List> casualLeaveList = new ArrayList<>();
|
|
|
|
|
|
|
|
//变动记录
|
|
|
|
|
|
|
|
List<List> changeLogList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String leaveDetailIds = deduTiaoxiuMap.keySet().stream()
|
|
|
|
|
|
|
|
.map(Object::toString)
|
|
|
|
|
|
|
|
.collect(Collectors.joining(","));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String acqTiaoxiuSql = "select id, tiaoxiuamount, usedAmount, resourceId from kq_balanceofleave where id in (" + leaveDetailIds + ")";
|
|
|
|
rs.executeQuery(acqOverTimeSql, xm, pxsj);
|
|
|
|
rs.executeQuery(acqTiaoxiuSql);
|
|
|
|
|
|
|
|
while (rs.next()) {
|
|
|
|
while (rs.next()) {
|
|
|
|
double tiaoxiuAmount = Util.getDoubleValue(Util.null2String(rs.getString("tiaoxiuamount")));
|
|
|
|
int number = Util.getIntValue(Util.null2String(rs.getString("number")));
|
|
|
|
double usedAmount = Util.getDoubleValue(Util.null2String(rs.getString("usedAmount")));
|
|
|
|
if (number > 0) {
|
|
|
|
int resourceId = Util.getIntValue(Util.null2String(rs.getString("resourceId")));
|
|
|
|
//插入一条培训记录
|
|
|
|
int id = Util.getIntValue(Util.null2String(rs.getString("id")));//调休表id
|
|
|
|
boolean b = rs2.executeUpdate(addTrainSql, xm, pxsj, kssj, jssj, ksh);
|
|
|
|
double duration = Util.getDoubleValue(Util.null2String(deduTiaoxiuMap.get(id)));
|
|
|
|
//重新计算主表培训总时长
|
|
|
|
if ( (tiaoxiuAmount - usedAmount - duration) >=0 ) {//调休
|
|
|
|
if (b) {
|
|
|
|
List tiaoxiuSub = new ArrayList();
|
|
|
|
boolean b1 = rs2.executeUpdate(modTrainSql, xm, pxsj.substring(0, 7));
|
|
|
|
tiaoxiuSub.add(tiaoxiuAmount - duration);
|
|
|
|
bb.writeLog("重新计算主表培训总时长: " + b1);
|
|
|
|
tiaoxiuSub.add(id);
|
|
|
|
if (b1) {
|
|
|
|
tiaoxiuSubList.add(tiaoxiuSub);
|
|
|
|
//重新计算主表加班总剩余时长
|
|
|
|
List changeLog = new ArrayList();
|
|
|
|
boolean b2 = rs2.executeUpdate(modOverSql, xm, pxsj.substring(0, 7));
|
|
|
|
changeLog.add(resourceId);
|
|
|
|
bb.writeLog("重新计算主表加班总剩余时长: " + b2);
|
|
|
|
Integer overtimeId = overtimeTiaoxiuMap.get(String.valueOf(id));
|
|
|
|
}
|
|
|
|
changeLog.add(overtimeId);
|
|
|
|
}
|
|
|
|
changeLog.add(id);
|
|
|
|
}
|
|
|
|
changeLog.add(duration);
|
|
|
|
}
|
|
|
|
changeLog.add(tiaoxiuAmount);
|
|
|
|
//根据目前加班剩余时长来判断是否需要插入一条事假的数据
|
|
|
|
changeLog.add(tiaoxiuAmount - duration);
|
|
|
|
rs2.executeQuery(acqOverSql, xm, pxsj.substring(0, 7));
|
|
|
|
changeLog.add(tiaoxiuLeaveId);
|
|
|
|
while (rs2.next()) {
|
|
|
|
changeLogList.add(changeLog);
|
|
|
|
double jbzsy = Util.getDoubleValue(Util.null2String(rs.getString("jbzsy")));
|
|
|
|
} else {//事假
|
|
|
|
double temp = ksh - jbzsy;
|
|
|
|
List casualLeave = new ArrayList();
|
|
|
|
if (temp > 0) {
|
|
|
|
casualLeave.add(resourceId);//resourceid
|
|
|
|
Integer casleaveId = -1;
|
|
|
|
casualLeave.add(resourceId);//fromdate
|
|
|
|
//生成一条事假数据
|
|
|
|
casualLeave.add(resourceId);//fromtime
|
|
|
|
|
|
|
|
casualLeave.add(resourceId);//todate
|
|
|
|
|
|
|
|
casualLeave.add(resourceId);//totime
|
|
|
|
|
|
|
|
casualLeave.add(casualLeaveId);//newleavetype
|
|
|
|
|
|
|
|
casualLeave.add(duration);//duration
|
|
|
|
|
|
|
|
casualLeave.add(minimumUnit);//durationrule
|
|
|
|
|
|
|
|
casualLeave.add(resourceId);//fromdatedb
|
|
|
|
|
|
|
|
casualLeave.add(resourceId);//fromtimedb
|
|
|
|
|
|
|
|
casualLeave.add(resourceId);//todatedb
|
|
|
|
|
|
|
|
casualLeave.add(resourceId);//totimedb
|
|
|
|
|
|
|
|
casualLeave.add(duration);//durationdb
|
|
|
|
|
|
|
|
casualLeave.add(resourceId);//belongdate
|
|
|
|
|
|
|
|
List<String> infos = resInfos.get(resourceId);
|
|
|
|
|
|
|
|
String subcompanyid = infos.get(0);
|
|
|
|
|
|
|
|
String departmentid = infos.get(1);
|
|
|
|
|
|
|
|
String jobtitle = infos.get(2);
|
|
|
|
|
|
|
|
casualLeave.add(subcompanyid);//subcompanyid
|
|
|
|
|
|
|
|
casualLeave.add(departmentid);//departmentid
|
|
|
|
|
|
|
|
casualLeave.add(jobtitle);//jobtitle
|
|
|
|
|
|
|
|
casualLeave.add(resourceId);//changetype
|
|
|
|
|
|
|
|
casualLeaveList.add(casualLeave);
|
|
|
|
|
|
|
|
List changeLog = new ArrayList();
|
|
|
|
|
|
|
|
changeLog.add(resourceId);
|
|
|
|
|
|
|
|
Integer overtimeId = overtimeTiaoxiuMap.get(String.valueOf(id));
|
|
|
|
|
|
|
|
changeLog.add(overtimeId);
|
|
|
|
|
|
|
|
changeLog.add("0");
|
|
|
|
|
|
|
|
changeLog.add(duration);
|
|
|
|
|
|
|
|
changeLog.add("0.0000");
|
|
|
|
|
|
|
|
changeLog.add(duration);
|
|
|
|
|
|
|
|
changeLog.add(casualLeaveId);
|
|
|
|
|
|
|
|
changeLog.add(overtimeSubTrainModeId);
|
|
|
|
|
|
|
|
changeLog.add(modedatacreater);
|
|
|
|
|
|
|
|
changeLog.add(modedatacreatertype);
|
|
|
|
|
|
|
|
changeLog.add(modedatacreatedate);
|
|
|
|
|
|
|
|
changeLog.add(modedatacreatetime);
|
|
|
|
|
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
|
|
changeLog.add(uuid);
|
|
|
|
boolean b = rs.executeUpdate(addCaslLeaSql, xm, pxsj, kssj, pxsj, jssj, calLeaveTypeId, ksh,
|
|
|
|
changeLogList.add(changeLog);
|
|
|
|
minimumUnit, pxsj, kssj, pxsj, jssj, ksh, pxsj, subcompanyid, departmentid, jobtitle, 0, uuid);
|
|
|
|
|
|
|
|
if (b) {
|
|
|
|
|
|
|
|
rs.executeQuery(acqCasLeaveSql, uuid);
|
|
|
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
|
|
|
casleaveId = Util.getIntValue(Util.null2String(rs.getString("id")));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//调休扣减
|
|
|
|
//记录事假台账
|
|
|
|
String subTiaoxiuSql = "update kq_balanceofleave set tiaoxiuamount = ? where id = ?";
|
|
|
|
rs.executeUpdate(addLeaSql, xm, calLeaveTypeId, pxsj, kssj, jssj, 0, casleaveId, temp);
|
|
|
|
boolean subTiaoxiuSqlFlag = rs.executeBatchSql(subTiaoxiuSql, tiaoxiuSubList);
|
|
|
|
|
|
|
|
bb.writeLog("subTiaoxiuSqlFlag: " + subTiaoxiuSqlFlag);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//事假扣减
|
|
|
|
|
|
|
|
String addCasSql = "insert into kq_flow_split_leave " +
|
|
|
|
|
|
|
|
" (resourceid, fromdate, fromtime, todate, totime, newleavetype, duration, durationrule, fromdatedb, fromtimedb, todatedb, totimedb," +
|
|
|
|
|
|
|
|
" durationdb, belongdate, subcompanyid, departmentid, jobtitle, changetype )" +
|
|
|
|
|
|
|
|
" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
|
|
|
|
|
|
|
boolean addCasSqlFlag = rs.executeBatchSql(addCasSql, casualLeaveList);
|
|
|
|
|
|
|
|
bb.writeLog("addCasSqlFlag: " + addCasSqlFlag);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//变动记录
|
|
|
|
|
|
|
|
String syncChangeSql = "insert into uf_overtimesubtrain " +
|
|
|
|
|
|
|
|
" (resourceId, overtimedataId, tiaoxiudataId, subduration, beforeduration, afterduration, leavetype, " +
|
|
|
|
|
|
|
|
" formmodeid, modedatacreater, modedatacreatertype, modedatacreatedate, modedatacreatetime, MODEUUID ) " +
|
|
|
|
|
|
|
|
" values (?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
|
|
|
|
|
|
|
bb.writeLog("syncChangeSql:" + syncChangeSql);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean syncChangeSqlFlag = rs.executeBatchSql(syncChangeSql, changeLogList);
|
|
|
|
|
|
|
|
bb.writeLog("addFlag:" + syncChangeSqlFlag);
|
|
|
|
|
|
|
|
if (syncChangeSqlFlag) {
|
|
|
|
|
|
|
|
for ( List changeLog: changeLogList) {
|
|
|
|
|
|
|
|
String uuid = Util.null2String(changeLog.get(changeLog.size() - 1));
|
|
|
|
|
|
|
|
String billid = "-1";
|
|
|
|
|
|
|
|
String acqModeIdSql = "select id from uf_NoOutEmpNum where MODEUUID = ?";
|
|
|
|
|
|
|
|
rs.executeQuery(acqModeIdSql, uuid);
|
|
|
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
|
|
|
billid = Util.null2String(rs.getString("id"));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bb.writeLog("billid:" + billid);
|
|
|
|
|
|
|
|
SskjUtil sskjUtil = new SskjUtil();
|
|
|
|
|
|
|
|
sskjUtil.modePerRecon(modedatacreater, overtimeSubTrainModeId, billid);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//回写培训台账修改状态
|
|
|
|
|
|
|
|
rs.executeUpdate(modTrainStatusSql, 1, detailId);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|