📄 biddinginfo.java
字号:
package com.saas.biz.biddingMgr;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.biddingDAO.*;
import com.saas.biz.dao.enquirytrackDAO.EnquirytrackExt;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
public class Biddinginfo
{
Dbtable tradeQuery;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
ArrayList queryResult = new ArrayList();
public Biddinginfo()
{
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;
}
public ArrayList getQueryResult()
{
return this.queryResult;
}
public void setQueryResult(ArrayList queryResult)
{
this.queryResult = queryResult;
}
public void genBidding(Buffers inbuffer)
{
log.LOG_INFO("进入genBidding方法...");
try
{
this.queryResult = genBidding();
} catch (SaasApplicationException e)
{
log.LOG_INFO(e.getMessage());
}
log.LOG_INFO("退出genBidding方法...");
}
public ArrayList genBidding() throws SaasApplicationException
{
ArrayList biddingList = new ArrayList();
ArrayList itemsList = new ArrayList();
BiddingExt biddingExt = new BiddingExt();
biddingList = biddingExt.selByList("SEL_BY_ALL");
for (Iterator it = biddingList.iterator(); it.hasNext();)
{
HashMap biddingListMap = (HashMap) it.next();
String title = "";
String bidding_id = "";
HashMap biddingMap = new HashMap();
if (biddingListMap.get("bidding_id") != null)
bidding_id = biddingListMap.get("bidding_id").toString();
if (biddingListMap.get("title") != null)
title = biddingListMap.get("title").toString();
try {
title = new String(title.getBytes("ISO8859_1"),"GB2312");
} catch (Exception e)
{
throw new RuntimeException(e);
}
biddingMap.put("title", title);
biddingMap.put("bidding_id", bidding_id);
itemsList.add(biddingMap);
}
return itemsList;
}
// get spec bidding list
public void genSpecBidding(Buffers inbuffer)
{
log.LOG_INFO("进入genBidding方法...");
String cust_id = inbuffer.getString("CUST_ID");
try
{
this.queryResult = genSpecBidding(cust_id);
} catch (SaasApplicationException e)
{
log.LOG_INFO(e.getMessage());
}
log.LOG_INFO("退出genBidding方法...");
}
public ArrayList genSpecBidding(String cust_id) throws SaasApplicationException
{
ArrayList biddingList = new ArrayList();
ArrayList itemsList = new ArrayList();
BiddingExt biddingExt = new BiddingExt();
biddingExt.setParam(":VCUST_ID", cust_id);
biddingList = biddingExt.selByList("SEL_SPEC_BIDDING");
for (Iterator it = biddingList.iterator(); it.hasNext();)
{
HashMap biddingListMap = (HashMap) it.next();
String title = "";
String bidding_id = "";
HashMap biddingMap = new HashMap();
if (biddingListMap.get("bidding_id") != null)
bidding_id = biddingListMap.get("bidding_id").toString();
if (biddingListMap.get("title") != null)
title = biddingListMap.get("title").toString();
try {
title = new String(title.getBytes("ISO8859_1"),"GB2312");
} catch (Exception e)
{
throw new RuntimeException(e);
}
biddingMap.put("title", title);
biddingMap.put("bidding_id", bidding_id);
itemsList.add(biddingMap);
}
return itemsList;
}
// 主键查找
public void genPKBidding(Buffers inbuffer)
{
log.LOG_INFO("进入genPKBidding方法...");
String bidding_id = inbuffer.getString("BIDDING_ID");
try
{
this.queryResult = genPKBidding(bidding_id);
} catch (SaasApplicationException e)
{
log.LOG_INFO(e.getMessage());
}
log.LOG_INFO("退出genPKBidding方法...");
}
//通过id找出招标信息
public ArrayList genPKBidding(String bidding_id) throws SaasApplicationException
{
ArrayList biddingList = new ArrayList();
ArrayList itemsList = new ArrayList();
BiddingExt biddingExt = new BiddingExt();
biddingExt.setParam(":VBIDDING_ID", bidding_id);
biddingList = biddingExt.selByList("SEL_BY_PK");
return biddingList;
}
//通过cust_id找出招标信息
public void genBiddingList(Buffers inbuffer)
{
log.LOG_INFO("进入genBiddingList方法...");
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String query_param = inbuffer.getString("QUERY_PARAM");
try
{
if(query_param.equals(""))
this.queryResult = genBiddingList(cust_id);
else this.queryResult =searchBidding(query_param,cust_id);
}
catch (SaasApplicationException e)
{
log.LOG_INFO(e.getMessage());
}
log.LOG_INFO("退出genBiddingList方法...");
}
public ArrayList genBiddingList(String cust_id) throws SaasApplicationException
{
ArrayList biddingList = new ArrayList();
BiddingExt biddingExt = new BiddingExt();
biddingExt.setParam(":VCUST_ID", cust_id);
biddingList = biddingExt.selByList("SEL_SPEC_BIDDING");
return biddingList;
}
//新增招标信息
public void addBiddingInfo(Buffers inbuffer)
{
log.LOG_INFO("进入addBiddingInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
BiddingDAO biddingDAO = new BiddingDAO();
biddingDAO.setBidding_id(inbuffer.getString("BIDDING_ID"));
biddingDAO.setCust_id(inbuffer.getString("SESSION_CUST_ID"));
biddingDAO.setTitle(inbuffer.getString("TITLE"));
biddingDAO.setBidding_no(inbuffer.getString("BIDDING_NO"));
biddingDAO.setOpen_date(inbuffer.getString("OPEN_DATE"));
biddingDAO.setAddr(inbuffer.getString("ADDR"));
biddingDAO.setContent(inbuffer.getString("CONTENT"));
biddingDAO.setPhone(inbuffer.getString("PHONE"));
biddingDAO.setAttach_tag(inbuffer.getString("ATTACH_TAG"));
// biddingDAO.setBidding_type(inbuffer.getString("BIDDING_TYPE"));
biddingDAO.setPublish_person(inbuffer.getString("SESSION_USER_ID"));
biddingDAO.setAudit_person(inbuffer.getString("SESSION_USER_ID"));
if (inbuffer.getString("ATTACH_TAG") !="")
{
biddingDAO.setAttach_tag("1");
}
else
{
biddingDAO.setAttach_tag("0");
}
try
{
iResult = addBiddingInfo(biddingDAO);
}
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("退出addBiddingInfo方法...");
}
public int addBiddingInfo(BiddingDAO biddingDAO) throws SaasApplicationException
{
BiddingExt biddingExt = new BiddingExt();
commMethodMgr comm = new commMethodMgr();
biddingExt.setParam(":VBIDDING_ID",biddingDAO.getBidding_id());
biddingExt.setParam(":VCUST_ID",biddingDAO.getCust_id());
biddingExt.setParam(":VTITLE",biddingDAO.getTitle());
biddingExt.setParam(":VBIDDING_NO",biddingDAO.getBidding_no());
biddingExt.setParam(":VOPEN_DATE",biddingDAO.getOpen_date());
biddingExt.setParam(":VADDR",biddingDAO.getAddr());
biddingExt.setParam(":VCONTENT",biddingDAO.getContent());
biddingExt.setParam(":VPHONE",biddingDAO.getPhone());
biddingExt.setParam(":VATTACH_TAG",biddingDAO.getAttach_tag());
biddingExt.setParam(":VBIDDING_TYPE","0");
biddingExt.setParam(":VPUBLISH_PERSON",biddingDAO.getPublish_person());
biddingExt.setParam(":VAUDIT_PERSON",biddingDAO.getAudit_person());
biddingExt.setParam(":VVALIDITY","0");
biddingExt.setParam(":VREMARK","");
tradeQuery.executeBy(biddingExt.insBy("INS_BY_ALL"));
this.outBuffer.setString("SPEC_ROOT_ID",biddingDAO.getBidding_id());
return 0;
}
public ArrayList searchBidding(String title,String cust_id) throws SaasApplicationException
{
ArrayList itemsList = new ArrayList();
EnquirytrackExt enquirytrackExt = new EnquirytrackExt();
enquirytrackExt.setParam(":VTITLE","%"+title+"%");
enquirytrackExt.setParam(":VCUST_ID",cust_id);
itemsList = enquirytrackExt.selByList("SEL_BY_SEARCH");
return itemsList;
}
//分页查询
public ArrayList getBiddingList(int iStart,String cust_id) throws SaasApplicationException
{
if(iStart==0)
{
iStart=0;
}
else
{
iStart = (iStart-1)*30;
}
ArrayList biddingList = new ArrayList();
BiddingExt biddingExt = new BiddingExt();
biddingExt.setParam(":VCUST_ID", cust_id);
biddingList = biddingExt.selByList("SEL_SPEC_BIDDING",iStart,30);
return biddingList;
}
//分页统计
public int getBiddingNumber(String cust_id) throws SaasApplicationException
{
ArrayList biddingList = new ArrayList();
BiddingExt biddingExt = new BiddingExt();
biddingExt.setParam(":VCUST_ID", cust_id);
biddingList = biddingExt.selByList("SEL_SPEC_BIDDING");
if(biddingList !=null && biddingList.size()>0)
{
return biddingList.size();
}
else
{
return 0;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -