diff --git a/fys-system/src/main/java/com/fuyuanshen/modules/system/mapper/app/APPDeviceMapper.java b/fys-system/src/main/java/com/fuyuanshen/modules/system/mapper/app/APPDeviceMapper.java index 0cf3a2e..9353433 100644 --- a/fys-system/src/main/java/com/fuyuanshen/modules/system/mapper/app/APPDeviceMapper.java +++ b/fys-system/src/main/java/com/fuyuanshen/modules/system/mapper/app/APPDeviceMapper.java @@ -19,6 +19,15 @@ import java.util.List; @Mapper public interface APPDeviceMapper extends BaseMapper { + /** + * APP用户设备列表 + * + * @param page + * @param criteria + * @return + */ + IPage appDeviceList(Page page,@Param("criteria") DeviceQueryCriteria criteria); + /** * 分页查询APP/小程序设备 @@ -27,6 +36,7 @@ public interface APPDeviceMapper extends BaseMapper { * @param page * @return */ - IPage queryAll(Page page, @Param("criteria")DeviceQueryCriteria criteria ); + IPage queryAll(Page page, @Param("criteria") DeviceQueryCriteria criteria); + } diff --git a/fys-system/src/main/java/com/fuyuanshen/modules/system/mapper/app/AppDeviceTypeMapper.java b/fys-system/src/main/java/com/fuyuanshen/modules/system/mapper/app/AppDeviceTypeMapper.java index 2d44958..b250061 100644 --- a/fys-system/src/main/java/com/fuyuanshen/modules/system/mapper/app/AppDeviceTypeMapper.java +++ b/fys-system/src/main/java/com/fuyuanshen/modules/system/mapper/app/AppDeviceTypeMapper.java @@ -3,16 +3,26 @@ package com.fuyuanshen.modules.system.mapper.app; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.fuyuanshen.modules.system.domain.app.APPDeviceType; +import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** -* @author 97433 -* @description 针对表【app_device_type(设备类型表)】的数据库操作Mapper -* @createDate 2025-06-24 11:16:18 -* @Entity system.domain.AppDeviceType -*/ + * @author 97433 + * @description 针对表【app_device_type(设备类型表)】的数据库操作Mapper + * @createDate 2025-06-24 11:16:18 + * @Entity system.domain.AppDeviceType + */ @Mapper public interface AppDeviceTypeMapper extends BaseMapper { + /** + * 查询设备类型列表 + * + * @param criteria 查询条件 + * @return 设备类型列表 + */ + List appTypeList(DeviceQueryCriteria criteria); } diff --git a/fys-system/src/main/java/com/fuyuanshen/modules/system/rest/app/APPDeviceController.java b/fys-system/src/main/java/com/fuyuanshen/modules/system/rest/app/APPDeviceController.java index 66daf9d..4ed1913 100644 --- a/fys-system/src/main/java/com/fuyuanshen/modules/system/rest/app/APPDeviceController.java +++ b/fys-system/src/main/java/com/fuyuanshen/modules/system/rest/app/APPDeviceController.java @@ -8,6 +8,7 @@ import com.fuyuanshen.modules.system.constant.UserConstants; import com.fuyuanshen.modules.system.domain.Device; import com.fuyuanshen.modules.system.domain.User; import com.fuyuanshen.modules.system.domain.app.APPDevice; +import com.fuyuanshen.modules.system.domain.app.APPDeviceType; import com.fuyuanshen.modules.system.domain.dto.CustomerVo; import com.fuyuanshen.modules.system.domain.dto.DeviceExcelImportDTO; import com.fuyuanshen.modules.system.domain.dto.DeviceForm; @@ -67,9 +68,32 @@ public class APPDeviceController { private final APPDeviceService appDeviceService; + @PostMapping(value = "/list") + @ApiOperation("APP用户设备列表") + public ResponseVO> appDeviceList(@RequestBody DeviceQueryCriteria criteria) { + Page page = new Page<>(criteria.getPage(), criteria.getSize()); + PageResult devices = null; + try { + devices = appDeviceService.appDeviceList(page, criteria); + } catch (Exception e) { + log.error("queryDevice error: " + e.getMessage()); + return ResponseVO.fail(""); + } + return ResponseVO.success(devices); + } + + + @PostMapping(value = "/typeList") + @ApiOperation("APP用户设备类型列表") + public ResponseVO> appTypeList(@RequestBody DeviceQueryCriteria criteria) { + List typeList = appDeviceService.appTypeList(criteria); + return ResponseVO.success(typeList); + } + + @PostMapping(value = "/bind") @ApiOperation("APP用户设备绑定") - public ResponseVO appBindDevice( @RequestBody DeviceQueryCriteria criteria) { + public ResponseVO appBindDevice(@RequestBody DeviceQueryCriteria criteria) { appDeviceService.appBindDevice(criteria); return ResponseVO.success("绑定成功!"); } diff --git a/fys-system/src/main/java/com/fuyuanshen/modules/system/service/app/APPDeviceService.java b/fys-system/src/main/java/com/fuyuanshen/modules/system/service/app/APPDeviceService.java index adcd92a..7928385 100644 --- a/fys-system/src/main/java/com/fuyuanshen/modules/system/service/app/APPDeviceService.java +++ b/fys-system/src/main/java/com/fuyuanshen/modules/system/service/app/APPDeviceService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.fuyuanshen.modules.system.domain.Device; import com.fuyuanshen.modules.system.domain.app.APPDevice; +import com.fuyuanshen.modules.system.domain.app.APPDeviceType; import com.fuyuanshen.modules.system.domain.dto.CustomerVo; import com.fuyuanshen.modules.system.domain.dto.DeviceForm; import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria; @@ -22,6 +23,22 @@ import java.util.List; **/ public interface APPDeviceService extends IService { + /** + * APP用户设备列表 + * + * @param criteria + */ + PageResult appDeviceList(Page page, DeviceQueryCriteria criteria); + + + /** + * APP用户设备类型列表 + * + * @param criteria + * @return + */ + List appTypeList(DeviceQueryCriteria criteria); + /** * APP/小程序用户设备绑定 * @@ -29,7 +46,6 @@ public interface APPDeviceService extends IService { */ void appBindDevice(DeviceQueryCriteria criteria); - /** * 分页查询APP/小程序设备绑定 * diff --git a/fys-system/src/main/java/com/fuyuanshen/modules/system/service/app/APPDeviceServiceImpl.java b/fys-system/src/main/java/com/fuyuanshen/modules/system/service/app/APPDeviceServiceImpl.java index e72f02c..f7c6cb6 100644 --- a/fys-system/src/main/java/com/fuyuanshen/modules/system/service/app/APPDeviceServiceImpl.java +++ b/fys-system/src/main/java/com/fuyuanshen/modules/system/service/app/APPDeviceServiceImpl.java @@ -49,6 +49,29 @@ public class APPDeviceServiceImpl extends ServiceImpl appDeviceList(Page page, DeviceQueryCriteria criteria) { + IPage devices = appDeviceMapper.appDeviceList(page, criteria); + return new PageResult<>(devices.getRecords(), devices.getTotal()); + } + + /** + * APP用户设备类型列表 + * + * @param criteria + * @return + */ + @Override + public List appTypeList(DeviceQueryCriteria criteria) { + return appDeviceTypeMapper.appTypeList(criteria); + } + + /** * APP/小程序用户设备绑定 * diff --git a/fys-system/src/main/resources/mapper/system/APPDeviceMapper.xml b/fys-system/src/main/resources/mapper/system/APPDeviceMapper.xml index 18f13f4..15d0431 100644 --- a/fys-system/src/main/resources/mapper/system/APPDeviceMapper.xml +++ b/fys-system/src/main/resources/mapper/system/APPDeviceMapper.xml @@ -19,6 +19,40 @@ + + + + \ No newline at end of file diff --git a/fys-system/src/main/resources/mapper/system/AppDeviceTypeMapper.xml b/fys-system/src/main/resources/mapper/system/AppDeviceTypeMapper.xml index 97fc77b..cc9b414 100644 --- a/fys-system/src/main/resources/mapper/system/AppDeviceTypeMapper.xml +++ b/fys-system/src/main/resources/mapper/system/AppDeviceTypeMapper.xml @@ -5,21 +5,55 @@ - - - - - - - - - - - + + + + + + + + + + + id,type_name,is_support_ble,locate_mode,network_way,create_by, update_by,create_time,update_time,customer_id,communication_mode + + +