0
0

Merge remote-tracking branch 'upstream/dyf-device' into main-dyf

This commit is contained in:
2025-08-25 14:32:19 +08:00
36 changed files with 1673 additions and 293 deletions

View File

@ -0,0 +1,105 @@
package com.fuyuanshen.app.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.fuyuanshen.common.idempotent.annotation.RepeatSubmit;
import com.fuyuanshen.common.log.annotation.Log;
import com.fuyuanshen.common.web.core.BaseController;
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
import com.fuyuanshen.common.core.domain.R;
import com.fuyuanshen.common.core.validate.AddGroup;
import com.fuyuanshen.common.core.validate.EditGroup;
import com.fuyuanshen.common.log.enums.BusinessType;
import com.fuyuanshen.common.excel.utils.ExcelUtil;
import com.fuyuanshen.app.domain.vo.AppPersonnelInfoRecordsVo;
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoRecordsBo;
import com.fuyuanshen.app.service.IAppPersonnelInfoRecordsService;
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
/**
* 人员信息登记记录
*
* @author CYT
* @date 2025-08-22
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/app/personnelInfoRecords")
public class AppPersonnelInfoRecordsController extends BaseController {
private final IAppPersonnelInfoRecordsService appPersonnelInfoRecordsService;
/**
* 查询人员信息登记记录列表
*/
@SaCheckPermission("app:personnelInfoRecords:list")
@GetMapping("/list")
public TableDataInfo<AppPersonnelInfoRecordsVo> list(AppPersonnelInfoRecordsBo bo, PageQuery pageQuery) {
return appPersonnelInfoRecordsService.queryPageList(bo, pageQuery);
}
/**
* 导出人员信息登记记录列表
*/
@SaCheckPermission("app:personnelInfoRecords:export")
@Log(title = "人员信息登记记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(AppPersonnelInfoRecordsBo bo, HttpServletResponse response) {
List<AppPersonnelInfoRecordsVo> list = appPersonnelInfoRecordsService.queryList(bo);
ExcelUtil.exportExcel(list, "人员信息登记记录", AppPersonnelInfoRecordsVo.class, response);
}
/**
* 获取人员信息登记记录详细信息
*
* @param id 主键
*/
@SaCheckPermission("app:personnelInfoRecords:query")
@GetMapping("/{id}")
public R<AppPersonnelInfoRecordsVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(appPersonnelInfoRecordsService.queryById(id));
}
/**
* 新增人员信息登记记录
*/
@SaCheckPermission("app:personnelInfoRecords:add")
@Log(title = "人员信息登记记录", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody AppPersonnelInfoRecordsBo bo) {
return toAjax(appPersonnelInfoRecordsService.insertByBo(bo));
}
/**
* 修改人员信息登记记录
*/
@SaCheckPermission("app:personnelInfoRecords:edit")
@Log(title = "人员信息登记记录", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AppPersonnelInfoRecordsBo bo) {
return toAjax(appPersonnelInfoRecordsService.updateByBo(bo));
}
/**
* 删除人员信息登记记录
*
* @param ids 主键串
*/
@SaCheckPermission("app:personnelInfoRecords:remove")
@Log(title = "人员信息登记记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(appPersonnelInfoRecordsService.deleteWithValidByIds(List.of(ids), true));
}
}

View File

@ -0,0 +1,66 @@
package com.fuyuanshen.app.domain;
import com.fuyuanshen.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 人员信息登记记录对象 app_personnel_info_records
*
* @author CYT
* @date 2025-08-22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("app_personnel_info_records")
public class AppPersonnelInfoRecords extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id")
private Long id;
/**
* 设备id
*/
private Long deviceId;
/**
* 主键
*/
private Long personnelId;
/**
* 人员姓名
*/
private String name;
/**
* 职位
*/
private String position;
/**
* 单位名称
*/
private String unitName;
/**
* ID号
*/
private String code;
/**
* 发送信息
*/
private String sendMsg;
}

View File

