首页 > 分享 > 基于微信小程序实现网上花店

基于微信小程序实现网上花店

 作者简介:Java领域优质创作者、CSDN博客专家 、CSDN内容合伙人、掘金特邀作者、阿里云博客专家、51CTO特邀作者、多年架构师设计经验、多年校企合作经验,被多个学校常年聘为校外企业导师,指导学生毕业设计并参与学生毕业答辩指导,有较为丰富的相关经验。期待与各位高校教师、企业讲师以及同行交流合作

主要内容:Java项目、Python项目、前端项目、PHP、ASP.NET、人工智能与大数据、单片机开发、物联网设计与开发设计、简历模板、学习资料、面试题库、技术互助、就业指导等

业务范围:免费功能设计、开题报告、任务书、中期检查PPT、系统功能实现、代码编写、论文编写和辅导、论文降重、长期答辩答疑辅导、腾讯会议一对一专业讲解辅导答辩、模拟答辩演练、和理解代码逻辑思路等

收藏点赞不迷路  关注作者有好处

文末获取源码 

项目编号:BS-XCX-084

一,环境介绍

语言环境:微信小程序

数据库:Mysql: mysql5.7

WEB框架:SpringBoot+Vue

开发工具:IDEA和微信开发者工具

二,项目简介

传统信息的管理大部分依赖于管理人员的手工登记与管理,然而,随着近些年信息技术的迅猛发展,让许多比较老套的信息管理模式进行了更新迭代,鲜花信息因为其管理内容繁杂,管理数量繁多导致手工进行处理不能满足广大用户的需求,因此就应运而生出相应的网上花店微信小程序。

本网上花店微信小程序分为管理员还有用户两个权限,管理员可以管理用户的基本信息内容,可以管理公告信息以及鲜花信息,能够与用户进行相互交流等操作,用户可以查看鲜花信息,可以查看公告以及查看管理员回复信息等操作。

该网上花店微信小程序采用的是WEB应用程序开发中最受欢迎的小程序结构模式,使用占用空间小但功能齐全的MySQL数据库进行数据的存储操作,系统开发技术使用到了Vue技术。后台采用Springboot框架开发、整体来说该网上花店微信小程序能够解决许多传统手工操作的难题,比如数据查询耽误时间长,数据管理步骤繁琐等问题。总的来说,网上花店微信小程序性能稳定,功能较全,投入运行使用性价比很高。

系统的开发离不开前期的需求分析,这个阶段就是让程序员知道自己该做什么事情,在进行需求分析的时候,着重点就是用户对系统的功能要求,这个阶段要是分析得很到位,系统开发出来投入使用时,用户就会发现系统的功能跟用户需求保持一致,程序稳定性也是达标的,可以说需求分析是决定系统开发成败的关键,它主要就是把现实世界进行抽象化,然后把抽象化的对象用来构建模型。

网上花店微信小程序的受益群体主要是工作人员,该网站能够方便使用者进行数据信息的查找和管理工作,本次开发的网站我们设计的界面展示主要分为管理员界面以及用户界面,具体界面的功能分布如下。

网上花店微信小程序管理员可以管理用户的基本信息,可以管理公告信息,可以管理公告信息等。

三,系统展示

后台管理系统

四,核心代码展示

package com.controller;

import java.io.File;

import java.math.BigDecimal;

import java.net.URL;

import java.text.SimpleDateFormat;

import com.alibaba.fastjson.JSONObject;

import java.util.*;

import org.springframework.beans.BeanUtils;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.ContextLoader;

import javax.servlet.ServletContext;

import com.service.TokenService;

import com.utils.*;

import java.lang.reflect.InvocationTargetException;

import com.service.DictionaryService;

import org.apache.commons.lang3.StringUtils;

import com.annotation.IgnoreAuth;

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.*;

import com.baomidou.mybatisplus.mapper.EntityWrapper;

import com.baomidou.mybatisplus.mapper.Wrapper;

import com.entity.*;

import com.entity.view.*;

import com.service.*;

import com.utils.PageUtils;

import com.utils.R;

import com.alibaba.fastjson.*;

@RestController

@Controller

@RequestMapping("/forum")

public class ForumController {

private static final Logger logger = LoggerFactory.getLogger(ForumController.class);

private static final String TABLE_NAME = "forum";

@Autowired

private ForumService forumService;

@Autowired

private TokenService tokenService;

@Autowired

private AddressService addressService;

@Autowired

private CartService cartService;

@Autowired

private ChatService chatService;

@Autowired

private DictionaryService dictionaryService;

@Autowired

private GonggaoService gonggaoService;

@Autowired

private XianhuaService xianhuaService;

@Autowired

private XianhuaCollectionService xianhuaCollectionService;

@Autowired

private XianhuaCommentbackService xianhuaCommentbackService;

@Autowired

private XianhuaOrderService xianhuaOrderService;

@Autowired

private YonghuService yonghuService;

@Autowired

private UsersService usersService;

@RequestMapping("/page")

public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){

logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

CommonUtil.checkMap(params);

PageUtils page = forumService.queryPage(params);

List<ForumView> list =(List<ForumView>)page.getList();

for(ForumView c:list){

dictionaryService.dictionaryConvert(c, request);

}

return R.ok().put("data", page);

}

@RequestMapping("/info/{id}")

public R info(@PathVariable("id") Long id, HttpServletRequest request){

logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);

ForumEntity forum = forumService.selectById(id);

if(forum !=null){

ForumView view = new ForumView();

BeanUtils.copyProperties( forum , view );

YonghuEntity yonghu = yonghuService.selectById(forum.getYonghuId());

if(yonghu != null){

BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yonghuId"

, "usersId"});

view.setYonghuId(yonghu.getId());

}

UsersEntity users = usersService.selectById(forum.getUsersId());

if(users != null){

view.setUsersId(users.getId());

view.setUusername(users.getUsername());

view.setUpassword(users.getPassword());

view.setUrole(users.getRole());

view.setUaddtime(users.getAddtime());

}

dictionaryService.dictionaryConvert(view, request);

return R.ok().put("data", view);

}else {

return R.error(511,"查不到数据");

}

}

@RequestMapping("/save")

public R save(@RequestBody ForumEntity forum, HttpServletRequest request){

logger.debug("save方法:,,Controller:{},,forum:{}",this.getClass().getName(),forum.toString());

String role = String.valueOf(request.getSession().getAttribute("role"));

if(false)

return R.error(511,"永远不会进入");

else if("用户".equals(role))

forum.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

else if("管理员".equals(role))

forum.setUsersId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>()

.eq("forum_name", forum.getForumName())

.eq("yonghu_id", forum.getYonghuId())

.eq("users_id", forum.getUsersId())

.eq("super_ids", forum.getSuperIds())

.eq("forum_types", forum.getForumTypes())

.eq("forum_state_types", forum.getForumStateTypes())

;

logger.info("sql语句:"+queryWrapper.getSqlSegment());

ForumEntity forumEntity = forumService.selectOne(queryWrapper);

if(forumEntity==null){

forum.setInsertTime(new Date());

forum.setCreateTime(new Date());

forumService.insert(forum);

return R.ok();

}else {

return R.error(511,"表中有相同数据");

}

}

@RequestMapping("/update")

public R update(@RequestBody ForumEntity forum, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {

logger.debug("update方法:,,Controller:{},,forum:{}",this.getClass().getName(),forum.toString());

ForumEntity oldForumEntity = forumService.selectById(forum.getId());

String role = String.valueOf(request.getSession().getAttribute("role"));

if("".equals(forum.getForumContent()) || "null".equals(forum.getForumContent())){

forum.setForumContent(null);

}

forum.setUpdateTime(new Date());

forumService.updateById(forum);

return R.ok();

}

@RequestMapping("/delete")

public R delete(@RequestBody Integer[] ids, HttpServletRequest request){

logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());

List<ForumEntity> oldForumList =forumService.selectBatchIds(Arrays.asList(ids));

forumService.deleteBatchIds(Arrays.asList(ids));

return R.ok();

}

@RequestMapping("/batchInsert")

public R save( String fileName, HttpServletRequest request){

logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);

Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

