进销存管理系统

简介: 进销存管理系统的功能需求:

进销存管理系统的功能需求:


1,实现采购订单的持久化,对采购商品入库处理,还有就是采购的退货处理;


2,实现商品的入库、出库操作,查询商品的库存信息,修改商品的仓库号


3,实现销售订单的添加,销售发货处理,并且销售的退货处理


4,实现新建员工培训信息和查询员工培训记录功能


5,实现对商品、供应商、客户资料的管理,对员工用户的管理,最重要的是对系统数据的备份和恢复


代码的截图如下所示:


微信图片_20221009145907.png


系统的截图如下所示:


微信图片_20221009145914.png


微信图片_20221009145919.png

微信图片_20221009145922.png


微信图片_20221009145926.png


微信图片_20221009145930.png


bean层manage的代码如下所示:


package com.xu.bean;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.springframework.stereotype.Component;
/**
 * 
 * @author 公众号:springmeng
 *管理员
 *id:管理员编号
 *name:管理员名字
 *password:登录密码
 *gender:性别
 *age:年龄
 *phone number:手机号码
 *deptId:部门id
 */
@Entity
@Table(name = "managers")
@Component
public class Managers {
  @Id
  @GeneratedValue(strategy=GenerationType.AUTO)
  @Column(name="managers_id")
  private Long id;
  @Column(name="managers_name")
  private String name;
  @Column(name="managers_password")
  private String password;
  @Column(name="managers_gender")
  private String gender;
  @Column(name="managers_age")
  private Long age;
  @Column(name="managers_phonenumber")
  private String phonenumber;
  /*@ManyToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY,optional=false,targetEntity=Dept.class)
  @JoinColumn(name="dept_name")
  private String deptName;*/
  public Long getId() {
  return id;
  }
  public void setId(Long id) {
  this.id = id;
  }
  public String getName() {
  return name;
  }
  public void setName(String name) {
  this.name = name;
  }
  public String getPassword() {
  return password;
  }
  public void setPassword(String password) {
  this.password = password;
  }
  public String getGender() {
  return gender;
  }
  public void setGender(String gender) {
  this.gender = gender;
  }
  public String getPhonenumber() {
  return phonenumber;
  }
  public void setPhonenumber(String phonenumber) {
  this.phonenumber = phonenumber;
  }
  public Long getAge() {
  return age;
  }
  public void setAge(Long age) {
  this.age = age;
  }
  /*public String getDeptName() {
  return deptName;
  }
  public void setDeptName(String deptName) {
  this.deptName = deptName;
  }*/
}

dao层MessageRepository的代码如下所示:


package com.xu.dao;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import com.xu.bean.Message;
public interface MessageRepository extends JpaRepository<Message, Long>{
  @Query("select count(id) from Message where flag = '未查看'")
  public Long findConts();
  @Transactional
  @Modifying(clearAutomatically = true)
  @Query(value ="update message set flag='已查看' where id=?1",nativeQuery=true)
  public void updateMessageById(Long id);
}


Mananger的代码如下所示:


package com.xu.service;
import java.util.List;
import com.xu.bean.Employee;
import com.xu.bean.Managers;
import com.xu.bean.Message;
import com.xu.bean.PurchaseItem;
import com.xu.bean.PurchaseOrder;
import com.xu.exception.ServiceException;
public interface ManagerService {
  public int register(Managers manager)throws ServiceException;
  public Managers login(String name,String password)throws ServiceException;
  public int addPurchaseOrder(PurchaseOrder purchase,List<PurchaseItem> purchaseItem)throws ServiceException;
  public List<PurchaseOrder> findAllPurchaseOrder()throws ServiceException;
  public List<PurchaseOrder> findPurchaseOrderByPage(int currentPage)throws ServiceException;
  public Long findPurchaseOrderCount()throws ServiceException;
  public Long getTotalPage()throws ServiceException;
  public PurchaseOrder delOrderByPurchaseId(Long orderId)throws ServiceException;
  public List<PurchaseItem> delPurchaseItemByPurchaseId(Long orderId)throws ServiceException;
  public List<PurchaseItem> findPurchaseItemByPurchaseOrderId(Long orderId)throws ServiceException;
  public String findFlagByOrderId(Long orderId)throws ServiceException;
  public int updateFlagByOrderId(String string, Long orderId)throws ServiceException;
  public Employee employeelogin(String name, String password)throws ServiceException;
  public int employeeregister(Employee employee)throws ServiceException;
  public int  updateStockByReturnPurchaseItem(List<PurchaseItem> purchaseItem)throws ServiceException;
  public Employee updateEmplyeeByName(Employee employee)throws ServiceException;
  public Managers updateManagersByName(Managers managers)throws ServiceException;
  public Long findMessageCount()throws ServiceException;
  public List<Message> findAllMessage()throws ServiceException;
  public Message findMessageById(Long id)throws ServiceException;
  public int updateEmployeeById(Long id)throws ServiceException;
  public List<Message> findMessageByPage(int i)throws ServiceException;
  public Long getMessageTotalPage()throws ServiceException;
  public Long findMessageCounts()throws ServiceException;
}


