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

📄 createsche_week.java

📁 一个日本流行的,功能较全的开源Web办公管理(Groupware)系统。
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
package jp.co.sjts.gsession.schedule;
/*
 * Copyright (C) 1999-2002 Japan Total System Co,LTD
 */
import java.util.Hashtable;
import java.util.TreeMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Vector;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jp.co.sjts.gsession.tools.*;
import jp.co.sjts.gsession.main.MainBaseServlet;

/**
 * 僗働僕儏乕儖廡娫夋柺傪嶌惉偟傑偡丅<BR>
 *
 * @author Ei       Kishida &lt;ei@sjts.co.jp&gt;
 * @author Hideyuki Kitade  &lt;kitade@sjts.co.jp&gt;
 */
public class Createsche_week extends CreatePage{
	/** */
	private Hashtable hsPara;
	/** */
	private Hashtable hsPara1;
	/** */
	private String mapURL = null;
	/** */
	private String mainURL = null;
	/** */
	private String helpURL = null;  //僿儖僾
	/** */
	private String dataDIR = null;
	/** */
	private String userDIR = null;
	/** */
	private String groupDIR = null;
	/** */
	private String hiduke ;
	/** */
	private int mod ;
	/** */
	private String gid ;
	/** */
	private String uid ;
	/** */
	private String sid ;
	/** */
	private IUserManager UM = null;
	/** */
	private SCScheFile sfile ;
	/** */
	private SCScheFile sfile1 ;
	/** */
	private SCScheData sdata ;
	/** */
	private SCConfUserFile uconf ;
	/** */
	private GSDate cal ;			//僇儗儞僟乕
	/** */
	private MainBaseServlet mbs;
	/** */
	private IHoliday holiday;
	/** */
	String[] s0 = new String[8];
	/** */
	String[] s1 = new String[8];
	/** */
	String[] s2 = new String[8];
	/** */
	private final String title = "僗働僕儏乕儖";
	/** */
	private static final String bgcolor = "#ffffff";
	/** */
	private static final String text = "#000000";
	/** */
	private static final String link = "#0000ff";
	/** */
	private static final String alink = "#000000";
	/** */
	private static final String vlink = "#0000ff";
	/** */
	private static final int ID = 0;
	/** */
	private static final int NAME = 1;
	/** */
	private static final int KANA = 2;

	/**
	 *  僷儔儊乕僞僙僢僩
	 *
	 *  @param hsPara  僷儔儊乕僞奿擺僴僢僔儏僥乕僽儖
	 *  @param hsPara1 僷儔儊乕僞奿擺僴僢僔儏僥乕僽儖
	 *  @param UM      儐乕僓乕儅僱乕僕儍乕
	 *  @param mod     儌乕僪
	 *  @param hiduke  擔晅
	 *  @param gid     僌儖乕僾ID
	 */
	public Createsche_week(Hashtable hsPara,Hashtable hsPara1,IUserManager UM,int mod,String hiduke,String gid,IHoliday holiday){

		this.hsPara = hsPara;
		this.mapURL = (String)hsPara.get(SCCmd.SC_MAP);
		this.dataDIR = (String)hsPara.get(SCCmd.SC_DIR);
		this.mainURL = (String)hsPara.get(SCCmd.SC_MAIN);  //儊僀儞URL庢摼
		this.helpURL = (String)hsPara.get("help");        //僿儖僾URL庢摼
		this.userDIR = (String)hsPara.get(SCCmd.SC_USER);
		this.groupDIR = (String)hsPara.get(SCCmd.SC_GROUP);
		this.hsPara1 = hsPara1;
		this.hiduke = hiduke;
		this.gid = gid;		//廡娫丒擔娫偺偲偒偺僌儖乕僾
		this.mod = mod;		//
		this.UM = UM;
		this.holiday = holiday;
	}

