/** * 获得浏览统计计数和今日统计计数 * @param siteId 站点ID * @return 计数值 * @throws SQLException */ public Browser getTotalAndTodayBrowserCount(int siteId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("siteId", siteId); return executor.queryObjectBean(Browser.class, "countTodayAndTotalBrowserCounter", paramMap); }
@Override public long getVideoHitsCount(int siteId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("siteId", siteId); return executor.queryObjectBean(Long.class, "countVideoHitsCounter", paramMap); }
@Override public long getBrowserCount(int siteId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("siteId", siteId); return executor.queryObjectBean(long.class, "countBrowserCounter", paramMap); }
@Override public Integer getChannelCommentAduitSwitch(int channelId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("channelId", channelId); return executor.queryObjectBean(Integer.class, "getChannelCommentAduitSwitch", paramMap); }
@Override public long getDownLoadCount(int siteId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("siteId", siteId); return executor.queryObjectBean(Long.class, "countDownLoadCounter", paramMap); }
public int getTotalCommnet(int docId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("docId", docId); return executor.queryObjectBean(int.class, "getTotalCommnet",paramMap); }
@Override public long getVideoHitsCount(int siteId, int channelId, int docId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("siteId", siteId); paramMap.put("channelId", channelId); paramMap.put("docId", docId); return executor.queryObjectBean(Long.class, "countVideoHitsCounter", paramMap); }
@Override public long getDownLoadCount(int siteId, int channelId, int docId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("siteId", siteId); paramMap.put("channelId", channelId); paramMap.put("docId", docId); return executor.queryObjectBean(Long.class, "countDownLoadCounter", paramMap); }
@Override public long getBrowserCount(int siteId, int channelId, int docId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("siteId", siteId); paramMap.put("channelId", channelId); paramMap.put("docId", docId); return executor.queryObjectBean(Long.class, "countBrowserCounter", paramMap); }
@Override public long getBrowserCount(int siteId, int channelId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("siteId", siteId); paramMap.put("channelId", channelId); return executor.queryObjectBean(Long.class, "countBrowserCounter", paramMap); }
@Override public long getDownLoadCount(int siteId, int channelId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("siteId", siteId); paramMap.put("channelId", channelId); return executor.queryObjectBean(Long.class, "countDownLoadCounter", paramMap); }
@Override public long getVideoHitsCount(int siteId, int channelId) throws SQLException { Map<String, Object> paramMap = new HashMap<String, Object>(); paramMap.put("siteId", siteId); paramMap.put("channelId", channelId); return executor.queryObjectBean(Long.class, "countVideoHitsCounter", paramMap); }
/** * 根据id查找对象 * @param id * @return */ public IpControl getIpControlById(String id){ Map idmap = new HashMap(); idmap.put("id", id); IpControl bean; try { bean = executor.queryObjectBean(IpControl.class, "getIpControlById", idmap); return bean; } catch (SQLException e) { e.printStackTrace(); } return null; } /**
@Override public ActivitiNodeCandidate queryActivitiNodeCandidate(String process_key, String activityKey, String business_id, String business_type) { try{ Map<String,String> params = new HashMap<String,String>(); params.put("process_key", process_key); params.put("node_key", activityKey); params.put("business_id", business_id); params.put("business_type", business_type); ActivitiNodeCandidate activitiNodeCandidate= executor.queryObjectBean(ActivitiNodeCandidate.class, "queryProcessNodeCandidates", params); return activitiNodeCandidate; }catch(Exception e){ e.printStackTrace(); } return null; }
public int countTasksByUserWithStates(List<String> processkeys, List<String> states, String userAccount) { try { Map map = new HashMap(); map.put("userAccount", userAccount); map.put("states", states); map.put("processkeys", processkeys); return ((Integer) this.executor.queryObjectBean(Integer.class, "countlistTaskAndVarsByUserWithStates", map)).intValue(); } catch (Exception e) { throw new ProcessException("获取待办任务数失败:processkeys=" + processkeys.toString() + ",states=" + states.toString() + ",userAccount=" + userAccount, e); } }
/** * 获取用户特定状态下的任务待办数 */ public int countTasksByUserWithState(String processkey, String state, String userAccount) { try { Map<String, String> map = new HashMap<String, String>(); map.put("userAccount", userAccount); map.put("state", state); map.put("processkey", processkey); return executor.queryObjectBean(int.class, "countlistTaskAndVarsByUserWithState", map); } catch (Exception e) { throw new ProcessException("获取待办任务数失败:processkey=" + processkey + ",state=" + state + ",userAccount=" + userAccount, e); } }
/** * 获取单个业务类别 * @param businessId * @return */ public BusinessType findUniqueResult(String businessId) { BusinessType businessType = null; try { businessType = new BusinessType(); businessType.setBusinessId(businessId); businessType = executor.queryObjectBean(BusinessType.class, "selectBusinessList", businessType); } catch (Exception e) { logger.error(e); } return businessType; }
public boolean hasGrantedRoles(String resource, String resourceType) throws RoleException{ try { ResourceInfo resourceInfo = this.resourceManager.getResourceInfoByType(resourceType); if(resourceInfo == null) throw new RoleException("hasGrantedRoles failed:resource="+resource +",resourceType="+ resourceType+",没有定义资源类型!"); Map params = new HashMap(); params.put("permissionTable", resourceInfo.getPermissionTable()); params.put("resource", resource); params.put("resourceType", resourceType); int num = this.executor.queryObjectBean(int.class, "hasGrantedRoles", params); return num > 0; } catch(RoleException e){ throw e; } catch (SQLException e) { throw new RoleException("hasGrantedRoles failed:resourceType="+resourceType+",resource="+resource,e); } }
@Override public int getMyselfTaskNum(String currentUser, String processKey) throws Exception { TransactionManager tm = new TransactionManager(); try { tm.begin(); // 当前用户转成域账号 currentUser = this.changeToDomainAccount(currentUser); Map<String, Object> params = new HashMap<String, Object>(); params.put("assignee", currentUser); params.put("processKey", processKey); // 当前用户的任务数 int taskNum = executor.queryObjectBean(int.class, "countTaskNum_wf", params); tm.commit(); return taskNum; } catch (Exception e) { throw new Exception("获取用户待办任务总数出错:" + e); } finally { tm.release(); } }
public boolean hasGrantRole(AuthRole role, String resource, String resourceType) throws RoleException { try { ResourceInfo resourceInfo = this.resourceManager.getResourceInfoByType(resourceType); if(role == null) throw new RoleException("hasGrantedRoles failed:resource="+resource +",resourceType="+ resourceType+",没有设置要判断的角色!"); if(resourceInfo == null) throw new RoleException("hasGrantedRoles failed:resource="+resource +",resourceType="+ resourceType+",没有定义资源类型!"); Map params = new HashMap(); params.put("permissionTable", resourceInfo.getPermissionTable()); params.put("resource", resource); params.put("resourceType", resourceType); params.put("roleId", role.getRoleId()); params.put("roleType", role.getRoleType()); int num = this.executor.queryObjectBean(int.class, "hasGrantRole", params); return num > 0; } catch(RoleException e){ throw e; } catch (Exception e) { throw new RoleException("hasGrantRole failed:resourceType="+resourceType+",resource="+resource+role.toString(),e); } }