dev-wcf
chenwei 1 year ago
parent b1fc77100f
commit 88991c41f1

File diff suppressed because it is too large Load Diff

@ -42,9 +42,12 @@ public class KqDevServiceImpl extends Service implements KqDevService {
return result;
}
int changeType = -1;
try {
//1-节假日、2-工作日、3-休息日、-1-数据异常,无效数据
changeType = KQOvertimeRulesBiz.getChangeType(resourceId, kqDate);
bb.writeLog("changeType: " + changeType);

@ -444,7 +444,7 @@ public class KQFormatSignData extends BaseBean {
checkInfo.put("signTime", legWorkInfos.get(0));//签到签退时间
checkInfo.put("deduct_signintime", "");//流程抵扣作为打卡时间
checkInfo.put("signStatus", ButtonStatusEnum.NORMAL.getStatusCode());
lsCheckInfo.add(legWorkInfos.get(0));
lsCheckInfo.add(checkInfo);
} else {
for ( String signTime : legWorkInfos) {
if (signTime.compareTo(workBeginTime) < 0) {//获取上班时间点之前最早的一笔卡

@ -2,7 +2,10 @@ package com.engine.kq.biz;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.engine.hostar.util.HostarUtil;
import com.engine.kq.cmd.attendanceButton.ButtonStatusEnum;
import com.engine.kq.entity.TimeScopeEntity;
import com.engine.kq.entity.WorkTimeEntity;
import com.engine.kq.enums.KqSplitFlowTypeEnum;
import com.engine.kq.log.KQLog;
import com.engine.kq.util.KQDurationCalculatorUtil;
@ -11,6 +14,8 @@ import java.text.DecimalFormatSymbols;
import java.util.Map.Entry;
import com.engine.kq.util.KQTransMethod;
import com.weaver.integration.ldap.sync.formart.OaFormart;
import org.apache.commons.lang3.StringUtils;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.file.Prop;
@ -40,6 +45,8 @@ public class KQReportBiz extends BaseBean {
private KQLog kqLog = new KQLog();
BaseBean bb = new BaseBean();
/**
*
*/
@ -130,7 +137,7 @@ public class KQReportBiz extends BaseBean {
rs.executeQuery(sql,resourceId,fromdate, todate);
while(rs.next()){
String serialnumber = Util.null2String(rs.getString("serialnumber"));
String serialid = Util.null2String(rs.getString("serialid"));
String serialid = Util.null2String(rs.getString("serialid"));
String workbegindate = Util.null2String(rs.getString("workbegindate"));
String workbegintime = Util.null2String(rs.getString("workbegintime"));
String workenddate = Util.null2String(rs.getString("workenddate"));
@ -216,7 +223,7 @@ public class KQReportBiz extends BaseBean {
}
}
data.put("start",isondutyfreecheck);
data.put("end",isoffdutyfreecheck);
data.put("end",isoffdutyfreecheck);
if(status.length()>0)status+=",";
status += ButtonStatusEnum.ABSENT.getStatusCode();
}
@ -366,6 +373,10 @@ public class KQReportBiz extends BaseBean {
datas.putAll(getDailyFlowEvectionOutData(params,user));
datas.putAll(getDailyFlowOverTimeData(params,user));
datas.putAll(getDailyFlowLeaveBackData(params,user));
/*考勤二开--出差公出流程餐补统计start*/
datas.putAll(getDailyMealAllowanceData(params,user));
/*考勤二开--出差公出流程餐补统计end*/
}catch (Exception e){
writeLog(e);
}
@ -663,7 +674,7 @@ public class KQReportBiz extends BaseBean {
}
sql = " select resourceid, newleavetype, durationrule, sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere +
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere +
" group by resourceid, newleavetype, durationrule ";
rs.execute(sql);
while (rs.next()) {
@ -760,7 +771,7 @@ public class KQReportBiz extends BaseBean {
// sqlWhere += " and (signfrom like 'card%' or signfrom='e9_mobile_out' or signfrom='EMSyn_out' or signfrom='DingTalk_out' or signfrom='Wechat_out') ";
sql = " select a.id,b.signdate,b.id as signid,b.signfrom from hrmresource a, hrmschedulesign b "+
" where a.id = b.userid and b.signdate >='"+fromDate+"' and b.signdate <='"+toDate+"' " +sqlWhere +
" where a.id = b.userid and b.signdate >='"+fromDate+"' and b.signdate <='"+toDate+"' " +sqlWhere +
" order by a.id,b.signdate ";
rs.execute(sql);
// kqLog.info("card.sql="+sql);
@ -839,7 +850,7 @@ public class KQReportBiz extends BaseBean {
}
sql = " select resourceid, newleavetype, durationrule, sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere +
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere +
" group by resourceid, newleavetype, durationrule ";
rs.execute(sql);
while (rs.next()) {
@ -1033,7 +1044,7 @@ public class KQReportBiz extends BaseBean {
}
sql = " select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere +
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere +
" group by resourceid, newleavetype, durationrule,belongdate ";
rs.execute(sql);
while (rs.next()) {
@ -1125,7 +1136,7 @@ public class KQReportBiz extends BaseBean {
}
sql = " select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere +
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere +
" group by resourceid, newleavetype, durationrule,belongdate ";
rs.execute(sql);
while (rs.next()) {
@ -1160,6 +1171,278 @@ public class KQReportBiz extends BaseBean {
return datas;
}
/**
*
* @param params
* @param user
* @return
*/
public Map<String,Object> getDailyMealAllowanceData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
try{
KQLeaveRulesComInfo kqLeaveRulesComInfo = new KQLeaveRulesComInfo();
JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data")));
String fromDate = Util.null2String(jsonObj.get("fromDate"));
String toDate = Util.null2String(jsonObj.get("toDate"));
String typeselect =Util.null2String(jsonObj.get("typeselect"));
if(typeselect.length()==0)typeselect = "3";
if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){
if(typeselect.equals("1")){
fromDate = TimeUtil.getCurrentDateString();
toDate = TimeUtil.getCurrentDateString();
}else{
fromDate = TimeUtil.getDateByOption(typeselect,"0");
toDate = TimeUtil.getDateByOption(typeselect,"1");
}
}
String subCompanyId = Util.null2String(jsonObj.get("subCompanyId"));
String departmentId = Util.null2String(jsonObj.get("departmentId"));
String resourceId = Util.null2String(jsonObj.get("resourceId"));
String allLevel = Util.null2String(jsonObj.get("allLevel"));
String isNoAccount = Util.null2String(jsonObj.get("isNoAccount"));
String viewScope = Util.null2String(jsonObj.get("viewScope"));
if(subCompanyId.length()>0){
sqlWhere +=" and a.subcompanyid1 in("+subCompanyId+") ";
}
if(departmentId.length()>0){
sqlWhere +=" and a.departmentid in("+departmentId+") ";
}
if(resourceId.length()>0){
sqlWhere +=" and b.resourceid in("+resourceId+") ";
}
if(viewScope.equals("4")){//我的下属
if(allLevel.equals("1")){//所有下属
sqlWhere+=" and a.managerstr like '%,"+user.getUID()+",%'";
}else{
sqlWhere+=" and a.managerid="+user.getUID();//直接下属
}
}
if (!"1".equals(isNoAccount)) {
sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' ");
}
//首先获取出差公出流程信息
Map<String, Object> evectionMap = new HashMap<>();
String evectionTableName = Util.null2String(bb.getPropValue("project_hostar","evectionTableName"));
sql = " select c.resourceid, c.belongdate, c.longitude, c.latitude from ( " +
" select a.belongdate, b.id as resourceid, b.subcompanyid1, b.departmentid, b.managerstr, b.managerid, b.loginid, c.jd as longitude, c.wd as latitude from kq_flow_split_evection a " +
" left join hrmresource b " +
" on b.id = a.resourceid " +
" left join " + evectionTableName + " c " +
" on c.requestid = a.requestid " +
" where a.belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +
" ) c " +
" where 1=1 " + sqlWhere ;
rs.execute(sql);
while (rs.next()) {
String resourceid = Util.null2String(rs.getString("resourceid"));
String belongdate = Util.null2String(rs.getString("belongdate"));
String longitude = Util.null2String(rs.getString("longitude"));
String latitude = Util.null2String(rs.getString("latitude"));
evectionMap.put( belongdate + "|" + resourceid, longitude + "|" + latitude );
}
//获取外勤打卡数据
KQWorkTime kqWorkTime = new KQWorkTime();
kqWorkTime.setIsFormat(true);
Map< String, Map<String, Object>> lsCheckInfo = new HashMap<>();
for ( String key: evectionMap.keySet()) {
String[] split = key.split("\\|");
String kqDate = split[0];
String userId = split[1];
WorkTimeEntity workTime = kqWorkTime.getWorkTime(userId, kqDate);
List<TimeScopeEntity> lsSignTime = new ArrayList<>();
List<TimeScopeEntity> lsWorkTime = new ArrayList<>();
if (workTime != null) {
lsSignTime = workTime.getSignTime();//允许打卡时间
lsWorkTime = workTime.getWorkTime();//工作时间
}
//只支持一天一次上下班
if (lsWorkTime != null && lsWorkTime.size()==1 ) {
TimeScopeEntity signTimeScope = lsSignTime.get(0);
TimeScopeEntity workTimeScope = lsWorkTime.get(0);
List<Map<String, Object>> legWorkInfos = new ArrayList<>();
//获取允许打卡时间
String signBeginTime = signTimeScope.getBeginTime();
bb.writeLog("signBeginTime: " + signBeginTime);
if (StringUtils.isNotBlank(signBeginTime)) {
signBeginTime = signBeginTime + ":00";
}
bb.writeLog("signBeginTime: " + signBeginTime);
//获取上班时间
String workBeginTime = workTimeScope.getBeginTime();
bb.writeLog("workBeginTime: " + workBeginTime);
if (StringUtils.isNotBlank(workBeginTime)) {
workBeginTime = workBeginTime + ":00";
}
bb.writeLog("workBeginTime: " + workBeginTime);
String acqLegWorkSignSql = "select operate_time, longitude, latitude from mobile_sign where operater = ? and operate_date = '" + kqDate + "' and operate_time >='" + signBeginTime + "' order by operate_time asc ";
bb.writeLog("acqLegWorkSignSql: " + acqLegWorkSignSql);
bb.writeLog("userId: " + userId);
rs.executeQuery(acqLegWorkSignSql, userId);
while ( rs.next()) {
String operateTime = Util.null2String(rs.getString("operate_time"));
String longitude = Util.null2String(rs.getString("longitude"));
String latitude = Util.null2String(rs.getString("latitude"));
if ( StringUtils.isNotBlank(operateTime) && StringUtils.isNotBlank(longitude) && StringUtils.isNotBlank(latitude) ) {
Map<String, Object> temp = new HashMap<>();
temp.put("operateTime", operateTime);
temp.put("longitude", longitude);
temp.put("latitude", latitude);
legWorkInfos.add(temp);
}
}
bb.writeLog("legWorkInfos: " + legWorkInfos);
if (legWorkInfos != null && legWorkInfos.size() > 0 ) {
String tempSignIn = "";
String tempSignInLatitude = "";
String tempSignInLongitude = "";
String tempSignOutLatitude = "";
String tempSignOutLongitude = "";
String tempSignOut = "";
Map<String, Object> checkInfo = new HashMap<>();
if ( legWorkInfos.size() == 1) {//只有一笔外勤卡直接算上班
Map<String, Object> temp = legWorkInfos.get(0);
String operateTime = Util.null2String(temp.get("operateTime"));
String longitude = Util.null2String(temp.get("longitude"));
String latitude = Util.null2String(temp.get("latitude"));
checkInfo.put("signDate", kqDate);//签到签退日期
checkInfo.put("signInTime", operateTime);//签到时间
checkInfo.put("signInLatitude", latitude);//签到纬度
checkInfo.put("signInLongitude", longitude);//签到经度
lsCheckInfo.put(userId + "|" + kqDate, checkInfo);
} else {
for ( Map<String, Object> temp : legWorkInfos) {
String operateTime = Util.null2String(temp.get("operateTime"));
String longitude = Util.null2String(temp.get("longitude"));
String latitude = Util.null2String(temp.get("latitude"));
if (operateTime.compareTo(workBeginTime) < 0) {//获取上班时间点之前最早的一笔卡
if (StringUtils.isBlank(tempSignIn)) {
tempSignIn = operateTime;
tempSignInLatitude = latitude;
tempSignInLongitude = longitude;
} else {
if ( operateTime.compareTo(tempSignIn) < 0 ) {
tempSignIn = operateTime;
tempSignInLatitude = latitude;
tempSignInLongitude = longitude;
}
}
}
if ( operateTime.compareTo(workBeginTime) > 0) {//下班卡取最晚的一笔
if (StringUtils.isBlank(tempSignIn)) {
tempSignOut = operateTime;
tempSignOutLatitude = latitude;
tempSignOutLongitude = longitude;
} else {
if ( operateTime.compareTo(tempSignOut) > 0 ) {
tempSignOut = operateTime;
tempSignOutLatitude = latitude;
tempSignOutLongitude = longitude;
}
}
}
}
checkInfo.put("signDate", kqDate);//签到签退日期
checkInfo.put("signInTime", tempSignIn);//签到时间
checkInfo.put("signInLatitude", tempSignInLatitude);//签到纬度
checkInfo.put("signInLongitude", tempSignInLongitude);//签到经度
checkInfo.put("signOutTime", tempSignOut);//签退时间
checkInfo.put("signOutLatitude", tempSignOutLatitude);//签退纬度
checkInfo.put("signOutLongitude", tempSignOutLongitude);//签退经度
lsCheckInfo.put(userId + "|" + kqDate, checkInfo);
}
}
}
}
HostarUtil hostarUtil = new HostarUtil();
//获取经纬度半径
Double radius = 0.00;
String acqRadiusSql = "select radius from uf_leWorkRadius where (isDelete is null or isDelete = 0 )";
rs.executeQuery(acqRadiusSql);
while (rs.next()) {
radius = Util.getDoubleValue(Util.null2String(rs.getString("radius")));
}
String MealAlloTableName = Util.null2String(bb.getPropValue("project_hostart", "MealAllowanceTableName"));
if (StringUtils.isNotBlank(MealAlloTableName)) {
//获取餐补判断时间
List<Map<String, String>> MealMap = new ArrayList<>();
String acqTimeSql = "select startTime, endTime from " + MealAlloTableName + " where (isDelete is null or isDelete = 0)";
rs.executeQuery(acqTimeSql);
while (rs.next()) {
String startTime = Util.null2String(rs.getString("startTime"));
String endTime = Util.null2String(rs.getString("endTime"));
Map<String, String> temp = new HashMap<>();
temp.put("startTime",startTime);
temp.put("endTime",endTime);
MealMap.add(temp);
}
//根据外勤打卡数据计算餐补数据
for (String key: lsCheckInfo.keySet()) {
String[] split = key.split("\\|");
String userId = split[0];
String kqDate = split[1];
Map<String, Object> temp = lsCheckInfo.get(key);
String signInTime = Util.null2String(temp.get("signInTime"));
String signOutTime = Util.null2String(temp.get("signOutTime"));
Double signInLatitude = Util.getDoubleValue(Util.null2String(temp.get("signInLatitude")));
Double signInLongitude = Util.getDoubleValue(Util.null2String(temp.get("signInLongitude")));
Double signOutLatitude = Util.getDoubleValue(Util.null2String(temp.get("signOutLatitude")));
Double signOutLongitude = Util.getDoubleValue(Util.null2String(temp.get("signOutLongitude")));
if (StringUtils.isNotBlank(signInTime) && StringUtils.isNotBlank(signOutTime) ) {
String lonAndLat = Util.null2String(evectionMap.get(kqDate + " |" + userId));
String[] split1 = lonAndLat.split("\\|");
Double longitude = Util.getDoubleValue(Util.null2String(split1[0]));
Double latitude = Util.getDoubleValue(Util.null2String(split1[1]));
//判断经纬度是否符合标准
Double distanceIn = hostarUtil.calculateDistance(latitude, longitude, signInLatitude, signInLongitude);//上班
Double distanceOut = hostarUtil.calculateDistance(latitude, longitude, signOutLatitude, signOutLongitude);//下班
if ( distanceIn<=radius && distanceOut<=radius) {
for (Map<String, String> me: MealMap) {
String startTime = me.get("startTime");
String endTime = me.get("endTime");
if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
startTime = startTime + ":00";
endTime = endTime + ":00";
}
if ( (signInTime.compareTo(startTime) <= 0) && (signOutTime.compareTo(endTime) >= 0) ) {
int t = Util.getIntValue(Util.null2String(datas.get("DailyMealAllow|" + resourceId + "|" + kqDate)));
if (t <= 0) {
datas.put("DailyMealAllow|" + resourceId + "|" + kqDate, 1);
} else {
t = t + 1;
datas.put("DailyMealAllow|" + resourceId + "|" + kqDate, t);
}
}
}
}
}
}
}
}catch (Exception e){
writeLog(e);
}
return datas;
}
/**
*
* @return
@ -1948,7 +2231,7 @@ public class KQReportBiz extends BaseBean {
text = SystemEnv.getHtmlLabelName(20081, user.getLanguage())+beLateMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage());
}
if (graveBeLateMins > 0) {//严重迟到
text = SystemEnv.getHtmlLabelName( 500546, user.getLanguage())+graveBeLateMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage());
text = SystemEnv.getHtmlLabelName(500546, user.getLanguage())+graveBeLateMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage());
}
if (leaveEarlyMins > 0) {//早退
text = SystemEnv.getHtmlLabelName(20082, user.getLanguage())+leaveEarlyMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage());

@ -309,7 +309,14 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
fieldValue = Util.null2String(signDetailInfo.get("signoutstatus3"));
data.add(fieldValue);
continue;
} else if(fieldName.equals("leave")){
} else if (fieldName.equals("mealAllowance")) {
int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate)));
if (intValue < 0) {
intValue = 0;
}
data.add(intValue);
continue;
} else if(fieldName.equals("leave")){
//请假
List<Map<String, Object>> allLeaveRules = KQLeaveRulesBiz.getAllLeaveRules();
Map<String, Object> leaveRule = null;
@ -407,7 +414,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
}catch (Exception e){
}
fieldValue = KQDurationCalculatorUtil.getDurationRound(businessLeave);
}else if(fieldName.equals("kqdate")){
} else if(fieldName.equals("kqdate")){
fieldValue=kqdate+" "+com.engine.portal.util.DateUtil.getDayWeekOfDate1(DateUtil.parseToDate(kqdate));
} else {
fieldValue = Util.null2String(rs.getString(fieldName));

@ -44,7 +44,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
String pageUid = PageUidFactory.getHrmPageUid("KQDailyReport");
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
ResourceComInfo resourceComInfo = new ResourceComInfo();
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
KQWorkTime kqWorkTime = new KQWorkTime();
@ -115,7 +115,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
column.put("width", Util.getIntValue(kqReportFieldComInfo.getWidth()));
}
if(kqReportFieldComInfo.getReportType1().equals("daily")){
column.put("isdaily", "1");
column.put("isdaily", "1");
}
column.put("showDetial",kqReportFieldComInfo.getShowDetial());
columns.add(column);
@ -139,10 +139,10 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
}
String backFields = " a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder," +
" b.kqdate, b.workdays,b.workMins,b.serialid, b.attendancedays,b.attendanceMins," +
" b.beLate,b.beLateMins,b.graveBeLate,b.graveBeLateMins,b.leaveEearly,b.leaveEarlyMins," +
" b.signdays,b.signmins, "+
" b.graveLeaveEarly,b.graveLeaveEarlyMins,b.absenteeism ,b.absenteeismMins ,(b.forgotCheck+"+forgotBeginWorkCheck_field+") forgotCheck ";
" b.kqdate, b.workdays,b.workMins,b.serialid, b.attendancedays,b.attendanceMins," +
" b.beLate,b.beLateMins,b.graveBeLate,b.graveBeLateMins,b.leaveEearly,b.leaveEarlyMins," +
" b.signdays,b.signmins, "+
" b.graveLeaveEarly,b.graveLeaveEarlyMins,b.absenteeism ,b.absenteeismMins ,(b.forgotCheck+"+forgotBeginWorkCheck_field+") forgotCheck ";
String sqlFrom = " from hrmresource a, kq_format_total b where a.id= b.resourceid and b.kqdate >='"+fromDate+"' and b.kqdate <='"+toDate+"'";
String sqlWhere = rightSql;
if(subCompanyId.length()>0){
@ -169,9 +169,9 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
}
if(status.length()>0){
if (!status.equals("8") && !status.equals("9")) {
sqlWhere += " and a.status = "+status+ "";
sqlWhere += " and a.status = "+status+ "";
}else if (status.equals("8")) {
sqlWhere += " and (a.status = 0 or a.status = 1 or a.status = 2 or a.status = 3) ";
sqlWhere += " and (a.status = 0 or a.status = 1 or a.status = 2 or a.status = 3) ";
}
}
@ -199,16 +199,14 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
if (rs.getDBType().equals("oracle")) {
sql = " select " + sql;
sql = "select * from ( select row_.*, rownum rownum_ from ( " + sql + " ) row_ where rownum <= "
+ (pageIndex * pageSize) + ") where rownum_ > " + ((pageIndex - 1) * pageSize);
+ (pageIndex * pageSize) + ") where rownum_ > " + ((pageIndex - 1) * pageSize);
} else if (rs.getDBType().equals("mysql")) {
sql = " select " + sql;
sql = "select t1.* from (" + sql + ") t1 limit " + ((pageIndex - 1) * pageSize) + "," + pageSize;
}
else if (rs.getDBType().equals("postgresql")) {
} else if (rs.getDBType().equals("postgresql")) {
sql = " select " + sql;
sql = "select t1.* from (" + sql + ") t1 limit " + pageSize+ " offset " + ((pageIndex - 1) * pageSize);
}
else {
} else {
orderBy = " order by dsporder asc, lastname asc, kqdate asc ";
descOrderBy = " order by dsporder desc, lastname desc, kqdate desc ";
if (pageIndex > 1) {
@ -217,7 +215,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
topSize = count - (pageSize * (pageIndex - 1));
}
sql = " select top " + topSize + " * from ( select top " + topSize + " * from ( select top "
+ (pageIndex * pageSize) + sql+" ) tbltemp1 " + descOrderBy + ") tbltemp2 " + orderBy;
+ (pageIndex * pageSize) + sql+" ) tbltemp1 " + descOrderBy + ") tbltemp2 " + orderBy;
} else {
sql = " select top " + pageSize + sql;
}
@ -225,7 +223,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
} else {
sql = " select " + sql;
}
Map<String,Object> flowData = kqReportBiz.getDailyFlowData(params,user);
Map<String,Object> flowData = kqReportBiz.getDailyFlowData(params,user);
// #1475814-概述:满足考勤报分部部门显示及导出时显示全路径
String fullPathMainKey = "show_full_path";
@ -292,7 +290,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
data.put(fieldName + "Id", fieldValueID);
data.put(fieldName, fieldValue);
} else if (kqReportFieldComInfo.getParentid().equals("overtime") || kqReportFieldComInfo.getParentid().equals("overtime_nonleave")
|| kqReportFieldComInfo.getParentid().equals("overtime_4leave") || fieldName.equals("businessLeave") || fieldName.equals("officialBusiness")) {
|| kqReportFieldComInfo.getParentid().equals("overtime_4leave") || fieldName.equals("businessLeave") || fieldName.equals("officialBusiness")) {
if (fieldName.equals("overtimeTotal")) {
double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id + "|" + kqdate + "|workingDayOvertime_4leave")));
workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave;
@ -309,7 +307,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
holidayOvertime_nonleave = holidayOvertime_nonleave < 0 ? 0 : holidayOvertime_nonleave;
fieldValue = KQDurationCalculatorUtil.getDurationRound(String.valueOf(workingDayOvertime_4leave + restDayOvertime_4leave + holidayOvertime_4leave +
workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave));
workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave));
} else {
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|" + kqdate + "|" + fieldName)));
}
@ -319,7 +317,13 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
if (fieldValue.length()>0) {//弹性工作制没有班次
data.put("serialid", shiftManagementToolKit.getShiftOnOffWorkSections(fieldValue, user.getLanguage()));
}
}else {
} else if (fieldName.equals("mealAllowance")) {
int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate)));
if (intValue < 0) {
intValue = 0;
}
data.put(fieldName, intValue);
} else {
fieldValue = Util.null2String(rs.getString(fieldName));
if (kqReportFieldComInfo.getUnittype().equals("2") && fieldValue.length() > 0) {
fieldValue = KQDurationCalculatorUtil.getDurationRound(("" + (Util.getDoubleValue(fieldValue) / 60.0)));
@ -327,7 +331,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
data.put(fieldName, fieldValue);
}
}
data.putAll(this.getSignDetailInfo(id, kqdate));
data.putAll(this.getSignDetailInfo(id, kqdate));
//请假
List<Map<String, Object>> allLeaveRules = KQLeaveRulesBiz.getAllLeaveRules();
@ -352,9 +356,9 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
BigDecimal b_leavebackData = new BigDecimal(leavebackData);
b_flowLeaveData = b_leaveData.subtract(b_leavebackData).toString();
if(Util.getDoubleValue(b_flowLeaveData, -1) < 0){
b_flowLeaveData = "0.0";
b_flowLeaveData = "0.0";
}
} catch (Exception e) {
kqLog.info("GetKQReportCmd:leaveData" + leaveData + ":leavebackData:" + leavebackData + ":" + e);
}
@ -475,10 +479,10 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
KQReportFieldComInfo kqReportFieldComInfo = new KQReportFieldComInfo();
while (kqReportFieldComInfo.next()){
if(kqReportFieldComInfo.getParentid().equals(parentid)) {
if(!kqReportFieldComInfo.getReportType().equals("daily"))continue;
if(!kqReportFieldComInfo.getReportType().equals("daily"))continue;
column = new HashMap();
column.put("title", SystemEnv.getHtmlLabelNames(kqReportFieldComInfo.getFieldlabel(), user.getLanguage()));
column.put("unit", KQReportBiz.getUnitType(kqReportFieldComInfo, user));
column.put("unit", KQReportBiz.getUnitType(kqReportFieldComInfo, user));
column.put("width", Util.getIntValue(kqReportFieldComInfo.getWidth()));
column.put("dataIndex", kqReportFieldComInfo.getFieldname());
column.put("key", kqReportFieldComInfo.getFieldname());
@ -503,12 +507,12 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
KQTimesArrayComInfo kqTimesArrayComInfo = new KQTimesArrayComInfo();
try{
sql = " select kqdate,resourceid,serialid,serialnumber,workbegindate,workbegintime, " +
" workenddate,workendtime,workmins,signindate,signintime,signoutdate,signouttime, \n" +
" attendanceMins,belatemins,graveBeLateMins,leaveearlymins,graveLeaveEarlyMins,absenteeismmins,forgotcheckMins,forgotBeginWorkCheckMins," +
" leaveMins,leaveInfo,evectionMins,outMins,signinid,signoutid \n" +
" from kq_format_detail b \n" +
" where resourceid = " + resourceId + " and kqdate ='" + kqDate + "' \n" +
" order by serialnumber \n";
" workenddate,workendtime,workmins,signindate,signintime,signoutdate,signouttime, \n" +
" attendanceMins,belatemins,graveBeLateMins,leaveearlymins,graveLeaveEarlyMins,absenteeismmins,forgotcheckMins,forgotBeginWorkCheckMins," +
" leaveMins,leaveInfo,evectionMins,outMins,signinid,signoutid \n" +
" from kq_format_detail b \n" +
" where resourceid = " + resourceId + " and kqdate ='" + kqDate + "' \n" +
" order by serialnumber \n";
rs.execute(sql);
while (rs.next()) {
String resourceid = Util.null2String(rs.getString("resourceid"));
@ -575,7 +579,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
}
}else{
if(workMins>0){
//弹性工时打卡时间取自签到签退数据
//弹性工时打卡时间取自签到签退数据
}
signStatusInfo = new HashMap();
signStatusInfo.put("leaveMins",leaveMins);

Loading…
Cancel
Save