feat(resource): 新增模型产品和工作流相关功能

feature/my-invitation
ChenYan 2025-01-14 18:11:39 +08:00
parent 52ca9b3295
commit 421ca7dc9d
6 changed files with 58 additions and 16 deletions

View File

@ -2,11 +2,8 @@
* 后端采用Spring Boot、Spring Security、Redis & Jwt。
* 权限认证使用Jwt支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* 高效率开发,使用代码生成器可以一键生成前后端代码。
* 提供了技术栈([Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev))版本[McWl-Vue3](https://gitcode.com/yangzongzhuan/McWl-Vue3),保持同步更新。
* 提供了单应用版本[McWl-Vue-fast](https://gitcode.com/yangzongzhuan/McWl-Vue-fast)Oracle版本[McWl-Vue-Oracle](https://gitcode.com/yangzongzhuan/McWl-Vue-Oracle),保持同步更新。
* 不分离版本,请移步[McWl](https://gitee.com/y_project/McWl),微服务版本,请移步[McWl-Cloud](https://gitee.com/y_project/McWl-Cloud)
* 阿里云折扣场:[点我进入](http://aly.mcwl.vip),腾讯云秒杀场:[点我进入](http://txy.mcwl.vip)  
## 内置功能
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。

View File

@ -10,12 +10,14 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Builder;
/**
* Entity
*
* @author mcwl
*/
public class BaseEntity implements Serializable
{
private static final long serialVersionUID = 1L;

View File

@ -1,11 +1,18 @@
package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mcwl.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
/**
*
@ -19,6 +26,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@TableName("model")
public class ModelProduct extends BaseEntity {
@ -27,10 +35,6 @@ public class ModelProduct extends BaseEntity {
*/
@TableId
private Long id;
/**
* ID
*/
private Long versionId;
/**
*
*/
@ -100,5 +104,17 @@ public class ModelProduct extends BaseEntity {
*/
private String delFlag;
/**
*
*/
@TableField(exist = false)
private List<String> themeList;
/**
*
*/
@TableField(exist = false)
private List<String> styleList;
}

View File

@ -2,6 +2,7 @@ package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mcwl.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -19,13 +20,17 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data
@TableName("model_version")
public class ModelVersion {
public class ModelVersion extends BaseEntity {
/**
* ID
*/
@TableId
private Long id;
/**
*
*/
private Long modelId;
/**
*
*/

View File

@ -15,6 +15,7 @@ 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;
@ -29,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -145,6 +147,14 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
@Override
public AjaxResult addModel(RequestModel requestModel) {
//获取封面图
String filePath = requestModel.getModelVersionList().get(0).getFilePath();
String[] split = filePath.split(",");
ModelProduct modelProduct = requestModel.getModelProduct();
modelProduct.setCategory(split[0]);
modelProduct.setCreateTime(new Date());
//添加模型表数据
postMapper.insert(requestModel.getModelProduct());
@ -176,6 +186,13 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
modelVersion.setAuditSatus(3);
modelVersionMapper.updateById(modelVersion);
}
ModelProduct model = ModelProduct.builder().
id(requestModel.getModelVersionList().get(0).
getModelId()).build();
model.setUpdateTime(new Date());
postMapper.updateById(model);
}
}

View File

@ -1,6 +1,7 @@
package com.mcwl.resource.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.common.constant.DictConstants;
@ -50,8 +51,9 @@ public class WorkFlowServiceImpl implements WorkFlowService {
String[] split = filePath.split(",");
requestWorkFlow.getWorkFlow().setCoverPath(split[0]);
requestWorkFlow.getWorkFlow().setCreateTime(new Date());
WorkFlow workFlow = requestWorkFlow.getWorkFlow();
workFlow .setCoverPath(split[0]);
workFlow.setCreateTime(new Date());
//添加模型表数据
flowMapper.insert(requestWorkFlow.getWorkFlow());
@ -65,11 +67,14 @@ public class WorkFlowServiceImpl implements WorkFlowService {
@Override
public void updateWorkFlow(RequestWorkFlow requestWorkFlow) {
WorkFlow workFlows = requestWorkFlow.getWorkFlow();
//修改工作流的信息
if (requestWorkFlow.getWorkFlow().getId() != null){
if (ObjectUtils.isEmpty(workFlows)){
requestWorkFlow.getWorkFlow().setAuditStatus(3);
}
if (StringUtils.isNotNull(workFlows.getId() )){
workFlows.setAuditStatus(3);
// flowMapper.updateWorkFlow(requestWorkFlow.getWorkFlow());
flowMapper.updateById(requestWorkFlow.getWorkFlow());
}
@ -85,7 +90,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
}
WorkFlow workFlow = WorkFlow.builder().id(requestWorkFlow.getWorkFlowVersionList().get(0).getWorkFlowId())
.createTime(new Date()).build();
.updateTime(new Date()).build();
//更新时间
flowMapper.updateById(workFlow);