feat:客户端版本管理
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
package com.zt.plat.module.qms.resource.clientManage.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 客户端版本管理分页 Request VO")
|
||||
@Data
|
||||
public class SystemVersionManagementPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "客户端id", example = "赵六")
|
||||
private String custDeviceId;
|
||||
|
||||
@Schema(description = "客户端名称", example = "赵六")
|
||||
private String custDeviceName;
|
||||
|
||||
@Schema(description = "更新标题")
|
||||
private String updateTitle;
|
||||
|
||||
@Schema(description = "更新内容")
|
||||
private String updateContent;
|
||||
|
||||
@Schema(description = "更新平台")
|
||||
private String updatePlatform;
|
||||
|
||||
@Schema(description = "安装包类型")
|
||||
private String updateType;
|
||||
|
||||
@Schema(description = "上线发行")
|
||||
private Integer issuanceFlag;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,83 @@
|
||||
package com.zt.plat.module.qms.resource.clientManage.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 客户端版本管理新增/修改 Request VO")
|
||||
@Data
|
||||
public class SystemVersionManagementSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18365")
|
||||
private Long id;
|
||||
|
||||
// @Schema(description = "客户端id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20524")
|
||||
// @NotEmpty(message = "客户端id不能为空")
|
||||
// private String custDeviceId;
|
||||
|
||||
// @Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
// @NotEmpty(message = "客户端名称不能为空")
|
||||
// private String custDeviceName;
|
||||
@Schema(description = "客户端id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20524")
|
||||
@NotEmpty(message = "客户端名称不能为空")
|
||||
private String custDeviceId;
|
||||
|
||||
@Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@NotEmpty(message = "客户端名称不能为空")
|
||||
private String custDeviceName;
|
||||
|
||||
@Schema(description = "更新标题")
|
||||
private String updateTitle;
|
||||
|
||||
@Schema(description = "更新内容")
|
||||
private String updateContent;
|
||||
|
||||
@Schema(description = "更新平台", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @NotEmpty(message = "更新平台不能为空")
|
||||
private String updatePlatform;
|
||||
|
||||
@Schema(description = "安装包类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
// @NotEmpty(message = "安装包类型不能为空")
|
||||
private String updateType;
|
||||
|
||||
@Schema(description = "当前版本,必须大于当前线上发行版本号")
|
||||
private String currentVersion;
|
||||
|
||||
@Schema(description = "最低版本")
|
||||
private String minimumVersion;
|
||||
|
||||
@Schema(description = "下载地址", example = "https://www.iocoder.cn")
|
||||
private String downloadUrl;
|
||||
|
||||
@Schema(description = "文件md5值")
|
||||
private String fileMd5;
|
||||
|
||||
@Schema(description = "文件sha1值")
|
||||
private String fileEncryptAlgorithm;
|
||||
|
||||
@Schema(description = "上线发行", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @NotNull(message = "上线发行不能为空")
|
||||
private Integer issuanceFlag;
|
||||
|
||||
@Schema(description = "是否静默更新")
|
||||
private Integer noneAdviceFlag;
|
||||
|
||||
@Schema(description = "是否强制更新")
|
||||
private Integer mustUpdateFlag;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@Schema(description = "上传文件列表")
|
||||
private List<uploadFileVo> files;
|
||||
|
||||
@Schema(description = "上传文件Uid")
|
||||
private String downloadId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zt.plat.module.qms.resource.clientManage.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "附件实例")
|
||||
@Data
|
||||
public class uploadFileVo {
|
||||
private String id;
|
||||
|
||||
private String url;
|
||||
|
||||
private String name;
|
||||
|
||||
private String uid;
|
||||
|
||||
private String status;
|
||||
|
||||
private String md5;
|
||||
|
||||
private String sha1;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,60 @@
|
||||
package com.zt.plat.module.qms.resource.clientManage.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.resource.clientManage.dal.dataobject.SystemVersionManagementDO;
|
||||
import com.zt.plat.module.qms.resource.clientManage.controller.vo.SystemVersionManagementPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户端版本管理 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface SystemVersionManagementMapper extends BaseMapperX<SystemVersionManagementDO> {
|
||||
|
||||
default PageResult<SystemVersionManagementDO> selectPage(SystemVersionManagementPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SystemVersionManagementDO>()
|
||||
.eqIfPresent(SystemVersionManagementDO::getCustDeviceId, reqVO.getCustDeviceId())
|
||||
.eqIfPresent(SystemVersionManagementDO::getCustDeviceName, reqVO.getCustDeviceName())
|
||||
.eqIfPresent(SystemVersionManagementDO::getUpdateTitle, reqVO.getUpdateTitle())
|
||||
.eqIfPresent(SystemVersionManagementDO::getUpdateContent, reqVO.getUpdateContent())
|
||||
.eqIfPresent(SystemVersionManagementDO::getUpdatePlatform, reqVO.getUpdatePlatform())
|
||||
.eqIfPresent(SystemVersionManagementDO::getIssuanceFlag, reqVO.getIssuanceFlag())
|
||||
.eqIfPresent(SystemVersionManagementDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(SystemVersionManagementDO::getCreator, reqVO.getCreator())
|
||||
.betweenIfPresent(SystemVersionManagementDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SystemVersionManagementDO::getId));
|
||||
}
|
||||
|
||||
|
||||
default PageResult<SystemVersionManagementDO> selectLts(SystemVersionManagementPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SystemVersionManagementDO>()
|
||||
.eqIfPresent(SystemVersionManagementDO::getUpdatePlatform, reqVO.getUpdatePlatform())
|
||||
.eqIfPresent(SystemVersionManagementDO::getUpdateType, reqVO.getUpdateType())
|
||||
.eqIfPresent(SystemVersionManagementDO::getCustDeviceId, reqVO.getCustDeviceId())
|
||||
.eq(SystemVersionManagementDO::getIssuanceFlag,1)
|
||||
.orderByDesc(SystemVersionManagementDO::getCreateTime)
|
||||
// .last("LIMIT 1")
|
||||
);
|
||||
}
|
||||
|
||||
default List<SystemVersionManagementDO> selectBySameCustDeviceId(Long id) {
|
||||
// 先根据id查询出目标记录的custDeviceId
|
||||
SystemVersionManagementDO target = selectById(id);
|
||||
if (target == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// 查询相同custDeviceId的所有记录
|
||||
return selectList(new LambdaQueryWrapperX<SystemVersionManagementDO>()
|
||||
.eq(SystemVersionManagementDO::getCustDeviceId, target.getCustDeviceId())
|
||||
.eq(SystemVersionManagementDO::getIssuanceFlag, 1)
|
||||
.orderByDesc(SystemVersionManagementDO::getCreateTime));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.zt.plat.module.qms.resource.clientManage.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.clientManage.controller.vo.SystemVersionManagementPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.clientManage.controller.vo.SystemVersionManagementRespVO;
|
||||
import com.zt.plat.module.qms.resource.clientManage.controller.vo.SystemVersionManagementSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.resource.clientManage.dal.dataobject.SystemVersionManagementDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 客户端版本管理 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface SystemVersionManagementService {
|
||||
|
||||
/**
|
||||
* 创建客户端版本管理
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
SystemVersionManagementRespVO createSystemVersionManagement(@Valid SystemVersionManagementSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新客户端版本管理
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSystemVersionManagement(@Valid SystemVersionManagementSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除客户端版本管理
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSystemVersionManagement(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除客户端版本管理
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteSystemVersionManagementListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得客户端版本管理
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 客户端版本管理
|
||||
*/
|
||||
SystemVersionManagementDO getSystemVersionManagement(Long id);
|
||||
|
||||
/**
|
||||
* 获得客户端版本管理分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 客户端版本管理分页
|
||||
*/
|
||||
PageResult<SystemVersionManagementDO> getSystemVersionManagementPage(SystemVersionManagementPageReqVO pageReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 获得客户端版本管理接口方法
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 客户端版本管理分页
|
||||
*/
|
||||
PageResult<SystemVersionManagementDO> getLts(SystemVersionManagementPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 版本发布
|
||||
* @param id
|
||||
*/
|
||||
void publish (Long id);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.qms.resource.clientManage.dal.mapper.SystemVersionManagementMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user