From 8a1f94cee97ff1e3ee8a885197c98872c7066e9b Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期四, 29 一月 2026 09:21:46 +0800
Subject: [PATCH] 功能开发
---
server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java | 48 +++++++++++++++++++++++-------------------------
1 files changed, 23 insertions(+), 25 deletions(-)
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
index 56d9001..3fa751f 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
@@ -11,7 +11,9 @@
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.CategoryMapper;
+import com.doumee.dao.business.MultifileMapper;
import com.doumee.dao.business.model.Category;
+import com.doumee.dao.business.model.Multifile;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.CategoryService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -44,6 +46,9 @@
private CategoryMapper categoryMapper;
@Autowired
+ private MultifileMapper multifileMapper;
+
+ @Autowired
private SystemDictDataBiz systemDictDataBiz;
@Override
@@ -52,7 +57,6 @@
if(Objects.isNull(category)
|| Objects.isNull(category.getType())
|| Objects.isNull(category.getName())
- || (!Constants.equalsInteger(category.getType(),Constants.ZERO)&& CollectionUtils.isEmpty(category.getDetailList()))
|| (Constants.equalsInteger(category.getType(),Constants.ONE) && (Objects.isNull(category.getIcon())||Objects.isNull(category.getIsFixed())) )
){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
@@ -63,10 +67,6 @@
category.setCreateUser(loginUserInfo.getId());
category.setUpdateTime(new Date());
category.setUpdateUser(loginUserInfo.getId());
- if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(category.getDetailList())
- && !Constants.equalsInteger(category.getType(),Constants.THREE)){
- category.setDetail(category.getDetailList().toJSONString());
- }
if(!Constants.equalsInteger(category.getType(),Constants.ONE)){
category.setIsFixed(Constants.ZERO);
}
@@ -102,7 +102,6 @@
|| Objects.isNull(category.getId())
|| Objects.isNull(category.getType())
|| Objects.isNull(category.getName())
- || (!Constants.equalsInteger(category.getType(),Constants.ZERO)&& CollectionUtils.isEmpty(category.getDetailList()))
|| (Constants.equalsInteger(category.getType(),Constants.ONE) && (Objects.isNull(category.getIcon())||Objects.isNull(category.getIsFixed())) )
){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
@@ -111,10 +110,6 @@
category.setUpdateTime(new Date());
category.setIsFixed(null);
category.setUpdateUser(loginUserInfo.getId());
- if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(category.getDetailList())
- && !Constants.equalsInteger(category.getType(),Constants.THREE)){
- category.setDetail(category.getDetailList().toJSONString());
- }
categoryMapper.updateById(category);
}
@Override
@@ -127,9 +122,6 @@
category.setUpdateTime(new Date());
category.setIsFixed(null);
category.setUpdateUser(loginUserInfo.getId());
- if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(category.getDetailList())){
- category.setDetail(category.getDetailList().toJSONString());
- }
categoryMapper.updateById(category);
}
@@ -148,9 +140,6 @@
Category category = categoryMapper.selectById(id);
if(Objects.isNull(category)){
throw new BusinessException(ResponseStatus.DATA_EMPTY);
- }
- if(StringUtils.isNotBlank(category.getDetail())){
- category.setDetailList(JSONArray.parseArray(category.getDetail()));
}
if(StringUtils.isNotBlank(category.getIcon())){
String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
@@ -229,9 +218,6 @@
+systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode();
for(Category cate : result.getRecords()){
try {
- if(StringUtils.isNotBlank(cate.getDetail())){
- cate.setDetailList(JSONArray.parseArray(cate.getDetail()));
- }
if(StringUtils.isNotBlank(cate.getIcon())){
cate.setIconFull(path + cate.getIcon());
}
@@ -256,14 +242,26 @@
.orderByAsc(Category::getSortnum)
);
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(categoryList)){
- String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
- +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode();
+ String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode();
+ String categoryFile = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.CATEGORY_FILES).getCode();
for (Category category:categoryList) {
- if(StringUtils.isNotBlank(category.getDetail())){
- category.setDetailList(JSONArray.parseArray(category.getDetail()));
- }
if(StringUtils.isNotBlank(category.getIcon())){
- category.setIconFull(path + category.getIcon());
+ category.setIconFull(path + categoryFile + category.getIcon());
+ }
+ //鍟嗕笟鍖栨帓琛屾鍥剧墖
+ if(Constants.equalsInteger(type,Constants.ONE)){
+ List<Multifile> multifileList = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda()
+ .eq(Multifile::getIsdeleted,Constants.ZERO)
+ .eq(Multifile::getObjType,Constants.ONE)
+ .eq(Multifile::getObjId,category.getId())
+ );
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){
+ String muFile = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.MEMBER_FILES).getCode();
+ multifileList.forEach(m->{
+ m.setFileurlFull(path + muFile + m.getFileurl());
+ });
+ }
+ category.setMultifileList(multifileList);
}
}
}
--
Gitblit v1.9.3