Compare commits
19 Commits
7607a0c9c0
...
prod
Author | SHA1 | Date | |
---|---|---|---|
82399cffed | |||
74cefe9cc3 | |||
9b476e98ba | |||
d962c6ead5 | |||
1246ac5cf7 | |||
5538ac96e5 | |||
b703f80355 | |||
b3b249ea07 | |||
aff424e73b | |||
dc513a858a | |||
df5ce7ddd9 | |||
2174dfdb4d | |||
2800b89e06 | |||
637e46c510 | |||
31c2158c8e | |||
c7c21dc358 | |||
a7e0803b00 | |||
55cacbd322 | |||
99ec6eaff0 |
@ -8,9 +8,11 @@ import com.fuyuanshen.common.core.domain.R;
|
||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||
import com.fuyuanshen.common.web.core.BaseController;
|
||||
import com.fuyuanshen.equipment.domain.Device;
|
||||
import com.fuyuanshen.equipment.domain.dto.AppDeviceBo;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.WebDeviceVo;
|
||||
import com.fuyuanshen.web.service.WEBDeviceService;
|
||||
import com.fuyuanshen.web.service.device.DeviceBizService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -38,7 +40,6 @@ public class WEBDeviceController extends BaseController {
|
||||
private final WEBDeviceService deviceService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return
|
||||
@ -53,6 +54,19 @@ public class WEBDeviceController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设备详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "设备详情")
|
||||
@GetMapping(value = "/pc/detail/{id}")
|
||||
public R<WebDeviceVo> getDevice(@PathVariable Long id) {
|
||||
WebDeviceVo device = deviceService.getDevice(id);
|
||||
return R.ok(device);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ import com.fuyuanshen.equipment.domain.form.DeviceForm;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.CustomerVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.WebDeviceVo;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@ -29,4 +30,12 @@ public interface WEBDeviceService extends IService<Device> {
|
||||
*/
|
||||
int webUnBindDevice(Long id, Long userId);
|
||||
|
||||
/**
|
||||
* WEB端设备详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
WebDeviceVo getDevice(Long id);
|
||||
|
||||
}
|
||||
|
@ -1,12 +1,17 @@
|
||||
package com.fuyuanshen.web.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuyuanshen.app.domain.AppDeviceBindRecord;
|
||||
import com.fuyuanshen.app.domain.AppDeviceShare;
|
||||
import com.fuyuanshen.app.domain.vo.AppDeviceShareVo;
|
||||
import com.fuyuanshen.app.mapper.AppDeviceBindRecordMapper;
|
||||
import com.fuyuanshen.app.mapper.AppDeviceShareMapper;
|
||||
import com.fuyuanshen.equipment.domain.Device;
|
||||
import com.fuyuanshen.equipment.domain.DeviceAssignments;
|
||||
import com.fuyuanshen.equipment.domain.vo.WebDeviceVo;
|
||||
import com.fuyuanshen.equipment.enums.BindingStatusEnum;
|
||||
import com.fuyuanshen.equipment.mapper.DeviceAssignmentsMapper;
|
||||
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
||||
@ -27,13 +32,12 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@RequiredArgsConstructor
|
||||
public class WEBDeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements WEBDeviceService {
|
||||
|
||||
private final DeviceBizService appDeviceService;
|
||||
|
||||
private final DeviceAssignmentsMapper deviceAssignmentsMapper;
|
||||
|
||||
private final AppDeviceBindRecordMapper appDeviceBindRecordMapper;
|
||||
|
||||
private final DeviceMapper deviceMapper;
|
||||
private final AppDeviceShareMapper appDeviceShareMapper;
|
||||
|
||||
|
||||
/**
|
||||
@ -70,4 +74,25 @@ public class WEBDeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impl
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* WEB端设备详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public WebDeviceVo getDevice(Long id) {
|
||||
Device device = deviceMapper.selectById(id);
|
||||
if (device != null) {
|
||||
WebDeviceVo webDeviceVo = new WebDeviceVo();
|
||||
BeanUtil.copyProperties(device, webDeviceVo);
|
||||
// 查询分享用户数
|
||||
Long count = appDeviceShareMapper.selectCount(new QueryWrapper<AppDeviceShare>().eq("device_id", id));
|
||||
webDeviceVo.setShareUsersNumber(Math.toIntExact(count));
|
||||
return webDeviceVo;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ spring.boot.admin.client:
|
||||
metadata:
|
||||
username: ${spring.boot.admin.client.username}
|
||||
userpassword: ${spring.boot.admin.client.password}
|
||||
username: @monitor.username@
|
||||
password: @monitor.password@
|
||||
username: ${monitor.username}
|
||||
password: ${monitor.password}
|
||||
|
||||
--- # snail-job 配置
|
||||
snail-job:
|
||||
|
@ -11,8 +11,8 @@ spring.boot.admin.client:
|
||||
metadata:
|
||||
username: ${spring.boot.admin.client.username}
|
||||
userpassword: ${spring.boot.admin.client.password}
|
||||
username: @monitor.username@
|
||||
password: @monitor.password@
|
||||
username: ${monitor.username}
|
||||
password: ${monitor.password}
|
||||
|
||||
--- # snail-job 配置
|
||||
snail-job:
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class DeviceForm {
|
||||
@Schema(title = "设备MAC")
|
||||
private String deviceMac;
|
||||
|
||||
@Schema(name = "蓝牙名称")
|
||||
@Schema(title = "蓝牙名称")
|
||||
private String bluetoothName;
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -92,4 +92,9 @@ public class WebDeviceVo implements Serializable {
|
||||
*/
|
||||
private String detailPageUrl;
|
||||
|
||||
/**
|
||||
* 分享用户数量
|
||||
*/
|
||||
private Integer shareUsersNumber;
|
||||
|
||||
}
|
||||
|
16
pom.xml
16
pom.xml
@ -83,10 +83,10 @@
|
||||
<monitor.username>fys</monitor.username>
|
||||
<monitor.password>123456</monitor.password>
|
||||
</properties>
|
||||
<activation>
|
||||
<!-- 默认环境 -->
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<!-- <activation> -->
|
||||
<!-- <!– 默认环境 –> -->
|
||||
<!-- <activeByDefault>true</activeByDefault> -->
|
||||
<!-- </activation> -->
|
||||
</profile>
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
@ -96,10 +96,10 @@
|
||||
<monitor.username>fys</monitor.username>
|
||||
<monitor.password>123456</monitor.password>
|
||||
</properties>
|
||||
<!-- <activation> -->
|
||||
<!-- <!– 默认环境 –> -->
|
||||
<!-- <activeByDefault>true</activeByDefault> -->
|
||||
<!-- </activation> -->
|
||||
<activation>
|
||||
<!-- 默认环境 -->
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jingquan</id>
|
||||
|
Reference in New Issue
Block a user