|
@@ -16,10 +16,7 @@ import com.sckw.system.model.vo.res.FindVersionListResVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
-import java.util.Collections;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -64,4 +61,38 @@ public class SysVersionService {
|
|
|
|
|
|
|
|
return PageHelperUtil.getPageResult(new PageInfo<>(findVersionListResVos), list, reqVo.getPageSize());
|
|
return PageHelperUtil.getPageResult(new PageInfo<>(findVersionListResVos), list, reqVo.getPageSize());
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param clientType 客户端类型
|
|
|
|
|
+ * @return HttpResult
|
|
|
|
|
+ * @desc: 查最新的版本信息
|
|
|
|
|
+ * @author: czh
|
|
|
|
|
+ * @date: 2023/10/10
|
|
|
|
|
+ */
|
|
|
|
|
+ public FindVersionListResVo findLatestVersion(Integer systemType, String clientType) {
|
|
|
|
|
+ SysVersion sysVersion = sysVersionDao.findLatestVersion(systemType, clientType);
|
|
|
|
|
+ if (Objects.isNull(sysVersion)) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ FindVersionListResVo findVersionListResVo = new FindVersionListResVo();
|
|
|
|
|
+ BeanUtils.copyProperties(sysVersion, findVersionListResVo);
|
|
|
|
|
+ List<Long> userIdList = new ArrayList<>();
|
|
|
|
|
+ userIdList.add(sysVersion.getCreateBy());
|
|
|
|
|
+ userIdList.add(sysVersion.getUpdateBy());
|
|
|
|
|
+ Map<Long, UserCacheResDto> longUserCacheResDtoMap = remoteSystemService.queryUserCacheMapByIds(userIdList);
|
|
|
|
|
+ UserCacheResDto userCacheResDto = longUserCacheResDtoMap.get(sysVersion.getCreateBy());
|
|
|
|
|
+ if (Objects.nonNull(userCacheResDto)) {
|
|
|
|
|
+ findVersionListResVo.setCreateByName(userCacheResDto.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ UserCacheResDto userCacheResDto2 = longUserCacheResDtoMap.get(sysVersion.getUpdateBy());
|
|
|
|
|
+ if (Objects.nonNull(userCacheResDto2)) {
|
|
|
|
|
+ findVersionListResVo.setUpdateByName(userCacheResDto2.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ findVersionListResVo.setFilePath(FileUtils.splice(findVersionListResVo.getFilePath()));
|
|
|
|
|
+ return findVersionListResVo;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|