1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > 基于微信小程序的校园外卖订餐个性化推荐系统

基于微信小程序的校园外卖订餐个性化推荐系统

时间:2021-10-15 00:21:50

相关推荐

基于微信小程序的校园外卖订餐个性化推荐系统

目 录

前言 1

1绪论 2

1.1课题背景及意义 2

1.2课题研究现状 2

1.3课题主要研究内容 3

2课题开发相关技术 4

2.1系统开发模式 4

2.2 JSP开发技术 4

2.3 MySQL数据库 6

2.4 小程序 6

2.5 个性化推荐技术 7

3系统分析与总体设计 9

3.1系统可行性分析 9

3.2系统功能需求分析 9

3.3系统总体设计 9

3.3.1总体设计原则 9

3.3.2系统流程设计 10

4系统详细设计与实现 12

4.1系统功能结构设计 12

4.2系统数据库设计 12

4.3小程序端 14

4.3.1注册登录模块 14

4.3.2首页餐厅列表模块 15

4.3.3点餐模块 17

4.4后台管理端 19

4.4.1管理员登录模块 19

4.4.2菜品管理模块 19

5结论 21

参考文献 22

附录 23

致谢 37

3系统分析与总体设计

3.1系统可行性分析

(1)技术可行性:开发这套临沂大学外卖排名推荐助手小程序架构基于微信+Java+SSM+HTML技术来实现;以微信小程序开发者工具进行开发,采用MySQL数据库来储存平台系统数据,使用最经典的协同过滤算法来推荐排名,以上的小程序和网站开发组合已被大量的小程序应用所证明,运行稳定可靠,可作为校园外卖排名运算推荐的开发技术,因此技术上可行。

(2)经济可行性:微信小程序是集合在微信上的功能,所以并不需要安装或者是下载,只需要人力物力的投入,时间上也合适,不需要很多额外支出,后期可以通过推广商铺来收取一定的利益,因此具有经济可行性。

(3)操作可行性:本系统实现了用户与数据库的互动,界面简单友好,操作方便。能够为用户提供更加具体的商铺数据。与此同时对于许多客户来说,微信小程序不占用手机的内存,而且也不受手机系统的限制,可以使用起来特别的快捷,具有操作可行性。

(4)法律可行性:本文转载自http://www.biyezuopin.vip/onews.asp?id=13856是合法的研究方向课题,符合法律要求。

系统可行性分析从技术可行性、经济可行性、运行可行性以及法律可行性等方面分析。

3.2系统功能需求分析

课题设计校园外卖个性化推荐系统包括小程序端和后台管理端两个部分,小程序注册用户和商家用户可餐厅列表、购物车订单及个人中心等,后台管理端可对菜品信息、菜品类别信息、优惠资讯管理、订单管理、统计及用户管理等。

4系统详细设计与实现

4.1系统功能结构设计

课题设计校园外卖个性化推荐系统包括小程序端和后台管理端两个部分,小程序注册用户和商家用户可餐厅列表、购物车订单及个人中心等,后台管理端可对菜品信息、菜品类别信息、优惠资讯管理、订单管理、统计及用户管理等。

其系统结构图如4-1图所示。

图4-1 系统功能结构图

Fig. 4-1 System function structure diagram

package com.ideabobo;import org.mybatis.generator.api.MyBatisGenerator;import org.mybatis.generator.config.Configuration;import org.mybatis.generator.config.xml.ConfigurationParser;import org.mybatis.generator.exception.InvalidConfigurationException;import org.mybatis.generator.exception.XMLParserException;import org.mybatis.generator.internal.DefaultShellCallback;import com.alibaba.fastjson.JSON;import com.mon;import com.mysql.jdbc.Connection;import com.mysql.jdbc.DatabaseMetaData;import java.io.File;import java.io.IOException;import java.io.InputStream;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.util.ArrayList;import java.util.List;/*** @Describe* @Author Corey* @Date /7/12.*/public class StartGenerator {public static void main(String[] args) {createMappingTables();List<String> warnings = new ArrayList<String>();boolean overwrite = true;String genCfg = "/generatorConfig.xml";File configFile = new File(StartGenerator.class.getResource(genCfg).getFile());ConfigurationParser cp = new ConfigurationParser(warnings);Configuration config = null;try {config = cp.parseConfiguration(configFile);} catch (IOException e) {e.printStackTrace();} catch (XMLParserException e) {e.printStackTrace();}DefaultShellCallback callback = new DefaultShellCallback(overwrite);MyBatisGenerator myBatisGenerator = null;try {myBatisGenerator = new MyBatisGenerator(config, callback, warnings);} catch (InvalidConfigurationException e) {e.printStackTrace();}try {myBatisGenerator.generate(null);} catch (SQLException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();} catch (InterruptedException e) {e.printStackTrace();}}public static void createMappingTables() {Connection con = null;try {// 使用properties对象加载输入流// 获取key对应的value值String driver = Common.getProperty("spring.datasource.driver-class-name");// "com.mysql.jdbc.Driver";String url = Common.getProperty("spring.datasource.url");// "jdbc:mysql://localhost:3306/samp_db";String username = Common.getProperty("spring.datasource.username"); // "root";String password = Common.getProperty("spring.datasource.password");// "";Class.forName(driver); // classLoader,加载对应驱动con = (Connection) DriverManager.getConnection(url, username,password);} catch (Exception e) {e.printStackTrace();}try {DatabaseMetaData meta = (DatabaseMetaData) con.getMetaData();ResultSet rs = meta.getTables(null, null, null,new String[] {"TABLE" });ArrayList<String> tables = new ArrayList<>();while (rs.next()) {String tableName = rs.getString(3);tables.add(tableName);System.out.println("表名:" + rs.getString(3));//System.out.println("表所属用户名:" + rs.getString(2));System.out.println("------------------------------");}con.close();String filePackage = Common.getProperty("tablemappingpackage");String servicePackage = Common.getProperty("servicemappingpackage").replaceAll("\\.", "\\\\")+"\\";String packagePath = System.getProperty("user.dir")+"\\src\\main\\java\\"+filePackage.replaceAll("\\.", "\\\\")+"\\";String servicePackagePath = System.getProperty("user.dir")+"\\src\\main\\java\\"+servicePackage;String cfilepath = "Dbtablemapping.java";String path = packagePath+cfilepath;File file = new File(path);File packageDir = new File(packagePath);File serviceDir = new File(servicePackagePath);if(packageDir.exists()){if(packageDir.isDirectory()){File[] modelFiles = packageDir.listFiles();for(File mfile:modelFiles){if(mfile.getName().equals("Dbtablemapping.java")||mfile.getName().equals("Dbservice.java")){continue;}else{mfile.delete();}}}}if(serviceDir.exists()){if(serviceDir.isDirectory()){File[] modelFiles = serviceDir.listFiles();for(File mfile:modelFiles){if(mfile.getName().equals("DatabaseService.java")){continue;}else{mfile.delete();}}}}StringBuilder sb = new StringBuilder();sb.append("package com.ideabobo.model;\r\n");sb.append("import com.alibaba.fastjson.JSON;\r\n");sb.append("public class Dbtablemapping {\r\n");sb.append("\tpublic static Object parseStringModel(String value, String table) {\r\n");sb.append("\t\tObject object = null;\r\n");sb.append("\t\tswitch (table) {\r\n");//sb.append("");//拼装for(String table:tables){String caseStr = "\t\t\tcase \""+table+"\": object = JSON.parseObject(value, "+getModeNameByTable(table)+".class); break;\r\n";sb.append(caseStr);}sb.append("\t\t}\r\n");sb.append("\t\treturn object;\r\n");sb.append("}\r\n");sb.append("public static Object getModelByTable(String table) {\r\n");sb.append("\tObject object = null;\r\n");sb.append("\tswitch (table) {\r\n");for(String table:tables){String caseStr = "\t\t\tcase \""+table+"\": object = new "+getModeNameByTable(table)+"(); break;\r\n";sb.append(caseStr);}sb.append("\t\t}\r\n");sb.append("\t\treturn object;\r\n");sb.append("\t}\r\n");sb.append("}\r\n");if(!file.exists()){System.out.println(file.getAbsolutePath());file.createNewFile();}Common.str2File(file.getAbsolutePath(), sb.toString());String mappingfilepath = System.getProperty("user.dir")+"\\src\\main\\resources\\mapper\\";File mfile = new File(mappingfilepath);if(mfile.exists() && mfile.isDirectory()){File[] files = mfile.listFiles();for(File mapperfile:files){String mapfilename = mapperfile.getName();if(!mapfilename.equals("DatabaseMapper.xml")){mapperfile.delete();}}}} catch (Exception e) {try {con.close();} catch (SQLException e1) {// TODO Auto-generated catch blocke1.printStackTrace();}// TODO Auto-generated catch blocke.printStackTrace();}}public static String getModeNameByTable(String tableName){String tablePre = Common.getProperty("tableprefix");String modelName = tableName;if(tablePre!=null && !tablePre.equals("")){modelName = modelName.replaceAll(tablePre, "");}modelName = Common.toUpperCaseFirstOne(modelName);return modelName;}}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。