Projek ini melaksanakan sistem pengurusan pembelian, jualan dan inventori berdasarkan springboot terutamanya menguruskan pembelian, jualan dan inventori barangan berkaitan yang dibuka oleh pengguna di kedai dalam talian agak lengkap dan mempunyai fungsi yang lengkap Sistem pengurusan kebenaran membolehkan anda mereka bentuk peranan dan menetapkan kebenaran mengikut keperluan anda. Perincian kebenaran boleh mencapai kawalan kebenaran peringkat halaman, yang sangat baik untuk keseluruhan projek. Fungsi utama yang dilaksanakan adalah seperti berikut:
Modul pengurusan asas: termasuk tiga sub-modul pengurusan pelanggan, pengurusan pembekal dan pengurusan produk
Modul pengurusan pembelian: termasuk pembelian produk, pemulangan dan pengurusan barangan Beberapa blok sub-cek untuk pertanyaan pemulangan
Pengurusan jualan: termasuk jualan produk, pemulangan dan beberapa blok sub-cek untuk pertanyaan pemulangan jualan
Pengurusan sistem: termasuk pengurusan jabatan, pengurusan menu , pengurusan pihak berkuasa, pengurusan peranan, Lima sub-modul pengurusan pengguna
Pengurusan lain: termasuk pertanyaan log log masuk, pengurusan pengumuman sistem, pengurusan ikon dan sub-modul lain
Pusat peribadi: termasuk peribadi pengurusan maklumat, pengubahsuaian kata laluan dan fungsi lain yang berkaitan
Persekitaran bahasa: Java: jdk1.8
Pangkalan data: Mysql: mysql5.7 / pangkalan data cache Redis
Pelayan aplikasi: Tomcat: tomcat8.5.31
Alat pembangunan: IDEA atau eclipse
Teknologi pembangunan belakang: Springboot+Mybatis-plus+Shiro
Depan -teknologi pembangunan akhir: Templat Bootstrap+Layui+Freemarker
Pentadbir super log masuk ke sistem: system/123456
Pengurusan asas —Pengurusan pelanggan
Pengurusan Asas—Pengurusan Pembekal
Pengurusan Asas—Komoditi . . 🎜>Pengurusan Sistem --- Pengurusan Jabatan
Pengurusan Sistem---Pengurusan Menu
Pengurusan Sistem-- -Pengurusan Kebenaran
Pengurusan Sistem---Pengurusan Peranan
Pengurusan Sistem---Pengurusan Pengguna
Pengurusan lain—Log log masuk
Pengurusan lain—Pengumuman sistem
4. Tunjukkan kod teras
package com.dev.shop.bus.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping("bus") public class BusinessController { /** * 跳转到客户管理页面 * @return */ @RequestMapping("toCustomerManager") public String toCustomerManager(){ return "business/customer/customerManager"; } /** * 跳转到供应商管理页面 * @return */ @RequestMapping("toProviderManager") public String toProviderManager(){ return "business/provider/providerManager"; } /** * 跳转到商品管理页面 * @return */ @RequestMapping("toGoodsManager") public String toGoodsManager(){ return "business/goods/goodsManager"; } /** * 跳转到进货管理页面 * @return */ @RequestMapping("toInportManager") public String toInportManager(){ return "business/inport/inportManager"; } /** * 跳转到退货管理页面 * @return */ @RequestMapping("toOutportManager") public String toOutportManager(){ return "business/outport/outportManager"; } /** * 跳转到商品销售管理页面 * @return */ @RequestMapping("toSalesManager") public String toSalesManager(){ return "business/sales/salesManager"; } /** * 跳转到商品销售管理页面 * @return */ @RequestMapping("toSalesbackManager") public String toSalesbackManager(){ return "business/salesback/salesbackManager"; } }
package com.dev.shop.bus.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.dev.shop.bus.entity.Customer; import com.dev.shop.bus.service.ICustomerService; import com.dev.shop.bus.vo.CustomerVo; import com.dev.shop.sys.common.Constast; import com.dev.shop.sys.common.DataGridView; import com.dev.shop.sys.common.ResultObj; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.List; @RestController @RequestMapping("/customer") public class CustomerController { @Autowired private ICustomerService customerService; /** * 查询所有的客户 * @param customerVo * @return */ @RequestMapping("loadAllCustomer") public DataGridView loadAllCustomer(CustomerVo customerVo){ //1.声明一个分页page对象 IPage<Customer> page = new Page(customerVo.getPage(),customerVo.getLimit()); //2.声明一个queryWrapper QueryWrapper<Customer> queryWrapper = new QueryWrapper(); queryWrapper.like(StringUtils.isNotBlank(customerVo.getCustomername()),"customername",customerVo.getCustomername()); queryWrapper.like(StringUtils.isNotBlank(customerVo.getConnectionpersion()),"connectionpersion",customerVo.getConnectionpersion()); queryWrapper.like(StringUtils.isNotBlank(customerVo.getPhone()),"phone",customerVo.getPhone()); customerService.page(page,queryWrapper); return new DataGridView(page.getTotal(),page.getRecords()); } /** * 添加一个客户 * @param customerVo * @return */ @RequestMapping("addCustomer") public ResultObj addCustomer(CustomerVo customerVo){ try { customerService.save(customerVo); return ResultObj.ADD_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.ADD_ERROR; } } /** * 修改一个客户 * @param customerVo * @return */ @RequestMapping("updateCustomer") public ResultObj updateCustomer(CustomerVo customerVo){ try { customerService.updateById(customerVo); return ResultObj.UPDATE_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.UPDATE_ERROR; } } /** * 删除一个客户 * @param id 客户的ID * @return */ @RequestMapping("deleteCustomer") public ResultObj deleteCustomer(Integer id){ try { customerService.removeById(id); return ResultObj.DELETE_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.DELETE_ERROR; } } /** * 批量删除客户 * @param customerVo 选中的客户 * @return */ @RequestMapping("batchDeleteCustomer") public ResultObj batchDeleteCustomer(CustomerVo customerVo){ try { Collection<Serializable> idList = new ArrayList<Serializable>(); for (Integer id : customerVo.getIds()) { idList.add(id); } customerService.removeByIds(idList); return ResultObj.DELETE_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.DELETE_ERROR; } } /** * 加载所有客户的下拉列表 * @return */ @RequestMapping("loadAllCustomerForSelect") public DataGridView loadAllCustomerForSelect(){ QueryWrapper<Customer> queryWrapper = new QueryWrapper<Customer>(); queryWrapper.eq("available", Constast.AVAILABLE_TRUE); List<Customer> list = customerService.list(queryWrapper); return new DataGridView(list); } }
package com.dev.shop.bus.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.dev.shop.bus.entity.Goods; import com.dev.shop.bus.entity.Provider; import com.dev.shop.bus.service.IGoodsService; import com.dev.shop.bus.service.IProviderService; import com.dev.shop.bus.vo.GoodsVo; import com.dev.shop.sys.common.AppFileUtils; import com.dev.shop.sys.common.Constast; import com.dev.shop.sys.common.DataGridView; import com.dev.shop.sys.common.ResultObj; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @RequestMapping("/goods") public class GoodsController { @Autowired private IGoodsService goodsService; @Autowired private IProviderService providerService; /** * 查询商品 * @param goodsVo * @return */ @RequestMapping("loadAllGoods") public DataGridView loadAllGoods(GoodsVo goodsVo){ IPage<Goods> page = new Page<>(goodsVo.getPage(),goodsVo.getLimit()); QueryWrapper<Goods> queryWrapper = new QueryWrapper(); queryWrapper.eq(goodsVo.getProviderid()!=null&&goodsVo.getProviderid()!=0,"providerid",goodsVo.getProviderid()); queryWrapper.like(StringUtils.isNotBlank(goodsVo.getGoodsname()),"goodsname",goodsVo.getGoodsname()); queryWrapper.like(StringUtils.isNotBlank(goodsVo.getProductcode()),"productcode",goodsVo.getProductcode()); queryWrapper.like(StringUtils.isNotBlank(goodsVo.getPromitcode()),"promitcode",goodsVo.getPromitcode()); queryWrapper.like(StringUtils.isNotBlank(goodsVo.getDescription()),"description",goodsVo.getDescription()); queryWrapper.like(StringUtils.isNotBlank(goodsVo.getSize()),"size",goodsVo.getSize()); queryWrapper.orderByDesc("id"); goodsService.page(page,queryWrapper); List<Goods> records = page.getRecords(); for (Goods goods : records) { Provider provider = providerService.getById(goods.getProviderid()); if (null!=provider){ goods.setProvidername(provider.getProvidername()); } } return new DataGridView(page.getTotal(),page.getRecords()); } /** * 添加商品 * @param goodsVo * @return */ @RequestMapping("addGoods") public ResultObj addGoods(GoodsVo goodsVo){ try { if (goodsVo.getGoodsimg()!=null&&goodsVo.getGoodsimg().endsWith("_temp")){ String newName = AppFileUtils.renameFile(goodsVo.getGoodsimg()); goodsVo.setGoodsimg(newName); } goodsService.save(goodsVo); return ResultObj.ADD_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.ADD_ERROR; } } /** * 修改商品 * @param goodsVo * @return */ @RequestMapping("updateGoods") public ResultObj updateGoods(GoodsVo goodsVo){ try { //商品图片不是默认图片 if (!(goodsVo.getGoodsimg()!=null&&goodsVo.getGoodsimg().equals(Constast.DEFAULT_IMG))){ if (goodsVo.getGoodsimg().endsWith("_temp")){ String newName = AppFileUtils.renameFile(goodsVo.getGoodsimg()); goodsVo.setGoodsimg(newName); //删除原先的图片 String oldPath = goodsService.getById(goodsVo.getId()).getGoodsimg(); AppFileUtils.removeFileByPath(oldPath); } } goodsService.updateById(goodsVo); return ResultObj.UPDATE_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.UPDATE_ERROR; } } /** * 删除商品 * @param id * @return */ @RequestMapping("deleteGoods") public ResultObj deleteGoods(Integer id,String goodsimg){ try { //删除商品的图片 AppFileUtils.removeFileByPath(goodsimg); goodsService.removeById(id); return ResultObj.DELETE_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.DELETE_ERROR; } } /** * 加载所有可用的商品 * @return */ @RequestMapping("loadAllGoodsForSelect") public DataGridView loadAllGoodsForSelect(){ QueryWrapper<Goods> queryWrapper = new QueryWrapper<Goods>(); queryWrapper.eq("available",Constast.AVAILABLE_TRUE); List<Goods> list = goodsService.list(queryWrapper); for (Goods goods : list) { Provider provider = providerService.getById(goods.getProviderid()); if (null!=provider){ goods.setProvidername(provider.getProvidername()); } } return new DataGridView(list); } /** * 根据供应商ID查询商品信息 * @param providerid 供应商ID * @return */ @RequestMapping("loadGoodsByProviderId") public DataGridView loadGoodsByProviderId(Integer providerid){ QueryWrapper<Goods> queryWrapper = new QueryWrapper<Goods>(); queryWrapper.eq("available",Constast.AVAILABLE_TRUE); queryWrapper.eq(providerid!=null,"providerid",providerid); List<Goods> list = goodsService.list(queryWrapper); for (Goods goods : list) { Provider provider = providerService.getById(goods.getProviderid()); if (null!=provider){ goods.setProvidername(provider.getProvidername()); } } return new DataGridView(list); } }
package com.dev.shop.bus.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import lombok.experimental.Accessors; import java.io.Serializable; @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("bus_customer") @ToString public class Customer implements Serializable { private static final long serialVersionUID=1L; @TableId(value = "id", type = IdType.AUTO) private Integer id; private String customername; private String zip; private String address; private String telephone; private String connectionpersion; private String phone; private String bank; private String account; private String email; private String fax; private Integer available; }
Atas ialah kandungan terperinci Bagaimana untuk melaksanakan sistem pengurusan pembelian, penjualan dan inventori komoditi berdasarkan Springboot. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!