ky 6 years ago
parent 0c77ce2752
commit 1567d5e0de

@ -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();
}

@ -137,13 +137,20 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
* @param pageSize
* @return
*/
public JSONObject pcDisableCustomList(Integer pageNum,Integer pageSize){
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "disable"));
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "disable"));
public JSONObject pcDisableCustomList(Integer pageNum,Integer pageSize,String copycatId){
Integer count = null;
List<Custom> customs;
if(null==copycatId){
count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "disable"));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "disable"));
}else {
count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "disable").eq("copycat_id",copycatId));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().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<CustomMapper, Custom> impleme
* @param pageSize
* @return
*/
public JSONObject pcEnableCustomList(Integer pageNum,Integer pageSize){
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "enable"));
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().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<Custom> customs;
if(null==copycatId){
count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "enable"));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "enable"));
}else {
count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "enable").eq("copycat_id",copycatId));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().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();

Loading…
Cancel
Save