📄 observeritrequestsubmit.java
字号:
/*
* ITReceivedObserver.java
*
* Created on January 19, 2007, 11:51 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package Wearnes;
/**
*
* @author dongliang.guo
*/
public class ObserverITRequestSubmit implements ObserverOfRequest{
/** Creates a new instance of ITReceivedObserver */
ITRequest request;
ObserverProfile observerProfile;
public ObserverITRequestSubmit(ITRequest r,ObserverProfile profile) {
request=r;
observerProfile=profile;
request.attachObserver(this);
}
public void updateOnRequestStatusChange(String status)
{
String content="User:"+request.user_name()+"\r\n";
content=content+"Request Date:"+request.req_date()+"\r\n";
content=content+"Expected Completion Date:"+request.expected_completion_date()+"\r\n";
content=content+"Category:"+request.category()+"\r\n";
content=content+"Item:"+request.item()+"\r\n";
content=content+"Description:"+request.description()+"\r\n\n";
content=content+"Business Impact:"+request.impact()+"\r\n\n";
String req_status=(String)(new RequestStatus()).get(request.process_status());
content=content+"Request Status:"+req_status+"\r\n\n";
String usrMgrMail=ActiveDirectoryFacility.getEmployeeProfile(request.user_name(), (new CommonUtility()).getActiveDirectoryHost()).defaultManagerEmail;
String usrMgr="";
if(usrMgrMail.indexOf("@")!=-1)
usrMgr=(usrMgrMail.split("@"))[0];
String webHost=(new CommonUtility()).getWebHost();
String approveLink=webHost+"/itreq/approveRequest.jsp?req_id="+(new Integer(request.req_id())).toString()+"&process_status=1&observerDate="+(new CommonUtility()).getCurrentDate()+"&observerName="+usrMgr+"&observerApprovement=Y&comment=NA";
String rejectLink=webHost+"/itreq/approveRequest.jsp?req_id="+(new Integer(request.req_id())).toString()+"&process_status=1&observerDate="+(new CommonUtility()).getCurrentDate()+"&observerName="+usrMgr+"&observerApprovement=N&comment=NA";
String loginApproveLink=webHost+"/itreq/requestToBeApprovedList.jsp?status=1";
content=content+"If you approve this request, please click this link:\r"+approveLink+"\r\n\n";
content=content+"If you reject this request, please click this link:\r"+rejectLink+"\r\n\n";
content=content+"If you login system to approve the request, please click this link:\r"+loginApproveLink+"\r\n";
if(status.equals(RequestStatus.USER_SUBMITED))
{
SendMailBean.send("IT.Request@wearnes.com", ITRequest.itServiceEmail, usrMgrMail, "",
"IT Request",content, (new CommonUtility()).getEmailHost());
//String sql="update request set "
}
}
public void updateRequestDetail(String sql)
{ try
{
WearnesDB db=WearnesDB.getInstance((new CommonUtility()).getConnectionURL());
db.update(sql);
}catch(Exception e)
{
}
}
public void persistObserver(ObserverProfile profile)
{}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -