📄 salepriceinfo.java
字号:
package com.saas.biz.salePriceMgr;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;
import com.saas.biz.dao.salePriceDAO.SalePriceDAO;
import com.saas.biz.dao.salePriceDAO.SalePriceExt;
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.commMethodMgr;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class SalePriceInfo {
Dbtable tradeQuery;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
ArrayList queryResult = new ArrayList();
commMethodMgr comm;
public SalePriceInfo() {
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 addSalePrice(Buffers inbuffer) {
log.LOG_INFO("进入addSalePrice方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String trade_id = inbuffer.getString("TRADE_ID");
String product_id = inbuffer.getString("PRODUCT_ID");
String sale_obj_id = inbuffer.getString("SALE_OBJ_ID");
String price_type = inbuffer.getString("PRICE_TYPE");
String fix_type = inbuffer.getString("FIX_TYPE");
String price = inbuffer.getString("PRICE");
String price_desc = inbuffer.getString("PRICE_DESC");
String start_date = inbuffer.getString("START_DATE");
String ent_date = inbuffer.getString("ENT_DATE");
String in_date = inbuffer.getString("IN_DATE");
String oper_user_id = inbuffer.getString("SESSION_USER_ID");
String remark = inbuffer.getString("REMARK");
try {
SalePriceDAO salepricedao = new SalePriceDAO();
salepricedao.setCust_id(cust_id);
salepricedao.setTrade_id(trade_id);
salepricedao.setProduct_id(product_id);
salepricedao.setSale_obj_id(sale_obj_id);
salepricedao.setPrice_type(price_type);
salepricedao.setFix_type(fix_type);
salepricedao.setPrice(price);
salepricedao.setPrice_desc(price_desc);
salepricedao.setStart_date(start_date);
salepricedao.setEnt_date(ent_date);
salepricedao.setIn_date(in_date);
salepricedao.setOper_user_id(oper_user_id);
salepricedao.setRemark(remark);
iResult = addSalePrice(salepricedao);
}
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("退出addSalePrice方法...");
}
public int addSalePrice(SalePriceDAO salepricedao) throws SaasApplicationException {
SalePriceExt salepriceExt = new SalePriceExt();
salepriceExt.setParam(":VCUST_ID", salepricedao.getCust_id());
salepriceExt.setParam(":VTRADE_ID", salepricedao.getTrade_id());
salepriceExt.setParam(":VPRODUCT_ID", salepricedao.getProduct_id());
salepriceExt.setParam(":VSALE_OBJ_ID", salepricedao.getSale_obj_id());
salepriceExt.setParam(":VPRICE_TYPE", salepricedao.getPrice_type());
salepriceExt.setParam(":VFIX_TYPE", salepricedao.getFix_type());
salepriceExt.setParam(":VPRICE", salepricedao.getPrice());
salepriceExt.setParam(":VPRICE_DESC", salepricedao.getPrice_desc());
salepriceExt.setParam(":VSTART_DATE", salepricedao.getStart_date());
salepriceExt.setParam(":VENT_DATE", salepricedao.getEnt_date());
salepriceExt.setParam(":VIN_DATE", salepricedao.getIn_date());
salepriceExt.setParam(":VOPER_USER_ID", salepricedao.getOper_user_id());
salepriceExt.setParam(":VREMARK", salepricedao.getRemark());
tradeQuery.executeBy(salepriceExt.insBy("INS_PRO_PRI_ALL"));
return 0;
}
// 修改单品报价
public void ModiPrice(Buffers inbuffer) {
log.LOG_INFO("进入ModiPrice方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String product_id = inbuffer.getString("PRODUCT_ID");
String sale_obj_id = inbuffer.getString("SALE_OBJ_ID");
String price_type = inbuffer.getString("PRICE_TYPE");
String fix_type = inbuffer.getString("FIX_TYPE");
String price = inbuffer.getString("PRICE");
String price_desc = inbuffer.getString("PRICE_DESC");
String start_date = inbuffer.getString("START_DATE");
String ent_date = inbuffer.getString("ENT_DATE");
String in_date = inbuffer.getString("IN_DATE");
String oper_user_id = inbuffer.getString("SESSION_USER_ID");
String remark = inbuffer.getString("REMARK");
try {
SalePriceDAO salepricedao = new SalePriceDAO();
salepricedao.setCust_id(cust_id);
salepricedao.setProduct_id(product_id);
salepricedao.setSale_obj_id(sale_obj_id);
salepricedao.setPrice_type(price_type);
salepricedao.setFix_type(fix_type);
salepricedao.setPrice(price);
salepricedao.setPrice_desc(price_desc);
salepricedao.setStart_date(start_date);
salepricedao.setEnt_date(ent_date);
salepricedao.setIn_date(in_date);
salepricedao.setOper_user_id(oper_user_id);
salepricedao.setRemark(remark);
iResult = ModiPrice(salepricedao);
}
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("退出ModiPrice方法...");
}
public int ModiPrice(SalePriceDAO salepricedao) throws SaasApplicationException {
SalePriceExt salepriceExt = new SalePriceExt();
salepriceExt.setParam(":VCUST_ID", salepricedao.getCust_id());
salepriceExt.setParam(":VPRODUCT_ID", salepricedao.getProduct_id());
salepriceExt.setParam(":VSALE_OBJ_ID", salepricedao.getSale_obj_id());
salepriceExt.setParam(":VPRICE_TYPE", salepricedao.getPrice_type());
salepriceExt.setParam(":VFIX_TYPE", salepricedao.getFix_type());
salepriceExt.setParam(":VPRICE", salepricedao.getPrice());
salepriceExt.setParam(":VPRICE_DESC", salepricedao.getPrice_desc());
salepriceExt.setParam(":VSTART_DATE", salepricedao.getStart_date());
salepriceExt.setParam(":VENT_DATE", salepricedao.getEnt_date());
salepriceExt.setParam(":VIN_DATE", salepricedao.getIn_date());
salepriceExt.setParam(":VOPER_USER_ID", salepricedao.getOper_user_id());
salepriceExt.setParam(":VREMARK", salepricedao.getRemark());
tradeQuery.executeBy(salepriceExt.insBy("UP_PRO_PRI_ALL"));
return 0;
}
// 打包定价
public void addEntirePrice(Buffers inbuffer) {
log.LOG_INFO("进入addEntirePrice方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String trade_id = inbuffer.getString("TRADE_ID");
String price_code = inbuffer.getString("PRICE_CODE");
String product_id = inbuffer.getString("PRODUCT_ID");
String sale_obj_id = inbuffer.getString("SALE_OBJ_ID");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -