org.apache.poi.ss.formula.functions.T Java Examples

The following examples show how to use org.apache.poi.ss.formula.functions.T. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JdbcDao.java    From jeecg with Apache License 2.0 6 votes vote down vote up
/**
 * 使用指定的检索标准检索数据并分页返回数据
 * @throws IllegalAccessException 
 * @throws InstantiationException 
 */
public List<T> findObjForJdbc(String sql, int page, int rows,Class<T> clazz) {
	List<T> rsList = new ArrayList<T>();
	//封装分页SQL
	sql = jeecgCreatePageSql(sql,page,rows);
	List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
	
	T po = null;
	for(Map<String,Object> m:mapList){
		try {
			po = clazz.newInstance();
			MyBeanUtils.copyMap2Bean_Nobig(po, m);
			rsList.add(po);
		}  catch (Exception e) {
			e.printStackTrace();
		}
	}
	return rsList;
}
 
Example #2
Source File: SystemPermissionController.java    From mumu with Apache License 2.0 6 votes vote down vote up
/**
 * 查看权限详情
 * @param permissionId 权限id
 * @param request
 * @return
 */
@RequiresPermissions("system:permission:view")
@RequestMapping(value="/view/{permissionId}",method=RequestMethod.GET)
public String permissionView(@PathVariable String permissionId, HttpServletRequest request){
    /*List<SysMenu> subMenus = menuService.getSubSysMenu(PublicEnum.NORMAL.value());
	request.setAttribute("subMenus", subMenus);*/
       List<SysMenu> sysMenus = menuService.querySysMenuByCondition(null, null, null);
       List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
       for (SysMenu sysMenu : sysMenus) {
           nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(sysMenu.getMenuId()), String.valueOf(sysMenu.getParentMenuId()), sysMenu));
       }
       List<T> list = NodeUtil.iterator(nodeBeans, "﹎﹎", "menuName");
       request.setAttribute("subMenus", list);

	SysPermission permission = permissionService.getSysPermissionById(permissionId);
	request.setAttribute("permission",permission);
	return "system/permission/view";
}
 
Example #3
Source File: SystemPermissionController.java    From mumu with Apache License 2.0 6 votes vote down vote up
/**
 * 编辑权限
 * @param permissionId 权限id
 * @param request
 * @return
 */
@RequiresPermissions("system:permission:edit")
@RequestMapping(value="/edit/{permissionId}",method=RequestMethod.GET)
public String editPermission(@PathVariable String permissionId,HttpServletRequest request){
	/*List<SysMenu> subMenus = menuService.getSubSysMenu(PublicEnum.NORMAL.value());
	request.setAttribute("subMenus", subMenus);*/
       List<SysMenu> sysMenus = menuService.querySysMenuByCondition(null, null, null);
       List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
       for (SysMenu sysMenu : sysMenus) {
           nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(sysMenu.getMenuId()), String.valueOf(sysMenu.getParentMenuId()), sysMenu));
       }
       List<T> list = NodeUtil.iterator(nodeBeans, "﹎﹎", "menuName");
       request.setAttribute("subMenus", list);
	
	SysPermission permission = permissionService.getSysPermissionById(permissionId);
	request.setAttribute("permission",permission);
	return "system/permission/edit";
}
 
Example #4
Source File: JdbcDao.java    From jeewx with Apache License 2.0 6 votes vote down vote up
/**
 * 使用指定的检索标准检索数据并分页返回数据
 * @throws IllegalAccessException 
 * @throws InstantiationException 
 */
public List<T> findObjForJdbc(String sql, int page, int rows,Class<T> clazz) {
	List<T> rsList = new ArrayList<T>();
	//封装分页SQL
	sql = jeecgCreatePageSql(sql,page,rows);
	List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
	
	T po = null;
	for(Map<String,Object> m:mapList){
		try {
			po = clazz.newInstance();
			MyBeanUtils.copyMap2Bean_Nobig(po, m);
			rsList.add(po);
		}  catch (Exception e) {
			e.printStackTrace();
		}
	}
	return rsList;
}
 
Example #5
Source File: SystemGroupController.java    From mumu with Apache License 2.0 6 votes vote down vote up
/**
 * 查看用户组详情
 * @param groupId 用户组id
 * @return
 */
@RequiresPermissions("system:group:view")
@RequestMapping(value="/view/{groupId}",method=RequestMethod.GET)
public String groupView(@PathVariable String groupId,HttpServletRequest request){
	SysGroup group=groupService.getSysGroupById(groupId);
	request.setAttribute("group", group);

	List<SysOrganize> organizes = organizeService.querySysOrganizeByCondition(null);
	List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
	for (SysOrganize org : organizes) {
		nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(org.getOrgId()), String.valueOf(org.getParentOrgId()), org));
	}
	List<T> organizesList = NodeUtil.iterator(nodeBeans, "﹎﹎", "orgName");
	request.setAttribute("organizes", organizesList);
	return "system/group/view";
}
 
Example #6
Source File: SystemGroupController.java    From mumu with Apache License 2.0 6 votes vote down vote up
/**
 * 编辑用户组
 * @param groupId 用户组id
 * @return
 */
@RequiresPermissions("system:group:edit")
@RequestMapping(value="/edit/{groupId}",method=RequestMethod.GET)
public String groupEdit(@PathVariable String groupId,HttpServletRequest request){
	SysGroup group=groupService.getSysGroupById(groupId);
	request.setAttribute("group", group);
	
	List<SysOrganize> organizes = organizeService.querySysOrganizeByCondition(null);
	List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
	for (SysOrganize org : organizes) {
		nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(org.getOrgId()), String.valueOf(org.getParentOrgId()), org));
	}
	List<T> organizesList = NodeUtil.iterator(nodeBeans, "﹎﹎", "orgName");
	request.setAttribute("organizes", organizesList);
	return "system/group/edit";
}
 
Example #7
Source File: SysOrganizeController.java    From mumu with Apache License 2.0 6 votes vote down vote up
/**
 * 编辑组织机构
 * @param orgId 组织机构id
 * @param request
 * @return
 */
@RequiresPermissions("system:organize:edit")
@RequestMapping(value="/edit/{orgId}",method=RequestMethod.GET)
public String edit(@PathVariable String orgId,HttpServletRequest request){
    SysOrganize organize=organizeService.getSysOrganizeById(orgId);
    request.setAttribute("organize", organize);

    List<SysOrganize> organizes=organizeService.querySysOrganizeByCondition(null);
    List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
    for (SysOrganize org : organizes) {
        nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(org.getOrgId()), String.valueOf(org.getParentOrgId()), org));
    }
    List<T> list = NodeUtil.iterator(nodeBeans, "﹎﹎", "orgName");
    request.setAttribute("organizes", list);
    return "system/organize/edit";
}
 
Example #8
Source File: SystemDDLController.java    From mumu with Apache License 2.0 6 votes vote down vote up
/**
 * 进入到编辑数据字典页面
 * @param ddlId 数据字典id
 * @return
 */
@RequiresPermissions("system:ddl:edit")
@RequestMapping(value="/edit/{ddlId}",method = RequestMethod.GET)
public String ddlEdit(@PathVariable String ddlId,HttpServletRequest request){
    //获取所有的数据字典
    List<SysDDL> systemDDLs = systemDDLService.getSystemDDLs();
    List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
    for (SysDDL ddl : systemDDLs) {
        nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(ddl.getDdlCode()), ddl.getParentCode(), ddl));
    }
    List<T> list = NodeUtil.iterator(nodeBeans, "﹎﹎", "ddlValue");
    request.setAttribute("systemDDLs", list);

    SysDDL systemDDL = systemDDLService.getSystemDDLById(ddlId);
    request.setAttribute("systemDDL",systemDDL);
    return "system/ddl/edit";
}
 
Example #9
Source File: SystemDDLController.java    From mumu with Apache License 2.0 6 votes vote down vote up
/**
 * 进入到数据字典详情页面
 * @param ddlId 数据字典id
 * @return
 */
@RequiresPermissions("system:ddl:view")
@RequestMapping(value="/view/{ddlId}",method = RequestMethod.GET)
public String ddlView(@PathVariable String ddlId,HttpServletRequest request){
    //获取所有的数据字典
    List<SysDDL> systemDDLs = systemDDLService.getSystemDDLs();
    List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
    for (SysDDL ddl : systemDDLs) {
        nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(ddl.getDdlCode()), ddl.getParentCode(), ddl));
    }
    List<T> list = NodeUtil.iterator(nodeBeans, "﹎﹎", "ddlValue");
    request.setAttribute("systemDDLs", list);

    //获取数据字典详情
    SysDDL systemDDL = systemDDLService.getSystemDDLById(ddlId);
    request.setAttribute("systemDDL",systemDDL);
    return "system/ddl/view";
}
 
Example #10
Source File: SystemPermissionController.java    From mumu with Apache License 2.0 5 votes vote down vote up
/**
 * 添加权限
 * @return
 */
@RequiresPermissions("system:permission:add")
@RequestMapping(value="/add",method=RequestMethod.GET)
public String permissionAdd(HttpServletRequest request){
       List<SysMenu> sysMenus = menuService.querySysMenuByCondition(null, null, null);
       List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
       for (SysMenu sysMenu : sysMenus) {
           nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(sysMenu.getMenuId()), String.valueOf(sysMenu.getParentMenuId()), sysMenu));
       }
       List<T> list = NodeUtil.iterator(nodeBeans, "﹎﹎", "menuName");
	request.setAttribute("subMenus", list);
	return "system/permission/add";
}
 
