| | |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.pojo.BatttestdataId; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.apache.poi.xwpf.usermodel.*; |
| | | import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr; |
| | | import org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge; |
| | |
| | | String poiJson = req.getParameter("json"); |
| | | POIWord poiWord = ActionUtil.getGson().fromJson(poiJson, POIWord.class); |
| | | List<TestDataInfDoc> list = bdataService.searchWordExport(poiWord); |
| | | String date = ActionUtil.sdfwithtime_yyyyMMdd_HH_mm_ss.format(new Date()); |
| | | //String date = ActionUtil.sdfwithtime_yyyyMMdd_HH_mm_ss.format(new Date()); |
| | | String date = ThreadLocalUtil.format(new Date(),6); |
| | | String fileName = "doc_" + date + "文件"; |
| | | XWPFDocument doc = new XWPFDocument(); |
| | | //标题 |
| | |
| | | mapRow.put("l1", "放电时间"); |
| | | for (int j = 0; j < lineCount; j++) { |
| | | TestDataInfDoc infDoc = list.get(j); |
| | | mapRow.put("l" + (j + 2), ActionUtil.sdfwithtime.format(infDoc.getRecordTime())); |
| | | mapRow.put("l" + (j + 2), ActionUtil.secToTime(infDoc.getTestTimelong())); |
| | | } |
| | | } else if (i == 1) { |
| | | mapRow.put("l1", "总电压(V)"); |
| | |
| | | //第九行数据 |
| | | Map<String, String> rowMap9 = new HashMap<>(); |
| | | rowMap9.put("l1", "记录"); |
| | | rowMap9.put("l2", "实测蓄电池电压值(v)"); |
| | | rowMap9.put("l2", "实测蓄电池电压值(V)"); |
| | | rowMap9.put("l3", ""); |
| | | rowMap9.put("l4", ""); |
| | | rowMap9.put("l5", "" + poiWord.getParamRecordVol2()); |