try {

List<ForumEntity> forumList = new ArrayList<>();

Map<String, List<String>> seachFields= new HashMap<>();

Date date = new Date();

int lastIndexOf = fileName.lastIndexOf(".");

if(lastIndexOf == -1){

return R.error(511,"该文件没有后缀");

}else{

String suffix = fileName.substring(lastIndexOf);

if(!".xls".equals(suffix)){

return R.error(511,"只支持后缀为xls的excel文件");

}else{

URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);

File file = new File(resource.getFile());

if(!file.exists()){

return R.error(511,"找不到上传文件,请联系管理员");

}else{

List<List<String>> dataList = PoiUtil.poiImport(file.getPath());

dataList.remove(0);

for(List<String> data:dataList){

ForumEntity forumEntity = new ForumEntity();

forumList.add(forumEntity);

}

forumService.insertBatch(forumList);

return R.ok();

}

}

}

}catch (Exception e){

e.printStackTrace();

return R.error(511,"批量插入数据异常,请联系管理员");

}

}

@IgnoreAuth

@RequestMapping("/list")

public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){

logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

CommonUtil.checkMap(params);

PageUtils page = forumService.queryPage(params);

List<ForumView> list =(List<ForumView>)page.getList();

for(ForumView c:list)

dictionaryService.dictionaryConvert(c, request);

return R.ok().put("data", page);

}

@RequestMapping("/detail/{id}")

public R detail(@PathVariable("id") Integer id, HttpServletRequest request){

logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);

ForumEntity forum = forumService.selectById(id);

if(forum !=null){

ForumView view = new ForumView();

BeanUtils.copyProperties( forum , view );

YonghuEntity yonghu = yonghuService.selectById(forum.getYonghuId());

if(yonghu != null){

BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yonghuId"

, "usersId"});

view.setYonghuId(yonghu.getId());

}

UsersEntity users = usersService.selectById(forum.getUsersId());

if(users != null){

view.setUsersId(users.getId());

view.setUusername(users.getUsername());

view.setUpassword(users.getPassword());

view.setUrole(users.getRole());

view.setUaddtime(users.getAddtime());

}

dictionaryService.dictionaryConvert(view, request);

return R.ok().put("data", view);

}else {

return R.error(511,"查不到数据");

}

}

@RequestMapping("/add")

public R add(@RequestBody ForumEntity forum, HttpServletRequest request){

logger.debug("add方法:,,Controller:{},,forum:{}",this.getClass().getName(),forum.toString());

Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>()

.eq("forum_name", forum.getForumName())

.eq("yonghu_id", forum.getYonghuId())

.eq("users_id", forum.getUsersId())

.eq("super_ids", forum.getSuperIds())

.eq("forum_types", forum.getForumTypes())

.eq("forum_state_types", forum.getForumStateTypes())

;

logger.info("sql语句:"+queryWrapper.getSqlSegment());

ForumEntity forumEntity = forumService.selectOne(queryWrapper);

if(forumEntity==null){

forum.setInsertTime(new Date());

forum.setCreateTime(new Date());

forumService.insert(forum);

return R.ok();

}else {

return R.error(511,"表中有相同数据");

}

}

}

五,相关作品展示

基于Java开发、Python开发、PHP开发、C#开发等相关语言开发的实战项目

基于Nodejs、Vue等前端技术开发的前端实战项目

基于微信小程序和安卓APP应用开发的相关作品

基于51单片机等嵌入式物联网开发应用

基于各类算法实现的AI智能应用

基于大数据实现的各类数据管理和推荐系统

 

 

相关知识

【全网首发】基于微信小程序的网上花店系统 鲜花销售小程序
[花店]网上花店微信小程序的设计与实现
基于微信小程序的网上花店售卖系统
基于微信小程序的校园鲜花销售系统
【微信小程序开发实战项目】——如何制作一个属于自己的花店微信小程序(2)
鲜花花店微信小程序—鲜花预定
三明大田花店微信小程序怎么做?
基于uniapp微信小程序的摄影街拍圈子交流平台
精品Nodejs实现的微信小程序的科学养花系统的设计与实现
同城鲜花配送微信小程序云开发解决方案

网址: 基于微信小程序实现网上花店 https://m.huajiangbk.com/newsview559678.html

所属分类:花卉
上一篇: asp.net1014
下一篇: Django计算机毕业设计网上鲜