Merge branch 'master' into docker_package
This commit is contained in:
commit
0348efcb56
|
@ -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<PageData<TbDeviceApplyDTO>> myDonePage(@ApiIgnore @RequestParam Map<String, Object> 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<TbDeviceApplyDTO> page = tbDeviceApplyService.queryAuditList(params);
|
||||
return new Result<PageData<TbDeviceApplyDTO>>().ok(page);
|
||||
}
|
||||
|
|
|
@ -53,4 +53,6 @@ public class TbDeviceApplyDTO implements Serializable {
|
|||
private Integer delFlag;
|
||||
|
||||
private String deviceName;
|
||||
|
||||
private TbDeviceDTO tbDeviceDTO;
|
||||
}
|
||||
|
|
|
@ -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<TbDeviceApplyDao,
|
|||
|
||||
@Autowired
|
||||
private TbDeviceApplyDao tbDeviceApplyDao;
|
||||
@Autowired
|
||||
private TbDeviceService tbDeviceService;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<TbDeviceApplyEntity> getWrapper(Map<String, Object> params) {
|
||||
|
@ -48,8 +49,15 @@ public class TbDeviceApplyServiceImpl extends CrudServiceImpl<TbDeviceApplyDao,
|
|||
}
|
||||
params.put("userId", SecurityUser.getUserId());
|
||||
List<TbDeviceApplyDTO> dtoList = tbDeviceApplyDao.queryListForAudit(params);
|
||||
List<TbDeviceApplyDTO> result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList());
|
||||
return new PageData(result, dtoList.size());
|
||||
List<TbDeviceApplyDTO> 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<TbDeviceApplyDTO> 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
|
||||
|
|
|
@ -15,6 +15,7 @@ import io.renren.modules.security.password.PasswordUtils;
|
|||
import io.renren.modules.security.user.SecurityUser;
|
||||
import io.renren.modules.security.user.UserDetail;
|
||||
import io.renren.modules.sys.dto.PasswordDTO;
|
||||
import io.renren.modules.sys.dto.SysDeptDTO;
|
||||
import io.renren.modules.sys.dto.SysUserDTO;
|
||||
import io.renren.modules.sys.excel.SysUserExcel;
|
||||
import io.renren.modules.sys.service.SysDeptService;
|
||||
|
@ -92,7 +93,10 @@ public class SysUserController {
|
|||
@ApiOperation("登录用户信息")
|
||||
public Result<SysUserDTO> info(){
|
||||
SysUserDTO data = ConvertUtils.sourceToTarget(SecurityUser.getUser(), SysUserDTO.class);
|
||||
data.setDeptName(sysDeptService.get(data.getDeptId()).getName());
|
||||
SysDeptDTO sysDeptDTO=sysDeptService.get(data.getDeptId());
|
||||
if(sysDeptDTO != null){
|
||||
data.setDeptName(sysDeptService.get(data.getDeptId()).getName());
|
||||
}
|
||||
data.setRoleIdList(sysRoleUserService.getRoleIdList(data.getId()));
|
||||
return new Result<SysUserDTO>().ok(data);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue