master
parent
217213d8d3
commit
c11c44fec0
@ -1,87 +0,0 @@
|
|||||||
//package com.zh.project0512.utils;
|
|
||||||
//
|
|
||||||
//import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
||||||
//import org.springframework.stereotype.Service;
|
|
||||||
//import org.springframework.transaction.annotation.Transactional;
|
|
||||||
//import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
||||||
//
|
|
||||||
//import javax.annotation.Resource;
|
|
||||||
//import javax.servlet.http.HttpServletRequest;
|
|
||||||
//import javax.servlet.http.HttpServletResponse;
|
|
||||||
//import java.io.OutputStream;
|
|
||||||
//import java.io.UnsupportedEncodingException;
|
|
||||||
//import java.text.SimpleDateFormat;
|
|
||||||
//import java.util.*;
|
|
||||||
//
|
|
||||||
//public class ExcelUtil {
|
|
||||||
//
|
|
||||||
// public void export(HttpServletRequest request, HttpServletResponse response,Integer chargesTemplateId) {
|
|
||||||
// //获取数据
|
|
||||||
// SearchChargesTemplateDetail searchChargesTemplateDetail = new SearchChargesTemplateDetail();
|
|
||||||
// searchChargesTemplateDetail.setChargesTemplateId(chargesTemplateId);
|
|
||||||
// List<VoChargesTemplateDetail> voChargesTemplateDetailList = sysChargesTemplateDetailDao.list(searchChargesTemplateDetail);
|
|
||||||
//
|
|
||||||
// //excel标题
|
|
||||||
// String[] title = {"序号","费用名称","计费单价/单位","附加/固定费用","状态","创建人","更新时间"};
|
|
||||||
//
|
|
||||||
// //excel文件名
|
|
||||||
// String fileName = "收费标准管理表"+System.currentTimeMillis()+".xls";
|
|
||||||
//
|
|
||||||
// //sheet名
|
|
||||||
// String sheetName = "收费标准管理表";
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// //初始化内容容器1
|
|
||||||
// String[][] content = new String[voChargesTemplateDetailList.size()][];
|
|
||||||
// for (int i = 0; i < voChargesTemplateDetailList.size(); i++) {
|
|
||||||
// //初始化内容容器2
|
|
||||||
// content[i] = new String[title.length];
|
|
||||||
// //获取 当前物业收费标准明细Vo
|
|
||||||
// VoChargesTemplateDetail voChargesTemplateDetail = voChargesTemplateDetailList.get(i);
|
|
||||||
// //传入序号
|
|
||||||
// content[i][0] = String.valueOf(i+1);
|
|
||||||
// //传入费用名称
|
|
||||||
// content[i][1] = voChargesTemplateDetail.getName();
|
|
||||||
//
|
|
||||||
// //传入计费单价/单位
|
|
||||||
// //查询计费单位显示名称
|
|
||||||
// String typeShowName = sysChargesTemplateDetailDao.findTypeShowNameByShowValue(voChargesTemplateDetail.getType());
|
|
||||||
// content[i][2] = voChargesTemplateDetail.getUnitPrice().toString()+typeShowName;
|
|
||||||
//
|
|
||||||
// //传入附加/固定费用
|
|
||||||
// List<VoChargesTemplateAdditionalCost> additionalCostList = sysChargesTemplateDetailDao.findAdditionalCostById(voChargesTemplateDetail.getId());
|
|
||||||
// if (additionalCostList != null && additionalCostList.size()>0){
|
|
||||||
// content[i][3] = "";
|
|
||||||
// for (VoChargesTemplateAdditionalCost additionalCost : additionalCostList) {
|
|
||||||
// content[i][3] += additionalCost.getName()+":"+additionalCost.getCost()+"/r/n";
|
|
||||||
// }
|
|
||||||
// }else {
|
|
||||||
// content[i][3] = "/";
|
|
||||||
// }
|
|
||||||
// //传入状态
|
|
||||||
// //查询状态显示名称
|
|
||||||
// String statusShowName = sysChargesTemplateDetailDao.findStatusShowNameByShowValue(voChargesTemplateDetail.getStatus());
|
|
||||||
// content[i][4] = statusShowName;
|
|
||||||
// //传入创建人
|
|
||||||
// content[i][5] = voChargesTemplateDetail.getCreateName();
|
|
||||||
// //传入更新时间
|
|
||||||
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
|
||||||
// String format = formatter.format(voChargesTemplateDetail.getModifyDate());
|
|
||||||
// content[i][6] = format;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //创建HSSFWorkbook
|
|
||||||
// HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook(sheetName, title, content, null);
|
|
||||||
//
|
|
||||||
// //响应到客户端
|
|
||||||
// try {
|
|
||||||
// this.setResponseHeader(response, fileName);
|
|
||||||
// OutputStream os = response.getOutputStream();
|
|
||||||
// wb.write(os);
|
|
||||||
// os.flush();
|
|
||||||
// os.close();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
Loading…
Reference in new issue