后续加班扣减转事假

dev-chenwnj
chenwei 1 year ago
parent df237d031f
commit dfbe7e7d0c

@ -100,6 +100,10 @@ public class SskjUtil {
/**
*
* @param resourceId
* @param kqDate
* @param requestid id
* @param duration
*/
public boolean handleCasLeave(String resourceId, String kqDate, String requestid, double duration) {
@ -120,18 +124,34 @@ public class SskjUtil {
}
if (casMap != null && casMap.size() > 0) {
String modCasSql = "update " + handleTabel + " set qjsc = ?, sfdk = ?, dklcid = ? where qjbid = ?";
String modLeaveSql = "update kq_flow_split_leave set duration = ?, durationdb = ? where id = ?";
String delLeaveSql = "";
String modLeaveSql = "update uf_casleave set duration = ?, isdecu = ?, decuflowid = ? where id = ?";
List<List> modCasList = new ArrayList<>();
List tempList = new ArrayList();
for (String key : casMap.keySet()) {
double qjsc = casMap.get(key);
double temp = duration - qjsc;
if (temp > 0) {
if (temp >= 0) {
tempList.add(0.00);
tempList.add(1);
tempList.add(key);
tempList.add(requestid);
modCasList.add(tempList);
} else {
tempList.add(Math.abs(temp));
tempList.add(0);
tempList.add(key);
tempList.add(requestid);
modCasList.add(tempList);
}
}
if (modCasList != null && modCasList.size() > 0) {
//修改转事假建模台账
rs.executeBatchSql(modLeaveSql, modCasList);
//修改转事假建模台账
rs.executeBatchSql(modCasSql, modCasList);
}
}
return true;

@ -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);
}
}
}

Loading…
Cancel
Save