📄 commodityinfo.java
字号:
this.outBuffer.setString("SPEC_CLASS_NAME_GRP", infoMap.get("class_name_grp").toString());
}
}
else
{
this.outBuffer.setString("WEB_ID","");
this.outBuffer.setString("SPEC_CLASS_ID", "");
this.outBuffer.setString("SPEC_CLASS_NAME", commodityDAO.getCommodity_name());
this.outBuffer.setString("SPEC_CLASS_ID_GRP","");
this.outBuffer.setString("SPEC_CLASS_NAME_GRP","");
}
return 0;
}
//查询root_id
public ArrayList genRootId(String product_id) throws SaasApplicationException
{
ArrayList itlist = new ArrayList();
InfoClassExt infoClassExt = new InfoClassExt();
infoClassExt.setParam(":VROOT_ID",product_id);
try
{
itlist = infoClassExt.selByList("SEL_BY_ID");
}
catch(Exception e)
{
return null;
}
return itlist;
}
//商品下架
public void invalidCommodityInfo(Buffers inbuffer)
{
log.LOG_INFO("进入invalidCommodityInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String commodity_id = inbuffer.getString("COMMODITY_ID");
try
{
iResult = invalidCommodityInfo(commodity_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("进入invalidCommodityInfo方法...");
}
public int invalidCommodityInfo(String commodity_id) throws SaasApplicationException
{
CommodityExt commodityExt = new CommodityExt();
commodityExt.setParam(":VCOMMODITY_ID",commodity_id);
commodityExt.setParam(":VVALIDITY","1");
tradeQuery.executeBy(commodityExt.insBy("INVALID_BY_COMMODITY"));
return 0;
}
//商品推荐
public void commendCommodityInfo(Buffers inbuffer)
{
log.LOG_INFO("进入commendCommodityInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String commodity_id = inbuffer.getString("COMMODITY_ID");
try
{
iResult = commendCommodityInfo(commodity_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("进入commendCommodityInfo方法...");
}
public int commendCommodityInfo(String commodity_id) throws SaasApplicationException
{
CommodityExt commodityExt = new CommodityExt();
commodityExt.setParam(":VCOMMODITY_ID",commodity_id);
commodityExt.setParam(":VCOMMODITY_CLASS","1");
tradeQuery.executeBy(commodityExt.insBy("COMMEND_BY_ONE"));
return 0;
}
//商品信息修改
public void upCommodityInfo(Buffers inbuffer)
{
log.LOG_INFO("进入upCommodityInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
CommodityDAO commodityDAO = new CommodityDAO();
commodityDAO.setCommodity_id(inbuffer.getString("COMMODITY_ID"));
// commodityDAO.setCust_id(inbuffer.getString("CUST_ID"));
commodityDAO.setCommodity_type(inbuffer.getString("COMMODITY_TYPE"));
commodityDAO.setCommodity_name(inbuffer.getString("COMMODITY_NAME"));
commodityDAO.setContent(inbuffer.getString("CONTENT"));
commodityDAO.setCommodity_brand(inbuffer.getString("COMMODITY_BRAND"));
commodityDAO.setCommodity_price(inbuffer.getString("COMMODITY_PRICE"));
commodityDAO.setPrice_type(inbuffer.getString("PRICE_TYPE"));
commodityDAO.setSale_price(inbuffer.getString("SALE_PRICE"));
commodityDAO.setCommodity_unit(inbuffer.getString("COMMODITY_UNIT"));
commodityDAO.setSale_market(inbuffer.getString("SALE_MARKET"));
commodityDAO.setPublish_user_id(inbuffer.getString("SESSION_USER_ID"));
commodityDAO.setAudit_user_id(inbuffer.getString("SESSION_USER_ID"));
if (inbuffer.getString("REATTACH_TAG") !="")
{
commodityDAO.setAttach_tag("1");
}
else
{
commodityDAO.setAttach_tag("0");
}
try
{
iResult = upCommodityInfo(commodityDAO);
}
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("退出upCommodityInfo方法...");
}
public int upCommodityInfo(CommodityDAO commodityDAO) throws SaasApplicationException
{
CommodityExt commodityExt = new CommodityExt();
//commodityExt.setParam(":VCUST_ID",commodityDAO.getCust_id());
commodityExt.setParam(":VCOMMODITY_ID",commodityDAO.getCommodity_id());
commodityExt.setParam(":VCOMMODITY_TYPE",commodityDAO.getCommodity_type());
commodityExt.setParam(":VCOMMODITY_NAME",commodityDAO.getCommodity_name());
commodityExt.setParam(":VCONTENT",commodityDAO.getContent());
commodityExt.setParam(":VCOMMODITY_CLASS","0");
commodityExt.setParam(":VCOMMODITY_BRAND",commodityDAO.getCommodity_brand());
commodityExt.setParam(":VCOMMODITY_PRICE",commodityDAO.getCommodity_price());
commodityExt.setParam(":VPRICE_TYPE",commodityDAO.getPrice_type());
commodityExt.setParam(":VSALE_PRICE",commodityDAO.getSale_price());
commodityExt.setParam(":VCOMMODITY_UNIT",commodityDAO.getCommodity_unit());
commodityExt.setParam(":VSALE_MARKET",commodityDAO.getSale_market());
commodityExt.setParam(":VATTACH_TAG",commodityDAO.getAttach_tag());
commodityExt.setParam(":VPUBLISH_USER_ID",commodityDAO.getPublish_user_id());
commodityExt.setParam(":VREMARK","");
tradeQuery.executeBy(commodityExt.insBy("UPDATE_BY_ONE"));
return 0;
}
public ArrayList searchCommodity(String title,String cust_id) throws SaasApplicationException
{
ArrayList itemsList = new ArrayList();
CommodityExt commodityExt = new CommodityExt();
commodityExt.setParam(":VCOMMODITY_NAME","%"+title+"%");
commodityExt.setParam(":VCUST_ID",cust_id);
commodityExt.setParam(":VVALIDITY","0");
itemsList = commodityExt.selByList("SEL_BY_SEARCH");
return itemsList;
}
//分页查询
public ArrayList genCustgoodsList(int iStart,String cust_id) throws SaasApplicationException
{
if(iStart==0)
{
iStart=0;
}
else
{
iStart = (iStart-1)*30;
}
ArrayList itemsList = new ArrayList();
CommodityExt commodityExt = new CommodityExt();
commodityExt.setParam(":VCUST_ID", cust_id);
commodityExt.setParam(":VVALIDITY", "0");
itemsList = commodityExt.selByList("SEL_BY_CUSTID",iStart,30);
return itemsList;
}
//统计总数
public int getCommodityNumer(String cust_id) throws SaasApplicationException
{
ArrayList itemsList = new ArrayList();
CommodityExt commodityExt = new CommodityExt();
commodityExt.setParam(":VCUST_ID", cust_id);
commodityExt.setParam(":VVALIDITY", "0");
itemsList = commodityExt.selByList("SEL_BY_CUSTID");
if(itemsList != null && itemsList.size()>0)
{
return itemsList.size();
}
else
{
return 0;
}
}
//推荐商品分页查询
public ArrayList genSpecComList(int iStart,String cust_id) throws SaasApplicationException
{
if(iStart==0)
{
iStart=0;
}
else
{
iStart = (iStart-1)*30;
}
ArrayList itemsList = new ArrayList();
CommodityExt commodityExt = new CommodityExt();
commodityExt.setParam(":VCUST_ID", cust_id);
commodityExt.setParam(":VVALIDITY", "0");
itemsList = commodityExt.selByList("SEL_BY_SPECIAL",iStart,30);
return itemsList;
}
//推荐商品统计
public int getSpecCommodityNumer(String cust_id) throws SaasApplicationException
{
ArrayList itemsList = new ArrayList();
CommodityExt commodityExt = new CommodityExt();
commodityExt.setParam(":VCUST_ID", cust_id);
commodityExt.setParam(":VVALIDITY", "0");
itemsList = commodityExt.selByList("SEL_BY_SPECIAL");
if(itemsList != null && itemsList.size()>0)
{
return itemsList.size();
}
else
{
return 0;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -