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

📄 companymanagenewtag.java

📁 本代码是一个权限管理系统源代码
💻 JAVA
字号:
/**
 * 
 */
package com.seavision.PermissionManage.tag;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import com.seavision.PermissionManage.common.BaseTag;
import com.seavision.PermissionManage.components.CompanyManage;
import com.seavision.PermissionManage.components.UserManage;
import com.seavision.PermissionManage.help.DaoFectory;
import com.seavision.PermissionManage.vo.CompanyVO;
import com.seavision.PermissionManage.vo.UserVO;

/**
 * @author qiao.rong
 * @parm null
 * @增加公司信息tag 需要循环打印上级公司列表和公色负责人(放入页面下拉框中)
 */

public class CompanyManageNewTag extends BaseTag {

	public int doStartTag() throws JspException {
		this.initializeTag("CompanyManageNewTag"); // 初始化类

//		try {
			this.appendMessage("<root>");

//			UserVO loguser = (UserVO) this.getAttribute("loginUserBean"); // 得到登陆用户的信息
//			String message = (String) this.getAttribute("message"); // 得到request中的message对象
//
//			this.removeAttribute("message"); // 删除session中message的信息
//
//			if (this.check(loguser)) { // 判断用户登陆信息是否存在
//
//				message = "您还没有登录或您离开系统时间太久,请重新登录";
//				String ResultMsg = "登陆失败";
//				// --系统提示信息--
//				this.appendMessage("<system>");
//				this.appendMessage("<appMessage>");
//				this.appendMessage("<message>" + message + "</message>");
//				this.appendMessage("<ResultMsg>" + ResultMsg + "</ResultMsg>");
//				this.appendMessage("</appMessage>");
//				this.appendMessage("</system>");
//			} // end if
//			else {
				CompanyVO companyVO_temp = new CompanyVO(); // 公司vo,用于从list中取vo的暂存
				List list_company = new ArrayList(); // 公司列表
				UserVO userVO = null; // 用户vo
				String fuZeRenID = null; // 负责人ID,临时存放
			
				
				// 组件
				CompanyManage companyManage = DaoFectory.getCompanyManage();
				UserManage userManage = DaoFectory.getUserManage();


				// 循环打印公司列表
				list_company = companyManage.getCompanyList();
				this.appendMessage("<companyList>");
				for (int i = 0; i < list_company.size(); i++) {
					companyVO_temp = (CompanyVO) list_company.get(i);
					this.appendMessage("<company>");
					this.appendMessage("<company_pId>"
							+ companyVO_temp.getCompanyId() + "</company_pId>");// 公司编号
					this.appendMessage("<company_pName>"
							+ companyVO_temp.getCompanyName()
							+ "</company_pName>"); // 公司名称
					this.appendMessage("</company>");
				}
				this.appendMessage("</companyList>");

				// 公司负责人列表,公司表company中的负责人
//				List list_user = userManage.getUserList() 
				this.appendMessage("<companyAuthorityList>");
//				for (int i = 0; i < list_company.size(); i++) {
//					companyVO_temp = (CompanyVO) list_company.get(i);
					this.appendMessage("<companyAuthority>");
//					System.out.println(companyVO_temp.getCompanyAuthority());
//					if(!companyVO_temp.getCompanyAuthority().equals("0")){  
//					this.appendMessage("<companyAuthorityId>"
//							+ "0"
//							+ "</companyAuthorityId>"); // 负责人ID
//					fuZeRenID = String.valueOf(companyVO_temp.getCompanyAuthority());
//					userVO = userManage.getUser(fuZeRenID);
					this.appendMessage("<companyAuthorityName>"
							+ "无" + "</companyAuthorityName>");// 公司负责人id
//					}
					this.appendMessage("</companyAuthority>");
//				}
				this.appendMessage("</companyAuthorityList>");

//			} // end else
			this.appendMessage("</root>");

			this.outputMessage();
//		} catch (Exception ex) {
//			this.outputStandardErrorMessage();
//			ex.printStackTrace();
//			print("userlistTag出现异常");
//
//		} // end catch

		return TagSupport.EVAL_BODY_INCLUDE; // 继续计算BODY体
	} // end doStartTag method

	public int doEndTag() throws JspException {
		return EVAL_PAGE;
	}// doEndTag method
}

⌨️ 快捷键说明

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