	/**
	 * <p>HTML弌椡
	 *
	 * @param  req  儕僋僄僗僩
	 * @param  res  儗僗億儞僗
	 */
	protected boolean writePage(HttpServletRequest req,HttpServletResponse res) throws GSException{

		s0[1] = new String("(擔)</FONT>");
		s0[2] = new String("(寧)</FONT>");
		s0[3] = new String("(壩)</FONT>");
		s0[4] = new String("(悈)</FONT>");
		s0[5] = new String("(栘)</FONT>");
		s0[6] = new String("(嬥)</FONT>");
		s0[7] = new String("(搚)</FONT>");
		s0[0] = new String("(擔)</FONT>");

		s1[0] = new String("<FONT COLOR=\"#ff0000\">");
		s1[1] = new String("<FONT COLOR=\"#ff0000\">");
		s1[2] = new String("<FONT COLOR=\"#000000\">");
		s1[3] = new String("<FONT COLOR=\"#000000\">");
		s1[4] = new String("<FONT COLOR=\"#000000\">");
		s1[5] = new String("<FONT COLOR=\"#000000\">");
		s1[6] = new String("<FONT COLOR=\"#000000\">");
		s1[7] = new String("<FONT COLOR=\"#0000ff\">");

		s2[0] = new String("#ffcfcf");
		s2[1] = new String("#ffc1c1");
		s2[2] = new String("#ffffff");
		s2[3] = new String("#ffffff");
		s2[4] = new String("#ffffff");
		s2[5] = new String("#ffffff");
		s2[6] = new String("#ffffff");
		s2[7] = new String("#cce6ff");

		cal = new GSDate();
		cal.setYMD(hiduke);
		int today = Integer.parseInt(cal.getstrYear() + cal.getstrMonth() + cal.getstrDate());
		int todayym = Integer.parseInt(cal.getstrYear() + cal.getstrMonth());
		int todayyy = Integer.parseInt(cal.getstrYear());
		int todaymm = Integer.parseInt(cal.getstrMonth());
		int todaydd = Integer.parseInt(cal.getstrDay());
		ArrayList[] alist = new ArrayList[7];

		HttpSession session = req.getSession(false);
		this.uid =((Integer)session.getAttribute(GSBase.SESSION_PARA_UID)).toString();
/* 僗働僕儏乕儖僨乕僞 */
		String url = GSTool.removeParaFormURI(req.getRequestURI());


		addScript(
			 "function openWindow(i)\r\n"
			+"{\r\n"
			+"   var win=window.open(\"\",\"window\"+i,\"width=550,height=500,resizable=1\");\r\n"
			+"   win.location=\""+mainURL+"?"+SCCmd.PA_CMD+"="+SCCmd.CD_UINF+"&"+SCCmd.PA_UID+"="+uid+"\";\r\n"
			+"}"
		);

		addScript(
			 "function openWindow2(i)\r\n"
			+"{\r\n"
			+"   var win=window.open(\"\",\"window\"+i,\"width=550,height=500,resizable=1\");\r\n"
			+"   win.location=\""+mainURL+"?"+SCCmd.PA_CMD+"="+SCCmd.CD_UINF+"&"+SCCmd.PA_UID+"=\""+"+i;\r\n"
			+"}"
		);

		setCharset("iso-2022-jp");
		setTitle(title);
		setBodyColor(bgcolor,text,link,vlink,alink);

		//僿儖僾儁乕僕
		setHelpUrl(helpURL + GSHelpPage.SC000000);

/* 僞僀僩儖 */
		addBodyString("");
		addBodyString("<!--僞僀僩儖-->");
		addBodyString("<TABLE WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">");
		addBodyString("<TR>");
		addBodyString("<TD>");

		addBodyString("  <TABLE WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"1\">");
		addBodyString("  <TR HEIGHT=\"40\" BGCOLOR=\"#000080\">");
		addBodyString("  <FORM METHOD=\"post\" ACTION=\"" + url + "\">");
		addBodyString("  <INPUT TYPE=\"hidden\" NAME=\"" + SCCmd.PA_CMD + "\" VALUE=\"" + SCCmd.CD_WEEK + "\">");
		addBodyString("  <INPUT TYPE=\"hidden\" NAME=\"" + SCCmd.PA_SUB + "\" VALUE=\"" + SCCmd.CD_WEEK + "\">");
		addBodyString("  <INPUT TYPE=\"hidden\" NAME=\"" + SCCmd.PA_MOD + "\" VALUE=\"" + mod + "\">");
		addBodyString("  <INPUT TYPE=\"hidden\" NAME=\"" + SCCmd.PA_DATE + "\" VALUE=\"" + hiduke + "\">");
		addBodyString("  <INPUT TYPE=\"hidden\" NAME=\"" + SCCmd.PA_TMP + "\" VALUE=\"" + 1 + "\">");
		addBodyString("  <INPUT TYPE=\"hidden\" NAME=\"" + SCCmd.PA_GID + "\" VALUE=\"" + gid + "\">");
		addBodyString("  <INPUT TYPE=\"hidden\" NAME=\"" + SCCmd.PA_SORTFLG + "\" VALUE=\""
		 			  + ( (hsPara1.get(SCCmd.PA_SORTFLG)!=null)?
						  ((String[])(hsPara1.get(SCCmd.PA_SORTFLG)))[0]:"false")
					  + "\">");

		addBodyString("  <TD WIDTH=\"100%\"><FONT SIZE=\"+1\" COLOR=\"#ffffff\"><B>"+title+"</B></FONT></TD>");
		addBodyString("  <TD WIDTH=\"5%\" NOWRAP>");
		addBodyString("  <A HREF=\""+url
					  +"?"+SCCmd.PA_CMD+"="+SCCmd.CD_SET
					  +"&"+SCCmd.PA_MOD+"="+mod
					  +"&"+SCCmd.PA_GID+"="+gid
					  +"&"+SCCmd.PA_SUB+"="+SCCmd.CD_WEEK
					  +"&"+SCCmd.PA_DATE+"="+cal.getYMD()
					  +"\">");
		addBodyString("  <IMG SRC=\""+mapURL+SCCmd.S_ST+"\" ALT=\"僗働僕儏乕儖婎杮愝掕\" WIDTH=\"93\" HEIGHT=\"28\" BORDER=\"0\"></A> </TD>");
		addBodyString("  </TR>");
		addBodyString("  </TABLE>");
		addBodyString("</TD>");
		addBodyString("</TR>");
		//addBodyString("</TABLE>");
/* 杮懱 */
		addBodyString("<!--杮懱-->");
		addBodyString("<TR>");
		addBodyString("<TD BGCOLOR=\"#ffffff\">");
		addBodyString("  <TABLE WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"2\">");
		addBodyString("  <TR>");
		addBodyString("  <TD width=\"10%\" nowrap>");
		addBodyString("  <A HREF=\""+url
					  +"?"+SCCmd.PA_CMD+"="+SCCmd.CD_DAY
					  +"&"+SCCmd.PA_SUB+"="+SCCmd.CD_DAY
					  +"&"+SCCmd.PA_MOD+"="+0
					  +"&"+SCCmd.PA_GID+"="+gid
					  +"&"+SCCmd.PA_USER+"="+uid
					  +"&"+SCCmd.PA_DATE+"="+hiduke
					  +"&"+SCCmd.PA_TMP+"="+1
					  +"\">");
		addBodyString("  <IMG SRC=\""+mapURL+SCCmd.S_DAY+"\" ALT=\"擔娫\" WIDTH=\"30\" HEIGHT=\"18\" BORDER=\"0\"></A> </TD>");

		addBodyString("  <TD>");
		addBodyString("    <TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">");
		addBodyString("    <TR>");

		addBodyString("    <TD ALIGN=\"left\">");
		addBodyString("    <font color=\"#e0e0e0\">仭</font>");
		addBodyString("    </TD>");
		addBodyString("    <TD ALIGN=\"left\">");
		addBodyString("    <font color=\"#000000\">嵼惾丂</font><BR>");
		addBodyString("    </TD>");

		addBodyString("    <TD ALIGN=\"left\">");
		addBodyString("    <font color=\"#ffdead\">仭</font>");
		addBodyString("    </TD>");
		addBodyString("    <TD ALIGN=\"left\">");
		addBodyString("    <font color=\"#000000\">寚嬑丂</font><BR>");
		addBodyString("    </TD>");

		addBodyString("    <TD ALIGN=\"left\">");
		addBodyString("    <font color=\"#00ced1\">仭</font>");
		addBodyString("    </TD>");
		addBodyString("    <TD ALIGN=\"left\">");
		addBodyString("    <font color=\"#000000\">奜弌丂</font><BR>");
		addBodyString("    </TD>");

		addBodyString("    </TR>");
		addBodyString("    </TABLE>");
		addBodyString("  </TD>");

		SCMsgFile mfile = new SCMsgFile(userDIR,uid);//儐乕僓乕僼傽僀儖
		if (mfile.size()== 0){
			addBodyString("  <TD ALIGN=\"left\" width=\"15%\" BGCOLOR=\"#ffffff\">");
			addBodyString("  <font>揱尵偼偁傝傑偣傫</font>");
			addBodyString("  </TD>");
			
		}else{
			addBodyString("  <TD ALIGN=\"left\" width=\"15%\" BGCOLOR=\"#ffffff\">");
			addBodyString("  <font>揱尵偑撏偄偰偄傑偡</font>");
			addBodyString("  </TD>");
		}

		addBodyString("  <TD ALIGN=\"right\">");
		addBodyString("  <INPUT TYPE=\"image\" NAME=\"zweek\" SRC=\""+mapURL+SCCmd.S_LA1+"\" ALT=\"慜廡堏摦\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\">");
		addBodyString("  <INPUT TYPE=\"image\" NAME=\"zday\" SRC=\""+mapURL+SCCmd.S_LA2+"\" ALT=\"慜擔堏摦\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\">");
		addBodyString("  <INPUT TYPE=\"image\" NAME=\"tday\" SRC=\""+mapURL+SCCmd.S_TODAY+"\" ALT=\"崱擔\" WIDTH=\"30\" HEIGHT=\"18\" BORDER=\"0\">");
		addBodyString("  <INPUT TYPE=\"image\" NAME=\"yday\" SRC=\""+mapURL+SCCmd.S_RA2+"\" ALT=\"梻擔堏摦\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\">");
		addBodyString("  <INPUT TYPE=\"image\" NAME=\"yweek\" SRC=\""+mapURL+SCCmd.S_RA1+"\" ALT=\"梻廡堏摦\" WIDTH=\"18\" HEIGHT=\"18\" BORDER=\"0\">");
		addBodyString("  </TD>");
		addBodyString("  </TR>");
		addBodyString("  </TABLE>");
		addBodyString("</TD>");
		addBodyString("</TR>");

/*  */
		addBodyString("<TR>");
		addBodyString("<TD>");
		addBodyString("  <TABLE WIDTH=\"100%\" BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"1\">");
		addBodyString("  <TR BGCOLOR=\"#000080\">");
		addBodyString("  <TH HEIGHT=\"40\" COLSPAN=\"8\" NOWRAP><FONT COLOR=\"#ffffff\">"+hiduke.substring(0,4)+"擭"+hiduke.substring(4,6)+"寧</FONT></TH>");
		addBodyString("  </TR>");
/* 僇儗儞僟乕 */
		addBodyString("  <TR BGCOLOR=\"#cccccc\">");
		addBodyString("  <TH WIDTH=\"16%\" BGCOLOR=\"#808080\" NOWRAP><FONT COLOR=\"#ffffff\">巵柤</FONT></TH>");
		boolean nextmonth = false;			//師寧僨乕僞昁梫偐
		String strmonth = cal.getstrMonth();	//7擔娫偱寧偑曄傢偭偨偐僠僃僢僋梡
		int saveix = 7;						//壗帪偐傢偭偨偐
		for(int ix=0;ix<7;ix++)
		{
			if(Integer.parseInt(strmonth)!=Integer.parseInt(cal.getstrMonth()))
			{
				nextmonth =true;
				saveix =ix;
				strmonth = cal.getstrMonth();
			}

			boolean holiFlg = holiday.isHoliday(cal.getYMD());
			addBodyString("  <TH WIDTH=\"12%\" NOWRAP><A HREF=\""+url
						  +"?"+SCCmd.PA_CMD+"="+SCCmd.CD_DAY
						  +"&"+SCCmd.PA_MOD+"="+0
						  +"&"+SCCmd.PA_USER+"="+uid
						  +"&"+SCCmd.PA_GID+"="+gid
						  +"&"+SCCmd.PA_DATE+"="+cal.getYMD()
						  +"&"+SCCmd.PA_TMP+"="+1
						  +"\">"
						  +((holiFlg)?s1[0]:s1[cal.getWeek()])+cal.getDay()+"擔"+s0[cal.getWeek()]
						  +"</A></TH>");
			cal.setYMD(cal.getYear(),cal.getMonth(),cal.getDay()+1);
		}

		addBodyString("  </TR>");
/* 昞帵偝傟傞嵟屻偺擔晅 */
		String endweek = cal.getYMD();
		/* 擔晅傪栠偡 */
		cal.setYMD(hiduke);//栠偡
		String yymm = cal.getstrYear()+cal.getstrMonth();
		for(int index=0;index<7;index++){
			alist[index]=new ArrayList();
		}

/* 巊梡幰柤 */
		Integer sessionUID = (Integer)session.getAttribute(GSBase.SESSION_PARA_UID);
		String sessionUNAME = (String)session.getAttribute(GSBase.SESSION_PARA_UNAME);
		String ustrid = sessionUID.toString();
		int usrinid= Integer.parseInt(ustrid);
		IUser iuser = UM.getUser(usrinid);
		if(usrinid!=0){
			addBodyString("  <TR ALIGN=\"left\" VALIGN=\"top\">");
			addBodyString("  <TD HEIGHT=\"50\" BGCOLOR=\"#e0e0e0\">");
			addBodyString("  <A HREF=\"javascript:openWindow("+sessionUID+")\">"+sessionUNAME+"</A><BR>");

			addBodyString("  <A HREF=\""+url
						  +"?"+SCCmd.PA_CMD+"="+SCCmd.CD_MONTH
						  +"&"+SCCmd.PA_MOD+"="+mod
						  +"&"+SCCmd.PA_GID+"="+gid
						  +"&"+SCCmd.PA_USER+"="+ustrid
						  +"&"+SCCmd.PA_DATE+"="+cal.getYMD()
						  +"\">");
			addBodyString("  <IMG SRC=\""+mapURL+SCCmd.S_MON_BTN+"\" ALT=\"寧娫\" BORDER=\"0\"></A>");

			addBodyString("  <A HREF=\""+url
						  +"?"+SCCmd.PA_CMD+"="+SCCmd.CD_MSG
						  +"&"+SCCmd.PA_MOD+"="+mod
						  +"&"+SCCmd.PA_GID+"="+gid
						  +"&"+SCCmd.PA_DATE+"="+cal.getYMD()
						  +"\">");
			addBodyString("  <IMG SRC=\""+mapURL+SCCmd.S_DEN_BTN+"\" ALT=\"揱尵昞帵\" BORDER=\"0\"></A> </TD>");


/* 僗働僕儏乕儖僨乕僞僙僢僩 */
/* 巊梡幰偺僗働僕儏乕儖 */
			sfile = new SCScheFile(userDIR,0,sessionUID.toString(),yymm);
			for(int ix=0;ix<sfile.size();ix++)

⌨️ 快捷键说明

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