fix:app版本管理细节调整

This commit is contained in:
FCL
2025-12-17 17:03:13 +08:00
parent 11bb57b1a4
commit e30b19cec0
8 changed files with 48 additions and 67 deletions

View File

@@ -452,10 +452,10 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
if(!fieldExtensions.isEmpty()){ if(!fieldExtensions.isEmpty()){
for(int i = 0; i < fieldExtensions.size(); i++){ for(int i = 0; i < fieldExtensions.size(); i++){
JSONObject fieldExtension = fieldExtensions.getJSONObject(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"; lastActivityFlag = "1";
} }
if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){ if(fieldExtension.getString("fieldName").equalsIgnoreCase(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){
firstActivityFlag = "1"; firstActivityFlag = "1";
} }
} }

View File

@@ -116,12 +116,11 @@ public class VersionManagementController extends AbstractFileUploadController im
} }
@GetMapping("/get-by-platform") @GetMapping("/checkUpdate")
@Operation(summary = "根据更新平台和安装包类型获取最新客户端版本管理信息") @Operation(summary = "根据更新平台和安装包类型获取最新客户端版本管理信息")
//@PreAuthorize("@ss.hasPermission('qms:version-management:query')") public CommonResult<PageResult<VersionManagementRespVO>> checkUpdate(@Valid VersionManagementPageReqVO pageReqVO) {
public CommonResult<PageResult<VersionManagementRespVO>> getSystemVersionManagementByPlatformAndType(@Valid VersionManagementPageReqVO pageReqVO) {
if (pageReqVO.getCustDeviceCode() == null ) { if (pageReqVO.getApplicationCode() == null ) {
return CommonResult.error(400, "客户端编号不能为空"); return CommonResult.error(400, "客户端编号不能为空");
} }
if (pageReqVO.getUpdatePlatform() == null ) { if (pageReqVO.getUpdatePlatform() == null ) {

View File

@@ -13,10 +13,10 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
public class VersionManagementPageReqVO extends PageParam { public class VersionManagementPageReqVO extends PageParam {
@Schema(description = "客户端code", example = "赵六") @Schema(description = "客户端code", example = "赵六")
private String custDeviceCode; private String applicationCode;
@Schema(description = "客户端名称", example = "赵六") @Schema(description = "客户端名称", example = "赵六")
private String custDeviceName; private String applicationName;
@Schema(description = "更新标题") @Schema(description = "更新标题")
private String updateTitle; private String updateTitle;
@@ -30,8 +30,8 @@ public class VersionManagementPageReqVO extends PageParam {
@Schema(description = "安装包类型") @Schema(description = "安装包类型")
private String updateType; private String updateType;
@Schema(description = "上线发行") @Schema(description = "发布状态")
private Integer issuanceFlag; private String publishFlag;
@Schema(description = "所属部门") @Schema(description = "所属部门")
private String systemDepartmentCode; private String systemDepartmentCode;

View File

@@ -19,13 +19,11 @@ public class VersionManagementRespVO {
@Schema(description = "客户端code", requiredMode = Schema.RequiredMode.REQUIRED, example = "20524") @Schema(description = "客户端code", requiredMode = Schema.RequiredMode.REQUIRED, example = "20524")
@ExcelProperty(value = "客户端code", converter = DictConvert.class) @ExcelProperty(value = "客户端code", converter = DictConvert.class)
@DictFormat("T_SYS_VER_MNGT_CUST_DEV") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 private String applicationCode;
private String custDeviceCode;
@Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") @Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@ExcelProperty(value = "客户端名称", converter = DictConvert.class) @ExcelProperty(value = "客户端名称", converter = DictConvert.class)
@DictFormat("T_SYS_VER_MNGT_CUST_DEV") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 private String applicationName;
private String custDeviceName;
@Schema(description = "更新标题") @Schema(description = "更新标题")
@ExcelProperty("更新标题") @ExcelProperty("更新标题")
@@ -37,12 +35,10 @@ public class VersionManagementRespVO {
@Schema(description = "更新平台", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "更新平台", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty(value = "更新平台", converter = DictConvert.class) @ExcelProperty(value = "更新平台", converter = DictConvert.class)
@DictFormat("T_SYSVER_MNGT_UPD_PLTF") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
private String updatePlatform; private String updatePlatform;
@Schema(description = "安装包类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @Schema(description = "安装包类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty(value = "安装包类型", converter = DictConvert.class) @ExcelProperty(value = "安装包类型", converter = DictConvert.class)
@DictFormat("T_SYSVER_MNGT_UPD_TP") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
private String updateType; private String updateType;
@Schema(description = "当前版本,必须大于当前线上发行版本号") @Schema(description = "当前版本,必须大于当前线上发行版本号")
@@ -69,17 +65,17 @@ public class VersionManagementRespVO {
@ExcelProperty("文件sha1值") @ExcelProperty("文件sha1值")
private String fileEncryptAlgorithm; private String fileEncryptAlgorithm;
@Schema(description = "上线发行", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "发布状态", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("上线发行") @ExcelProperty("发布状态")
private Integer issuanceFlag; private String publishFlag;
@Schema(description = "是否静默更新") @Schema(description = "是否静默更新")
@ExcelProperty("是否静默更新") @ExcelProperty("是否静默更新")
private Integer noneAdviceFlag; private Integer silenceFlag;
@Schema(description = "是否强制更新") @Schema(description = "是否强制更新")
@ExcelProperty("是否强制更新") @ExcelProperty("是否强制更新")
private Integer mustUpdateFlag; private Integer mustFlag;
@Schema(description = "所属部门") @Schema(description = "所属部门")
@ExcelProperty("所属部门") @ExcelProperty("所属部门")

View File

@@ -13,20 +13,13 @@ public class VersionManagementSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18365") @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18365")
private Long id; 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") @Schema(description = "客户端code", requiredMode = Schema.RequiredMode.REQUIRED, example = "20524")
@NotEmpty(message = "客户端名称不能为空") @NotEmpty(message = "客户端名称不能为空")
private String custDeviceCode; private String applicationCode;
@Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") @Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@NotEmpty(message = "客户端名称不能为空") @NotEmpty(message = "客户端名称不能为空")
private String custDeviceName; private String applicationName;
@Schema(description = "更新标题") @Schema(description = "更新标题")
private String updateTitle; private String updateTitle;
@@ -57,15 +50,14 @@ public class VersionManagementSaveReqVO {
@Schema(description = "文件sha1值") @Schema(description = "文件sha1值")
private String fileEncryptAlgorithm; private String fileEncryptAlgorithm;
@Schema(description = "上线发行", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "发布状态", requiredMode = Schema.RequiredMode.REQUIRED)
// @NotNull(message = "上线发行不能为空") private String publishFlag;
private Integer issuanceFlag;
@Schema(description = "是否静默更新") @Schema(description = "是否静默更新")
private Integer noneAdviceFlag; private Integer silenceFlag;
@Schema(description = "是否强制更新") @Schema(description = "是否强制更新")
private Integer mustUpdateFlag; private Integer mustFlag;
@Schema(description = "所属部门") @Schema(description = "所属部门")
private String systemDepartmentCode; private String systemDepartmentCode;

View File

@@ -30,18 +30,14 @@ public class VersionManagementDO extends BusinessBaseDO {
private Long id; private Long id;
/** /**
* 客户端code * 客户端code
*
* 枚举 {@link TODO T_SYS_VER_MNGT_CUST_DEV 对应的类}
*/ */
@TableField("CUST_DEV_CD") @TableField("APPL_CD")
private String custDeviceCode; private String applicationCode;
/** /**
* 客户端名称 * 客户端名称
*
* 枚举 {@link TODO T_SYS_VER_MNGT_CUST_DEV 对应的类}
*/ */
@TableField("CUST_DEV_NAME") @TableField("APPL_NAME")
private String custDeviceName; private String applicationName;
/** /**
* 更新标题 * 更新标题
*/ */
@@ -55,14 +51,12 @@ public class VersionManagementDO extends BusinessBaseDO {
/** /**
* 更新平台 * 更新平台
* *
* 枚举 {@link TODO T_SYSVER_MNGT_UPD_PLTF 对应的类}
*/ */
@TableField("UPD_PLTF") @TableField("UPD_PLTF")
private String updatePlatform; private String updatePlatform;
/** /**
* 安装包类型 * 安装包类型
* *
* 枚举 {@link TODO T_SYSVER_MNGT_UPD_TP 对应的类}
*/ */
@TableField("UPD_TP") @TableField("UPD_TP")
private String updateType; private String updateType;
@@ -92,20 +86,20 @@ public class VersionManagementDO extends BusinessBaseDO {
@TableField("FILE_ENCR_ALG") @TableField("FILE_ENCR_ALG")
private String fileEncryptAlgorithm; private String fileEncryptAlgorithm;
/** /**
* 上线发行 * 发布状态
*/ */
@TableField("ISSC_FLG") @TableField("PUB_FLG")
private Integer issuanceFlag; private String publishFlag;
/** /**
* 是否静默更新 * 是否静默更新
*/ */
@TableField("NNE_ADV_FLG") @TableField("SLNC_FLG")
private Integer noneAdviceFlag; private Integer silenceFlag;
/** /**
* 是否强制更新 * 是否强制更新
*/ */
@TableField("MUST_UPD_FLG") @TableField("MUST_FLG")
private Integer mustUpdateFlag; private Integer mustFlag;
/** /**
* 所属部门 * 所属部门
*/ */

View File

@@ -20,12 +20,12 @@ public interface VersionManagementMapper extends BaseMapperX<VersionManagementDO
default PageResult<VersionManagementDO> selectPage(VersionManagementPageReqVO reqVO) { default PageResult<VersionManagementDO> selectPage(VersionManagementPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<VersionManagementDO>() return selectPage(reqVO, new LambdaQueryWrapperX<VersionManagementDO>()
.eqIfPresent(VersionManagementDO::getCustDeviceCode, reqVO.getCustDeviceCode()) .eqIfPresent(VersionManagementDO::getApplicationCode, reqVO.getApplicationCode())
.eqIfPresent(VersionManagementDO::getCustDeviceName, reqVO.getCustDeviceName()) .eqIfPresent(VersionManagementDO::getApplicationName, reqVO.getApplicationName())
.eqIfPresent(VersionManagementDO::getUpdateTitle, reqVO.getUpdateTitle()) .eqIfPresent(VersionManagementDO::getUpdateTitle, reqVO.getUpdateTitle())
.eqIfPresent(VersionManagementDO::getUpdateContent, reqVO.getUpdateContent()) .eqIfPresent(VersionManagementDO::getUpdateContent, reqVO.getUpdateContent())
.eqIfPresent(VersionManagementDO::getUpdatePlatform, reqVO.getUpdatePlatform()) .eqIfPresent(VersionManagementDO::getUpdatePlatform, reqVO.getUpdatePlatform())
.eqIfPresent(VersionManagementDO::getIssuanceFlag, reqVO.getIssuanceFlag()) .eqIfPresent(VersionManagementDO::getPublishFlag, reqVO.getPublishFlag())
.eqIfPresent(VersionManagementDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .eqIfPresent(VersionManagementDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfPresent(VersionManagementDO::getCreator, reqVO.getCreator()) .eqIfPresent(VersionManagementDO::getCreator, reqVO.getCreator())
.betweenIfPresent(VersionManagementDO::getCreateTime, reqVO.getCreateTime()) .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>() return selectPage(reqVO, new LambdaQueryWrapperX<VersionManagementDO>()
.eqIfPresent(VersionManagementDO::getUpdatePlatform, reqVO.getUpdatePlatform()) .eqIfPresent(VersionManagementDO::getUpdatePlatform, reqVO.getUpdatePlatform())
.eqIfPresent(VersionManagementDO::getUpdateType, reqVO.getUpdateType()) .eqIfPresent(VersionManagementDO::getUpdateType, reqVO.getUpdateType())
.eqIfPresent(VersionManagementDO::getCustDeviceCode, reqVO.getCustDeviceCode()) .eqIfPresent(VersionManagementDO::getApplicationCode, reqVO.getApplicationCode())
.eq(VersionManagementDO::getIssuanceFlag,1) .eq(VersionManagementDO::getPublishFlag,1)
.orderByDesc(VersionManagementDO::getCreateTime) .orderByDesc(VersionManagementDO::getCreateTime)
// .last("LIMIT 1") // .last("LIMIT 1")
); );
} }
default List<VersionManagementDO> selectBySameCustDeviceCode(Long id) { default List<VersionManagementDO> selectBySameCode(Long id) {
// 先根据id查询出目标记录的custDeviceCode // 先根据id查询出目标记录的custDeviceCode
VersionManagementDO target = selectById(id); VersionManagementDO target = selectById(id);
if (target == null) { if (target == null) {
@@ -53,8 +53,8 @@ public interface VersionManagementMapper extends BaseMapperX<VersionManagementDO
// 查询相同custDeviceCode的所有记录 // 查询相同custDeviceCode的所有记录
return selectList(new LambdaQueryWrapperX<VersionManagementDO>() return selectList(new LambdaQueryWrapperX<VersionManagementDO>()
.eq(VersionManagementDO::getCustDeviceCode, target.getCustDeviceCode()) .eq(VersionManagementDO::getApplicationCode, target.getApplicationCode())
.eq(VersionManagementDO::getIssuanceFlag, 1) .eq(VersionManagementDO::getPublishFlag, 1)
.orderByDesc(VersionManagementDO::getCreateTime)); .orderByDesc(VersionManagementDO::getCreateTime));
} }
} }

View File

@@ -37,7 +37,7 @@ public class versionManagementServiceImpl implements VersionManagementService {
@Override @Override
public VersionManagementRespVO createSystemVersionManagement(VersionManagementSaveReqVO createReqVO) { public VersionManagementRespVO createSystemVersionManagement(VersionManagementSaveReqVO createReqVO) {
//多条数据取第一条 //多条数据取第一条
if (createReqVO.getFiles().size() > 0) { if (createReqVO.getFiles() != null && createReqVO.getFiles().size() > 0) {
uploadFileVo uploadFileVo = createReqVO.getFiles().get(0); uploadFileVo uploadFileVo = createReqVO.getFiles().get(0);
createReqVO.setDownloadUrl(uploadFileVo.getUrl()); createReqVO.setDownloadUrl(uploadFileVo.getUrl());
createReqVO.setFileMd5(uploadFileVo.getMd5()); createReqVO.setFileMd5(uploadFileVo.getMd5());
@@ -62,7 +62,7 @@ public class versionManagementServiceImpl implements VersionManagementService {
validateSystemVersionManagementExists(updateReqVO.getId()); validateSystemVersionManagementExists(updateReqVO.getId());
//多条数据取第一条 //多条数据取第一条
if (updateReqVO.getFiles().size() > 0) { if (updateReqVO.getFiles() != null && updateReqVO.getFiles().size() > 0) {
uploadFileVo uploadFileVo = updateReqVO.getFiles().get(0); uploadFileVo uploadFileVo = updateReqVO.getFiles().get(0);
updateReqVO.setDownloadUrl(uploadFileVo.getUrl()); updateReqVO.setDownloadUrl(uploadFileVo.getUrl());
updateReqVO.setFileMd5(uploadFileVo.getMd5()); updateReqVO.setFileMd5(uploadFileVo.getMd5());
@@ -121,7 +121,7 @@ public class versionManagementServiceImpl implements VersionManagementService {
public PageResult<VersionManagementDO> getLts(VersionManagementPageReqVO pageReqVO) { public PageResult<VersionManagementDO> getLts(VersionManagementPageReqVO pageReqVO) {
return systemVersionManagementMapper.selectLts(pageReqVO); return systemVersionManagementMapper.selectList(pageReqVO);
} }
@Override @Override
@@ -130,21 +130,21 @@ public class versionManagementServiceImpl implements VersionManagementService {
validateSystemVersionManagementExists(id); validateSystemVersionManagementExists(id);
// 下线当前发布的版本 // 下线当前发布的版本
List<VersionManagementDO> versionManagementDOS = systemVersionManagementMapper.selectBySameCustDeviceCode(id); List<VersionManagementDO> versionManagementDOS = systemVersionManagementMapper.selectBySameCode(id);
if (versionManagementDOS.size() > 0) { if (versionManagementDOS.size() > 0) {
VersionManagementDO versionManagementDO = versionManagementDOS.get(0); VersionManagementDO versionManagementDO = versionManagementDOS.get(0);
VersionManagementDO offlineVO = new VersionManagementDO(); VersionManagementDO offlineVO = new VersionManagementDO();
offlineVO.setId(versionManagementDO.getId()); offlineVO.setId(versionManagementDO.getId());
offlineVO.setIssuanceFlag(2); // offlineVO.setPublishFlag(2);
systemVersionManagementMapper.updateById(offlineVO); systemVersionManagementMapper.updateById(offlineVO);
} }
VersionManagementDO onlineVO = new VersionManagementDO(); VersionManagementDO onlineVO = new VersionManagementDO();
onlineVO.setId(id); onlineVO.setId(id);
onlineVO.setIssuanceFlag(1); // onlineVO.setPublishFlag(1);
systemVersionManagementMapper.updateById(onlineVO); systemVersionManagementMapper.updateById(onlineVO);
} }
} }