版本文件
前缀字段
This commit is contained in:
parent
019eb184f3
commit
d29c85c600
|
@ -28,7 +28,7 @@
|
|||
<!-- 文件列表 -->
|
||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
||||
<el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
|
||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
</el-link>
|
||||
<div class="ele-upload-list__item-content-action">
|
||||
|
@ -61,7 +61,8 @@ export default {
|
|||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
fileType: {
|
||||
type: Array,
|
||||
default: () => ["doc", "xls", "ppt", "txt", "pdf"],
|
||||
// default: () => ["doc", "docx", "xls", "ppt", "txt", "pdf","bin"],
|
||||
default: () => ["bin"],
|
||||
},
|
||||
// 是否显示提示
|
||||
isShowTip: {
|
||||
|
@ -74,7 +75,8 @@ export default {
|
|||
number: 0,
|
||||
uploadList: [],
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
uploadData: {key:'',token:''},
|
||||
uploadData: {token:''},
|
||||
domain:"",
|
||||
uploadFileUrl: "https://up-z2.qiniup.com", // 上传文件服务器地址
|
||||
// headers: {
|
||||
// Authorization: "Bearer " + getToken(),
|
||||
|
@ -87,6 +89,7 @@ export default {
|
|||
console.log("七牛云获取token"+JSON.stringify(res));
|
||||
if (res.code === 200) {
|
||||
this.uploadData.token = res.token
|
||||
this.domain = res.domain;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -158,16 +161,18 @@ export default {
|
|||
handleUploadSuccess(res, file) {
|
||||
console.log("七牛云获取res"+JSON.stringify(res));
|
||||
console.log("七牛云获取file"+JSON.stringify(file));
|
||||
if (res.code === 200) {
|
||||
this.uploadList.push({ name: res.fileName, url: res.fileName });
|
||||
this.uploadedSuccessfully();
|
||||
} else {
|
||||
this.number--;
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgError(res.msg);
|
||||
this.$refs.fileUpload.handleRemove(file);
|
||||
this.uploadedSuccessfully();
|
||||
}
|
||||
this.uploadList.push({ name: res.hash, url: this.domain+"/"+res.hash });
|
||||
this.uploadedSuccessfully();
|
||||
// if (res.code === 200) {
|
||||
// this.uploadList.push({ name: res.fileName, url: res.fileName });
|
||||
// this.uploadedSuccessfully();
|
||||
// } else {
|
||||
// this.number--;
|
||||
// this.$modal.closeLoading();
|
||||
// this.$modal.msgError(res.msg);
|
||||
// this.$refs.fileUpload.handleRemove(file);
|
||||
// this.uploadedSuccessfully();
|
||||
// }
|
||||
},
|
||||
// 删除文件
|
||||
handleDelete(index) {
|
||||
|
@ -176,7 +181,9 @@ export default {
|
|||
},
|
||||
// 上传结束处理
|
||||
uploadedSuccessfully() {
|
||||
if (this.number > 0 && this.uploadList.length === this.number) {
|
||||
console.log("this.number:"+this.number);
|
||||
console.log("this.uploadList.length:"+this.uploadList.length);
|
||||
if (this.number > 0) {
|
||||
this.fileList = this.fileList.concat(this.uploadList);
|
||||
this.uploadList = [];
|
||||
this.number = 0;
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
<el-table v-loading="loading" :data="versionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="id" align="center" prop="versionId" />
|
||||
<el-table-column label="型号" align="center" prop="modelId" />
|
||||
<el-table-column label="型号" align="center" prop="model" />
|
||||
<el-table-column label="版本号" align="center" prop="version" />
|
||||
<el-table-column label="大小(K)" align="center" prop="size" />
|
||||
<el-table-column label="升级要求" align="center" prop="upgradeRequire" />
|
||||
|
@ -126,7 +126,7 @@
|
|||
<el-option
|
||||
v-for="item in modelOptions"
|
||||
:key="item.modelId"
|
||||
:label="item.modelName"
|
||||
:label="item.model"
|
||||
:value="item.modelId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
@ -134,6 +134,9 @@
|
|||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="form.version" placeholder="请输入版本号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件" prop="file">
|
||||
<file-upload v-model="form.file"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="大小(K)" prop="size">
|
||||
<el-input v-model="form.size" placeholder="请输入大小" />
|
||||
</el-form-item>
|
||||
|
@ -155,7 +158,6 @@
|
|||
<script>
|
||||
import { listVersion, getVersion, delVersion, addVersion, updateVersion } from "@/api/device/version";
|
||||
import {listModel} from "@/api/device/model";
|
||||
import {listClassify} from "@/api/device/classify";
|
||||
|
||||
export default {
|
||||
name: "Version",
|
||||
|
@ -204,8 +206,14 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getModelOptions();
|
||||
},
|
||||
methods: {
|
||||
getModelOptions() {
|
||||
listModel(this.queryParams).then(response => {
|
||||
this.modelOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询固件版本列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
@ -257,9 +265,6 @@ export default {
|
|||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加固件版本";
|
||||
listModel(this.queryParams).then(response => {
|
||||
this.modelOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
|
|
@ -534,5 +534,15 @@ public class AppController extends BaseController
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据版本号获取版本对象
|
||||
*/
|
||||
@GetMapping("/getVersion")
|
||||
public AjaxResult getVersion(String version)
|
||||
{
|
||||
logger.info("根据版本号获取版本对象-----{}",version);
|
||||
return success(asDeviceVersionService.selectAsDeviceVersionByVersion(version));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -168,4 +168,8 @@ public class AsDevice extends BaseEntity
|
|||
/** 蓝牙名称 */
|
||||
@Excel(name = "蓝牙名称")
|
||||
private String bluetoothName;
|
||||
|
||||
/** 设备前缀 */
|
||||
@Excel(name = "设备前缀")
|
||||
private String pre;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
|
||||
/**
|
||||
* 固件版本对象 as_device_version
|
||||
*
|
||||
*
|
||||
* @author qiuzhenzhao
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
|
@ -25,6 +25,10 @@ public class AsDeviceVersion extends BaseEntity
|
|||
@Excel(name = "型号id")
|
||||
private Long modelId;
|
||||
|
||||
/** 型号 */
|
||||
@Excel(name = "型号")
|
||||
private String model;
|
||||
|
||||
/** 版本号 */
|
||||
@Excel(name = "版本号")
|
||||
private String version;
|
||||
|
@ -33,6 +37,10 @@ public class AsDeviceVersion extends BaseEntity
|
|||
@Excel(name = "大小", readConverterExp = "K=")
|
||||
private Long size;
|
||||
|
||||
/** 文件 */
|
||||
@Excel(name = "文件")
|
||||
private String file;
|
||||
|
||||
/** 升级要求 */
|
||||
@Excel(name = "升级要求")
|
||||
private String upgradeRequire;
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.ruoyi.device.domain.AsDeviceVersion;
|
|||
|
||||
/**
|
||||
* 固件版本Mapper接口
|
||||
*
|
||||
*
|
||||
* @author qiuzhenzhao
|
||||
* @date 2023-11-11
|
||||
*/
|
||||
|
@ -15,15 +15,21 @@ public interface AsDeviceVersionMapper extends BaseMapper<AsDeviceVersion>
|
|||
{
|
||||
/**
|
||||
* 查询固件版本
|
||||
*
|
||||
*
|
||||
* @param versionId 固件版本主键
|
||||
* @return 固件版本
|
||||
*/
|
||||
public AsDeviceVersion selectAsDeviceVersionByVersionId(Long versionId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据版本号获取版本对象
|
||||
*/
|
||||
AsDeviceVersion selectAsDeviceVersionByVersion(String version);
|
||||
|
||||
/**
|
||||
* 查询固件版本列表
|
||||
*
|
||||
*
|
||||
* @param asDeviceVersion 固件版本
|
||||
* @return 固件版本集合
|
||||
*/
|
||||
|
@ -31,7 +37,7 @@ public interface AsDeviceVersionMapper extends BaseMapper<AsDeviceVersion>
|
|||
|
||||
/**
|
||||
* 新增固件版本
|
||||
*
|
||||
*
|
||||
* @param asDeviceVersion 固件版本
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -39,7 +45,7 @@ public interface AsDeviceVersionMapper extends BaseMapper<AsDeviceVersion>
|
|||
|
||||
/**
|
||||
* 修改固件版本
|
||||
*
|
||||
*
|
||||
* @param asDeviceVersion 固件版本
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -47,7 +53,7 @@ public interface AsDeviceVersionMapper extends BaseMapper<AsDeviceVersion>
|
|||
|
||||
/**
|
||||
* 删除固件版本
|
||||
*
|
||||
*
|
||||
* @param versionId 固件版本主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -55,7 +61,7 @@ public interface AsDeviceVersionMapper extends BaseMapper<AsDeviceVersion>
|
|||
|
||||
/**
|
||||
* 批量删除固件版本
|
||||
*
|
||||
*
|
||||
* @param versionIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
@ -5,23 +5,32 @@ import com.ruoyi.device.domain.AsDeviceVersion;
|
|||
|
||||
/**
|
||||
* 固件版本Service接口
|
||||
*
|
||||
*
|
||||
* @author qiuzhenzhao
|
||||
* @date 2023-11-11
|
||||
*/
|
||||
public interface IAsDeviceVersionService
|
||||
public interface IAsDeviceVersionService
|
||||
{
|
||||
/**
|
||||
* 查询固件版本
|
||||
*
|
||||
*
|
||||
* @param versionId 固件版本主键
|
||||
* @return 固件版本
|
||||
*/
|
||||
public AsDeviceVersion selectAsDeviceVersionByVersionId(Long versionId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据版本号获取版本对象
|
||||
*
|
||||
* @param version 版本号
|
||||
* @return 固件版本
|
||||
*/
|
||||
public AsDeviceVersion selectAsDeviceVersionByVersion(String version);
|
||||
|
||||
/**
|
||||
* 查询固件版本列表
|
||||
*
|
||||
*
|
||||
* @param asDeviceVersion 固件版本
|
||||
* @return 固件版本集合
|
||||
*/
|
||||
|
@ -29,7 +38,7 @@ public interface IAsDeviceVersionService
|
|||
|
||||
/**
|
||||
* 新增固件版本
|
||||
*
|
||||
*
|
||||
* @param asDeviceVersion 固件版本
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -37,7 +46,7 @@ public interface IAsDeviceVersionService
|
|||
|
||||
/**
|
||||
* 修改固件版本
|
||||
*
|
||||
*
|
||||
* @param asDeviceVersion 固件版本
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -45,7 +54,7 @@ public interface IAsDeviceVersionService
|
|||
|
||||
/**
|
||||
* 批量删除固件版本
|
||||
*
|
||||
*
|
||||
* @param versionIds 需要删除的固件版本主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -53,7 +62,7 @@ public interface IAsDeviceVersionService
|
|||
|
||||
/**
|
||||
* 删除固件版本信息
|
||||
*
|
||||
*
|
||||
* @param versionId 固件版本主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
@ -491,6 +491,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
device.setUserName(asUser.getUserName());
|
||||
device.setBluetoothId(asDevice.getBluetoothId());
|
||||
device.setBluetoothName(asDevice.getBluetoothName());
|
||||
device.setPre(asDevice.getPre());
|
||||
int i = asDeviceMapper.updateAsDevice(device);
|
||||
ServiceUtil.assertion(i == 0, "绑定失败!");
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import javax.annotation.Resource;
|
|||
|
||||
/**
|
||||
* 固件版本Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author qiuzhenzhao
|
||||
* @date 2023-11-11
|
||||
*/
|
||||
|
@ -25,7 +25,7 @@ public class AsDeviceVersionServiceImpl extends ServiceImpl<AsDeviceVersionMappe
|
|||
|
||||
/**
|
||||
* 查询固件版本
|
||||
*
|
||||
*
|
||||
* @param versionId 固件版本主键
|
||||
* @return 固件版本
|
||||
*/
|
||||
|
@ -35,9 +35,20 @@ public class AsDeviceVersionServiceImpl extends ServiceImpl<AsDeviceVersionMappe
|
|||
return asDeviceVersionMapper.selectAsDeviceVersionByVersionId(versionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据版本号获取版本对象
|
||||
*
|
||||
* @param version 版本号
|
||||
* @return 固件版本
|
||||
*/
|
||||
@Override
|
||||
public AsDeviceVersion selectAsDeviceVersionByVersion(String version) {
|
||||
return asDeviceVersionMapper.selectAsDeviceVersionByVersion(version);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询固件版本列表
|
||||
*
|
||||
*
|
||||
* @param asDeviceVersion 固件版本
|
||||
* @return 固件版本
|
||||
*/
|
||||
|
@ -49,7 +60,7 @@ public class AsDeviceVersionServiceImpl extends ServiceImpl<AsDeviceVersionMappe
|
|||
|
||||
/**
|
||||
* 新增固件版本
|
||||
*
|
||||
*
|
||||
* @param asDeviceVersion 固件版本
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -62,7 +73,7 @@ public class AsDeviceVersionServiceImpl extends ServiceImpl<AsDeviceVersionMappe
|
|||
|
||||
/**
|
||||
* 修改固件版本
|
||||
*
|
||||
*
|
||||
* @param asDeviceVersion 固件版本
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -75,7 +86,7 @@ public class AsDeviceVersionServiceImpl extends ServiceImpl<AsDeviceVersionMappe
|
|||
|
||||
/**
|
||||
* 批量删除固件版本
|
||||
*
|
||||
*
|
||||
* @param versionIds 需要删除的固件版本主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -87,7 +98,7 @@ public class AsDeviceVersionServiceImpl extends ServiceImpl<AsDeviceVersionMappe
|
|||
|
||||
/**
|
||||
* 删除固件版本信息
|
||||
*
|
||||
*
|
||||
* @param versionId 固件版本主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.device.mapper.AsDeviceVersionMapper">
|
||||
|
||||
|
||||
<resultMap type="AsDeviceVersion" id="AsDeviceVersionResult">
|
||||
<result property="versionId" column="version_id" />
|
||||
<result property="modelId" column="model_id" />
|
||||
|
@ -13,30 +13,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="size" column="size" />
|
||||
<result property="file" column="file" />
|
||||
<result property="upgradeRequire" column="upgrade_require" />
|
||||
<result property="upgradeDescribe" column="upgrade_describe" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAsDeviceVersionVo">
|
||||
select version_id, model_id, version, create_by, create_time, update_by, update_time, size, upgrade_require, upgrade_describe from as_device_version
|
||||
select
|
||||
v.version_id,
|
||||
v.model_id,
|
||||
m.model,
|
||||
v.version,
|
||||
v.create_by,
|
||||
v.create_time,
|
||||
v.update_by,
|
||||
v.update_time,
|
||||
v.size,
|
||||
v.file,
|
||||
v.upgrade_require,
|
||||
v.upgrade_describe
|
||||
from as_device_version v
|
||||
left join as_model m on v.model_id = m.model_id
|
||||
</sql>
|
||||
|
||||
<select id="selectAsDeviceVersionList" parameterType="AsDeviceVersion" resultMap="AsDeviceVersionResult">
|
||||
<include refid="selectAsDeviceVersionVo"/>
|
||||
<where>
|
||||
<if test="modelId != null "> and model_id = #{modelId}</if>
|
||||
<if test="version != null and version != ''"> and version = #{version}</if>
|
||||
<if test="size != null "> and size = #{size}</if>
|
||||
<if test="upgradeRequire != null and upgradeRequire != ''"> and upgrade_require like concat('%', #{upgradeRequire}, '%')</if>
|
||||
<if test="upgradeDescribe != null and upgradeDescribe != ''"> and upgrade_describe like concat('%', #{upgradeDescribe}, '%')</if>
|
||||
<where>
|
||||
<if test="modelId != null "> and v.model_id = #{modelId}</if>
|
||||
<if test="version != null and version != ''"> and v.version = #{version}</if>
|
||||
<if test="size != null "> and v.size = #{size}</if>
|
||||
<if test="upgradeRequire != null and upgradeRequire != ''"> and v.upgrade_require like concat('%', #{upgradeRequire}, '%')</if>
|
||||
<if test="upgradeDescribe != null and upgradeDescribe != ''"> and v.upgrade_describe like concat('%', #{upgradeDescribe}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAsDeviceVersionByVersionId" parameterType="Long" resultMap="AsDeviceVersionResult">
|
||||
<include refid="selectAsDeviceVersionVo"/>
|
||||
where version_id = #{versionId}
|
||||
where v.version_id = #{versionId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAsDeviceVersionByVersion" parameterType="string" resultMap="AsDeviceVersionResult">
|
||||
<include refid="selectAsDeviceVersionVo"/>
|
||||
where v.version = #{version}
|
||||
</select>
|
||||
|
||||
<insert id="insertAsDeviceVersion" parameterType="AsDeviceVersion" useGeneratedKeys="true" keyProperty="versionId">
|
||||
insert into as_device_version
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -47,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="size != null">size,</if>
|
||||
<if test="file != null">file,</if>
|
||||
<if test="upgradeRequire != null">upgrade_require,</if>
|
||||
<if test="upgradeDescribe != null">upgrade_describe,</if>
|
||||
</trim>
|
||||
|
@ -58,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="size != null">#{size},</if>
|
||||
<if test="file != null">#{file},</if>
|
||||
<if test="upgradeRequire != null">#{upgradeRequire},</if>
|
||||
<if test="upgradeDescribe != null">#{upgradeDescribe},</if>
|
||||
</trim>
|
||||
|
@ -73,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="size != null">size = #{size},</if>
|
||||
<if test="file != null">file = #{file},</if>
|
||||
<if test="upgradeRequire != null">upgrade_require = #{upgradeRequire},</if>
|
||||
<if test="upgradeDescribe != null">upgrade_describe = #{upgradeDescribe},</if>
|
||||
</trim>
|
||||
|
@ -84,9 +107,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteAsDeviceVersionByVersionIds" parameterType="String">
|
||||
delete from as_device_version where version_id in
|
||||
delete from as_device_version where version_id in
|
||||
<foreach item="versionId" collection="array" open="(" separator="," close=")">
|
||||
#{versionId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue
Block a user