|
|
|
@ -1,11 +1,8 @@
|
|
|
|
|
package com.engine.kq.biz;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.engine.kq.biz.chain.shiftinfo.ShiftInfoBean;
|
|
|
|
|
import com.engine.kq.cmd.attendanceButton.ButtonStatusEnum;
|
|
|
|
|
import com.engine.kq.enums.FlowReportTypeEnum;
|
|
|
|
|
import com.engine.kq.enums.KqSplitFlowTypeEnum;
|
|
|
|
|
import com.engine.kq.log.KQLog;
|
|
|
|
|
import com.engine.kq.util.KQDurationCalculatorUtil;
|
|
|
|
@ -2027,17 +2024,6 @@ public class KQReportBiz extends BaseBean {
|
|
|
|
|
int evectionMins = Util.getIntValue(Util.null2String(signInfo.get("evectionMins")));
|
|
|
|
|
int outMins = Util.getIntValue(Util.null2String(signInfo.get("outMins")));
|
|
|
|
|
|
|
|
|
|
String resourceId = Util.null2String(signInfo.get("resourceId"));
|
|
|
|
|
String kqDate = Util.null2String(signInfo.get("kqdate"));
|
|
|
|
|
String flowinfo = Util.null2String(signInfo.get("flowinfo"));
|
|
|
|
|
KQTimesArrayComInfo kqTimesArrayComInfo = new KQTimesArrayComInfo();
|
|
|
|
|
int split_time_index = 0;
|
|
|
|
|
ShiftInfoBean shiftInfoBean = KQDurationCalculatorUtil.getWorkTime(resourceId, kqDate, false);
|
|
|
|
|
List<int[]> halfWorkIndex = shiftInfoBean.getHalfWorkIndex();
|
|
|
|
|
if(halfWorkIndex != null && !halfWorkIndex.isEmpty()) {
|
|
|
|
|
int[] halfWorkIndexs = halfWorkIndex.get(0);
|
|
|
|
|
split_time_index = halfWorkIndexs[1];//半天的时间
|
|
|
|
|
}
|
|
|
|
|
if(worktime.length()>0){
|
|
|
|
|
if (absenteeismMins > 0) {//旷工
|
|
|
|
|
text = SystemEnv.getHtmlLabelName(20085, user.getLanguage())+absenteeismMins+ SystemEnv.getHtmlLabelName(15049, user.getLanguage());
|
|
|
|
@ -2066,71 +2052,21 @@ public class KQReportBiz extends BaseBean {
|
|
|
|
|
|
|
|
|
|
if (leaveMins > 0) {//请假
|
|
|
|
|
Map<String, Object> jsonObject = null;
|
|
|
|
|
// if(leaveInfo.length()>0){
|
|
|
|
|
// jsonObject = JSON.parseObject(leaveInfo);
|
|
|
|
|
// for (Map.Entry<String,Object> entry : jsonObject.entrySet()) {
|
|
|
|
|
// String newLeaveType = entry.getKey();
|
|
|
|
|
// String tmpLeaveMins = Util.null2String(entry.getValue());
|
|
|
|
|
// if(text.indexOf(kqLeaveRulesComInfo.getLeaveName(newLeaveType))==-1){
|
|
|
|
|
// if (text.length() > 0) text += " ";
|
|
|
|
|
// //text += kqLeaveRulesComInfo.getLeaveName(newLeaveType)+tmpLeaveMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage());
|
|
|
|
|
// text += Util.formatMultiLang(kqLeaveRulesComInfo.getLeaveName(newLeaveType),""+user.getLanguage());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }else{
|
|
|
|
|
// if(text.indexOf(SystemEnv.getHtmlLabelName(670, user.getLanguage()))==-1) {
|
|
|
|
|
// if (text.length() > 0) text += " ";
|
|
|
|
|
// text += SystemEnv.getHtmlLabelName(670, user.getLanguage());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if(flowinfo.length() > 0) {
|
|
|
|
|
jsonObject = JSON.parseObject(flowinfo);
|
|
|
|
|
String jsonKey = "";
|
|
|
|
|
String jsonValue = "";
|
|
|
|
|
if (jsonObject.containsKey(FlowReportTypeEnum.LEAVE.getFlowType())) {
|
|
|
|
|
jsonKey = FlowReportTypeEnum.LEAVE.getFlowType();
|
|
|
|
|
jsonValue = SystemEnv.getHtmlLabelName(670, user.getLanguage());
|
|
|
|
|
}
|
|
|
|
|
if (jsonKey.length() > 0) {
|
|
|
|
|
JSONArray jsonArray = (JSONArray) jsonObject.get(jsonKey);
|
|
|
|
|
String text4temp = "";
|
|
|
|
|
if (jsonArray != null && !jsonArray.isEmpty()) {
|
|
|
|
|
//客户不存在多个重复流程的情况,只是显示第一个就行
|
|
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
|
JSONObject jsonObject1 = (JSONObject) jsonArray.get(i);
|
|
|
|
|
if (jsonObject1 != null && !jsonObject1.isEmpty()) {
|
|
|
|
|
String newLeaveType = Util.null2s(Util.null2String(jsonObject1.get("newLeaveType")), "");
|
|
|
|
|
String begintime = Util.null2s(Util.null2String(jsonObject1.get("begintime")), "");
|
|
|
|
|
String endtime = Util.null2s(Util.null2String(jsonObject1.get("endtime")), "");
|
|
|
|
|
int beginIdx = kqTimesArrayComInfo.getArrayindexByTimes(begintime);
|
|
|
|
|
int endIdx = kqTimesArrayComInfo.getArrayindexByTimes(endtime);
|
|
|
|
|
if (jsonKey.equalsIgnoreCase(FlowReportTypeEnum.LEAVE.getFlowType())) {
|
|
|
|
|
if (newLeaveType.length() > 0) {
|
|
|
|
|
jsonValue = kqLeaveRulesComInfo.getLeaveName(newLeaveType);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (beginIdx <= split_time_index && endIdx <= split_time_index) {
|
|
|
|
|
//上午
|
|
|
|
|
if ("on".equalsIgnoreCase(onOrOff)) {
|
|
|
|
|
text4temp = jsonValue;
|
|
|
|
|
if(leaveInfo.length()>0){
|
|
|
|
|
jsonObject = JSON.parseObject(leaveInfo);
|
|
|
|
|
for (Entry<String, Object> entry : jsonObject.entrySet()) {
|
|
|
|
|
String newLeaveType = entry.getKey();
|
|
|
|
|
String tmpLeaveMins = Util.null2String(entry.getValue());
|
|
|
|
|
if(text.indexOf(kqLeaveRulesComInfo.getLeaveName(newLeaveType))==-1){
|
|
|
|
|
if (text.length() > 0) text += " ";
|
|
|
|
|
//text += kqLeaveRulesComInfo.getLeaveName(newLeaveType)+tmpLeaveMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage());
|
|
|
|
|
text += Util.formatMultiLang(kqLeaveRulesComInfo.getLeaveName(newLeaveType),""+user.getLanguage());
|
|
|
|
|
}
|
|
|
|
|
} else if (beginIdx >= split_time_index && endIdx >= split_time_index) {
|
|
|
|
|
//下午
|
|
|
|
|
if ("off".equalsIgnoreCase(onOrOff)) {
|
|
|
|
|
text4temp = jsonValue;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
//全天
|
|
|
|
|
text4temp = jsonValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(text4temp.length()>0){
|
|
|
|
|
if(text.indexOf(SystemEnv.getHtmlLabelName(670, user.getLanguage()))==-1) {
|
|
|
|
|
if (text.length() > 0) text += " ";
|
|
|
|
|
text += text4temp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
text += SystemEnv.getHtmlLabelName(670, user.getLanguage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2462,25 +2398,16 @@ public class KQReportBiz extends BaseBean {
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
int sixnight_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","sixnight_serialid"));
|
|
|
|
|
int twelvehours_night_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","twelvehours_night_serialid"));
|
|
|
|
|
int night_rest_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","night_rest_serialid"));
|
|
|
|
|
rs.executeQuery("select * from kq_format_total where kqdate = ? and resourceid=?",kqdate,userid);
|
|
|
|
|
rs.writeLog("select * from kq_format_total where kqdate = '"+ kqdate +"' and resourceid="+ userid);
|
|
|
|
|
while(rs.next()){
|
|
|
|
|
int serialid = Util.getIntValue(rs.getString("serialid"));
|
|
|
|
|
double attendanceMins = Util.getDoubleValue(rs.getString("attendanceMins"),0.00);
|
|
|
|
|
attendanceMins = attendanceMins / 60;
|
|
|
|
|
double overTimeTotal = getOverTimeTotal(kqdate,userid);
|
|
|
|
|
double time = attendanceMins+overTimeTotal;
|
|
|
|
|
//1、 12小时工作制夜班、做六休一夜班有夜班补贴,并且出勤(上班时间+加班时间)>=8小时,统计一次
|
|
|
|
|
if(serialid == sixnight_serialid|| serialid == twelvehours_night_serialid){
|
|
|
|
|
if(time >= 8){
|
|
|
|
|
result ++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//2、当一线人员排“夜休”班次,并且加班台账当天导入的加班时长>=8小时,统计一次。
|
|
|
|
|
if(serialid == night_rest_serialid){
|
|
|
|
|
if(overTimeTotal >= 8){
|
|
|
|
|
result ++;
|
|
|
|
|
result = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2499,32 +2426,19 @@ public class KQReportBiz extends BaseBean {
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
int sixnight_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","sixnight_serialid"));
|
|
|
|
|
int twelvehours_night_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","twelvehours_night_serialid"));
|
|
|
|
|
int night_rest_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","night_rest_serialid"));
|
|
|
|
|
rs.executeQuery("select * from kq_format_total where kqdate >= ? and kqdate <= ? and resourceid=?",fromDate,toDate,userid);
|
|
|
|
|
rs.writeLog("select * from kq_format_total where kqdate >= '"+ fromDate +"' and kqdate <= '"+ toDate +"' and resourceid="+ userid);
|
|
|
|
|
while(rs.next()){
|
|
|
|
|
int serialid = Util.getIntValue(rs.getString("serialid"));
|
|
|
|
|
String kqdate = Util.null2String(rs.getString("kqdate"));
|
|
|
|
|
double attendanceMins = Util.getDoubleValue(rs.getString("attendanceMins"),0.00);
|
|
|
|
|
attendanceMins = attendanceMins / 60;
|
|
|
|
|
rs.writeLog("========= getNightSubsidyTotal attendanceMins ========== "+ attendanceMins);
|
|
|
|
|
double overTimeTotal = getOverTimeTotal(kqdate,userid);
|
|
|
|
|
rs.writeLog("========= getNightSubsidyTotal overTimeTotal ========== "+ overTimeTotal);
|
|
|
|
|
double time = attendanceMins+overTimeTotal;
|
|
|
|
|
rs.writeLog("========= getNightSubsidyTotal time ========== "+ time);
|
|
|
|
|
if(serialid == sixnight_serialid|| serialid == twelvehours_night_serialid){
|
|
|
|
|
if(time >= 8){
|
|
|
|
|
result++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
rs.writeLog("========= getNightSubsidyTotal result 111 ========== "+ result);
|
|
|
|
|
//2、当一线人员排“夜休”班次,并且加班台账当天导入的加班时长>=8小时,统计一次。
|
|
|
|
|
if(serialid == night_rest_serialid){
|
|
|
|
|
if(overTimeTotal >= 8){
|
|
|
|
|
result ++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
rs.writeLog("========= getNightSubsidyTotal result 222 ========== "+ result);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
@ -2559,10 +2473,11 @@ public class KQReportBiz extends BaseBean {
|
|
|
|
|
String tablename_dt = tablename+"_dt1";
|
|
|
|
|
rs.executeQuery("select b.* from "+ tablename +" a,"+ tablename_dt +" b,workflow_requestbase c" +
|
|
|
|
|
"where a.requestid = c.requestid and a.id=b.mainid and c.currentnodetype=3" +
|
|
|
|
|
"and a.detail_signdate >=? and a.detail_signdate <=? and a.resourceId=?",fromDate,toDate,userid);
|
|
|
|
|
while(rs.next()){
|
|
|
|
|
result++;
|
|
|
|
|
"and a.ksrq >=? and a.jsrq <=? and a.resourceId=?",fromDate,toDate,userid);
|
|
|
|
|
if(rs.next()){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
result = rs.getCounts();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2580,8 +2495,8 @@ public class KQReportBiz extends BaseBean {
|
|
|
|
|
rs.executeQuery("select b.* from "+ tablename +" a,"+ tablename_dt +" b,workflow_requestbase c" +
|
|
|
|
|
"where a.requestid = c.requestid and a.id=b.mainid and c.currentnodetype=3" +
|
|
|
|
|
"and b.detail_signdate =? and a.resourceId=?",kqdate,userid);
|
|
|
|
|
while(rs.next()){
|
|
|
|
|
result ++;
|
|
|
|
|
if(rs.next()){
|
|
|
|
|
result = 1;
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|