|
|
|
@ -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<String> nightShiftList, Map<String,Object> dailyFlowOverTimeData,
|
|
|
|
|
Map<String, Double> signminsMap, Map<String, Double> attendanceMinsMap, String groupId,
|
|
|
|
|
Set<String> zrzbcSet, Set<String> 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<String> 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<String,Object> dailyFlowOverTimeData, Map<String, Double> signminsMap,
|
|
|
|
|
Map<String, Double> attendanceMinsMap, List<String> removeRes) {
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|