|
楼主 |
发表于 2020-7-13 13:30:01
|
显示全部楼层
initsession
初始化session
import javax.servlet.http.HttpSession;
public class InitSession {
public InitSession() {
}
/**
* 初始化session中应保存的变量,包括code和logger.
* @param session HttpSession
* @throws Exception
*/
public static void init(HttpSession session) throws Exception {
initCode(session);
// initLogger(session);
}
/**
* 初始化code.
* @param session HttpSession
* @throws Exception
*/
private static void initCode(HttpSession session) throws Exception {
if(session.getAttribute( "_CodeManager ")!=null)return;
// CommonLogger.getInstance().getLogger().info( "开始初始化code ");
CodeManager codeManager = CodeManager.getInstance();
codeManager.initCode();
session.setAttribute( "_CodeManager ", codeManager);
session.setAttribute( "_auditState ", codeManager.queryAuditState());
session.setAttribute( "_census ", codeManager.queryCensus());
session.setAttribute( "_educationalLevel ", codeManager.queryEducationalLevel());
session.setAttribute( "_education ", codeManager.queryEducation()); //教委专业代码
session.setAttribute( "_studentType ", codeManager.queryStudentType());
session.setAttribute( "_subschool ", codeManager.querySubschool());
session.setAttribute( "_station ",codeManager.queryStation());
session.setAttribute( "_testSubject ", codeManager.queryTestSubject());
session.setAttribute( "_year ", codeManager.queryYear());
// System.out .println( "dddd "+codeManager.queryYear().size() ) ;
session.setAttribute( "_manageType ",codeManager.queryManageType());
session.setAttribute( "_stuType ",codeManager.queryStuType());
session.setAttribute( "_classGrade ",codeManager.queryClassgrade());
session.setAttribute( "_distributed ",codeManager.queryDistributed());
session.setAttribute( "_examSort ",codeManager.queryExamSort());//考试类别
session.setAttribute( "_examSchoolType ",codeManager.queryExamSchoolType());//考试单位类型
session.setAttribute( "_examItem ",codeManager.queryExamItem());//考试项目
session.setAttribute( "_employState ",codeManager.QueryEmployState() ) ;//聘任状态
session.setAttribute( "_statusState ",codeManager.queryStatusState() ) ;
session.setAttribute( "_RewardPunishmentCode ",codeManager.queryRewardPunishmentCode() ) ;
session.setAttribute( "_RewardLevelCode ",codeManager.queryRewardLevelCode() ) ;
session.setAttribute( "_UndoSignalCode ",codeManager.queryUndoSignalCode() ) ;
session.setAttribute( "_RewardPunishmentReason ",codeManager.queryRewardPunishmentReason() ) ;
session.setAttribute( "_englishDegree ",codeManager.queryEnglishDegree());//英语审批代码
session.setAttribute( "_socialCourse ",codeManager.querySocialCourse());//社会课程代码(学位)
session.setAttribute( "_punishiment ",codeManager.queryPunishment());//学位惩罚审批代码
session.setAttribute( "_score ",codeManager.queryScore());//成绩代码
session.setAttribute( "_teachDep ",codeManager.queryTeachDep());//教学部门
session.setAttribute( "_institution ",codeManager.queryInstitution());//机构
session.setAttribute( "_firstFocus ",codeManager.queryFirstFocus());//首再次
session.setAttribute( "_examTypeAlias ",codeManager.queryExamTypeAlias());//考核方式别名
session.setAttribute( "_startMark ",codeManager.queryStartMark());//启用标志(课程、教学点专业)
session.setAttribute( "_approveMark ",codeManager.queryApproveMark());//课程审批标志
session.setAttribute( "_cancelMark ",codeManager.queryCancelMark());//课程停开标志
session.setAttribute( "_mediaType ", codeManager.queryMediaType()); //媒体类型
session.setAttribute( "_haveMark ", codeManager.queryHaveMark()); //有无代码表
session.setAttribute( "_generalCourse ", codeManager.queryGeneralCourse()); //课程总表
session.setAttribute( "_generalCourse_IdName ", codeManager.queryGeneralCourse_IdName()); //课程总表
session.setAttribute( "_transCode ", codeManager.queryTransCode()); //传输代码
session.setAttribute( "_transCodeUp ", codeManager.queryTransCodeUp()); //上传传输代码
session.setAttribute( "_transCodeReceive ", codeManager.queryTransCodeReceive()); //接收传输代码
session.setAttribute( "_openSpeciality ", codeManager.queryOpenSpeciality()); //开设专业
session.setAttribute( "_credentialType ", codeManager.queryCredentialType()); //证件类型
session.setAttribute( "_socialSubjcetSort ",codeManager.querySocialSubjcetSort());//社会科目类别
session.setAttribute( "_examStateCode ",codeManager.queryExamStateCode());//审核状态代码表
session.setAttribute( "_netExamCourse ",codeManager.queryNetExamCourse());//网考科目
CommonLogger.getInstance().getLogger().debug( "初始化code完成 ");
}
} |
|