|
|
|
@ -378,6 +378,10 @@ public class KQReportBiz extends BaseBean {
|
|
|
|
|
basebean.writeLog("getDailyFlowData appFprOvertime");
|
|
|
|
|
datas.putAll(getDailyAppForOvertimeData(params,user));
|
|
|
|
|
|
|
|
|
|
//考勤二开--转事假
|
|
|
|
|
basebean.writeLog("getDailyFlowData toComLeave");
|
|
|
|
|
datas.putAll(getDailyToComLeaveData(params,user));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
writeLog(e);
|
|
|
|
@ -406,9 +410,167 @@ public class KQReportBiz extends BaseBean {
|
|
|
|
|
basebean.writeLog("getFlowData appFprOvertime");
|
|
|
|
|
datas.putAll(getAppForOvertimeData(params,user));
|
|
|
|
|
|
|
|
|
|
//考勤二开--转事假
|
|
|
|
|
basebean.writeLog("getFlowData getToComLeaveData");
|
|
|
|
|
datas.putAll(getToComLeaveData(params,user));
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
writeLog(e);
|
|
|
|
|
}
|
|
|
|
|
return datas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Map<String,Object> getToComLeaveData(Map<String,Object> params, User user){
|
|
|
|
|
Map<String,Object> datas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String sql = "";
|
|
|
|
|
String sqlWhere = " ";
|
|
|
|
|
try {
|
|
|
|
|
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 c.subcompanyid1 in(" + subCompanyId + ") ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (departmentId.length() > 0) {
|
|
|
|
|
sqlWhere += " and c.departmentid in(" + departmentId + ") ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (resourceId.length() > 0) {
|
|
|
|
|
sqlWhere += " and c.resourceid in(" + resourceId + ") ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (viewScope.equals("4")) {//我的下属
|
|
|
|
|
if (allLevel.equals("1")) {//所有下属
|
|
|
|
|
sqlWhere += " and c.managerstr like '%," + user.getUID() + ",%'";
|
|
|
|
|
} else {
|
|
|
|
|
sqlWhere += " and c.managerid=" + user.getUID();//直接下属
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!"1".equals(isNoAccount)) {
|
|
|
|
|
sqlWhere += " and c.loginid is not null " + (rs.getDBType().equals("oracle") ? "" : " and c.loginid<>'' ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sql = " select * from (select * from uf_casleave a left join hrmresource on a.resourceid = b.id " +
|
|
|
|
|
" where a.startdate >='" + fromDate + "' and a.enddate <='" + toDate +"' and (isdecu = 0 or isdecu is null ) ) c where 1=1 " + sqlWhere;
|
|
|
|
|
basebean.writeLog("getToComLeaveData sql: " + sql);
|
|
|
|
|
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
double duration = Util.getDoubleValue(Util.null2String(rs.getString("duration")));
|
|
|
|
|
if ( duration > 0.00){
|
|
|
|
|
double temp = Util.getDoubleValue(Util.null2String(datas.get("ToComLeaveData|" + resourceId)));
|
|
|
|
|
if (temp <= 0.00) {
|
|
|
|
|
datas.put("ToComLeaveData|" + resourceId, duration);
|
|
|
|
|
} else {
|
|
|
|
|
datas.put("ToComLeaveData|" + resourceId, temp + duration);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
writeLog(e);
|
|
|
|
|
}
|
|
|
|
|
basebean.writeLog("getDailyToComLeaveData datas:" + datas);
|
|
|
|
|
return datas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String,Object> getDailyToComLeaveData(Map<String,Object> params, User user){
|
|
|
|
|
Map<String,Object> datas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String sql = "";
|
|
|
|
|
String sqlWhere = " ";
|
|
|
|
|
try {
|
|
|
|
|
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 c.subcompanyid1 in(" + subCompanyId + ") ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (departmentId.length() > 0) {
|
|
|
|
|
sqlWhere += " and c.departmentid in(" + departmentId + ") ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (resourceId.length() > 0) {
|
|
|
|
|
sqlWhere += " and c.resourceid in(" + resourceId + ") ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (viewScope.equals("4")) {//我的下属
|
|
|
|
|
if (allLevel.equals("1")) {//所有下属
|
|
|
|
|
sqlWhere += " and c.managerstr like '%," + user.getUID() + ",%'";
|
|
|
|
|
} else {
|
|
|
|
|
sqlWhere += " and c.managerid=" + user.getUID();//直接下属
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!"1".equals(isNoAccount)) {
|
|
|
|
|
sqlWhere += " and c.loginid is not null " + (rs.getDBType().equals("oracle") ? "" : " and c.loginid<>'' ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sql = " select * from (select * from uf_casleave a left join hrmresource on a.resourceid = b.id " +
|
|
|
|
|
" where a.startdate >='" + fromDate + "' and a.enddate <='" + toDate +"' and (isdecu = 0 or isdecu is null ) ) c where 1=1 " + sqlWhere;
|
|
|
|
|
basebean.writeLog("getDailyToComLeaveData sql: " + sql);
|
|
|
|
|
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
double duration = Util.getDoubleValue(Util.null2String(rs.getString("duration")));
|
|
|
|
|
String kqdate = Util.null2String(rs.getString("startdate"));
|
|
|
|
|
if ( duration > 0.00){
|
|
|
|
|
double temp = Util.getDoubleValue(Util.null2String(datas.get("DailyToComLeaveData|" + resourceId + "|" + kqdate)));
|
|
|
|
|
if (temp <= 0.00) {
|
|
|
|
|
datas.put("DailyToComLeaveData|" + resourceId + "|" + kqdate, duration);
|
|
|
|
|
} else {
|
|
|
|
|
datas.put("DailyToComLeaveData|" + resourceId + "|" + kqdate, temp + duration);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
writeLog(e);
|
|
|
|
|
}
|
|
|
|
|
basebean.writeLog("getDailyToComLeaveData datas:" + datas);
|
|
|
|
|
return datas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2567,18 +2729,14 @@ public class KQReportBiz extends BaseBean {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String getSignStatus(Map<String,Object> signInfo, User user,String onOrOff){
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
bb.writeLog("getSignStatus start");
|
|
|
|
|
|
|
|
|
|
KQLeaveRulesComInfo kqLeaveRulesComInfo = new KQLeaveRulesComInfo();
|
|
|
|
|
String text = "";
|
|
|
|
|
String isneedcal = Util.null2String(signInfo.get("isneedcal"));
|
|
|
|
|
bb.writeLog("isneedcal: " + isneedcal);
|
|
|
|
|
|
|
|
|
|
String workdate = Util.null2String(signInfo.get("workdate"));
|
|
|
|
|
bb.writeLog("workdate: " + workdate);
|
|
|
|
|
|
|
|
|
|
String worktime = Util.null2String(signInfo.get("worktime"));
|
|
|
|
|
bb.writeLog("worktime: " + worktime);
|
|
|
|
|
|
|
|
|
|
if(!new KQFormatBiz().needCal(workdate,worktime,isneedcal)) {//还未到时间无需计算
|
|
|
|
|
return text;
|
|
|
|
|