diff --git a/renren-admin/src/main/java/io/renren/modules/device/controller/TbDeviceApplyController.java b/renren-admin/src/main/java/io/renren/modules/device/controller/TbDeviceApplyController.java index 514b3145..88d3f595 100644 --- a/renren-admin/src/main/java/io/renren/modules/device/controller/TbDeviceApplyController.java +++ b/renren-admin/src/main/java/io/renren/modules/device/controller/TbDeviceApplyController.java @@ -116,10 +116,15 @@ public class TbDeviceApplyController { @ApiImplicitParams({ @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , - @ApiImplicitParam(name = "deviceName", value = "设备名称", paramType = "query", dataType="String") + @ApiImplicitParam(name = "deviceName", value = "设备名称", paramType = "query", dataType="String"), + @ApiImplicitParam(name = "state", value = "申请状态", paramType = "query", dataType="int") }) public Result> myDonePage(@ApiIgnore @RequestParam Map params){ - params.put("states", ImmutableList.of(2,3)); + if(params.get("state") == null){ + params.put("states", ImmutableList.of(2,3)); + }else{ + params.put("states", ImmutableList.of(params.get("state"))); + } PageData page = tbDeviceApplyService.queryAuditList(params); return new Result>().ok(page); } diff --git a/renren-admin/src/main/java/io/renren/modules/device/dto/TbDeviceApplyDTO.java b/renren-admin/src/main/java/io/renren/modules/device/dto/TbDeviceApplyDTO.java index 790290c6..34142071 100644 --- a/renren-admin/src/main/java/io/renren/modules/device/dto/TbDeviceApplyDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/device/dto/TbDeviceApplyDTO.java @@ -53,4 +53,6 @@ public class TbDeviceApplyDTO implements Serializable { private Integer delFlag; private String deviceName; + + private TbDeviceDTO tbDeviceDTO; } diff --git a/renren-admin/src/main/java/io/renren/modules/device/service/Impl/TbDeviceApplyServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/device/service/Impl/TbDeviceApplyServiceImpl.java index b581b0d4..0aa7ba86 100644 --- a/renren-admin/src/main/java/io/renren/modules/device/service/Impl/TbDeviceApplyServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/device/service/Impl/TbDeviceApplyServiceImpl.java @@ -7,8 +7,7 @@ import io.renren.modules.device.dao.TbDeviceApplyDao; import io.renren.modules.device.dto.TbDeviceApplyDTO; import io.renren.modules.device.entity.TbDeviceApplyEntity; import io.renren.modules.device.service.TbDeviceApplyService; -import io.renren.modules.fuse.dto.TbFuseDTO; -import io.renren.modules.meeting.dto.TMeetingroomBookDTO; +import io.renren.modules.device.service.TbDeviceService; import io.renren.modules.security.user.SecurityUser; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -29,6 +28,8 @@ public class TbDeviceApplyServiceImpl extends CrudServiceImpl getWrapper(Map params) { @@ -48,8 +49,15 @@ public class TbDeviceApplyServiceImpl extends CrudServiceImpl dtoList = tbDeviceApplyDao.queryListForAudit(params); - List result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()); - return new PageData(result, dtoList.size()); + List resultList; + if(params.get("deviceName") != null){ + resultList = dtoList.stream().filter(it->tbDeviceService.get(it.getDeviceId()).getName().contains(params.get("deviceName").toString())).collect(Collectors.toList()); + }else{ + resultList=dtoList; + } + List result = resultList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()); + result.stream().forEach(it->it.setTbDeviceDTO(tbDeviceService.get(it.getDeviceId()))); + return new PageData(result, resultList.size()); } @Override