⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 goodsmgr.java

📁 JSP实现的在线网络购物系统JAVA程序源码,
💻 JAVA
字号:
package com.shopping.business;

import java.sql.*;
import java.util.*;

import com.comm.*;
import com.comm.vo.*;
import com.shopping.dao.*;

public class GoodsMgr {

    //商品类型
    public void addGoodsType(GenericVO gvo) throws AppException {
        try {
            new GoodsTypeDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void modifyGoodsType(GenericVO gvo) throws AppException {
        try {
            new GoodsTypeDao().modify(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public int deleteGoodsType(int goodsTypeId) throws AppException {
        try {
            //判断下面是否有子类
            Vector t = new GoodsTypeDao().getByPid(goodsTypeId);
            if (t.size() > 0) {
                return 0;
            }
            new GoodsTypeDao().delete(goodsTypeId);
            return goodsTypeId;
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getTopGoodsType() throws AppException {
        try {
            return new GoodsTypeDao().getTop();
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getGoodsTypeByPid(int parentId) throws AppException {
        try {
            return new GoodsTypeDao().getByPid(parentId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO getGoodsTypeDetail(int goodsTypeId) throws AppException {
        try {
            return new GoodsTypeDao().getDetail(goodsTypeId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    //品牌
    public void addBrand(GenericVO gvo) throws AppException {
        try {
            new BrandDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void modifyBrand(GenericVO gvo) throws AppException {
        try {
            new BrandDao().modify(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void deleteBrand(int brandId) throws AppException {
        try {
            new BrandDao().delete(brandId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO getBrandDetail(int brandId) throws AppException {
        try {
            return new BrandDao().getDetail(brandId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getBrand() throws AppException {
        try {
            return new BrandDao().get();
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void updateBrandLogo1(int brandId, String logo1) throws AppException {
        try {
            new BrandDao().updateLogo1(brandId, logo1);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void updateBrandLogo2(int brandId, String logo1) throws AppException {
        try {
            new BrandDao().updateLogo2(brandId, logo1);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getBrandByGoodsTypeId(int goodsTypeId) throws AppException {
        try {
            return new GoodsDao().getBrandByGoodsTypeId(goodsTypeId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    //商品
    public int addGoods(GenericVO gvo) throws AppException {
        try {
            return new GoodsDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void modifyGoods(GenericVO gvo) throws AppException {
        try {
            new GoodsDao().modify(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void deleteGoods(int goodsId) throws AppException {
        try {
            new GoodsDao().delete(goodsId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO getGoodsDetail(int goodsId) throws AppException {
        try {
            GenericVO gv = new GoodsDao().getDetail(goodsId);
            Vector rg = new GoodsDao().getRelateGoods(goodsId);
            gv.add("RELATEGOODS", rg);
            return gv;
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }


    public void addOOGoods(GenericVO gvo) throws AppException {
        try {
            new GoodsDao().addOOGoods(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }


    public void deleteOOGoods(int id) throws AppException {
        try {
            new GoodsDao().deleteOOGoods(id);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public ListVO searchGoods(GenericVO gvo) throws AppException {
        try {
            return new GoodsDao().search(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    //排行榜
    public void addTop(GenericVO gvo) throws AppException {
        try {
            new TopDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void modifyTop(GenericVO gvo) throws AppException {
        try {
            new TopDao().modify(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void deleteTop(int deleteId) throws AppException {
        try {
            new TopDao().delete(deleteId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getTop() throws AppException {
        try {
            return new TopDao().get();
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getTopByType(int type) throws AppException {
        try {
            return new TopDao().getByType(type);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO getTopDetail(int topId) throws AppException {
        try {
            return new TopDao().getDetail(topId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    //推荐
    public void AddGood(GenericVO gvo) throws AppException {
        try {
            new GoodDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void deleteGood(int goodId) throws AppException {
        try {
            new GoodDao().delete(goodId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getGoodByItem(String item) throws AppException {
        try {
            return new GoodDao().getByItem(item);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    //地址本
    public void addAddress(GenericVO gvo) throws AppException {
        try {
            new AddressDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void modifyAddress(GenericVO gvo) throws AppException {
        try {
            new AddressDao().modify(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getAddressByUserId(int userId) throws AppException {
        try {
            return new AddressDao().getByUserId(userId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO getAddressDetail(int addressId) throws AppException {
        try {
            return new AddressDao().getDetail(addressId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    //订单
    public String addOrder(GenericVO gvo) throws AppException {
        try {
            return new OrderDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void updateOrder(String no, String field, Object value) throws
            AppException {
        try {
            new OrderDao().update(no, field, value);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void addOrderGoods(GenericVO gvo) throws AppException {
        try {
            new OrderDao().addOrderGoods(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO getOrderDetail(int orderId) throws AppException {
        try {
            return new OrderDao().getDetail(orderId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO getOrderDetailByOrderNo(String orderNo) throws
            AppException {
        try {
            return new OrderDao().getDetailByOrderNo(orderNo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getGoodsByOrderNo(String orderNo) throws AppException {
        try {
            return new OrderDao().getGoodsByOrderNo(orderNo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void updateOrderStatus(int orderId, int status) throws AppException {
        try {
            new OrderDao().updateStatus(orderId, status);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public ListVO searchOrder(GenericVO gvo) throws AppException {
        try {
            return new OrderDao().search(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void addPayMethod(GenericVO gvo) throws AppException {
        try {
            new PayMethodDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void modifyPayMethod(GenericVO gvo) throws AppException {
        try {
            new PayMethodDao().modify(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void deletePayMethod(int payMethodId) throws AppException {
        try {
            new PayMethodDao().delete(payMethodId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getPayMethod() throws AppException {
        try {
            return new PayMethodDao().get();
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO getPayMethodDetail(int payMethodId) throws AppException {
        try {
            return new PayMethodDao().getDetail(payMethodId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void addPostMethod(GenericVO gvo) throws AppException {
        try {
            new PostMethodDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void modifyPostMethod(GenericVO gvo) throws AppException {
        try {
            new PostMethodDao().modify(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void deletePostMethod(int postMethodId) throws AppException {
        try {
            new PostMethodDao().delete(postMethodId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO getPostMethodDetail(int postMethodId) throws AppException {
        try {
            return new PostMethodDao().getDetail(postMethodId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getPostMethod() throws AppException {
        try {
            return new PostMethodDao().get();
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void updateGoodsPv(int goodsId, int pv) throws AppException {
        try {
            new GoodsDao().updateGoodsPv(goodsId, pv);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -