📄 salepriceinfo.java
字号:
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.setPrice_code(price_code);
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 = addEntirePrice(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("退出addEntirePrice方法...");
}
public int addEntirePrice(SalePriceDAO salepricedao) throws SaasApplicationException {
String product_Idx = salepricedao.getProduct_id();
StringTokenizer st = new StringTokenizer(product_Idx, "|");
while (st.hasMoreTokens()) {
String product_id = st.nextToken();
SalePriceExt salepriceExt = new SalePriceExt();
salepriceExt.setParam(":VCUST_ID", salepricedao.getCust_id());
salepriceExt.setParam(":VTRADE_ID", salepricedao.getTrade_id());
salepriceExt.setParam(":VPRICE_CODE", salepricedao.getPrice_code());
salepriceExt.setParam(":VPRODUCT_ID", product_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());
// log.LOG_INFO(""+salepriceExt.insBy("INS_PRO_PRI_ID"));
tradeQuery.executeBy(salepriceExt.insBy("INS_PRO_PRI_ID"));
}
return 0;
}
public ArrayList getById(String cust_id, String fix_type) throws SaasApplicationException {
log.LOG_INFO("cust_id="+cust_id+"==fix_type"+fix_type);
ArrayList relationList = new ArrayList();
SalePriceExt salepriceExt = new SalePriceExt();
salepriceExt.setParam(":VCUST_ID", cust_id);
salepriceExt.setParam(":VFIX_TYPE", fix_type);
log.LOG_INFO(""+salepriceExt.insBy("SEL_BY_FIX_TYPE"));
relationList = salepriceExt.selByList("SEL_BY_FIX_TYPE");
return relationList;
}
public String getPriceJsonData(int iStart, String cust_id, String fix_type) throws SaasApplicationException {
String json = "";
ArrayList userList = new ArrayList();
SalePriceExt salepriceExt = new SalePriceExt();
salepriceExt.setParam(":VCUST_ID", cust_id);
salepriceExt.setParam(":VFIX_TYPE", fix_type);
userList = salepriceExt.selByList("SEL_BY_FIX_TYPE", iStart, 10);
JSONArray array = new JSONArray();
JSONObject root = new JSONObject();
if (userList != null && userList.size() > 0) {
for (int i = 0; i < userList.size(); i++) {
HashMap map = (HashMap) userList.get(i);
String goods_name = "", product_id = "";
String price = "";
String id = map.get("trade_id").toString();
if (map.get("goods_name") != null) {
goods_name = map.get("goods_name").toString();
}
if (map.get("product_id") != null) {
product_id = map.get("product_id").toString();
}
if (map.get("price") != null) {
price = map.get("price").toString();
}
JSONObject jsonObj = new JSONObject();
jsonObj.put("id", id);
jsonObj.put("goods_name", goods_name);
jsonObj.put("product_id", product_id);
jsonObj.put("price", price);
array.add(jsonObj);
}
}
int size = getPriceNumber(cust_id, "0");
root.put("root", array);
root.put("totalCount", size);
json = root.toString();
return json;
}
public int getPriceNumber(String cust_id, String fix_type) throws SaasApplicationException {
ArrayList relationList = new ArrayList();
SalePriceExt salepriceExt = new SalePriceExt();
salepriceExt.setParam(":VCUST_ID", cust_id);
salepriceExt.setParam(":VFIX_TYPE", fix_type);
relationList = salepriceExt.selByList("SEL_BY_FIX_TYPE");
if (relationList != null && relationList.size() > 0) {
return relationList.size();
}
return 0;
}
public ArrayList getCodeBy(String cust_id, String fix_type) throws SaasApplicationException {
ArrayList relationList = new ArrayList();
SalePriceExt salepriceExt = new SalePriceExt();
salepriceExt.setParam(":VCUST_ID", cust_id);
salepriceExt.setParam(":VFIX_TYPE", fix_type);
relationList = salepriceExt.selByList("SEL_BY_CODE");
return relationList;
}
public HashMap getOneGoods(String cust_id, String product_id) {
ArrayList list = new ArrayList();
SalePriceExt salepriceExt = new SalePriceExt();
salepriceExt.setParam(":VCUST_ID", cust_id);
salepriceExt.setParam(":VPRODUCT_ID", product_id);
list = salepriceExt.selByList("SEL_GOODS_BY_ID");
HashMap map = new HashMap();
if (list != null && list.size() > 0) {
map = (HashMap) list.get(0);
}
return map;
}
public ArrayList getMoreGoods(String cust_id, String price_code) {
ArrayList list = new ArrayList();
SalePriceExt salepriceExt = new SalePriceExt();
salepriceExt.setParam(":VCUST_ID", cust_id);
salepriceExt.setParam(":VPRICE_CODE", price_code);
list = salepriceExt.selByList("SEL_PRO_BY_CODE");
return list;
}
// 修改整单报价
public void ModiMorePrice(Buffers inbuffer) {
log.LOG_INFO("进入ModiMorePrice方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String price_code = inbuffer.getString("PRICE_CODE");
String sale_obj_id = inbuffer.getString("SALE_OBJ_ID");
String price_type = inbuffer.getString("PRICE_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 remark = inbuffer.getString("REMARK");
try {
SalePriceDAO salepricedao = new SalePriceDAO();
salepricedao.setCust_id(cust_id);
salepricedao.setPrice_code(price_code);
salepricedao.setSale_obj_id(sale_obj_id);
salepricedao.setPrice_type(price_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.setRemark(remark);
iResult = ModiMorePrice(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("退出ModiMorePrice方法...");
}
public int ModiMorePrice(SalePriceDAO salepricedao) throws SaasApplicationException {
SalePriceExt salepriceExt = new SalePriceExt();
salepriceExt.setParam(":VCUST_ID", salepricedao.getCust_id());
salepriceExt.setParam(":VPRICE_CODE", salepricedao.getPrice_code());
salepriceExt.setParam(":VSALE_OBJ_ID", salepricedao.getSale_obj_id());
salepriceExt.setParam(":VPRICE_TYPE", salepricedao.getPrice_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(":VREMARK", salepricedao.getRemark());
tradeQuery.executeBy(salepriceExt.insBy("UP_MORE_PRI_ALL"));
return 0;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -