ky 6 years ago
parent 0c77ce2752
commit 1567d5e0de

@ -41,18 +41,18 @@ public class PcCustomController {
@PostMapping("/pcDisableCustomList") @PostMapping("/pcDisableCustomList")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header") @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "待认证列表", notes = "待认证列表") @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(); return ResultBuilder.withPayload(customs).build();
} }
@PostMapping("/pcEnableCustomList") @PostMapping("/pcEnableCustomList")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header") @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "已认证列表", notes = "已认证列表") @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(); return ResultBuilder.withPayload(customs).build();
} }

@ -137,13 +137,20 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
* @param pageSize * @param pageSize
* @return * @return
*/ */
public JSONObject pcDisableCustomList(Integer pageNum,Integer pageSize){ public JSONObject pcDisableCustomList(Integer pageNum,Integer pageSize,String copycatId){
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "disable")); Integer count = null;
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "disable")); 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){ for(Custom custom:customs){
String copycatId = custom.getCopycatId(); String copycat = custom.getCopycatId();
PcUser pcUser = pcUserService.pcUserDetail(copycatId); PcUser pcUser = pcUserService.pcUserDetail(copycat);
custom.setCopycatName(pcUser.getName()); custom.setCopycatName(pcUser.getName());
} }
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
@ -158,13 +165,19 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
* @param pageSize * @param pageSize
* @return * @return
*/ */
public JSONObject pcEnableCustomList(Integer pageNum,Integer pageSize){ public JSONObject pcEnableCustomList(Integer pageNum,Integer pageSize,String copycatId){
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "enable")); Integer count = null;
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "enable")); List<Custom> customs;
for(Custom custom:customs){ if(null==copycatId){
String copycatId = custom.getCopycatId(); count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "enable"));
PcUser pcUser = pcUserService.pcUserDetail(copycatId); 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()); custom.setCopycatName(pcUser.getName());
} }
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();

Loading…
Cancel
Save