程序员看马航失联事件

马航失联第一季(起风了)
剧情简介:某XX情报员,带着高度军事机密,几经周转乘上了小马哥驾驶的飞机,准备返回于是故事开始了………………

马航失联第二季(致命的机密)
剧情简介:继第一季这季剧情进一步深化,小马哥与老美、小樱等交换机密最终得出“两条弧线”空间论…………

马航失联第三季(风云)
剧情简介:继第二季这季剧情继续深化小马哥发布一个惊天动地的消息………………

马航失联第四季(海神的微笑)
剧情简介:剧情峰回路转,老中监听到黑匣子信号…………

演员列表:小马哥,老忠,老美,小澳哥,小樱,狗日。跑龙套角色:小越,小菲等。

	@RequestMapping(value="manager/import/soldtable",method=RequestMethod.GET)
	public String importtable(HttpServletRequest request,HttpServletResponse response) throws Exception, WriteException{
		OutputStream os = response.getOutputStream();  
		String refectoryId="refectory";
	     
	    String fileName="menusold";  
	    response.setContentType("application/vnd.ms-excel");  
	    response.addHeader("Content-Disposition", "attachment;filename=\"" + fileName + ".xls" + "\"");  
	    
		SoldExample example=new SoldExample();
		example.createCriteria().andRefectoryIdEqualTo(refectoryId);
		List<Sold> list=soldService.getSoldlist(example);
	      
	    if(list.size()>0){  
	        System.out.println("=====kaisi");  
	        WritableWorkbook book = Workbook.createWorkbook(os);  
	        WritableSheet  ws= book.createSheet(fileName, 0); //新建一个sheet  
	        WritableCellFormat wcf = null;      
	        WritableFont wf = new WritableFont(WritableFont.TIMES,12, WritableFont.BOLD,false);//最后一个为是否italic     
	        wf.setColour(Colour.BLACK);     
	        wcf = new WritableCellFormat(wf);       
	        wcf.setAlignment(Alignment.CENTRE);     
	        wcf.setVerticalAlignment(VerticalAlignment.CENTRE);       
	        wcf.setBorder(Border.ALL,BorderLineStyle.THIN);     
	      for(int i=0;i<list.size();i++){  
	          Sold soldmenu=list.get(i);
	          Label label11=new Label(0, 0, "菜谱名称",wcf);  
	          ws.setColumnView(0,20);  
	          ws.addCell(label11);  
	          Label label1=new Label(0, i+1, soldmenu.getMenuname());  
	          ws.addCell(label1);  
	            
	          Label label12=new Label(1, 0, "单价/元",wcf);  
	          ws.setColumnView(1,30);  
	          ws.addCell(label12);  
	          Label label2=new Label(1, i+1, soldmenu.getPrice().toString());  
	          ws.addCell(label2);  
	            
	          Label label13=new Label(2, 0, "销售量/份",wcf);  
	          ws.setColumnView(2,50);  
	          ws.addCell(label13);  
	          Label label3=new Label(2, i+1, soldmenu.getNumber().toString());  
	          ws.addCell(label3);  
	            
	          Label label14=new Label(3, 0, "总额/元",wcf);  
	          ws.setColumnView(3,20);  
	          ws.addCell(label14);  
	          Label label4=new Label(3, i+1, soldmenu.getSum().toString());  
	          ws.addCell(label4);  
	 
	      }  
	        book.write();  
	        book.close();  
	        os.close();  
	        response.flushBuffer();  
	    }  
	    return null;  
	}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值