679610546fec262ed4df3f7929e9d0a416b20c8c.svn-base 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. package UIB.UIB03.ZBS;
  2. import java.io.File;
  3. import java.net.URLDecoder;
  4. import java.util.Calendar;
  5. import java.util.HashMap;
  6. import UIB.COM.QRCodeHandler;
  7. import jxl.SheetSettings;
  8. import jxl.write.Label;
  9. import jxl.write.WritableImage;
  10. import jxl.write.WritableSheet;
  11. /**
  12. *
  13. * @desc B类模板,元素占据4个单元格
  14. * @author meiguiping
  15. * @date 2010 1:51:12 PM
  16. */
  17. public class QltyGuaranteeBuilderB implements IQltyGuaranteeBuilder
  18. {
  19. private int columns; //总行数
  20. private int rows; //总列数
  21. private WritableSheet wSheet;
  22. // private int fixedChemRow;
  23. // private int fixedQltyRow;
  24. public QltyGuaranteeBuilderB()
  25. {
  26. }
  27. public QltyGuaranteeBuilderB(WritableSheet sheet)
  28. {
  29. wSheet = sheet;
  30. columns = wSheet.getColumns();
  31. rows = wSheet.getRows();
  32. }
  33. /**
  34. * 1、填充模板行
  35. * 2、填充实际值(表头、成分、材质)
  36. * 3、合并单元格
  37. * 4、填充备注
  38. * @author meiguiping
  39. * @date Sep 20, 2010
  40. */
  41. public void buildQltyGuarantee(String tmplNO , HashMap mapHead ,DataRowList[] drlChem , DataRowList[] drlQlty) throws Exception
  42. {
  43. //获取配置参数
  44. QltyTmplParser qtp = new QltyTmplParser();
  45. HashMap hm = qtp.getParamer();
  46. if(hm.size() <= 0)
  47. {
  48. System.out.println("参数配置出错,请检查!");
  49. return;
  50. }
  51. HashMap proMap = (HashMap)hm.get(tmplNO+"ATT");
  52. HashMap picMap = (HashMap)hm.get(tmplNO+"PIC");
  53. HashMap codeMap = (HashMap)hm.get(tmplNO+"CODE");
  54. //System.out.println("图片========》》"+picMap+"\n"+proMap);
  55. int maxCoilNo = Integer.parseInt(proMap.get("maxCoilNo").toString()); //质保书最多容纳卷数
  56. int chemTmplRow = StringFormat.getNumber(proMap.get("chemTmplRow").toString());//成分模板行位置
  57. int qltyTmplRow = StringFormat.getNumber(proMap.get("qltyTmplRow").toString());//性能模板行位置
  58. int headStartRow = StringFormat.getNumber(proMap.get("headStartRow").toString());//表头开始行
  59. int headEndRow = StringFormat.getNumber(proMap.get("headEndRow").toString());//表头结束行
  60. int chemCDRow = StringFormat.getNumber(proMap.get("chemCDRow").toString());//元素名填充的行
  61. int chemValStartRow = StringFormat.getNumber(proMap.get("chemValStartRow").toString());//成分值开始填充行
  62. int chemValStartCol = StringFormat.getNumber(proMap.get("chemValStartCol").toString());//成分开始列
  63. int qltyValStartRow = StringFormat.getNumber(proMap.get("qltyValStartRow").toString());//性能开始行
  64. int qltyValStartCol = StringFormat.getNumber(proMap.get("qltyValStartCol").toString());//性能开始列
  65. int qltyGigNameRow = StringFormat.getNumber(proMap.get("qltyGigNameRow").toString());//性能大名称开始行
  66. int qltySmallNameRow = StringFormat.getNumber(proMap.get("qltySmallNameRow").toString());//性能小名称开始行
  67. int qltyExtCodeRow = StringFormat.getNumber(proMap.get("qltyExtCodeRow").toString());//性能附加信息填充行
  68. int rmkStartRow = StringFormat.getNumber(proMap.get("rmkStartRow").toString());//备注开始行
  69. int rmkStartCol = StringFormat.getNumber(proMap.get("rmkStartCol").toString());//备注开始列
  70. int tabulatorRow = StringFormat.getNumber(proMap.get("tabulatorRow").toString());//质表人开始行
  71. int tabulatorCol = StringFormat.getNumber(proMap.get("tabulatorCol").toString());//质表人开始列
  72. int cretNoDescRow = StringFormat.getNumber(proMap.get("cretNoDescRow").toString());//描述行
  73. int cretNoDescCol = StringFormat.getNumber(proMap.get("cretNoDescCol").toString());//描述列
  74. if(drlChem == null) throw new Exception("质保书异常,缺少成分记录。");
  75. int coilCount = drlChem.length; //SQL查询出来的实际卷数
  76. if(maxCoilNo < coilCount) throw new Exception("质保书最大容纳卷数小于实际质保书卷数");
  77. if(maxCoilNo >8 || maxCoilNo < 4) throw new Exception("一张质保书卷数应在4~8卷之间");
  78. ///补充拉力项目
  79. if(drlQlty.length != 0)
  80. {
  81. RowSetConverter.replenishPullItem(drlQlty[0]);//补充拉力项目
  82. }
  83. ///填充模板行
  84. setChemTmpl( drlChem[0] , chemTmplRow , chemValStartCol);//增加行操作对于元素代码填充行无影响,元素代码填充
  85. if(drlQlty.length != 0)
  86. {
  87. setQltyTmpl( drlQlty[0] , qltyTmplRow , qltyValStartCol , qltySmallNameRow );//模板行(材质)填充
  88. }
  89. ///填充实绩值
  90. setHeader( mapHead ,picMap , codeMap,headStartRow , headEndRow );//质保书表头填充
  91. setChem(drlChem , chemValStartRow , chemTmplRow , chemCDRow , proMap);//成分填充
  92. if(drlQlty.length != 0)
  93. {
  94. setQlty(drlQlty , qltyValStartRow , qltyTmplRow , proMap);//材质填充
  95. }
  96. //合并单元格
  97. if(drlQlty.length != 0)//无性能不考虑合并问题
  98. {
  99. mergeQltyCells(qltySmallNameRow);//材质小名称行
  100. mergeQltyCells(qltyGigNameRow);//材质大名称行
  101. mergeQltyCellsColumn(qltyGigNameRow , columns);
  102. }
  103. ///填充备注,制表人
  104. wSheet.addCell( new Label(rmkStartCol, rmkStartRow, mapHead.get("CRET_NO_RMK")==null?"": mapHead.get("CRET_NO_RMK").toString(),wSheet.getCell(rmkStartCol, rmkStartRow).getCellFormat() ) );
  105. wSheet.addCell( new Label(tabulatorCol, tabulatorRow, mapHead.get("USERID")==null?"": mapHead.get("USERID").toString(),wSheet.getCell(tabulatorCol, tabulatorRow).getCellFormat() ) );
  106. //wSheet.addCell( new Label(qltyValStartRow+drlQlty.length, qltyValStartRow+drlQlty.length, mapHead.get("CRET_NO_RMK")==null?"": mapHead.get("CRET_NO_RMK").toString(),wSheet.getCell(rmkStartCol, rmkStartRow).getCellFormat() ) );
  107. //wSheet.addCell( new Label(tabulatorCol, tabulatorRow, mapHead.get("USERID")==null?"": mapHead.get("USERID").toString(),wSheet.getCell(tabulatorCol, tabulatorRow).getCellFormat() ) );
  108. //质保书最后描述的填充
  109. //wSheet.addCell(new Label(cretNoDescCol , cretNoDescRow , mapHead.get("CRET_DESC") == null?"":mapHead.get("CRET_DESC").toString() ,wSheet.getCell(cretNoDescCol, cretNoDescRow).getCellFormat() ));
  110. if("B00005".equals(tmplNO))//军工模板特殊处理
  111. {
  112. String gradetype = mapHead.get("SPEC_STL_GRD").toString();
  113. gradetype=gradetype.substring(3);
  114. //动态获取军工的标准(CCSA牌号则获取A,CCS36则获取36,以此类推)
  115. wSheet.addCell(new Label(20 , 33 ,gradetype,wSheet.getCell(20, 33).getCellFormat() ));
  116. wSheet.addCell(new Label(25 , 34 ,gradetype,wSheet.getCell(25, 34).getCellFormat() ));
  117. }else
  118. {
  119. //质保书最后描述的填充,军工质保书固定描述,其他质保书动态填充
  120. wSheet.addCell(new Label(cretNoDescCol , cretNoDescRow , mapHead.get("CRET_DESC") == null?"":mapHead.get("CRET_DESC").toString() ,wSheet.getCell(cretNoDescCol, cretNoDescRow).getCellFormat() ));
  121. }
  122. // setImage(picMap);
  123. ///打印设置
  124. SheetSettings sheetSettings = wSheet.getSettings();
  125. // sheetSettings.setFitHeight(fh);
  126. // sheetSettings.setFitWidth(fw);//
  127. sheetSettings.setScaleFactor(100);//百分比形式
  128. ///删除模板行
  129. wSheet.removeRow(chemTmplRow);
  130. wSheet.removeRow(qltyTmplRow-1);
  131. }
  132. /**
  133. * 模板行的成分信息填充
  134. * @param tmplRow 原模板上录入成分实绩的行在当前操作副本上的行数,也就是成分开始的行
  135. * @param chemValStartCol 成分开始列
  136. */
  137. public void setChemTmpl(DataRowList drl , int tmplRow , int chemValStartCol) throws Exception
  138. {
  139. String key = "";
  140. String value = "";
  141. String extCode = "";
  142. for(int index =0 ; index < drl.size(); index++)
  143. {
  144. key = drl.getKey(index).toString();
  145. value = drl.getValue(index).toString();
  146. extCode = drl.getExtCode(index).toString();
  147. if("".equals(extCode))continue;//只填充元素名称
  148. for(int col = chemValStartCol ; col < columns; col++)
  149. {
  150. if( "".equals(wSheet.getCell(col, tmplRow).getContents().trim()))//判断是否已填充,只有成分元素才填充
  151. {
  152. wSheet.addCell(new Label(col , tmplRow, key /*, ExcelStyleSeter.getChemValuetyle(),wSheet.getCell(col, tmplRow).getCellFormat()*/));//模板行
  153. break;//因为首先是按元素名循环,所以元素被填充后,需要进入大循环的下一个元素循环
  154. }
  155. }
  156. }
  157. }
  158. /**
  159. * 模板行的材质信息填充
  160. * @param tmplRow 材质模板行
  161. * @param qltyValStartCol 材质开始列
  162. * @param qltySmallNameRow材质小名称开始行
  163. */
  164. public void setQltyTmpl(DataRowList drl , int tmplRow , int qltyValStartCol , int qltySmallNameRow ) throws Exception
  165. {
  166. String key = "";
  167. String smallName = "";
  168. String bigName = "";
  169. String extCode = "";
  170. for(int index =0 ; index < drl.size(); index++)
  171. {
  172. key = drl.getKey(index).toString();
  173. // value = drl.getValue(index).toString();
  174. smallName = drl.getSmallName(index).toString().replaceAll("&", "\n");//小名称不可以为空,所以不判断,若为空则直接抛出异常
  175. bigName = drl.getBigName(index)==null?"":drl.getBigName(index).toString().replaceAll("&", "\n");
  176. extCode = drl.getExtCode(index)==null?"":drl.getExtCode(index).toString();
  177. for(int col = qltyValStartCol ; col < columns; col++)
  178. {
  179. if( "".equals(wSheet.getCell(col, tmplRow).getContents().trim())
  180. && !"".equals(smallName) )//判断是否已填充,只有材质、位置等才填充,对钢卷号等信息不填充
  181. {
  182. wSheet.addCell(new Label(col , qltySmallNameRow-1 , bigName , ExcelStyleSeter.getQltyNameStyle() ));//大名称
  183. wSheet.addCell(new Label(col , qltySmallNameRow , smallName , ExcelStyleSeter.getQltyNameStyle() ));//材质名称行
  184. wSheet.addCell(new Label(col , qltySmallNameRow+1 , extCode , ExcelStyleSeter.getQltyNameStyle() ));//补充码
  185. //wSheet.addCell(new Label(col , qltySmallNameRow+2 , extCode , ExcelStyleSeter.getQltyNameStyle() ));//补充码
  186. wSheet.addCell(new Label(col , tmplRow , key , ExcelStyleSeter.getChemValuetyle()/*,wSheet.getCell(col, 16).getCellFormat()*/));//模板行
  187. break;//某一列被填充后退出列的循环,进入下一个元素的循环。否则第一个元素将填满模板
  188. }
  189. }
  190. }
  191. }
  192. /**
  193. * @desc 表头填充
  194. * @param map 表头数据如合同号均在该map中
  195. * @param picMap 存储图片
  196. * @param startRow 表头数据开始填充行
  197. * @param endRow 表头数据结束填充行
  198. * @throws Exception
  199. */
  200. public void setHeader(HashMap map , HashMap picMap ,HashMap codeMap , int startRow , int endRow) throws Exception
  201. {
  202. String key = "";
  203. //对表头所有的单元格进行循环,获取需要的质保书数据要求
  204. for(int row = 0 ; row <= endRow; row++)
  205. {
  206. for(int col = 0 ; col <= columns; col++)
  207. {
  208. key = wSheet.getCell(col, row).getContents().trim();//获取EXCEL中的文本内容
  209. if(key.equals("")||!key.startsWith("["))//EXCEL中内容为空,或者不以[开头的,则进入下个循环处理
  210. continue;
  211. key = key.replaceFirst("\\[", "").replaceFirst("\\]", "").trim();//将EXCEL中用"[]"括起来的内容提取出来
  212. if(map.get(key) == null)//map中可能不包含所要求的内容,进入下个循环。
  213. {
  214. wSheet.addCell(new Label(col , row , "" ,wSheet.getCell(col, row).getCellFormat()));//若无内容,则填入空
  215. }
  216. else
  217. {
  218. wSheet.addCell(new Label(col , row , map.get(key).toString() ,wSheet.getCell(col, row).getCellFormat()));
  219. }
  220. }
  221. }
  222. //增加图片
  223. Object pic1 = map.get("PIC1");//20180323解决图片无法读取---wl
  224. // Object pic2 = map.get("PIC2");
  225. if(pic1 != null)
  226. {
  227. // if(map == null)return;
  228. pic1=pic1+".png";
  229. double col = Double.parseDouble(picMap.get("imgStartCol").toString());//StringFormat.getNumber(picMap.get("imgStartCol").toString());;
  230. double row = Double.parseDouble(picMap.get("imgStartrow").toString());//StringFormat.getNumber(picMap.get("imgStartrow").toString());;
  231. double width = Double.parseDouble(picMap.get("imgWidth").toString());
  232. double height = Double.parseDouble(picMap.get("imgHeight").toString());
  233. // String filePath= Thread.currentThread().getContextClassLoader().getResource("").getPath()+map.get("name").toString();
  234. // String filePath= Thread.currentThread().getContextClassLoader().getResource("").getPath()+"excelConfig/"+pic1;
  235. String filePath= this.getClass().getClassLoader().getResource("/").getPath().replaceFirst("classes/", "")+"excelConfig/"+pic1;
  236. filePath =URLDecoder.decode(filePath,"utf-8");
  237. File file = new File(filePath);
  238. WritableImage wi = new WritableImage(col,row,width,height , file);
  239. wSheet.addImage(wi);
  240. }
  241. //增加二维码图片
  242. Object pic3 = map.get("PIC3");
  243. if(pic3 != null)
  244. {
  245. // if(map == null)return;
  246. //获取当前日期
  247. Calendar c = Calendar.getInstance();
  248. String p = pic3.toString();
  249. p = p.substring(0, 2)+c.get(Calendar.YEAR)+"-"+c.get(Calendar.MONTH)+"-"+c.get(Calendar.DATE)+"_"+c.get(Calendar.HOUR_OF_DAY)+"-"+c.get(Calendar.MINUTE)+"-"+c.get(Calendar.SECOND)+p.substring(2, 6);
  250. double col = Double.parseDouble(codeMap.get("imgStartCol").toString());//StringFormat.getNumber(picMap.get("imgStartCol").toString());;
  251. double row = Double.parseDouble(codeMap.get("imgStartrow").toString());//StringFormat.getNumber(picMap.get("imgStartrow").toString());;
  252. double width = Double.parseDouble(codeMap.get("imgWidth").toString());
  253. double height = Double.parseDouble(codeMap.get("imgHeight").toString());
  254. // String filePath= Thread.currentThread().getContextClassLoader().getResource("").getPath()+map.get("name").toString();
  255. // String filePath= Thread.currentThread().getContextClassLoader().getResource("").getPath()+"excelConfig/"+pic1;
  256. String filePath= this.getClass().getClassLoader().getResource("/").getPath().replaceFirst("classes/", "")+"excelConfig/"+p;
  257. filePath =URLDecoder.decode(filePath,"utf-8");
  258. //截取标准号,二维码里面暂时不显示精度
  259. String abbsym = map.get("SPEC_ABBSYM").toString();
  260. if(abbsym.indexOf(";")>0){
  261. abbsym = abbsym.substring(0,abbsym.indexOf(";"));
  262. }
  263. StringBuffer context =new StringBuffer();
  264. context.append("制造商:新余钢铁股份有限公司\n");
  265. context.append("牌号:").append(map.get("SPEC_STL_GRD")).append("\n");
  266. context.append("标准号:").append(abbsym).append("\n");
  267. context.append("交货状态:").append(map.get("PRDNM_CD")).append("\n");
  268. context.append("发货日期:").append(map.get("SHIP_DIR_DTIME")).append("\n");
  269. context.append("合同号:").append(map.get("ORD_NO")).append("\n");
  270. context.append("证明书编号:").append(map.get("CRET_NO")).append("\n");
  271. //生成二维码
  272. QRCodeHandler.QRCodeEncoder(context.toString(), filePath);
  273. //将二维码添加到模板
  274. File file = new File(filePath);
  275. WritableImage wi = new WritableImage(col,row,width,height , file);
  276. wSheet.addImage(wi);
  277. //保存二维码图片地址以便后面删除.
  278. map.put("cdPath", filePath);
  279. }
  280. }
  281. /**
  282. * @param chemValStartRow 成分实绩值填充起始行
  283. * @param tmplRow 成分模板行
  284. * @param chemCDRow 成分代码填充行(C、Si等名称)
  285. */
  286. public void setChem(DataRowList[] drl , int chemValStartRow , int tmplRow , int chemCDRow , HashMap map) throws Exception
  287. {
  288. int currentRow = chemValStartRow;
  289. String labelContent = "";//模板中的内容
  290. String afterLabelContent = "";
  291. int chemFlag = 0;
  292. for(int i = 0; i < drl.length; i++)
  293. {
  294. chemFlag = 0;
  295. //元素前的钢卷号等信息填充
  296. for(int col = 0 ; col < columns; col++)//元素前的钢卷号等信息填充
  297. {
  298. labelContent = wSheet.getCell(col , tmplRow).getContents().trim();
  299. if("".equals(labelContent))//若模板中成分行的内容为空
  300. continue;
  301. if(drl[i].getValue(labelContent)==null)//为null则进入下次循环
  302. continue;
  303. if("".equals(drl[i].getExtCode(labelContent)))//填充钢卷信息
  304. {
  305. wSheet.addCell( new Label(col , currentRow+i*2 , drl[i].getValue(labelContent).toString() , wSheet.getCell(col, tmplRow).getCellFormat()/*ExcelStyleSeter.getCommStyle()*/) );
  306. }
  307. else//填充元素值信息
  308. {
  309. if(chemFlag%2==0)
  310. {
  311. afterLabelContent = wSheet.getCell(col+1 , tmplRow).getContents().trim();
  312. //元素名
  313. wSheet.addCell(new Label(col , chemCDRow , labelContent , ExcelStyleSeter.getChemNametyle()) );
  314. wSheet.addCell(new Label(col , chemCDRow+2 , afterLabelContent , ExcelStyleSeter.getChemNametyle()) );
  315. //元素值
  316. wSheet.addCell(new Label(col , currentRow+i*2 , drl[i].getValue(labelContent)==null?"":drl[i].getValue(labelContent).toString() , ExcelStyleSeter.getChemValuetyle()) );
  317. wSheet.addCell(new Label(col , currentRow+i*2+1 , drl[i].getValue(afterLabelContent)==null?"":drl[i].getValue(afterLabelContent).toString() , ExcelStyleSeter.getChemValuetyle()) );
  318. }
  319. chemFlag++;
  320. }
  321. }
  322. }
  323. }
  324. /**
  325. *
  326. * @param drl
  327. * @param qltyValStartRow 材质实绩值填充起始行
  328. * @param tmplRow 材质模板行
  329. * @throws Exception
  330. */
  331. public void setQlty(DataRowList[] drl , int qltyValStartRow , int tmplRow , HashMap map) throws Exception
  332. {
  333. Label label = null;
  334. String labelContent = "";//模板中的内容
  335. for(int i = 0; i < drl.length; i++)
  336. {
  337. for(int col = 0 ; col < columns ; col++)
  338. {
  339. labelContent = wSheet.getCell(col, tmplRow).getContents().trim();
  340. if("".equals(labelContent))//为空则进行下一次循环
  341. continue;
  342. if(drl[i].getValue(labelContent) == null)//DataRowList中可能不包含所要求的内容,进入下个循环。
  343. continue;
  344. label = new Label( col,qltyValStartRow+i ,drl[i].getValue(labelContent).toString() ,wSheet.getCell(col, tmplRow).getCellFormat()/*ExcelStyleSeter.getQltyValueStyle()*/);
  345. wSheet.addCell(label);
  346. }
  347. }
  348. }
  349. /**
  350. * @desc 插入图片
  351. * @param map
  352. * @throws Exception
  353. */
  354. public void setImage(HashMap map )throws Exception
  355. {
  356. if(map == null)return;
  357. int col = StringFormat.getNumber(map.get("imgStartCol").toString());;
  358. int row = StringFormat.getNumber(map.get("imgStartrow").toString());;
  359. double width = Double.parseDouble(map.get("imgWidth").toString());
  360. double height = Double.parseDouble(map.get("imgHeight").toString());
  361. String filePath= Thread.currentThread().getContextClassLoader().getResource("").getPath()+map.get("name").toString();
  362. File file = new File(filePath);
  363. WritableImage wi = new WritableImage(col,row,width,height , file);
  364. wSheet.addImage(wi);
  365. }
  366. /**
  367. * @param currentRow 需要合并的行
  368. * @throws Exception
  369. */
  370. public void mergeQltyCells(int currentRow) throws Exception
  371. {
  372. String labelContent = "";
  373. String labelContentBefore = "";
  374. int count = 0;
  375. for(int col = 0; col <= columns; col++)
  376. {
  377. labelContent = wSheet.getCell(col , currentRow).getContents().trim();//当前单元格的值
  378. labelContentBefore = wSheet.getCell(col-1 , currentRow).getContents().trim();//之前一个单元格的值
  379. if(!labelContentBefore.equals(labelContent) && !"".equals(labelContentBefore) )//
  380. {
  381. if(count == 0)
  382. continue;
  383. wSheet.mergeCells((col-1)-count, currentRow, col-1, currentRow );
  384. count = 0;//合并后,重新归0
  385. }
  386. else if(!"".equals(labelContent) && !"".equals(labelContentBefore) )
  387. {
  388. count++;
  389. }
  390. }
  391. }
  392. /**
  393. * @desc 合同列,主要针对材质大名称、小名称的合并
  394. * @param currentRow
  395. */
  396. private void mergeQltyCellsColumn(int currentRow , int cols) throws Exception
  397. {
  398. String shangValue;
  399. String xiaValue;
  400. for(int i = 0; i < cols; i++)
  401. {
  402. shangValue = wSheet.getCell(i , currentRow).getContents().toString();
  403. xiaValue = wSheet.getCell(i , currentRow+1).getContents().toString();
  404. if(shangValue.equals(xiaValue) && !"".equals(shangValue))
  405. {
  406. wSheet.mergeCells( i, currentRow , i , currentRow+1);
  407. }
  408. }
  409. }
  410. }