📄 schedule.java
字号:
if(mod!=1){
// 儐乕僓愝掕僼傽僀儖庢摼
uconf = new SCConfUserFile(userDir,entuid);
maxsche = uconf.GetSchemax();
maxsche++;
uconf.SetSchemax(maxsche);
uconf.Save();
}else{
// 僌儖乕僾愝掕僼傽僀儖庢摼
gconf = new SCConfGroupFile(groupDir,entuid);
gconf.Load();
maxsche = gconf.GetSchemax();
maxsche++;
gconf.SetSchemax(maxsche);
gconf.Save();
}
GSDate cal2 = new GSDate();//奐巒
GSDate cal3 = new GSDate();//廔椆
cal2.setYMD(syy+smm+"01");
cal3.setYMD(eyy+emm+"01");
int roopcnt = 0;
while (Long.parseLong(cal2.getYMD())<=Long.parseLong(cal3.getYMD())){
roopcnt ++;
cal2.setYMD(cal2.getYear(),cal2.getMonth()+1,cal2.getDay());
}
cal2.setYMD(syy+smm+sdd);
cal3.setYMD(eyy+emm+edd);
for(int intcnt=0 ;intcnt<roopcnt ;intcnt++){
//擖椡忣曬庢摼
if(mod!=1)
{
sfile = new SCScheFile(userDir,0,entuid,cal2.getstrYear()+cal2.getstrMonth());
}else{
sfile = new SCScheFile(groupDir,1,entuid,cal2.getstrYear()+cal2.getstrMonth());
}
sfile.Addmod(-1,new SCScheData(Integer.toString(maxsche),
uid,syy+smm+sdd+shh+shm,
eyy+emm+edd+ehh+ehm,
chkStr(title),
chkStr(content),
chkStr(bikou)
,open));
sfile.Save();
cal2.setYMD(cal2.getYear(),cal2.getMonth()+1,15);
}
cal.setYMD(hiduke);
// 懠儐乕僓暘傕嶌惉
SCTempFile sftemp = new SCTempFile(userDir,uid);
for( int i = 0 ; i < sftemp.size(); i++)
{
SCTempData sdtemp = sftemp.Getmod(i);//柧嵶撉傒崬傒
// 儐乕僓愝掕僼傽僀儖庢摼
uconf = new SCConfUserFile(userDir,sdtemp.GetUid());
maxsche = uconf.GetSchemax();
maxsche++;
uconf.SetSchemax(maxsche);
//強嵼僙僢僩
if (Integer.parseInt(shozai) == 1){
uconf.SetShozai("1");
}
uconf.Save();
cal2.setYMD(syy+smm+"01");//奐巒
cal3.setYMD(eyy+emm+"01");//廔椆
roopcnt = 0;
while (Long.parseLong(cal2.getYMD())<=Long.parseLong(cal3.getYMD())){
roopcnt ++;
cal2.setYMD(cal2.getYear(),cal2.getMonth()+1,cal2.getDay());
}
cal2.setYMD(syy+smm+sdd);
cal3.setYMD(eyy+emm+edd);
for(int intcnt=0 ;intcnt<roopcnt ;intcnt++){
sfile = new SCScheFile(userDir,0,sdtemp.GetUid(),cal2.getstrYear()+cal2.getstrMonth());
sfile.Addmod(-1,new SCScheData(Integer.toString(maxsche),
uid,
syy+smm+sdd+shh+shm,
eyy+emm+edd+ehh+ehm,
chkStr(title),
chkStr(content),
chkStr(bikou),
open));
sfile.Save();
cal2.setYMD(cal2.getYear(),cal2.getMonth()+1,1);
}
}
blnFlg = true;
return blnFlg;
}
/**
* 僗働僕儏乕儖曄峏
*
* @param hsPara 僴僢僔儏僥乕僽儖
* @param req 僒乕僽儗僢僩儕僋僄僗僩
* @param res 僒乕僽儗僢僩儗僗億儞僗
* @param uid 儐乕僓乕ID
* @param mod 儌乕僪
* @param hiduke 擔晅
* @param sid 僗働僕儏乕儖ID
* @param fileEdate
* @return true偱惉岟,false偱幐攕
*/
public boolean ScheUpd(Hashtable hsPara,HttpServletRequest req,HttpServletResponse res,String uid,int mod,String hiduke,String sid,String fileEdate)
throws GSException
{
boolean blnFlg = false;
String dataDir = (String)hsInitData.get(SCCmd.SC_DIR);
String userDir = (String)hsInitData.get(SCCmd.SC_USER);
String groupDir = (String)hsInitData.get(SCCmd.SC_GROUP);
cal.setYMD(fileEdate);
// 愝掕僨乕僞撉傒崬傒
SCConfUserFile sconf = new SCConfUserFile(userDir,uid);
String entuid = (String)((String[])hsPara.get(SCCmd.PA_USER))[0];
SCScheData sdata = sfile.DataChk(sid);
if (sdata ==null){
CreateErrorPage epage = new CreateErrorPage("曇廤尦偺僨乕僞偑偁傝傑偣傫",MapUrl,strErrPara);
epage.write(req,res);
return blnFlg;
}
HttpSession session = req.getSession(false);
Integer sessionUID = (Integer)session.getAttribute(GSBase.SESSION_PARA_UID);
String syy = (String)((String[])hsPara.get("styy"))[0];
String smm = (String)((String[])hsPara.get("stmm"))[0];
if(smm.length() == 1)
{
smm ="0"+smm;
}
String sdd = (String)((String[])hsPara.get("stdd"))[0];
if(sdd.length() == 1)
{
sdd ="0"+sdd;
}
String shh = (String)((String[])hsPara.get("sthh"))[0];
if(shh.length() == 1)
{
shh ="0"+shh;
}
String shm = (String)((String[])hsPara.get("sthm"))[0];
if(shm.length() == 1)
{
shm ="0"+shm;
}
String eyy = (String)((String[])hsPara.get("edyy"))[0];
String emm = (String)((String[])hsPara.get("edmm"))[0];
if(emm.length() == 1)
{
emm ="0"+emm;
}
String edd = (String)((String[])hsPara.get("eddd"))[0];
if(edd.length() == 1)
{
edd ="0"+edd;
}
String ehh = (String)((String[])hsPara.get("edhh"))[0];
if(ehh.length() == 1)
{
ehh ="0"+ehh;
}
String ehm = (String)((String[])hsPara.get("edhm"))[0];
try{
if(Integer.parseInt(ehh)==Integer.parseInt(sconf.GetToTime()+1)&&Integer.parseInt(ehm)==30)
throw new GSException("廔椆帪娫偑偙偊偰傑偡丅");
} catch(GSException e) {
CreateErrorPage epage = new CreateErrorPage(e.getMessage(),MapUrl,strErrPara);
epage.write(req,res);
return blnFlg;
}
if(ehm.length() == 1)
{
ehm ="0"+ehm;
}
try{
if(Long.parseLong(syy+smm+sdd+shh+shm)>= Long.parseLong(eyy+emm+edd+ehh+ehm))
throw new GSException("奐巒亙廔椆偱擖椡偟偰偔偩偝偄丅");
} catch(GSException e) {
CreateErrorPage epage = new CreateErrorPage(e.getMessage(),MapUrl,strErrPara);
epage.write(req,res);
return blnFlg;
}
String title = (String)((String[])hsPara.get("title"))[0];
try{
if(title.length() == 0)
throw new GSException("僞僀僩儖傪擖椡偟偰偔偩偝偄丅");
} catch(GSException e) {
CreateErrorPage epage = new CreateErrorPage(e.getMessage(),MapUrl,strErrPara);
epage.write(req,res);
return blnFlg;
}
String content = (String)((String[])hsPara.get("content"))[0];
if(content.length() == 0)
{
content=" ";
}
String bikou = (String)((String[])hsPara.get("bikou"))[0];
if(bikou.length() == 0)
{
bikou =" ";
}
String open = (String)((String[])hsPara.get("open"))[0];
GSDate cal2 = new GSDate();//奐巒
GSDate cal3 = new GSDate();//廔椆
if(mod==0){
sfile = new SCScheFile(userDir,mod,entuid,cal.getstrYear()+cal.getstrMonth());
}else{
sfile = new SCScheFile(groupDir,mod,entuid,cal.getstrYear()+cal.getstrMonth());
}
SCScheData chkSdata = sfile.DataChk(sid);
cal2.setYMD(chkSdata.GetFrom());
cal3.setYMD(chkSdata.GetTo());
int roopcnt = 0;
while (Long.parseLong(cal2.getYMD())<=Long.parseLong(cal3.getYMD())){
roopcnt ++;
cal2.setYMD(cal2.getYear(),cal2.getMonth()+1,1);
}
cal2.setYMD(chkSdata.GetFrom());
cal3.setYMD(chkSdata.GetTo());
//嶍彍
for(int intcnt=0 ;intcnt<roopcnt ;intcnt++){
//擖椡忣曬庢摼
if(mod==0){
sfile = new SCScheFile(userDir,mod,entuid,cal2.getstrYear()+cal2.getstrMonth());
}else{
sfile = new SCScheFile(groupDir,mod,entuid,cal2.getstrYear()+cal2.getstrMonth());
}
if (sfile.DataChk(sid)!=null){
sfile.Deluid(sid);
sfile.Save();
}
cal2.setYMD(cal2.getYear(),cal2.getMonth()+1,15);
}
//捛壛
cal2.setYMD(syy+smm+"01");
cal3.setYMD(eyy+emm+"01");
roopcnt = 0;
while (Long.parseLong(cal2.getYMD())<=Long.parseLong(cal3.getYMD())){
roopcnt ++;
cal2.setYMD(cal2.getYear(),cal2.getMonth()+1,1);
}
cal2.setYMD(syy+smm+sdd);
cal3.setYMD(eyy+emm+edd);
for(int intcnt=0 ;intcnt<roopcnt ;intcnt++){
//擖椡忣曬庢摼
if(mod!=1){
sfile = new SCScheFile(userDir,0,entuid,cal2.getstrYear()+cal2.getstrMonth());
}else{
sfile = new SCScheFile(groupDir,1,entuid,cal2.getstrYear()+cal2.getstrMonth());
}
sdata.SetUid(uid);
sdata.SetFrom(syy+smm+sdd+shh+shm);
sdata.SetTo(eyy+emm+edd+ehh+ehm);
sdata.SetTitle(chkStr(title));
sdata.SetContent(chkStr(content));
sdata.SetBikou(chkStr(bikou));
sdata.SetOpen(open);
sfile.Addmod(-1,sdata);//捛壛
sfile.Save();
cal2.setYMD(cal2.getYear(),cal2.getMonth()+1,1);
}
cal.setYMD(hiduke);
blnFlg = true;
return blnFlg;
}
/**
* 暥帤楍傪曐懚偱偒傞宍偵曄姺偟傑偡丅
*
* @param strStr 曄姺懳徾暥帤楍
* @param 曄姺屻暥帤楍
*/
public String chkStr(String strStr){
String strPara = null;
strPara = GSTool.delimitEncorde(",",GSHtml.ReturntoBR(GSHtml.transMsg(strStr)));
return strPara;
}
/**
* temp僼傽僀儖傪峏怴偟傑偡丅
*
* @param hsPara
* @param req
* @param res
* @param uid 儐乕僓乕ID
* @param mod 儌乕僪(擔丄廡丄寧)
* @param hiduke 擔晅
* @param euid 僗働僕儏乕儖偺懳徾幰
*/
public void TempUpd(Hashtable hsPara ,
HttpServletRequest req ,
HttpServletResponse res ,
String uid ,
int mod ,
String hiduke ,
String euid
) throws GSException{
String userDir = (String)hsInitData.get(SCCmd.SC_USER);
String groupDir = (String)hsInitData.get(SCCmd.SC_GROUP);
cal.setYMD(hiduke);
//擖椡忣曬庢摼
SCScheFile stmp = new SCScheFile(userDir,2,uid,cal.getstrYear()+cal.getstrMonth());
SCScheData sdata = stmp.DataChk(uid);
HttpSession session = req.getSession(false);
Integer sessionUID = (Integer)session.getAttribute(GSBase.SESSION_PARA_UID);
String syy = (String)((String[])hsPara.get("styy"))[0];
String smm = (String)((String[])hsPara.get("stmm"))[0];
if(smm.length() == 1)
{
smm ="0"+smm;
}
String sdd = (String)((String[])hsPara.get("stdd"))[0];
if(sdd.length() == 1)
{
sdd ="0"+sdd;
}
String shh = (String)((String[])hsPara.get("sthh"))[0];
if(shh.length() == 1)
{
shh ="0"+shh;
}
String shm = (String)((String[])hsPara.get("sthm"))[0];
if(shm.length() == 1)
{
shm ="0"+shm;
}
String eyy = (String)((String[])hsPara.get("edyy"))[0];
String emm = (String)((String[])hsPara.get("edmm"))[0];
if(emm.length() == 1)
{
emm ="0"+emm;
}
String edd = (String)((String[])hsPara.get("eddd"))[0];
if(edd.length() == 1)
{
edd ="0"+edd;
}
String ehh = (String)((String[])hsPara.get("edhh"))[0];
if(ehh.length() == 1)
{
ehh ="0"+ehh;
}
String ehm = (String)((String[])hsPara.get("edhm"))[0];
if(ehm.length() == 1)
{
ehm ="0"+ehm;
}
String title = (String)((String[])hsPara.get("title"))[0];
if(title.length() == 0)
{
title =" ";
}
String content = (String)((String[])hsPara.get("content"))[0];
if(content.length() == 0)
{
content =" ";
}
String bikou = (String)((String[])hsPara.get("bikou"))[0];
if(bikou.length() == 0)
{
bikou =" ";
}
String open = (String)((String[])hsPara.get("open"))[0];
sdata.SetUid(uid);
sdata.SetFrom(syy+smm+sdd+shh+shm);
sdata.SetTo(eyy+emm+edd+ehh+ehm);
sdata.SetTitle(chkStr(title));
sdata.SetContent(chkStr(content));
sdata.SetBikou(chkStr(bikou));
sdata.SetOpen(open);
stmp.update(sdata);
stmp.Save();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -