一,技术选型:
二,原型设计:
对方没有UI要求,预算也低,这一步直接忽略,UI套用的我前面开发的。图片处理ps 搞下图标 图片什么的.
三,软件下载安装、环境安装:
软件下载的地址和安装的教程都整理的很详细,每当我换一台电脑的时候,直接进行下面的下载及安装,真的很快搞完,如下所示:
系统的下载也可以提供给大家。
四,系统的演示:
如果想看完整的视频演示,如下:
https://www.bilibili.com/video/BV1Y341177Qd?spm_id_from=333.999.0.0
五,核心代码演示
package com.example.bus.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; /** * 业务管理的路由器 * @author LJH * */ @Controller @RequestMapping("/bus") public class BusinessController { /** * 跳转到客户管理 */ @RequestMapping("toCustomerManager") public String toCustomerManager() { return "business/customer/customerManager"; } /** * 跳转到供应商管理 */ @RequestMapping("toProviderManager") public String toProviderManager() { return "business/provider/providerManager"; } /** * 跳转到商品管理 */ @RequestMapping("toGoodsManager") public String toGoodsManager() { return "business/goods/goodsManager"; } /** * 跳转到进货管理 */ @RequestMapping("toInportManager") public String toInportManager() { return "business/inport/inportManager"; } /** * 跳转到退货查询管理 */ @RequestMapping("toOutportManager") public String toOutportManager() { return "business/outport/outportManager"; } /** * 跳转到宠物资料管理 * * @return */ @RequestMapping("toPetInfoManager") public String toPetInfoManager() { return "business/pet/petManager"; } }
@RestController @RequestMapping("/customer") public class CustomerController { @Autowired private CustomerService customerService; /** * 查询 */ @RequestMapping("loadAllCustomer") public DataGridView loadAllCustomer(CustomerVo customerVo) { IPage<Customer> page = new Page<>(customerVo.getPage(), customerVo.getLimit()); QueryWrapper<Customer> queryWrapper = new QueryWrapper<>(); queryWrapper.like(StringUtils.isNotBlank(customerVo.getCustomername()), "customername", customerVo.getCustomername()); queryWrapper.like(StringUtils.isNotBlank(customerVo.getPhone()), "phone", customerVo.getPhone()); queryWrapper.like(StringUtils.isNotBlank(customerVo.getConnectionperson()), "connectionperson", customerVo.getConnectionperson()); this.customerService.page(page, queryWrapper); return new DataGridView(page.getTotal(), page.getRecords()); } /** * 添加 */ @RequestMapping("addCustomer") public ResultObj addCustomer(CustomerVo customerVo) { try { this.customerService.save(customerVo); return ResultObj.ADD_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.ADD_ERROR; } } /** * 修改 */ @RequestMapping("updateCustomer") public ResultObj updateCustomer(CustomerVo customerVo) { try { this.customerService.updateById(customerVo); return ResultObj.UPDATE_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.UPDATE_ERROR; } } /** * 删除 */ @RequestMapping("deleteCustomer") public ResultObj deleteCustomer(Integer id) { try { this.customerService.removeById(id); return ResultObj.DELETE_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.DELETE_ERROR; } } /** * 批量删除 */ @RequestMapping("batchDeleteCustomer") public ResultObj batchDeleteCustomer(CustomerVo customerVo) { try { Collection<Serializable> idList = new ArrayList<Serializable>(); for (Integer id : customerVo.getIds()) { idList.add(id); } this.customerService.removeByIds(idList); return ResultObj.DELETE_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.DELETE_ERROR; } }
@RestController @RequestMapping("/goods") public class GoodsController { @Autowired private GoodsService goodsService; @Autowired private ProviderService providerService; /** * 查询 */ @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()); this.goodsService.page(page, queryWrapper); List<Goods> records = page.getRecords(); for (Goods goods : records) { Provider provider = this.providerService.getById(goods.getProviderid()); if (null != provider) { goods.setProvidername(provider.getProvidername()); } } return new DataGridView(page.getTotal(), records); } /** * 添加 */ @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); } this.goodsService.save(goodsVo); return ResultObj.ADD_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.ADD_ERROR; } } /** * 修改 */ @RequestMapping("updateGoods") public ResultObj updateGoods(GoodsVo goodsVo) { try { //说明是不默认图片 if (!(goodsVo.getGoodsimg() != null && goodsVo.getGoodsimg().equals(Constant.IMAGES_DEFAULTGOODSIMG_PNG))) { if (goodsVo.getGoodsimg().endsWith("_temp")) { String newName = AppFileUtils.renameFile(goodsVo.getGoodsimg()); goodsVo.setGoodsimg(newName); //删除原先的图片 String oldPath = this.goodsService.getById(goodsVo.getId()).getGoodsimg(); AppFileUtils.removeFileByPath(oldPath); } } this.goodsService.updateById(goodsVo); return ResultObj.UPDATE_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.UPDATE_ERROR; } } /** * 删除 */ @RequestMapping("deleteGoods") public ResultObj deleteGoods(Integer id, String goodsimg) { try { //删除原文件 AppFileUtils.removeFileByPath(goodsimg); this.goodsService.removeById(id); return ResultObj.DELETE_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.DELETE_ERROR; } } /** * 加载所有可用的供应商 */ @RequestMapping("loadAllGoodsForSelect") public DataGridView loadAllGoodsForSelect() { QueryWrapper<Goods> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("available", Constant.AVAILABLE_TRUE); List<Goods> list = this.goodsService.list(queryWrapper); for (Goods goods : list) { Provider provider = this.providerService.getById(goods.getProviderid()); if (null != provider) { goods.setProvidername(provider.getProvidername()); } } return new DataGridView(list); }
六,系统源码获取
还是那句话,仅限制学习使用!
若发现偷盗者,以后我开源的就少了!而且会追究你的责任!