?? itemstrade.java
字號:
package com.saas.biz.www.manage.itemsMgr;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
import com.saas.biz.commen.*;
import com.saas.biz.dao.itemsDAO.*;
public class ItemsTrade {
Dbtable tradeQuery;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
commMethodMgr commen;
public ItemsTrade() {
log = new Logger(this);
tradeQuery =new Dbtable();
commen = 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 void AddItemsInfo(Buffers inbuffer)
{
log.LOG_INFO("進入AddItemsInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
String lmjb = inbuffer.getString("LMJB");
String lmmc = inbuffer.getString("LMMC");
String modelfile = inbuffer.getString("MODELFILE");
String sjlmbs = inbuffer.getString("SJLMBS");
String displayrage = inbuffer.getString("DISPLAYRAGE");
String showfirst = inbuffer.getString("SHOWFIRST");
String staffId = inbuffer.getString("STAFF_ID");
String realpath = inbuffer.getString("REALPATH");
String modelfiledir = inbuffer.getString("UPLOADFILEDIR");
int iResult = -1;
try
{
iResult = AddItemsInfo(lmjb,lmmc,modelfile,sjlmbs,displayrage,showfirst,staffId,realpath,modelfiledir);
}
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("退出AddItemsInfo方法...");
}
private int AddItemsInfo (String lmjb,String lmmc,String modelfile,String sjlmbs,String displayrage,String showfirst,String staffId,String realpath,String modelfiledir) throws SaasApplicationException
{
LmxxbExt lmxxbExt = new LmxxbExt();
String lmbs = commen.GenTradeId();
String filePath = realpath+"\\www\\web\\"+modelfile;
String webPath = "./www/web/";
if (modelfile != null && modelfile != "")
{
commen.copyFile(modelfiledir+modelfile, filePath);
}
try
{
lmxxbExt.setParam(":VLMBS",lmbs);
lmxxbExt.setParam(":VLMJB",lmjb);
lmxxbExt.setParam(":VLMMC",lmmc);
lmxxbExt.setParam(":VMBWJM",modelfile);
lmxxbExt.setParam(":VMBWJLJ",webPath);
lmxxbExt.setParam(":VSJLMBS",sjlmbs);
lmxxbExt.setParam(":VXSSX",displayrage);
lmxxbExt.setParam(":VCZYGH",staffId);
lmxxbExt.setParam(":VBZ",showfirst);
tradeQuery.executeBy(lmxxbExt.insBy("INS_BY_ALL"));
}
catch (Exception e)
{
throw new RuntimeException("新增欄目信息出錯!"+e);
}
int iClass = new Integer(lmjb).intValue()-1;
lmjb = String.valueOf(iClass);
this.outBuffer.setString("LMJB", lmjb);
return 0;
}
public void ModifyItemsInfo(Buffers inbuffer)
{
log.LOG_INFO("進入ModifyItemsInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
String lmmc = inbuffer.getString("LMMC");
String lmjb = inbuffer.getString("LMJB");
String lmbs = inbuffer.getString("LMBS");
String modelfile = inbuffer.getString("MODELFILE");
String displayrage = inbuffer.getString("DISPLAYRAGE");
String showfirst = inbuffer.getString("SHOWFIRST");
String staffId = inbuffer.getString("STAFF_ID");
String realpath = inbuffer.getString("REALPATH");
String modelfiledir = inbuffer.getString("UPLOADFILEDIR");
int iResult = -1;
try
{
iResult = ModifyItemsInfo(lmbs,lmmc,modelfile,displayrage,showfirst,staffId,realpath,modelfiledir);
}
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", "業務處理成功!");
}
int iClass = new Integer(lmjb).intValue()-1;
lmjb = String.valueOf(iClass);
this.outBuffer.setString("LMJB", lmjb);
log.LOG_INFO("退出ModifyItemsInfo方法...");
}
private int ModifyItemsInfo (String lmbs,String lmmc,String modelfile,String displayrage,String showfirst,String staffId,String realpath,String modelfiledir) throws SaasApplicationException
{
LmxxbExt lmxxbExt = new LmxxbExt();
String filePath = realpath+"\\www\\web\\"+modelfile;
String webPath = "./www/web/";
try
{
if (!modelfile.equalsIgnoreCase(""))
{
commen.copyFile(modelfiledir+modelfile, filePath);
lmxxbExt.setParam(":VLMBS",lmbs);
lmxxbExt.setParam(":VLMMC",lmmc);
lmxxbExt.setParam(":VMBWJM",modelfile);
lmxxbExt.setParam(":VMBWJLJ",webPath);
lmxxbExt.setParam(":VXSSX",displayrage);
lmxxbExt.setParam(":VBZ",showfirst);
tradeQuery.executeBy(lmxxbExt.insBy("UP_BY_PK1"));
}
else
{
lmxxbExt.setParam(":VLMBS",lmbs);
lmxxbExt.setParam(":VLMMC",lmmc);
lmxxbExt.setParam(":VXSSX",displayrage);
lmxxbExt.setParam(":VBZ",showfirst);
tradeQuery.executeBy(lmxxbExt.insBy("UP_BY_PK2"));
}
}
catch (Exception e)
{
throw new RuntimeException("修改欄目信息出錯!"+e);
}
return 0;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -