diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/VersionManagementConst.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/VersionManagementConst.java new file mode 100644 index 0000000..87b3467 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/VersionManagementConst.java @@ -0,0 +1,8 @@ +package com.zt.plat.module.qms.resource.clientManage; + +public class VersionManagementConst { + + public static final String UPDATE_TYPE_WAITING = "0"; //未发布 + public static final String PUBLISH_FLAG_PUBLISH = "1"; //已发布 + public static final String PUBLISH_FLAG_OFFLINE = "2"; //下线 +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java index 0d63895..010dc76 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java @@ -56,14 +56,14 @@ public class VersionManagementController extends AbstractFileUploadController im @Operation(summary = "创建客户端版本管理") @PreAuthorize("@ss.hasPermission('qms:version-management:create')") public CommonResult createSystemVersionManagement(@Valid @RequestBody VersionManagementSaveReqVO createReqVO) { - return success(systemVersionManagementService.createSystemVersionManagement(createReqVO)); + return success(systemVersionManagementService.createVersionManagement(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新客户端版本管理") @PreAuthorize("@ss.hasPermission('qms:version-management:update')") public CommonResult updateSystemVersionManagement(@Valid @RequestBody VersionManagementSaveReqVO updateReqVO) { - systemVersionManagementService.updateSystemVersionManagement(updateReqVO); + systemVersionManagementService.updateVersionManagement(updateReqVO); return success(true); } @@ -72,7 +72,7 @@ public class VersionManagementController extends AbstractFileUploadController im @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('qms:version-management:delete')") public CommonResult deleteSystemVersionManagement(@RequestParam("id") Long id) { - systemVersionManagementService.deleteSystemVersionManagement(id); + systemVersionManagementService.deleteVersionManagement(id); return success(true); } @@ -90,7 +90,7 @@ public class VersionManagementController extends AbstractFileUploadController im @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('qms:version-management:query')") public CommonResult getSystemVersionManagement(@RequestParam("id") Long id) { - VersionManagementDO systemVersionManagement = systemVersionManagementService.getSystemVersionManagement(id); + VersionManagementDO systemVersionManagement = systemVersionManagementService.getVersionManagement(id); return success(BeanUtils.toBean(systemVersionManagement, VersionManagementRespVO.class)); } @@ -98,7 +98,7 @@ public class VersionManagementController extends AbstractFileUploadController im @Operation(summary = "获得客户端版本管理分页") @PreAuthorize("@ss.hasPermission('qms:version-management:query')") public CommonResult> getSystemVersionManagementPage(@Valid VersionManagementPageReqVO pageReqVO) { - PageResult pageResult = systemVersionManagementService.getSystemVersionManagementPage(pageReqVO); + PageResult pageResult = systemVersionManagementService.getVersionManagementPage(pageReqVO); return success(BeanUtils.toBean(pageResult, VersionManagementRespVO.class)); } @@ -109,7 +109,7 @@ public class VersionManagementController extends AbstractFileUploadController im public void exportSystemVersionManagementExcel(@Valid VersionManagementPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = systemVersionManagementService.getSystemVersionManagementPage(pageReqVO).getList(); + List list = systemVersionManagementService.getVersionManagementPage(pageReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "客户端版本管理.xls", "数据", VersionManagementRespVO.class, BeanUtils.toBean(list, VersionManagementRespVO.class)); @@ -118,7 +118,7 @@ public class VersionManagementController extends AbstractFileUploadController im @GetMapping("/checkUpdate") @Operation(summary = "根据更新平台和安装包类型获取最新客户端版本管理信息") - public CommonResult> checkUpdate(@Valid VersionManagementPageReqVO pageReqVO) { + public CommonResult checkUpdate(@Valid VersionManagementPageReqVO pageReqVO) { if (pageReqVO.getApplicationCode() == null ) { return CommonResult.error(400, "客户端编号不能为空"); @@ -126,13 +126,17 @@ public class VersionManagementController extends AbstractFileUploadController im if (pageReqVO.getUpdatePlatform() == null ) { return CommonResult.error(400, "更新平台不能为空"); } - PageResult pageResult = systemVersionManagementService.getLts(pageReqVO); - return success(BeanUtils.toBean(pageResult, VersionManagementRespVO.class)); + PageResult pageResult = systemVersionManagementService.getList(pageReqVO); + if (pageResult.getList().size() == 0) { + return CommonResult.error(400, "没有可更新版本"); + } + VersionManagementDO versionManagementDO = pageResult.getList().get(0); + return success(BeanUtils.toBean(versionManagementDO, VersionManagementRespVO.class)); } - @GetMapping("/publish") - CommonResult publish(@RequestParam("id") Long id) { - systemVersionManagementService.publish(id); - return success(true); + @GetMapping("/executePublish") + CommonResult executePublish(@RequestParam("id") Long id) { + systemVersionManagementService.executePublish(id); + return success("发布成功"); } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/uploadFileVo.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/UploadFileVo.java similarity index 92% rename from zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/uploadFileVo.java rename to zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/UploadFileVo.java index 751a45e..99e41d9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/uploadFileVo.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/UploadFileVo.java @@ -5,7 +5,7 @@ import lombok.Data; @Schema(description = "附件实例") @Data -public class uploadFileVo { +public class UploadFileVo { private String id; private String url; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementSaveReqVO.java index 2e4c4f6..817c9b3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementSaveReqVO.java @@ -65,11 +65,10 @@ public class VersionManagementSaveReqVO { @Schema(description = "备注") private String remark; - - @Schema(description = "上传文件列表") - private List files; - @Schema(description = "上传文件Uid") private String downloadId; + //==========扩展属性=============== + @Schema(description = "上传文件列表") + private List files; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/dataobject/VersionManagementDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/dataobject/VersionManagementDO.java index d7cbb4a..6435531 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/dataobject/VersionManagementDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/dataobject/VersionManagementDO.java @@ -111,9 +111,6 @@ public class VersionManagementDO extends BusinessBaseDO { @TableField("RMK") private String remark; - @TableField("CREATOR") - private String creator; - @TableField("DL_ID") private String downloadId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/mapper/VersionManagementMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/mapper/VersionManagementMapper.java index 2f1daf6..8892e36 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/mapper/VersionManagementMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/mapper/VersionManagementMapper.java @@ -43,18 +43,4 @@ public interface VersionManagementMapper extends BaseMapperX selectBySameCode(Long id) { - // 先根据id查询出目标记录的custDeviceCode - VersionManagementDO target = selectById(id); - if (target == null) { - return Collections.emptyList(); - } - - // 查询相同custDeviceCode的所有记录 - return selectList(new LambdaQueryWrapperX() - .eq(VersionManagementDO::getApplicationCode, target.getApplicationCode()) - .eq(VersionManagementDO::getPublishFlag, 1) - .orderByDesc(VersionManagementDO::getCreateTime)); - } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementService.java index d422dba..7d2cf11 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementService.java @@ -22,21 +22,21 @@ public interface VersionManagementService { * @param createReqVO 创建信息 * @return 编号 */ - VersionManagementRespVO createSystemVersionManagement(@Valid VersionManagementSaveReqVO createReqVO); + VersionManagementRespVO createVersionManagement(@Valid VersionManagementSaveReqVO createReqVO); /** * 更新客户端版本管理 * * @param updateReqVO 更新信息 */ - void updateSystemVersionManagement(@Valid VersionManagementSaveReqVO updateReqVO); + void updateVersionManagement(@Valid VersionManagementSaveReqVO updateReqVO); /** * 删除客户端版本管理 * * @param id 编号 */ - void deleteSystemVersionManagement(Long id); + void deleteVersionManagement(Long id); /** * 批量删除客户端版本管理 @@ -51,7 +51,7 @@ public interface VersionManagementService { * @param id 编号 * @return 客户端版本管理 */ - VersionManagementDO getSystemVersionManagement(Long id); + VersionManagementDO getVersionManagement(Long id); /** * 获得客户端版本管理分页 @@ -59,7 +59,7 @@ public interface VersionManagementService { * @param pageReqVO 分页查询 * @return 客户端版本管理分页 */ - PageResult getSystemVersionManagementPage(VersionManagementPageReqVO pageReqVO); + PageResult getVersionManagementPage(VersionManagementPageReqVO pageReqVO); /** @@ -68,11 +68,11 @@ public interface VersionManagementService { * @param pageReqVO 分页查询 * @return 客户端版本管理分页 */ - PageResult getLts(VersionManagementPageReqVO pageReqVO); + PageResult getList(VersionManagementPageReqVO pageReqVO); /** * 版本发布 * @param id */ - void publish (Long id); + void executePublish(Long id); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementServiceImpl.java new file mode 100644 index 0000000..99a28bc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementServiceImpl.java @@ -0,0 +1,151 @@ +package com.zt.plat.module.qms.resource.clientManage.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.resource.clientManage.VersionManagementConst; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementPageReqVO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementRespVO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementSaveReqVO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.UploadFileVo; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.resource.clientManage.dal.dataobject.VersionManagementDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.clientManage.dal.mapper.VersionManagementMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 客户端版本管理 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class VersionManagementServiceImpl implements VersionManagementService { + + @Resource + private VersionManagementMapper versionManagementMapper; + + @Override + public VersionManagementRespVO createVersionManagement(VersionManagementSaveReqVO createReqVO) { + //多条数据取第一条 + + // 插入 + VersionManagementDO versionManagement = BeanUtils.toBean(createReqVO, VersionManagementDO.class); + // LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();//获取当前登录人通用方法 +// systemVersionManagement.setCreator(String.valueOf(SecurityFrameworkUtils.getLoginUser().getId())); + handleFileParam(createReqVO); + versionManagementMapper.insert(versionManagement); + // 返回 + return BeanUtils.toBean(versionManagement, VersionManagementRespVO.class); + } + + @Override + public void updateVersionManagement(VersionManagementSaveReqVO updateReqVO) { + // 校验存在 + validateVersionManagementExists(updateReqVO.getId()); + handleFileParam(updateReqVO); + // 更新 + VersionManagementDO updateObj = BeanUtils.toBean(updateReqVO, VersionManagementDO.class); +// updateObj.setUpdater(String.valueOf(SecurityFrameworkUtils.getLoginUser().getId())); + versionManagementMapper.updateById(updateObj); + } + + //处理附件参数 + private void handleFileParam(VersionManagementSaveReqVO reqVO){ + List files = reqVO.getFiles(); + if (files == null || files.isEmpty()) + return; + UploadFileVo uploadFileVo = files.get(0); + reqVO.setDownloadUrl(uploadFileVo.getUrl()); + reqVO.setFileMd5(uploadFileVo.getMd5()); + reqVO.setFileEncryptAlgorithm(uploadFileVo.getSha1()); + reqVO.setDownloadId(uploadFileVo.getId()); + } + + @Override + public void deleteVersionManagement(Long id) { + // 校验存在 + validateVersionManagementExists(id); + // 删除 + versionManagementMapper.deleteById(id); + } + + @Override + public void deleteSystemVersionManagementListByIds(List ids) { + // 校验存在 + validateVersionManagementExists(ids); + // 删除 + versionManagementMapper.deleteByIds(ids); + } + + private void validateVersionManagementExists(List ids) { + List list = versionManagementMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS); + } + } + + private void validateVersionManagementExists(Long id) { + if (versionManagementMapper.selectById(id) == null) { + throw exception(SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS); + } + } + + @Override + public VersionManagementDO getVersionManagement(Long id) { + return versionManagementMapper.selectById(id); + } + + @Override + public PageResult getVersionManagementPage(VersionManagementPageReqVO pageReqVO) { + return versionManagementMapper.selectPage(pageReqVO); + } + + @Override + public PageResult getList(VersionManagementPageReqVO pageReqVO) { + + + return versionManagementMapper.selectList(pageReqVO); + } + + + /* + * 发布*/ + @Override + @Transactional(rollbackFor = Exception.class) + public void executePublish(Long id) { + // 校验存在 + validateVersionManagementExists(id); + // 下线当前发布的版本 + VersionManagementDO entity = versionManagementMapper.selectById(id); + if(ObjectUtils.isEmpty( entity.getDownloadUrl()) || ObjectUtils.isEmpty( entity.getDownloadId())) + throw exception0(SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS.getCode(), "请上传附件后再发布!"); + String code = entity.getApplicationCode(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(VersionManagementDO::getApplicationCode, code); + queryWrapper.eq(VersionManagementDO::getPublishFlag, VersionManagementConst.PUBLISH_FLAG_PUBLISH); + queryWrapper.ne(VersionManagementDO::getId, id); + List list = versionManagementMapper.selectList(queryWrapper); + if(!list.isEmpty()){ + for(VersionManagementDO versionManagementDO : list){ + versionManagementDO.setPublishFlag(VersionManagementConst.PUBLISH_FLAG_OFFLINE); + } + versionManagementMapper.updateBatch(list); + } + entity.setPublishFlag(VersionManagementConst.PUBLISH_FLAG_PUBLISH); + versionManagementMapper.updateById(entity); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/versionManagementServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/versionManagementServiceImpl.java deleted file mode 100644 index 346e048..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/versionManagementServiceImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.zt.plat.module.qms.resource.clientManage.service; - -import cn.hutool.core.collection.CollUtil; -import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; -import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementPageReqVO; -import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementRespVO; -import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementSaveReqVO; -import com.zt.plat.module.qms.resource.clientManage.controller.vo.uploadFileVo; -import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; - -import java.util.*; - -import com.zt.plat.module.qms.resource.clientManage.dal.dataobject.VersionManagementDO; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.util.object.BeanUtils; - -import com.zt.plat.module.qms.resource.clientManage.dal.mapper.VersionManagementMapper; - -import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; -import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; - -/** - * 客户端版本管理 Service 实现类 - * - * @author 后台管理 - */ -@Service -@Validated -public class versionManagementServiceImpl implements VersionManagementService { - - @Resource - private VersionManagementMapper systemVersionManagementMapper; - - @Override - public VersionManagementRespVO createSystemVersionManagement(VersionManagementSaveReqVO createReqVO) { - //多条数据取第一条 - if (createReqVO.getFiles() != null && createReqVO.getFiles().size() > 0) { - uploadFileVo uploadFileVo = createReqVO.getFiles().get(0); - createReqVO.setDownloadUrl(uploadFileVo.getUrl()); - createReqVO.setFileMd5(uploadFileVo.getMd5()); - createReqVO.setFileEncryptAlgorithm(uploadFileVo.getSha1()); - createReqVO.setDownloadId(uploadFileVo.getId()); - } - - // 插入 - VersionManagementDO systemVersionManagement = BeanUtils.toBean(createReqVO, VersionManagementDO.class); - - // LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();//获取当前登录人通用方法 - systemVersionManagement.setCreator(String.valueOf(SecurityFrameworkUtils.getLoginUser().getId())); - - systemVersionManagementMapper.insert(systemVersionManagement); - // 返回 - return BeanUtils.toBean(systemVersionManagement, VersionManagementRespVO.class); - } - - @Override - public void updateSystemVersionManagement(VersionManagementSaveReqVO updateReqVO) { - // 校验存在 - validateSystemVersionManagementExists(updateReqVO.getId()); - - //多条数据取第一条 - if (updateReqVO.getFiles() != null && updateReqVO.getFiles().size() > 0) { - uploadFileVo uploadFileVo = updateReqVO.getFiles().get(0); - updateReqVO.setDownloadUrl(uploadFileVo.getUrl()); - updateReqVO.setFileMd5(uploadFileVo.getMd5()); - updateReqVO.setFileEncryptAlgorithm(uploadFileVo.getSha1()); - updateReqVO.setDownloadId(uploadFileVo.getId()); - } - - // 更新 - VersionManagementDO updateObj = BeanUtils.toBean(updateReqVO, VersionManagementDO.class); - - updateObj.setUpdater(String.valueOf(SecurityFrameworkUtils.getLoginUser().getId())); - - systemVersionManagementMapper.updateById(updateObj); - } - - @Override - public void deleteSystemVersionManagement(Long id) { - // 校验存在 - validateSystemVersionManagementExists(id); - // 删除 - systemVersionManagementMapper.deleteById(id); - } - - @Override - public void deleteSystemVersionManagementListByIds(List ids) { - // 校验存在 - validateSystemVersionManagementExists(ids); - // 删除 - systemVersionManagementMapper.deleteByIds(ids); - } - - private void validateSystemVersionManagementExists(List ids) { - List list = systemVersionManagementMapper.selectByIds(ids); - if (CollUtil.isEmpty(list) || list.size() != ids.size()) { - throw exception(SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS); - } - } - - private void validateSystemVersionManagementExists(Long id) { - if (systemVersionManagementMapper.selectById(id) == null) { - throw exception(SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS); - } - } - - @Override - public VersionManagementDO getSystemVersionManagement(Long id) { - return systemVersionManagementMapper.selectById(id); - } - - @Override - public PageResult getSystemVersionManagementPage(VersionManagementPageReqVO pageReqVO) { - return systemVersionManagementMapper.selectPage(pageReqVO); - } - - @Override - public PageResult getLts(VersionManagementPageReqVO pageReqVO) { - - - return systemVersionManagementMapper.selectList(pageReqVO); - } - - @Override - public void publish(Long id) { - // 校验存在 - validateSystemVersionManagementExists(id); - - // 下线当前发布的版本 - List versionManagementDOS = systemVersionManagementMapper.selectBySameCode(id); - - if (versionManagementDOS.size() > 0) { - - VersionManagementDO versionManagementDO = versionManagementDOS.get(0); - VersionManagementDO offlineVO = new VersionManagementDO(); - offlineVO.setId(versionManagementDO.getId()); -// offlineVO.setPublishFlag(2); - systemVersionManagementMapper.updateById(offlineVO); - } - - - VersionManagementDO onlineVO = new VersionManagementDO(); - onlineVO.setId(id); -// onlineVO.setPublishFlag(1); - systemVersionManagementMapper.updateById(onlineVO); - } -} \ No newline at end of file