From ec1e88f46925edc514195597593c7fab46ba4598 Mon Sep 17 00:00:00 2001 From: zhangming <965499528@qq.com> Date: Wed, 4 Dec 2024 11:31:32 +0800 Subject: [PATCH] =?UTF-8?q?12.04=20=E6=96=B0=E5=A2=9E=E9=A4=90=E8=A1=A5?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB-INF/jsp/GetSerialInfoTemp.jsp | 30 ++++++ WEB-INF/prop/hostar_zm_prop.properties | 4 +- .../hostar/thread/HandleCBDataThread.java | 97 ++++++++++++++++++- .../kq/cmd/report/ExportDailyExcelCmd.java | 1 + .../engine/kq/cmd/report/ExportExcelCmd.java | 1 + .../kq/cmd/report/GetKQDailyReportCmd.java | 1 + .../engine/kq/cmd/report/GetKQReportCmd.java | 1 + .../hostar/job/UpdateCbxxjlDataJob.java | 97 ++++++++++++++++++- 8 files changed, 221 insertions(+), 11 deletions(-) create mode 100644 WEB-INF/jsp/GetSerialInfoTemp.jsp diff --git a/WEB-INF/jsp/GetSerialInfoTemp.jsp b/WEB-INF/jsp/GetSerialInfoTemp.jsp new file mode 100644 index 0000000..de2ff03 --- /dev/null +++ b/WEB-INF/jsp/GetSerialInfoTemp.jsp @@ -0,0 +1,30 @@ +<%@ page import="com.engine.kq.biz.KQWorkTime" %> +<%@ page import="java.util.Map" %> +<%@ page import="com.engine.kq.entity.WorkTimeEntity" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit" %> +<% + String userId = request.getParameter("userId"); + String kqDate = request.getParameter("kqDate"); + try { + + KQWorkTime kqWorkTime = new KQWorkTime(); + Map serialInfo = kqWorkTime.getSerialInfo(userId, kqDate, false); + if (serialInfo != null && serialInfo.size() > 0) { + int serialid = Util.getIntValue(Util.null2String(serialInfo.get(kqDate)), 0); + out.println("serialid:" + serialid + "
"); + } + + WorkTimeEntity workTime = kqWorkTime.getWorkTime(userId, kqDate); + String bc = workTime.getSerialId(); + out.print("new serialid:" + bc + "
"); + + ShiftManagementToolKit shiftManagementToolKit = new ShiftManagementToolKit(); + String shiftOnOffWorkSections = shiftManagementToolKit.getShiftOnOffWorkSections(bc, 7); + out.print("shiftOnOffWorkSections:" + shiftOnOffWorkSections + "
"); + shiftOnOffWorkSections = shiftManagementToolKit.getShiftOnOffWorkSections("51", 7); + out.print("shiftOnOffWorkSections 51:" + shiftOnOffWorkSections + "
"); + } catch (Exception e) { + out.print("get serialid error:" + e.getMessage()); + } +%> \ No newline at end of file diff --git a/WEB-INF/prop/hostar_zm_prop.properties b/WEB-INF/prop/hostar_zm_prop.properties index 9bdd5e2..dcf0d8b 100644 --- a/WEB-INF/prop/hostar_zm_prop.properties +++ b/WEB-INF/prop/hostar_zm_prop.properties @@ -1,2 +1,4 @@ # 餐补信息记录模块ID -cbxxjl_modeid=82 \ No newline at end of file +cbxxjl_modeid=82 +# 夜班补助指定班次 +night_shift_appoint_bc=51,52 \ No newline at end of file diff --git a/src/com/engine/hostar/thread/HandleCBDataThread.java b/src/com/engine/hostar/thread/HandleCBDataThread.java index 1711896..5206fd9 100644 --- a/src/com/engine/hostar/thread/HandleCBDataThread.java +++ b/src/com/engine/hostar/thread/HandleCBDataThread.java @@ -10,6 +10,7 @@ import com.engine.kq.biz.KQShiftRuleInfoBiz; import com.engine.kq.biz.KQTimesArrayComInfo; import com.engine.kq.biz.KQWorkTime; import com.engine.kq.biz.chain.shiftinfo.ShiftInfoBean; +import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit; import com.engine.kq.entity.TimeScopeEntity; import com.engine.kq.entity.WorkTimeEntity; import com.engine.kq.util.KQDurationCalculatorUtil; @@ -186,6 +187,13 @@ public class HandleCBDataThread extends BaseBean implements Runnable{ if (StringUtils.isEmpty(zeropoint)) { zeropoint = "0"; } + // 考勤二开--夜班餐补_白班 + String ybcbbb = getNightShiftSubsidyBb(userId, kqDate, nightShiftList, dailyFlowOverTimeData, signminsMap, attendanceMinsMap, + groupId, zrzbcSet, pbzbcSet); + baseBean.writeLog("ybcbbb:" + ybcbbb); + if (StringUtils.isEmpty(ybcbbb)) { + ybcbbb = "0"; + } rs.executeQuery("select id from uf_cbxxjlb where xm = ? and rq = ?", userId, kqDate); RecordSet rs1 = new RecordSet(); @@ -194,8 +202,8 @@ public class HandleCBDataThread extends BaseBean implements Runnable{ int cbxxjlId = rs.getInt("id"); SimpleDateFormat dtFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 String nowDateTime = dtFormat.format(new Date()); - rs1.executeUpdate("update uf_cbxxjlb set hrzdcb = ?, jmybcb = ?, zdcb = ?, ybbz = ?, cccb = ?, ldbz = ?, modedatamodifydatetime = ? where id = ?", - otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, nowDateTime, cbxxjlId); + rs1.executeUpdate("update uf_cbxxjlb set hrzdcb = ?, jmybcb = ?, zdcb = ?, ybbz = ?, cccb = ?, ldbz = ?, ybcbbb = ?, modedatamodifydatetime = ? where id = ?", + otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, ybcbbb, nowDateTime, cbxxjlId); //权限重构 ModeRightInfo ModeRightInfo = new ModeRightInfo(); ModeRightInfo.setNewRight(true); @@ -213,9 +221,9 @@ public class HandleCBDataThread extends BaseBean implements Runnable{ 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); + rs1.executeUpdate("insert into uf_cbxxjlb (xm, rq, gh, bm, hrzdcb, jmybcb, zdcb, ybbz, cccb, ldbz, ybcbbb, formmodeid, MODEUUID, " + + "modedatacreater, modedatacreatertype, modedatacreatedate, modedatacreatetime) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,? ,?, ?, ?)", + userId, kqDate, gh, bm, otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, ybcbbb, cbxxjlModeId, uuidT, "1", "0", nowDate, nowTime); RecordSet qxcgRs = new RecordSet(); qxcgRs.execute("select id from uf_cbxxjlb where MODEUUID = '" + uuidT + "'"); Integer idT = 0; @@ -379,6 +387,85 @@ public class HandleCBDataThread extends BaseBean implements Runnable{ return value; } + public String getNightShiftSubsidyBb(String userId, String kqDate, List nightShiftList, Map dailyFlowOverTimeData, + Map signminsMap, Map attendanceMinsMap, String groupId, + Set zrzbcSet, Set pbzbcSet) { + BaseBean bb = new BaseBean(); + String value = ""; + try { + + KQWorkTime kqWorkTime = new KQWorkTime(); + + WorkTimeEntity workTime = kqWorkTime.getWorkTime(userId, kqDate); + String bc = workTime.getSerialId(); + if (StringUtils.isEmpty(bc)) { + return "0"; + } + + int serialid = Integer.parseInt(bc); + bb.writeLog("getNightShiftSubsidyBb serialid:" + serialid); + if (serialid <= 0) { + return "0"; + } + if (CollectionUtils.isEmpty(nightShiftList) || !nightShiftList.contains(String.valueOf(serialid))) { + if ((!CollectionUtils.isEmpty(pbzbcSet)) && pbzbcSet.contains(groupId)) { + double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|workingDayOvertime_4leave"))); + workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave; + double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|restDayOvertime_4leave"))); + restDayOvertime_4leave = restDayOvertime_4leave < 0 ? 0 : restDayOvertime_4leave; + double holidayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|holidayOvertime_4leave"))); + holidayOvertime_4leave = holidayOvertime_4leave < 0 ? 0 : holidayOvertime_4leave; + + double workingDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|workingDayOvertime_nonleave"))); + workingDayOvertime_nonleave = workingDayOvertime_nonleave < 0 ? 0 : workingDayOvertime_nonleave; + double restDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|restDayOvertime_nonleave"))); + restDayOvertime_nonleave = restDayOvertime_nonleave < 0 ? 0 : restDayOvertime_nonleave; + double holidayOvertime_nonleave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|holidayOvertime_nonleave"))); + holidayOvertime_nonleave = holidayOvertime_nonleave < 0 ? 0 : holidayOvertime_nonleave; + + double temp = workingDayOvertime_4leave + restDayOvertime_4leave + holidayOvertime_4leave + + workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave; + Double attendanceMins = Util.getDoubleValue(Util.null2String(attendanceMinsMap.get(userId + "|" + kqDate))); + RecordSet rs = new RecordSet(); + String appointBc = rs.getPropValue("hostar_zm_prop", "night_shift_appoint_bc"); + double floor = Math.floor(((attendanceMins < 0.00 ? 0.00 : attendanceMins) + temp) / 60); + if (StringUtils.isEmpty(appointBc)) { + if (floor >= 19.00) { + value = "2"; + } + if (floor < 19.00 && floor >= 14.00) { + value = "1"; + } + } else { + List appointBcList = Arrays.asList(appointBc.split(",")); + if (appointBcList.contains(bc)) { + if (floor >= 15.00) { + value = "2"; + } + if (floor < 15.00 && floor >= 10.00) { + value = "1"; + } + } else { + ShiftManagementToolKit shiftManagementToolKit = new ShiftManagementToolKit(); + String shiftOnOffWorkSections = shiftManagementToolKit.getShiftOnOffWorkSections(bc, 7); + if (StringUtils.isEmpty(shiftOnOffWorkSections) || !shiftOnOffWorkSections.contains("夜班")) { + if (floor >= 19.00) { + value = "2"; + } + if (floor < 19.00 && floor >= 14.00) { + value = "1"; + } + } + } + } + } + } + } catch (Exception e) { + bb.writeLog("get getNightShiftSubsidyBb error:" + e.getMessage()); + } + return value; + } + public String getOtherStatAllowance(String userId, String kqDate, Map dailyFlowOverTimeData, Map signminsMap, Map attendanceMinsMap, List removeRes) { BaseBean bb = new BaseBean(); diff --git a/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java b/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java index 77aaa09..0a4cf29 100644 --- a/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java +++ b/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java @@ -192,6 +192,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand> { " sum(zm.hrzdcb) as otherStatAllowance," + " sum(zm.ybbz) as nightShiftSubsidy," + " sum(zm.ldbz) as zeropoint," + + " sum(zm.ybcbbb) as nightShiftSubsidyDayShift," + " a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," + " sum(b.workdays) as workdays,sum(b.workMins) as workMins,sum(b.attendancedays) as attendancedays," + " sum(FLOOR( b.attendanceMins / 30 ) * 30 ) as attendanceMins,sum(b.beLate) as beLate,sum(b.beLateMins) as beLateMins, " + diff --git a/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java b/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java index 7dd016a..f2fdaa0 100644 --- a/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java +++ b/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java @@ -151,6 +151,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand> { " sum(zm.hrzdcb) as otherStatAllowance," + " sum(zm.ybbz) as nightShiftSubsidy," + " sum(zm.ldbz) as zeropoint," + + " sum(zm.ybcbbb) as nightShiftSubsidyDayShift," + " a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," + " sum(b.workdays) as workdays,sum(b.workMins) as workMins,sum(b.attendancedays) as attendancedays," + " sum(FLOOR( b.attendanceMins / 30 ) * 30 ) as attendanceMins,sum(b.beLate) as beLate,sum(b.beLateMins) as beLateMins, " + diff --git a/src/weaver/interfaces/hostar/job/UpdateCbxxjlDataJob.java b/src/weaver/interfaces/hostar/job/UpdateCbxxjlDataJob.java index 5396885..d56523e 100644 --- a/src/weaver/interfaces/hostar/job/UpdateCbxxjlDataJob.java +++ b/src/weaver/interfaces/hostar/job/UpdateCbxxjlDataJob.java @@ -10,6 +10,7 @@ import com.engine.kq.biz.KQShiftRuleInfoBiz; import com.engine.kq.biz.KQTimesArrayComInfo; import com.engine.kq.biz.KQWorkTime; import com.engine.kq.biz.chain.shiftinfo.ShiftInfoBean; +import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit; import com.engine.kq.entity.TimeScopeEntity; import com.engine.kq.entity.WorkTimeEntity; import com.engine.kq.util.KQDurationCalculatorUtil; @@ -283,6 +284,13 @@ public class UpdateCbxxjlDataJob extends BaseCronJob { if (StringUtils.isEmpty(zeropoint)) { zeropoint = "0"; } + // 考勤二开--夜班餐补_白班 + String ybcbbb = getNightShiftSubsidyBb(userId, kqDate, nightShiftList, dailyFlowOverTimeData, signminsMap, attendanceMinsMap, + groupId, zrzbcSet, pbzbcSet); + baseBean.writeLog("ybcbbb:" + ybcbbb); + if (StringUtils.isEmpty(ybcbbb)) { + ybcbbb = "0"; + } rs.executeQuery("select id from uf_cbxxjlb where xm = ? and rq = ?", userId, kqDate); RecordSet rs1 = new RecordSet(); @@ -290,8 +298,8 @@ public class UpdateCbxxjlDataJob extends BaseCronJob { if (rs.next()) { int cbxxjlId = rs.getInt("id"); String nowDateTime = dtFormat.format(new Date()); - rs1.executeUpdate("update uf_cbxxjlb set hrzdcb = ?, jmybcb = ?, zdcb = ?, ybbz = ?, cccb = ?, ldbz = ?, modedatamodifydatetime = ? where id = ?", - otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, nowDateTime, cbxxjlId); + rs1.executeUpdate("update uf_cbxxjlb set hrzdcb = ?, jmybcb = ?, zdcb = ?, ybbz = ?, cccb = ?, ldbz = ?, ybcbbb = ?, modedatamodifydatetime = ? where id = ?", + otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, ybcbbb, nowDateTime, cbxxjlId); } else { String uuidT = UUID.randomUUID().toString(); String nowDate = sdfDate.format(new Date()); @@ -303,9 +311,9 @@ public class UpdateCbxxjlDataJob extends BaseCronJob { 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); + rs1.executeUpdate("insert into uf_cbxxjlb (xm, rq, gh, bm, hrzdcb, jmybcb, zdcb, ybbz, cccb, ldbz, ybcbbb, formmodeid, MODEUUID, " + + "modedatacreater, modedatacreatertype, modedatacreatedate, modedatacreatetime) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,? ,?, ?)", + userId, kqDate, gh, bm, otherStatAllowance, nightAllowance, statAllowance, nightShiftSubsidy, mealAllowance, zeropoint, ybcbbb, cbxxjlModeId, uuidT, "1", "0", nowDate, nowTime); // RecordSet qxcgRs = new RecordSet(); // qxcgRs.execute("select id from uf_cbxxjlb where MODEUUID = '" + uuidT + "'"); // Integer idT = 0; @@ -475,6 +483,85 @@ public class UpdateCbxxjlDataJob extends BaseCronJob { return value; } + public String getNightShiftSubsidyBb(String userId, String kqDate, List nightShiftList, Map dailyFlowOverTimeData, + Map signminsMap, Map attendanceMinsMap, String groupId, + Set zrzbcSet, Set pbzbcSet) { + BaseBean bb = new BaseBean(); + String value = ""; + try { + + KQWorkTime kqWorkTime = new KQWorkTime(); + + WorkTimeEntity workTime = kqWorkTime.getWorkTime(userId, kqDate); + String bc = workTime.getSerialId(); + if (StringUtils.isEmpty(bc)) { + return "0"; + } + + int serialid = Integer.parseInt(bc); + bb.writeLog("getNightShiftSubsidyBb serialid:" + serialid); + if (serialid <= 0) { + return "0"; + } + if (CollectionUtils.isEmpty(nightShiftList) || !nightShiftList.contains(String.valueOf(serialid))) { + if ((!CollectionUtils.isEmpty(pbzbcSet)) && pbzbcSet.contains(groupId)) { + double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|workingDayOvertime_4leave"))); + workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave; + double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|restDayOvertime_4leave"))); + restDayOvertime_4leave = restDayOvertime_4leave < 0 ? 0 : restDayOvertime_4leave; + double holidayOvertime_4leave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|holidayOvertime_4leave"))); + holidayOvertime_4leave = holidayOvertime_4leave < 0 ? 0 : holidayOvertime_4leave; + + double workingDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|workingDayOvertime_nonleave"))); + workingDayOvertime_nonleave = workingDayOvertime_nonleave < 0 ? 0 : workingDayOvertime_nonleave; + double restDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|restDayOvertime_nonleave"))); + restDayOvertime_nonleave = restDayOvertime_nonleave < 0 ? 0 : restDayOvertime_nonleave; + double holidayOvertime_nonleave = Util.getDoubleValue(Util.null2String(dailyFlowOverTimeData.get(userId + "|" + kqDate + "|holidayOvertime_nonleave"))); + holidayOvertime_nonleave = holidayOvertime_nonleave < 0 ? 0 : holidayOvertime_nonleave; + + double temp = workingDayOvertime_4leave + restDayOvertime_4leave + holidayOvertime_4leave + + workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave; + Double attendanceMins = Util.getDoubleValue(Util.null2String(attendanceMinsMap.get(userId + "|" + kqDate))); + RecordSet rs = new RecordSet(); + String appointBc = rs.getPropValue("hostar_zm_prop", "night_shift_appoint_bc"); + double floor = Math.floor(((attendanceMins < 0.00 ? 0.00 : attendanceMins) + temp) / 60); + if (StringUtils.isEmpty(appointBc)) { + if (floor >= 19.00) { + value = "2"; + } + if (floor < 19.00 && floor >= 14.00) { + value = "1"; + } + } else { + List appointBcList = Arrays.asList(appointBc.split(",")); + if (appointBcList.contains(bc)) { + if (floor >= 15.00) { + value = "2"; + } + if (floor < 15.00 && floor >= 10.00) { + value = "1"; + } + } else { + ShiftManagementToolKit shiftManagementToolKit = new ShiftManagementToolKit(); + String shiftOnOffWorkSections = shiftManagementToolKit.getShiftOnOffWorkSections(bc, 7); + if (StringUtils.isEmpty(shiftOnOffWorkSections) || !shiftOnOffWorkSections.contains("夜班")) { + if (floor >= 19.00) { + value = "2"; + } + if (floor < 19.00 && floor >= 14.00) { + value = "1"; + } + } + } + } + } + } + } catch (Exception e) { + bb.writeLog("get getNightShiftSubsidyBb error:" + e.getMessage()); + } + return value; + } + public String getOtherStatAllowance(String userId, String kqDate, Map dailyFlowOverTimeData, Map signminsMap, Map attendanceMinsMap, List removeRes) { BaseBean bb = new BaseBean();