diff --git a/src/main/java/com/gszc/controller/PcCustomController.java b/src/main/java/com/gszc/controller/PcCustomController.java index e1c12f5..9cd0ade 100644 --- a/src/main/java/com/gszc/controller/PcCustomController.java +++ b/src/main/java/com/gszc/controller/PcCustomController.java @@ -41,18 +41,18 @@ public class PcCustomController { @PostMapping("/pcDisableCustomList") @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header") @ApiOperation(value = "待认证列表", notes = "待认证列表") - public Result pcDisableCustomList(Integer pageNum,Integer pageSize) { + public Result pcDisableCustomList(Integer pageNum,Integer pageSize,String copycatId) { - JSONObject customs = customService.pcDisableCustomList(pageNum,pageSize); + JSONObject customs = customService.pcDisableCustomList(pageNum,pageSize,copycatId); return ResultBuilder.withPayload(customs).build(); } @PostMapping("/pcEnableCustomList") @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header") @ApiOperation(value = "已认证列表", notes = "已认证列表") - public Result pcEnableCustomList(Integer pageNum,Integer pageSize) { + public Result pcEnableCustomList(Integer pageNum,Integer pageSize,String copycatId) { - JSONObject customs = customService.pcEnableCustomList(pageNum,pageSize); + JSONObject customs = customService.pcEnableCustomList(pageNum,pageSize,copycatId); return ResultBuilder.withPayload(customs).build(); } diff --git a/src/main/java/com/gszc/service/impl/CustomServiceImpl.java b/src/main/java/com/gszc/service/impl/CustomServiceImpl.java index 72fbf88..66bbb9d 100644 --- a/src/main/java/com/gszc/service/impl/CustomServiceImpl.java +++ b/src/main/java/com/gszc/service/impl/CustomServiceImpl.java @@ -137,13 +137,20 @@ public class CustomServiceImpl extends ServiceImpl impleme * @param pageSize * @return */ - public JSONObject pcDisableCustomList(Integer pageNum,Integer pageSize){ - - Integer count = customMapper.selectCount(new EntityWrapper().eq("status_code", "disable")); - List customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().eq("status_code", "disable")); + public JSONObject pcDisableCustomList(Integer pageNum,Integer pageSize,String copycatId){ + + Integer count = null; + List customs; + if(null==copycatId){ + count = customMapper.selectCount(new EntityWrapper().eq("status_code", "disable")); + customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().eq("status_code", "disable")); + }else { + count = customMapper.selectCount(new EntityWrapper().eq("status_code", "disable").eq("copycat_id",copycatId)); + customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().eq("status_code", "disable").eq("copycat_id",copycatId)); + } for(Custom custom:customs){ - String copycatId = custom.getCopycatId(); - PcUser pcUser = pcUserService.pcUserDetail(copycatId); + String copycat = custom.getCopycatId(); + PcUser pcUser = pcUserService.pcUserDetail(copycat); custom.setCopycatName(pcUser.getName()); } JSONObject jsonObject = new JSONObject(); @@ -158,13 +165,19 @@ public class CustomServiceImpl extends ServiceImpl impleme * @param pageSize * @return */ - public JSONObject pcEnableCustomList(Integer pageNum,Integer pageSize){ - - Integer count = customMapper.selectCount(new EntityWrapper().eq("status_code", "enable")); - List customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().eq("status_code", "enable")); - for(Custom custom:customs){ - String copycatId = custom.getCopycatId(); - PcUser pcUser = pcUserService.pcUserDetail(copycatId); + public JSONObject pcEnableCustomList(Integer pageNum,Integer pageSize,String copycatId){ + + Integer count = null; + List customs; + if(null==copycatId){ + count = customMapper.selectCount(new EntityWrapper().eq("status_code", "enable")); + customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().eq("status_code", "enable")); + }else { + count = customMapper.selectCount(new EntityWrapper().eq("status_code", "enable").eq("copycat_id",copycatId)); + customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().eq("status_code", "enable").eq("copycat_id",copycatId)); + }for(Custom custom:customs){ + String copycat = custom.getCopycatId(); + PcUser pcUser = pcUserService.pcUserDetail(copycat); custom.setCopycatName(pcUser.getName()); } JSONObject jsonObject = new JSONObject();