| | |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Page<ReplyTemplateEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<String> ids= PermissionUtil.getPermission(sysUser); |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | return getDataTable("您没有权限查看该数据"); |
| | | List<String> ids=PermissionUtil.getStairDepartment(sysUser,iOrganizationChartService); |
| | | List<ReplyTemplateEntity> list; |
| | | if (sysUser.getUserType().equals("1")||sysUser.getIsDivisionHead().equals("1")){ |
| | | list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name,ids,null); |
| | | } |
| | | List<ReplyTemplateEntity> list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name,ids); |
| | | else { |
| | | list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name,ids,sysUser.getUserId()); |
| | | } |
| | | int num=iReplyTemplateService.countNum(Name,ids); |
| | | return getDataTable(list,num); |
| | | } |
| | |
| | | return ResultData.error("模板名称不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(sysUser.getDepartmentId())) |
| | | if(StringUtils.isEmpty(entity.getDepartmentId())) |
| | | { |
| | | return ResultData.error("部门id不能为空 请分配部门id"); |
| | | } |
| | | |
| | | List<String> ids=iOrganizationChartService.getIds(sysUser.getDepartmentId()); |
| | | List<String> ids=iOrganizationChartService.getIds(entity.getDepartmentId()); |
| | | int num=iReplyTemplateService.countNum(entity.getName(),ids); |
| | | |
| | | if(num>0) |
| | |
| | | } |
| | | |
| | | entity.setId(null); |
| | | entity.setDepartmentId(sysUser.getDepartmentId()); |
| | | entity.setDepartmentId(entity.getDepartmentId()); |
| | | entity.setCreateUserId(sysUser.getUserId()+""); |
| | | |
| | | return toAjax(iReplyTemplateService.insertConfig(entity)); |
| | |
| | | @ApiOperation("复制模板") |
| | | @PostMapping("/copy") |
| | | @Authorization |
| | | public ResultData copy(@RequestParam(value = "Id",required = false) String Id) |
| | | public ResultData copy(@RequestParam(value = "Id",required = false) String Id,@CurrentUser SysUser sysUser) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | |
| | | { |
| | | return ResultData.error("模板不存在!"); |
| | | } |
| | | entity.setCreateUserId(sysUser.getUserId()); |
| | | entity.setName(entity.getName()+"(副本)"); |
| | | entity.setId(null); |
| | | return toAjax(iReplyTemplateService.insertConfig(entity)); |