出差餐补优化需求20240730

dev-zm
zhangming 10 months ago
parent a0ec75702f
commit c968012e13

@ -69,6 +69,16 @@ public class HandleCBDataThread extends BaseBean implements Runnable{
baseBean.writeLog("HandleCBDataThread:" + userId + "、" + kqDate); baseBean.writeLog("HandleCBDataThread:" + userId + "、" + kqDate);
try { try {
RecordSet rs = new RecordSet(); 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); String nightShiftSubsidy = getNightShiftSubsidy(userId, kqDate);
baseBean.writeLog("nightShiftSubsidy:" + nightShiftSubsidy); 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) { if (signNumber == 0) {
double minValue = 0.00; 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"))); double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|workingDayOvertime_4leave")));
workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave; workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave;
double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|restDayOvertime_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) { } else if (v >= 9.00) {
value = "2"; value = "2";
} }
} // }
if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) { // if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) {
minValue = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate))); // minValue = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate)));
value = String.valueOf(Math.floor((Math.max(minValue, 0.00)) / 360)); // 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(); 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"))); double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|workingDayOvertime_4leave")));
workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave; workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave;
double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|restDayOvertime_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; workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave;
Double attendanceMins = Util.getDoubleValue(Util.null2String(attendanceMinsMap.get(res + "|" + kqDate))); Double attendanceMins = Util.getDoubleValue(Util.null2String(attendanceMinsMap.get(res + "|" + kqDate)));
value = String.valueOf(Math.floor(((attendanceMins < 0.00 ? 0.00 : attendanceMins) + temp) / 300)); value = String.valueOf(Math.floor(((attendanceMins < 0.00 ? 0.00 : attendanceMins) + temp) / 300));
} // }
if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) { // if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) {
Double signmins = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate))); // Double signmins = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate)));
value = String.valueOf(Math.floor((signmins < 0.00 ? 0.00 : signmins) / 360)); // 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 (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"))); double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|workingDayOvertime_4leave")));
workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave; workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave;
double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(res + "|" + kqDate + "|restDayOvertime_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; workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave;
Double attendanceMins = Util.getDoubleValue(Util.null2String(attendanceMinsMap.get(res + "|" + kqDate))); Double attendanceMins = Util.getDoubleValue(Util.null2String(attendanceMinsMap.get(res + "|" + kqDate)));
value = String.valueOf(Math.floor(((attendanceMins < 0.00 ? 0.00 : attendanceMins) + temp) / 300)); value = String.valueOf(Math.floor(((attendanceMins < 0.00 ? 0.00 : attendanceMins) + temp) / 300));
} // }
if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) { // if ((!CollectionUtils.isEmpty(zrzbcSet)) && zrzbcSet.contains(groupId)) {
Double signmins = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate))); // Double signmins = Util.getDoubleValue(Util.null2String(signminsMap.get(res + "|" + kqDate)));
value = String.valueOf(Math.floor((signmins < 0.00 ? 0.00 : signmins) / 360)); // 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); rs.executeUpdate(sql, userId, kqDate);
} }
} }
long startTime = System.currentTimeMillis(); // long startTime = System.currentTimeMillis();
// 获取考勤二开--夜班补助 // // 获取考勤二开--夜班补助
String nightShiftSubsidy = getNightShiftSubsidy(userId, kqDate); // String nightShiftSubsidy = getNightShiftSubsidy(userId, kqDate);
bb.writeLog("nightShiftSubsidy:" + nightShiftSubsidy); // bb.writeLog("nightShiftSubsidy:" + nightShiftSubsidy);
if (StringUtils.isEmpty(nightShiftSubsidy)) { // if (StringUtils.isEmpty(nightShiftSubsidy)) {
nightShiftSubsidy = "0"; // nightShiftSubsidy = "0";
} // }
// 获取考勤二开--鸿仁驻点餐补 // // 获取考勤二开--鸿仁驻点餐补
String otherStatAllowance = getOtherStatAllowance(userId, kqDate); // String otherStatAllowance = getOtherStatAllowance(userId, kqDate);
bb.writeLog("otherStatAllowance:" + otherStatAllowance); // bb.writeLog("otherStatAllowance:" + otherStatAllowance);
if (StringUtils.isEmpty(otherStatAllowance)) { // if (StringUtils.isEmpty(otherStatAllowance)) {
otherStatAllowance = "0"; // otherStatAllowance = "0";
} // }
// 考勤二开--精密夜班餐补 // // 考勤二开--精密夜班餐补
String nightAllowance = getNightAllowance(userId, kqDate); // String nightAllowance = getNightAllowance(userId, kqDate);
bb.writeLog("nightAllowance:" + nightAllowance); // bb.writeLog("nightAllowance:" + nightAllowance);
if (StringUtils.isEmpty(nightAllowance)) { // if (StringUtils.isEmpty(nightAllowance)) {
nightAllowance = "0"; // nightAllowance = "0";
} // }
// 考勤二开--驻点餐补 // // 考勤二开--驻点餐补
String statAllowance = getStatAllowance(userId, kqDate); // String statAllowance = getStatAllowance(userId, kqDate);
bb.writeLog("statAllowance:" + statAllowance); // bb.writeLog("statAllowance:" + statAllowance);
if (StringUtils.isEmpty(statAllowance)) { // if (StringUtils.isEmpty(statAllowance)) {
statAllowance = "0"; // statAllowance = "0";
} // }
// 考勤二开--出差餐补 // // 考勤二开--出差餐补
String mealAllowance = getMealAllowance(userId, kqDate); // String mealAllowance = getMealAllowance(userId, kqDate);
if (!(StringUtils.equals(statAllowance, "0") && StringUtils.equals(otherStatAllowance, "0"))) { // if (!(StringUtils.equals(statAllowance, "0") && StringUtils.equals(otherStatAllowance, "0"))) {
mealAllowance = "0"; // mealAllowance = "0";
} // }
bb.writeLog("mealAllowance:" + mealAllowance); // bb.writeLog("mealAllowance:" + mealAllowance);
if (StringUtils.isEmpty(mealAllowance)) { // if (StringUtils.isEmpty(mealAllowance)) {
mealAllowance = "0"; // mealAllowance = "0";
} // }
// 考勤二开--零点补助 // // 考勤二开--零点补助
String zeropoint = getZeroBt(userId, kqDate); // String zeropoint = getZeroBt(userId, kqDate);
bb.writeLog("zeropoint:" + zeropoint); // bb.writeLog("zeropoint:" + zeropoint);
if (StringUtils.isEmpty(zeropoint)) { // if (StringUtils.isEmpty(zeropoint)) {
zeropoint = "0"; // zeropoint = "0";
} // }
//
rs.executeQuery("select id from uf_cbxxjlb where xm = ? and rq = ?", userId, kqDate); // rs.executeQuery("select id from uf_cbxxjlb where xm = ? and rq = ?", userId, kqDate);
RecordSet rs1 = new RecordSet(); // RecordSet rs1 = new RecordSet();
String cbxxjlModeId = rs1.getPropValue("hostar_zm_prop","cbxxjl_modeid"); // String cbxxjlModeId = rs1.getPropValue("hostar_zm_prop","cbxxjl_modeid");
if (rs.next()) { // if (rs.next()) {
int cbxxjlId = rs.getInt("id"); // int cbxxjlId = rs.getInt("id");
rs1.executeUpdate("update uf_cbxxjlb set hrzdcb = ?, jmybcb = ?, zdcb = ?, ybbz = ?, cccb = ?, ldbz = ? where id = ?", // rs1.executeUpdate("update uf_cbxxjlb set hrzdcb = ?, jmybcb = ?, zdcb = ?, ybbz = ?, cccb = ?, ldbz = ? where id = ?",
otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, cbxxjlId); // otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, cbxxjlId);
//权限重构 // //权限重构
ModeRightInfo ModeRightInfo = new ModeRightInfo(); // ModeRightInfo ModeRightInfo = new ModeRightInfo();
ModeRightInfo.setNewRight(true); // ModeRightInfo.setNewRight(true);
ModeRightInfo.editModeDataShare(1, Integer.parseInt(cbxxjlModeId), cbxxjlId); // ModeRightInfo.editModeDataShare(1, Integer.parseInt(cbxxjlModeId), cbxxjlId);
} else { // } else {
String uuidT = UUID.randomUUID().toString(); // String uuidT = UUID.randomUUID().toString();
SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式 // SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
SimpleDateFormat sdfTime = new SimpleDateFormat("HH:mm:ss");//设置日期格式 // SimpleDateFormat sdfTime = new SimpleDateFormat("HH:mm:ss");//设置日期格式
String nowDate = sdfDate.format(new Date()); // String nowDate = sdfDate.format(new Date());
String nowTime = sdfTime.format(new Date()); // String nowTime = sdfTime.format(new Date());
String gh = null; // String gh = null;
String bm = null; // String bm = null;
rs1.executeQuery("SELECT workcode, departmentid from hrmresource where id = ?", userId); // rs1.executeQuery("SELECT workcode, departmentid from hrmresource where id = ?", userId);
if (rs1.next()) { // if (rs1.next()) {
gh = rs1.getString("workcode"); // gh = rs1.getString("workcode");
bm = rs1.getString("departmentid"); // bm = rs1.getString("departmentid");
} // }
rs1.executeUpdate("insert into uf_cbxxjlb (xm, rq, gh, bm, hrzdcb, jmybcb, zdcb, ybbz, cccb, ldbz, formmodeid, MODEUUID, " + // rs1.executeUpdate("insert into uf_cbxxjlb (xm, rq, gh, bm, hrzdcb, jmybcb, zdcb, ybbz, cccb, ldbz, formmodeid, MODEUUID, " +
"modedatacreater, modedatacreatertype, modedatacreatedate, modedatacreatetime) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,? ,?)", // "modedatacreater, modedatacreatertype, modedatacreatedate, modedatacreatetime) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,? ,?)",
userId, kqDate, gh, bm ,otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, cbxxjlModeId, uuidT, "1", "0", nowDate, nowTime); // userId, kqDate, gh, bm ,otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, cbxxjlModeId, uuidT, "1", "0", nowDate, nowTime);
RecordSet qxcgRs = new RecordSet(); // RecordSet qxcgRs = new RecordSet();
qxcgRs.execute("select id from uf_cbxxjlb where MODEUUID = '" + uuidT + "'"); // qxcgRs.execute("select id from uf_cbxxjlb where MODEUUID = '" + uuidT + "'");
Integer idT = 0; // Integer idT = 0;
while (qxcgRs.next()) { // while (qxcgRs.next()) {
idT = qxcgRs.getInt("id"); // idT = qxcgRs.getInt("id");
} // }
//权限重构 // //权限重构
ModeRightInfo ModeRightInfo = new ModeRightInfo(); // ModeRightInfo ModeRightInfo = new ModeRightInfo();
ModeRightInfo.setNewRight(true); // ModeRightInfo.setNewRight(true);
ModeRightInfo.editModeDataShare(1, Integer.parseInt(cbxxjlModeId), idT); // ModeRightInfo.editModeDataShare(1, Integer.parseInt(cbxxjlModeId), idT);
} // }
long endTime = System.currentTimeMillis(); // long endTime = System.currentTimeMillis();
long elapsedTime = endTime - startTime; // 执行时间 // long elapsedTime = endTime - startTime; // 执行时间
bb.writeLog("getDailyMealAllowanceData执行时间" + elapsedTime/1000 + "秒"); // bb.writeLog("getDailyMealAllowanceData执行时间" + elapsedTime/1000 + "秒");
}catch (Exception e) { }catch (Exception e) {
writeLog(e); writeLog(e);
kqLog.info(e); kqLog.info(e);

Loading…
Cancel
Save