| | |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.ReplyTemplateEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.service.IReplyTemplateService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @Autowired |
| | | IReplyTemplateService iReplyTemplateService; |
| | | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | |
| | | /** |
| | | * 获取模板列表 |
| | | * @return |
| | |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "Name",required = false) String Name) |
| | | @RequestParam(value = "Name",required = false) String Name, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Page<ReplyTemplateEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<ReplyTemplateEntity> list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name); |
| | | int num=iReplyTemplateService.countNum(Name); |
| | | List<String> ids=iOrganizationChartService.getIds(sysUser.getDepartmentId()); |
| | | String[] roles = sysUser.getRoleIds().split(","); |
| | | Integer isRole=0;//是否超管 |
| | | for (String role: roles) { |
| | | if (role.equals("1")){ |
| | | isRole=1; |
| | | break; |
| | | } |
| | | } |
| | | if (isRole.equals(1)){ |
| | | ids=null; |
| | | } |
| | | List<ReplyTemplateEntity> list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name,ids); |
| | | int num=iReplyTemplateService.countNum(Name,ids); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | |
| | | { |
| | | return ResultData.error("模板名称不能为空"); |
| | | } |
| | | |
| | | entity.setId(null); |
| | | entity.setDepartmentId(sysUser.getDepartmentId()); |
| | | entity.setCreateUserId(sysUser.getUserId()+""); |