fix:app版本管理细节调整
This commit is contained in:
@@ -452,10 +452,10 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
||||
if(!fieldExtensions.isEmpty()){
|
||||
for(int i = 0; i < fieldExtensions.size(); i++){
|
||||
JSONObject fieldExtension = fieldExtensions.getJSONObject(i);
|
||||
if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_LAST_ACTIVITY_FLAG)){
|
||||
if(fieldExtension.getString("fieldName").equalsIgnoreCase(QmsBpmConstant.BPM_LAST_ACTIVITY_FLAG)){
|
||||
lastActivityFlag = "1";
|
||||
}
|
||||
if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){
|
||||
if(fieldExtension.getString("fieldName").equalsIgnoreCase(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){
|
||||
firstActivityFlag = "1";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,12 +116,11 @@ public class VersionManagementController extends AbstractFileUploadController im
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/get-by-platform")
|
||||
@GetMapping("/checkUpdate")
|
||||
@Operation(summary = "根据更新平台和安装包类型获取最新客户端版本管理信息")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:version-management:query')")
|
||||
public CommonResult<PageResult<VersionManagementRespVO>> getSystemVersionManagementByPlatformAndType(@Valid VersionManagementPageReqVO pageReqVO) {
|
||||
public CommonResult<PageResult<VersionManagementRespVO>> checkUpdate(@Valid VersionManagementPageReqVO pageReqVO) {
|
||||
|
||||
if (pageReqVO.getCustDeviceCode() == null ) {
|
||||
if (pageReqVO.getApplicationCode() == null ) {
|
||||
return CommonResult.error(400, "客户端编号不能为空");
|
||||
}
|
||||
if (pageReqVO.getUpdatePlatform() == null ) {
|
||||
|
||||
@@ -13,10 +13,10 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class VersionManagementPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "客户端code", example = "赵六")
|
||||
private String custDeviceCode;
|
||||
private String applicationCode;
|
||||
|
||||
@Schema(description = "客户端名称", example = "赵六")
|
||||
private String custDeviceName;
|
||||
private String applicationName;
|
||||
|
||||
@Schema(description = "更新标题")
|
||||
private String updateTitle;
|
||||
@@ -30,8 +30,8 @@ public class VersionManagementPageReqVO extends PageParam {
|
||||
@Schema(description = "安装包类型")
|
||||
private String updateType;
|
||||
|
||||
@Schema(description = "上线发行")
|
||||
private Integer issuanceFlag;
|
||||
@Schema(description = "发布状态")
|
||||
private String publishFlag;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@@ -19,13 +19,11 @@ public class VersionManagementRespVO {
|
||||
|
||||
@Schema(description = "客户端code", requiredMode = Schema.RequiredMode.REQUIRED, example = "20524")
|
||||
@ExcelProperty(value = "客户端code", converter = DictConvert.class)
|
||||
@DictFormat("T_SYS_VER_MNGT_CUST_DEV") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String custDeviceCode;
|
||||
private String applicationCode;
|
||||
|
||||
@Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@ExcelProperty(value = "客户端名称", converter = DictConvert.class)
|
||||
@DictFormat("T_SYS_VER_MNGT_CUST_DEV") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String custDeviceName;
|
||||
private String applicationName;
|
||||
|
||||
@Schema(description = "更新标题")
|
||||
@ExcelProperty("更新标题")
|
||||
@@ -37,12 +35,10 @@ public class VersionManagementRespVO {
|
||||
|
||||
@Schema(description = "更新平台", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty(value = "更新平台", converter = DictConvert.class)
|
||||
@DictFormat("T_SYSVER_MNGT_UPD_PLTF") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String updatePlatform;
|
||||
|
||||
@Schema(description = "安装包类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty(value = "安装包类型", converter = DictConvert.class)
|
||||
@DictFormat("T_SYSVER_MNGT_UPD_TP") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String updateType;
|
||||
|
||||
@Schema(description = "当前版本,必须大于当前线上发行版本号")
|
||||
@@ -69,17 +65,17 @@ public class VersionManagementRespVO {
|
||||
@ExcelProperty("文件sha1值")
|
||||
private String fileEncryptAlgorithm;
|
||||
|
||||
@Schema(description = "上线发行", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("上线发行")
|
||||
private Integer issuanceFlag;
|
||||
@Schema(description = "发布状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("发布状态")
|
||||
private String publishFlag;
|
||||
|
||||
@Schema(description = "是否静默更新")
|
||||
@ExcelProperty("是否静默更新")
|
||||
private Integer noneAdviceFlag;
|
||||
private Integer silenceFlag;
|
||||
|
||||
@Schema(description = "是否强制更新")
|
||||
@ExcelProperty("是否强制更新")
|
||||
private Integer mustUpdateFlag;
|
||||
private Integer mustFlag;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
|
||||
@@ -13,20 +13,13 @@ public class VersionManagementSaveReqVO {
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18365")
|
||||
private Long id;
|
||||
|
||||
// @Schema(description = "客户端code", requiredMode = Schema.RequiredMode.REQUIRED, example = "20524")
|
||||
// @NotEmpty(message = "客户端code不能为空")
|
||||
// private String custDeviceCode;
|
||||
|
||||
// @Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
// @NotEmpty(message = "客户端名称不能为空")
|
||||
// private String custDeviceName;
|
||||
@Schema(description = "客户端code", requiredMode = Schema.RequiredMode.REQUIRED, example = "20524")
|
||||
@NotEmpty(message = "客户端名称不能为空")
|
||||
private String custDeviceCode;
|
||||
private String applicationCode;
|
||||
|
||||
@Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@NotEmpty(message = "客户端名称不能为空")
|
||||
private String custDeviceName;
|
||||
private String applicationName;
|
||||
|
||||
@Schema(description = "更新标题")
|
||||
private String updateTitle;
|
||||
@@ -57,15 +50,14 @@ public class VersionManagementSaveReqVO {
|
||||
@Schema(description = "文件sha1值")
|
||||
private String fileEncryptAlgorithm;
|
||||
|
||||
@Schema(description = "上线发行", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @NotNull(message = "上线发行不能为空")
|
||||
private Integer issuanceFlag;
|
||||
@Schema(description = "发布状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String publishFlag;
|
||||
|
||||
@Schema(description = "是否静默更新")
|
||||
private Integer noneAdviceFlag;
|
||||
private Integer silenceFlag;
|
||||
|
||||
@Schema(description = "是否强制更新")
|
||||
private Integer mustUpdateFlag;
|
||||
private Integer mustFlag;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@@ -30,18 +30,14 @@ public class VersionManagementDO extends BusinessBaseDO {
|
||||
private Long id;
|
||||
/**
|
||||
* 客户端code
|
||||
*
|
||||
* 枚举 {@link TODO T_SYS_VER_MNGT_CUST_DEV 对应的类}
|
||||
*/
|
||||
@TableField("CUST_DEV_CD")
|
||||
private String custDeviceCode;
|
||||
@TableField("APPL_CD")
|
||||
private String applicationCode;
|
||||
/**
|
||||
* 客户端名称
|
||||
*
|
||||
* 枚举 {@link TODO T_SYS_VER_MNGT_CUST_DEV 对应的类}
|
||||
*/
|
||||
@TableField("CUST_DEV_NAME")
|
||||
private String custDeviceName;
|
||||
@TableField("APPL_NAME")
|
||||
private String applicationName;
|
||||
/**
|
||||
* 更新标题
|
||||
*/
|
||||
@@ -55,14 +51,12 @@ public class VersionManagementDO extends BusinessBaseDO {
|
||||
/**
|
||||
* 更新平台
|
||||
*
|
||||
* 枚举 {@link TODO T_SYSVER_MNGT_UPD_PLTF 对应的类}
|
||||
*/
|
||||
@TableField("UPD_PLTF")
|
||||
private String updatePlatform;
|
||||
/**
|
||||
* 安装包类型
|
||||
*
|
||||
* 枚举 {@link TODO T_SYSVER_MNGT_UPD_TP 对应的类}
|
||||
*/
|
||||
@TableField("UPD_TP")
|
||||
private String updateType;
|
||||
@@ -92,20 +86,20 @@ public class VersionManagementDO extends BusinessBaseDO {
|
||||
@TableField("FILE_ENCR_ALG")
|
||||
private String fileEncryptAlgorithm;
|
||||
/**
|
||||
* 上线发行
|
||||
* 发布状态
|
||||
*/
|
||||
@TableField("ISSC_FLG")
|
||||
private Integer issuanceFlag;
|
||||
@TableField("PUB_FLG")
|
||||
private String publishFlag;
|
||||
/**
|
||||
* 是否静默更新
|
||||
*/
|
||||
@TableField("NNE_ADV_FLG")
|
||||
private Integer noneAdviceFlag;
|
||||
@TableField("SLNC_FLG")
|
||||
private Integer silenceFlag;
|
||||
/**
|
||||
* 是否强制更新
|
||||
*/
|
||||
@TableField("MUST_UPD_FLG")
|
||||
private Integer mustUpdateFlag;
|
||||
@TableField("MUST_FLG")
|
||||
private Integer mustFlag;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
|
||||
@@ -20,12 +20,12 @@ public interface VersionManagementMapper extends BaseMapperX<VersionManagementDO
|
||||
|
||||
default PageResult<VersionManagementDO> selectPage(VersionManagementPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<VersionManagementDO>()
|
||||
.eqIfPresent(VersionManagementDO::getCustDeviceCode, reqVO.getCustDeviceCode())
|
||||
.eqIfPresent(VersionManagementDO::getCustDeviceName, reqVO.getCustDeviceName())
|
||||
.eqIfPresent(VersionManagementDO::getApplicationCode, reqVO.getApplicationCode())
|
||||
.eqIfPresent(VersionManagementDO::getApplicationName, reqVO.getApplicationName())
|
||||
.eqIfPresent(VersionManagementDO::getUpdateTitle, reqVO.getUpdateTitle())
|
||||
.eqIfPresent(VersionManagementDO::getUpdateContent, reqVO.getUpdateContent())
|
||||
.eqIfPresent(VersionManagementDO::getUpdatePlatform, reqVO.getUpdatePlatform())
|
||||
.eqIfPresent(VersionManagementDO::getIssuanceFlag, reqVO.getIssuanceFlag())
|
||||
.eqIfPresent(VersionManagementDO::getPublishFlag, reqVO.getPublishFlag())
|
||||
.eqIfPresent(VersionManagementDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(VersionManagementDO::getCreator, reqVO.getCreator())
|
||||
.betweenIfPresent(VersionManagementDO::getCreateTime, reqVO.getCreateTime())
|
||||
@@ -33,18 +33,18 @@ public interface VersionManagementMapper extends BaseMapperX<VersionManagementDO
|
||||
}
|
||||
|
||||
|
||||
default PageResult<VersionManagementDO> selectLts(VersionManagementPageReqVO reqVO) {
|
||||
default PageResult<VersionManagementDO> selectList(VersionManagementPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<VersionManagementDO>()
|
||||
.eqIfPresent(VersionManagementDO::getUpdatePlatform, reqVO.getUpdatePlatform())
|
||||
.eqIfPresent(VersionManagementDO::getUpdateType, reqVO.getUpdateType())
|
||||
.eqIfPresent(VersionManagementDO::getCustDeviceCode, reqVO.getCustDeviceCode())
|
||||
.eq(VersionManagementDO::getIssuanceFlag,1)
|
||||
.eqIfPresent(VersionManagementDO::getApplicationCode, reqVO.getApplicationCode())
|
||||
.eq(VersionManagementDO::getPublishFlag,1)
|
||||
.orderByDesc(VersionManagementDO::getCreateTime)
|
||||
// .last("LIMIT 1")
|
||||
);
|
||||
}
|
||||
|
||||
default List<VersionManagementDO> selectBySameCustDeviceCode(Long id) {
|
||||
default List<VersionManagementDO> selectBySameCode(Long id) {
|
||||
// 先根据id查询出目标记录的custDeviceCode
|
||||
VersionManagementDO target = selectById(id);
|
||||
if (target == null) {
|
||||
@@ -53,8 +53,8 @@ public interface VersionManagementMapper extends BaseMapperX<VersionManagementDO
|
||||
|
||||
// 查询相同custDeviceCode的所有记录
|
||||
return selectList(new LambdaQueryWrapperX<VersionManagementDO>()
|
||||
.eq(VersionManagementDO::getCustDeviceCode, target.getCustDeviceCode())
|
||||
.eq(VersionManagementDO::getIssuanceFlag, 1)
|
||||
.eq(VersionManagementDO::getApplicationCode, target.getApplicationCode())
|
||||
.eq(VersionManagementDO::getPublishFlag, 1)
|
||||
.orderByDesc(VersionManagementDO::getCreateTime));
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class versionManagementServiceImpl implements VersionManagementService {
|
||||
@Override
|
||||
public VersionManagementRespVO createSystemVersionManagement(VersionManagementSaveReqVO createReqVO) {
|
||||
//多条数据取第一条
|
||||
if (createReqVO.getFiles().size() > 0) {
|
||||
if (createReqVO.getFiles() != null && createReqVO.getFiles().size() > 0) {
|
||||
uploadFileVo uploadFileVo = createReqVO.getFiles().get(0);
|
||||
createReqVO.setDownloadUrl(uploadFileVo.getUrl());
|
||||
createReqVO.setFileMd5(uploadFileVo.getMd5());
|
||||
@@ -62,7 +62,7 @@ public class versionManagementServiceImpl implements VersionManagementService {
|
||||
validateSystemVersionManagementExists(updateReqVO.getId());
|
||||
|
||||
//多条数据取第一条
|
||||
if (updateReqVO.getFiles().size() > 0) {
|
||||
if (updateReqVO.getFiles() != null && updateReqVO.getFiles().size() > 0) {
|
||||
uploadFileVo uploadFileVo = updateReqVO.getFiles().get(0);
|
||||
updateReqVO.setDownloadUrl(uploadFileVo.getUrl());
|
||||
updateReqVO.setFileMd5(uploadFileVo.getMd5());
|
||||
@@ -121,7 +121,7 @@ public class versionManagementServiceImpl implements VersionManagementService {
|
||||
public PageResult<VersionManagementDO> getLts(VersionManagementPageReqVO pageReqVO) {
|
||||
|
||||
|
||||
return systemVersionManagementMapper.selectLts(pageReqVO);
|
||||
return systemVersionManagementMapper.selectList(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,21 +130,21 @@ public class versionManagementServiceImpl implements VersionManagementService {
|
||||
validateSystemVersionManagementExists(id);
|
||||
|
||||
// 下线当前发布的版本
|
||||
List<VersionManagementDO> versionManagementDOS = systemVersionManagementMapper.selectBySameCustDeviceCode(id);
|
||||
List<VersionManagementDO> versionManagementDOS = systemVersionManagementMapper.selectBySameCode(id);
|
||||
|
||||
if (versionManagementDOS.size() > 0) {
|
||||
|
||||
VersionManagementDO versionManagementDO = versionManagementDOS.get(0);
|
||||
VersionManagementDO offlineVO = new VersionManagementDO();
|
||||
offlineVO.setId(versionManagementDO.getId());
|
||||
offlineVO.setIssuanceFlag(2);
|
||||
// offlineVO.setPublishFlag(2);
|
||||
systemVersionManagementMapper.updateById(offlineVO);
|
||||
}
|
||||
|
||||
|
||||
VersionManagementDO onlineVO = new VersionManagementDO();
|
||||
onlineVO.setId(id);
|
||||
onlineVO.setIssuanceFlag(1);
|
||||
// onlineVO.setPublishFlag(1);
|
||||
systemVersionManagementMapper.updateById(onlineVO);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user