云快卖,提供专业好用的外卖系统、跑腿系统和同城信息系统,公众号+小程序+APP多端适用。
临沂大学外卖排名推荐助手小程序个性化推荐系统
2024-01-27 11:00:33 云快卖

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)法律可行性:本文转载自是合法的研究方向课题,符合法律要求。

外卖点餐_外卖点位_美团外卖点餐

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

3.2系统功能需求剖析

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

4系统详尽设计与实现

4.1系统功能结构设计

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

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

图4-1系统功能结布光

Fig.4-1

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.ideabobo.util.Common;
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 2018/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 block
				e1.printStackTrace();
			}
			// TODO Auto-generated catch block
			e.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;
	}
}

外卖点餐_外卖点位_美团外卖点餐

免责声明:部分文章信息来源于网络以及网友投稿,本站只负责对文章进行整理、排版、编辑,出于传递更多信息之目的,并不意味着赞同其观点或证实其内容的真实性,如本站文章和转稿涉及版权等问题,请作者在及时联系本站,我们会尽快为您处理。

云快卖

留言咨询

×