绑定设备
This commit is contained in:
parent
b705a1ea2c
commit
ccff7b4d04
@ -107,4 +107,11 @@ public class DeviceController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/getDeviceNotBind")
|
||||
@Operation(summary = "获得未绑定的设备分页")
|
||||
public CommonResult<PageResult<DeviceRespVO>> getDeviceNotBind(@Valid DevicePageReqVO pageReqVO) {
|
||||
PageResult<DeviceDO> pageResult = deviceService.getDeviceNotBind(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -98,4 +98,12 @@ public class DeviceuserController {
|
||||
return success(BeanUtils.toBean(deviceusers, DeviceuserRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getDeviceuserByUserId")
|
||||
@Operation(summary = "根据用户ID获得设备人员关联")
|
||||
@Parameter(name = "userid", description = "用户编号", required = true)
|
||||
public CommonResult<List<DeviceuserRespVO>> getDeviceuserByUserId(@RequestParam("userid") Integer userid) {
|
||||
List<DeviceuserDO> deviceusers = deviceuserService.getDeviceuserByUserId(userid);
|
||||
return success(BeanUtils.toBean(deviceusers, DeviceuserRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -41,4 +41,7 @@ public class DeviceuserPageReqVO extends PageParam {
|
||||
@Schema(description = "用户姓名", example = "张三")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "家庭组号", example = "16280")
|
||||
private Integer familyid;
|
||||
|
||||
}
|
||||
@ -48,4 +48,8 @@ public class DeviceuserRespVO {
|
||||
@ExcelProperty("用户姓名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "家庭组号", example = "16280")
|
||||
@ExcelProperty("家庭组号")
|
||||
private Integer familyid;
|
||||
|
||||
}
|
||||
@ -41,4 +41,7 @@ public class DeviceuserSaveReqVO {
|
||||
@Schema(description = "用户姓名", example = "张三")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "家庭组号", example = "16280")
|
||||
private Integer familyid;
|
||||
|
||||
}
|
||||
@ -66,5 +66,10 @@ public class DeviceuserDO {
|
||||
*/
|
||||
@TableField("username")
|
||||
private String username;
|
||||
/**
|
||||
* 家庭组号
|
||||
*/
|
||||
@TableField("familyid")
|
||||
private Integer familyid;
|
||||
|
||||
}
|
||||
@ -36,4 +36,23 @@ public interface DeviceMapper extends BaseMapperX<DeviceDO> {
|
||||
.orderByDesc(DeviceDO::getId));
|
||||
}
|
||||
|
||||
default PageResult<DeviceDO> selectNotBindPage(DevicePageReqVO reqVO) {
|
||||
LambdaQueryWrapperX<DeviceDO> wrapper = new LambdaQueryWrapperX<>();
|
||||
wrapper.notExists("SELECT 1 FROM tb_deviceuser du WHERE du.deviceid = CAST(tb_device.devicecode AS SIGNED)");
|
||||
wrapper.likeIfPresent(DeviceDO::getDevicename, reqVO.getDevicename());
|
||||
wrapper.eqIfPresent(DeviceDO::getDevicecode, reqVO.getDevicecode());
|
||||
wrapper.eqIfPresent(DeviceDO::getDevicetype, reqVO.getDevicetype());
|
||||
wrapper.eqIfPresent(DeviceDO::getLocation, reqVO.getLocation());
|
||||
wrapper.eqIfPresent(DeviceDO::getDevicestatus, reqVO.getDevicestatus());
|
||||
wrapper.eqIfPresent(DeviceDO::getOrgid, reqVO.getOrgid());
|
||||
wrapper.likeIfPresent(DeviceDO::getOrgname, reqVO.getOrgname());
|
||||
wrapper.eqIfPresent(DeviceDO::getDescription, reqVO.getDescription());
|
||||
wrapper.betweenIfPresent(DeviceDO::getCreatetime, reqVO.getCreatetime());
|
||||
wrapper.betweenIfPresent(DeviceDO::getUpdatetime, reqVO.getUpdatetime());
|
||||
wrapper.eqIfPresent(DeviceDO::getCreateby, reqVO.getCreateby());
|
||||
wrapper.eqIfPresent(DeviceDO::getUpdateby, reqVO.getUpdateby());
|
||||
wrapper.orderByDesc(DeviceDO::getId);
|
||||
return selectPage(reqVO, wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -68,4 +68,12 @@ public interface DeviceService {
|
||||
*/
|
||||
void updateDeviceStatus(Integer devicecode, Integer devicestatus);
|
||||
|
||||
/**
|
||||
* 获得未绑定的设备分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 设备分页
|
||||
*/
|
||||
PageResult<DeviceDO> getDeviceNotBind(DevicePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -97,4 +97,9 @@ public class DeviceServiceImpl implements DeviceService {
|
||||
deviceMapper.update(updateObj, wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DeviceDO> getDeviceNotBind(DevicePageReqVO pageReqVO) {
|
||||
return deviceMapper.selectNotBindPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -64,4 +64,12 @@ public interface DeviceuserService {
|
||||
*/
|
||||
List<DeviceuserDO> getDeviceuserByDeviceId(Integer deviceid);
|
||||
|
||||
/**
|
||||
* 根据用户ID获得设备人员关联列表
|
||||
*
|
||||
* @param userid 用户编号
|
||||
* @return 设备人员关联列表
|
||||
*/
|
||||
List<DeviceuserDO> getDeviceuserByUserId(Integer userid);
|
||||
|
||||
}
|
||||
@ -80,4 +80,10 @@ public class DeviceuserServiceImpl implements DeviceuserService {
|
||||
.eq(DeviceuserDO::getDeviceid, deviceid));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceuserDO> getDeviceuserByUserId(Integer userid) {
|
||||
return deviceuserMapper.selectList(new LambdaQueryWrapper<DeviceuserDO>()
|
||||
.eq(DeviceuserDO::getUserid, userid));
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user