📄 prepriceinfo.java
字号:
package com.saas.biz.prePriceMgr;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.saas.biz.dao.prePriceDAO.*;
import com.saas.biz.dao.prePriceDAO.PrePriceExt;
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 PrePriceInfo {
Dbtable tradeQuery;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
ArrayList queryResult = new ArrayList();
public PrePriceInfo() {
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 addPrePriceInfo(Buffers inbuffer) {
log.LOG_INFO("进入addPrePriceInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String quo_id = inbuffer.getString("QUO_ID");
String pre_id = inbuffer.getString("PRE_ID");
String pre_fee = inbuffer.getString("PRE_FEE");
String currency_code = inbuffer.getString("CURRENCY_CODE");
String pay_type = inbuffer.getString("PAY_TYPE");
String tax = inbuffer.getString("TAX");
String remain_fee = inbuffer.getString("REMAIN_FEE");
String start_date = inbuffer.getString("START_DATE");
String end_date = inbuffer.getString("END_DATE");
String bill_no = inbuffer.getString("BILL_NO");
String pre_user_id = inbuffer.getString("PRE_USER_ID");
String pre_user_name = inbuffer.getString("PRE_USER_NAME");
String oper_user_id = inbuffer.getString("SESSION_USER_ID");
String in_date = inbuffer.getString("IN_DATE");
String remark2 = inbuffer.getString("REMARK2");
try {
iResult = addPrePriceInfo(cust_id, quo_id, pre_id, pre_fee,
currency_code, pay_type, tax, remain_fee, start_date,
end_date, bill_no, pre_user_id, pre_user_name,oper_user_id, in_date,
remark2);
} 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("退出addPrePriceInfo方法...");
}
public int addPrePriceInfo(String cust_id, String quo_id, String pre_id,
String pre_fee, String currency_code, String pay_type, String tax,
String remain_fee, String start_date, String end_date,
String bill_no, String pre_user_id, String pre_user_name,
String oper_user_id, String in_date, String remark2)
throws SaasApplicationException {
PrePriceExt prePriceExt = new PrePriceExt();
prePriceExt.setParam(":VCUST_ID", cust_id);
prePriceExt.setParam(":VQUO_ID", quo_id);
prePriceExt.setParam(":VPRE_ID", pre_id);
prePriceExt.setParam(":VPRE_FEE", pre_fee);
prePriceExt.setParam(":VCURRENCY_CODE", currency_code);
prePriceExt.setParam(":VPAY_TYPE", pay_type);
prePriceExt.setParam(":VTAX", tax);
prePriceExt.setParam(":VREMAIN_FEE", remain_fee);
prePriceExt.setParam(":VSTART_DATE", start_date);
prePriceExt.setParam(":VEND_DATE", end_date);
prePriceExt.setParam(":VBILL_NO", bill_no);
prePriceExt.setParam(":VPRE_USER_ID", pre_user_id);
prePriceExt.setParam(":VPRE_USER_NAME", pre_user_name);
prePriceExt.setParam(":VOPER_USER_ID", oper_user_id);
prePriceExt.setParam(":VIN_DATE", in_date);
prePriceExt.setParam(":VREMARK2", remark2);
tradeQuery.executeBy(prePriceExt.insBy("INS_ONE_PREPRICE"));
return 0;
}
public void updatePrePrice(Buffers inbuffer) {
log.LOG_INFO("进入updatePrePrice方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String quo_id = inbuffer.getString("QUO_ID");
String pre_id = inbuffer.getString("PRE_ID");
String pre_fee = inbuffer.getString("PRE_FEE");
String currency_code = inbuffer.getString("CURRENCY_CODE");
String pay_type = inbuffer.getString("PAY_TYPE");
String tax = inbuffer.getString("TAX");
String remain_fee = inbuffer.getString("REMAIN_FEE");
String start_date = inbuffer.getString("START_DATE");
String end_date = inbuffer.getString("END_DATE");
String bill_no = inbuffer.getString("BILL_NO");
String pre_user_id = inbuffer.getString("PRE_USER_ID");
String pre_user_name = inbuffer.getString("PRE_USER_NAME");
String oper_user_id = inbuffer.getString("SESSION_USER_ID");
String in_date = inbuffer.getString("IN_DATE");
String remark2 = inbuffer.getString("REMARK2");
try {
iResult = updatePrePrice(cust_id, quo_id, pre_id, pre_fee,
currency_code, pay_type, tax, remain_fee, start_date,
end_date, bill_no, pre_user_id,pre_user_name, oper_user_id, in_date,
remark2);
} 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("退出updatePrePrice方法...");
}
public int updatePrePrice(String cust_id, String quo_id, String pre_id,
String pre_fee, String currency_code, String pay_type, String tax,
String remain_fee, String start_date, String end_date,
String bill_no, String pre_user_id,String pre_user_name, String oper_user_id,
String in_date, String remark2) throws SaasApplicationException {
PrePriceExt prePriceExt = new PrePriceExt();
prePriceExt.setParam(":VCUST_ID", cust_id);
prePriceExt.setParam(":VQUO_ID", quo_id);
prePriceExt.setParam(":VPRE_ID", pre_id);
prePriceExt.setParam(":VPRE_FEE", pre_fee);
prePriceExt.setParam(":VCURRENCY_CODE", currency_code);
prePriceExt.setParam(":VPAY_TYPE", pay_type);
prePriceExt.setParam(":VTAX", tax);
prePriceExt.setParam(":VREMAIN_FEE", remain_fee);
prePriceExt.setParam(":VSTART_DATE", start_date);
prePriceExt.setParam(":VEND_DATE", end_date);
prePriceExt.setParam(":VBILL_NO", bill_no);
prePriceExt.setParam(":VPRE_USER_ID", pre_user_id);
prePriceExt.setParam(":VPRE_USER_NAME", pre_user_name);
prePriceExt.setParam(":VOPER_USER_ID", oper_user_id);
prePriceExt.setParam(":VIN_DATE", in_date);
prePriceExt.setParam(":VREMARK2", remark2);
tradeQuery.executeBy(prePriceExt.insBy("UPDATE_ONE_PREPRICE"));
return 0;
}
public void delPrePrice(Buffers inbuffer) {
log.LOG_INFO("进入delPrePrice方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String quo_id = inbuffer.getString("QUO_ID");
String pre_id = inbuffer.getString("PRE_ID");
try {
iResult = delPrePrice(cust_id, quo_id, pre_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("退出delPrePrice方法...");
}
public int delPrePrice(String cust_id, String quo_id, String pre_id)
throws SaasApplicationException {
PrePriceExt prePriceExt = new PrePriceExt();
prePriceExt.setParam(":VCUST_ID", cust_id);
prePriceExt.setParam(":VQUO_ID", quo_id);
prePriceExt.setParam(":VPRE_ID", pre_id);
tradeQuery.executeBy(prePriceExt.insBy("DEL_ONE_PREPRICE"));
return 0;
}
public ArrayList getAllPrePriceByState(String cust_id, String state_code,
int iStart,String quo_id) throws SaasApplicationException {
ArrayList list = new ArrayList();
PrePriceExt prePriceExt = new PrePriceExt();
try {
if (iStart == 0) {
iStart = 0;
} else {
iStart = (iStart - 1) * 20;
}
prePriceExt.setParam(":VCUST_ID", cust_id);
prePriceExt.setParam(":VQUO_ID", quo_id);
prePriceExt.setParam(":VSTATE_CODE", state_code);
list = prePriceExt.selByList("SEL_ALL_PREPRICE", iStart, 20);
} catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
public int getAllPrePriceByState(String cust_id, String state_code,String quo_id)
throws SaasApplicationException {
PrePriceExt prePriceExt = new PrePriceExt();
ArrayList list = new ArrayList();
int count = 0;
try {
prePriceExt.setParam(":VCUST_ID", cust_id);
prePriceExt.setParam(":VQUO_ID", quo_id);
prePriceExt.setParam(":VSTATE_CODE", state_code);
list = prePriceExt.selByList("SEL_ALL_PREPRICE");
} catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
if (list != null && list.size() > 0) {
count = list.size();
}
return count;
}
public ArrayList getOnePrePrice(String cust_id, String state_code,
String pre_id) throws SaasApplicationException {
PrePriceExt prePriceExt = new PrePriceExt();
ArrayList list = new ArrayList();
try {
prePriceExt.setParam(":VCUST_ID", cust_id);
prePriceExt.setParam(":VSTATE_CODE", state_code);
prePriceExt.setParam(":VPRE_ID", pre_id);
list = prePriceExt.selByList("SEL_ONE_PREPRICE");
} catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -