📄 staffcheckmgr.java
字号:
package com.saas.biz.staffMgr;
import com.saas.biz.dao.staffDAO.*;
import com.saas.sys.buffer.Buffers;
import java.util.*;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.dbm.*;
import com.saas.sys.log.*;
import javax.servlet.http.HttpSession;
public class StaffCheckMgr {
/** The entity context */
Dbtable tradeQuery;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
public StaffCheckMgr() {
log = new Logger(this);
tradeQuery =new Dbtable();
}
public void setTradeQuery(Dbtable tradeQuery)
{
this.tradeQuery = tradeQuery;
}
public Dbtable getTradeQuery()
{
return this.tradeQuery;
}
public void setOutBuffer(Buffers outBuffer)
{
this.outBuffer = outBuffer;
}
public Buffers getOutBuffer()
{
return this.outBuffer;
}
/**
* 校验用户登陆名称和密码
* @param inbuffer
*/
public void CheckLogin(Buffers inbuffer)
{
log.LOG_INFO("进入CheckLogin方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
String staffId = inbuffer.getString("STAFF_ID");
String staffPwd = inbuffer.getString("STAFF_PWD");
int iResult = -1;
try
{
iResult = CheckLogin(staffId,staffPwd);
}
catch(SaasApplicationException e)
{
log.LOG_INFO(e.getMessage());
}
if (iResult != 0)
{
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
}
else
{
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出CheckLogin方法...");
}
/**
* 校验用户登陆名称和密码
* @param staffId
* @param staffPwd
* @return
*/
private int CheckLogin (String staffId,String staffPwd) throws SaasApplicationException
{
SatffExt satffExt = new SatffExt();
StaffDAO staffDao = new StaffDAO();
satffExt.setParam(":VSTAFFID", staffId);
staffDao = satffExt.selByInfo("SEL_BY_CHECK");
if (staffDao == null) throw new SaasApplicationException("该用户不存在["+staffId+"]");
if (!staffDao.getPasswd().equalsIgnoreCase(staffPwd))
{
throw new SaasApplicationException("该用户密码错误["+staffId+"]");
}
this.outBuffer.setString("STAFF_NAME", staffDao.getStaff_name());
this.outBuffer.setSessionField("STAFF_ID");
this.outBuffer.setSessionField("STAFF_NAME");
return 0;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -