From 5d15287b2a06f978485ac6af71e33e1a82b43a65 Mon Sep 17 00:00:00 2001 From: kimi <kimi42345@gmail.com> Date: 星期三, 15 四月 2020 16:29:55 +0800 Subject: [PATCH] fix 上传后生成版本连接池用完不释放问题 --- src/main/java/com/highdatas/mdm/controller/MaintainController.java | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/highdatas/mdm/controller/MaintainController.java b/src/main/java/com/highdatas/mdm/controller/MaintainController.java index 662d38c..c4f81d5 100644 --- a/src/main/java/com/highdatas/mdm/controller/MaintainController.java +++ b/src/main/java/com/highdatas/mdm/controller/MaintainController.java @@ -38,8 +38,7 @@ public class MaintainController { @Autowired IMaintainService maintainService; - @Autowired - ITUserService userService; + @Autowired IMaintainDetailService maintainDetailService; @Autowired @@ -93,7 +92,7 @@ @RequestMapping(value = "/version/{tableName}", method = RequestMethod.GET) public Result getHistory(@PathVariable String tableName, HttpServletRequest request) { - TUser user = (TUser) request.getSession().getAttribute("user"); + TUser user = DbUtils.getUser(request); String userId = user.getUserId(); Maintain maxVersion = maintainService.getMaxVersion(tableName); @@ -110,7 +109,7 @@ if (StringUtils.isEmpty(flowId)) { continue; } - boolean author = masterAuthorService.checkMaintainAuthor(userId, maintain.getId()); + boolean author = masterAuthorService.checkMaintainAuthor(user, maintain.getId()); if (!author) { continue; } @@ -199,8 +198,13 @@ continue; } String chargeId = record.getChargeId(); - TUser user = userService.selectOne(new EntityWrapper<TUser>().eq("user_id", chargeId)); - record.setChargeId(user.getUserName()); + TUser user = DbUtils.getUserById(chargeId); + if (user == null) { + record.setChargeId("鐢ㄦ埛宸插垹闄�"); + }else { + record.setChargeId(user.getUserName()); + } + resultObj.add(record); } result.setRecords(resultObj); -- Gitblit v1.8.0