diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java index d2f4d80..85cdf95 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java @@ -134,7 +134,16 @@ public class MallProductController extends BaseController { modelService.removeById(modelVersion.getId()); return AjaxResult.success(); } + /** + * 查询模型详情 + * @param id + * @return + */ + @GetMapping("/selectModelById") + public AjaxResult selectModelById(@RequestParam Long id){ + return modelService.selectModelById(id); + } /** * 我的发布-模型 diff --git a/mcwl-resource/pom.xml b/mcwl-resource/pom.xml index 6fd7aac..c5b6b86 100644 --- a/mcwl-resource/pom.xml +++ b/mcwl-resource/pom.xml @@ -40,7 +40,7 @@ com.mcwl - mcwl-admin + mcwl-system 3.8.8 diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/domain/ModelProduct.java b/mcwl-resource/src/main/java/com/mcwl/resource/domain/ModelProduct.java index dc2875e..f84f3f2 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/domain/ModelProduct.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/domain/ModelProduct.java @@ -108,14 +108,9 @@ public class ModelProduct extends BaseEntity { */ private String delFlag; - /** - * 翻译后主体 - */ - @TableField(exist = false) - private List themeList; /** - * 翻译后风格 + * 翻译后标签 */ @TableField(exist = false) private List styleList; diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/ModelService.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/ModelService.java index 2b39c16..c4e004d 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/ModelService.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/ModelService.java @@ -34,4 +34,6 @@ public interface ModelService extends IService { void updaModel(RequestModel requestModel); + AjaxResult selectModelById(Long id); + } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/WorkFlowService.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/WorkFlowService.java index 2fff370..b8f762f 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/WorkFlowService.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/WorkFlowService.java @@ -27,4 +27,6 @@ public interface WorkFlowService extends IService { AjaxResult selectWorkFlowById(Long id); TableDataInfo listByPage(ModelImagePageRes imagePageRes); + + } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelServiceImpl.java index d9f73d1..691cd91 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelServiceImpl.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mcwl.common.constant.DictConstants; import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.entity.SysUser; @@ -15,16 +16,15 @@ import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.StringUtils; import com.mcwl.resource.domain.ModelProduct; import com.mcwl.resource.domain.ModelVersion; -import com.mcwl.resource.domain.WorkFlow; import com.mcwl.resource.domain.dto.ModelImagePageRes; import com.mcwl.resource.domain.request.RequestModel; import com.mcwl.resource.domain.vo.MallProductVo; -import com.mcwl.resource.domain.vo.ModelImageVo; import com.mcwl.resource.domain.vo.ModelVo; import com.mcwl.resource.mapper.ModelMapper; - import com.mcwl.resource.mapper.ModelVersionMapper; import com.mcwl.resource.service.ModelService; +import com.mcwl.resource.service.ToActivityService; +import com.mcwl.system.init.DictInit; import com.mcwl.system.service.ISysUserService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; @@ -50,6 +50,8 @@ public class ModelServiceImpl extends ServiceImpl impl @Autowired private RedisCache redisCache; + @Autowired + private ToActivityService toActivityService; @Autowired private ModelVersionMapper modelVersionMapper; @Autowired @@ -151,7 +153,7 @@ public class ModelServiceImpl extends ServiceImpl impl String filePath = requestModel.getModelVersionList().get(0).getFilePath(); String[] split = filePath.split(","); ModelProduct modelProduct = requestModel.getModelProduct(); - modelProduct.setCategory(split[0]); + modelProduct.setSurfaceUrl(split[0]); modelProduct.setCreateTime(new Date()); @@ -197,4 +199,41 @@ public class ModelServiceImpl extends ServiceImpl impl } + @Override + public AjaxResult selectModelById(Long id) { + //查询详情 + ModelProduct modelProduct = postMapper.selectById(id); + + //翻译属性 垂类 + if (StringUtils.isNotEmpty(modelProduct.getCategory())){ + modelProduct.setCategory(DictInit.getDictValue(DictConstants.MODEL_CHILD_CATEGORY,modelProduct.getCategory())); + } + + + //标签 + if (StringUtils.isNotEmpty(modelProduct.getTags())){ + ArrayList strings = new ArrayList<>(); + String[] split = modelProduct.getTags().split(","); + for (String s : split) { + if (s != ""){ + strings.add(s); + } + } + modelProduct.setStyleList(strings); + } + + //功能 + if (StringUtils.isNotEmpty(modelProduct.getFunctions())){ + modelProduct.setCategory(DictInit.getDictValue(DictConstants.WORK_FLOW_FUNCTIONS,modelProduct.getFunctions())); + } + + //活动 + if (StringUtils.isNotEmpty(modelProduct.getActivityId())){ + modelProduct.setActivityId(toActivityService.getById(modelProduct.getActivityId()).getActivityName()); + } + + return AjaxResult.success(modelProduct); + } + + } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java index e866908..d15e5fd 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java @@ -13,20 +13,18 @@ import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.entity.SysUser; import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.utils.StringUtils; -import com.mcwl.resource.domain.ModelProduct; import com.mcwl.resource.domain.WorkFlow; import com.mcwl.resource.domain.WorkFlowVersion; import com.mcwl.resource.domain.dto.ModelImagePageRes; import com.mcwl.resource.domain.request.RequestWorkFlow; -import com.mcwl.resource.domain.vo.ModelVo; import com.mcwl.resource.domain.vo.PageVo; import com.mcwl.resource.domain.vo.WorkFlowVo; import com.mcwl.resource.mapper.WorkFlowMapper; import com.mcwl.resource.mapper.WorkFlowVersionMapper; import com.mcwl.resource.service.ToActivityService; import com.mcwl.resource.service.WorkFlowService; +import com.mcwl.system.init.DictInit; import com.mcwl.system.service.ISysUserService; -import com.mcwl.web.controller.init.DictInit; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -236,4 +234,6 @@ public class WorkFlowServiceImpl extends ServiceImpl i return rspData; } + + } diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/init/DictInit.java b/mcwl-system/src/main/java/com/mcwl/system/init/DictInit.java similarity index 98% rename from mcwl-admin/src/main/java/com/mcwl/web/controller/init/DictInit.java rename to mcwl-system/src/main/java/com/mcwl/system/init/DictInit.java index d70e223..921a836 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/init/DictInit.java +++ b/mcwl-system/src/main/java/com/mcwl/system/init/DictInit.java @@ -1,4 +1,4 @@ -package com.mcwl.web.controller.init; +package com.mcwl.system.init; import com.mcwl.common.core.domain.entity.SysDictData; import com.mcwl.system.mapper.SysDictDataMapper;