📄 enquirydealinfo.java
字号:
package com.saas.biz.enquirydealMgr;
import java.util.ArrayList;
import java.util.HashMap;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.enquirydealDAO.EnquirydealDAO;
import com.saas.biz.dao.enquirydealDAO.EnquirydealExt;
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 Enquirydealinfo {
Dbtable tradeQuery;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
commMethodMgr comm;
ArrayList queryResult = new ArrayList();
public Enquirydealinfo() {
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;
}
// 新增询价回复
public void addEnquiryInfo(Buffers inbuffer) {
log.LOG_INFO("进入addEnquiryInfo方法...");
this.outBuffer = inbuffer;
String trade_id = comm.GenTradeId();
String enquiry_id = inbuffer.getString("ENQUIRY_ID");
String deal_content = inbuffer.getString("CONTENT");
String deal_tag = inbuffer.getString("DEAL_TAG");
String deal_user = inbuffer.getString("SESSION_USER_ID");
int iResult = -1;
try {
EnquirydealDAO enqDao = new EnquirydealDAO();
enqDao.setTrade_id(trade_id);
enqDao.setEnquiry_id(enquiry_id);
enqDao.setDeal_content(deal_content);
enqDao.setDeal_tag(deal_tag);
enqDao.setDeal_user(deal_user);
iResult = addEnquiryInfo(enqDao);
}
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("退出addEnquiryInfo方法...");
}
public int addEnquiryInfo(EnquirydealDAO enqDao) throws SaasApplicationException {
EnquirydealExt dealExt = new EnquirydealExt();
dealExt.setParam(":VTRADE_ID", enqDao.getTrade_id());
dealExt.setParam(":VENQUIRY_ID", enqDao.getEnquiry_id());
dealExt.setParam(":VDEAL_CONTENT", enqDao.getDeal_content());
dealExt.setParam(":VDEAL_TAG", enqDao.getDeal_tag());
dealExt.setParam(":VDEAL_USER", enqDao.getDeal_user());
tradeQuery.executeBy(dealExt.insBy("INS_BY_DEAL"));
return 0;
}
/**
* 删除留言信息
*
* @param inbuffer
*/
public void delEnquiryInfo(Buffers inbuffer) {
log.LOG_INFO("进入delEnquiryInfo方法...");
this.outBuffer = inbuffer;
String trade_id = inbuffer.getString("TRADE_ID");
int iResult = -1;
try {
iResult = delEnquiryInfo(trade_id);
}
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("退出addEnquiryInfo方法...");
}
public int delEnquiryInfo(String trade_id) throws SaasApplicationException {
EnquirydealExt dealExt = new EnquirydealExt();
dealExt.setParam(":VENQUIRY_ID", trade_id);
tradeQuery.executeBy(dealExt.insBy("DELETE_BY_ENQUIRY"));
return 0;
}
/**
* add by WangY Date:08.08.09 回复学院提问
*
* @param inbuffer
*/
public void addEnquiry(Buffers inbuffer) {
log.LOG_INFO("进入addEnquiry方法...");
this.outBuffer = inbuffer;
String trade_id = comm.GenTradeId();
String enquiry_id = inbuffer.getString("ENQUIRY_ID");
String deal_content = inbuffer.getString("DEAL_CONTENT");
String deal_tag = inbuffer.getString("DEAL_TAG");
String deal_user = inbuffer.getString("DEAL_USER");
int iResult = -1;
try {
EnquirydealDAO enqDao = new EnquirydealDAO();
enqDao.setTrade_id(trade_id);
enqDao.setEnquiry_id(enquiry_id);
enqDao.setDeal_content(deal_content);
enqDao.setDeal_tag(deal_tag);
enqDao.setDeal_user(deal_user);
iResult = addEnquiry(enqDao);
}
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("退出addEnquiry方法...");
}
public int addEnquiry(EnquirydealDAO enqDao) throws SaasApplicationException {
EnquirydealExt dealExt = new EnquirydealExt();
dealExt.setParam(":VTRADE_ID", enqDao.getTrade_id());
dealExt.setParam(":VENQUIRY_ID", enqDao.getEnquiry_id());
dealExt.setParam(":VDEAL_CONTENT", enqDao.getDeal_content());
dealExt.setParam(":VDEAL_TAG", enqDao.getDeal_tag());
dealExt.setParam(":VDEAL_USER", enqDao.getDeal_user());
tradeQuery.executeBy(dealExt.insBy("INS_BY_DEAL"));
return 0;
}
public void delEnquiryDeal(Buffers inbuffer) {
log.LOG_INFO("进入delEnquiryDeal方法...");
this.outBuffer = inbuffer;
String trade_id = inbuffer.getString("TRADE_ID");
int iResult = -1;
try {
iResult = delEnquiryDeal(trade_id);
}
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("退出delEnquiryDeal方法...");
}
public int delEnquiryDeal(String trade_id) throws SaasApplicationException {
EnquirydealExt dealExt = new EnquirydealExt();
dealExt.setParam(":VTRADE_ID", trade_id);
tradeQuery.executeBy(dealExt.insBy("DELETE_BY_ID"));
return 0;
}
public ArrayList SchrepoitoryById(String enquiry_id) throws SaasApplicationException {
ArrayList itemsList = new ArrayList();
EnquirydealExt dealExt = new EnquirydealExt();
dealExt.setParam(":VENQUIRY_ID", enquiry_id);
itemsList = dealExt.selByList("SEL_BY_REP_ID");
return itemsList;
}
/**
* @param iStart
* @param limit
* @param enquiry_id
* @return 取出留言回复
* @throws SaasApplicationException
*/
public ArrayList getEnquriyDealById(int iStart, int limit, String enquiry_id, String enquiry_user, String deal_tag) throws SaasApplicationException {
if (iStart > 1) {
iStart = (iStart - 1) * limit;
}
else {
iStart = 0;
}
ArrayList itemsList = new ArrayList();
EnquirydealExt dealExt = new EnquirydealExt();
dealExt.setParam(":VENQUIRY_ID", enquiry_id);
dealExt.setParam(":VENQUIRY_USER", enquiry_user);
dealExt.setParam(":VDEAL_TAG", deal_tag);
itemsList = dealExt.selByList("SEL_BY_ENQUIRY_ID", iStart, limit);
return itemsList;
}
/**
* @param enquiry_id
* @return 统计留言回复
* @throws SaasApplicationException
*/
public int getEnquriyDealCountById(String enquiry_id, String enquiry_user, String deal_tag) throws SaasApplicationException {
int size = 0;
ArrayList list = new ArrayList();
EnquirydealExt dealExt = new EnquirydealExt();
dealExt.setParam(":VENQUIRY_ID", enquiry_id);
dealExt.setParam(":VENQUIRY_USER", enquiry_user);
dealExt.setParam(":VDEAL_TAG", deal_tag);
list = dealExt.selByList("SEL_BY_ENQUIRY_ID_CT");
if (list != null && list.size() > 0) {
HashMap map = (HashMap) list.get(0);
size = Integer.parseInt(map.get("ct").toString());
}
return size;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -