|
|
|
@ -52,6 +52,8 @@ public class DeductTrainTimesJob extends BaseCronJob {
|
|
|
|
|
|
|
|
|
|
//获取事假类型
|
|
|
|
|
String calLeaveTypeId = bb.getPropValue("project_sskj", "calLeaveId");
|
|
|
|
|
//获取转事假建模ID
|
|
|
|
|
String casLeaveModeId = bb.getPropValue("project_sskj", "casLeaveModeId");
|
|
|
|
|
//获取事假单位规则
|
|
|
|
|
KQLeaveRulesComInfo kqLeaveRulesComInfo = new KQLeaveRulesComInfo();
|
|
|
|
|
String minimumUnit = kqLeaveRulesComInfo.getMinimumUnit(calLeaveTypeId);
|
|
|
|
@ -128,10 +130,10 @@ public class DeductTrainTimesJob extends BaseCronJob {
|
|
|
|
|
String addTrainSql = "insert into " + addTraNa + " (pxry, pxrq, kssj, jssj, pxsc) values (?,?,?,?,?)";
|
|
|
|
|
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, " +
|
|
|
|
|
" duration, durationrule, fromdatedb, fromtimedb, todatedb, totimedb, durationdb, belongdate, subcompanyid, " +
|
|
|
|
|
" departmentid, jobtitle, changetype, casleaveuuid ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
|
|
|
|
String addCaslLeaSql = "insert into uf_casleave (resourceid, kqdate, starttime, endtime, duration, isdecu, formmodeid, modedatacreater, modedatacreatertype, " +
|
|
|
|
|
" modedatacreatedate, modedatacreatetime, MODEUUID) values (?,?,?,?,?,?,?,?,?,?,?,?)";
|
|
|
|
|
String acqCasLeaveSql = "select id from kq_flow_split_leave where casleaveuuid = ?";
|
|
|
|
|
String acqModeIdSql = "select id from uf_casleave where MODEUUID = ?";
|
|
|
|
|
String modTrainSql = "update " + addOverNa + " set pxzsc = (select sum(pxsc) from " + addTraNa + " as dt_table where " +
|
|
|
|
|
" dt_table.mainid = " + addOverNa + ".id ) where xm = ? and ny = ? ";
|
|
|
|
|
String modOverSql = "update " + addOverNa + " set jbzsy = (psjbsy + zmjbsy + jrjbsy - pxzsc) where xm = ? and ny = ? ";
|
|
|
|
@ -162,17 +164,24 @@ public class DeductTrainTimesJob extends BaseCronJob {
|
|
|
|
|
if (temp > 0) {
|
|
|
|
|
Integer casleaveId = -1;
|
|
|
|
|
//生成一条事假数据
|
|
|
|
|
String modedatacreatedate = DateUtil.format(new Date(), "yyyy-MM-dd");
|
|
|
|
|
String modedatacreatetime = DateUtil.format(new Date(), "HH:mm:ss");
|
|
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
|
|
|
boolean b = rs.executeUpdate(addCaslLeaSql, xm, pxsj, kssj, pxsj, jssj, calLeaveTypeId, ksh,
|
|
|
|
|
minimumUnit, pxsj, kssj, pxsj, jssj, ksh, pxsj, subcompanyid, departmentid, jobtitle, 0, uuid);
|
|
|
|
|
if (b) {
|
|
|
|
|
rs.executeQuery(acqCasLeaveSql, uuid);
|
|
|
|
|
boolean addFlag = rs.executeUpdate(addCaslLeaSql, xm, pxsj, kssj, jssj, ksh, 0, casLeaveModeId, 1, 0, modedatacreatedate,
|
|
|
|
|
uuid, modedatacreatetime);
|
|
|
|
|
bb.writeLog("addFlag:" + addFlag);
|
|
|
|
|
if (addFlag) {
|
|
|
|
|
String billid = "-1";
|
|
|
|
|
rs.executeQuery(acqModeIdSql, uuid);
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
casleaveId = Util.getIntValue(Util.null2String(rs.getString("id")));
|
|
|
|
|
billid = Util.null2String(rs.getString("id"));
|
|
|
|
|
}
|
|
|
|
|
bb.writeLog("billid:" + billid);
|
|
|
|
|
sskjUtil.modePerRecon(1, casLeaveModeId, billid);
|
|
|
|
|
//记录事假台账
|
|
|
|
|
rs.executeUpdate(addLeaSql, xm, calLeaveTypeId, pxsj, kssj, jssj, 0, casleaveId, temp);
|
|
|
|
|
}
|
|
|
|
|
//记录事假台账
|
|
|
|
|
rs.executeUpdate(addLeaSql, xm, calLeaveTypeId, pxsj, kssj, jssj, 0, casleaveId, temp);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|