伴随着信息科技的高效发展与互联网技术的日益健全,大家越来越注重电商。图书交易小程序是电商的一个典型性代表。市场从之前的路边货市场变化到网络里,根据交易系统进行了交易。而图书交易小程序带来农户省时省力、省劲、划算的货品交易平台,它可使农户们灵活运用信息科技的优点去解决图书,越来越更加顺畅、便捷、便捷,能够满足用户快速地享受在线购物带来的生活。为后能比较方便地达到图书的合理利用,科学研究现阶段交易的发展状况,根据要求、可行性研究,设计方案完成一个图书交易小程序。
本系统主要是完成灵便、可扩展性强、客户交互方式好平台。 系统给予强悍的数据库管理、精确高效率的数据分析、迅速灵活多变的数据统计服务。 采用前端微信小程序技术,设计界面简约、易用性高、良好的人际交互体验; 采用后端SpringbBoot Mybatis等新技术,搭建便于管理方法、易上手、高安全系数、协调能力、可扩展性、高效率、动态性、互动式浏览数据库的管理系统; 完成形象化、科学、简单图书交易小程序。
关键字: 图书交易;微信小程序;SpringBoot;Mysql
基于springboot图书交易商城微信小程序源码和论文
演示视频:
基于springboot图书交易商城微信小程序源码和论文
With the efficient development of information technology and the increasingly sound Internet technology, people are paying more and more attention to e-commerce. Drug trading applet is a typical representative of e-commerce. The market has changed from the previous roadside goods market to the network, where transactions are conducted according to the trading system. The drug trading applet brings farmers a time-saving, labor-saving and cost-effective commodity trading platform. It enables farmers to flexibly use the advantages of information technology to solve drugs, which is more and more smooth, convenient and convenient, and can meet users' rapid enjoyment of the life brought by online shopping. In order to achieve the rational use of drugs more conveniently in the future, scientific research is made on the development of the current transaction, and a small drug transaction program is designed and completed according to the requirements and feasibility study.
This system is mainly a platform with convenient, strong scalability and good customer interaction. The system provides powerful database management, accurate and efficient data analysis, and fast and flexible data statistics services. The front-end WeChat applet technology is adopted to design a simple interface, high usability and good interpersonal interaction experience; New technologies such as SpringbBoot Mybatis on the back end are adopted to build a management system that is easy to manage, easy to use, high safety factor, coordination ability, scalability, high efficiency, dynamic and interactive to browse the database; Complete visualized, scientific and simple drug trading small procedures.
Keywords: drug transaction; WeChat applet; SpringBoot; Mysql
目 录
1 绪论
1.1 课题背景
图书商城,对国家经济的发展和鹏飞以及对人类社会的文明带来了巨大影响。图书行业已成为许多国家的支柱产业,随着人们生活水平以及图书性能的不断提高,人们对图书的消费和需求也越来越旺盛,世界图书行业也保持庞大的市场需求和市场规模。近年来,中国图书市场发展迅猛,以接近 37%的速度增长,巨大的市场容量和可观的经济效益,引起各图书厂家纷纷加大投资,图书市场烽烟四起,图书销售策略和模式频出,竞争已是空前的激烈,在此形势下,一种介于生产厂家和用户之间的桥梁,图书销售公司正在不断的产生和发展壮大。
通过网络进行图书销售,是这个时代发展的必然结果,是随着网络的普及和电子商务概念的兴盛而兴起的。这种全新出现的新型图书销售形式,与传统通过图书店面进行销售的方式相比优势显著: 1,降低了图书销售成本;2,改变图书传统的了解和购买方式,使用网络平台了解图书信息并购买,使得商业活动没有空间和时间的限制;3,图书信息的传递更有效率和直观,新车信息上传后,人们可以立即了解咨询,交易可以马上进行,从而大大提高了图书交易的效率。正是由于这些巨大的优势,图书销售平台才能得以迅速地开拓市场。图书销售平台的主要是借助平台作为交易平台,将图书的各项指标,优势劣势,精美图片以发布到网络中,人们能够借助网络登录图书销售平台来查看各种图书的信息并提交订单订购或者预定图书,实现在线交易。开发之前需要做好详细的系统架构,这种系统架构内容包括了市场需求分析,平台前端设计,后台设计,技术可行性分析,框架组合分析等 。
1.2 课题目的及意义
图书销售信息管理,是企业管理图书销售的一个不可缺少的平台。在以往,传统的信息管理方式主要以人为主体,人们投入大量时间和精力去操作, 存在着管理上的局限性、主观性和片面性,人为的管理手段已经无法适应互联网时代的发展,这种方法无疑是在浪费大量的人力和财力,而在信息高速发达的时代, 主要是以计算机为处理手段。本系统将取代传统的手动操作管理,实现人和计算机的完美结合,充分发挥人和机器的特长,能对图书销售信息的数据进行收集、记录、统计和导出的系统。灵活和可配置地为管理人员提供直观可视化、科学化和简约化管理。本系统的开发能一定程度上提高企业工作效率,能够比较全面、准确地掌握企业图书销售的信息并进行统计、查询和管理。建立现代化图书销售信息管理体制,统一化、规范化和流程化企业各部门之间的业务流程,实现各部门协调合作、无纸办公。
1.3 课题研究内容
由于规模的局限性,相对跨国公司或是大规模集团公司,图书销售管理系统无需大容量的数据库存储。所要求实现功能是针对特征的图书销售管理工作。当有需求变化时,能够高效率地根据需求更新系统功能。切实有针对地协助图书销售管理人员的工作,使得在图书销售信息管理上更加高效,并保证其变成发展进步的核心动力。
本文利用SpringBoot与微信小程序技术,基于B/S模式设计实现了图书销售网上商城平台,具体工作内容如下:
- 分析阶段,采用面向对象的设计方法进行分析设计,从可行性分析入手, 再从用户的功能需求、非功能需求、系统性能需求与安全需求等几方面进行需求分析,挖掘出用户的真正需求。图书销售管理工作需求不仅涉及到图书销售部门,还 需要挖掘普通用户的实际需求。
- 设计阶段,图书销售网上商城设计工作分为系统功能设计、系统数据库设计两方面。在用户需求分析的基础上,完成用户用例分析,设计系统开发所必须 的各种模型,包括系统开发环境的设计、网络结构设计等内容。在功能上设计 网上商城的功能模块,完成了功能模块流程图的设计。在数据库的设计过程中,设计网上商城的实体关系图,设计出相应的数据库表逻辑结构。
- 实现阶段,系统实现分为程序代码实现和系统界面实现两部分。在编程 过程中,使用IDE开发工具,根据系统设计阶段设计的功能,进行相应功能的 实现。在系统界面实现过程中,运用IDE开发工具提供的标准化页面组件,设 计出系统功能界面。最后将信息系统分别部署到Web服务器和数据库服务器上。
- 测试阶段,针对各个功能模块编写测试用例,采用黑盒测试的方法,完 成对系统软件测试工作。
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils;
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.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
* 通用接口
*/
@RestController
public class CommonController{
@Autowired
private CommonService commonService;
@Autowired
private ConfigService configService;
private static AipFace client = null;
private static String BAIDU_DITU_AK = null;
@RequestMapping("/location")
public R location(String lng,String lat) {
if(BAIDU_DITU_AK==null) {
BAIDU_DITU_AK = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")).getValue();
if(BAIDU_DITU_AK==null) {
return R.error("请在配置管理中正确配置baidu_ditu_ak");
}
}
Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);
return R.ok().put("data", map);
}
/**
* 人脸比对
*
* @param face1 人脸1
* @param face2 人脸2
* @return
*/
@RequestMapping("/matchFace")
public R matchFace(String face1, String face2,HttpServletRequest request) {
if(client==null) {
/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
String token = BaiduUtil.getAuth(APIKey, SecretKey);
if(token==null) {
return R.error("请在配置管理中正确配置APIKey和SecretKey");
}
client = new AipFace(null, APIKey, SecretKey);
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
}
JSONObject res = null;
try {
File file1 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face1);
File file2 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face2);
String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
MatchRequest req1 = new MatchRequest(img1, "BASE64");
MatchRequest req2 = new MatchRequest(img2, "BASE64");
ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
requests.add(req1);
requests.add(req2);
res = client.match(requests);
System.out.println(res.get("result"));
} catch (FileNotFoundException e) {
e.printStackTrace();
return R.error("文件不存在");
} catch (IOException e) {
e.printStackTrace();
}
return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
}
/**
* 获取table表中的column列表(联动接口)
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/option/{tableName}/{columnName}")
public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
if(StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if(StringUtils.isNotBlank(parent)) {
params.put("parent", parent);
}
List<String> data = commonService.getOption(params);
return R.ok().put("data", data);
}
/**
* 根据table中的column获取单条记录
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/follow/{tableName}/{columnName}")
public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
params.put("columnValue", columnValue);
Map<String, Object> result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
* 修改table表的sfsh状态
* @param table
* @param map
* @return
*/
@RequestMapping("/sh/{tableName}")
public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
map.put("table", tableName);
commonService.sh(map);
return R.ok();
}
/**
* 获取需要提醒的记录数
* @param tableName
* @param columnName
* @param type 1:数字 2:日期
* @param map
* @return
*/
@IgnoreAuth
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("table", tableName);
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));
}
}
int count = commonService.remindCount(map);
return R.ok().put("count", count);
}
/**
* 单列求和
*/
@IgnoreAuth
@RequestMapping("/cal/{tableName}/{columnName}")
public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
Map<String, Object> result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
* 分组统计
*/
@IgnoreAuth
@RequestMapping("/group/{tableName}/{columnName}")
public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
List<Map<String, Object>> result = commonService.selectGroup(params);
return R.ok().put("data", result);
}
/**
* (按值统计)
*/
@IgnoreAuth
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
List<Map<String, Object>> result = commonService.selectValue(params);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
}