报表代码还原

dev_zm
李栋 1 year ago
parent 57a78725a6
commit cff3198ba1

@ -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;
@ -85,7 +82,7 @@ public class KQReportBiz extends BaseBean {
try {
Map<String, Object> kqdate = null;
List<Object> datas = null;
Map<String,Object> data = null;
Map<String, Object> data = null;
sql = " select kqdate,serialid, workbegindate, workbegintime,workenddate, workendtime," +
" signintime,signouttime,beLateMins,graveBeLateMins,leaveEarlyMins,graveLeaveEarlyMins," +
" absenteeismMins, forgotCheckMins,forgotBeginWorkCheckMins,otherinfo "+
@ -150,7 +147,7 @@ public class KQReportBiz extends BaseBean {
kqdate = new HashMap<>();
datas = new ArrayList<>();
kqdate.put("kqdate",Util.null2String(rs.getString("kqdate")));
kqdate.put("kqdate", Util.null2String(rs.getString("kqdate")));
if(workbegindate.length()>0){
data = new HashMap<>();
data.put("workbegindate",workbegindate);
@ -294,23 +291,23 @@ public class KQReportBiz extends BaseBean {
}else if(fieldName.equals("officialBusiness")){
unitType = KQExitRulesBiz.getMinimumUnit().equals("3")?"2":"1";//单位类型
}else if(parentid.equals("overtime") || parentid.equals("overtime_nonleave") || parentid.equals("overtime_4leave")){
unitType = (KQOvertimeRulesBiz.getMinimumUnit()==3 || KQOvertimeRulesBiz.getMinimumUnit()==5 ||KQOvertimeRulesBiz.getMinimumUnit()==6)?"2":"1";//单位类型
unitType = (KQOvertimeRulesBiz.getMinimumUnit()==3 || KQOvertimeRulesBiz.getMinimumUnit()==5 || KQOvertimeRulesBiz.getMinimumUnit()==6)?"2":"1";//单位类型
}
}
if(Util.null2String(unitType).length()>0){
if(unitType.equals("1")){
unitTypeName=SystemEnv.getHtmlLabelName(1925, user.getLanguage());
unitTypeName= SystemEnv.getHtmlLabelName(1925, user.getLanguage());
}else if(unitType.equals("2")){
unitTypeName=SystemEnv.getHtmlLabelName(391, user.getLanguage());
unitTypeName= SystemEnv.getHtmlLabelName(391, user.getLanguage());
}else if(unitType.equals("3")){
unitTypeName=SystemEnv.getHtmlLabelName(18083, user.getLanguage());
unitTypeName= SystemEnv.getHtmlLabelName(18083, user.getLanguage());
}
}
return unitTypeName;
}
public Map<String,Object> getFlowData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getFlowData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
try{
datas.putAll(getFlowLeaveData(params,user));
datas.putAll(getFlowEvectionOutData(params,user));
@ -324,107 +321,14 @@ public class KQReportBiz extends BaseBean {
return datas;
}
/**
*
* @param params
* @param user
* @return
*/
public Map<String,Object> getSaturdayFlowLeaveBackData(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<>'' ");
}
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+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) " +
"and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND groupid = " +
"(select top 1 groupid from kq_shiftschedule where resourceid = b.resourceid and serialid = b.serialid and kqdate = b.belongdate)) " +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+"|leavebackType_"+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,df.format(value));
}
}catch (Exception e){
writeLog(e);
}
return datas;
}
/**
*
* @param params
* @param user
* @return
*/
public Map<String,Object> getSaturdayFlowLeaveData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getSaturdayFlowLeaveData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
try{
RecordSet rs = new RecordSet();
String sql = "";
@ -434,7 +338,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -474,11 +378,8 @@ public class KQReportBiz extends BaseBean {
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+"' and " +
"(DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 " +
"AND groupid = (select top 1 groupid from kq_shiftschedule where resourceid = b.resourceid " +
" and serialid = b.serialid and kqdate = b.belongdate)) " +sqlWhere +
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+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) " +sqlWhere +
" group by resourceid, newleavetype, durationrule ";
rs.execute(sql);
while (rs.next()) {
@ -515,108 +416,14 @@ public class KQReportBiz extends BaseBean {
return datas;
}
/**
*
* @param params
* @param user
* @return
*/
public Map<String,Object> getDailySaturdayFlowLeaveBackData(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<>'' ");
}
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+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) " +
"and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND groupid = " +
"(select top 1 groupid from kq_shiftschedule where resourceid = b.resourceid and serialid = b.serialid and kqdate = b.belongdate)) " +sqlWhere +
" group by resourceid, newleavetype, durationrule,belongdate ";
rs.execute(sql);
while (rs.next()) {
String resourceid = rs.getString("resourceid");
String belongdate = rs.getString("belongdate");
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+"|"+belongdate+"|leavebackType_"+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,df.format(value));
}
}catch (Exception e){
writeLog(e);
}
return datas;
}
/**
*
* @param params
* @param user
* @return
*/
public Map<String,Object> getDailySaturdayFlowLeaveData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getDailySaturdayFlowLeaveData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -625,7 +432,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -665,10 +472,8 @@ public class KQReportBiz extends BaseBean {
sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' ");
}
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+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) " +
"and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND groupid = " +
"(select top 1 groupid from kq_shiftschedule where resourceid = b.resourceid and serialid = b.serialid and kqdate = b.belongdate)) " +sqlWhere +
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+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) " +sqlWhere +
" group by resourceid, newleavetype, durationrule,belongdate ";
rs.execute(sql);
while (rs.next()) {
@ -709,8 +514,8 @@ public class KQReportBiz extends BaseBean {
* @param user
* @return
*/
public Map<String,Object> getDailyFlowData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getDailyFlowData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
try{
datas.putAll(getDailyFlowLeaveData(params,user));
datas.putAll(getDailyFlowEvectionOutData(params,user));
@ -728,8 +533,8 @@ public class KQReportBiz extends BaseBean {
* @param user
* @return
*/
public Map<String,Object> getFlowEvectionOutData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getFlowEvectionOutData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -743,7 +548,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -836,8 +641,8 @@ public class KQReportBiz extends BaseBean {
* @param user
* @return
*/
public Map<String,Object> getDailyFlowEvectionOutData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getDailyFlowEvectionOutData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -851,7 +656,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -944,8 +749,8 @@ public class KQReportBiz extends BaseBean {
* @param user
* @return
*/
public Map<String,Object> getFlowLeaveData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getFlowLeaveData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -954,7 +759,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -994,7 +799,7 @@ public class KQReportBiz extends BaseBean {
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 "+
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);
@ -1035,8 +840,8 @@ public class KQReportBiz extends BaseBean {
* @param user
* @return
*/
public Map<String,Object> getFlowLeaveBackData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getFlowLeaveBackData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -1045,7 +850,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -1085,7 +890,7 @@ public class KQReportBiz extends BaseBean {
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 "+
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);
@ -1126,8 +931,8 @@ public class KQReportBiz extends BaseBean {
* @param user
* @return
*/
public Map<String,Object> getFlowProcessChangeData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getFlowProcessChangeData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -1138,7 +943,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -1178,7 +983,7 @@ public class KQReportBiz extends BaseBean {
sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' ");
}
sql = " select resourceid, durationrule, changetype,sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.PROCESSCHANGE.getTablename()+" b "+
sql = " select resourceid, durationrule, changetype,sum(duration) as val from hrmresource a, "+ KqSplitFlowTypeEnum.PROCESSCHANGE.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" group by resourceid, durationrule,changetype ";
rs.execute(sql);
@ -1229,8 +1034,8 @@ public class KQReportBiz extends BaseBean {
* @param user
* @return
*/
public Map<String,Object> getDailyFlowLeaveData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getDailyFlowLeaveData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -1239,7 +1044,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -1279,7 +1084,7 @@ public class KQReportBiz extends BaseBean {
sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' ");
}
sql = " select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+
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 +
" group by resourceid, newleavetype, durationrule,belongdate ";
rs.execute(sql);
@ -1321,8 +1126,8 @@ public class KQReportBiz extends BaseBean {
* @param user
* @return
*/
public Map<String,Object> getDailyFlowLeaveBackData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getDailyFlowLeaveBackData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -1331,7 +1136,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -1371,7 +1176,7 @@ public class KQReportBiz extends BaseBean {
sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' ");
}
sql = " select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+
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 +
" group by resourceid, newleavetype, durationrule,belongdate ";
rs.execute(sql);
@ -1411,8 +1216,8 @@ public class KQReportBiz extends BaseBean {
*
* @return
*/
public Map<String,Object> getFlowOverTimeDataNew(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getFlowOverTimeDataNew(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -1421,7 +1226,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -1519,8 +1324,8 @@ public class KQReportBiz extends BaseBean {
*
* @return
*/
public Map<String,Object> getFlowOverTimeData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getFlowOverTimeData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -1529,7 +1334,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -1580,7 +1385,7 @@ public class KQReportBiz extends BaseBean {
}
sql = " select resourceid,changeType, " +valueField+
" from hrmresource a, "+KqSplitFlowTypeEnum.OVERTIME.getTablename()+" b "+
" from hrmresource a, "+ KqSplitFlowTypeEnum.OVERTIME.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere+
" group by resourceid,changeType,durationrule ";
rs.execute(sql);
@ -1617,8 +1422,8 @@ public class KQReportBiz extends BaseBean {
*
* @return
*/
public Map<String,Object> getDailyFlowOverTimeData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getDailyFlowOverTimeData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -1627,7 +1432,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -1722,8 +1527,8 @@ public class KQReportBiz extends BaseBean {
*
* @return
*/
public Map<String,Object> getFlowOtherData(Map<String,Object> params, User user){
Map<String,Object> datas = new HashMap<>();;
public Map<String, Object> getFlowOtherData(Map<String, Object> params, User user){
Map<String, Object> datas = new HashMap<>();;
RecordSet rs = new RecordSet();
String sql = "";
String sqlWhere = " ";
@ -1734,7 +1539,7 @@ public class KQReportBiz extends BaseBean {
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"));
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")){
@ -1774,7 +1579,7 @@ public class KQReportBiz extends BaseBean {
sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' ");
}
sql = " select resourceid, durationrule, sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.OTHER.getTablename()+" b "+
sql = " select resourceid, durationrule, sum(duration) as val from hrmresource a, "+ KqSplitFlowTypeEnum.OTHER.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" group by resourceid, durationrule ";
rs.execute(sql);
@ -1814,13 +1619,13 @@ public class KQReportBiz extends BaseBean {
* @param toDate
* @return
*/
public Map<String,Object> getDetialDatas(String resourceId,String fromDate, String toDate, User user){
public Map<String, Object> getDetialDatas(String resourceId, String fromDate, String toDate, User user){
KQLeaveRulesComInfo kqLeaveRulesComInfo = new KQLeaveRulesComInfo();
Map<String,Object> datas = new HashMap<>();
Map<String,Object> data = null;
Map<String,Object> tmpdatas = new HashMap<>();
Map<String,Object> tmpdata = null;
Map<String,Object> tmpmap = null;
Map<String, Object> datas = new HashMap<>();
Map<String, Object> data = null;
Map<String, Object> tmpdatas = new HashMap<>();
Map<String, Object> tmpdata = null;
Map<String, Object> tmpmap = null;
RecordSet rs = new RecordSet();
String sql = "";
try {
@ -1850,12 +1655,12 @@ public class KQReportBiz extends BaseBean {
if(datas.get(key)==null){
data = new HashMap<>();
}else{
data = (Map<String,Object>)datas.get(key);
data = (Map<String, Object>)datas.get(key);
tmptext = Util.null2String(data.get("text"));
}
tmpdata = new HashMap<>();
if(tmpdatas.get(key)!=null){
tmpmap = (Map<String,Object>)tmpdatas.get(key);
tmpmap = (Map<String, Object>)tmpdatas.get(key);
flag = Util.null2String(tmpmap.get("text"));
}
@ -1894,10 +1699,10 @@ public class KQReportBiz extends BaseBean {
}
}
if (leaveMins > 0) {//请假
Map<String,Object> jsonObject = null;
Map<String, Object> jsonObject = null;
if(leaveInfo.length()>0){
jsonObject = JSON.parseObject(leaveInfo);
for (Entry<String,Object> entry : jsonObject.entrySet()) {
for (Entry<String, Object> entry : jsonObject.entrySet()) {
String newLeaveType = entry.getKey();
String tmpLeaveMins = Util.null2String(entry.getValue());
if(text.indexOf(kqLeaveRulesComInfo.getLeaveName(newLeaveType))==-1){
@ -1944,10 +1749,10 @@ public class KQReportBiz extends BaseBean {
//全部搞一遍
if(tmpdatas != null){
// writeLog(n+">>>tmpdatas="+JSONObject.toJSONString(tmpdatas));
Map<String,Object> data1 = null;
for(Entry<String,Object> entry : tmpdatas.entrySet()){
Map<String, Object> data1 = null;
for(Entry<String, Object> entry : tmpdatas.entrySet()){
String mapKey = Util.null2String(entry.getKey());
Map<String,Object> mapValue = (Map<String,Object>)entry.getValue();
Map<String, Object> mapValue = (Map<String, Object>)entry.getValue();
String flag = Util.null2String(mapValue.get("text"));
if("true".equals(flag)){//需要加工的数据
data1 = new HashMap<>();
@ -2003,11 +1808,11 @@ public class KQReportBiz extends BaseBean {
return serialCount;
}
public static String getSignStatus(Map<String,Object> signInfo, User user){
public static String getSignStatus(Map<String, Object> signInfo, User user){
return getSignStatus(signInfo,user,"");
}
public static String getSignStatus(Map<String,Object> signInfo, User user,String onOrOff){
public static String getSignStatus(Map<String, Object> signInfo, User user, String onOrOff){
KQLeaveRulesComInfo kqLeaveRulesComInfo = new KQLeaveRulesComInfo();
String text = "";
String workdate = Util.null2String(signInfo.get("workdate"));
@ -2027,32 +1832,21 @@ 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());
text = SystemEnv.getHtmlLabelName(20085, user.getLanguage())+absenteeismMins+ SystemEnv.getHtmlLabelName(15049, user.getLanguage());
}else {
if (beLateMins > 0) {//迟到
text = SystemEnv.getHtmlLabelName(20081, user.getLanguage())+beLateMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage());
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());
text = SystemEnv.getHtmlLabelName(20082, user.getLanguage())+leaveEarlyMins+ SystemEnv.getHtmlLabelName(15049, user.getLanguage());
}
if (graveLeaveEarlyMins > 0) {//严重早退
text = SystemEnv.getHtmlLabelName(500547, user.getLanguage())+graveLeaveEarlyMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage());
text = SystemEnv.getHtmlLabelName(500547, user.getLanguage())+graveLeaveEarlyMins+ SystemEnv.getHtmlLabelName(15049, user.getLanguage());
}
if (forgotCheckMins > 0) {//漏签
text = SystemEnv.getHtmlLabelName(20086, user.getLanguage());
@ -2065,72 +1859,22 @@ 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;
}
} else if (beginIdx >= split_time_index && endIdx >= split_time_index) {
//下午
if ("off".equalsIgnoreCase(onOrOff)) {
text4temp = jsonValue;
}
} else {
//全天
text4temp = jsonValue;
}
}
}
if(text4temp.length()>0){
Map<String, Object> jsonObject = null;
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 += text4temp;
//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());
}
}
}
@ -2148,14 +1892,14 @@ public class KQReportBiz extends BaseBean {
}
if(text.equals("")){
boolean needCal = new KQFormatBiz().needCal(workdate,worktime);
text = needCal?SystemEnv.getHtmlLabelName(225, user.getLanguage()):"";
text = needCal? SystemEnv.getHtmlLabelName(225, user.getLanguage()):"";
}
}else{
if (leaveMins > 0) {//请假
Map<String,Object> jsonObject = null;
Map<String, Object> jsonObject = null;
if(leaveInfo.length()>0){
jsonObject = JSON.parseObject(leaveInfo);
for (Entry<String,Object> entry : jsonObject.entrySet()) {
for (Entry<String, Object> entry : jsonObject.entrySet()) {
String newLeaveType = entry.getKey();
String tmpLeaveMins = Util.null2String(entry.getValue());
if(text.indexOf(kqLeaveRulesComInfo.getLeaveName(newLeaveType))==-1){
@ -2242,11 +1986,11 @@ public class KQReportBiz extends BaseBean {
return text;
}
public static boolean getShowFlowText(String leaveInfo,String onOrOff){
Map<String,Object> jsonObject = null;
public static boolean getShowFlowText(String leaveInfo, String onOrOff){
Map<String, Object> jsonObject = null;
jsonObject = JSON.parseObject(leaveInfo);
String flow_signtype = "";
for (Entry<String,Object> entry : jsonObject.entrySet()) {
for (Entry<String, Object> entry : jsonObject.entrySet()) {
String tmpSignType = Util.null2String(entry.getValue());
flow_signtype += ","+tmpSignType;
}
@ -2256,7 +2000,7 @@ public class KQReportBiz extends BaseBean {
return isShowFlowText(flow_signtype,onOrOff);
}
public static boolean isShowFlowText(String flow_signtype,String onOrOff){
public static boolean isShowFlowText(String flow_signtype, String onOrOff){
boolean showFlowText = true;
if(flow_signtype.length() > 0){
@ -2400,7 +2144,7 @@ public class KQReportBiz extends BaseBean {
rs1.executeUpdate(delSql);
}
Map<String,String> result = kqFlowActiontBiz.handleKQFlowAction(proc_set_id, usedetails, Util.getIntValue(requestid), kqtype, Util.getIntValue(workflowid), isForce1,isUpgrade1,map);
Map<String, String> result = kqFlowActiontBiz.handleKQFlowAction(proc_set_id, usedetails, Util.getIntValue(requestid), kqtype, Util.getIntValue(workflowid), isForce1,isUpgrade1,map);
if(!result.isEmpty()){
@ -2421,7 +2165,7 @@ public class KQReportBiz extends BaseBean {
* @param bcfs
* @return
*/
public double getOverTimeCount(String startdate,String enddate,String userid,String jblx,String bcfs){
public double getOverTimeCount(String startdate, String enddate, String userid, String jblx, String bcfs){
double result = 0.00;
RecordSet rs = new RecordSet();
rs.executeQuery("select sum(gjsc) as count from uf_jbtz where gzrq >= ? and gzrq <= ? and jbr=? and jblx=? and bcfs=?",startdate,enddate,userid,jblx,bcfs);
@ -2440,7 +2184,7 @@ public class KQReportBiz extends BaseBean {
* @param bcfs
* @return
*/
public double getOverTimeDailyCount(String kqdate,String userid,String jblx,String bcfs){
public double getOverTimeDailyCount(String kqdate, String userid, String jblx, String bcfs){
double result = 0.00;
RecordSet rs = new RecordSet();
rs.executeQuery("select sum(gjsc) as count from uf_jbtz where gzrq = ? and jbr=? and jblx=? and bcfs=?",kqdate,userid,jblx,bcfs);
@ -2457,30 +2201,21 @@ public class KQReportBiz extends BaseBean {
* @param userid
* @return
*/
public double getNightSubsidyDaily(String kqdate,String userid){
public double getNightSubsidyDaily(String kqdate, String userid){
double result = 0.00;
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(serialid == sixnight_serialid|| serialid == twelvehours_night_serialid){
if(time >= 8){
result ++;
}
}
//2、当一线人员排“夜休”班次并且加班台账当天导入的加班时长>=8小时统计一次。
if(serialid == night_rest_serialid){
if(overTimeTotal >= 8){
result ++;
result = 1;
}
}
}
@ -2494,37 +2229,24 @@ public class KQReportBiz extends BaseBean {
* @param userid
* @return
*/
public double getNightSubsidyTotal(String fromDate,String toDate,String userid){
public double getNightSubsidyTotal(String fromDate, String toDate, String userid){
double result = 0.00;
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(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;
}
@ -2535,7 +2257,7 @@ public class KQReportBiz extends BaseBean {
* @param userid
* @return
*/
public double getOverTimeTotal(String kqdate,String userid){
public double getOverTimeTotal(String kqdate, String userid){
double result = 0.00;
RecordSet rs = new RecordSet();
rs.executeQuery("select sum(gjsc)as gjsc from uf_jbtz where gzrq=? and jbr=?",kqdate,userid);
@ -2552,17 +2274,18 @@ public class KQReportBiz extends BaseBean {
* @param userid
* @return
*/
public int getFillCardCount(String fromDate,String toDate,String userid){
public int getFillCardCount(String fromDate, String toDate, String userid){
int result = 0;
RecordSet rs = new RecordSet();
String tablename = rs.getPropValue("nbjh_ygdjblc","fillcard_table");
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++;
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.ksrq >=? and a.jsrq <=? and a.resourceId=?",fromDate,toDate,userid);
if(rs.next()){
}
result = rs.getCounts();
return result;
}
@ -2572,16 +2295,16 @@ public class KQReportBiz extends BaseBean {
* @param userid
* @return
*/
public int getFillCardCountDaily(String kqdate,String userid){
public int getFillCardCountDaily(String kqdate, String userid){
int result = 0;
RecordSet rs = new RecordSet();
String tablename = rs.getPropValue("nbjh_ygdjblc","fillcard_table");
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 " +
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;
}

@ -5,15 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.kq.biz.KQFormatBiz;
import com.engine.kq.biz.KQHolidaySetBiz;
import com.engine.kq.biz.KQLeaveRulesBiz;
import com.engine.kq.biz.KQOvertimeRulesBiz;
import com.engine.kq.biz.KQReportBiz;
import com.engine.kq.biz.KQReportFieldComInfo;
import com.engine.kq.biz.KQSettingsComInfo;
import com.engine.kq.biz.KQShiftManagementComInfo;
import com.engine.kq.biz.KQUnitBiz;
import com.engine.kq.biz.*;
import com.engine.kq.util.KQDurationCalculatorUtil;
import com.engine.kq.util.PageUidFactory;
import org.apache.commons.lang3.StringUtils;
@ -31,11 +23,7 @@ import weaver.hrm.resource.ResourceComInfo;
import weaver.systeminfo.SystemEnv;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
@ -198,11 +186,11 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
String definedFieldSum = Util.null2String(definedFieldInfo.get("definedFieldSum"));
//支援班次统计
String supportSerId = new BaseBean().getPropValue("nbkq_main", "supportSerId");
String backFields = " (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayworkdays," +
String backFields = " (select sum(workdays) from kq_format_total where resourceid = a.id and kqdate >='" + fromDate + "' and kqdate <='" + toDate + "' and (DATEPART(dw, kqdate) = 7 or DATEPART(dw, kqdate) = 1)) as saturdayworkdays," +
" (select count(0) from kq_shiftschedule where resourceid = a.id and kqdate >='" + fromDate + "' and kqdate <='" + toDate + "' and serialid=" + supportSerId + " )as supportTotal," +
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayattendancedays," +
" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayworkdays," +
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayattendancedays," +
" (select sum(attendancedays) from kq_format_total where resourceid = a.id and kqdate >='" + fromDate + "' and kqdate <='" + toDate + "' and (DATEPART(dw, kqdate) = 7 or DATEPART(dw, kqdate) = 1)) as saturdayattendancedays," +
" (select sum(workdays) from kq_format_total where resourceid = a.id and kqdate >='" + fromDate + "' and kqdate <='" + toDate + "' and DATEPART(dw, kqdate) != 7 and DATEPART(dw, kqdate) != 1) as weekdayworkdays," +
" (select sum(attendancedays) from kq_format_total where resourceid = a.id and kqdate >='" + fromDate + "' and kqdate <='" + toDate + "' and DATEPART(dw, kqdate) != 7 and DATEPART(dw, kqdate) != 1) as weekdayattendancedays," +
"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(b.attendanceMins) as attendanceMins,sum(b.beLate) as beLate,sum(b.beLateMins) as beLateMins, " +
@ -341,10 +329,6 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
Map<String, Object> flowData = kqReportBiz.getFlowData(params, user);
Map<String, Object> saturdayFlowLeaveData = kqReportBiz.getSaturdayFlowLeaveData(params, user);
Map<String, Object> saturdayFlowLeaveBackData = kqReportBiz.getSaturdayFlowLeaveBackData(params, user);
if ((!CollectionUtils.isEmpty(saturdayFlowLeaveBackData)) || saturdayFlowLeaveBackData.size() > 0) {
saturdayFlowLeaveData.putAll(saturdayFlowLeaveBackData);
}
rs.execute(sql);
rs.writeLog("========== GetKQReportCmd sql ========== " + sql);
while (rs.next()) {
@ -516,11 +500,10 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
}
String sjbjcjRes = "0.0";
String hjsjRes = "0.0";
for (int ia = 0; allLeaveRules != null && ia < allLeaveRules.size(); ia++) {
leaveRule = (Map<String, Object>) allLeaveRules.get(ia);
int i = Integer.valueOf(leaveRule.get("id").toString());
for (int i = 0; allLeaveRules != null && i < allLeaveRules.size(); i++) {
if (((!CollectionUtils.isEmpty(sjbjcjidList)) && sjbjcjidList.contains(i)) ||
((!CollectionUtils.isEmpty(hjsjidList)) && hjsjidList.contains(i))) {
leaveRule = (Map<String, Object>) allLeaveRules.get(i);
String flowType = Util.null2String("leaveType_" + leaveRule.get("id"));
String leaveData = Util.null2String(saturdayFlowLeaveData.get(id + "|" + flowType));
String flowLeaveBackType = Util.null2String("leavebackType_" + leaveRule.get("id"));

@ -28,6 +28,7 @@ import java.util.*;
import java.io.*;
import java.net.*;
import com.sun.net.ssl.internal.www.protocol.https.BASE64Encoder;
import org.apache.oro.text.regex.*;
import weaver.system.*;
@ -1478,7 +1479,7 @@ public class SendMail extends MailErrorBean {
InputStream is = (InputStream) fileContentList.get(i);
String filename = (String) fileNameList.get(i);
String ctype = FileTypeMap.getDefaultFileTypeMap().getContentType(filename);
sun.misc.BASE64Encoder enc = new sun.misc.BASE64Encoder();
BASE64Encoder enc = new BASE64Encoder();
filename = "=?UTF-8?B?" + enc.encode(filename.getBytes("UTF-8")) + "?=";
filename = filename.replace("\n", ""); // 当文件名过长时
StringBuffer sb = new StringBuffer(filename.length()); // 需要

Loading…
Cancel
Save