出差餐补优化需求20240730

dev-zm
zhangming 9 months ago
parent a0ec75702f
commit c968012e13

@ -69,6 +69,16 @@ public class HandleCBDataThread extends BaseBean implements Runnable{
baseBean.writeLog("HandleCBDataThread:" + userId + "、" + kqDate);
try {
RecordSet rs = new RecordSet();
// 判断该条数据是否人工调整,是人工调整则不更新
int cnt = 0;
rs.executeQuery("SELECT count(*) as cnt FROM uf_cbxxjlb where xm = ? and rq = ? and sfrgdz = 0", userId, kqDate);
if (rs.next()) {
cnt = rs.getInt("cnt");
}
if (cnt > 0) {
return;
}
// 获取考勤二开--夜班补助
String nightShiftSubsidy = getNightShiftSubsidy(userId, kqDate);
baseBean.writeLog("nightShiftSubsidy:" + nightShiftSubsidy);
@ -496,11 +506,11 @@ public class HandleCBDataThread extends BaseBean implements Runnable{
}
}
String groupId = kqGroupMemberComInfo.getKQGroupId(res, kqDate);
// String groupId = kqGroupMemberComInfo.getKQGroupId(res, kqDate);
if (signNumber == 0) {
double minValue = 0.00;
if ((!CollectionUtils.isEmpty(pbzbcSet)) && pbzbcSet.contains(groupId)) {
// if ((!CollectionUtils.isEmpty(pbzbcSet)) && pbzbcSet.contains(groupId)) {
double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|workingDayOvertime_4leave")));
workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave;
double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|restDayOvertime_4leave")));
@ -529,11 +539,11 @@ public class HandleCBDataThread extends BaseBean implements Runnable{
} else if (v >= 9.00) {
value = "2";
}
}
if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) {
minValue = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate)));
value = String.valueOf(Math.floor((Math.max(minValue, 0.00)) / 360));
}
// }
// if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) {
// minValue = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate)));
// value = String.valueOf(Math.floor((Math.max(minValue, 0.00)) / 360));
// }
//
}
}
@ -714,7 +724,7 @@ public class HandleCBDataThread extends BaseBean implements Runnable{
groupId = groupIdObj.toString();
}
if ((!CollectionUtils.isEmpty(pbzbcSet)) && pbzbcSet.contains(groupId)) {
// if ((!CollectionUtils.isEmpty(pbzbcSet)) && pbzbcSet.contains(groupId)) {
double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|workingDayOvertime_4leave")));
workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave;
double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|restDayOvertime_4leave")));
@ -733,11 +743,11 @@ public class HandleCBDataThread extends BaseBean implements Runnable{
workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave;
Double attendanceMins = Util.getDoubleValue(Util.null2String(attendanceMinsMap.get(res + "|" + kqDate)));
value = String.valueOf(Math.floor(((attendanceMins < 0.00 ? 0.00 : attendanceMins) + temp) / 300));
}
if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) {
Double signmins = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate)));
value = String.valueOf(Math.floor((signmins < 0.00 ? 0.00 : signmins) / 360));
}
// }
// if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) {
// Double signmins = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate)));
// value = String.valueOf(Math.floor((signmins < 0.00 ? 0.00 : signmins) / 360));
// }
}
}
}
@ -989,7 +999,7 @@ public class HandleCBDataThread extends BaseBean implements Runnable{
}
}
if (signNumber == 0 ) {
if ((!CollectionUtils.isEmpty(pbzbcSet)) && pbzbcSet.contains(groupId)) {
// if ((!CollectionUtils.isEmpty(pbzbcSet)) && pbzbcSet.contains(groupId)) {
double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|workingDayOvertime_4leave")));
workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave;
double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|restDayOvertime_4leave")));
@ -1008,11 +1018,11 @@ public class HandleCBDataThread extends BaseBean implements Runnable{
workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave;
Double attendanceMins = Util.getDoubleValue(Util.null2String(attendanceMinsMap.get(res + "|" + kqDate)));
value = String.valueOf(Math.floor(((attendanceMins < 0.00 ? 0.00 : attendanceMins) + temp) / 300));
}
if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) {
Double signmins = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate)));
value = String.valueOf(Math.floor((signmins < 0.00 ? 0.00 : signmins) / 360));
}
// }
// if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) {
// Double signmins = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate)));
// value = String.valueOf(Math.floor((signmins < 0.00 ? 0.00 : signmins) / 360));
// }
}
}
}

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

Loading…
Cancel
Save