forked from dyf/fys-Multi-tenant
WEB端查看APP客户设备绑定
This commit is contained in:
@ -19,6 +19,7 @@ import com.fuyuanshen.equipment.domain.bo.UserAppBo;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||
import com.fuyuanshen.equipment.service.AppUserService;
|
||||
import com.fuyuanshen.equipment.service.DeviceService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -42,6 +43,7 @@ public class APPDeviceController extends BaseController {
|
||||
|
||||
private final APPDeviceService appDeviceService;
|
||||
private final AppUserService appUserService;
|
||||
private final DeviceService deviceService;
|
||||
|
||||
|
||||
@PostMapping(value = "/list")
|
||||
@ -71,13 +73,11 @@ public class APPDeviceController extends BaseController {
|
||||
|
||||
@GetMapping
|
||||
@Operation(summary = "WEB端查看APP客户设备绑定")
|
||||
public TableDataInfo<APPDevice> queryAPPDevice(DeviceQueryCriteria criteria) {
|
||||
return appDeviceService.queryAppDeviceList(criteria);
|
||||
public TableDataInfo<AppDeviceVo> queryAPPDevice(DeviceQueryCriteria bo, PageQuery pageQuery) {
|
||||
return deviceService.queryAppDeviceList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping(value = "/unbind")
|
||||
@Operation(summary = "设备解绑")
|
||||
public ResponseVO<String> unbindAPPDevice(@Validated @ModelAttribute APPUnbindDTO deviceForm) {
|
||||
@ -86,7 +86,6 @@ public class APPDeviceController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改APP用户信息
|
||||
*/
|
||||
|
@ -29,7 +29,14 @@ public class AppDeviceVo {
|
||||
private Integer communicationMode;
|
||||
|
||||
/**
|
||||
* 设备图片
|
||||
* 设备图片
|
||||
*/
|
||||
private String devicePic;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
|
||||
}
|
||||
|
@ -499,8 +499,10 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
|
||||
@Override
|
||||
public TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery) {
|
||||
Long userId = AppLoginHelper.getUserId();
|
||||
bo.setBindingUserId(userId);
|
||||
if (bo.getBindingUserId() == null) {
|
||||
Long userId = AppLoginHelper.getUserId();
|
||||
bo.setBindingUserId(userId);
|
||||
}
|
||||
Page<AppDeviceVo> result = baseMapper.queryAppDeviceList(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
@ -167,18 +167,28 @@
|
||||
|
||||
<select id="queryAppDeviceList" resultType="com.fuyuanshen.equipment.domain.vo.AppDeviceVo">
|
||||
select d.id,
|
||||
d.device_name,
|
||||
d.device_mac,
|
||||
d.device_sn,
|
||||
d.device_imei,
|
||||
d.device_mac,
|
||||
dt.communication_mode
|
||||
d.device_name,
|
||||
d.device_mac,
|
||||
d.device_sn,
|
||||
d.device_imei,
|
||||
d.device_pic,
|
||||
dt.type_name,
|
||||
dt.communication_mode
|
||||
from device d
|
||||
inner join device_type dt on d.device_type = dt.id
|
||||
inner join device_type dt on d.device_type = dt.id
|
||||
where d.binding_user_id = #{criteria.bindingUserId}
|
||||
<if test="criteria.deviceType != null">
|
||||
and d.device_type = #{criteria.deviceType}
|
||||
</if>
|
||||
<if test="criteria.deviceName != null">
|
||||
and d.device_name = #{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>
|
||||
</select>
|
||||
|
||||
<!-- 获取分配设备的客户 -->
|
||||
|
Reference in New Issue
Block a user