📄 productinfo.java
字号:
public int delProductInfo(ProductDAO productdao)
throws SaasApplicationException {
ProductExt productExt = new ProductExt();
productExt.setParam(":VCUST_ID", productdao.getCust_id());
productExt.setParam(":VPRODUCT_ID", productdao.getProduct_id());
tradeQuery.executeBy(productExt.insBy("DEL_BY_PRO_ID"));
return 0;
}
// 产品修改
public void changProductInfo(Buffers inbuffer) {
log.LOG_INFO("进入changProductInfo方法...");
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 product_name = inbuffer.getString("PRODUCT_NAME");
String product_abstract = inbuffer.getString("PRODUCT_ABSTRACT");
String product_desc = inbuffer.getString("PRODUCT_DESC");
String product_site = inbuffer.getString("PRODUCT_SITE");
String product_unit = inbuffer.getString("PRODUCT_UNIT");
String audit_date = inbuffer.getString("AUDIT_DATE");
String remark = inbuffer.getString("REMARK");
try {
ProductDAO productdao = new ProductDAO();
productdao.setCust_id(cust_id);
productdao.setProduct_id(product_id);
productdao.setProduct_name(product_name);
productdao.setProduct_abstract(product_abstract);
productdao.setProduct_desc(product_desc);
productdao.setProduct_site(product_site);
productdao.setProduct_unit(product_unit);
productdao.setAudit_date(audit_date);
productdao.setRemark(remark);
iResult = changProductInfo(productdao);
} 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("退出changProductInfo方法...");
}
public int changProductInfo(ProductDAO productDAO)
throws SaasApplicationException {
ProductExt productExt = new ProductExt();
productExt.setParam(":VCUST_ID", productDAO.getCust_id());
productExt.setParam(":VPRODUCT_ID", productDAO.getProduct_id());
productExt.setParam(":VPRODUCT_NAME", productDAO.getProduct_name());
productExt.setParam(":VPRODUCT_ABSTRACT", productDAO
.getProduct_abstract());
productExt.setParam(":VPRODUCT_DESC", productDAO.getProduct_desc());
productExt.setParam(":VPRODUCT_SITE", productDAO.getProduct_site());
productExt.setParam(":VPRODUCT_UNIT", productDAO.getProduct_unit());
productExt.setParam(":VAUDIT_DATE", productDAO.getAudit_date());
productExt.setParam(":VREMARK", productDAO.getRemark());
tradeQuery.executeBy(productExt.insBy("UPDATE_PRODUCT_BY_ID"));
return 0;
}
// 分页查询
@SuppressWarnings("unchecked")
public ArrayList getproductListByCust(int iStart, String strCustId)
throws SaasApplicationException {
if (iStart == 0) {
iStart = 0;
} else {
iStart = (iStart - 1) * 30;
}
ArrayList productList = new ArrayList();
ProductExt productExt = new ProductExt();
productExt.setParam(":VCUST_ID", strCustId);
productList = productExt.selByList("SEL_BY_CUST", iStart, 30);
log.LOG_INFO("" + productExt.insBy("UPDATE_PRODUCT_BY_ID"));
return productList;
}
// 统计总数
@SuppressWarnings("unchecked")
public int getProductNumber(String cust_id) throws SaasApplicationException {
ArrayList productList = new ArrayList();
ProductExt productExt = new ProductExt();
productExt.setParam(":VCUST_ID", cust_id);
productList = productExt.selByList("SEL_BY_CUST");
if (productList != null) {
return productList.size();
} else {
return 0;
}
}
// 分页搜索查询
@SuppressWarnings("unchecked")
public ArrayList getproductListBySearch(int iStart, String Keys)
throws SaasApplicationException {
if (iStart == 0) {
iStart = 0;
} else {
iStart = (iStart - 1) * 30;
}
ArrayList productList = new ArrayList();
ProductExt productExt = new ProductExt();
productExt.setParam(":VCONTENT", "%" + Keys.trim() + "%");
productList = productExt.selByList("SEL_BY_KEYS", iStart, 30);
return productList;
}
// 分页搜索统计
@SuppressWarnings("unchecked")
public int getProductSearch(String Keys) throws SaasApplicationException {
ArrayList productList = new ArrayList();
ProductExt productExt = new ProductExt();
productExt.setParam(":VCONTENT", "%" + Keys.trim() + "%");
productList = productExt.selByList("SEL_BY_KEYS");
if (productList != null) {
return productList.size();
} else {
return 0;
}
}
@SuppressWarnings("unchecked")
public ArrayList getById(String cust_id, String product_id)
throws SaasApplicationException {
ArrayList relationList = new ArrayList();
ProductExt relaExt = new ProductExt();
relaExt.setParam(":VCUST_ID", cust_id);
relaExt.setParam(":VPRODUCT_ID", product_id);
relationList = relaExt.selByList("SEL_BY_PRODUCT_ID");
return relationList;
}
@SuppressWarnings("unchecked")
public ArrayList getProList(int iStart, String cust_id)
throws SaasApplicationException {
ProductExt procurExt = new ProductExt();
ArrayList list = new ArrayList();
if (iStart > 1) {
iStart = (iStart - 1) * 20;
} else {
iStart = 0;
}
procurExt.setParam(":VCUST_ID", cust_id);
list = procurExt.selByList("SEL_ALL_PRO", iStart, 20);
return list;
}
@SuppressWarnings("unchecked")
public ArrayList getAllProductList(int iStart, String cust_id)
throws SaasApplicationException {
ProductExt procurExt = new ProductExt();
ArrayList list = new ArrayList();
if (iStart > 1) {
iStart = (iStart - 1) * 10;
} else {
iStart = 0;
}
procurExt.setParam(":VCUST_ID", cust_id);
list = procurExt.selByList("SEL_ALL_PRODUCTLIST", iStart, 10);
return list;
}
// 取出所有的产品
@SuppressWarnings("unchecked")
public int getProductList(String cust_id) throws SaasApplicationException {
ProductExt procurExt = new ProductExt();
ArrayList list = new ArrayList();
int count = 0;
try {
procurExt.setParam(":VCUST_ID", cust_id);
list = procurExt.selByList("SEL_ALL_PRO");
} catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
if (list != null && list.size() > 0) {
count = list.size();
}
return count;
}
@SuppressWarnings("unchecked")
public ArrayList genProduct() throws SaasApplicationException {
ArrayList productList = new ArrayList();
ProductExt productExt = new ProductExt();
productList = productExt.selByList("SEL_BY_LIMIT_14");
return productList;
}
// 查找图片路径
public String getCustAttachPath(String strAttachId, String flag)
throws SaasApplicationException {
Attachinfo attachInfo = new Attachinfo();
String file_path = attachInfo.getAttachPath(strAttachId, flag, "0");
return file_path;
}
@SuppressWarnings("unchecked")
public ArrayList getproductListByLimit(String strCustId, int num)
throws SaasApplicationException {
ArrayList productList = new ArrayList();
ProductExt productExt = new ProductExt();
productExt.setParam(":VCUST_ID", strCustId);
productList = productExt.selByList("SEL_BY_CUST_LIMIT", 0, num);
return productList;
}
@SuppressWarnings("unchecked")
public ArrayList getProductByClassId(int iStart, int limit, String class_id)
throws SaasApplicationException {
log.LOG_INFO("进入getProductByStock方法");
if (iStart > 1) {
iStart = (iStart - 1) * limit;
} else {
iStart = 0;
}
ArrayList saleList = new ArrayList();
ProductExt productExt = new ProductExt();
productExt.setParam(":VCLASS_ID", class_id);
saleList = productExt.selByList("SEL_PRODUCT_BY_CLASS_ID", iStart, limit);
log.LOG_INFO("退出getProductByStock方法");
return saleList;
}
@SuppressWarnings("unchecked")
public int getProductByClassId(String class_id)
throws SaasApplicationException {
int size = 0;
ProductExt productExt = new ProductExt();
productExt.setParam(":VCLASS_ID", class_id);
ArrayList list = productExt.selByList("SEL_PRODUCT_BY_CLASS_ID");
if (list != null && list.size() > 0) {
size = list.size();
}
return size;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -