TSpecdevGlController.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. package com.ruoyi.project.sems.controller;
  2. import java.io.FileOutputStream;
  3. import java.io.IOException;
  4. import java.io.OutputStream;
  5. import java.text.SimpleDateFormat;
  6. import java.util.ArrayList;
  7. import java.util.List;
  8. import com.alibaba.fastjson.JSON;
  9. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  10. import com.ruoyi.common.utils.DateUtils;
  11. import com.ruoyi.common.utils.file.ExcelUtils;
  12. import com.ruoyi.project.sems.domain.*;
  13. import com.ruoyi.project.sems.service.ITSpecCheckService;
  14. import com.ruoyi.project.system.domain.SysDept;
  15. import com.ruoyi.project.system.domain.SysDictData;
  16. import com.ruoyi.project.system.service.ISysDeptService;
  17. import com.ruoyi.project.system.service.ISysDictTypeService;
  18. import org.apache.poi.ss.usermodel.*;
  19. import org.apache.poi.xssf.streaming.SXSSFWorkbook;
  20. import org.springframework.security.access.prepost.PreAuthorize;
  21. import org.springframework.beans.factory.annotation.Autowired;
  22. import org.springframework.web.bind.annotation.*;
  23. import com.ruoyi.framework.aspectj.lang.annotation.Log;
  24. import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
  25. import com.ruoyi.project.sems.service.ITSpecdevGlService;
  26. import com.ruoyi.framework.web.controller.BaseController;
  27. import com.ruoyi.framework.web.domain.AjaxResult;
  28. import com.ruoyi.common.utils.poi.ExcelUtil;
  29. import com.ruoyi.framework.web.page.TableDataInfo;
  30. import org.springframework.web.multipart.MultipartFile;
  31. /**
  32. * 特种设备锅炉台账Controller
  33. *
  34. * @author ruoyi
  35. * @date 2021-07-21
  36. */
  37. @RestController
  38. @RequestMapping("/sems/specGl")
  39. public class TSpecdevGlController extends BaseController
  40. {
  41. @Autowired
  42. private ITSpecdevGlService tSpecdevGlService;
  43. @Autowired
  44. private ITSpecCheckService tSpecCheckService;
  45. @Autowired
  46. private ISysDeptService iSysDeptService;
  47. @Autowired
  48. private ISysDictTypeService iSysDictTypeService;
  49. /**
  50. * 查询特种设备锅炉台账列表
  51. */
  52. @PreAuthorize("@ss.hasPermi('sems:specGl:list')")
  53. @GetMapping("/list")
  54. public TableDataInfo list(TSpecdevGl tSpecdevGl)
  55. {
  56. startPage();
  57. List<TSpecdevGl> list = tSpecdevGlService.selectTSpecdevGlList(tSpecdevGl);
  58. return getDataTable(list);
  59. }
  60. /**
  61. * 导出特种设备锅炉台账列表
  62. */
  63. @PreAuthorize("@ss.hasPermi('sems:specGl:export')")
  64. @Log(title = "特种设备锅炉台账", businessType = BusinessType.EXPORT)
  65. @GetMapping("/export")
  66. public AjaxResult export(TSpecdevGl tSpecdevGl)
  67. {
  68. List<TSpecdevGl> list = tSpecdevGlService.selectTSpecdevGlList(tSpecdevGl);
  69. ExcelUtil<TSpecdevGl> util = new ExcelUtil<TSpecdevGl>(TSpecdevGl.class);
  70. return util.exportExcel(list, "specGl");
  71. }
  72. /**
  73. * 获取特种设备锅炉台账详细信息
  74. */
  75. @PreAuthorize("@ss.hasPermi('sems:specGl:query')")
  76. @GetMapping(value = "/{id}")
  77. public AjaxResult getInfo(@PathVariable("id") Long id)
  78. {
  79. return AjaxResult.success(tSpecdevGlService.selectTSpecdevGlById(id));
  80. }
  81. /**
  82. * 新增特种设备锅炉台账
  83. */
  84. @PreAuthorize("@ss.hasPermi('sems:specGl:add')")
  85. @Log(title = "特种设备锅炉台账", businessType = BusinessType.INSERT)
  86. @PostMapping
  87. public AjaxResult add(@RequestBody TSpecdevGl tSpecdevGl)
  88. {
  89. return toAjax(tSpecdevGlService.insertTSpecdevGl(tSpecdevGl));
  90. }
  91. /**
  92. * 修改特种设备锅炉台账
  93. */
  94. @PreAuthorize("@ss.hasPermi('sems:specGl:edit')")
  95. @Log(title = "特种设备锅炉台账", businessType = BusinessType.UPDATE)
  96. @PutMapping
  97. public AjaxResult edit(@RequestBody TSpecdevGl tSpecdevGl)
  98. {
  99. TSpecdevGl old = tSpecdevGlService.selectTSpecdevGlById(tSpecdevGl.getId());
  100. if (!old.getReportNo().equals(tSpecdevGl.getReportNo())) {
  101. TSpecCheck tc = new TSpecCheck();
  102. tc.setDevType(4l);
  103. tc.setCheckUnit(tSpecdevGl.getCheckUnit());
  104. tc.setDevId(tSpecdevGl.getId());
  105. tc.setNextWarnDate(tSpecdevGl.getNextWarnDate());
  106. tc.setReportNo(tSpecdevGl.getReportNo());
  107. tc.setWarnDate(tSpecdevGl.getWarnDate());
  108. tc.setOutWarnDate(tSpecdevGl.getOutWarnDate());
  109. tc.setOutReportNo(tSpecdevGl.getOutReportNo());
  110. tc.setOutCheckConclusion(tSpecdevGl.getOutCheckConclusion());
  111. tc.setOutNextWarnDate(tSpecdevGl.getOutNextWarnDate());
  112. tSpecCheckService.insertTSpecCheck(tc);
  113. }
  114. return toAjax(tSpecdevGlService.updateTSpecdevGl(tSpecdevGl));
  115. }
  116. /**
  117. * 删除特种设备锅炉台账
  118. */
  119. @PreAuthorize("@ss.hasPermi('sems:specGl:remove')")
  120. @Log(title = "特种设备锅炉台账", businessType = BusinessType.DELETE)
  121. @DeleteMapping("/{ids}")
  122. public AjaxResult remove(@PathVariable Long[] ids)
  123. {
  124. return toAjax(tSpecdevGlService.deleteTSpecdevGlByIds(ids));
  125. }
  126. /**
  127. * 去重
  128. */
  129. @PreAuthorize("@ss.hasPermi('sems:plant:remove')")
  130. @GetMapping("/duplicate")
  131. public AjaxResult duplicate()
  132. {
  133. tSpecdevGlService.duplicateTSpecdevGl();
  134. return AjaxResult.success();
  135. }
  136. /**
  137. * 批量导入
  138. */
  139. @PreAuthorize("@ss.hasPermi('sems:specGl:add')")
  140. @Log(title = "特种设备批量导入", businessType = BusinessType.INSERT)
  141. @PostMapping("/importData")
  142. public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException
  143. {
  144. //获取操作人员ID
  145. Long userId = getUserId();
  146. //报错行数统计
  147. List<Integer> failRow =new ArrayList<Integer>();
  148. Workbook workbook = ExcelUtils.getWorkBook(file);
  149. Sheet sheet = workbook.getSheetAt(0);
  150. List<TSpecdevGl> list = new ArrayList<TSpecdevGl>();
  151. //字典查询
  152. List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
  153. //部门查询
  154. List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
  155. int rowNum = sheet.getPhysicalNumberOfRows();
  156. int failNumber = 0;
  157. for (int i = 1; i < rowNum; i++) {
  158. try {
  159. logger.info("读取行数:" + i);
  160. Row row = sheet.getRow(i);
  161. int cellNum = row.getLastCellNum();
  162. TSpecdevGl entity = new TSpecdevGl();
  163. for (int j = 0; j < cellNum; j++) {
  164. Cell cell = row.getCell(j);
  165. if (cell == null) {
  166. continue;
  167. }
  168. String cellValue = ExcelUtils.getCellValue(cell);
  169. logger.info("cellValue:" + cellValue);
  170. if (j == 0) {
  171. //序号
  172. } else if (j == 1) {
  173. entity.setPlantCode(cellValue);//装置名称
  174. } else if (j == 2) {
  175. entity.setUnit(cellValue);//单元
  176. } else if (j == 3) {
  177. entity.setPlantMaint(cellValue);//装置维修组
  178. } else if (j == 4) {
  179. entity.setEngineer(cellValue);//装置维修工程师
  180. } else if (j == 5) {
  181. entity.setDevno(cellValue);//位号
  182. } else if (j == 6) {
  183. entity.setDevname(cellValue);//设备名称
  184. } else if (j == 7) {
  185. entity.setModel(cellValue);//型号
  186. } else if (j == 8) {
  187. entity.setUseno(cellValue);//使用证号
  188. } else if (j == 9) {
  189. entity.setRegno(cellValue);//注册编号
  190. } else if (j == 10) {
  191. entity.setCreateUnit(cellValue);//制造单位
  192. } else if (j == 11) {
  193. entity.setBurnMode(cellValue);//燃烧方式
  194. } else if (j == 12) {
  195. entity.setWaterMode(cellValue);//水处理方式
  196. } else if (j == 13) {
  197. entity.setBurnKind(cellValue);//燃烧种类
  198. } else if (j == 14) {
  199. entity.setRatedPower(cellValue);//额定出力
  200. } else if (j == 15) {
  201. entity.setDesTemp(cellValue);//设计温度
  202. } else if (j == 16) {
  203. entity.setOptTemp(cellValue);//操作温度
  204. } else if (j == 17) {
  205. entity.setDesPressure(cellValue);//设计压力
  206. } else if (j == 18) {
  207. entity.setOptPressure(cellValue);//操作压力
  208. } else if (j == 19) {
  209. if (cellValue.length() > 3) {//投用日期
  210. entity.setSubmitdate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
  211. }
  212. } else if (j == 20) {
  213. entity.setCheckUnit(cellValue);//检验单位
  214. } else if (j == 21) {
  215. if (cellValue.length() > 3) {//本次内部检验日期
  216. entity.setWarnDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
  217. }
  218. } else if (j == 22) {
  219. entity.setCheckConclusion(cellValue);//内部检验结论
  220. } else if (j == 23) {
  221. entity.setReportNo(cellValue);//内部检验报告编号
  222. } else if (j == 24) {
  223. if (cellValue.length() > 3) {//下次内部检验日期
  224. entity.setNextWarnDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
  225. }
  226. } else if (j == 25) {
  227. if (cellValue.length() > 3) {//本次外部检验日期
  228. entity.setOutWarnDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
  229. }
  230. } else if (j == 26) {
  231. entity.setOutCheckConclusion(cellValue);//外部检验结论
  232. } else if (j == 27) {
  233. entity.setOutReportNo(cellValue);//外部检验报告编号
  234. } else if (j == 28) {
  235. if (cellValue.length() > 3) {//下次外部检验日期
  236. entity.setOutNextWarnDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
  237. }
  238. } else if (j == 29) {
  239. entity.setRemarks(cellValue);//备注
  240. }/*else if (j == 30) {
  241. for (SysDept d : dept) {
  242. if (d.getDeptName().equals(cellValue)) {
  243. entity.setDeptId(d.getDeptId());//部门编号
  244. }
  245. }
  246. }*/
  247. }
  248. entity.setCreaterCode(userId.toString());
  249. logger.info("entity:" + entity);
  250. list.add(entity);
  251. }catch (Exception e){
  252. failNumber++;
  253. logger.info("e:" + JSON.toJSONString(e));
  254. failRow.add(i + 1);
  255. }
  256. }
  257. int successNumber = 0;
  258. int failNum = 0;
  259. for (TSpecdevGl t : list
  260. ) {
  261. failNum++;
  262. try {
  263. tSpecdevGlService.insertTSpecdevGl(t);
  264. successNumber++;
  265. }catch (Exception e){
  266. failNumber++;
  267. logger.info("e:" + e);
  268. failRow.add(failNum + 1);
  269. }
  270. }
  271. logger.info("list:" + JSON.toJSONString(list));
  272. logger.info("successNumber:" +String.valueOf(successNumber));
  273. logger.info("failNumber:" +String.valueOf(failNumber));
  274. logger.info("failRow:" +String.valueOf(failRow));
  275. return AjaxResult.success(String.valueOf(successNumber), failRow);
  276. }
  277. /**
  278. * 批量导入
  279. * 检验更新导入
  280. */
  281. @PreAuthorize("@ss.hasPermi('sems:specGl:add')")
  282. @Log(title = "特种设备批量导入", businessType = BusinessType.INSERT)
  283. @PostMapping("/updateData")
  284. public AjaxResult updateData(@RequestParam("file") MultipartFile file) throws IOException
  285. {
  286. //获取操作人员ID
  287. Long userId = getUserId();
  288. //报错行数统计
  289. List<Integer> failRow =new ArrayList<Integer>();
  290. Workbook workbook = ExcelUtils.getWorkBook(file);
  291. Sheet sheet = workbook.getSheetAt(0);
  292. List<TSpecdevGl> list = new ArrayList<TSpecdevGl>();
  293. List<TSpecdevGl> oldList = new ArrayList<TSpecdevGl>();
  294. TSpecdevGl oldEntity = new TSpecdevGl();
  295. //字典查询
  296. List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
  297. //部门查询
  298. List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
  299. int rowNum = sheet.getPhysicalNumberOfRows();
  300. int failNumber = 0;
  301. for (int i = 1; i < rowNum; i++) {
  302. try {
  303. logger.info("读取行数:" + i);
  304. Row row = sheet.getRow(i);
  305. int cellNum = row.getLastCellNum();
  306. TSpecdevGl entity = new TSpecdevGl();
  307. for (int j = 0; j < cellNum; j++) {
  308. Cell cell = row.getCell(j);
  309. if (cell == null) {
  310. continue;
  311. }
  312. String cellValue = ExcelUtils.getCellValue(cell);
  313. logger.info("cellValue:" + cellValue);
  314. if (j == 0) {
  315. //序号
  316. Double d = Double.parseDouble(cellValue);
  317. long s = new Double(d).longValue();
  318. entity.setId(s);
  319. } else if (j == 1) {
  320. entity.setPlantCode(cellValue);//装置名称
  321. } else if (j == 2) {
  322. entity.setDevno(cellValue);//位号
  323. } else if (j == 3) {
  324. entity.setDevname(cellValue);//设备名称
  325. } else if (j == 4) {
  326. entity.setUseno(cellValue);//使用证号
  327. } else if (j == 5) {
  328. entity.setCheckUnit(cellValue);//检验单位
  329. } else if (j == 6) {
  330. logger.info("日期格式:" + cellValue);
  331. if (cellValue.length() > 3) {//本次内部检验日期
  332. entity.setWarnDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
  333. }
  334. } else if (j == 7) {
  335. entity.setCheckConclusion(cellValue);//内部检验结论
  336. } else if (j == 8) {
  337. entity.setReportNo(cellValue);//内部检验报告编号
  338. } else if (j == 9) {
  339. logger.info("日期格式:" + cellValue);
  340. if (cellValue.length() > 3) {//下次内部检验日期
  341. entity.setNextWarnDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
  342. }
  343. } else if (j == 10) {
  344. logger.info("日期格式:" + cellValue);
  345. if (cellValue.length() > 3) {//本次外部检验日期
  346. entity.setOutWarnDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
  347. }
  348. } else if (j == 11) {
  349. entity.setOutCheckConclusion(cellValue);//外部检验结论
  350. } else if (j == 12) {
  351. entity.setOutReportNo(cellValue);//外部检验报告编号
  352. } else if (j == 13) {
  353. logger.info("日期格式:" + cellValue);
  354. if (cellValue.length() > 3) {//下次外部检验日期
  355. entity.setOutNextWarnDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
  356. }
  357. }
  358. }
  359. logger.info("entity:" + JSON.toJSONString(entity));
  360. list.add(entity);
  361. oldEntity = entity;
  362. oldList.add(oldEntity);
  363. }catch (Exception e){
  364. failNumber++;
  365. logger.info("e:" + JSON.toJSONString(e));
  366. failRow.add(i + 1);
  367. }
  368. }
  369. int successNumber = 0;
  370. int failNum = 0;
  371. for (TSpecdevGl t : list) {
  372. failNum++;
  373. try {
  374. tSpecdevGlService
  375. .update(t,
  376. new QueryWrapper<TSpecdevGl>()
  377. .eq("USENO", t.getUseno())
  378. .eq("PLANT_CODE", t.getPlantCode())
  379. );
  380. successNumber++;
  381. }catch (Exception e){
  382. failNumber++;
  383. logger.info("e:" + e);
  384. failRow.add(failNum + 1);
  385. e.printStackTrace();
  386. }
  387. }
  388. for (TSpecdevGl t : oldList) {
  389. TSpecCheck tc = new TSpecCheck();
  390. tc.setDevType(4l);
  391. tc.setCheckUnit(t.getCheckUnit());
  392. tc.setDevId(t.getId());
  393. tc.setNextWarnDate(t.getNextWarnDate());
  394. tc.setReportNo(t.getReportNo());
  395. tc.setWarnDate(t.getWarnDate());
  396. tc.setOutWarnDate(t.getOutWarnDate());
  397. tc.setOutReportNo(t.getOutReportNo());
  398. tc.setOutCheckConclusion(t.getOutCheckConclusion());
  399. tc.setOutNextWarnDate(t.getOutNextWarnDate());
  400. tSpecCheckService.insertTSpecCheck(tc);
  401. }
  402. logger.info("list:" + JSON.toJSONString(list));
  403. logger.info("successNumber:" +String.valueOf(successNumber));
  404. logger.info("failNumber:" +String.valueOf(failNumber));
  405. logger.info("failRow:" +String.valueOf(failRow));
  406. return AjaxResult.success(String.valueOf(successNumber), failRow);
  407. }
  408. @GetMapping("/exportDevList")
  409. public AjaxResult exportbmy(ParamData params) throws IOException {
  410. logger.info(JSON.toJSONString(params));
  411. String id = params.getIds();
  412. String[] ids = id.split(",");
  413. List<TSpecdevGl> list = new ArrayList<>();
  414. for (String i : ids
  415. ) {
  416. TSpecdevGl t = tSpecdevGlService.getById(i);
  417. list.add(t);
  418. }
  419. SXSSFWorkbook wb = new SXSSFWorkbook(1000);
  420. CellStyle wrapStyle = wb.createCellStyle();
  421. wrapStyle.setWrapText(true); //设置自动换行
  422. //创建sheet页
  423. Sheet sheet = wb.createSheet("sheet1");
  424. //设置列的宽度,第一个参数为列的序号,从0开始,第二参数为列宽,单位1/256个字节
  425. sheet.setColumnWidth(0, 12*256);
  426. sheet.setColumnWidth(1, 26*256);
  427. sheet.setColumnWidth(2, 26*256);
  428. sheet.setColumnWidth(3, 26*256);
  429. sheet.setColumnWidth(4, 26*256);
  430. sheet.setColumnWidth(5, 26*256);
  431. sheet.setColumnWidth(6, 26*256);
  432. sheet.setColumnWidth(7, 26*256);
  433. sheet.setColumnWidth(8, 40*256);
  434. sheet.setColumnWidth(9, 40*256);
  435. sheet.setColumnWidth(10, 26*256);
  436. sheet.setColumnWidth(11, 26*256);
  437. sheet.setColumnWidth(12, 40*256);
  438. sheet.setColumnWidth(13, 40*256);
  439. //设置开始行和开始列
  440. Row row0 = sheet.createRow(0);
  441. CellStyle style = wb.createCellStyle();
  442. style.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
  443. style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
  444. // Font headerFont = wb.createFont();
  445. // headerFont.setFontName("Arial");
  446. // headerFont.setFontHeightInPoints((short) 12);
  447. // headerFont.setBold(false);
  448. // headerFont.setColor(IndexedColors.BLACK.getIndex());
  449. // style.setFont(headerFont);
  450. Cell cell0 = row0.createCell(0);
  451. row0.createCell(0).setCellValue("序号");
  452. row0.createCell(1).setCellValue("装置");
  453. row0.createCell(2).setCellValue("设备位号");
  454. row0.createCell(3).setCellValue("设备名称");
  455. row0.createCell(4).setCellValue("使用证号码");
  456. row0.createCell(5).setCellValue("检验单位");row0.getCell(5).setCellStyle(style);
  457. row0.createCell(6).setCellValue("本次内部检验日期");row0.getCell(6).setCellStyle(style);
  458. row0.createCell(7).setCellValue("内部检验结论");row0.getCell(7).setCellStyle(style);
  459. row0.createCell(8).setCellValue("内部检验报告编号");row0.getCell(8).setCellStyle(style);
  460. row0.createCell(9).setCellValue("下次内部检验日期");row0.getCell(9).setCellStyle(style);
  461. row0.createCell(10).setCellValue("本次外部检验日期");row0.getCell(10).setCellStyle(style);
  462. row0.createCell(11).setCellValue("外部检验结论");row0.getCell(11).setCellStyle(style);
  463. row0.createCell(12).setCellValue("外部检验报告编号");row0.getCell(12).setCellStyle(style);
  464. row0.createCell(13).setCellValue("下次外部检验日期");row0.getCell(13).setCellStyle(style);
  465. //填充数据
  466. int rowIndex = 1;
  467. int columnIndex = 1;
  468. for (TSpecdevGl t: list
  469. ) {
  470. Row row = sheet.createRow(rowIndex);
  471. row.createCell(0).setCellValue(t.getId());
  472. row.createCell(1).setCellValue(t.getPlantCode());
  473. row.createCell(2).setCellValue(t.getDevno());
  474. row.createCell(3).setCellValue(t.getDevname());
  475. row.createCell(4).setCellValue(t.getUseno());
  476. row.createCell(5).setCellValue(t.getCheckUnit());
  477. if (t.getWarnDate()!= null){
  478. row.createCell(6).setCellValue(new SimpleDateFormat("yyyy-MM-dd").format(t.getWarnDate()));
  479. }
  480. row.createCell(7).setCellValue(t.getCheckConclusion());
  481. row.createCell(8).setCellValue(t.getReportNo());
  482. if (t.getNextWarnDate()!= null){
  483. row.createCell(9).setCellValue(new SimpleDateFormat("yyyy-MM-dd").format(t.getNextWarnDate()));
  484. }
  485. if (t.getOutWarnDate()!= null){
  486. row.createCell(10).setCellValue(new SimpleDateFormat("yyyy-MM-dd").format(t.getOutWarnDate()));
  487. }
  488. row.createCell(11).setCellValue(t.getOutCheckConclusion());
  489. row.createCell(12).setCellValue(t.getOutReportNo());
  490. if (t.getOutNextWarnDate()!= null){
  491. row.createCell(13).setCellValue(new SimpleDateFormat("yyyy-MM-dd").format(t.getOutNextWarnDate()));
  492. }
  493. rowIndex++;
  494. }
  495. OutputStream out = null;
  496. String filename = ExcelUtil.encodingFilename("锅炉批量更新");
  497. out = new FileOutputStream(ExcelUtil.getAbsoluteFile(filename));
  498. wb.write(out);
  499. wb.close();
  500. out.close();
  501. return AjaxResult.success(filename);
  502. }
  503. }