|
|
|
@ -247,88 +247,88 @@ public class KQFormatData extends BaseBean {
|
|
|
|
|
rs.executeUpdate(sql, userId, kqDate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
long startTime = System.currentTimeMillis();
|
|
|
|
|
// 获取考勤二开--夜班补助
|
|
|
|
|
String nightShiftSubsidy = getNightShiftSubsidy(userId, kqDate);
|
|
|
|
|
bb.writeLog("nightShiftSubsidy:" + nightShiftSubsidy);
|
|
|
|
|
if (StringUtils.isEmpty(nightShiftSubsidy)) {
|
|
|
|
|
nightShiftSubsidy = "0";
|
|
|
|
|
}
|
|
|
|
|
// 获取考勤二开--鸿仁驻点餐补
|
|
|
|
|
String otherStatAllowance = getOtherStatAllowance(userId, kqDate);
|
|
|
|
|
bb.writeLog("otherStatAllowance:" + otherStatAllowance);
|
|
|
|
|
if (StringUtils.isEmpty(otherStatAllowance)) {
|
|
|
|
|
otherStatAllowance = "0";
|
|
|
|
|
}
|
|
|
|
|
// 考勤二开--精密夜班餐补
|
|
|
|
|
String nightAllowance = getNightAllowance(userId, kqDate);
|
|
|
|
|
bb.writeLog("nightAllowance:" + nightAllowance);
|
|
|
|
|
if (StringUtils.isEmpty(nightAllowance)) {
|
|
|
|
|
nightAllowance = "0";
|
|
|
|
|
}
|
|
|
|
|
// 考勤二开--驻点餐补
|
|
|
|
|
String statAllowance = getStatAllowance(userId, kqDate);
|
|
|
|
|
bb.writeLog("statAllowance:" + statAllowance);
|
|
|
|
|
if (StringUtils.isEmpty(statAllowance)) {
|
|
|
|
|
statAllowance = "0";
|
|
|
|
|
}
|
|
|
|
|
// 考勤二开--出差餐补
|
|
|
|
|
String mealAllowance = getMealAllowance(userId, kqDate);
|
|
|
|
|
if (!(StringUtils.equals(statAllowance, "0") && StringUtils.equals(otherStatAllowance, "0"))) {
|
|
|
|
|
mealAllowance = "0";
|
|
|
|
|
}
|
|
|
|
|
bb.writeLog("mealAllowance:" + mealAllowance);
|
|
|
|
|
if (StringUtils.isEmpty(mealAllowance)) {
|
|
|
|
|
mealAllowance = "0";
|
|
|
|
|
}
|
|
|
|
|
// 考勤二开--零点补助
|
|
|
|
|
String zeropoint = getZeroBt(userId, kqDate);
|
|
|
|
|
bb.writeLog("zeropoint:" + zeropoint);
|
|
|
|
|
if (StringUtils.isEmpty(zeropoint)) {
|
|
|
|
|
zeropoint = "0";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rs.executeQuery("select id from uf_cbxxjlb where xm = ? and rq = ?", userId, kqDate);
|
|
|
|
|
RecordSet rs1 = new RecordSet();
|
|
|
|
|
String cbxxjlModeId = rs1.getPropValue("hostar_zm_prop","cbxxjl_modeid");
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
int cbxxjlId = rs.getInt("id");
|
|
|
|
|
rs1.executeUpdate("update uf_cbxxjlb set hrzdcb = ?, jmybcb = ?, zdcb = ?, ybbz = ?, cccb = ?, ldbz = ? where id = ?",
|
|
|
|
|
otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, cbxxjlId);
|
|
|
|
|
//权限重构
|
|
|
|
|
ModeRightInfo ModeRightInfo = new ModeRightInfo();
|
|
|
|
|
ModeRightInfo.setNewRight(true);
|
|
|
|
|
ModeRightInfo.editModeDataShare(1, Integer.parseInt(cbxxjlModeId), cbxxjlId);
|
|
|
|
|
} else {
|
|
|
|
|
String uuidT = UUID.randomUUID().toString();
|
|
|
|
|
SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
|
|
|
SimpleDateFormat sdfTime = new SimpleDateFormat("HH:mm:ss");//设置日期格式
|
|
|
|
|
String nowDate = sdfDate.format(new Date());
|
|
|
|
|
String nowTime = sdfTime.format(new Date());
|
|
|
|
|
String gh = null;
|
|
|
|
|
String bm = null;
|
|
|
|
|
rs1.executeQuery("SELECT workcode, departmentid from hrmresource where id = ?", userId);
|
|
|
|
|
if (rs1.next()) {
|
|
|
|
|
gh = rs1.getString("workcode");
|
|
|
|
|
bm = rs1.getString("departmentid");
|
|
|
|
|
}
|
|
|
|
|
rs1.executeUpdate("insert into uf_cbxxjlb (xm, rq, gh, bm, hrzdcb, jmybcb, zdcb, ybbz, cccb, ldbz, formmodeid, MODEUUID, " +
|
|
|
|
|
"modedatacreater, modedatacreatertype, modedatacreatedate, modedatacreatetime) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,? ,?)",
|
|
|
|
|
userId, kqDate, gh, bm ,otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, cbxxjlModeId, uuidT, "1", "0", nowDate, nowTime);
|
|
|
|
|
RecordSet qxcgRs = new RecordSet();
|
|
|
|
|
qxcgRs.execute("select id from uf_cbxxjlb where MODEUUID = '" + uuidT + "'");
|
|
|
|
|
Integer idT = 0;
|
|
|
|
|
while (qxcgRs.next()) {
|
|
|
|
|
idT = qxcgRs.getInt("id");
|
|
|
|
|
}
|
|
|
|
|
//权限重构
|
|
|
|
|
ModeRightInfo ModeRightInfo = new ModeRightInfo();
|
|
|
|
|
ModeRightInfo.setNewRight(true);
|
|
|
|
|
ModeRightInfo.editModeDataShare(1, Integer.parseInt(cbxxjlModeId), idT);
|
|
|
|
|
}
|
|
|
|
|
long endTime = System.currentTimeMillis();
|
|
|
|
|
long elapsedTime = endTime - startTime; // 执行时间
|
|
|
|
|
bb.writeLog("getDailyMealAllowanceData执行时间:" + elapsedTime/1000 + "秒");
|
|
|
|
|
// long startTime = System.currentTimeMillis();
|
|
|
|
|
// // 获取考勤二开--夜班补助
|
|
|
|
|
// String nightShiftSubsidy = getNightShiftSubsidy(userId, kqDate);
|
|
|
|
|
// bb.writeLog("nightShiftSubsidy:" + nightShiftSubsidy);
|
|
|
|
|
// if (StringUtils.isEmpty(nightShiftSubsidy)) {
|
|
|
|
|
// nightShiftSubsidy = "0";
|
|
|
|
|
// }
|
|
|
|
|
// // 获取考勤二开--鸿仁驻点餐补
|
|
|
|
|
// String otherStatAllowance = getOtherStatAllowance(userId, kqDate);
|
|
|
|
|
// bb.writeLog("otherStatAllowance:" + otherStatAllowance);
|
|
|
|
|
// if (StringUtils.isEmpty(otherStatAllowance)) {
|
|
|
|
|
// otherStatAllowance = "0";
|
|
|
|
|
// }
|
|
|
|
|
// // 考勤二开--精密夜班餐补
|
|
|
|
|
// String nightAllowance = getNightAllowance(userId, kqDate);
|
|
|
|
|
// bb.writeLog("nightAllowance:" + nightAllowance);
|
|
|
|
|
// if (StringUtils.isEmpty(nightAllowance)) {
|
|
|
|
|
// nightAllowance = "0";
|
|
|
|
|
// }
|
|
|
|
|
// // 考勤二开--驻点餐补
|
|
|
|
|
// String statAllowance = getStatAllowance(userId, kqDate);
|
|
|
|
|
// bb.writeLog("statAllowance:" + statAllowance);
|
|
|
|
|
// if (StringUtils.isEmpty(statAllowance)) {
|
|
|
|
|
// statAllowance = "0";
|
|
|
|
|
// }
|
|
|
|
|
// // 考勤二开--出差餐补
|
|
|
|
|
// String mealAllowance = getMealAllowance(userId, kqDate);
|
|
|
|
|
// if (!(StringUtils.equals(statAllowance, "0") && StringUtils.equals(otherStatAllowance, "0"))) {
|
|
|
|
|
// mealAllowance = "0";
|
|
|
|
|
// }
|
|
|
|
|
// bb.writeLog("mealAllowance:" + mealAllowance);
|
|
|
|
|
// if (StringUtils.isEmpty(mealAllowance)) {
|
|
|
|
|
// mealAllowance = "0";
|
|
|
|
|
// }
|
|
|
|
|
// // 考勤二开--零点补助
|
|
|
|
|
// String zeropoint = getZeroBt(userId, kqDate);
|
|
|
|
|
// bb.writeLog("zeropoint:" + zeropoint);
|
|
|
|
|
// if (StringUtils.isEmpty(zeropoint)) {
|
|
|
|
|
// zeropoint = "0";
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// rs.executeQuery("select id from uf_cbxxjlb where xm = ? and rq = ?", userId, kqDate);
|
|
|
|
|
// RecordSet rs1 = new RecordSet();
|
|
|
|
|
// String cbxxjlModeId = rs1.getPropValue("hostar_zm_prop","cbxxjl_modeid");
|
|
|
|
|
// if (rs.next()) {
|
|
|
|
|
// int cbxxjlId = rs.getInt("id");
|
|
|
|
|
// rs1.executeUpdate("update uf_cbxxjlb set hrzdcb = ?, jmybcb = ?, zdcb = ?, ybbz = ?, cccb = ?, ldbz = ? where id = ?",
|
|
|
|
|
// otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, cbxxjlId);
|
|
|
|
|
// //权限重构
|
|
|
|
|
// ModeRightInfo ModeRightInfo = new ModeRightInfo();
|
|
|
|
|
// ModeRightInfo.setNewRight(true);
|
|
|
|
|
// ModeRightInfo.editModeDataShare(1, Integer.parseInt(cbxxjlModeId), cbxxjlId);
|
|
|
|
|
// } else {
|
|
|
|
|
// String uuidT = UUID.randomUUID().toString();
|
|
|
|
|
// SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
|
|
|
// SimpleDateFormat sdfTime = new SimpleDateFormat("HH:mm:ss");//设置日期格式
|
|
|
|
|
// String nowDate = sdfDate.format(new Date());
|
|
|
|
|
// String nowTime = sdfTime.format(new Date());
|
|
|
|
|
// String gh = null;
|
|
|
|
|
// String bm = null;
|
|
|
|
|
// rs1.executeQuery("SELECT workcode, departmentid from hrmresource where id = ?", userId);
|
|
|
|
|
// if (rs1.next()) {
|
|
|
|
|
// gh = rs1.getString("workcode");
|
|
|
|
|
// bm = rs1.getString("departmentid");
|
|
|
|
|
// }
|
|
|
|
|
// rs1.executeUpdate("insert into uf_cbxxjlb (xm, rq, gh, bm, hrzdcb, jmybcb, zdcb, ybbz, cccb, ldbz, formmodeid, MODEUUID, " +
|
|
|
|
|
// "modedatacreater, modedatacreatertype, modedatacreatedate, modedatacreatetime) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,? ,?)",
|
|
|
|
|
// userId, kqDate, gh, bm ,otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, cbxxjlModeId, uuidT, "1", "0", nowDate, nowTime);
|
|
|
|
|
// RecordSet qxcgRs = new RecordSet();
|
|
|
|
|
// qxcgRs.execute("select id from uf_cbxxjlb where MODEUUID = '" + uuidT + "'");
|
|
|
|
|
// Integer idT = 0;
|
|
|
|
|
// while (qxcgRs.next()) {
|
|
|
|
|
// idT = qxcgRs.getInt("id");
|
|
|
|
|
// }
|
|
|
|
|
// //权限重构
|
|
|
|
|
// ModeRightInfo ModeRightInfo = new ModeRightInfo();
|
|
|
|
|
// ModeRightInfo.setNewRight(true);
|
|
|
|
|
// ModeRightInfo.editModeDataShare(1, Integer.parseInt(cbxxjlModeId), idT);
|
|
|
|
|
// }
|
|
|
|
|
// long endTime = System.currentTimeMillis();
|
|
|
|
|
// long elapsedTime = endTime - startTime; // 执行时间
|
|
|
|
|
// bb.writeLog("getDailyMealAllowanceData执行时间:" + elapsedTime/1000 + "秒");
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
writeLog(e);
|
|
|
|
|
kqLog.info(e);
|
|
|
|
|