Merge branch 'dev-chenwnj' into dev

dev-chenwnj
chenwei 2 years ago
commit 1faf03be7c

@ -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) { public boolean handleCasLeave(String resourceId, String kqDate, String requestid, double duration) {
@ -120,18 +124,34 @@ public class SskjUtil {
} }
if (casMap != null && casMap.size() > 0) { if (casMap != null && casMap.size() > 0) {
String modCasSql = "update " + handleTabel + " set qjsc = ?, sfdk = ?, dklcid = ? where qjbid = ?"; String modCasSql = "update " + handleTabel + " set qjsc = ?, sfdk = ?, dklcid = ? where qjbid = ?";
String modLeaveSql = "update kq_flow_split_leave set duration = ?, durationdb = ? where id = ?"; String modLeaveSql = "update uf_casleave set duration = ?, isdecu = ?, decuflowid = ? where id = ?";
String delLeaveSql = "";
List<List> modCasList = new ArrayList<>(); List<List> modCasList = new ArrayList<>();
List tempList = new ArrayList(); List tempList = new ArrayList();
for (String key : casMap.keySet()) { for (String key : casMap.keySet()) {
double qjsc = casMap.get(key); double qjsc = casMap.get(key);
double temp = duration - qjsc; 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(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; return true;

@ -52,6 +52,8 @@ public class DeductTrainTimesJob extends BaseCronJob {
//获取事假类型 //获取事假类型
String calLeaveTypeId = bb.getPropValue("project_sskj", "calLeaveId"); String calLeaveTypeId = bb.getPropValue("project_sskj", "calLeaveId");
//获取转事假建模ID
String casLeaveModeId = bb.getPropValue("project_sskj", "casLeaveModeId");
//获取事假单位规则 //获取事假单位规则
KQLeaveRulesComInfo kqLeaveRulesComInfo = new KQLeaveRulesComInfo(); KQLeaveRulesComInfo kqLeaveRulesComInfo = new KQLeaveRulesComInfo();
String minimumUnit = kqLeaveRulesComInfo.getMinimumUnit(calLeaveTypeId); 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 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 addLeaSql = "insert into " + addLeaNa + " (qjry, qjlx, qjrq, kssj, jssj, sfdk, qjbid, qjsc) values (?,?,?,?,?,?,?,?)";
String acqOverSql = "select jbzsy from " + addOverNa + " where xm = ? and ny = ? "; String acqOverSql = "select jbzsy from " + addOverNa + " where xm = ? and ny = ? ";
String addCaslLeaSql = "insert into kq_flow_split_leave (resourceid, fromdate, fromtime, todate, totime, newleavetype, " + String addCaslLeaSql = "insert into uf_casleave (resourceid, kqdate, starttime, endtime, duration, isdecu, formmodeid, modedatacreater, modedatacreatertype, " +
" duration, durationrule, fromdatedb, fromtimedb, todatedb, totimedb, durationdb, belongdate, subcompanyid, " + " modedatacreatedate, modedatacreatetime, MODEUUID) values (?,?,?,?,?,?,?,?,?,?,?,?)";
" departmentid, jobtitle, changetype, casleaveuuid ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String acqCasLeaveSql = "select id from kq_flow_split_leave where casleaveuuid = ?"; 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 " + String modTrainSql = "update " + addOverNa + " set pxzsc = (select sum(pxsc) from " + addTraNa + " as dt_table where " +
" dt_table.mainid = " + addOverNa + ".id ) where xm = ? and ny = ? "; " dt_table.mainid = " + addOverNa + ".id ) where xm = ? and ny = ? ";
String modOverSql = "update " + addOverNa + " set jbzsy = (psjbsy + zmjbsy + jrjbsy - pxzsc) where xm = ? and ny = ? "; String modOverSql = "update " + addOverNa + " set jbzsy = (psjbsy + zmjbsy + jrjbsy - pxzsc) where xm = ? and ny = ? ";
@ -162,18 +164,25 @@ public class DeductTrainTimesJob extends BaseCronJob {
if (temp > 0) { if (temp > 0) {
Integer casleaveId = -1; 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(); String uuid = UUID.randomUUID().toString();
boolean b = rs.executeUpdate(addCaslLeaSql, xm, pxsj, kssj, pxsj, jssj, calLeaveTypeId, ksh, boolean addFlag = rs.executeUpdate(addCaslLeaSql, xm, pxsj, kssj, jssj, ksh, 0, casLeaveModeId, 1, 0, modedatacreatedate,
minimumUnit, pxsj, kssj, pxsj, jssj, ksh, pxsj, subcompanyid, departmentid, jobtitle, 0, uuid); uuid, modedatacreatetime);
if (b) { bb.writeLog("addFlag" + addFlag);
rs.executeQuery(acqCasLeaveSql, uuid); if (addFlag) {
String billid = "-1";
rs.executeQuery(acqModeIdSql, uuid);
while (rs.next()) { 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