栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

基于javaweb+SpringBoot+MyBatis网上订餐在线点餐管理系统(前台、后台)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

基于javaweb+SpringBoot+MyBatis网上订餐在线点餐管理系统(前台、后台)

基于javaweb+SpringBoot+MyBatis网上订餐在线点餐管理系统(前台、后台)

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

package com.demo.controller.web;

import com.demo.entity.Evaluate;
import com.demo.entity.Order;
import com.demo.entity.vo.OrderExcelExportVO;
import com.demo.service.EvaService;
import com.demo.service.OrderService;
import com.demo.service.UserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.demo.common.view.ObjectExcelViewOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.document.AbstractExcelView;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;


	public String getCode() {
		return this.text;
	public static void main(String[] args) throws Exception {
		VerifyCode vc = new VerifyCode();
		vc.drawImage(new FileOutputStream("e:/vc.jpg"));
		System.out.println("执行成功~!");
	}





//	//打印报表
//	public static void writeToDisk(java.util.List list, int maxrow, String fileName) throws IOException {
//	   
//		//1生成sheet1
//		HSSFWorkbook wb=new HSSFWorkbook();
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.*;


@Controller
public class ProductController {

                                
                                
                            
                        
                        
  • 导出全部订单
  • <%--
    --%>
            valueStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
            valueStyle.setVerticalAlignment(CellStyle.VERTICAL_CENTER);//垂直居中
            HSSFDataFormat df = workbook.createDataFormat();//此处设置数据格式  
            valueStyle.setDataFormat(df.getFormat("#,#0.0")); //小数点后保留两位,可以写contentStyle.setDataFormat(df.getFormat("#,#0.00"));  
    
            List> varList = (List>) model.get("varList");
            int varCount = varList.size();
            int rowIndex = 2;//第三行
            for(int i=0; i
                //初始参数
                OrderExcelExportVO data = (OrderExcelExportVO)varList.get(i);
                int colIndex = 0;//第一列
                //1-订单序号
                colIndex = ObjectExcelUtil.setSingleCellText(sheet,cell,rowIndex,colIndex,ObjectExcelUtil.showNullData(data.getId()),contentStyle);
                //2-订单编号
                colIndex = ObjectExcelUtil.setSingleCellText(sheet,cell,rowIndex,colIndex,ObjectExcelUtil.showNullData(data.getOrderId()),contentStyle);
                //3-订单金额
                colIndex = ObjectExcelUtil.setSingleCellText(sheet,cell,rowIndex,colIndex,ObjectExcelUtil.showNullData(data.getMoney()),contentStyle);
                //4-收货人
                colIndex = ObjectExcelUtil.setSingleCellText(sheet,cell,rowIndex,colIndex,ObjectExcelUtil.showNullData(data.getUserId()),contentStyle);
                //5-收获地址
                colIndex = ObjectExcelUtil.setSingleCellText(sheet,cell,rowIndex,colIndex,ObjectExcelUtil.showNullData(data.getAddressInfo()),contentStyle);
                //6-下单时间
    
    		this.text = sb.toString();
    
    		// 画干扰线
    		for (int i = 0; i < len + 2; i++) {
    			// 设置画笔颜色 -- 随机
    			// g2.setColor(new Color(255, 0, 0));
    			g2.setColor(new Color(getRandom(0, 150), getRandom(0, 150),
    					getRandom(0, 150)));
    			g2.drawLine(getRandom(0, 120), getRandom(0, 30), getRandom(0, 120),
    					getRandom(0, 30));
    		}
    
    		g2.setColor(Color.GRAY);
    		g2.drawRect(0, 0, width-1, height-1);
    
    		// 4.保存图片到指定的输出流
    		try {
    			ImageIO.write(this.img, "JPEG", outputStream);
    		} catch (Exception e) {
    			e.printStackTrace();
    			throw new RuntimeException(e);
    
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.UnsupportedEncodingException;
    import java.util.HashMap;
    import java.util.Map;
    
    import org.json.JSONArray;
    import org.json.JSONObject;
    
    
            Map excelMap = new HashMap();
            excelMap.put("excelTitle","订单信息表格");//excel标题
            DateFormat sdf = new SimpleDateFormat("yyyyMMdd");
            String time = sdf.format(new Timestamp(System.currentTimeMillis()));
            excelMap.put("fileName","订单信息表格" + time);//文件名
            return excelMap;
        }
        
        protected AbstractExcelView getAbstractExcelView(Map excelMap){
            try {
                ObjectExcelViewOrder erv = new ObjectExcelViewOrder(excelMap.get("fileName"),excelMap.get("excelTitle"));
                return erv;
            } catch (Exception e) {
                e.printStackTrace();
                return null;
            }
        }
    
    }
    package com.demo.common.utils;
    
    import java.io.UnsupportedEncodingException;
    

    运行环境

    Java≥8、MySQL≥5.7

    开发工具

    eclipse/idea/myeclipse/sts等均可配置运行

    技术框架

    SpringBoot SpringMVC MyBatis JSP JavaScript jQuery……

    适用

    课程设计,大作业,毕业设计,项目练习,学习演示等

    功能说明

    前台用户:查看菜品、点餐下单、确认收货、评论等……

    后台管理员:管理用户、订单、分类、交易、公告等……

    前台

    后台


    转载请注明:文章转载自 www.mshxw.com
    本文地址:https://www.mshxw.com/it/838908.html
    我们一直用心在做
    关于我们 文章归档 网站地图 联系我们

    版权所有 (c)2021-2022 MSHXW.COM

    ICP备案号:晋ICP备2021003244-6号