huwhois 4 years ago
parent
commit
be77f49d9e

+ 6 - 9
src/main/java/io/renren/modules/admin/controller/ReportController.java

@ -143,21 +143,18 @@ public class ReportController {
143 143
    /**
144 144
     * listbybranch
145 145
     */
146
    @GetMapping("/listbranch/{bid}")
146
    @GetMapping("/listbranch/{mid}/{bid}")
147 147
    @RequiresPermissions("admin:report:list")
148
    public R listByBranch(@PathVariable("bid") Long bid){
149
        List<ReportEntity> list = reportService.listByBranch(bid);
148
    public R listByBranch(@PathVariable("mid") Long mid, @PathVariable("bid") Long bid){
149
        List<ReportEntity> list = reportService.listByBranch(mid, bid);
150 150
151 151
        return R.ok().put("list", list);
152 152
    }
153 153
154
    /**
155
     * listbybranch
156
     */
157
    @GetMapping("/listbranch")
154
    @GetMapping("/listbranch/{mid}")
158 155
    @RequiresPermissions("admin:report:list")
159
    public R listByBranch(){
160
        List<ReportEntity> list = reportService.list();
156
    public R listByBranch(@PathVariable("mid") Long mid){
157
        List<ReportEntity> list = reportService.listByBranch(mid);
161 158
162 159
        return R.ok().put("list", list);
163 160
    }

+ 3 - 1
src/main/java/io/renren/modules/admin/service/ReportService.java

@ -18,6 +18,8 @@ public interface ReportService extends IService<ReportEntity> {
18 18
19 19
    PageUtils queryPage(Map<String, Object> params);
20 20
21
	List<ReportEntity> listByBranch(Long bid);
21
	List<ReportEntity> listByBranch(Long mid, Long bid);
22
23
	List<ReportEntity> listByBranch(Long mid);
22 24
}
23 25

+ 7 - 2
src/main/java/io/renren/modules/admin/service/impl/ReportServiceImpl.java

@ -31,8 +31,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity> impl
31 31
    }
32 32
33 33
    @Override
34
    public List<ReportEntity> listByBranch(Long bid) {
35
        return this.list(new QueryWrapper<ReportEntity>().eq("branch_id", bid));
34
    public List<ReportEntity> listByBranch(Long mid, Long bid) {
35
        return this.list(new QueryWrapper<ReportEntity>().eq(bid == 0, "meeting_id", mid).eq("branch_id", bid));
36
    }
37
38
    @Override
39
    public List<ReportEntity> listByBranch(Long mid) {
40
        return this.list(new QueryWrapper<ReportEntity>().eq("meeting_id", mid));
36 41
    }
37 42
38 43
}