@ -0,0 +1,67 @@
package com.fuyuanshen.app.domain.bo;
import com.fuyuanshen.app.domain.AppPersonnelInfoRecords;
import com.fuyuanshen.common.core.validate.AddGroup;
import com.fuyuanshen.common.core.validate.EditGroup;
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
/**
* 人员信息登记记录业务对象 app_personnel_info_records
*
* @author CYT
* @date 2025-08-22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = AppPersonnelInfoRecords.class, reverseConvertGenerate = false)
public class AppPersonnelInfoRecordsBo extends BaseEntity {
/**
* 主键
*/
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
private Long id;
/**
* 设备id
*/
@NotNull(message = "设备id不能为空", groups = { AddGroup.class, EditGroup.class })
private Long deviceId;
/**
* 主键
*/
@NotNull(message = "主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long personnelId;
/**
* 人员姓名
*/
private String name;
/**
* 职位
*/
private String position;
/**
* 单位名称
*/
private String unitName;
/**
* ID号
*/
private String code;
/**
* 发送信息
*/
private String sendMsg;
}

View File

@ -0,0 +1,80 @@
package com.fuyuanshen.app.domain.vo;
import com.fuyuanshen.app.domain.AppPersonnelInfoRecords;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.fuyuanshen.common.excel.annotation.ExcelDictFormat;
import com.fuyuanshen.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* 人员信息登记记录视图对象 app_personnel_info_records
*
* @author CYT
* @date 2025-08-22
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = AppPersonnelInfoRecords.class)
public class AppPersonnelInfoRecordsVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ExcelProperty(value = "主键")
private Long id;
/**
* 设备id
*/
@ExcelProperty(value = "设备id")
private Long deviceId;
/**
* 主键
*/
@ExcelProperty(value = "主键")
private Long personnelId;
/**
* 人员姓名
*/
@ExcelProperty(value = "人员姓名")
private String name;
/**
* 职位
*/
@ExcelProperty(value = "职位")
private String position;
/**
* 单位名称
*/
@ExcelProperty(value = "单位名称")
private String unitName;
/**
* ID号
*/
@ExcelProperty(value = "ID号")
private String code;
/**
* 发送信息
*/
@ExcelProperty(value = "发送信息")
private String sendMsg;
}

View File

@ -0,0 +1,15 @@
package com.fuyuanshen.app.mapper;
import com.fuyuanshen.app.domain.AppPersonnelInfoRecords;
import com.fuyuanshen.app.domain.vo.AppPersonnelInfoRecordsVo;
import com.fuyuanshen.common.mybatis.core.mapper.BaseMapperPlus;
/**
* 人员信息登记记录Mapper接口
*
* @author CYT
* @date 2025-08-22
*/
public interface AppPersonnelInfoRecordsMapper extends BaseMapperPlus<AppPersonnelInfoRecords, AppPersonnelInfoRecordsVo> {
}

View File

