Compare commits

...

2 Commits

@ -27,7 +27,9 @@ import weaver.soa.workflow.request.RequestService;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.time.Duration;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
@ -871,16 +873,26 @@ public class KQFormatData extends BaseBean {
} }
bb.writeLog("attendanceMins: " + attendanceMins); bb.writeLog("attendanceMins: " + attendanceMins);
bb.writeLog("absenteeismMins: " + absenteeismMins);
bb.writeLog("beLateMins: " + beLateMins); bb.writeLog("beLateMins: " + beLateMins);
bb.writeLog("leaveMins: " + leaveMins); bb.writeLog("leaveMins: " + leaveMins);
bb.writeLog("evectionMins: " + evectionMins);
bb.writeLog("outMins: " + outMins);
bb.writeLog("-----连班行政岗二开end-----"); bb.writeLog("-----连班行政岗二开end-----");
/*考勤二开--值夜班班次的考勤人员第二天排了行政班在8:05之前打卡行政班就算正常考勤end*/ /*考勤二开--值夜班班次的考勤人员第二天排了行政班在8:05之前打卡行政班就算正常考勤end*/
//考勤二开--取消漏签,改为旷工(规则工作时长就是480,直接全天旷工)start //考勤二开--取消漏签,改为旷工(规则工作时长就是480,直接全天旷工)start
bb.writeLog("absenteeismMins: " + absenteeismMins);
if ( forgotCheckMins > 0) { if ( forgotCheckMins > 0) {
absenteeismMins = 480; //优化:请假,出差,公出存在数据时,旷工时长需要扣减
forgotCheckMins = 0; forgotCheckMins = 0;
attendanceMins = 0; attendanceMins = 0;
if (evectionMins == 0 && leaveMins == 0 && outMins == 0) {
absenteeismMins = 480;
} else {
absenteeismMins = 480 - leaveMins - evectionMins - outMins;
}
} else { } else {
//计算实际出勤时间(出差公出算出勤)=应出勤-旷工-请假-迟到-早退 //计算实际出勤时间(出差公出算出勤)=应出勤-旷工-请假-迟到-早退
attendanceMins = workMins - absenteeismMins-leaveMins-beLateMins-graveBeLateMins-leaveEarlyMins-graveLeaveEarlyMins; attendanceMins = workMins - absenteeismMins-leaveMins-beLateMins-graveBeLateMins-leaveEarlyMins-graveLeaveEarlyMins;
@ -905,7 +917,9 @@ public class KQFormatData extends BaseBean {
rs.executeUpdate(delSql ); rs.executeUpdate(delSql );
//迟到、早退(注意严重迟到、严重早退的情况) belateMins--迟到 graveBeLateMins--严重迟到 leaveEarlyMins--早退 graveLeaveEarlyMins--严重早退 //迟到、早退(注意严重迟到、严重早退的情况) belateMins--迟到 graveBeLateMins--严重迟到 leaveEarlyMins--早退 graveLeaveEarlyMins--严重早退
String changeBeforeData = "beLateMins:" + beLateMins + "graveBeLateMins:" + graveBeLateMins + "leaveEarlyMins:" + leaveEarlyMins + "graveLeaveEarlyMins:" + graveLeaveEarlyMins; String changeBeforeData = "beLateMins:" + beLateMins + "graveBeLateMins:" + graveBeLateMins + "leaveEarlyMins:" + leaveEarlyMins + "graveLeaveEarlyMins:" + graveLeaveEarlyMins;
bb.writeLog("changeBeforeData: " + changeBeforeData);
int abnormalMins = beLateMins + graveBeLateMins + leaveEarlyMins + graveLeaveEarlyMins; int abnormalMins = beLateMins + graveBeLateMins + leaveEarlyMins + graveLeaveEarlyMins;
bb.writeLog("abnormalMins: " + abnormalMins);
if ( abnormalMins > 0 && abnormalMins <= 30 ) { if ( abnormalMins > 0 && abnormalMins <= 30 ) {
beLateMins = 0; beLateMins = 0;
graveBeLateMins = 0; graveBeLateMins = 0;
@ -947,8 +961,67 @@ public class KQFormatData extends BaseBean {
} }
if ( abnormalMins > 120) { if ( abnormalMins > 120) {
absenteeismMins = 240; absenteeismMins = 240;
beLateMins = 0;
graveBeLateMins = 0;
leaveEarlyMins = 0;
graveLeaveEarlyMins = 0;
}
//增加功能--如果上班卡和下班卡相差十分钟,旷工计一天
String inTemp = "";
String outTemp = "";
for (int j = 0; lsCheckInfo != null && j < lsCheckInfo.size(); j++) {
Map<String, Object> checkInfo = (Map<String, Object>) lsCheckInfo.get(j);
String signType = Util.null2String(checkInfo.get("signType"));
String signTime = Util.null2String(checkInfo.get("signTime"));
String signDate = Util.null2String(checkInfo.get("signDate"));
if (signType.equals("1")) {
inTemp = signDate + " " + signTime;
}
if (signType.equals("2")) {
outTemp = signDate + " " + signTime;
} }
}
bb.writeLog("inTemp" + inTemp);
bb.writeLog("outTemp" + outTemp);
if(StringUtils.isNotBlank(inTemp) && StringUtils.isNotBlank(outTemp)){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime startTime = LocalDateTime.parse(inTemp, formatter);
LocalDateTime endTime = LocalDateTime.parse(outTemp, formatter);
// 计算两个LocalDateTime对象之间的Duration
Duration duration = Duration.between(startTime, endTime);
// 将Duration转换为分钟
long minutesLong = duration.toMinutes();
int minutes = (int) minutesLong;
if(minutes<=10){
//优化:考虑请假公出出差的时长
if (evectionMins == 0 && leaveMins == 0 && outMins == 0) {
absenteeismMins = 480;
} else {
absenteeismMins = 480 - leaveMins - evectionMins - outMins;
}
beLateMins = 0;
graveBeLateMins = 0;
leaveEarlyMins = 0;
graveLeaveEarlyMins = 0;
}
}
//计算实际出勤时间(出差公出算出勤)=应出勤-旷工-请假-迟到-早退 //计算实际出勤时间(出差公出算出勤)=应出勤-旷工-请假-迟到-早退
bb.writeLog("workMins: " + workMins);
bb.writeLog("absenteeismMins: " + absenteeismMins);
bb.writeLog("leaveMins: " + leaveMins);
bb.writeLog("beLateMins: " + beLateMins);
bb.writeLog("graveBeLateMins: " + graveBeLateMins);
bb.writeLog("leaveEarlyMins: " + leaveEarlyMins);
bb.writeLog("graveLeaveEarlyMins: " + graveLeaveEarlyMins);
attendanceMins = workMins - absenteeismMins-leaveMins-beLateMins-graveBeLateMins-leaveEarlyMins-graveLeaveEarlyMins; attendanceMins = workMins - absenteeismMins-leaveMins-beLateMins-graveBeLateMins-leaveEarlyMins-graveLeaveEarlyMins;
// ssutil.customLog(); // ssutil.customLog();
/*考勤二开--阶梯式记旷工end*/ /*考勤二开--阶梯式记旷工end*/

@ -430,6 +430,12 @@ public class KQReportBiz extends BaseBean {
//考勤二开--异常考勤转事假 //考勤二开--异常考勤转事假
datas.putAll(getAbnAttToComLeaveData(params,user)); datas.putAll(getAbnAttToComLeaveData(params,user));
//考勤二开--上月请假
datas.putAll(getFlowLastLeaveData(params,user));
//考勤二开--上月销假
datas.putAll(getFlowLeaveLastBackData(params,user));
//考勤二开--上月加班
datas.putAll(getFlowLastOverTimeDataNew(params,user));
}catch (Exception e){ }catch (Exception e){
writeLog(e); writeLog(e);
@ -1303,14 +1309,14 @@ public class KQReportBiz extends BaseBean {
} }
//再查批量加班申请流程 //再查批量加班申请流程
String overtimeBatchTableName = basebean.getPropValue("project_sskj","overtimeBatchTableName"); String overtimeBatchTableName = basebean.getPropValue("project_sskj","overtimeBatchTableName");
String acqOverTimeBatchSql = "select jbry, ksrq, kssj, jsrq, jssj from ( " + String acqOverTimeBatchSql = "select resourceid, ksrq, kssj, jsrq, jssj from ( " +
" select a.jbry, a.ksrq, a.kssj, a.jsrq, a.jssj, b.subcompanyid1, b.departmentid, b.managerstr, b.managerid, b.loginid " + " select a.jbry as resourceid, a.ksrq, a.kssj, a.jsrq, a.jssj, b.subcompanyid1, b.departmentid, b.managerstr, b.managerid, b.loginid " +
" FROM "+overtimeBatchTableName+"_dt1 a " + " FROM "+overtimeBatchTableName+"_dt1 a " +
" left join hrmresource b on b.id = a.jbry " + " left join hrmresource b on b.id = a.jbry " +
" ) c where c.ksrq >= '"+fromDate+"' and c.jsrq <='" + toDate + "' " + sqlWhere; " ) c where c.ksrq >= '"+fromDate+"' and c.jsrq <='" + toDate + "' " + sqlWhere;
rs.executeQuery(acqOverTimeBatchSql); rs.executeQuery(acqOverTimeBatchSql);
while (rs.next()) { while (rs.next()) {
String resourceid = Util.null2String(rs.getString("jbry")); String resourceid = Util.null2String(rs.getString("resourceid"));
String fromdate = Util.null2String(rs.getString("ksrq")); String fromdate = Util.null2String(rs.getString("ksrq"));
String fromtime = Util.null2String(rs.getString("kssj")); String fromtime = Util.null2String(rs.getString("kssj"));
String todate = Util.null2String(rs.getString("jsrq")); String todate = Util.null2String(rs.getString("jsrq"));
@ -1727,6 +1733,100 @@ public class KQReportBiz extends BaseBean {
return datas; return datas;
} }
/**
*
* @param params
* @param user
* @return
*/
public Map<String,Object> getFlowLastLeaveData(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 ="7";
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<>'' ");
}
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 +
" group by resourceid, newleavetype, durationrule ";
rs.execute(sql);
while (rs.next()) {
String resourceid = rs.getString("resourceid");
String newleavetype = rs.getString("newleavetype");
String durationrule = rs.getString("durationrule");
double value = rs.getDouble("val")<0?0:rs.getDouble("val");
if( !newleavetype.equals("5")){
continue;
}
double proportion = Util.getDoubleValue(kqLeaveRulesComInfo.getProportion(newleavetype));
if(KQUnitBiz.isLeaveHour(newleavetype, kqLeaveRulesComInfo)){//按小时
if(!KQUnitBiz.isLeaveHour(durationrule)){
if(proportion>0) value = value*proportion;
}
}else{//按天
if(KQUnitBiz.isLeaveHour(durationrule)){
if(proportion>0) value = value/proportion;
}
}
String key = resourceid+"|lastleaveType_"+newleavetype;
if(datas.containsKey(key)){
value += Util.getDoubleValue(Util.null2String(datas.get(key)));
}
//df.format 默认是不四舍五入的 0.125这样的就会直接变成0.12了
df.setMaximumFractionDigits(5);
datas.put(key,format(value));
}
}catch (Exception e){
writeLog(e);
}
return datas;
}
//获取打卡数据用于判断外勤,补卡等信息=============================== //获取打卡数据用于判断外勤,补卡等信息===============================
public Map<String,Object> getCardMap(Map<String,Object> params, User user){ public Map<String,Object> getCardMap(Map<String,Object> params, User user){
@ -1903,6 +2003,97 @@ public class KQReportBiz extends BaseBean {
return datas; return datas;
} }
/**
*
* @param params
* @param user
* @return
*/
public Map<String,Object> getFlowLeaveLastBackData(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 ="7";
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<>'' ");
}
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 +
" group by resourceid, newleavetype, durationrule ";
rs.execute(sql);
while (rs.next()) {
String resourceid = rs.getString("resourceid");
String newleavetype = rs.getString("newleavetype");
String durationrule = rs.getString("durationrule");
double value = rs.getDouble("val")<0?0:rs.getDouble("val");
double proportion = Util.getDoubleValue(kqLeaveRulesComInfo.getProportion(newleavetype));
if(KQUnitBiz.isLeaveHour(newleavetype,kqLeaveRulesComInfo)){//按小时
if(!KQUnitBiz.isLeaveHour(durationrule)){
if(proportion>0) value = value*proportion;
}
}else{//按天
if(KQUnitBiz.isLeaveHour(durationrule)){
if(proportion>0) value = value/proportion;
}
}
String key = resourceid+"|lastleavebackType_"+newleavetype;
if(datas.containsKey(key)){
value += Util.getDoubleValue(Util.null2String(datas.get(key)));
}
//df.format 默认是不四舍五入的 0.125这样的就会直接变成0.12了
df.setMaximumFractionDigits(5);
datas.put(key,format(value));
}
}catch (Exception e){
writeLog(e);
}
return datas;
}
/** /**
* *
* @param params * @param params
@ -2476,6 +2667,113 @@ public class KQReportBiz extends BaseBean {
return datas; return datas;
} }
/**
*
* @return
*/
public Map<String,Object> getFlowLastOverTimeDataNew(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
try{
KQOvertimeRulesBiz kqOvertimeRulesBiz = new KQOvertimeRulesBiz();
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 a.id 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<>'' ");
}
int uintType = kqOvertimeRulesBiz.getMinimumUnit();//当前加班单位
double hoursToDay = kqOvertimeRulesBiz.getHoursToDay();//当前天跟小时计算关系
String valueField = "";
sql = " select resourceid,changeType, sum(cast(duration_min as decimal(18,4))) as val,paidLeaveEnable "+
" from hrmresource a, kq_flow_overtime b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere+
" group by resourceid,changeType,paidLeaveEnable ";
rs.execute(sql);
kqLog.info("getFlowOverTimeDataNew:sql:"+sql);
while (rs.next()) {
String resourceid = rs.getString("resourceid");
String paidLeaveEnable = rs.getString("paidLeaveEnable");
int changeType =rs.getInt("changeType");//1-节假日、2-工作日、3-休息日
double value = rs.getDouble("val")<0?0:rs.getDouble("val");
if(uintType==3 || uintType== 5 || uintType== 6){//按小时计算
value = Util.getDoubleValue(KQDurationCalculatorUtil.getDurationRound(value/(60.0)+""));
}else{//按天计算
value = Util.getDoubleValue(KQDurationCalculatorUtil.getDurationRound(value/(60.0*hoursToDay)+""));
}
String flowType = "";
if(changeType==1){
flowType = "holidayOvertime";
}else if(changeType==2){
flowType = "workingDayOvertime";
}else if(changeType==3){
flowType = "restDayOvertime";
}
if("1".equalsIgnoreCase(paidLeaveEnable)){
//1表示关联调休
flowType += "_4leave";
}else{
//0表示不关联调休
flowType += "_nonleave";
}
String key = resourceid+"|"+flowType+"last";
//df.format 默认是不四舍五入的 0.125这样的就会直接变成0.12了
df.setMaximumFractionDigits(5);
if(datas.containsKey(key)){
double tmpVal = Util.getDoubleValue(Util.null2String(datas.get(key)),0.0);
tmpVal += value;
datas.put(key,format(tmpVal));
}else{
datas.put(key,format(value));
}
}
}catch (Exception e){
writeLog(e);
}
return datas;
}
/** /**
* *
@ -3223,7 +3521,7 @@ public class KQReportBiz extends BaseBean {
} }
} }
if(text.equals("")){ if(text.equals("")){
boolean needCal = new KQFormatBiz().needCal(workdate,worktime); boolean needCal = new KQFormatBiz().needCal(workdate,worktime,isneedcal);
text = needCal?SystemEnv.getHtmlLabelName(225, user.getLanguage()):""; text = needCal?SystemEnv.getHtmlLabelName(225, user.getLanguage()):"";
} }
}else{ }else{

@ -543,15 +543,24 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
data.add(fieldValue); data.add(fieldValue);
} }
}else if(fieldName.equals("overtime")){ } else if(fieldName.equals("reissuecard")){//补卡
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id +"|"+kqdate+ "|workingDayOvertime_nonleave"))); int intValue = Util.getIntValue(Util.null2String(flowData.get(id +"|"+kqdate + "|reissueCard")));
data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("workingDayOvertime_nonleave")))); if (intValue < 0) {
fieldValue = "0";
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id +"|"+kqdate+ "|restDayOvertime_nonleave"))); } else {
data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("restDayOvertime_nonleave")))); fieldValue = String.valueOf(intValue);
}
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id +"|"+kqdate+ "|holidayOvertime_nonleave"))); data.add(fieldValue);
data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("holidayOvertime_nonleave")))); continue;
} else if(fieldName.equals("overtime")){
// fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id +"|"+kqdate+ "|workingDayOvertime_nonleave")));
// data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("workingDayOvertime_nonleave"))));
//
// fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id +"|"+kqdate+ "|restDayOvertime_nonleave")));
// data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("restDayOvertime_nonleave"))));
//
// fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id +"|"+kqdate+ "|holidayOvertime_nonleave")));
// data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("holidayOvertime_nonleave"))));
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id +"|"+kqdate+ "|workingDayOvertime_4leave"))); fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id +"|"+kqdate+ "|workingDayOvertime_4leave")));
data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("workingDayOvertime_4leave")))); data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("workingDayOvertime_4leave"))));
@ -806,7 +815,8 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
} }
}else if(parentid.equals("overtime")){ }else if(parentid.equals("overtime")){
String[] overtimeChild = {"overtime_nonleave","overtime_4leave","overtimeTotal"}; // String[] overtimeChild = {"overtime_nonleave","overtime_4leave","overtimeTotal"};
String[] overtimeChild = {"overtime_4leave","overtimeTotal"};
for(int i=0;i<overtimeChild.length;i++){ for(int i=0;i<overtimeChild.length;i++){
String id = overtimeChild[i]; String id = overtimeChild[i];
title = new HashMap(); title = new HashMap();

@ -522,16 +522,25 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
data.add(restdayValue); data.add(restdayValue);
data.add(fieldValue); data.add(fieldValue);
continue;
}else if(fieldName.equals("reissuecard")){//补卡
int intValue = Util.getIntValue(Util.null2String(flowData.get(id + "|reissueCard")));
if (intValue < 0) {
fieldValue = "0";
} else {
fieldValue = String.valueOf(intValue);
}
data.add(fieldValue);
continue; continue;
} else if(fieldName.equals("overtime")){ } else if(fieldName.equals("overtime")){
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|workingDayOvertime_nonleave"))); // fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|workingDayOvertime_nonleave")));
data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("workingDayOvertime_nonleave")))); // data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("workingDayOvertime_nonleave"))));
//
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|restDayOvertime_nonleave"))); // fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|restDayOvertime_nonleave")));
data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("restDayOvertime_nonleave")))); // data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("restDayOvertime_nonleave"))));
//
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|holidayOvertime_nonleave"))); // fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|holidayOvertime_nonleave")));
data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("holidayOvertime_nonleave")))); // data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("holidayOvertime_nonleave"))));
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|workingDayOvertime_4leave"))); fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|workingDayOvertime_4leave")));
data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("workingDayOvertime_4leave")))); data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("workingDayOvertime_4leave"))));
@ -789,7 +798,8 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
titleList.add(title); titleList.add(title);
} }
}else if(parentid.equals("overtime")){ }else if(parentid.equals("overtime")){
String[] overtimeChild = {"overtime_nonleave","overtime_4leave","overtimeTotal"}; // String[] overtimeChild = {"overtime_nonleave","overtime_4leave","overtimeTotal"};
String[] overtimeChild = {"overtime_4leave","overtimeTotal"};
for(int i=0;i<overtimeChild.length;i++){ for(int i=0;i<overtimeChild.length;i++){
String id = overtimeChild[i]; String id = overtimeChild[i];
title = new HashMap(); title = new HashMap();

@ -233,6 +233,10 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
} else { } else {
sql = " select " + sql; sql = " select " + sql;
} }
boolean isneedcal = KQSettingsBiz.getKqformatAccurate();
params.put("isneedcal",isneedcal?"1":"0");
Map<String,Object> flowData = kqReportBiz.getDailyFlowData(params,user); Map<String,Object> flowData = kqReportBiz.getDailyFlowData(params,user);
Map<String,String> serialdata = new HashMap<>(); Map<String,String> serialdata = new HashMap<>();
/*考勤二开--转事假start*/ /*考勤二开--转事假start*/
@ -512,6 +516,17 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
data.put("laborHoursTotal", fieldValue); data.put("laborHoursTotal", fieldValue);
} }
}else if(fieldName.equals("reissuecard")){//补卡
bb.writeLog("补卡id:" + id);
bb.writeLog("补卡kqdate:" + kqdate);
bb.writeLog("补卡key:" + id +"|"+kqdate + "|reissueCard");
int intValue = Util.getIntValue(Util.null2String(flowData.get(id +"|"+kqdate + "|reissueCard")));
if (intValue < 0) {
fieldValue = "0";
} else {
fieldValue = String.valueOf(intValue);
}
data.put(fieldName, fieldValue);
} else { } else {
fieldValue = Util.null2String(rs.getString(fieldName)); fieldValue = Util.null2String(rs.getString(fieldName));
if (kqReportFieldComInfo.getUnittype().equals("2") && fieldValue.length() > 0) { if (kqReportFieldComInfo.getUnittype().equals("2") && fieldValue.length() > 0) {
@ -713,7 +728,8 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
lsChildColumns.add(column); lsChildColumns.add(column);
} }
}else if(parentid.equals("overtime")){ }else if(parentid.equals("overtime")){
String[] overtimeChild = {"overtime_nonleave","overtime_4leave","overtimeTotal"}; // String[] overtimeChild = {"overtime_nonleave","overtime_4leave","overtimeTotal"};
String[] overtimeChild = {"overtime_4leave","overtimeTotal"};
for(int i=0;i<overtimeChild.length;i++){ for(int i=0;i<overtimeChild.length;i++){
String id = overtimeChild[i]; String id = overtimeChild[i];
column = new HashMap(); column = new HashMap();

@ -6,6 +6,7 @@ import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext; import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext; import com.engine.core.interceptor.CommandContext;
import com.engine.kq.biz.*; import com.engine.kq.biz.*;
import com.engine.kq.enums.KqSplitFlowTypeEnum;
import com.engine.kq.util.KQDurationCalculatorUtil; import com.engine.kq.util.KQDurationCalculatorUtil;
import com.engine.kq.util.PageUidFactory; import com.engine.kq.util.PageUidFactory;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -25,8 +26,12 @@ import weaver.systeminfo.SystemEnv;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import static com.api.formmode.cache.ModeExpandPageComInfo.groupid;
public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> { public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
BaseBean bb = new BaseBean(); BaseBean bb = new BaseBean();
@ -457,6 +462,118 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
for(int i=0;serialIds!=null&&i<serialIds.size();i++){ for(int i=0;serialIds!=null&&i<serialIds.size();i++){
data.put(serialIds.get(i), kqReportBiz.getSerialCount(id,fromDate,toDate,serialIds.get(i))); data.put(serialIds.get(i), kqReportBiz.getSerialCount(id,fromDate,toDate,serialIds.get(i)));
} }
}else if(fieldName.equals("reissuecard")){
int intValue = Util.getIntValue(Util.null2String(flowData.get(id + "|reissueCard")));
if (intValue < 0) {
fieldValue = "0";
} else {
fieldValue = String.valueOf(intValue);
}
}else if(fieldName.equals("thisRemOt")){//当月加班剩余
double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|workingDayOvertime_4leave")));
workingDayOvertime_4leave = workingDayOvertime_4leave<0?0:workingDayOvertime_4leave;
double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|restDayOvertime_4leave")));
restDayOvertime_4leave = restDayOvertime_4leave<0?0:restDayOvertime_4leave;
double holidayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|holidayOvertime_4leave")));
holidayOvertime_4leave = holidayOvertime_4leave<0?0:holidayOvertime_4leave;
double workingDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|workingDayOvertime_nonleave")));
workingDayOvertime_nonleave = workingDayOvertime_nonleave<0?0:workingDayOvertime_nonleave;
double restDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|restDayOvertime_nonleave")));
restDayOvertime_nonleave = restDayOvertime_nonleave<0?0:restDayOvertime_nonleave;
double holidayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|holidayOvertime_nonleave")));
holidayOvertime_nonleave = holidayOvertime_nonleave<0?0:holidayOvertime_nonleave;
double overtimeDuration = workingDayOvertime_4leave+restDayOvertime_4leave+holidayOvertime_4leave+
workingDayOvertime_nonleave+restDayOvertime_nonleave+holidayOvertime_nonleave;
//请假时长统计
String leaveData = Util.null2String(flowData.get(id+"|leaveType_5"));
String leavebackData = Util.null2s(Util.null2String(flowData.get(id+"|leavebackType_5")),"0.0");
String b_flowLeaveData = "";
String flowLeaveData = "";
try{
//以防止出现精度问题
if(leaveData.length() == 0){
leaveData = "0.0";
}
if(leavebackData.length() == 0){
leavebackData = "0.0";
}
BigDecimal b_leaveData = new BigDecimal(leaveData);
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";
}
}catch (Exception e){
writeLog("GetKQReportCmd:leaveData"+leaveData+":leavebackData:"+leavebackData+":"+e);
}
//考虑下冻结的数据
if(b_flowLeaveData.length() > 0){
flowLeaveData = KQDurationCalculatorUtil.getDurationRound(b_flowLeaveData);
}else{
flowLeaveData = KQDurationCalculatorUtil.getDurationRound(Util.null2String(Util.getDoubleValue(leaveData,0.0)-Util.getDoubleValue(leavebackData,0.0)));
}
double leaveDuration = Math.max(Util.getDoubleValue(Util.null2String(flowLeaveData)),0.00);
double temp = overtimeDuration - leaveDuration;
fieldValue = String.valueOf(temp);
} else if(fieldName.equals("lastRemOt")){//上月加班剩余
double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|workingDayOvertime_4leavelast")));
workingDayOvertime_4leave = workingDayOvertime_4leave<0?0:workingDayOvertime_4leave;
double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|restDayOvertime_4leavelast")));
restDayOvertime_4leave = restDayOvertime_4leave<0?0:restDayOvertime_4leave;
double holidayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|holidayOvertime_4leavelast")));
holidayOvertime_4leave = holidayOvertime_4leave<0?0:holidayOvertime_4leave;
double workingDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|workingDayOvertime_nonleavelast")));
workingDayOvertime_nonleave = workingDayOvertime_nonleave<0?0:workingDayOvertime_nonleave;
double restDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|restDayOvertime_nonleavelast")));
restDayOvertime_nonleave = restDayOvertime_nonleave<0?0:restDayOvertime_nonleave;
double holidayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|holidayOvertime_nonleavelast")));
holidayOvertime_nonleave = holidayOvertime_nonleave<0?0:holidayOvertime_nonleave;
double overtimeDuration = workingDayOvertime_4leave+restDayOvertime_4leave+holidayOvertime_4leave+
workingDayOvertime_nonleave+restDayOvertime_nonleave+holidayOvertime_nonleave;
//请假时长统计
String leaveData = Util.null2String(flowData.get(id+"|lastleaveType_5"));
String leavebackData = Util.null2s(Util.null2String(flowData.get(id+"|lastleavebackType_5")),"0.0");
String b_flowLeaveData = "";
String flowLeaveData = "";
try{
//以防止出现精度问题
if(leaveData.length() == 0){
leaveData = "0.0";
}
if(leavebackData.length() == 0){
leavebackData = "0.0";
}
BigDecimal b_leaveData = new BigDecimal(leaveData);
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";
}
}catch (Exception e){
writeLog("GetKQReportCmd:leaveData"+leaveData+":leavebackData:"+leavebackData+":"+e);
}
//考虑下冻结的数据
if(b_flowLeaveData.length() > 0){
flowLeaveData = KQDurationCalculatorUtil.getDurationRound(b_flowLeaveData);
}else{
flowLeaveData = KQDurationCalculatorUtil.getDurationRound(Util.null2String(Util.getDoubleValue(leaveData,0.0)-Util.getDoubleValue(leavebackData,0.0)));
}
double leaveDuration = Math.max(Util.getDoubleValue(Util.null2String(flowLeaveData)),0.00);
double temp = overtimeDuration - leaveDuration;
fieldValue = String.valueOf(temp);
} else if(kqReportFieldComInfo.getParentid().equals("overtime")||kqReportFieldComInfo.getParentid().equals("overtime_nonleave") } 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")){ if(fieldName.equals("overtimeTotal")){
@ -502,7 +619,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
}else{ }else{
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id+"|"+fieldName))); fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id+"|"+fieldName)));
} }
}else if("holiDuration".equals(fieldName)){ } else if("holiDuration".equals(fieldName)){
int intValue = Util.getIntValue(Util.null2String(flowData.get("HoliDurationData|" + id))); int intValue = Util.getIntValue(Util.null2String(flowData.get("HoliDurationData|" + id)));
if (intValue >= 0) { if (intValue >= 0) {
data.put(fieldName,intValue); data.put(fieldName,intValue);
@ -529,7 +646,49 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
} }
bb.writeLog("劳务公司 fieldValue: " + fieldValue); bb.writeLog("劳务公司 fieldValue: " + fieldValue);
data.put(fieldName, fieldValue); data.put(fieldName, fieldValue);
}else if ("laborHours".equals(kqReportFieldComInfo.getParentid()) ) { } else if ("startOrEndDays".equals(fieldName)) {//考勤二开--入离职工时
int absenceDays = 0;
if ("3".equals(typeselect) || "7".equals(typeselect)) {
Map<String, String> employAndResignDates = getEmployAndResignDateById(id);
String companystartdate = Util.null2String(employAndResignDates.get("companystartdate"));
String resignDate = Util.null2String(employAndResignDates.get("resignDate"));
if (StringUtils.isNotBlank(companystartdate) && StringUtils.isBlank(resignDate)) {
String substring1 = companystartdate.substring(0, 7);
String substring2 = fromDate.substring(0, 7);
if (substring1.equals(substring2)) {
absenceDays = getAbsenceDays(id, fromDate, companystartdate, toDate);
}
} else if (StringUtils.isBlank(companystartdate) && StringUtils.isNotBlank(resignDate)) {
String substring1 = resignDate.substring(0, 7);
String substring2 = toDate.substring(0, 7);
if (substring1.equals(substring2)) {
absenceDays = getAbsenceDays(id, resignDate, toDate, fromDate);
}
} else if (StringUtils.isNotBlank(companystartdate) && StringUtils.isNotBlank(resignDate)) {
String substring1 = companystartdate.substring(0, 7);
String substring2 = resignDate.substring(0, 7);
String substring3 = fromDate.substring(0, 7);
String substring4 = toDate.substring(0, 7);
if ( substring1.equals(substring2) && substring2.equals(substring3)
&& substring3.equals(substring4) ) {//考勤月入职且离职
int temp1 = getAbsenceDays(id, fromDate, companystartdate, toDate);
int temp2 = getAbsenceDays(id, resignDate, toDate, fromDate);
absenceDays = temp1 + temp2;
} else if (substring1.equals(substring3) && !substring2.equals(substring3)) {//考勤月入职,非考勤月离职
absenceDays = getAbsenceDays(id, fromDate, companystartdate, toDate);
} else if ( !substring1.equals(substring3) && !substring2.equals(substring3)){//非考勤月入职,考勤月离职
absenceDays = getAbsenceDays(id, resignDate, toDate, fromDate);
}
}
}
fieldValue = String.valueOf(absenceDays);
data.put(fieldName, fieldValue);
} else if ("laborHours".equals(kqReportFieldComInfo.getParentid()) ) {
if ("laborHoursTotal".equals(fieldName)) { if ("laborHoursTotal".equals(fieldName)) {
// //
@ -728,6 +887,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
} }
return retmap; return retmap;
} }
/*获取人员多级部门*/ /*获取人员多级部门*/
private String getMultiLevelDepartmentById(String id){ private String getMultiLevelDepartmentById(String id){
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
@ -756,6 +916,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
} }
return str; return str;
} }
/*获取人员加班类型*/ /*获取人员加班类型*/
private String getOvertimeTypeById(String id){ private String getOvertimeTypeById(String id){
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
@ -768,6 +929,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
} }
return field35; return field35;
} }
/*获取人员入离职时间*/ /*获取人员入离职时间*/
private Map<String,String> getEmployAndResignDateById(String id){ private Map<String,String> getEmployAndResignDateById(String id){
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
@ -834,7 +996,8 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
lsChildColumns.add(column); lsChildColumns.add(column);
} }
}else if(parentid.equals("overtime")){ }else if(parentid.equals("overtime")){
String[] overtimeChild = {"overtime_nonleave","overtime_4leave","overtimeTotal"}; // String[] overtimeChild = {"overtime_nonleave","overtime_4leave","overtimeTotal"};
String[] overtimeChild = {"overtime_4leave","overtimeTotal"};
for(int i=0;i<overtimeChild.length;i++){ for(int i=0;i<overtimeChild.length;i++){
String id = overtimeChild[i]; String id = overtimeChild[i];
column = new HashMap(); column = new HashMap();
@ -929,6 +1092,42 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
return lsChildColumns; return lsChildColumns;
} }
public int getAbsenceDays(String resourceId, String startDate, String endDate, String groupDate){
int days = 0;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate startDateL = LocalDate.parse(startDate, formatter);
LocalDate endDateL = LocalDate.parse(endDate, formatter);
List<String> dates = new ArrayList<>();
LocalDate currentDate = startDateL;
while (!currentDate.isAfter(endDateL)) {
dates.add("'"+currentDate.format(formatter)+"'");
currentDate = currentDate.plusDays(1);
}
String selDates = String.join(",", dates);
int size = dates.size();
KQGroupMemberComInfo kqGroupMemberComInfo = new KQGroupMemberComInfo();
String groupid = Util.null2String(kqGroupMemberComInfo.getKQGroupId(resourceId, groupDate));
String acqNumberSql = "select count(*) as number from KQ_HolidaySet where groupid = " + groupid +" changeType in (1,3) " +
"and holidayDate in ("+selDates+")";
bb.writeLog("acqNumberSql: " + acqNumberSql);
RecordSet rs = new RecordSet();
rs.executeQuery(acqNumberSql);
int number = 0;
while (rs.next()) {
number = Math.max(Util.getIntValue(Util.null2String(rs.getString("number"))), 0);
}
days = size - number;
return days;
}
@Override @Override
public BizLogContext getLogContext() { public BizLogContext getLogContext() {
return null; return null;

@ -61,7 +61,9 @@ public class SskjUtil {
long NTime =df.parse(newTime).getTime(); long NTime =df.parse(newTime).getTime();
//从对象中拿到时间 //从对象中拿到时间
long OTime = df.parse(oldTime).getTime(); long OTime = df.parse(oldTime).getTime();
diff=(NTime-OTime)/1000/60; //分钟数30向下取整
long temp = (NTime-OTime) /1000 /60;
diff = (Integer.parseInt(String.valueOf(temp)) / 30) * 30;
}catch (Exception e) { }catch (Exception e) {
basebean.writeLog("SskjUtil getTime Exception: " + e); basebean.writeLog("SskjUtil getTime Exception: " + e);
} }

Loading…
Cancel
Save