Compare commits
4 Commits
main_app权限
...
6e41426faa
Author | SHA1 | Date | |
---|---|---|---|
6e41426faa | |||
134c17a2bd | |||
5c2aba3d32 | |||
6a6adc5ec1 |
@ -38,4 +38,5 @@ public interface GenConfigService extends IService<GenConfig> {
|
|||||||
* @return 表配置
|
* @return 表配置
|
||||||
*/
|
*/
|
||||||
GenConfig update(String tableName, GenConfig genConfig);
|
GenConfig update(String tableName, GenConfig genConfig);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import com.fuyuanshen.base.BaseEntity;
|
import com.fuyuanshen.base.BaseEntity;
|
||||||
@ -20,6 +21,7 @@ import java.io.Serializable;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@TableName("device")
|
@TableName("device")
|
||||||
|
@JsonInclude(JsonInclude.Include.ALWAYS) // 关键注解
|
||||||
public class Device extends BaseEntity implements Serializable {
|
public class Device extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.fuyuanshen.modules.system.domain.app.APPDeviceType;
|
import com.fuyuanshen.modules.system.domain.app.APPDeviceType;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -23,6 +24,6 @@ public interface AppDeviceTypeMapper extends BaseMapper<APPDeviceType> {
|
|||||||
* @param criteria 查询条件
|
* @param criteria 查询条件
|
||||||
* @return 设备类型列表
|
* @return 设备类型列表
|
||||||
*/
|
*/
|
||||||
List<APPDeviceType> appTypeList(DeviceQueryCriteria criteria);
|
List<APPDeviceType> appTypeList(@Param("criteria")DeviceQueryCriteria criteria);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,56 +1,20 @@
|
|||||||
package com.fuyuanshen.modules.system.rest.app;
|
package com.fuyuanshen.modules.system.rest.app;
|
||||||
|
|
||||||
import com.alibaba.excel.EasyExcel;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuyuanshen.annotation.Log;
|
|
||||||
import com.fuyuanshen.exception.BadRequestException;
|
|
||||||
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.APPDevice;
|
||||||
import com.fuyuanshen.modules.system.domain.app.APPDeviceType;
|
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;
|
|
||||||
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.app.APPUnbindDTO;
|
import com.fuyuanshen.modules.system.domain.dto.app.APPUnbindDTO;
|
||||||
import com.fuyuanshen.modules.system.listener.excel.DeviceImportParams;
|
|
||||||
import com.fuyuanshen.modules.system.listener.excel.UploadDeviceDataListener;
|
|
||||||
import com.fuyuanshen.modules.system.mapper.DeviceMapper;
|
|
||||||
import com.fuyuanshen.modules.system.mapper.DeviceTypeMapper;
|
|
||||||
import com.fuyuanshen.modules.system.mapper.UserMapper;
|
|
||||||
import com.fuyuanshen.modules.system.service.DeviceService;
|
|
||||||
import com.fuyuanshen.modules.system.service.UserService;
|
|
||||||
import com.fuyuanshen.modules.system.service.app.APPDeviceService;
|
import com.fuyuanshen.modules.system.service.app.APPDeviceService;
|
||||||
import com.fuyuanshen.modules.system.service.impl.DeviceExportService;
|
|
||||||
import com.fuyuanshen.modules.utils.ResponseVO;
|
import com.fuyuanshen.modules.utils.ResponseVO;
|
||||||
import com.fuyuanshen.modules.utils.excel.ImportResult;
|
|
||||||
import com.fuyuanshen.utils.FileUtil;
|
|
||||||
import com.fuyuanshen.utils.PageResult;
|
import com.fuyuanshen.utils.PageResult;
|
||||||
import com.fuyuanshen.utils.SecurityUtils;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,7 +50,7 @@ public class APPDeviceController {
|
|||||||
@PostMapping(value = "/typeList")
|
@PostMapping(value = "/typeList")
|
||||||
@ApiOperation("APP用户设备类型列表")
|
@ApiOperation("APP用户设备类型列表")
|
||||||
public ResponseVO<List<APPDeviceType>> appTypeList(@RequestBody DeviceQueryCriteria criteria) {
|
public ResponseVO<List<APPDeviceType>> appTypeList(@RequestBody DeviceQueryCriteria criteria) {
|
||||||
List<APPDeviceType> typeList = appDeviceService.appTypeList(criteria);
|
List<APPDeviceType> typeList = appDeviceService.appTypeList(criteria);
|
||||||
return ResponseVO.success(typeList);
|
return ResponseVO.success(typeList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,8 @@ public class APPDeviceServiceImpl extends ServiceImpl<APPDeviceMapper, APPDevice
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<APPDeviceType> appTypeList(DeviceQueryCriteria criteria) {
|
public List<APPDeviceType> appTypeList(DeviceQueryCriteria criteria) {
|
||||||
return appDeviceTypeMapper.appTypeList(criteria);
|
criteria.setCustomerId(SecurityUtils.getCurrentUserId());
|
||||||
|
return appDeviceTypeMapper.appTypeList(criteria);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,6 +109,9 @@ public class APPDeviceServiceImpl extends ServiceImpl<APPDeviceMapper, APPDevice
|
|||||||
}
|
}
|
||||||
|
|
||||||
Device device = devices.get(0);
|
Device device = devices.get(0);
|
||||||
|
device.setBindingStatus(BindingStatusEnum.BOUND.getCode());
|
||||||
|
deviceMapper.updateById( device);
|
||||||
|
|
||||||
APPDevice appDevice = new APPDevice();
|
APPDevice appDevice = new APPDevice();
|
||||||
BeanUtil.copyProperties(device, appDevice);
|
BeanUtil.copyProperties(device, appDevice);
|
||||||
appDevice.setBindingType(UserType.APP.getValue());
|
appDevice.setBindingType(UserType.APP.getValue());
|
||||||
@ -124,6 +128,7 @@ public class APPDeviceServiceImpl extends ServiceImpl<APPDeviceMapper, APPDevice
|
|||||||
DeviceType deviceType = deviceTypeMapper.selectById(device.getDeviceType());
|
DeviceType deviceType = deviceTypeMapper.selectById(device.getDeviceType());
|
||||||
APPDeviceType type = new APPDeviceType();
|
APPDeviceType type = new APPDeviceType();
|
||||||
BeanUtil.copyProperties(deviceType, type);
|
BeanUtil.copyProperties(deviceType, type);
|
||||||
|
type.setCustomerId(currentUserId);
|
||||||
appDeviceTypeMapper.insert(type);
|
appDeviceTypeMapper.insert(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ spring:
|
|||||||
max-file-size: 5MB # 设置单个上传文件的最大大小为10MB
|
max-file-size: 5MB # 设置单个上传文件的最大大小为10MB
|
||||||
max-request-size: 5MB
|
max-request-size: 5MB
|
||||||
jackson:
|
jackson:
|
||||||
default-property-inclusion: non_null
|
default-property-inclusion: always
|
||||||
# pid:
|
# pid:
|
||||||
# file: /自行指定位置/eladmin.pid
|
# file: /自行指定位置/eladmin.pid
|
||||||
|
|
||||||
|
@ -19,7 +19,8 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id,type_name,is_support_ble,locate_mode,network_way,create_by,
|
id
|
||||||
|
,type_name,is_support_ble,locate_mode,network_way,create_by,
|
||||||
update_by,create_time,update_time,customer_id,communication_mode
|
update_by,create_time,update_time,customer_id,communication_mode
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
@ -27,31 +28,6 @@
|
|||||||
<select id="appTypeList" resultType="com.fuyuanshen.modules.system.domain.app.APPDeviceType">
|
<select id="appTypeList" resultType="com.fuyuanshen.modules.system.domain.app.APPDeviceType">
|
||||||
select d.* from app_device_type as d
|
select d.* from app_device_type as d
|
||||||
<where>
|
<where>
|
||||||
<!-- 时间范围等其他条件保持原样 -->
|
|
||||||
<if test="criteria.deviceName != null and criteria.deviceName.trim() != ''">
|
|
||||||
and d.device_name like concat('%', TRIM(#{criteria.deviceName}), '%')
|
|
||||||
</if>
|
|
||||||
<if test="criteria.deviceMac != null and criteria.deviceMac.trim() != ''">
|
|
||||||
and d.device_mac = #{criteria.deviceMac}
|
|
||||||
</if>
|
|
||||||
<if test="criteria.deviceImei != null and criteria.deviceImei.trim() != ''">
|
|
||||||
and d.device_imei = #{criteria.deviceImei}
|
|
||||||
</if>
|
|
||||||
<if test="criteria.deviceSn != null">
|
|
||||||
and d.device_sn = #{criteria.deviceSn}
|
|
||||||
</if>
|
|
||||||
<if test="criteria.deviceType != null">
|
|
||||||
and d.device_type = #{criteria.deviceType}
|
|
||||||
</if>
|
|
||||||
<if test="criteria.deviceStatus != null">
|
|
||||||
and d.device_status = #{criteria.deviceStatus}
|
|
||||||
</if>
|
|
||||||
<if test="criteria.createTime != null and criteria.createTime.size() != 0">
|
|
||||||
and d.create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]}
|
|
||||||
</if>
|
|
||||||
<if test="criteria.tenantId != null">
|
|
||||||
AND tenant_id = #{criteria.tenantId}
|
|
||||||
</if>
|
|
||||||
and d.customer_id = #{criteria.customerId}
|
and d.customer_id = #{criteria.customerId}
|
||||||
</where>
|
</where>
|
||||||
order by d.create_time desc
|
order by d.create_time desc
|
||||||
|
Reference in New Issue
Block a user