From 74472c9d22dddcb41383794caf0011043b20f817 Mon Sep 17 00:00:00 2001 From: kimi <kimi42345@gmail.com> Date: 星期二, 31 三月 2020 13:25:47 +0800 Subject: [PATCH] fix 数据权限 --- src/main/java/com/highdatas/mdm/controller/MaintainController.java | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/highdatas/mdm/controller/MaintainController.java b/src/main/java/com/highdatas/mdm/controller/MaintainController.java index 653e623..662d38c 100644 --- a/src/main/java/com/highdatas/mdm/controller/MaintainController.java +++ b/src/main/java/com/highdatas/mdm/controller/MaintainController.java @@ -15,6 +15,7 @@ import com.highdatas.mdm.pojo.Result; import com.highdatas.mdm.service.*; import com.highdatas.mdm.util.Constant; +import com.highdatas.mdm.util.DbUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -47,6 +48,8 @@ IFlowsService flowsService; @Autowired IMaintainFieldService maintainFieldService; + @Autowired + IMasterAuthorService masterAuthorService; @RequestMapping(value = "/get/{id}", method = RequestMethod.GET) public Result get(@PathVariable String id) { @@ -61,19 +64,20 @@ public Result unSubmit(@PathVariable String tableName, @PathVariable Integer pageNo, HttpServletRequest request) throws UnsupportedEncodingException { String pageSize = request.getParameter("pageSize"); String whereSegment = request.getParameter("whereSegment"); - + TUser user = DbUtils.getUser(request); if (StringUtils.isEmpty(whereSegment)) { whereSegment = Constant.WHERE_DEFAULT; }else { whereSegment = URLDecoder.decode(whereSegment, "UTF-8"); } - return maintainService.getUnSubmitData(tableName, pageNo, pageSize, whereSegment); + return maintainService.getUnSubmitData(user, tableName, pageNo, pageSize, whereSegment); } @RequestMapping(value = "{tableName}/unflow/{pageNo}", method = RequestMethod.GET) public Result unflow(@PathVariable String tableName, @PathVariable Integer pageNo, HttpServletRequest request) throws UnsupportedEncodingException { String pageSize = request.getParameter("pageSize"); String whereSegment = request.getParameter("whereSegment"); + TUser user = DbUtils.getUser(request); if (StringUtils.isEmpty(whereSegment)) { whereSegment = Constant.WHERE_DEFAULT; @@ -81,9 +85,9 @@ whereSegment = URLDecoder.decode(whereSegment, "UTF-8"); } if (StringUtils.isEmpty(pageSize)) { - return maintainService.getInvalidVerionData(tableName, whereSegment, pageNo, null); + return maintainService.getInvalidVerionData(user, tableName, whereSegment, pageNo, null); } else { - return maintainService.getInvalidVerionData(tableName, whereSegment, pageNo, Integer.valueOf(pageSize)); + return maintainService.getInvalidVerionData(user, tableName, whereSegment, pageNo, Integer.valueOf(pageSize)); } } @@ -106,7 +110,10 @@ if (StringUtils.isEmpty(flowId)) { continue; } - + boolean author = masterAuthorService.checkMaintainAuthor(userId, maintain.getId()); + if (!author) { + continue; + } Flows flows = flowsService.selectById(maintain.getFlowId()); if (flows.getStatus().equals(ActivitiStatus.close)) { continue; @@ -220,13 +227,14 @@ public Result setFlowId(@RequestParam String flowId,@PathVariable Integer pageNo, HttpServletRequest request) { String whereSegment = request.getParameter("whereSegment"); String pageSize = request.getParameter("pageSize"); + TUser user = DbUtils.getUser(request); if (StringUtils.isEmpty(whereSegment)) { whereSegment = Constant.WHERE_DEFAULT; } if (StringUtils.isEmpty(pageSize)) { - return maintainService.tempDataByVersionByFlow(flowId, whereSegment, pageNo, null); + return maintainService.tempDataByVersionByFlow(user, flowId, whereSegment, pageNo, null); } - return maintainService.tempDataByVersionByFlow(flowId, whereSegment, pageNo, Integer.valueOf(pageSize)); + return maintainService.tempDataByVersionByFlow(user, flowId, whereSegment, pageNo, Integer.valueOf(pageSize)); } -- Gitblit v1.8.0