Compare commits
2 Commits
1246ac5cf7
...
9b476e98ba
Author | SHA1 | Date | |
---|---|---|---|
9b476e98ba | |||
d962c6ead5 |
@ -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.PageQuery;
|
||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.fuyuanshen.common.web.core.BaseController;
|
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.dto.AppDeviceBo;
|
||||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
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.WEBDeviceService;
|
||||||
import com.fuyuanshen.web.service.device.DeviceBizService;
|
import com.fuyuanshen.web.service.device.DeviceBizService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@ -38,7 +40,6 @@ public class WEBDeviceController extends BaseController {
|
|||||||
private final WEBDeviceService deviceService;
|
private final WEBDeviceService deviceService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
@ -53,6 +54,19 @@ public class WEBDeviceController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备详情
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Operation(summary = "设备详情")
|
||||||
|
@GetMapping(value = "/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.query.DeviceQueryCriteria;
|
||||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||||
import com.fuyuanshen.equipment.domain.vo.CustomerVo;
|
import com.fuyuanshen.equipment.domain.vo.CustomerVo;
|
||||||
|
import com.fuyuanshen.equipment.domain.vo.WebDeviceVo;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -29,4 +30,12 @@ public interface WEBDeviceService extends IService<Device> {
|
|||||||
*/
|
*/
|
||||||
int webUnBindDevice(Long id, Long userId);
|
int webUnBindDevice(Long id, Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WEB端设备详情
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
WebDeviceVo getDevice(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
package com.fuyuanshen.web.service.impl;
|
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.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fuyuanshen.app.domain.AppDeviceBindRecord;
|
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.AppDeviceBindRecordMapper;
|
||||||
|
import com.fuyuanshen.app.mapper.AppDeviceShareMapper;
|
||||||
import com.fuyuanshen.equipment.domain.Device;
|
import com.fuyuanshen.equipment.domain.Device;
|
||||||
import com.fuyuanshen.equipment.domain.DeviceAssignments;
|
import com.fuyuanshen.equipment.domain.DeviceAssignments;
|
||||||
|
import com.fuyuanshen.equipment.domain.vo.WebDeviceVo;
|
||||||
import com.fuyuanshen.equipment.enums.BindingStatusEnum;
|
import com.fuyuanshen.equipment.enums.BindingStatusEnum;
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceAssignmentsMapper;
|
import com.fuyuanshen.equipment.mapper.DeviceAssignmentsMapper;
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
||||||
@ -27,13 +32,12 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class WEBDeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements WEBDeviceService {
|
public class WEBDeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements WEBDeviceService {
|
||||||
|
|
||||||
private final DeviceBizService appDeviceService;
|
|
||||||
|
|
||||||
private final DeviceAssignmentsMapper deviceAssignmentsMapper;
|
private final DeviceAssignmentsMapper deviceAssignmentsMapper;
|
||||||
|
|
||||||
private final AppDeviceBindRecordMapper appDeviceBindRecordMapper;
|
private final AppDeviceBindRecordMapper appDeviceBindRecordMapper;
|
||||||
|
|
||||||
private final DeviceMapper deviceMapper;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -67,9 +67,17 @@ public class DeviceType extends TenantEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 型号字典用于APP页面跳转
|
* 型号字典用于APP页面跳转
|
||||||
|
* app_model_dictionary
|
||||||
*/
|
*/
|
||||||
@Schema(title = "型号字典用于APP页面跳转")
|
@Schema(title = "型号字典用于APP页面跳转")
|
||||||
private String modelDictionary;
|
private String appModelDictionary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 型号字典用于PC页面跳转
|
||||||
|
* pc_model_dictionary
|
||||||
|
*/
|
||||||
|
@Schema(title = "型号字典用于PC页面跳转")
|
||||||
|
private String pcModelDictionary;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -92,4 +92,9 @@ public class WebDeviceVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String detailPageUrl;
|
private String detailPageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分享用户数量
|
||||||
|
*/
|
||||||
|
private Integer shareUsersNumber;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user