TPssrOverhaulExchangerController.java 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. package com.ruoyi.project.pssr.controller;
  2. import com.alibaba.fastjson.JSON;
  3. import com.ruoyi.common.utils.DateUtils;
  4. import com.ruoyi.common.utils.StringUtils;
  5. import com.ruoyi.common.utils.file.ExcelUtils;
  6. import com.ruoyi.common.utils.poi.ExcelUtil;
  7. import com.ruoyi.framework.aspectj.lang.annotation.Log;
  8. import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
  9. import com.ruoyi.framework.web.controller.BaseController;
  10. import com.ruoyi.framework.web.domain.AjaxResult;
  11. import com.ruoyi.framework.web.page.TableDataInfo;
  12. import com.ruoyi.project.listener.pssr.ConfirmTaskCreateListener;
  13. import com.ruoyi.project.pssr.domain.TPssrApprove;
  14. import com.ruoyi.project.pssr.domain.TPssrOverhaulExchanger;
  15. import com.ruoyi.project.pssr.domain.TPssrSubcontent;
  16. import com.ruoyi.project.pssr.domain.TPssrTurndown;
  17. import com.ruoyi.project.pssr.mapper.TPssrOverhaulExchangerMapper;
  18. import com.ruoyi.project.pssr.service.*;
  19. import com.ruoyi.project.system.domain.SysDept;
  20. import com.ruoyi.project.system.domain.SysUser;
  21. import com.ruoyi.project.system.service.ISysDeptService;
  22. import com.ruoyi.project.system.service.ISysUserService;
  23. import org.activiti.engine.*;
  24. import org.activiti.engine.impl.identity.Authentication;
  25. import org.activiti.engine.runtime.ProcessInstance;
  26. import org.activiti.engine.task.Task;
  27. import org.apache.commons.collections4.CollectionUtils;
  28. import org.apache.poi.ss.usermodel.*;
  29. import org.apache.poi.xssf.usermodel.XSSFSheet;
  30. import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  31. import org.springframework.beans.factory.annotation.Autowired;
  32. import org.springframework.security.access.prepost.PreAuthorize;
  33. import org.springframework.web.bind.annotation.*;
  34. import org.springframework.web.multipart.MultipartFile;
  35. import javax.annotation.Resource;
  36. import java.io.FileOutputStream;
  37. import java.io.IOException;
  38. import java.io.InputStream;
  39. import java.io.OutputStream;
  40. import java.text.SimpleDateFormat;
  41. import java.util.*;
  42. /**
  43. * 检修项目-换热器Controller
  44. *
  45. * @author ssy
  46. * @date 2024-09-18
  47. */
  48. @RestController
  49. @RequestMapping("/pssr/overhaulExchanger")
  50. public class TPssrOverhaulExchangerController extends BaseController {
  51. @Resource
  52. private TPssrOverhaulExchangerMapper tPssrOverhaulExchangerMapper;
  53. @Autowired
  54. private ITPssrFileService tPssrFileService;
  55. @Autowired
  56. private ITPssrTurndownService tPssrTurndownService;
  57. @Autowired
  58. private ITPssrOverhaulExchangerService tPssrOverhaulExchangerService;
  59. @Autowired
  60. private ITPssrApproveService tPssrApproveService;
  61. @Autowired
  62. private RuntimeService runtimeService;
  63. @Autowired
  64. private HistoryService historyService;
  65. @Autowired
  66. private ITPssrSubcontentService tPssrSubcontentService;
  67. @Autowired
  68. private ISysUserService sysUserService;
  69. private String forShort = "jxxm-hrq";
  70. @Autowired
  71. private ISysDeptService iSysDeptService;
  72. @Autowired
  73. private ISysUserService userService;
  74. /**
  75. * 查询检修项目-换热器列表
  76. */
  77. @PreAuthorize("@ss.hasPermi('pssr:overhaulExchanger:list')")
  78. @GetMapping("/list")
  79. public TableDataInfo list(TPssrOverhaulExchanger tPssrOverhaulExchanger) {
  80. try {
  81. TPssrApprove approve = tPssrApproveService.selectTPssrApproveBySubId(tPssrOverhaulExchanger.getSubId());
  82. if (approve != null) {
  83. ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
  84. TaskService taskService = processEngine.getTaskService();
  85. Task task = processEngine.getTaskService()//获取任务service
  86. .createTaskQuery()//创建查询对象
  87. .taskAssignee(getUserId().toString())
  88. .processInstanceId(approve.getProcessId()).singleResult();
  89. if (task != null) {
  90. if (task.getName().equals("确认人")){
  91. tPssrOverhaulExchanger.setConfirmedPerson(getUserId().toString());
  92. }
  93. }
  94. }
  95. } catch (Exception e) {
  96. e.printStackTrace();
  97. logger.error("待办确认人查询报错:{}",e.getMessage());
  98. }
  99. if ("1".equals(tPssrOverhaulExchanger.getConfirmedPerson())) {
  100. tPssrOverhaulExchanger.setConfirmedPerson(getUserId().toString());
  101. }
  102. startPage();
  103. List<TPssrOverhaulExchanger> list = tPssrOverhaulExchangerService.selectTPssrOverhaulExchangerList(tPssrOverhaulExchanger);
  104. list.forEach(item -> {
  105. item.setFileList(tPssrFileService.selectTPssrFileListByItem(item.getSubId(), item.getId(), "jxxm-hrq"));
  106. if (item.getApproveStatus() != 2)
  107. item.setReason(tPssrTurndownService.selectTPssrTurndownByItem(item.getSubId(), item.getId(), "jxxm-hrq"));
  108. });
  109. return getDataTable(list);
  110. }
  111. /**
  112. * 导出检修项目-换热器列表
  113. */
  114. @PreAuthorize("@ss.hasPermi('pssr:overhaulExchanger:export')")
  115. @Log(title = "检修项目-换热器", businessType = BusinessType.EXPORT)
  116. @GetMapping("/export")
  117. public AjaxResult export(TPssrOverhaulExchanger tPssrOverhaulExchanger) {
  118. List<TPssrOverhaulExchanger> list = tPssrOverhaulExchangerService.selectTPssrOverhaulExchangerList(tPssrOverhaulExchanger);
  119. return AjaxResult.success(exportTmpl(list, tPssrOverhaulExchanger.getDevType()));
  120. }
  121. public String exportTmpl(List<TPssrOverhaulExchanger> list, Long devType) {
  122. OutputStream out = null;
  123. String filename = null;
  124. try {
  125. String tempUrl = "static/word/pssr/jxxmhrq.xlsx"; // 模板文件
  126. InputStream is = null;
  127. is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
  128. XSSFWorkbook wb = null;
  129. wb = new XSSFWorkbook(is);
  130. XSSFSheet sheet = wb.getSheetAt(0);
  131. switch (devType.toString()) {
  132. case "1":
  133. filename = "PSSR_01_检修项目_换热器" + ".xlsx";
  134. sheet.getRow(0).getCell(0).setCellValue("蒸汽裂解装置换热器检修清单");
  135. break;
  136. case "2":
  137. filename = "PSSR_01_检修项目_电仪" + ".xlsx";
  138. sheet.getRow(0).getCell(0).setCellValue("蒸汽裂解装置电仪检修清单");
  139. break;
  140. case "3":
  141. filename = "PSSR_01_检修项目_反应器" + ".xlsx";
  142. sheet.getRow(0).getCell(0).setCellValue("蒸汽裂解装置反应器检修清单");
  143. break;
  144. case "4":
  145. filename = "PSSR_01_检修项目_裂解炉" + ".xlsx";
  146. sheet.getRow(0).getCell(0).setCellValue("蒸汽裂解装置裂解炉检修清单");
  147. break;
  148. case "5":
  149. filename = "PSSR_01_检修项目_其他" + ".xlsx";
  150. sheet.getRow(0).getCell(0).setCellValue("蒸汽裂解装置其他检修清单");
  151. break;
  152. }
  153. //填充数据
  154. int rowIndex = 3;
  155. int num = 1;
  156. Row originalRow = sheet.getRow(3);
  157. Cell originalcell = originalRow.getCell(0);
  158. // 获取单元格样式
  159. CellStyle originalStyle = originalcell.getCellStyle();
  160. for (TPssrOverhaulExchanger t : list) {
  161. Row row = sheet.createRow(rowIndex);
  162. row.setHeight((short) 800);
  163. row.createCell(0).setCellValue(num);
  164. row.createCell(1).setCellValue(t.getTagNo());
  165. row.createCell(2).setCellValue(t.getEquipmentName());
  166. row.createCell(3).setCellValue(t.getPidNo());
  167. row.createCell(4).setCellValue(t.getWorkDes());
  168. row.createCell(5).setCellValue(t.getCompletionStatus());
  169. row.createCell(6);
  170. try {
  171. SysUser sysUser = sysUserService.selectUserById(Long.valueOf(t.getConfirmedPerson()));
  172. String confirm1 = sysUser.getSignUrl();
  173. ExcelUtils.insertPicture(wb, sheet, confirm1, row.getRowNum(), 6, 1, 1);
  174. } catch (NumberFormatException e) {
  175. throw new RuntimeException(e);
  176. }
  177. row.createCell(7).setCellValue(DateUtils.dateTime(t.getCompletionDate()));
  178. row.createCell(8).setCellValue(t.getRemarks());
  179. //渲染样式
  180. for (int i = 0; i < 9; i++) {
  181. row.getCell(i).setCellStyle(originalStyle);
  182. }
  183. num++;
  184. rowIndex++;
  185. }
  186. out = new FileOutputStream(ExcelUtil.getAbsoluteFile(filename));
  187. wb.write(out);
  188. wb.close();
  189. } catch (IOException e) {
  190. e.printStackTrace();
  191. }
  192. return filename;
  193. }
  194. /**
  195. * 获取检修项目-换热器详细信息
  196. */
  197. @PreAuthorize("@ss.hasPermi('pssr:overhaulExchanger:query')")
  198. @GetMapping(value = "/{id}")
  199. public AjaxResult getInfo(@PathVariable("id") Long id) {
  200. TPssrOverhaulExchanger item = tPssrOverhaulExchangerService.selectTPssrOverhaulExchangerById(id);
  201. item.setFileList(tPssrFileService.selectTPssrFileListByItem(item.getSubId(), item.getId(), "jxxm-hrq"));
  202. if (item.getApproveStatus() != 2)
  203. item.setReason(tPssrTurndownService.selectTPssrTurndownByItem(item.getSubId(), item.getId(), "jxxm-hrq"));
  204. return AjaxResult.success(item);
  205. }
  206. /**
  207. * 新增检修项目-换热器
  208. */
  209. @PreAuthorize("@ss.hasPermi('pssr:overhaulExchanger:add')")
  210. @Log(title = "检修项目-换热器", businessType = BusinessType.INSERT)
  211. @PostMapping
  212. public AjaxResult add(@RequestBody TPssrOverhaulExchanger tPssrOverhaulExchanger) {
  213. tPssrOverhaulExchanger.setApproveStatus(0L);
  214. return toAjax(insertOrUpdate(tPssrOverhaulExchanger));
  215. }
  216. //导入时判断更新或新增
  217. private int insertOrUpdate(TPssrOverhaulExchanger item) {
  218. TPssrOverhaulExchanger entity = new TPssrOverhaulExchanger();
  219. entity.setSubId(item.getSubId());
  220. entity.setTagNo(item.getTagNo());
  221. List<TPssrOverhaulExchanger> list = tPssrOverhaulExchangerService.selectTPssrOverhaulExchangerList(entity);
  222. if (CollectionUtils.isNotEmpty(list)) {
  223. item.setId(list.get(0).getId());
  224. return tPssrOverhaulExchangerService.updateTPssrOverhaulExchanger(item);
  225. }else{
  226. return tPssrOverhaulExchangerService.insertTPssrOverhaulExchanger(item);
  227. }
  228. }
  229. /**
  230. * 修改检修项目-换热器
  231. */
  232. @PreAuthorize("@ss.hasPermi('pssr:overhaulExchanger:edit')")
  233. @Log(title = "检修项目-换热器", businessType = BusinessType.UPDATE)
  234. @PutMapping
  235. public AjaxResult edit(@RequestBody TPssrOverhaulExchanger tPssrOverhaulExchanger) {
  236. TPssrOverhaulExchanger entity = tPssrOverhaulExchangerService.selectTPssrOverhaulExchangerById(tPssrOverhaulExchanger.getId());
  237. if (entity.getApproveStatus() != 1 && entity.getApproveStatus() != 0) {
  238. return AjaxResult.error("当前状态不可修改!");
  239. }
  240. tPssrFileService.updateFileRelevance(tPssrOverhaulExchanger.getFileIds(), "jxxm-hrq", tPssrOverhaulExchanger.getId(), tPssrOverhaulExchanger.getSubId());
  241. return toAjax(tPssrOverhaulExchangerService.updateTPssrOverhaulExchanger(tPssrOverhaulExchanger));
  242. }
  243. /**
  244. * 修改检修项目-换热器
  245. */
  246. @PreAuthorize("@ss.hasPermi('pssr:overhaulExchanger:edit')")
  247. @Log(title = "检修项目-换热器", businessType = BusinessType.UPDATE)
  248. @PutMapping("/editBatch")
  249. public AjaxResult editb(@RequestBody TPssrOverhaulExchanger tPssrOverhaulExchanger) {
  250. return toAjax(tPssrOverhaulExchangerMapper.updateTPssrOverhaulExchangerByIds(tPssrOverhaulExchanger));
  251. }
  252. /**
  253. * 删除检修项目-换热器
  254. */
  255. @PreAuthorize("@ss.hasPermi('pssr:overhaulExchanger:remove')")
  256. @Log(title = "检修项目-换热器", businessType = BusinessType.DELETE)
  257. @DeleteMapping("/{ids}")
  258. public AjaxResult remove(@PathVariable Long[] ids) {
  259. return toAjax(tPssrOverhaulExchangerService.deleteTPssrOverhaulExchangerByIds(ids));
  260. }
  261. /**
  262. * 确认检修项目-换热器
  263. */
  264. @PreAuthorize("@ss.hasPermi('pssr:overhaulExchanger:edit')")
  265. @Log(title = "检修项目-换热器", businessType = BusinessType.UPDATE)
  266. @PutMapping("/confirmExchanger")
  267. public AjaxResult confirmExchanger(@RequestBody TPssrOverhaulExchanger tPssrOverhaulExchanger) {
  268. if (tPssrOverhaulExchanger.getIds() != null && tPssrOverhaulExchanger.getIds().length > 0) {
  269. for (Long id : tPssrOverhaulExchanger.getIds()) {
  270. TPssrOverhaulExchanger exchanger = tPssrOverhaulExchangerService.selectTPssrOverhaulExchangerById(id);
  271. exchanger.setCompletionDate(new Date());
  272. exchanger.setApproveStatus(2L);
  273. exchanger.setUpdatedate(new Date());
  274. exchanger.setUpdaterCode(String.valueOf(getUserId()));
  275. tPssrOverhaulExchangerService.updateTPssrOverhaulExchanger(exchanger);
  276. }
  277. } else {
  278. TPssrOverhaulExchanger exchanger = new TPssrOverhaulExchanger();
  279. exchanger.setSubId(tPssrOverhaulExchanger.getSubId());
  280. exchanger.setConfirmedPerson(getUserId().toString());
  281. exchanger.setApproveStatus(1L);
  282. for (TPssrOverhaulExchanger overhaulExchanger : tPssrOverhaulExchangerService.selectTPssrOverhaulExchangerList(exchanger)) {
  283. overhaulExchanger.setCompletionDate(new Date());
  284. overhaulExchanger.setApproveStatus(2L);
  285. overhaulExchanger.setUpdatedate(new Date());
  286. overhaulExchanger.setUpdaterCode(String.valueOf(getUserId()));
  287. tPssrOverhaulExchangerService.updateTPssrOverhaulExchanger(overhaulExchanger);
  288. }
  289. }
  290. //查询当前待审批的确认人
  291. TPssrOverhaulExchanger entity = new TPssrOverhaulExchanger();
  292. entity.setSubId(tPssrOverhaulExchanger.getSubId());
  293. entity.setApproveStatus(1L);
  294. TPssrOverhaulExchanger exchanger = tPssrOverhaulExchangerService.selectAllConfirmedPersonBySubId(entity);
  295. if (exchanger != null) {
  296. String confirmedPerson = exchanger.getConfirmedPerson();
  297. logger.info("===========confirmedPerson:{}", confirmedPerson);
  298. //如果当前用户还有待审批任务
  299. if (confirmedPerson.contains(getUserId().toString())) {
  300. return AjaxResult.success();
  301. }
  302. }
  303. //无待审批任务结束当前用户流程
  304. // 因为流程关系所以approve一定会有且只有一条数据
  305. TPssrApprove tPssrApprove = tPssrApproveService.selectTPssrApproveBySubId(tPssrOverhaulExchanger.getSubId());
  306. TPssrApproveController.handleConfirmApprove(tPssrApprove, getUserId().toString());
  307. return AjaxResult.success();
  308. }
  309. @PutMapping("/turnDownExchanger")
  310. public AjaxResult turnDownExchanger(@RequestBody List<TPssrOverhaulExchanger> tPssrOverhaulExchanger) {
  311. if (CollectionUtils.isNotEmpty(tPssrOverhaulExchanger)) {
  312. String userId = getUserId().toString();
  313. Long subId = tPssrOverhaulExchanger.get(0).getSubId();
  314. // 修改已选择数据的状态
  315. for (TPssrOverhaulExchanger item : tPssrOverhaulExchanger) {
  316. TPssrOverhaulExchanger blind = new TPssrOverhaulExchanger();
  317. blind.setId(item.getId());
  318. blind.setApproveStatus(1L);
  319. blind.setUpdatedate(new Date());
  320. blind.setUpdaterCode(getUserId().toString());
  321. tPssrOverhaulExchangerService.updateTPssrOverhaulExchanger(blind);
  322. // 新增驳回原因数据
  323. TPssrTurndown turndown = new TPssrTurndown();
  324. turndown.setForShort(forShort);
  325. turndown.setSubId(item.getSubId());
  326. turndown.setItemId(item.getId());
  327. turndown.setReason(item.getReason());
  328. turndown.setCreatedate(new Date());
  329. turndown.setCreaterCode(getUserId().toString());
  330. tPssrTurndownService.insertTPssrTurndown(turndown);
  331. }
  332. // 查询当前流程
  333. TPssrApprove approve = tPssrApproveService.selectTPssrApproveBySubId(subId);
  334. try {
  335. runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr1confirm");
  336. historyService.deleteHistoricProcessInstance(approve.getProcessId());
  337. } catch (Exception e) {
  338. logger.info("无运行时流程");
  339. }
  340. // 驳回 查询所有待审批的人员
  341. //查询所有确认人
  342. TPssrOverhaulExchanger exchanger = new TPssrOverhaulExchanger();
  343. exchanger.setSubId(approve.getSubId());
  344. exchanger.setApproveStatus(1L);
  345. TPssrOverhaulExchanger overhaul = tPssrOverhaulExchangerService.selectAllConfirmedPersonBySubId(exchanger);
  346. String confirmers = null;
  347. if (overhaul != null) {
  348. confirmers = overhaul.getConfirmedPerson();
  349. }
  350. logger.info("=======================confirmers:{}", confirmers);
  351. Set<String> confirmUsers1 = new HashSet<>();
  352. if (StringUtils.isNotEmpty(confirmers)) {
  353. confirmUsers1.addAll(Arrays.asList(confirmers.split(",")));
  354. }
  355. // 开始申请流程
  356. long businessKey = approve.getApproveId();
  357. //开始工作流、监听
  358. Authentication.setAuthenticatedUserId(userId);//设置当前申请人
  359. Map<String, Object> variables = new HashMap<>();
  360. variables.put("applyUser", userId);
  361. variables.put("confirmUsers", new ArrayList<>(confirmUsers1));
  362. variables.put("confirmTaskCreateListener", new ConfirmTaskCreateListener());//发送邮件
  363. variables.put("chargePerson", approve.getSubCharge());
  364. //采用key来启动流程定义并设置流程变量,返回流程实例
  365. ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr1confirm", String.valueOf(businessKey), variables);
  366. // 修改审批表和sub表
  367. approve.setProcessId(pi.getProcessInstanceId());
  368. approve.setApproveStatus(1L);
  369. approve.setUpdatedate(new Date());
  370. approve.setUpdaterCode(getUserId().toString());
  371. tPssrApproveService.updateTPssrApprove(approve);
  372. TPssrSubcontent subcontent = new TPssrSubcontent();
  373. subcontent.setId(approve.getSubId());
  374. subcontent.setApproveStatus(1L);
  375. subcontent.setUpdatedate(new Date());
  376. subcontent.setUpdaterCode(getUserId().toString());
  377. tPssrSubcontentService.updateTPssrSubcontent(subcontent);
  378. return AjaxResult.success();
  379. }
  380. return AjaxResult.error();
  381. }
  382. /**
  383. * 批量导入
  384. */
  385. @PreAuthorize("@ss.hasPermi('pssr:overhaulExchanger:add')")
  386. @PostMapping("/importData")
  387. public AjaxResult importInterlockData(MultipartFile file, Long subId, Long devType) throws IOException {
  388. //获取操作人员ID
  389. Long userId = getUserId();
  390. //报错行数统计
  391. List<Integer> failRow = new ArrayList<Integer>();
  392. Workbook workbook = ExcelUtils.getWorkBook(file);
  393. Sheet sheet = workbook.getSheetAt(0);
  394. List<TPssrOverhaulExchanger> list = new ArrayList<TPssrOverhaulExchanger>();
  395. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  396. //部门查询
  397. List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
  398. int rowNum = sheet.getPhysicalNumberOfRows();
  399. int failNumber = 0;
  400. for (int i = 2; i <= rowNum; i++) {
  401. try {
  402. logger.info("读取行数:" + i);
  403. Row row = sheet.getRow(i);
  404. int cellNum = row.getLastCellNum();
  405. TPssrOverhaulExchanger entity = new TPssrOverhaulExchanger();
  406. entity.setDeptId(userService.selectUserById(getUserId()).getDeptId());
  407. entity.setSubId(subId);
  408. entity.setDevType(devType);
  409. entity.setApproveStatus(0L);
  410. for (int j = 0; j < cellNum; j++) {
  411. Cell cell = row.getCell(j);
  412. String cellValue = ExcelUtils.getCellValue(cell);
  413. logger.info("cellValue:" + cellValue);
  414. if (j == 0) {
  415. entity.setTagNo(cellValue);
  416. } else if (j == 1) {
  417. entity.setEquipmentName(cellValue);
  418. } else if (j == 2) {
  419. entity.setWorkDes(cellValue);
  420. } else if (j == 3) {
  421. entity.setPidNo(cellValue);
  422. }
  423. }
  424. entity.setCreaterCode(userId.toString());
  425. logger.info("entity:" + entity);
  426. list.add(entity);
  427. } catch (Exception e) {
  428. failNumber++;
  429. failRow.add(i + 1);
  430. }
  431. }
  432. int successNumber = 0;
  433. int failNum = 0;
  434. for (TPssrOverhaulExchanger t : list
  435. ) {
  436. failNum++;
  437. try {
  438. this.add(t);
  439. successNumber++;
  440. } catch (Exception e) {
  441. failNumber++;
  442. logger.info("e:" + e);
  443. failRow.add(failNum + 1);
  444. }
  445. }
  446. logger.info("list:" + JSON.toJSONString(list));
  447. logger.info("successNumber:" + String.valueOf(successNumber));
  448. logger.info("failNumber:" + String.valueOf(failNumber));
  449. logger.info("failRow:" + String.valueOf(failRow));
  450. return AjaxResult.success("导入成功行数:" + String.valueOf(successNumber));
  451. }
  452. }