?? warntypeinfo.java
字號:
package com.saas.biz.warntypeMgr;
import java.util.ArrayList;
import java.util.HashMap;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.warntypeDAO.WarntypeDAO;
import com.saas.biz.dao.warntypeDAO.WarntypeExt;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
/**
* @author:LiuYang
* @desc:預警模式
* @2008-6-4
*/
public class WarnTypeInfo {
Dbtable tradeQuery;
commMethodMgr comm;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
ArrayList queryResult = new ArrayList();
public WarnTypeInfo() {
log = new Logger(this);
tradeQuery = new Dbtable();
comm = new commMethodMgr();
}
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;
}
public ArrayList getQueryResult() {
return this.queryResult;
}
public void setQueryResult(ArrayList queryResult) {
this.queryResult = queryResult;
}
/**
* 預警模式
*
* @param inbuffer
*/
public void addWarnTypeInfo(Buffers inbuffer) {
log.LOG_INFO("進入addWarnTypeInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String mod_id = inbuffer.getString("MOD_ID");
String mod_name = inbuffer.getString("MOD_NAME");
String mod_type = inbuffer.getString("MOD_TYPE");
String warn_type = inbuffer.getString("WARN_TYPE");
String warn_circle = inbuffer.getString("WARN_CIRCLE");
String exec_date = inbuffer.getString("EXEC_DATE");
String start_date = inbuffer.getString("START_DATE");
String end_date = inbuffer.getString("END_DATE");
String rsrv_str1 = inbuffer.getString("RSRV_STR1");
String rsrv_str2 = inbuffer.getString("RSRV_STR2");
String rsrv_str3 = inbuffer.getString("RSRV_STR3");
String rsrv_str4 = inbuffer.getString("RSRV_STR4");
String rsrv_str5 = inbuffer.getString("RSRV_STR5");
String rsrv_str6 = inbuffer.getString("RSRV_STR6");
String rsrv_str7 = inbuffer.getString("RSRV_STR7");
String rsrv_str8 = inbuffer.getString("RSRV_STR8");
String rsrv_str9 = inbuffer.getString("RSRV_STR9");
String rsrv_str10 = inbuffer.getString("RSRV_STR10");
String user_id = inbuffer.getString("SESSION_USER_ID");
String remark = inbuffer.getString("REMARK");
try {
WarntypeDAO warnDao = new WarntypeDAO();
warnDao.setCust_id(cust_id);
warnDao.setMod_id(mod_id);
warnDao.setMod_name(mod_name);
warnDao.setMod_type(mod_type);
warnDao.setWarn_type(warn_type);
warnDao.setWarn_circle(warn_circle);
warnDao.setExec_date(exec_date);
warnDao.setStart_date(start_date);
warnDao.setEnd_date(end_date);
warnDao.setRsrv_str1(rsrv_str1);
warnDao.setRsrv_str2(rsrv_str2);
warnDao.setRsrv_str3(rsrv_str3);
warnDao.setRsrv_str4(rsrv_str4);
warnDao.setRsrv_str5(rsrv_str5);
warnDao.setRsrv_str6(rsrv_str6);
warnDao.setRsrv_str7(rsrv_str7);
warnDao.setRsrv_str8(rsrv_str8);
warnDao.setRsrv_str9(rsrv_str9);
warnDao.setRsrv_str10(rsrv_str10);
warnDao.setUser_id(user_id);
warnDao.setRemark(remark);
iResult = addWarnTypeInfo(warnDao);
}
catch (Exception 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("退出addWarnTypeInfo方法...");
}
public int addWarnTypeInfo(WarntypeDAO warnDao) throws SaasApplicationException {
WarntypeExt warnExt = new WarntypeExt();
warnExt.setParam(":VCUST_ID", warnDao.getCust_id());
warnExt.setParam(":VMOD_ID", warnDao.getMod_id());
warnExt.setParam(":VMOD_NAME", warnDao.getMod_name());
warnExt.setParam(":VMOD_TYPE", warnDao.getMod_type());
warnExt.setParam(":VWARN_TYPE", warnDao.getWarn_type());
warnExt.setParam(":VWARN_CIRCLE", warnDao.getWarn_circle());
warnExt.setParam(":VEXEC_DATE", warnDao.getExec_date());
warnExt.setParam(":VSTART_DATE", warnDao.getStart_date());
warnExt.setParam(":VEND_DATE", warnDao.getEnd_date());
warnExt.setParam(":VRSRV_STR1", warnDao.getRsrv_str1());
warnExt.setParam(":VRSRV_STR2", warnDao.getRsrv_str2());
warnExt.setParam(":VRSRV_STR3", warnDao.getRsrv_str3());
warnExt.setParam(":VRSRV_STR4", warnDao.getRsrv_str4());
warnExt.setParam(":VRSRV_STR5", warnDao.getRsrv_str5());
warnExt.setParam(":VRSRV_STR6", warnDao.getRsrv_str6());
warnExt.setParam(":VRSRV_STR7", warnDao.getRsrv_str7());
warnExt.setParam(":VRSRV_STR8", warnDao.getRsrv_str8());
warnExt.setParam(":VRSRV_STR9", warnDao.getRsrv_str9());
warnExt.setParam(":VRSRV_STR10", warnDao.getRsrv_str10());
warnExt.setParam(":VUSER_ID", warnDao.getUser_id());
warnExt.setParam(":VREMARK", warnDao.getRemark());
tradeQuery.executeBy(warnExt.insBy("INS_BY_ALL"));
return 0;
}
/**
* 刪除預警模式
*/
public void delWarnTypeInfo(Buffers inbuffer) {
log.LOG_INFO("進入delWarnTypeInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String mod_id = inbuffer.getString("MOD_ID");
try {
iResult = delWarnTypeInfo(mod_id);
}
catch (Exception 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("退出delWarnTypeInfo方法...");
}
public int delWarnTypeInfo(String mod_id) throws SaasApplicationException {
WarntypeExt warnExt = new WarntypeExt();
warnExt.setParam(":VMOD_ID", mod_id);
tradeQuery.executeBy(warnExt.insBy("DEL_BY_ID"));
return 0;
}
/**
* @param cust_id
* @return客戶自己的預警模式
* @throws SaasApplicationException
*/
public ArrayList getWarnTypeByCust(String cust_id) throws SaasApplicationException {
WarntypeExt warnExt = new WarntypeExt();
warnExt.setParam(":VCUST_ID", cust_id);
ArrayList list = warnExt.selByList("SEL_BY_CUST");
return list;
}
/**
* @param cust_id
* @return客戶自己的預警模式
* @throws SaasApplicationException
*/
public ArrayList getWarnTypeByCust(int iStart, String cust_id) throws SaasApplicationException {
iStart = iStart * 20;
WarntypeExt warnExt = new WarntypeExt();
warnExt.setParam(":VCUST_ID", cust_id);
ArrayList list = warnExt.selByList("SEL_BY_CUST", iStart, 20);
return list;
}
/**
* @param cust_id
* @return客戶自己的預警模式
* @throws SaasApplicationException
*/
public int getWarnTypeByCustSize(String cust_id) throws SaasApplicationException {
int size = 0;
WarntypeExt warnExt = new WarntypeExt();
warnExt.setParam(":VCUST_ID", cust_id);
ArrayList list = warnExt.selByList("SEL_BY_CUST_SIZE");
if (list != null && list.size() > 0) {
HashMap map = (HashMap) list.get(0);
size = Integer.parseInt(map.get("ct").toString());
}
return size;
}
public ArrayList getConWarnByCust(int iStart, String cust_id,String mod_type) throws SaasApplicationException {
if (iStart > 1) {
iStart = (iStart - 1) * 20;
}
else {
iStart = 0;
}
WarntypeExt warnExt = new WarntypeExt();
warnExt.setParam(":VCUST_ID", cust_id);
warnExt.setParam(":VMOD_TYPE", mod_type);
ArrayList list = warnExt.selByList("SEL_WARN_CONTRACT", iStart, 20);
return list;
}
public int getConWarnByCust(String cust_id,String mod_type) throws SaasApplicationException {
int size = 0;
WarntypeExt warnExt = new WarntypeExt();
warnExt.setParam(":VCUST_ID", cust_id);
warnExt.setParam(":VMOD_TYPE", mod_type);
ArrayList list = warnExt.selByList("SEL_WARN_CONTRACT");
if (list != null && list.size() > 0) {
size=list.size();
}
return size;
}
/**
* @param com_id
* @return單條預警模式
* @throws SaasApplicationException
*/
public HashMap getWarnTypeById(String mod_id) throws SaasApplicationException {
WarntypeExt warnExt = new WarntypeExt();
warnExt.setParam(":VMOD_ID", mod_id);
ArrayList list = warnExt.selByList("SEL_BY_ID");
HashMap map = new HashMap();
if (list != null && list.size() > 0) {
map = (HashMap) list.get(0);
}
return map;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -