宠物小程序系统
Copyright ©2024 www.javaclimb.com 版权所有 5/26/2023
有个小伙伴找到我开发一个系统,这次他要考验我的效率,第一次遇到这种条件的。
一周开发出来给2000,3天开发出来4000,一天开发出来给5000。
都这样说了,那我还拖什么?
系统完事后,和他商讨了一下,退他一部分费用,源码开源给大家了。方便的小伙伴,转发,在看支持下。你的支持,是我前进的动力,如果不方便,也没事,嘿嘿……
首先他的需求不是很很难,梳理了一遍感觉没啥问题了,直接开始干了。
那一天能不能完成 让我们拭目以待?
# 文章目录
- 一,技术选型: (opens new window)
- 二,原型设计: (opens new window)
- 三,软件下载安装、环境安装: (opens new window)
- 四,系统的演示: (opens new window)
- 五,核心代码演示 (opens new window)
- 六,系统源码获取 (opens new window)
# 一,技术选型:
# 二,原型设计 (opens new window):
对方没有UI要求,预算也低,这一步直接忽略,UI套用的我前面开发的。图片处理ps 搞下图标 图片什么的.
# 三,软件下载安装、环境安装:
软件下载的地址和安装的教程都整理的很详细,每当我换一台电脑的时候,直接进行下面的下载及安装,真的很快搞完,如下所示:
系统的下载也可以提供给大家。
# 四,系统的演示:
如果想看完整的视频演示,如下:
# 五,核心代码演示
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);
}
# 六,系统源码获取
关注下方公众号,回复宠物,干货分享不断!