Browse Source

上传文件至 'Shop/src/cn/service/impl'

1801010538 5 years ago
parent
commit
19009707be

+ 26 - 0
Shop/src/cn/service/impl/AgentServiceImpl.java

@@ -0,0 +1,26 @@
+package cn.service.impl;
+
+import cn.dao.AgentDao;
+import cn.dao.impl.AgentDaoImpl;
+import cn.domain.Agent;
+import cn.domain.Order;
+import cn.service.AgentService;
+
+public class AgentServiceImpl implements AgentService {
+    private AgentDao agentDao = new AgentDaoImpl();
+
+    @Override
+    public void register(Agent agent) throws Exception {
+        agentDao.register(agent);
+    }
+
+    @Override
+    public Agent login(Agent agent)throws Exception {
+        return agentDao.login(agent.getName(),agent.getPassword());
+    }
+
+    @Override
+    public Agent findByMid(String mid) throws Exception {
+        return agentDao.findByMid(mid);
+    }
+}

+ 36 - 0
Shop/src/cn/service/impl/CompanyServiceImpl.java

@@ -0,0 +1,36 @@
+package cn.service.impl;
+
+import cn.dao.CompanyDao;
+import cn.dao.impl.CompanyDaoImpl;
+import cn.domain.Company;
+import cn.service.CompanyService;
+
+import java.util.List;
+
+public class CompanyServiceImpl implements CompanyService {
+    CompanyDao companyDao= new CompanyDaoImpl();
+    @Override
+    public void register(Company company) throws Exception {
+        companyDao.register(company);
+    }
+
+    @Override
+    public List<Company> companyInfomation() throws Exception {
+        return companyDao.companyInfomation();
+    }
+
+    @Override
+    public List<Company> pendingMatters() throws Exception {
+        return companyDao.pendingMatters();
+    }
+
+    @Override
+    public void pass(String mid) throws Exception {
+        companyDao.pass(mid);
+    }
+
+    @Override
+    public List<Company> findCompany() throws Exception {
+        return companyDao.findCompany();
+    }
+}

+ 26 - 0
Shop/src/cn/service/impl/OrderServiceImpl.java

@@ -0,0 +1,26 @@
+package cn.service.impl;
+
+import cn.dao.OrderDao;
+import cn.dao.impl.OrderDaoImpl;
+import cn.domain.Order;
+import cn.service.OrderService;
+
+import java.util.List;
+
+public class OrderServiceImpl implements OrderService {
+    OrderDao orderDao = new OrderDaoImpl();
+    @Override
+    public void saveOrder(Order order) throws Exception {
+        orderDao.saveOrder(order);
+    }
+
+    @Override
+    public List<Order> findByBuyer(String buyer) throws Exception {
+        return orderDao.findByBuyer(buyer);
+    }
+
+    @Override
+    public List<Order> findBySaler(String saler) throws Exception {
+        return orderDao.findBySaler(saler);
+    }
+}

+ 42 - 0
Shop/src/cn/service/impl/ProductServiceImpl.java

@@ -0,0 +1,42 @@
+package cn.service.impl;
+
+import cn.dao.ProductDao;
+import cn.dao.impl.ProductDaoImpl;
+import cn.domain.Agent;
+import cn.domain.Product;
+import cn.service.ProductService;
+
+import java.util.List;
+
+public class ProductServiceImpl implements ProductService {
+    private ProductDao productDao = new ProductDaoImpl();
+    @Override
+    public List<Product> findProduct() throws Exception {
+        return productDao.findProduct();
+    }
+
+    @Override
+    public Product findProductById(String mid) throws Exception {
+        return productDao.findProductById(mid);
+    }
+
+    @Override
+    public List<Product> findProductByScompany(String scompany) throws Exception {
+        return productDao.findProductByScompany(scompany);
+    }
+
+    @Override
+    public void addProduct(Product product) throws Exception {
+        productDao.addProduct(product);
+    }
+
+    @Override
+    public void deleteProduct(String mid) throws Exception {
+        productDao.deleteProduct(mid);
+    }
+
+    @Override
+    public void updateProduct(Product product) throws Exception {
+        productDao.updateProduct(product);
+    }
+}