看了下之前自己写的博客,java生成pdf,简直不忍直视,所以打算重新写个,废话不多说,直接上代码
我这里是通过解析xml获取到的数据,可以根据自己的实际情况,传递不同参数获取不同数据源即可
public HSSFWorkbook exportOrgExcel(String xmlPath) throws Exception {
HSSFWorkbook workbook = null;
int i=0;
try {
// 创建工作簿实例
workbook = new HSSFWorkbook();
// 创建工作表实例
HSSFSheet sheet = workbook.createSheet("企业信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
HSSFCellStyle boldStyle = createBoldStyle(workbook); //获取粗体表头样式
HSSFCellStyle dataStyle = createDataStyle(workbook); //获取标准样式
List list = SaxParseXmlUtil.parseXmlFileForList(xmlPath);
List<GBasic> basicInfoList = null;
List<GCaseinfo> caseinfoList = null;
List<GEntinv> entinvList = null;
List<GFiliation> filiationList = null;
List<GFrinv> frinvList = null;
List<GFrposition> frpositionList = null;
List<GLiquidation> liquidationList = null;
List<GMordetail> mordetailList = null;
List<GPunishbreak> punishbreakList = null;
List<GPunished> punishedList = null;
List<GShareholder> shareholderList = null;
List<GSharesfrost> sharesfrostList = null;
List<GSharesimpawn> sharesimpawnList = null;
List<GPerson> personList = null;
List<GAlter> alterList = null;
List<GMorguainfo> morguainfoList = null;
GBasic gbasic = basicInfoList.get(0);
HSSFRow row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "企业名称");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册号");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"原注册号");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"法定代表人姓名");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册资本");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"实收资本(万元)");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"币种");
this.createCell(row, 7, boldStyle, HSSFCell.CELL_TYPE_STRING,"经营状态");
this.createCell(row, 8, boldStyle, HSSFCell.CELL_TYPE_STRING,"企业(机构)类型");
this.createCell(row, 9, boldStyle, HSSFCell.CELL_TYPE_STRING,"开业日期");
this.createCell(row, 10, boldStyle, HSSFCell.CELL_TYPE_STRING,"经营期限自");
this.createCell(row, 11, boldStyle, HSSFCell.CELL_TYPE_STRING,"经营期限至");
this.createCell(row, 12, boldStyle, HSSFCell.CELL_TYPE_STRING,"住址");
this.createCell(row, 13, boldStyle, HSSFCell.CELL_TYPE_STRING,"登记机关");
this.createCell(row, 14, boldStyle, HSSFCell.CELL_TYPE_STRING,"许可经营项目");
this.createCell(row, 15, boldStyle, HSSFCell.CELL_TYPE_STRING,"一般经营项目");
this.createCell(row, 16, boldStyle, HSSFCell.CELL_TYPE_STRING,"经营(业务)范围");
this.createCell(row, 17, boldStyle, HSSFCell.CELL_TYPE_STRING,"经营(业务)范围及方式");
this.createCell(row, 18, boldStyle, HSSFCell.CELL_TYPE_STRING,"最后年检年度");
this.createCell(row, 19, boldStyle, HSSFCell.CELL_TYPE_STRING,"注销日期");
this.createCell(row, 20, boldStyle, HSSFCell.CELL_TYPE_STRING,"吊销日期");
this.createCell(row, 21, boldStyle, HSSFCell.CELL_TYPE_STRING,"最后年检日期");
this.createCell(row, 22, boldStyle, HSSFCell.CELL_TYPE_STRING,"行业门类代码");
this.createCell(row, 23, boldStyle, HSSFCell.CELL_TYPE_STRING,"国民经济行业代码");
this.createCell(row, 24, boldStyle, HSSFCell.CELL_TYPE_STRING,"变更日期");
this.createCell(row, 25, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册部门编码");
this.createCell(row, 26, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册省份");
this.createCell(row, 27, boldStyle, HSSFCell.CELL_TYPE_STRING,"行业门类名称");
this.createCell(row, 28, boldStyle, HSSFCell.CELL_TYPE_STRING,"国民经济行业名称");
HSSFRow row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(gbasic.getEntname())?gbasic.getEntname():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getRegno())?gbasic.getRegno():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getOriregno())?gbasic.getOriregno():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getFrname())?gbasic.getFrname():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getRegcap())?gbasic.getRegcap():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getReccap())?gbasic.getReccap():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getRegcapcur())?gbasic.getRegcapcur():"");
this.createCell(row1, 7, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getEntstatus())?gbasic.getEntstatus():"");
this.createCell(row1, 8, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getEnttype())?gbasic.getEnttype():"");
this.createCell(row1, 9, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getEsdate())?gbasic.getEsdate():"");
this.createCell(row1, 10, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getOpfrom())?gbasic.getOpfrom():"");
this.createCell(row1, 11, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getOpto())?gbasic.getOpto():"");
this.createCell(row1, 12, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getDom())?gbasic.getDom():"");
this.createCell(row1, 13, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getRegorg())?gbasic.getRegorg():"");
this.createCell(row1, 14, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getAbuitem())?gbasic.getAbuitem():"");
this.createCell(row1, 15, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getCbuitem())?gbasic.getCbuitem():"");
this.createCell(row1, 16, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getOpscope())?gbasic.getOpscope():"");
this.createCell(row1, 17, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getOpscoandform())?gbasic.getOpscoandform():"");
this.createCell(row1, 18, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getAncheyear())?gbasic.getAncheyear():"");
this.createCell(row1, 19, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getCandate())?gbasic.getCandate():"");
this.createCell(row1, 20, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getRevdate())?gbasic.getRevdate():"");
this.createCell(row1, 21, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getAnchedate())?gbasic.getAnchedate():"");
this.createCell(row1, 22, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getIndustryphycode())?gbasic.getIndustryphycode():"");
this.createCell(row1, 23, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getIndustrycocode())?gbasic.getIndustrycocode():"");
this.createCell(row1, 24, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getChangedate())?gbasic.getChangedate():"");
this.createCell(row1, 25, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getRegorgcode())?gbasic.getRegorgcode():"");
this.createCell(row1, 26, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getRegorgprovince())?gbasic.getRegorgprovince():"");
this.createCell(row1, 27, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getIndustryphyname())?gbasic.getIndustryphyname():"");
this.createCell(row1, 28, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(gbasic.getIndustryconame())?gbasic.getIndustryconame():"");
i = 0;
//行政处罚
sheet = workbook.createSheet("行政处罚信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List caseinfoList = this.queryCaseinfo(gid); 原查询数据库获取数据
if(null != caseinfoList && caseinfoList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "案发时间");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"案由");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"案值");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"违法行为类型");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"执行类别");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"案件结果");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"处罚决定文书");
this.createCell(row, 7, boldStyle, HSSFCell.CELL_TYPE_STRING,"处罚决定书签发日期");
this.createCell(row, 8, boldStyle, HSSFCell.CELL_TYPE_STRING,"作出行政处罚决定机关名称");
this.createCell(row, 9, boldStyle, HSSFCell.CELL_TYPE_STRING,"主要违法事实");
this.createCell(row, 10, boldStyle, HSSFCell.CELL_TYPE_STRING,"处罚依据");
this.createCell(row, 11, boldStyle, HSSFCell.CELL_TYPE_STRING,"处罚种类");
this.createCell(row, 12, boldStyle, HSSFCell.CELL_TYPE_STRING,"处罚结果");
this.createCell(row, 13, boldStyle, HSSFCell.CELL_TYPE_STRING,"处罚金额");
this.createCell(row, 14, boldStyle, HSSFCell.CELL_TYPE_STRING,"处罚执行情况");
Iterator it = caseinfoList.iterator();
while(it.hasNext()) {
GCaseinfo caseinfo = (GCaseinfo) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getCasetime())?caseinfo.getCasetime():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getCasereason())?caseinfo.getCasereason():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getCaseval())?caseinfo.getCaseval():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getCasetype())?caseinfo.getCasetype():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getExesort())?caseinfo.getExesort():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getCaseresult())?caseinfo.getCaseresult():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getPendecno())?caseinfo.getPendecno():"");
this.createCell(row1, 7, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getPendecissdate())?caseinfo.getPendecissdate():"");
this.createCell(row1, 8, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getPenauth())?caseinfo.getPenauth():"");
this.createCell(row1, 9, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getIllegfact())?caseinfo.getIllegfact():"");
this.createCell(row1, 10, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getPenbasis())?caseinfo.getPenbasis():"");
this.createCell(row1, 11, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getPentype())?caseinfo.getPentype():"");
this.createCell(row1, 12, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getPenresult())?caseinfo.getPenresult():"");
this.createCell(row1, 13, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getPenam())?caseinfo.getPenam():"");
this.createCell(row1, 14, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(caseinfo.getPenexest())?caseinfo.getPenexest():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无行政处罚信息");
}
i = 0;
//企业对外投资信息
sheet = workbook.createSheet("企业对外投资信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List entinvList = this.queryEntinv(gid);
if(null != entinvList && entinvList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "企业(机构)名称");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册号");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"企业(机构)类型");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册资本(万元)");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册资本币种");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"企业状态");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"注销日期");
this.createCell(row, 7, boldStyle, HSSFCell.CELL_TYPE_STRING,"吊销日期");
this.createCell(row, 8, boldStyle, HSSFCell.CELL_TYPE_STRING,"登记机关");
this.createCell(row, 9, boldStyle, HSSFCell.CELL_TYPE_STRING,"认缴出资额(万元)");
this.createCell(row, 10, boldStyle, HSSFCell.CELL_TYPE_STRING,"认缴出资币种");
this.createCell(row, 12, boldStyle, HSSFCell.CELL_TYPE_STRING,"出资方式");
this.createCell(row, 12, boldStyle, HSSFCell.CELL_TYPE_STRING,"出资比例");
this.createCell(row, 13, boldStyle, HSSFCell.CELL_TYPE_STRING,"开业日期");
this.createCell(row, 14, boldStyle, HSSFCell.CELL_TYPE_STRING,"法定代表人姓名");
Iterator it = entinvList.iterator();
while(it.hasNext()) {
GEntinv entinv = (GEntinv) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getEntname())?entinv.getEntname():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getRegno())?entinv.getRegno():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getEnttype())?entinv.getEnttype():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getRegcap())?entinv.getRegcap():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getRegcapcur())?entinv.getRegcapcur():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getEntstatus())?entinv.getEntstatus():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getCandate())?entinv.getCandate():"");
this.createCell(row1, 7, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getRevdate())?entinv.getRevdate():"");
this.createCell(row1, 8, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getRegorg())?entinv.getRegorg():"");
this.createCell(row1, 9, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getSubconam())?entinv.getSubconam():"");
this.createCell(row1, 10, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getCongrocur())?entinv.getCongrocur():"");
this.createCell(row1, 11, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getConform())?entinv.getConform():"");
this.createCell(row1, 12, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getFundedratio())?entinv.getFundedratio():"");
this.createCell(row1, 13, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getEsdate())?entinv.getEsdate():"");
this.createCell(row1, 14, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(entinv.getName())?entinv.getName():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无企业投资信息");
}
i = 0;
//股东信息
sheet = workbook.createSheet("股东信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List shareholderList = this.shareholderList(gid);
if(null != shareholderList && shareholderList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "股东名称");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"认缴出资额(万元)");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"认缴出资币种");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"出资比例");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"出资方式");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"出资日期");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"国别");
this.createCell(row, 7, boldStyle, HSSFCell.CELL_TYPE_STRING,"股东总数量");
this.createCell(row, 8, boldStyle, HSSFCell.CELL_TYPE_STRING,"总额度");
this.createCell(row, 9, boldStyle, HSSFCell.CELL_TYPE_STRING,"股东出资比例总和");
Iterator it = shareholderList.iterator();
while(it.hasNext()) {
GShareholder shareholder = (GShareholder) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(shareholder.getShaname())?shareholder.getShaname():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(shareholder.getSubconam())?shareholder.getSubconam():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(shareholder.getRegcapcur())?shareholder.getRegcapcur():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(shareholder.getFundedratio())?shareholder.getFundedratio():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(shareholder.getConform())?shareholder.getConform():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(shareholder.getCondate())?shareholder.getCondate():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(shareholder.getCountry())?shareholder.getCountry():"");
this.createCell(row1, 7, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(shareholder.getInvamount())?shareholder.getInvamount():"");
this.createCell(row1, 8, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(shareholder.getSumconam())?shareholder.getSumconam():"");
this.createCell(row1, 9, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(shareholder.getInvsumfundedratio())?shareholder.getInvsumfundedratio():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无股东信息");
}
i = 0;
//股东详细信息
sheet = workbook.createSheet("股东详细信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List personList = this.queryPersonList(gid);
if(null != shareholderList && shareholderList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "姓名");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"职位");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"性别");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"总人数");
Iterator it = personList.iterator();
while(it.hasNext()) {
GPerson person = (GPerson) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(person.getPername())?person.getPername():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(person.getPosition())?person.getPosition():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(person.getSex())?person.getSex():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(person.getPersonamount())?person.getPersonamount():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无股东详细信息");
}
i = 0;
//分支机构信息
sheet = workbook.createSheet("分支机构信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List filiationList = this.queryFiliation(gid);
if(null != filiationList && filiationList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "分支机构名称");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"分支机构企业注册号");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"分支机构负责人");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"一般经营项目");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"分支机构地址");
Iterator it = filiationList.iterator();
while(it.hasNext()) {
GFiliation filiation = (GFiliation) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(filiation.getBrname())?filiation.getBrname():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(filiation.getBrregno())?filiation.getBrregno():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(filiation.getBrprincipal())?filiation.getBrprincipal():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(filiation.getCbuitem())?filiation.getCbuitem():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(filiation.getBraddr())?filiation.getBraddr():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无分支机构信息");
}
i = 0;
//法人对外投资信息
sheet = workbook.createSheet("法人对外投资信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List frinvList = this.queryFrinv(gid);
if(null != frinvList && frinvList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "法定代表人姓名");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"企业(机构)名称");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册号");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"企业(机构)类型");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册资本(万元)");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册资本币种");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"企业状态");
this.createCell(row, 7, boldStyle, HSSFCell.CELL_TYPE_STRING,"注销日期");
this.createCell(row, 8, boldStyle, HSSFCell.CELL_TYPE_STRING,"吊销日期");
this.createCell(row, 9, boldStyle, HSSFCell.CELL_TYPE_STRING,"登记机关");
this.createCell(row, 10, boldStyle, HSSFCell.CELL_TYPE_STRING,"认缴出资额(万元)");
this.createCell(row, 11, boldStyle, HSSFCell.CELL_TYPE_STRING,"认缴出资币种");
this.createCell(row, 12, boldStyle, HSSFCell.CELL_TYPE_STRING,"出资方式");
this.createCell(row, 13, boldStyle, HSSFCell.CELL_TYPE_STRING,"出资比例");
this.createCell(row, 14, boldStyle, HSSFCell.CELL_TYPE_STRING,"开业日期");
Iterator it = frinvList.iterator();
while(it.hasNext()) {
GFrinv frinv = (GFrinv) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(frinv.getName())?frinv.getName():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(frinv.getEntname())?frinv.getEntname():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(frinv.getRegno())?frinv.getRegno():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(frinv.getEnttype())?frinv.getEnttype():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(frinv.getRegcap())?frinv.getRegcap():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(frinv.getRegcapcur())?frinv.getRegcapcur():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(frinv.getEntstatus())?frinv.getEntstatus():"");
this.createCell(row1, 7, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(frinv.getCandate())?frinv.getCandate():"");
this.createCell(row1, 8, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(frinv.getRevdate())?frinv.getRevdate():"");
this.createCell(row1, 9, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(frinv.getRegorg())?frinv.getRegorg():"");
this.createCell(row1, 10, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frinv.getSubconam())?frinv.getSubconam():"");
this.createCell(row1, 11, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frinv.getCurrency())?frinv.getCurrency():"");
this.createCell(row1, 12, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frinv.getConform())?frinv.getConform():"");
this.createCell(row1, 13, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frinv.getFundedratio())?frinv.getFundedratio():"");
this.createCell(row1, 14, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frinv.getEsdate())?frinv.getEsdate():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无法人对外投资信息");
}
i = 0;
//法人其他任职信息
sheet = workbook.createSheet("法人其他任职信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List frpositionList = this.queryFrposition(gid);
if(null != frpositionList && frpositionList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "法定代表人姓名");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"企业(机构)名称");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册号");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"企业(机构)类型");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册资本(万元)");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"注册资本币种");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"企业状态");
this.createCell(row, 7, boldStyle, HSSFCell.CELL_TYPE_STRING,"注销日期");
this.createCell(row, 8, boldStyle, HSSFCell.CELL_TYPE_STRING,"吊销日期");
this.createCell(row, 9, boldStyle, HSSFCell.CELL_TYPE_STRING,"登记机关");
this.createCell(row, 10, boldStyle, HSSFCell.CELL_TYPE_STRING,"职务");
this.createCell(row, 11, boldStyle, HSSFCell.CELL_TYPE_STRING,"是否法定代表人");
this.createCell(row, 12, boldStyle, HSSFCell.CELL_TYPE_STRING,"开业日期");
Iterator it = frpositionList.iterator();
while(it.hasNext()) {
GFrposition frposition = (GFrposition) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getName())?frposition.getName():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getEntname())?frposition.getEntname():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getRegno())?frposition.getRegno():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getEnttype())?frposition.getEnttype():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getRegcap())?frposition.getRegcap():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getRegcapcur())?frposition.getRegcapcur():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getEntstatus())?frposition.getEntstatus():"");
this.createCell(row1, 7, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getCandate())?frposition.getCandate():"");
this.createCell(row1, 8, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getRevdate())?frposition.getRevdate():"");
this.createCell(row1, 9, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getRegorg())?frposition.getRegorg():"");
this.createCell(row1, 10, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getPosition())?frposition.getPosition():"");
this.createCell(row1, 11, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getLerepsign())?frposition.getLerepsign():"");
this.createCell(row1, 12, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(frposition.getEsdate())?frposition.getEsdate():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无法人其他任职信息");
}
i = 0;
//动产抵押信息
sheet = workbook.createSheet("动产抵押信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List mordetailList = this.queryMordetail(gid);
if(null != mordetailList && mordetailList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "抵押人");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"抵押权人");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"登记机关");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"登记日期");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"状态标识");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"登记证号");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"申请抵押原因");
this.createCell(row, 7, boldStyle, HSSFCell.CELL_TYPE_STRING,"被担保主债权种类");
this.createCell(row, 8, boldStyle, HSSFCell.CELL_TYPE_STRING,"被担保主债权数额(万元)");
this.createCell(row, 9, boldStyle, HSSFCell.CELL_TYPE_STRING,"履约起始日期");
this.createCell(row, 10, boldStyle, HSSFCell.CELL_TYPE_STRING,"履约截止日期");
this.createCell(row, 11, boldStyle, HSSFCell.CELL_TYPE_STRING,"注销日期");
Iterator it = mordetailList.iterator();
while(it.hasNext()) {
GMordetail mordetail = (GMordetail) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getMortgagor())?mordetail.getMortgagor():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getMore())?mordetail.getMore():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getRegorg())?mordetail.getRegorg():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getRegidate())?mordetail.getRegidate():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getMortype())?mordetail.getMortype():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getMorregcno())?mordetail.getMorregcno():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getAppregrea())?mordetail.getAppregrea():"");
this.createCell(row1, 7, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getPriclaseckind())?mordetail.getPriclaseckind():"");
this.createCell(row1, 8, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getPriclasecam())?mordetail.getPriclasecam():"");
this.createCell(row1, 9, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getPefperform())?mordetail.getPefperform():"");
this.createCell(row1, 10, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getPefperto())?mordetail.getPefperto():"");
this.createCell(row1, 11, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(mordetail.getCandate())?mordetail.getCandate():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无动产抵押信息");
}
i = 0;
//失信被执行人信息
sheet = workbook.createSheet("失信被执行人信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List punishbreakList = this.queryMordetail(gid);
if(null != punishbreakList && punishbreakList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "案号");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"被执行人姓名/名称");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"失信人类型");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"性别");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"身份证号码/工商注册号");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"身份证原始发证地");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"法定代表人/负责人姓名");
this.createCell(row, 7, boldStyle, HSSFCell.CELL_TYPE_STRING,"立案时间");
this.createCell(row, 8, boldStyle, HSSFCell.CELL_TYPE_STRING,"公布时间");
this.createCell(row, 9, boldStyle, HSSFCell.CELL_TYPE_STRING,"执行法院");
this.createCell(row, 10, boldStyle, HSSFCell.CELL_TYPE_STRING,"省份");
this.createCell(row, 11, boldStyle, HSSFCell.CELL_TYPE_STRING,"执行依据文号");
this.createCell(row, 12, boldStyle, HSSFCell.CELL_TYPE_STRING,"做出执行依据单位");
this.createCell(row, 13, boldStyle, HSSFCell.CELL_TYPE_STRING,"生效法律文书确定的义务");
this.createCell(row, 14, boldStyle, HSSFCell.CELL_TYPE_STRING,"失信被执行人行为具体情形");
this.createCell(row, 15, boldStyle, HSSFCell.CELL_TYPE_STRING,"被执行人的履行情况");
this.createCell(row, 16, boldStyle, HSSFCell.CELL_TYPE_STRING,"已履行");
this.createCell(row, 17, boldStyle, HSSFCell.CELL_TYPE_STRING,"未履行");
Iterator it = punishbreakList.iterator();
while(it.hasNext()) {
GPunishbreak punishbreak = (GPunishbreak) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(punishbreak.getCasecode())?punishbreak.getCasecode():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(punishbreak.getInameclean())?punishbreak.getInameclean():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(punishbreak.getType())?punishbreak.getType():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(punishbreak.getSexyclean())?punishbreak.getSexyclean():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(punishbreak.getCardnum())?punishbreak.getCardnum():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(punishbreak.getYsfzd())?punishbreak.getYsfzd():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(punishbreak.getBusinessentity())?punishbreak.getBusinessentity():"");
this.createCell(row1, 7, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(punishbreak.getRegdateclean())?punishbreak.getRegdateclean():"");
this.createCell(row1, 8, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(punishbreak.getPublishdateclean())?punishbreak.getPublishdateclean():"");
this.createCell(row1, 9, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(punishbreak.getCourtname())?punishbreak.getCourtname():"");
this.createCell(row1, 10, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(punishbreak.getAreanameclean())?punishbreak.getAreanameclean():"");
this.createCell(row1, 11, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(punishbreak.getGistid())?punishbreak.getGistid():"");
this.createCell(row1, 12, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(punishbreak.getGistunit())?punishbreak.getGistunit():"");
this.createCell(row1, 13, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(punishbreak.getDuty())?punishbreak.getDuty():"");
this.createCell(row1, 14, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(punishbreak.getDisrupttypename())?punishbreak.getDisrupttypename():"");
this.createCell(row1, 15, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(punishbreak.getPerformance())?punishbreak.getPerformance():"");
this.createCell(row1, 16, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(punishbreak.getPerformedpart())?punishbreak.getPerformedpart():"");
this.createCell(row1, 17, dataStyle, HSSFCell.CELL_TYPE_STRING,StringUtil.isNotNull(punishbreak.getUnperformpart())?punishbreak.getUnperformpart():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无失信被执行人信息");
}
i = 0;
//股权冻结历史信息
sheet = workbook.createSheet("股权冻结历史信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List sharesfrostList = this.sharesfrostList(gid);
if(null != sharesfrostList && sharesfrostList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "冻结文号");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"冻结机关");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"冻结起始日期");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"冻结截至日期");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"冻结金额");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"解冻机关");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"解冻文号");
this.createCell(row, 7, boldStyle, HSSFCell.CELL_TYPE_STRING,"解冻日期");
this.createCell(row, 8, boldStyle, HSSFCell.CELL_TYPE_STRING,"解冻说明");
Iterator it = sharesfrostList.iterator();
while(it.hasNext()) {
GSharesfrost sharesfrost = (GSharesfrost) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesfrost.getFrodocno())?sharesfrost.getFrodocno():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesfrost.getFroauth())?sharesfrost.getFroauth():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesfrost.getFrofrom())?sharesfrost.getFrofrom():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesfrost.getFroto())?sharesfrost.getFroto():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesfrost.getFroam())?sharesfrost.getFroam():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesfrost.getThawauth())?sharesfrost.getThawauth():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesfrost.getThawdocno())?sharesfrost.getThawdocno():"");
this.createCell(row1, 7, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesfrost.getThawdate())?sharesfrost.getThawdate():"");
this.createCell(row1, 8, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesfrost.getThawcomment())?sharesfrost.getThawcomment():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无股权冻结历史信息");
}
i = 0;
//股权出质历史信息
sheet = workbook.createSheet("股权出质历史信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List sharesimpawnList = this.sharesimpawnList(gid);
if(null != sharesimpawnList && sharesimpawnList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "质权人姓名");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"出质人类别");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"出质金额");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"出质备案日期");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"出质审批部门");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"出质批准日期");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"出质截至日期");
Iterator it = sharesimpawnList.iterator();
while(it.hasNext()) {
GSharesimpawn sharesimpawn = (GSharesimpawn) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesimpawn.getImporg())?sharesimpawn.getImporg():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesimpawn.getImporgtype())?sharesimpawn.getImporgtype():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesimpawn.getImpam())?sharesimpawn.getImpam():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesimpawn.getImponrecdate())?sharesimpawn.getImponrecdate():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesimpawn.getImpexaeep())?sharesimpawn.getImpexaeep():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesimpawn.getImpsandate())?sharesimpawn.getImpsandate():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(sharesimpawn.getImpto())?sharesimpawn.getImpto():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无股权出质历史信息");
}
i = 0;
//变更信息
sheet = workbook.createSheet("变更信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List alterList = this.queryAlterList(gid);
if(null != alterList && alterList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "变更项目");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"变更前内容");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"变更后内容");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"变更日期");
Iterator it = alterList.iterator();
while(it.hasNext()) {
GAlter alter = (GAlter) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(alter.getAltitem())?alter.getAltitem():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(alter.getAltbe())?alter.getAltbe():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(alter.getAltaf())?alter.getAltaf():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(alter.getAltdate())?alter.getAltdate():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无变更信息");
}
i = 0;
//变更信息
sheet = workbook.createSheet("清算信息");
// 设置列宽
this.setSheetColumnWidth(sheet, 22);
boldStyle = createBoldStyle(workbook); //获取粗体表头样式
dataStyle = createDataStyle(workbook); //获取标准样式
// List liquidationList = this.queryLiquidation(gid);
if(null != liquidationList && liquidationList.size() > 0){
row = sheet.createRow((short)0);
this.createCell(row, 0, boldStyle, HSSFCell.CELL_TYPE_STRING, "清算责任人");
this.createCell(row, 1, boldStyle, HSSFCell.CELL_TYPE_STRING,"清算负责人");
this.createCell(row, 2, boldStyle, HSSFCell.CELL_TYPE_STRING,"清算组成员");
this.createCell(row, 3, boldStyle, HSSFCell.CELL_TYPE_STRING,"清算完结情况");
this.createCell(row, 4, boldStyle, HSSFCell.CELL_TYPE_STRING,"清算完结日期");
this.createCell(row, 5, boldStyle, HSSFCell.CELL_TYPE_STRING,"债务承接人");
this.createCell(row, 6, boldStyle, HSSFCell.CELL_TYPE_STRING,"债权承接人");
Iterator it = liquidationList.iterator();
while(it.hasNext()) {
GLiquidation liquidation = (GLiquidation) it.next();
row1 = sheet.createRow((short) (i + 1));// 建立新行
this.createCell(row1, 0, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(liquidation.getLigentity())?liquidation.getLigentity():"");
this.createCell(row1, 1, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(liquidation.getLigprincipal())?liquidation.getLigprincipal():"");
this.createCell(row1, 2, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(liquidation.getLiqmen())?liquidation.getLiqmen():"");
this.createCell(row1, 3, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(liquidation.getLigst())?liquidation.getLigst():"");
this.createCell(row1, 4, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(liquidation.getLigenddate())?liquidation.getLigenddate():"");
this.createCell(row1, 5, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(liquidation.getDebttranee())?liquidation.getDebttranee():"");
this.createCell(row1, 6, dataStyle, HSSFCell.CELL_TYPE_STRING, StringUtil.isNotNull(liquidation.getClaimtranee())?liquidation.getClaimtranee():"");
i++;
}
}else{
this.createCell(sheet.createRow(0), 0, dataStyle, HSSFCell.CELL_TYPE_STRING, "暂无清算信息");
}
i = 0;
}catch(Exception e) {
throw new RuntimeException(e);
}
return workbook;
}
excel样式控制方法(项目中可以作为工具类中的静态方法)
private void setSheetColumnWidth(HSSFSheet sheet, int colNum) {
//根据数据记录设置列宽
for (int i=0; i<colNum; i++) {
sheet.setColumnWidth(i, 4000);
}
}
/**
* 设置Excel单元格文本样式(标准)
* @param wb
* @return
*/
private HSSFCellStyle createDataStyle(HSSFWorkbook wb) {
HSSFFont font = wb.createFont();
font.setFontHeight((short) 200);
HSSFCellStyle style = wb.createCellStyle();
style.setFont(font);
style.setDataFormat(HSSFDataFormat.getBuiltinFormat("###,##0.00"));
return style;
}
/**
* 设置Excel单元格文本样式(粗体)
* @param wb
* @return
*/
private HSSFCellStyle createBoldStyle(HSSFWorkbook wb) {
HSSFFont boldFont = wb.createFont();
boldFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
boldFont.setFontHeightInPoints((short)10);
HSSFCellStyle style = wb.createCellStyle();
style.setFont(boldFont);
return style;
}
//创建Excel单元格
private void createCell(HSSFRow row, int column, HSSFCellStyle style, int cellType, Object value) {
HSSFCell cell = row.createCell(column);
if (style != null) {
cell.setCellStyle(style);
}
switch (cellType) {
case HSSFCell.CELL_TYPE_BLANK: {
}
break;
case HSSFCell.CELL_TYPE_STRING: {
cell.setCellValue(value.toString());
}
break;
case HSSFCell.CELL_TYPE_NUMERIC: {
cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
cell.setCellValue(Double.parseDouble(value.toString()));
}
break;
default:
break;
}
}