Example #11
Source File: Params.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException {
	String param = getParameter(parameterName);
	if (param == null) return null;
	Object obj = ConvertUtils.convert(param, clazz);
	if (obj != null && obj.getClass().equals(clazz))
	{
		return (T) obj;
	}
	throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[] {parameterName});
}
 
Example #12
Source File: SysOrganizeController.java    From mumu with Apache License 2.0 5 votes vote down vote up
/**
 * 组织机构列表
 * @return
 */
@RequiresPermissions("system:organize:add")
@RequestMapping(value="/add",method=RequestMethod.GET)
public String add(HttpServletRequest request){
    List<SysOrganize> organizes=organizeService.querySysOrganizeByCondition(null);
    List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
    for (SysOrganize organize : organizes) {
        nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(organize.getOrgId()), String.valueOf(organize.getParentOrgId()), organize));
    }
    List<T> list = NodeUtil.iterator(nodeBeans, "﹎﹎", "orgName");
    request.setAttribute("organizes", list);
    return "system/organize/add";
}
 
Example #13
Source File: SystemGroupController.java    From mumu with Apache License 2.0 5 votes vote down vote up
/**
 * 添加用户组
 * @return
 */
@RequiresPermissions("system:group:add")
@RequestMapping(value="/add",method=RequestMethod.GET)
public String add(HttpServletRequest request){
	List<SysOrganize> organizes = organizeService.querySysOrganizeByCondition(null);
	List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
	for (SysOrganize org : organizes) {
		nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(org.getOrgId()), String.valueOf(org.getParentOrgId()), org));
	}
	List<T> organizesList = NodeUtil.iterator(nodeBeans, "﹎﹎", "orgName");
	request.setAttribute("organizes", organizesList);
	return "system/group/add";
}
 
Example #14
Source File: SystemDDLController.java    From mumu with Apache License 2.0 5 votes vote down vote up
/**
 * 进入到添加数据字典页面
 * @return
 */
@RequiresPermissions("system:ddl:add")
@RequestMapping(value="/add",method = RequestMethod.GET)
public String ddlAdd(HttpServletRequest request){
    //获取所有的数据字典
    List<SysDDL> systemDDLs = systemDDLService.getSystemDDLs();

    List<NodeUtil.NodeBean> nodeBeans = new ArrayList<NodeUtil.NodeBean>();
    for (SysDDL ddl : systemDDLs) {
        nodeBeans.add(new NodeUtil.NodeBean(String.valueOf(ddl.getDdlCode()), ddl.getParentCode(), ddl));
    }
    List<T> list = NodeUtil.iterator(nodeBeans, "﹎﹎", "ddlValue");
    request.setAttribute("systemDDLs", list);
    return "system/ddl/add";
}
 
Example #15
Source File: WriterVoid.java    From seed with Apache License 2.0 4 votes vote down vote up
@Override
public void write(List<? extends T> items) {
    //nothing to do
}
 
Example #16
Source File: JSONConverter.java    From SI with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public JSONConverter(T resource){
	this.resource = resource;
}
 
Example #17
Source File: JSONConverter.java    From SI with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public JSONConverter(T resource){
	this.resource = resource;
}
 
