⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 recvpermissionmanager.java

📁 负责公文的传输及一些处理功能
💻 JAVA
字号:
package com.example.gw.recvpermission;

import java.util.*;

public class RecvPermissionManager implements IRecvPermissionManager{
  private IRecvPermissionDao recvPermissionDao;
  public void setRecvPermissionDao(IRecvPermissionDao recvPermissionDao){
	  this.recvPermissionDao = recvPermissionDao;
  }
  public IRecvPermissionDao getRecvPermissionDao(){
	  return recvPermissionDao;
  }
  public void saveRecvPermission(RecvPermission recvpermission){
	  recvPermissionDao.save(recvpermission);
  }
  public void updateRecvPermission(RecvPermission recvpermission){
	  recvPermissionDao.saveOrUpdate(recvpermission);
  }
  
  public RecvPermission getRecvPermission(String docId,String unitId){	  
	  RecvPermission recv = new RecvPermission();
	  try{
	  List list = recvPermissionDao.find(" from RecvPermission where recvDocForm="+docId+" and unitId="+unitId+"");
	  ListIterator iterator = list.listIterator();
	  recv = (RecvPermission)iterator.next();
	  }catch(Exception e){e.printStackTrace();}
	  return recv;
  }
  
  public Map getSendStatMap(String sendunitId,String bywhere) throws Exception
  {
	Map statmap = new HashMap();
    String where="";    
    where="select unitId,count(permissionId) from RecvPermission where recvDocForm in (select docId from RecvDocForm where sendUnitId="+sendunitId+" "+bywhere+") group by unitId";
	List list=recvPermissionDao.find(where);
	ListIterator iterator = list.listIterator();
	while(iterator.hasNext())
	{	  
	  Object[] obj =(Object[])iterator.next();
	  statmap.put(obj[0].toString(),new Integer(obj[1].toString()));
	}
	return statmap;
  }
  
  public Map getSignStatMap(String sendunitId,String bywhere,String status) throws Exception
  {
	Map statmap = new HashMap();
    String where="";
    if (!status.equals(""))
    {
      where="select unitId,count(permissionId) from RecvPermission where status in ("+status+") and recvDocForm in (select docId from RecvDocForm where sendUnitId="+sendunitId+" "+bywhere+") group by unitId";
    }
    else
    {
      where="select unitId,count(permissionId) from RecvPermission where recvDocForm in (select docId from RecvDocForm where sendUnitId="+sendunitId+" "+bywhere+") group by unitId";
    }
	List list=recvPermissionDao.find(where);
	ListIterator iterator = list.listIterator();
	while(iterator.hasNext())
	{	  
	  Object[] obj =(Object[])iterator.next();
	  statmap.put(obj[0].toString(),new Integer(obj[1].toString()));
	}
	return statmap;
  }

  public Map getSignPerStatMap(String unitId,String bywhere,String status) throws Exception
  {
	Map statmap = new HashMap();
    String where="";
    if (!status.equals(""))
    {
      where="select recvform.sendUnitId,count(recvper.permissionId) from RecvDocForm recvform,RecvPermission recvper where recvper.status in ("+status+") and recvper.recvDocForm=recvform.docId and recvper.unitId="+unitId+" "+bywhere+" group by recvform.sendUnitId";
    }
    else
    {
      where="select recvform.sendUnitId,count(recvper.permissionId) from RecvDocForm recvform,RecvPermission recvper where recvper.recvDocForm=recvform.docId and recvper.unitId="+unitId+" "+bywhere+" group by recvform.sendUnitId";
    }
	List list=recvPermissionDao.find(where);
	ListIterator iterator = list.listIterator();
	while(iterator.hasNext())
	{	  
	  Object[] obj =(Object[])iterator.next();
	  statmap.put(obj[0].toString(),new Integer(obj[1].toString()));
	}
	return statmap;
  }
  
  public List findRePermissionList(String where){
	  return recvPermissionDao.find(where);
  }
  
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -