| | |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "keyword",required = false) String keyword, |
| | | @RequestParam(value = "classifyGrade",required = false) String classifyGrade, |
| | | @RequestParam(value = "departmentId",required = false) String departmentId, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum 不能为空"); |
| | | Assert.notNull(pageSize, "pageSize 不能为空"); |
| | | Page<TransactionEvent> pageParam = new Page<>(pageNum,pageSize); |
| | | // List<String> ids=iOrganizationChartService.getIds(sysUser.getDepartmentId()); |
| | | List<TransactionEvent> list = iTransactionEventService.selectConfigList(pageParam,pageSize,keyword, |
| | | List<TransactionEvent> list; |
| | | if (departmentId!=null){ |
| | | List<String> ids=iOrganizationChartService.getDepartmentId(departmentId); |
| | | list = iTransactionEventService.selectConfigList(pageParam,pageSize,keyword, |
| | | classifyGrade,ids); |
| | | }else { |
| | | list = iTransactionEventService.selectConfigList(pageParam,pageSize,keyword, |
| | | classifyGrade,null); |
| | | } |
| | | int num=iTransactionEventService.countNum(keyword,classifyGrade,null); |
| | | return getDataTable(list,num); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty("修改时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | |
| | | */ |
| | | public List<OrganizationChartEntity> selectParentList(String parentId,String grade); |
| | | |
| | | /** |
| | | * 获取该部门所有上级部门及其所有下级部门 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<String> getDepartmentId(String id); |
| | | |
| | | } |
| | |
| | | return ids; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getDepartmentId(String id){ |
| | | String parentId = parentId(id); |
| | | List<String> departmentIds=new ArrayList<>(); |
| | | departmentIds.add(parentId); |
| | | List<OrganizationChartEntity> organizationChartEntities = baseMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda().eq(OrganizationChartEntity::getParentId, parentId)); |
| | | for (OrganizationChartEntity organizationChart :organizationChartEntities){ |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | departmentIds=getDepartmentIds(organizationChart.getId().toString(),departmentIds); |
| | | } |
| | | return departmentIds; |
| | | } |
| | | |
| | | |
| | | public String parentId(String id){ |
| | | String parentId=id; |
| | | OrganizationChartEntity organizationChart = baseMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda().eq(OrganizationChartEntity::getId, id)); |
| | | if (organizationChart.getParentId().length()>0){ |
| | | parentId=parentId(organizationChart.getParentId()); |
| | | } |
| | | return parentId; |
| | | } |
| | | |
| | | public List<String> getDepartmentIds(String id,List<String> departmentIds){ |
| | | List<OrganizationChartEntity> organizationChartEntities = baseMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda().eq(OrganizationChartEntity::getParentId, id)); |
| | | if (organizationChartEntities.size()==0){ |
| | | return departmentIds; |
| | | } |
| | | else { |
| | | for (OrganizationChartEntity organizationChart :organizationChartEntities){ |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | departmentIds=getDepartmentIds(organizationChart.getId().toString(),departmentIds); |
| | | } |
| | | } |
| | | return departmentIds; |
| | | } |
| | | |
| | | |
| | | |
| | | //递归取id |
| | |
| | | and department_id in (SELECT id from automessage_organization_chart where id=#{departmentId} or parent_id = #{departmentId}) |
| | | </if> |
| | | </where> |
| | | order by create_time |
| | | </select> |
| | | |
| | | <select id="selectCountList" resultType="integer"> |