package com.util;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/*import dao.CommDAO;*/
import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;
public class Info {
//public static String popheight = "alliframe.height=document.body.clientHeight+";
public static String popheight = "alliframe.style.height=document.body.scrollHeight+";
public static HashMap getUser(HttpServletRequest request)
{
HashMap map = (HashMap)(request.getSession().getAttribute("admin")==null?request.getSession().getAttribute("user"):request.getSession().getAttribute("admin"));
return map;
}
public static int getBetweenDayNumber(String dateA, String dateB) {
long dayNumber = 0;
//1小时=60分钟=3600秒=3600000
long mins = 60L * 1000L;
//long day= 24L * 60L * 60L * 1000L;计算天数之差
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
try {
java.util.Date d1 = df.parse(dateA);
java.util.Date d2 = df.parse(dateB);
dayNumber = (d2.getTime() - d1.getTime()) / mins;
} catch (Exception e) {
e.printStackTrace();
}
return (int) dayNumber;
}
public static void main(String[] g )
{
System.out.print(Info.getBetweenDayNumber("2012-11-11 11:19", "2012-11-11 11:11"));
}
public static String getselect(String name,String tablename,String zdname)
{
String select = "<select name=\""+name+"\" id=\""+name+"\" >";
/*for(HashMap permap:new CommDAO().select("select * from "+tablename+" order by id desc")){
select+="<option value=\""+permap.get(zdname)+"\">"+permap.get(zdname)+"</option>";
}
select+="</select>";*/
return select;
}
public static String getselect(String name,String tablename,String zdname,String where)
{
String select = "<select name=\""+name+"\" id=\""+name+"\" >";
select+="<option value=\"\">不限</option>";
/*for(HashMap permap:new CommDAO().select("select * from "+tablename+" where "+where+" order by id desc")){
String optionstr = "";
if(zdname.split(";").length==1){
optionstr=permap.get(zdname.split("~")[0]).toString();
}else{
for(String str:zdname.split(";"))
{
String zdstr = str.split("~")[0];
String zdnamestr = str.split("~")[1].equals("无名")?"":(str.split("~")[1]+":");
optionstr+=zdnamestr+permap.get(zdstr)+" - ";
}
}
if(optionstr.indexOf(" - ")>-1)optionstr=optionstr.substring(0,optionstr.length()-3);
select+="<option value=\""+optionstr+"\">"+optionstr+"</option>";
}
select+="</select>";*/
return select;
}
public static String getradio(String name,String tablename,String zdname,String where)
{
String radio="";
int dxii = 0;
/*for(HashMap permap:new CommDAO().select("select * from "+tablename+" where "+where+" order by id desc")){
String check="";
if(dxii==0)check="checked=checked";
String optionstr = "";
for(String str:zdname.split(";"))
{
String zdstr = str.split("~")[0];
String zdnamestr = str.split("~")[1].equals("无名")?"":(str.split("~")[1]+":");
optionstr+=zdnamestr+permap.get(zdstr)+" - ";
}
if(optionstr.length()>0)optionstr=optionstr.substring(0,optionstr.length()-3);
radio+="<label><input type='radio' name='"+name+"' "+check+" value=\""+optionstr+"\">"+optionstr+"</label>\n";
dxii++;
}*/
return radio;
}
public static void writeExcel(String fileName,String prosstr,java.util.List<List> plist,HttpServletRequest request, HttpServletResponse response){
WritableWorkbook wwb = null;
String cols = "";
for(String str:prosstr.split("@"))
{
cols+=str.split("-")[0]+",";
}
cols = cols.substring(0,cols.length()-1);
String where = request.getAttribute("where")==null?"":request.getAttribute("where").toString();
/* List<List> mlist = new CommDAO().selectforlist("select "+cols+" from "+fileName+" "+where+" order by id desc");*/
fileName = request.getRealPath("/")+"/upfile/"+Info.generalFileName("a.xls");
String[] pros = prosstr.split("@");
try {
//首先要使用Workbook类的工厂方法创建一个可写入的工作薄(Workbook)对象
wwb = Workbook.createWorkbook(new File(fileName));
} catch (IOException e) {
e.printStackTrace();
}
if(wwb!=null){
//创建一个可写入的工作表
//Workbook的createSheet方法有两个参数,第一个是工作表的名称,第二个是工作表在工作薄中的位置
WritableSheet ws = wwb.createSheet("sheet1", 0);
ws.setColumnView(0,20);
ws.setColumnView(1,20);
ws.setColumnView(2,20);
ws.setColumnView(3,20);
ws.setColumnView(4,20);
ws.setColumnView(5,20);
try {
for(int i=0;i<pros.length;i++)
{
Label label1 = new Label(i, 0,"");
label1.setString(pros[i]);
ws.addCell(label1);
}
} catch (RowsExceededException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (WriteException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//下面开始添加单元格
/*int i=1;*/
/* for(List t:mlist){
try {
Iterator it = t.iterator();
int jj=0;
while(it.hasNext())
{
Label label1 = new Label(jj, i,"");
String a = it.next().toString();
label1.setString(a);
ws.addCell(label1);
jj++;
}
i++;
} catch (RowsExceededException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (WriteException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
try {
//从内存中写入文件中
wwb.write();
//关闭资源,释放内存
wwb.close();
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
try {
response.sendRedirect("/pianotrainwebstie/upload?filename="+fileName.substring(fileName.lastIndexOf("/")+1));
} catch (IOException e) {
e.printStackTrace();*/
}
}
public static String getcheckbox(String name,String tablename,String zdname,String where)
{
String checkbox="";
/* f
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Java 毕业设计,SSM 课程设计,基于 Java SSM 开发的,含有代码注释,新手也可看懂。毕业设计、期末大作业、课程设计、高分必看,下载下来,简单部署,就可以使用。 包含:项目源码、数据库脚本、软件工具等,该项目可以作为毕设、课程设计使用,前后端代码都在里面。 该系统功能完善、界面美观、操作简单、功能齐全、管理便捷,具有很高的实际应用价值。 项目都经过严格调试,确保可以运行!可以放心下载 1. 技术组成 前端:HTML、JSP 后台框架:SSM 开发环境:idea 数据库:MySql(建议用 5.7 版本,8.0 有时候会有坑) 部署环境:Tomcat(建议用 7.x 或者 8.x 版本),maven 数据库工具:navicat
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计-ssm+jsp+mysql的商品信息分类管理系.zip (517个子文件)
Info.class 18KB
db.class 14KB
ShangpinrukuController.class 11KB
ShangpinxinxiController.class 10KB
YuangongController.class 10KB
YonghuzhuceController.class 9KB
QuehuoshenqingController.class 9KB
BaofeixinxiController.class 9KB
VeDate.class 9KB
TingzhijinhuoController.class 9KB
CangkuxinxiController.class 8KB
AllusersController.class 7KB
ShoucangjiluController.class 7KB
ShangpinleibiexinxiController.class 7KB
XinwentongzhiController.class 7KB
LiuyanbanController.class 7KB
YouqinglianjieController.class 6KB
PinglunController.class 6KB
Shangpinruku.class 4KB
Yonghuzhuce.class 4KB
StrUtil.class 4KB
ShangpinleibiexinxiServerImpi.class 3KB
Quehuoshenqing.class 3KB
LiuyanbanServerImpi.class 3KB
QuehuoshenqingServerImpi.class 3KB
YouqinglianjieServerImpi.class 3KB
ShangpinxinxiServerImpi.class 3KB
TingzhijinhuoServerImpi.class 3KB
Shangpinxinxi.class 3KB
ShangpinrukuServerImpi.class 3KB
CangkuxinxiServerImpi.class 3KB
BaofeixinxiServerImpi.class 3KB
YonghuzhuceServerImpi.class 3KB
Yuangong.class 3KB
YuangongServerImpi.class 3KB
XinwentongzhiServerImpi.class 3KB
AllusersServerImpi.class 3KB
Tingzhijinhuo.class 3KB
Baofeixinxi.class 3KB
Xinwentongzhi.class 2KB
Liuyanban.class 2KB
ShoucangjiluServerImpi.class 2KB
PinglunServerImpi.class 2KB
hsgloginController.class 2KB
Pinglun.class 2KB
Shoucangjilu.class 2KB
Md5.class 2KB
SetChar.class 2KB
IndexController.class 2KB
Youqinglianjie.class 2KB
Cangkuxinxi.class 2KB
Allusers.class 2KB
Shangpinleibiexinxi.class 1KB
PageBean.class 1KB
PageInfo.class 1KB
testFilter.class 1KB
ShangpinleibiexinxiMapper.class 1KB
YouqinglianjieMapper.class 1KB
QuehuoshenqingMapper.class 1KB
TingzhijinhuoMapper.class 1020B
ShangpinxinxiMapper.class 1020B
XinwentongzhiMapper.class 1020B
LiuyanbanMapper.class 1016B
ShangpinrukuMapper.class 1009B
CangkuxinxiMapper.class 998B
BaofeixinxiMapper.class 998B
YonghuzhuceMapper.class 998B
YuangongMapper.class 965B
ShangpinleibiexinxiServer.class 951B
CheckCode.class 922B
ShoucangjiluMapper.class 898B
AllusersMapper.class 898B
YouqinglianjieServer.class 896B
QuehuoshenqingServer.class 896B
TingzhijinhuoServer.class 885B
ShangpinxinxiServer.class 885B
ShangpinrukuServer.class 874B
YonghuzhuceServer.class 863B
BaofeixinxiServer.class 863B
CangkuxinxiServer.class 863B
LiuyanbanServer.class 860B
PinglunMapper.class 858B
YuangongServer.class 830B
XinwentongzhiServer.class 796B
ShoucangjiluServer.class 763B
AllusersServer.class 763B
PinglunServer.class 723B
Constant.class 674B
.classpath 1KB
org.eclipse.wst.common.component 598B
org.eclipse.wst.jsdt.ui.superType.container 49B
common.css 136KB
common.css 136KB
bootstrap.min.css 119KB
common.css 118KB
bootstrap.min.css 115KB
bootstrap.css 115KB
style.min.css 114KB
bootstrap.min.css 107KB
materialdesignicons.min.css 85KB
共 517 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
gdutxiaoxu
- 粉丝: 1543
- 资源: 3119
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 自考数据库系统原理04735真题含答案(2011.1-2017年)
- YOLO算法-有轨车辆数据集-2013张图像带标签-身体-联轴器-车轮.zip
- YOLO算法-火车-轨道数据集-2164张图像带标签-火车-轨道.zip
- 05-大数据概论(1).zip
- WebSocketB/S前后端链接通信-simple-Chat实现(应用)
- YOLO算法-瓶纸盒合并数据集-3161张图像带标签-纸张-纸箱-瓶子.zip
- YOLO算法-检测车数据集-2622张图像带标签-货车-发动机.zip
- YOLO算法-自卸卡车-挖掘机-轮式装载机数据集-2644张图像带标签-自卸卡车-挖掘机-轮式装载机.zip
- 离散数学课件全国自考02324
- YOLO算法-火灾和人员探测数据集-3039张图像带标签-人-烟-火.zip
- YOLO算法-产品识别数据集-5166张图像带标签-可口可乐.zip
- YOLO算法-数据集数据集-330张图像带标签-椅子-书桌.zip
- SwinTransformer 改进:添加SelfAttention自注意力层
- YOLO算法-可回收垃圾检测数据集-1142张图像带标签-纸张-纸箱-瓶子.zip
- YOLO算法-锡罐-牙罐-盖子打开数据集-179张图像带标签-锡罐-牙罐-盖子打开.zip
- YOLO算法-汽车数据集-5000张图像带标签-.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功