Example #18
Source File: ResExportObj.java    From ExcelReads with Apache License 2.0 4 votes vote down vote up
@Override
@Deprecated
public void Save() throws Exception {
    OutputStream out =createStream();
    createWK();
    tryCreateCellStyle();
    checkData();
    Class<?> clazz = list.get(0).getClass();
    Field[] fields = ExcelTool.GetFilesDeep(clazz);
    String[] title = new String[fields.length];
    short[] align = new short[fields.length];
    ExcelAnno ea = null;
    if(anyColByKey.isEmpty()) {
        for (int i = 0; i < fields.length; i++) {
            fields[i].setAccessible(true);
            //过滤列
            if (filterColByKey.contains(fields[i].getName())) {
                continue;
            }

            ea = fields[i].getAnnotation(ExcelAnno.class);
            if (ea != null) {
                if(ea.Pass()) {
                    continue;
                }}
            title[i] = fields[i].getName();
            align[i] = 0x2;
            if (ea != null) {
                if(ea.Align()!=0x2){
                    align[i] = ea.Align();
                }
                if (!ea.Value().equals("Null")) {
                    title[i] = ea.Value();
                }
            }
        }
    }else {
        for (int i = 0; i < fields.length; i++) {
            fields[i].setAccessible(true);
            if(!anyColByKey.contains(fields[i].getName())){
                throw new Exception("字段名无效");
            }
        }
        title = anyColByKey.toArray(new String[anyColByKey.size()]);
    }


    if (c != null) {
        list.sort(c);
    }
    Sheet sheet = wk.createSheet("sheet1");
    sheet.setDefaultColumnWidth((short) 15);
    CellStyle style = wk.createCellStyle();
    style.setAlignment(HorizontalAlignment.CENTER);
    Row row = sheet.createRow(0);
    initTitle(title,row,style);
    int index = 0;
    Object object=null;
    String fn;
    for (T o : list) {
        //过滤行
        if (!filter.test(o)) {
            continue;
        }
        process.accept(o);//加工每一行
        row = sheet.createRow(++index);
        for (int i = 0; i < title.length; i++) {
            Cell cell = row.createCell(i);
            cell.setCellStyle(style);
            object=fields[i].get(o);
            if(cellStyle.containsKey(title[i])){
                cell.setCellStyle(cellStyle.get(title[i]).getRealyStyle());
            }
            cell.setCellValue(object==null?"":object.toString());

        }
    }

    try {
        wk.write(out);
        out.flush();
    } finally {
        ExcelTool.Close(wk,out);
    }
}
 
Example #19
Source File: ResExportObj.java    From ExcelReads with Apache License 2.0 4 votes vote down vote up
public ResExportObj(List<T> list){
    super(list);
}
 
Example #20
Source File: ResExportObj.java    From ExcelReads with Apache License 2.0 4 votes vote down vote up
public ResExportObj(List<T> list, String path) {
    super(list, path);
}
 
Example #21
Source File: SaveExcel.java    From ExcelReads with Apache License 2.0 2 votes vote down vote up
/**
 * 转换字段
 *
 * @param titleMapping
 * @return
 */
SaveExcel<T> ConvertName(HashMap<String, String> titleMapping, Boolean isInit);
 
Example #22
Source File: RedisOperationService.java    From onetwo with Apache License 2.0 2 votes vote down vote up
/***
 * 根据key获取缓存,如果还不存在,则上锁执行cacheLoader
 * @author weishao zeng
 * @param key
 * @param cacheLoader
 * @return
 */
<T> T getCache(String key, Supplier<CacheData<T>> cacheLoader);
 
Example #23
Source File: DefaultDataProFilter.java    From ExcelReads with Apache License 2.0 2 votes vote down vote up
@Override
public void accept(T o) {

}
 
Example #24
Source File: SaveExcel.java    From ExcelReads with Apache License 2.0 2 votes vote down vote up
/**
 * 设置风格.必须保证wk不能为null。
 *
 * @param name
 * @param cellStyle
 * @return
 */
SaveExcel<T> SetCellStyle(String name, CellStyleInterface cellStyle);
 
Example #25
Source File: SaveExcel.java    From ExcelReads with Apache License 2.0 2 votes vote down vote up
/**
 * 转换字段
 *
 * @param titleMapping
 * @return
 */
SaveExcel<T> ConvertName(HashMap<String, String> titleMapping);
 
Example #26
Source File: SaveExcel.java    From ExcelReads with Apache License 2.0 2 votes vote down vote up
/**
 * 转换字段名称
 *
 * @param title
 * @param newTitle
 * @return
 */
SaveExcel<T> ConvertName(String title, String newTitle);
 
Example #27
Source File: SaveExcel.java    From ExcelReads with Apache License 2.0 2 votes vote down vote up
/**
 * 设置保存路径
 *
 * @param path
 */
SaveExcel<T> SetPath(String path);
 
Example #28
Source File: SaveExcel.java    From ExcelReads with Apache License 2.0 2 votes vote down vote up
/**
 * 网页输出流
 *
 * @param stream
 * @return
 */
SaveExcel<T> SetOutputStream(OutputStream stream) throws Exception;
 
Example #29
Source File: SaveExcel.java    From ExcelReads with Apache License 2.0 2 votes vote down vote up
/**
 * 此处过滤Excel的列数据(列名)\n
 * 如果加入后,删除这些列
 *
 * @param consumer {@link DataFilterColumnInterface}
 */
SaveExcel<T> AnyCol(Consumer<List<String>> consumer);
 
Example #30
Source File: SaveExcel.java    From ExcelReads with Apache License 2.0 2 votes vote down vote up
/**
 * 此处过滤Excel的列数据(列名)\n
 * 如果加入后,只保留对应数据
 *
 * @param consumer {@link DataFilterColumnInterface}
 */
SaveExcel<T> FilterCol(Consumer<List<String>> consumer);