Manager的serviceimp实现:


package com.xu.service.imp;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import com.xu.bean.Employee;
import com.xu.bean.Managers;
import com.xu.bean.Message;
import com.xu.bean.PurchaseItem;
import com.xu.bean.PurchaseOrder;
import com.xu.dao.EmployeeRepository;
import com.xu.dao.GoodsRepository;
import com.xu.dao.ManagerRepository;
import com.xu.dao.MessageRepository;
import com.xu.dao.PurchaseItemRepository;
import com.xu.dao.PurchaseRepository;
import com.xu.dao.StockRepository;
import com.xu.exception.ServiceException;
import com.xu.service.ManagerService;
import com.xu.util.EncoderByMd5;
@Service
public class ManagerServiceImp implements ManagerService{
  @Resource
  private ManagerRepository managerRepository;
  @Resource
  private PurchaseRepository purchaseRepository;
  @Resource
  private PurchaseItemRepository purchaseItemRepository;
  @Resource
  private EmployeeRepository employeeRepository;
  @Resource
  private StockRepository stockRepository;
  @Resource
  private GoodsRepository goodsRepository;
  @Resource
  private MessageRepository messageReository;
  @Override
  public int register(Managers manager) throws ServiceException {
  managerRepository.save(manager);
  return 0;
  }
  @Override
  public Managers login(String name, String password) throws ServiceException {
  Managers man = managerRepository.findManagersByName(name);
  if(man!=null){
  String md5 = EncoderByMd5.Md5(password);
  if(md5.equals(man.getPassword())){
    return man;
  }else{
    return null;
  }}else{
    return null;
  }
  }
  @Override
  public int addPurchaseOrder(PurchaseOrder purchase, List<PurchaseItem> purchaseItem) throws ServiceException {
  Double total =0D;
  for(PurchaseItem item:purchaseItem){
    Double price = item.getPrice();
    Long count = item.getCount();
    Double i = price * count;
    total += i;
  }
  purchase.setSuppliersId(purchaseItem.get(0).getSupplierId());
  purchase.setTotal(total);
  PurchaseOrder order = purchaseRepository.save(purchase);  
  for(PurchaseItem item:purchaseItem){
    item.setPurchaseOrderId(order.getId());
    purchaseItemRepository.save(item);
  }
  return 1;
  }
  @Override
  public List<PurchaseOrder> findAllPurchaseOrder() {
  List<PurchaseOrder> list = purchaseRepository.findAll();
  return list;
  }
  @Override
  public Long findPurchaseOrderCount() {
  return purchaseRepository.count();
  }
  @Override
  public List<PurchaseOrder> findPurchaseOrderByPage(int pageNum) { 
  Pageable pageable = new PageRequest(pageNum, 10);
  Page<PurchaseOrder> page =purchaseRepository.findAll(pageable);
  List<PurchaseOrder> list = new ArrayList<PurchaseOrder>();
  for(PurchaseOrder p:page){
    list.add(p);
  }
  return list;
  }
  @Override
  public Long getTotalPage(){
  long count = findPurchaseOrderCount();
  Long totalPage;
  if(count%10==0){
    totalPage = count/10;
  }else{
    totalPage = count/10 +1;
  }
  return totalPage;
  }
  @Override
  public PurchaseOrder delOrderByPurchaseId(Long orderId) {
    PurchaseOrder purchaseOrder = purchaseRepository.findOne(orderId);
    purchaseRepository.delete(orderId);
  return purchaseOrder;
  }
  @Override
  public List<PurchaseItem> delPurchaseItemByPurchaseId(Long orderId) throws ServiceException {
  List<PurchaseItem> purchaseItem = purchaseItemRepository.findPurchaseItemByPurchaseId(orderId);
  purchaseItemRepository.delete(orderId);
  return purchaseItem;
  }
  @Override
  public List<PurchaseItem> findPurchaseItemByPurchaseOrderId(Long orderId) throws ServiceException {
  return purchaseItemRepository.findPurchaseItemByPurchaseId(orderId);
  }
  @Override
  public String findFlagByOrderId(Long orderId) throws ServiceException {
  return purchaseRepository.findFlagByOrderId(orderId);
  }
  @Override
  public int updateFlagByOrderId(String string, Long orderId) throws ServiceException {
  purchaseRepository.updateFlagByOrderId(string,orderId);
  return 1;
  }
  @Override
  public Employee employeelogin(String name, String password) throws ServiceException {
  Employee man = employeeRepository.findEmployeeByName(name);
  if(man!=null){
    String md5 = EncoderByMd5.Md5(password);
    if(md5.equals(man.getPassword())){
    return man;
    }else{
    return null;
    }
  }else{
    return null;
  }
  }
  @Override
  public int employeeregister(Employee employee) throws ServiceException {
  employeeRepository.save(employee);
  return 0;
  }
  @Override
  public int updateStockByReturnPurchaseItem(List<PurchaseItem> purchaseItem) throws ServiceException {
  for(PurchaseItem pi:purchaseItem){
    Long goodsId = goodsRepository.findGoodsIdByGoodsName(pi.getName());
    Long count = stockRepository.findCountByGoodsId(goodsId);
    stockRepository.updateStockCountByGoodsId(count-pi.getCount(), goodsId);
  }
  return 0;
  }
  @Override
  public Employee updateEmplyeeByName(Employee employee) throws ServiceException {
  employeeRepository.updateEmployeeByName(employee.getAge(),employee.getGender(),employee.getPhonenumber(),employee.getName());
  return employeeRepository.findEmployeeByName(employee.getName());
  }
  @Override
  public Managers updateManagersByName(Managers managers) throws ServiceException {
  managerRepository.updateManagersByName(managers.getAge(),managers.getGender(),managers.getPhonenumber(),managers.getName());
  return managerRepository.findManagersByName(managers.getName());
  }
  @Override
  public Long findMessageCount() throws ServiceException {
  return messageReository.findConts();
  }
  @Override
  public List<Message> findAllMessage() throws ServiceException {
  return messageReository.findAll();
  }
  @Override
  public Message findMessageById(Long id) throws ServiceException {
  return messageReository.findOne(id);
  }
  @Override
  public int updateEmployeeById(Long id) throws ServiceException {
  messageReository.updateMessageById(id);
  return 1;
  }
  @Override
  public List<Message> findMessageByPage(int i) throws ServiceException {
  Pageable pageable = new PageRequest(i, 10);
  Page<Message> page =messageReository.findAll(pageable);
  List<Message> list = new ArrayList<Message>();
  for(Message p:page){
    list.add(p);
  }
  return list;
  }
  @Override
  public Long getMessageTotalPage() throws ServiceException {
  long count = findMessageCounts();
  Long totalPage;
  if(count%10==0){
    totalPage = count/10;
  }else{
    totalPage = count/10 +1;
  }
  return totalPage;
  }
  @Override
  public Long findMessageCounts() throws ServiceException {
  return messageReository.count();
  }
}
目录
相关文章
|
6月前
|
存储 安全 Java
jspm贫困生管理系统
jspm贫困生管理系统
|
6月前
|
存储 安全 前端开发
绿色蔬菜销售管理系统
绿色蔬菜销售管理系统
|
供应链 BI
一文看懂什么是“进销存”
一、什么是“进销存”? 进销存,又称为购销链,是指企业管理过程中 采购(进)→入库(存)→销售(销) 的动态管理过程。 进:指询价、采购到入库与付款的过程。 销:指报价、销售到出库与收款的过程。 存:指出入库之外,包括领料、退货、盘点等影响库存数量的动作。
214 0
|
6月前
|
Oracle 关系型数据库 数据管理
企业进销存管理系统的设计与实现_kaic
企业进销存管理系统的设计与实现_kaic
|
4月前
|
数据采集 人工智能 数据挖掘
盘点:5款简单好用的人事管理系统!
为大家介绍五款好用的人事管理系统,包括草料二维码人事管理系统,简道云等等。
|
数据可视化 搜索推荐 数据管理
CRM客户关系管理系统的主要功能
一套完整的CRM系统应能实现营销、销售、服务等业务的自动化,实现客户数据共享,达到提高客户满意度、降低成本、增加收人、开拓市场、帮助企业高层进行生产、营销等决策的目的。当然,面向不同的行业,不同的CRM厂商开发的产品具备差异性的功能,例如比较注重生命周期管理面向B2B行业的CRM,注重营销管理面向电商行业的营销型CRM等等,一般CRM系统都会拥有如下主要功能。
|
JSON 前端开发 JavaScript
|
监控 前端开发 搜索推荐
CRM客户关系管理系统有什么用?
CRM客户关系管理系统的功能包括客户管理、时间管理、联系人管理、销售管理、潜在客户管理、电话销售、电话营销、营销管理、客户服务等。
301 0
|
JavaScript Java 开发工具
基于SSM的医药进销存管理系统
基于SSM的医药进销存管理系统
121 0
基于SSM的医药进销存管理系统
|
存储 中间件
管理系统-ITclub(下)
管理系统-ITclub(下)
管理系统-ITclub(下)