项目介绍
随着互联网技术和通讯技术的快速发展、成熟,两者最终结合到了一起,即移动互联网。移动互联网时代的到来,微信的普及,致使基于微信小程序的系统越来越多,因此,针对用户手机微信购买小说书籍方面的需求,特开发了本微信小程序小说实体书商城。
本微信小程序小说实体书商城采用微信开发者工具、MYSQL数据库,基于微信平台设计开发。微信小程序小说实体书商城主要实现了用户功能模块和管理员功能模块两大部分,用户通过微信平台可进行查询小说、购买小说等,管理员可通过系统后台可对系统进行全面管理。该微信小程序小说实体书商城具有操作简单,界面清晰,管理方便,功能完善等优势,具有很高的使用价值。
“操作简单,功能实用”这是本软件设计的核心理念,本系统力求创造最好的用户体验。
开发环境
编程语言:Java
数据库 :Mysql
系统架构:B/S
后端框架:SSM
编译工具:idea或者eclipse,微信开发者工具,jdk1.8,maven
支持定做:java/php/python/android/小程序vue/爬虫/c#/asp.net
系统实现
5.1用户功能模块的实现
5.1.1用户注册登录界面
没有账号的用户可进行注册操作,注册后可进入登录界面进行登录系统,用户注册登录界面展示如图5-1所示。
图5-1 用户注册登录界面图
5.1.2首页界面
用户登录后进入系统首页,可查看系统信息,首页界面展示如图5-2所示。
图5-2 首页界面图
5.1.3小说信息界面
用户在小说信息界面可查看所有小说信息,并可选择查看详情,小说信息界面如图5-3所示。
图5-3 小说信息界面图
5.1.4购物车界面
用户在购物车界面可查看购物车小说信息,并可进行修改数量或者提交订单等,购物车界面如图5-4所示。
图5-4 购物车界面图
5.1.5我的订单界面
用户可进入我的订单界面查看个人订单信息,我的订单界面展示如图5-5所示。
图5-5 我的订单界面图
5.2管理员模块的实现
5.2.1管理员登录界面
管理员要想进入系统后台进行管理操作,必须登录系统后台,管理员登录界面展示如图5-6所示。
图5-6 管理员登录界面图
5.2.2小说信息管理界面
管理员在小说信息管理界面可查看已有小说信息,对已有小说信息,管理员可进行编辑和删除操作,同时管理员也可添加新的小说信息,小说信息管理界面展示如图5-7所示。添加小说信息界面如图5-8所示。
图5-7 小说信息管理界面图
图5-8添加小说信息界面图
5.2.3用户管理界面
管理员可增删改查用户信息,用户管理界面展示如图5-9所示。
图5-9 用户管理界面图
5.2.4订单管理界面
管理员在订单管理界面可查看所有订单信息,并可对其进行发货操作,订单管理界面展示如图5-11所示。
图5-11 订单管理界面图
5.2.5小说分类管理界面
管理员可添加、修改和删除小说分类信息,小说分类管理界面展示如图5-12所示。
图5-12 小说分类管理界面图
核心代码
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.XiaoshuoxinxiEntity;
import com.entity.view.XiaoshuoxinxiView;
import com.service.XiaoshuoxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 小说信息
* 后端接口
* @author
* @email
* @date
*/
@RestController
@RequestMapping("/xiaoshuoxinxi")
public class XiaoshuoxinxiController {
@Autowired
private XiaoshuoxinxiService xiaoshuoxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,XiaoshuoxinxiEntity xiaoshuoxinxi,
HttpServletRequest request){
EntityWrapper<XiaoshuoxinxiEntity> ew = new EntityWrapper<XiaoshuoxinxiEntity>();
PageUtils page = xiaoshuoxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xiaoshuoxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,XiaoshuoxinxiEntity xiaoshuoxinxi, HttpServletRequest request){
EntityWrapper<XiaoshuoxinxiEntity> ew = new EntityWrapper<XiaoshuoxinxiEntity>();
PageUtils page = xiaoshuoxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xiaoshuoxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( XiaoshuoxinxiEntity xiaoshuoxinxi){
EntityWrapper<XiaoshuoxinxiEntity> ew = new EntityWrapper<XiaoshuoxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( xiaoshuoxinxi, "xiaoshuoxinxi"));
return R.ok().put("data", xiaoshuoxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(XiaoshuoxinxiEntity xiaoshuoxinxi){
EntityWrapper< XiaoshuoxinxiEntity> ew = new EntityWrapper< XiaoshuoxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( xiaoshuoxinxi, "xiaoshuoxinxi"));
XiaoshuoxinxiView xiaoshuoxinxiView = xiaoshuoxinxiService.selectView(ew);
return R.ok("查询小说信息成功").put("data", xiaoshuoxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
XiaoshuoxinxiEntity xiaoshuoxinxi = xiaoshuoxinxiService.selectById(id);
xiaoshuoxinxi.setClicknum(xiaoshuoxinxi.getClicknum()+1);
xiaoshuoxinxi.setClicktime(new Date());
xiaoshuoxinxiService.updateById(xiaoshuoxinxi);
return R.ok().put("data", xiaoshuoxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
XiaoshuoxinxiEntity xiaoshuoxinxi = xiaoshuoxinxiService.selectById(id);
xiaoshuoxinxi.setClicknum(xiaoshuoxinxi.getClicknum()+1);
xiaoshuoxinxi.setClicktime(new Date());
xiaoshuoxinxiService.updateById(xiaoshuoxinxi);
return R.ok().put("data", xiaoshuoxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XiaoshuoxinxiEntity xiaoshuoxinxi, HttpServletRequest request){
xiaoshuoxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xiaoshuoxinxi);
xiaoshuoxinxiService.insert(xiaoshuoxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody XiaoshuoxinxiEntity xiaoshuoxinxi, HttpServletRequest request){
xiaoshuoxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xiaoshuoxinxi);
xiaoshuoxinxiService.insert(xiaoshuoxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody XiaoshuoxinxiEntity xiaoshuoxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(xiaoshuoxinxi);
xiaoshuoxinxiService.updateById(xiaoshuoxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
xiaoshuoxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<XiaoshuoxinxiEntity> wrapper = new EntityWrapper<XiaoshuoxinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = xiaoshuoxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,XiaoshuoxinxiEntity xiaoshuoxinxi, HttpServletRequest request,String pre){
EntityWrapper<XiaoshuoxinxiEntity> ew = new EntityWrapper<XiaoshuoxinxiEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicknum");
params.put("order", "desc");
PageUtils page = xiaoshuoxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xiaoshuoxinxi), params), params));
return R.ok().put("data", page);
}
}
论文参考
目 录
1 绪 论 1
1.1研究背景 1
1.2研究目标 1
1.3研究内容 2
2系统关键技术 3
2.1 微信小程序 3
2.2 微信Web开发者工具 3
2.3 微信小程序API接口 3
2.4 WXML 、WXS、JS小程序编写语言 4
2.5 MYSQL数据库 4
3系统分析 5
3.1可行性分析 5
3.1.1 技术可行性 5
3.1.2经济可行性 5
3.1.3操作可行性 5
3.1.4法律可行性 6
3.2系统性能分析 6
3.3 系统体验需求分析 6
3.4 系统功能分析 7
3.5系统流程分析 8
3.5.1 登录流程 8
3.5.2注册流程 9
4系统设计 10
4.1系统结构设计 10
4.2系统顺序图 10
4.2.1登录模块顺序图 10
4.2.2添加信息模块顺序图 11
4.3系统数据库设计 11
4.3.1数据库E-R图设计 12
4.3.3数据库表设计 13
5 系统的实现 16
5.1用户功能模块的实现 16
5.1.1用户注册登录界面 16
5.1.2首页界面 16
5.1.3小说信息界面 17
5.1.4购物车界面 18
5.1.5我的订单界面 19
5.2管理员模块的实现 20
5.2.1管理员登录界面 20
5.2.2小说信息管理界面 21
5.2.3用户管理界面 22
5.2.4订单管理界面 22
5.2.5小说分类管理界面 23
6系统测试 24
6.1测试定义 24
6.2测试方案 24
6.3测试项目 25
6.4测试目的及特性 26
6.5测试结论 26
结 论 27
参 考 文 献 28
谢 辞 29