@ -0,0 +1,68 @@
package com.fuyuanshen.app.service;
import com.fuyuanshen.app.domain.vo.AppPersonnelInfoRecordsVo;
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoRecordsBo;
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* 人员信息登记记录Service接口
*
* @author CYT
* @date 2025-08-22
*/
public interface IAppPersonnelInfoRecordsService {
/**
* 查询人员信息登记记录
*
* @param id 主键
* @return 人员信息登记记录
*/
AppPersonnelInfoRecordsVo queryById(Long id);
/**
* 分页查询人员信息登记记录列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 人员信息登记记录分页列表
*/
TableDataInfo<AppPersonnelInfoRecordsVo> queryPageList(AppPersonnelInfoRecordsBo bo, PageQuery pageQuery);
/**
* 查询符合条件的人员信息登记记录列表
*
* @param bo 查询条件
* @return 人员信息登记记录列表
*/
List<AppPersonnelInfoRecordsVo> queryList(AppPersonnelInfoRecordsBo bo);
/**
* 新增人员信息登记记录
*
* @param bo 人员信息登记记录
* @return 是否新增成功
*/
Boolean insertByBo(AppPersonnelInfoRecordsBo bo);
/**
* 修改人员信息登记记录
*
* @param bo 人员信息登记记录
* @return 是否修改成功
*/
Boolean updateByBo(AppPersonnelInfoRecordsBo bo);
/**
* 校验并批量删除人员信息登记记录信息
*
* @param ids 待删除的主键集合
* @param isValid 是否进行有效性校验
* @return 是否删除成功
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

View File

@ -0,0 +1,138 @@
package com.fuyuanshen.app.service.impl;
import com.fuyuanshen.common.core.utils.MapstructUtils;
import com.fuyuanshen.common.core.utils.StringUtils;
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoRecordsBo;
import com.fuyuanshen.app.domain.vo.AppPersonnelInfoRecordsVo;
import com.fuyuanshen.app.domain.AppPersonnelInfoRecords;
import com.fuyuanshen.app.mapper.AppPersonnelInfoRecordsMapper;
import com.fuyuanshen.app.service.IAppPersonnelInfoRecordsService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 人员信息登记记录Service业务层处理
*
* @author CYT
* @date 2025-08-22
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class AppPersonnelInfoRecordsServiceImpl implements IAppPersonnelInfoRecordsService {
private final AppPersonnelInfoRecordsMapper baseMapper;
/**
* 查询人员信息登记记录
*
* @param id 主键
* @return 人员信息登记记录
*/
@Override
public AppPersonnelInfoRecordsVo queryById(Long id){
return baseMapper.selectVoById(id);
}
/**
* 分页查询人员信息登记记录列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 人员信息登记记录分页列表
*/
@Override
public TableDataInfo<AppPersonnelInfoRecordsVo> queryPageList(AppPersonnelInfoRecordsBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<AppPersonnelInfoRecords> lqw = buildQueryWrapper(bo);
Page<AppPersonnelInfoRecordsVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询符合条件的人员信息登记记录列表
*
* @param bo 查询条件
* @return 人员信息登记记录列表
*/
@Override
public List<AppPersonnelInfoRecordsVo> queryList(AppPersonnelInfoRecordsBo bo) {
LambdaQueryWrapper<AppPersonnelInfoRecords> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<AppPersonnelInfoRecords> buildQueryWrapper(AppPersonnelInfoRecordsBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<AppPersonnelInfoRecords> lqw = Wrappers.lambdaQuery();
lqw.orderByAsc(AppPersonnelInfoRecords::getId);
lqw.eq(bo.getDeviceId() != null, AppPersonnelInfoRecords::getDeviceId, bo.getDeviceId());
lqw.eq(bo.getPersonnelId() != null, AppPersonnelInfoRecords::getPersonnelId, bo.getPersonnelId());
lqw.like(StringUtils.isNotBlank(bo.getName()), AppPersonnelInfoRecords::getName, bo.getName());
lqw.eq(StringUtils.isNotBlank(bo.getPosition()), AppPersonnelInfoRecords::getPosition, bo.getPosition());
lqw.like(StringUtils.isNotBlank(bo.getUnitName()), AppPersonnelInfoRecords::getUnitName, bo.getUnitName());
lqw.eq(StringUtils.isNotBlank(bo.getCode()), AppPersonnelInfoRecords::getCode, bo.getCode());
lqw.eq(StringUtils.isNotBlank(bo.getSendMsg()), AppPersonnelInfoRecords::getSendMsg, bo.getSendMsg());
return lqw;
}
/**
* 新增人员信息登记记录
*
* @param bo 人员信息登记记录
* @return 是否新增成功
*/
@Override
public Boolean insertByBo(AppPersonnelInfoRecordsBo bo) {
AppPersonnelInfoRecords add = MapstructUtils.convert(bo, AppPersonnelInfoRecords.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setId(add.getId());
}
return flag;
}
/**
* 修改人员信息登记记录
*
* @param bo 人员信息登记记录
* @return 是否修改成功
*/
@Override
public Boolean updateByBo(AppPersonnelInfoRecordsBo bo) {
AppPersonnelInfoRecords update = MapstructUtils.convert(bo, AppPersonnelInfoRecords.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(AppPersonnelInfoRecords entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 校验并批量删除人员信息登记记录信息
*
* @param ids 待删除的主键集合
* @param isValid 是否进行有效性校验
* @return 是否删除成功
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuyuanshen.app.mapper.AppPersonnelInfoRecordsMapper">
</mapper>

View File

@ -22,10 +22,10 @@ public class Device extends TenantEntity {
* id
*/
@TableId(value = "id", type = IdType.AUTO)
@Schema(name = "ID")
@Schema(title = "ID")
private Long id;
@Schema(name = "设备记录ID")
@Schema(title = "设备记录ID")
@TableField(exist = false)
private Long assignId;
@ -33,76 +33,76 @@ public class Device extends TenantEntity {
* 设备分组
* group_id
*/
@Schema(name = "设备分组")
@Schema(title = "设备分组")
private Long groupId;
/**
* device_type
*/
@Schema(name = "设备类型")
@Schema(title = "设备类型")
private Long deviceType;
@Schema(name = "设备类型名称")
@Schema(title = "设备类型名称")
private String typeName;
@Schema(name = "客户号")
@Schema(title = "客户号")
private Long customerId;
@Schema(name = "所属客户")
@Schema(title = "所属客户")
private String customerName;
/**
* 当前所有者
* current_owner_id
*/
@Schema(name = "当前所有者")
@Schema(title = "当前所有者")
private Long currentOwnerId;
/**
* 原始所有者(创建者)
* original_owner_id
*/
@Schema(name = "原始所有者(创建者)")
@Schema(title = "原始所有者(创建者)")
private Long originalOwnerId;
/**
* 原始设备
*/
@Schema(name = "原始设备")
@Schema(title = "原始设备")
private Long originalDeviceId;
@Schema(name = "设备编号")
@Schema(title = "设备编号")
private String deviceNo;
@Schema(name = "设备名称")
@Schema(title = "设备名称")
private String deviceName;
@Schema(name = "设备图片")
@Schema(title = "设备图片")
private String devicePic;
@Schema(name = "设备MAC")
@Schema(title = "设备MAC")
private String deviceMac;
@Schema(name = "蓝牙名称")
@Schema(title = "蓝牙名称")
private String bluetoothName;
/**
* 设备IMEI
* device_imei
*/
@Schema(name = "设备IMEI")
@Schema(title = "设备IMEI")
private String deviceImei;
@Schema(name = "设备SN")
@Schema(title = "设备SN")
private String deviceSn;
@Schema(name = "经度")
@Schema(title = "经度")
private String longitude;
@Schema(name = "纬度")
@Schema(title = "纬度")
private String latitude;
@Schema(name = "备注")
@Schema(title = "备注")
private String remark;
/**
@ -110,7 +110,7 @@ public class Device extends TenantEntity {
* 0 失效
* 1 正常
*/
@Schema(name = "设备状态")
@Schema(title = "设备状态")
private Integer deviceStatus;
/**
@ -118,7 +118,7 @@ public class Device extends TenantEntity {
* 0 未绑定
* 1 已绑定
*/
@Schema(name = "绑定状态")
@Schema(title = "绑定状态")
private Integer bindingStatus;
/**
@ -151,7 +151,7 @@ public class Device extends TenantEntity {
* 出厂日期
* production_date
*/
@Schema(name = "出厂日期")
@Schema(title = "出厂日期")
private Date productionDate;
}

View File

@ -18,42 +18,42 @@ import lombok.Data;
public class DeviceType extends TenantEntity {
@TableId(value = "id", type = IdType.AUTO)
@Schema(name = "ID", hidden = true)
@Schema(title = "ID", hidden = true)
private Long id;
@Schema(name = "客户号")
@Schema(title = "客户号")
private Long customerId;
@Schema(name = "创建该类型的客户")
@Schema(title = "创建该类型的客户")
private Long ownerCustomerId;
/**
* 原始所有者(创建者)
* original_owner_id
*/
@Schema(name = "原始所有者(创建者)")
@Schema(title = "原始所有者(创建者)")
private Long originalOwnerId;
/**
* 原始设备
*/
@Schema(name = "原始设备类型")
@Schema(title = "原始设备类型")
private Long originalDeviceId;
@NotBlank(message = "设备类型名称不能为空")
@Schema(name = "类型名称", required = true)
@Schema(title = "类型名称", required = true)
private String typeName;
@Schema(name = "是否支持蓝牙")
@Schema(title = "是否支持蓝牙")
private Boolean isSupportBle;
@Schema(name = "定位方式", example = "0:无;1:GPS;2:基站;3:wifi;4:北斗")
@Schema(title = "定位方式", example = "0:无;1:GPS;2:基站;3:wifi;4:北斗")
private String locateMode;
@Schema(name = "联网方式", example = "0:无;1:4G;2:WIFI")
@Schema(title = "联网方式", example = "0:无;1:4G;2:WIFI")
private String networkWay;
@Schema(name = "通讯方式", example = "0:4G;1:蓝牙")
@Schema(title = "通讯方式", example = "0:4G;1:蓝牙")
private String communicationMode;
/**
@ -67,9 +67,17 @@ public class DeviceType extends TenantEntity {
/**
* 型号字典用于APP页面跳转
* app_model_dictionary
*/
@Schema(name = "型号字典用于APP页面跳转")
private String modelDictionary;
@Schema(title = "型号字典用于APP页面跳转")
private String appModelDictionary;
/**
* 型号字典用于PC页面跳转
* pc_model_dictionary
*/
@Schema(title = "型号字典用于PC页面跳转")
private String pcModelDictionary;
}

View File

@ -30,21 +30,21 @@ public class DeviceGroupBo extends BaseEntity {
/**
* 分组名称
*/
@Schema(name = "分组名称")
@Schema(title = "分组名称")
@NotBlank(message = "分组名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String groupName;
/**
* 状态0-禁用1-正常
*/
@Schema(name = "状态0-禁用1-正常")
@Schema(title = "状态0-禁用1-正常")
// @NotNull(message = "状态0-禁用1-正常不能为空", groups = { AddGroup.class, EditGroup.class })
private Long status;
/**
* 父分组ID
*/
@Schema(name = "父分组ID")
@Schema(title = "父分组ID")
private Long parentId;
/**
@ -59,10 +59,10 @@ public class DeviceGroupBo extends BaseEntity {
private Long isDeleted;
@Schema(name = "页码", example = "1")
@Schema(title = "页码", example = "1")
private Integer pageNum = 1;
@Schema(name = "每页数据量", example = "10")
@Schema(title = "每页数据量", example = "10")
private Integer pageSize = 10;
}

View File

@ -40,7 +40,7 @@ public class DeviceForm {
@Schema(title = "设备MAC")
private String deviceMac;
@Schema(name = "蓝牙名称")
@Schema(title = "蓝牙名称")
private String bluetoothName;

View File

@ -11,28 +11,28 @@ import lombok.Data;
@Data
public class DeviceTypeForm {
@Schema(name = "ID", hidden = true)
@Schema(title = "ID", hidden = true)
private Long id;
@Schema(name = "类型名称", required = true)
@Schema(title = "类型名称", required = true)
private String typeName;
@Schema(name = "是否支持蓝牙")
@Schema(title = "是否支持蓝牙")
private Boolean isSupportBle;
@Schema(name = "定位方式", example = "0:无;1:GPS;2:基站;3:wifi;4:北斗")
@Schema(title = "定位方式", example = "0:无;1:GPS;2:基站;3:wifi;4:北斗")
private String locateMode;
@Schema(name = "联网方式", example = "0:无;1:4G;2:WIFI")
@Schema(title = "联网方式", example = "0:无;1:4G;2:WIFI")
private String networkWay;
@Schema(name = "通讯方式", example = "0:4G;1:蓝牙")
@Schema(title = "通讯方式", example = "0:4G;1:蓝牙")
private String communicationMode;
/**
* 型号字典用于APP页面跳转
*/
@Schema(name = "型号字典用于APP页面跳转")
@Schema(title = "型号字典用于APP页面跳转")
private String modelDictionary;
}

View File

@ -66,6 +66,12 @@ public class DeviceQueryCriteria extends BaseEntity {
/* app绑定用户id */
private Long bindingUserId;
/**
* 使用人员
*/
private String personnelBy;
/**
* 是否为管理员
*/

View File

@ -15,25 +15,25 @@ import java.util.Set;
@Data
public class DeviceTypeQueryCriteria extends BaseEntity implements Serializable {
@Schema(name = "设备类型id")
@Schema(title = "设备类型id")
private Long deviceTypeId;
@Schema(name = "型号名称")
@Schema(title = "型号名称")
private String typeName;
@Schema(name = "所属客户")
@Schema(title = "所属客户")
private Set<Long> customerIds;
@Schema(name = "所属客户")
@Schema(title = "所属客户")
private Long customerId;
@Schema(name = "com.fuyuanshen")
@Schema(title = "com.fuyuanshen")
private Long tenantId;
@Schema(name = "页码", example = "1")
@Schema(title = "页码", example = "1")
private Integer pageNum = 1;
@Schema(name = "每页数据量", example = "10")
@Schema(title = "每页数据量", example = "10")
private Integer pageSize = 10;

View File

@ -16,11 +16,11 @@ import java.util.List;
@Validated
public class CustomerVo {
@Schema(name = "客户ID")
@Schema(title = "客户ID")
@NotNull(message = "客户ID不能为空")
private Long customerId;
@Schema(name = "设备ID")
@Schema(title = "设备ID")
@NotNull(message = "设备ID不能为空")
private List<Long> deviceIds;

View File

@ -0,0 +1,100 @@
package com.fuyuanshen.equipment.domain.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class WebDeviceVo implements Serializable {
private Long id;
/**
* 设备名称
*/
private String deviceName;
/**
* 设备IMEI
*/
private String deviceImei;
/**
* 设备MAC
*/
private String deviceMac;
/**
* 通讯方式 0:4G;1:蓝牙
*/
private Integer communicationMode;
/**
* 设备图片
*/
private String devicePic;
/**
* 设备类型
*/
private String typeName;
/**
* 蓝牙名称
*/
private String bluetoothName;
/**
* 使用人员
*/
private String personnelBy;
/**
* 设备状态
* 0 失效
* 1 正常
*/
private Integer deviceStatus;
/**
* 绑定时间
*/
private Date bindingTime;
/**
* 在线状态(0离线1在线)
*/
private Integer onlineStatus;
/**
* 电量 百分比
*/
private String battery;
/**
* 纬度
*/
private String latitude;
/**
* 经度
*/
private String longitude;
/**
* 告警状态(0解除告警1告警)
*/
private String alarmStatus;
/**
* 设备详情页面
*/
private String detailPageUrl;
/**
* 分享用户数量
*/
private Integer shareUsersNumber;
}

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuyuanshen.equipment.domain.Device;
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
import com.fuyuanshen.equipment.domain.vo.WebDeviceVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -68,4 +69,6 @@ public interface DeviceMapper extends BaseMapper<Device> {
List<Device> findByOriginalDeviceId(Long originalDeviceId);
AppDeviceVo getDeviceInfo(@Param("deviceMac") String deviceMac);
Page<WebDeviceVo> queryWebDeviceList(Page<Object> build, DeviceQueryCriteria bo);
}

View File

@ -232,5 +232,46 @@
inner join device_type dt on d.device_type = dt.id
where d.device_mac = #{deviceMac}
</select>
<select id="queryWebDeviceList" resultType="com.fuyuanshen.equipment.domain.vo.WebDeviceVo">
select d.id, d.device_name, d.device_name,
d.device_name,
d.device_mac,
d.device_sn,
d.device_imei,
d.device_pic,
dt.type_name,
dt.communication_mode,
d.bluetooth_name,
dt.model_dictionary detailPageUrl,
ap.name personnelBy,
d.device_status,
c.binding_time
from device d
inner join device_type dt on d.device_type = dt.id
inner join app_device_bind_record c on d.id = c.device_id
left join app_personnel_info ap on ap.device_id = d.id
where dt.communication_mode = 0
<if test="criteria.deviceType != null">
and d.device_type = #{criteria.deviceType}
</if>
<if test="criteria.deviceName != null">
and d.device_name like concat('%', #{criteria.deviceName}, '%')
</if>
<if test="criteria.deviceMac != null">
and d.device_mac = #{criteria.deviceMac}
</if>
<if test="criteria.deviceImei != null">
and d.device_imei = #{criteria.deviceImei}
</if>
<if test="criteria.deviceStatus != null">
and d.device_status = #{criteria.deviceStatus}
</if>
<if test="criteria.personnelBy != null and criteria.personnelBy != ''">
and ap.name like concat('%', #{criteria.personnelBy}, '%')
</if>
<if test="criteria.communicationMode != null">
and dt.communication_mode, = #{criteria.communicationMode}
</if>
</select>
</mapper>