更多历史日报
__1ztzuCfbFMrk1J3JfFq
__1ztzuCfbFMrk1J3JfFq
published
__epSEONPqumqyqXNO4zO
UTF-8
get
/dailylog/view/historyDaily
json
= '"+startTime+"'";//and item_logtype = '"+logtype+"'
}
if(isNotNull(endTime)){
whereStr+="and subdate(a.item_sendTime,1) <'"+endTime+"'";
}
var rolesid=getWebUser().getRolelist(getApplication());
println("rolesid-----------------------:"+rolesid);
var PTroleid= getRoleIdByName("普通员工");
var JLroleid= getRoleIdByName("部门经理");
var GLroleid= getRoleIdByName("管理员");
var sql="select "+
"a.PARENT," + //
"a.LASTMODIFIED," + //
"a.FORMNAME," + //
"a.STATE," + //
"a.AUDITUSER," + //
"a.AUDITDATE," + //
"a.AUTHOR," + //
"a.AUTHORDEPTID," + //
"a.AUTHOR_DEPT_INDEX," + //
"a.AUTHOR_USER_INDEX," + //
"a.CREATED," + //
"a.FORMID," + //
"a.SUBFORMIDS," + //
"a.INITIATOR," + //
"a.ISTMP," + //
"a.VERSIONS," + //
"a.APPLICATIONID," + //
"a.STATEINT," + //
"a.STATELABEL," + //
"a.AUDITORNAMES," + //
"a.LASTFLOWOPERATION," + //
"a.LASTMODIFIER," + //
"a.DOMAINID," + //
"a.AUDITORLIST," + //
"a.COAUDITORLIST," + //
"a.STATELABELINFO," + //
"a.PREVAUDITNODE," + //
"a.PREVAUDITUSER," + //
"a.OPTIONITEM," + //
"a.SIGN," + //
"a.KINGGRIDSIGNATURE," + //
"a.ID," + //
"a.ITEM_NOTE," + //
"a.ITEM_PICTURE," + //
"a.ITEM_ATTACHMENT," + //
"a.ITEM_READ," + //
"a.ITEM_UNREAD," + //
"a.ITEM_LOGTYPE," + //
"a.ITEM_FIELD1," + //
"a.ITEM_FIELD2," + //
"a.ITEM_FIELD3," + //
"a.ITEM_FIELD4," + //
"a.ITEM_FIELD5,"+
"a.ITEM_COPYTOPERSON," + //
"a.ITEM_SEND," + //
"a.ITEM_USERNAME," + //
"a.ITEM_planitem," + //
"a.ITEM_USERID," + //
"a.ITEM_SIGN," + //
"a.ITEM_COMMENTSSECTION," + //
"a.ITEM_COMMENT," + //
"a.ITEM_SENDTIME," + //
"a.ITEM_choosetime," + //
"a.ITEM_finishWork," + //
"a.ITEM_unfinish," + //
"a.ITEM_projectProgress," + //
"a.ITEM_coordinateWork," + //
"count(b.id) as item_commentNumber,"+
"case when a.ITEM_READ like('%"+Uid+"%') then '已读' else '未读' end as ITEM_state"+//
" from tlk_baseLog a "+
" LEFT JOIN tlk_comment b ON a.id = b.item_dailyID";
if(rolesid.indexOf(GLroleid)>=0){//管理员
sql +=" where a.item_userID = '"+userID+"' and a.item_send='已发送'"+whereStr;
result.put("role","1");
}
else if(rolesid.indexOf(JLroleid)>=0){//部门经理
if(!HB_Department.equals(userDepartment)){//不同部门
sql += " where a.item_userID = '"+userID+"' and a.item_copytoperson like('%"+Uid+"%') and a.item_send='已发送'"+whereStr;
result.put("role","2");
}else{//同部门
sql +=" where a.item_userID = '"+userID+"' and a.item_send='已发送'"+whereStr;
result.put("role","12");
}
}
else{//普通员工角色id
sql+=" where a.item_userID = '"+userID+"' and a.item_copytoperson like('%"+Uid+"%') and a.item_send='已发送'"+whereStr;
result.put("role","3");
}
if(isNotNull(Number) && !"null".equals(Number)){
sql += " GROUP BY a.id ORDER BY a.ITEM_SENDTIME DESC limit "+Number;
}else{
sql += " GROUP BY a.id ORDER BY a.ITEM_SENDTIME DESC limit 30";
}
var datas = queryByDSName("dailylog",sql);
result.put("msg", "success");
result.put("code", "0");
result.put("datas", datas);
return result;
})()]]>