新增举报功能

新增审核举报功能
新增工作流添加审核
新增工作流修改审核
新增模型添加审核
新增模型修改审核
master
Diyu0904 2025-01-20 15:42:46 +08:00
parent a8bf9b7390
commit 4bb2498fc8
21 changed files with 521 additions and 53 deletions

View File

@ -1,11 +1,9 @@
package com.mcwl.web.controller.resource;
import cn.hutool.core.lang.Dict;
import com.mcwl.common.constant.DictConstants;
import com.mcwl.common.core.controller.BaseController;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.ModelVersion;
import com.mcwl.resource.service.ModelVersionService;
import com.mcwl.system.init.DictInit;
@ -17,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -85,7 +82,16 @@ public class ModelVersionController extends BaseController {
}
/**
*
* @param modelId
* @return
*/
@GetMapping("/selectByModelId")
public AjaxResult selectByModelId(@RequestParam Long modelId){
return modelVersionService.selectByModelId(modelId);
}
@ApiOperation(value = "模型版本列表")
@PostMapping("list")

View File

@ -0,0 +1,72 @@
package com.mcwl.web.controller.resource;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.resource.domain.Report;
import com.mcwl.resource.domain.vo.PageVo;
import com.mcwl.resource.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
*
* @author DaiZibo
* @date 2025/1/18
* @apiNote
*/
@RequestMapping("/report")
@RestController
public class ReportController {
@Autowired
private ReportService reportService;
/**
*
* @param report
* @return
*/
@PostMapping("/addReport")
public AjaxResult addReport(@RequestBody Report report){
reportService.addReport(report);
return AjaxResult.success("举报成功");
}
/**
*
* @param pageVo
* @return
*/
@PostMapping("/selectReport")
public AjaxResult selectReport(@RequestBody PageVo pageVo){
return reportService.selectReport(pageVo);
}
/**
*
* @param id
* @return
*/
@GetMapping("/deleteReport")
public AjaxResult deleteReport(@RequestParam Long id){
reportService.deleteReport(id);
return AjaxResult.success("删除成功");
}
/**
*
* @param id
* @return
*/
@GetMapping("/updateStatus")
public AjaxResult updateStatus(@RequestParam Long id){
reportService.updateStatus(id);
return AjaxResult.success("修改成功");
}
}

View File

@ -48,7 +48,7 @@ public class ToActivityController extends BaseController {
@PostMapping("finById")
public AjaxResult finById(@RequestBody ToActivity toActivity)
{
return AjaxResult.success(toActivityService.getById(toActivity));
return AjaxResult.success(toActivityService.getById(toActivity.getId()));
}

View File

@ -3,7 +3,6 @@ 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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -11,9 +10,7 @@ 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;
/**
@ -44,11 +41,6 @@ public class ModelProduct extends BaseEntity {
*/
@ApiModelProperty(value = "名称")
private String modelName;
/**
*
*/
@ApiModelProperty(value = "描述")
private String versionDescription;
/***
* id
*/
@ -113,7 +105,14 @@ public class ModelProduct extends BaseEntity {
*
*/
@ApiModelProperty(value = "审核状态")
private Integer auditSatus;
private Integer auditStatus;
/**
* 1 2
*/
@ApiModelProperty(value = "审核")
private Integer jurisdiction;
/**
*
*/

View File

@ -37,7 +37,7 @@ public class ModelVersion extends BaseEntity {
/**
*
*/
@ApiModelProperty(value = "版本名称")
@ApiModelProperty(value = "模型ID")
private Long modelId;
/**
*
@ -84,11 +84,21 @@ public class ModelVersion extends BaseEntity {
*/
@ApiModelProperty(value = "cfg")
private Integer cfg;
/**
*
*/
@ApiModelProperty(value = "是否免费")
private Integer isFree;
/**
*
*/
@ApiModelProperty(value = "是否公开")
private Integer isPublic;
/**
*
*/
@ApiModelProperty(value = "是否加密")
private String isEncrypt;
/**
* 线使
*/
@ -138,7 +148,7 @@ public class ModelVersion extends BaseEntity {
*
*/
@ApiModelProperty(value = "审核状态")
private Integer auditSatus;
private Integer auditStatus;
/**
*
*/

View File

@ -0,0 +1,73 @@
package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
* @author DaiZibo
* @date 2025/1/18
* @apiNote
*/
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("report")
public class Report {
/**
* ID
*/
private Long id;
/**
* ID
*/
private Long productId;
/**
* ID
*/
private Long userId;
/**
*
*/
private Integer reportId;
/**
* (1 2 3)
*/
private Integer type;
/**
*
*/
private String text;
/**
* 0 1
*/
private Integer status = 0;
/**
*
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createTime;
/**
* 0 2
*/
private Integer delFlag = 0;
}

View File

@ -2,7 +2,6 @@ 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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@ -22,7 +21,7 @@ import lombok.NoArgsConstructor;
@Data
@ApiModel(description = "活动")
@TableName("to_activity")
public class ToActivity extends BaseEntity {
public class ToActivity{
/**
*
*/

View File

@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
/**
* +
*
* @author DaiZibo
* @date 2025/1/13
* @apiNote
@ -23,10 +24,12 @@ public class PageVo {
@ApiModelProperty(value = "页码")
private Integer pageNumber;
@ApiModelProperty(value = "每页条数")
@ApiModelProperty(value = "每页条数")
private Integer pageSize;
@ApiModelProperty(value = "名称")
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "排序")
@ApiModelProperty(value = "排序")
private Integer order;
@ApiModelProperty(value = "条件过滤")
private Integer type;
}

View File

@ -20,6 +20,6 @@ import java.util.List;
public interface ModelVersionMapper extends BaseMapper<ModelVersion> {
void addModelVersion(@Param("modelProduct") ModelProduct modelProduct, @Param("modelVersionList") List<ModelVersion> modelVersionList);
void updateByName(ModelVersion modelVersion);
}

View File

@ -0,0 +1,15 @@
package com.mcwl.resource.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mcwl.resource.domain.Report;
import org.apache.ibatis.annotations.Mapper;
/**
* @author DaiZibo
* @date 2025/1/18
* @apiNote
*/
@Mapper
public interface ReportMapper extends BaseMapper<Report> {
}

View File

@ -17,4 +17,6 @@ import org.apache.ibatis.annotations.Param;
public interface WorkFlowLikeMapper extends BaseMapper<WorkFlowLike> {
WorkFlowLike getLike(@Param("userId") Long userId, @Param("modelId") Long modelId);
void updateStatus(WorkFlowLike workFlowLike);
}

View File

@ -1,6 +1,7 @@
package com.mcwl.resource.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.resource.domain.ModelVersion;
import java.util.List;
@ -18,4 +19,6 @@ public interface ModelVersionService extends IService<ModelVersion> {
List<ModelVersion> selectLogininforList(ModelVersion modelVersion);
AjaxResult selectByModelId(Long modelId);
}

View File

@ -0,0 +1,24 @@
package com.mcwl.resource.service;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.resource.domain.Report;
import com.mcwl.resource.domain.vo.PageVo;
/**
*
*
* @author DaiZibo
* @date 2025/1/18
* @apiNote
*/
public interface ReportService {
void addReport(Report report);
AjaxResult selectReport(PageVo pageVo);
void deleteReport(Long id);
void updateStatus(Long id);
}

View File

@ -1,6 +1,8 @@
package com.mcwl.resource.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@ -14,6 +16,7 @@ import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.common.core.redis.RedisCache;
import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.common.utils.StringUtils;
import com.mcwl.common.utils.baidu.BaiduCensor;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.ModelVersion;
import com.mcwl.resource.domain.dto.ModelImagePageRes;
@ -28,6 +31,7 @@ import com.mcwl.system.init.DictInit;
import com.mcwl.system.service.ISysUserService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -59,6 +63,9 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
@Autowired
private ISysUserService sysUserService;
@Autowired
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
@Override
public Page<ModelProduct> selectByUserId(MallProductVo mallProductVo) {
@ -73,8 +80,6 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
mallProductLambdaQueryWrapper.eq(ModelProduct::getUserId,userId);
mallProductLambdaQueryWrapper.eq(ModelProduct::getDelFlag,0);
// 开始时间和结束时间过滤
if (mallProductVo.getStartTime() != null && mallProductVo.getEndTime() != null) {
// 查询开始时间和结束时间之间的商品
@ -115,7 +120,7 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
page.addOrder(orderItem);
LambdaQueryWrapper<ModelProduct> lqw = new LambdaQueryWrapper<>();
lqw.eq(imagePageRes.getStatus() != null, ModelProduct::getAuditSatus, imagePageRes.getStatus())
lqw.eq(imagePageRes.getStatus() != null, ModelProduct::getAuditStatus, imagePageRes.getStatus())
.eq(imagePageRes.getUserId() != null, ModelProduct::getUserId, imagePageRes.getUserId())
.ge(imagePageRes.getStartTime() != null, ModelProduct::getCreateTime, imagePageRes.getStartTime())
.le(imagePageRes.getEndTime() != null, ModelProduct::getCreateTime, imagePageRes.getEndTime());
@ -165,19 +170,160 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
//批量添加版本
modelVersionMapper.addModelVersion(requestModel.getModelProduct(),requestModel.getModelVersionList());
//执行审核方法
audit(requestModel);
return AjaxResult.success("添加成功,等待审核");
}
private void audit(RequestModel requestModel) {
// 执行审核操作
threadPoolTaskExecutor.submit(() -> {
ModelProduct modelProduct = requestModel.getModelProduct();
if (modelProduct != null){
if (modelProduct.getModelName() != null){
//审核名称
String s = BaiduCensor.TextCensor(modelProduct.getModelName()+","+modelProduct.getTags());
// 解析 JSON 字符串
JSONObject jsonObject = JSONObject.parseObject(s);
// 获取 'conclusion' 字段的值
String conclusion = jsonObject.getString("conclusion");
if (conclusion.equals("不合规")) {
//更改状态,添加原因 -> 结束任务
// 获取 'data' 数组
JSONArray dataArray = jsonObject.getJSONArray("data");
// 存储所有的失败原因
List<String> failureReasons = new ArrayList<>();
// 遍历 'data' 数组中的每个元素
for (Object itemObj : dataArray) {
JSONObject item = (JSONObject) itemObj;
String msg = item.getString("msg");
failureReasons.add(msg);
}
// 使用逗号拼接所有的失败原因
String concatenatedReasons = String.join(", ", failureReasons);
modelProduct.setAuditText(concatenatedReasons);
//修改状态以及失败原因
modelProduct.setAuditStatus(4);
baseMapper.updateById(modelProduct);
log.info("模型审核未通过");
//结束任务
return;
}
//修改为合格
modelProduct.setAuditText("");
modelProduct.setAuditStatus(modelProduct.getJurisdiction());
baseMapper.updateById(modelProduct);
}
}
List<ModelVersion> modelVersionList = requestModel.getModelVersionList();
if (modelVersionList != null){
//审核版本
for (ModelVersion modelVersion : modelVersionList) {
modelVersion.setModelId(modelProduct.getId());
//版本名称
String s1 = BaiduCensor.TextCensor(modelVersion.getVersionName() + "," +
modelVersion.getVersionDescription()+","+modelVersion.getTriggerWords());
// 解析 JSON 字符串
JSONObject jsonObject1 = JSONObject.parseObject(s1);
// 获取 'conclusion' 字段的值
String conclusion1 = jsonObject1.getString("conclusion");
if (conclusion1.equals("不合规")) {
//更改版本状态->跳出循环 审核下一个版本
// 获取 'data' 数组
JSONArray dataArray1 = jsonObject1.getJSONArray("data");
// 存储所有的失败原因
List<String> failureReasons = new ArrayList<>();
// 遍历 'data' 数组中的每个元素
for (Object itemObj : dataArray1) {
JSONObject item = (JSONObject) itemObj;
String msg = item.getString("msg");
failureReasons.add(msg);
}
// 使用逗号拼接所有的失败原因
String concatenatedReasons = String.join(", ", failureReasons);
modelVersion.setAuditText(concatenatedReasons);
modelVersion.setAuditStatus(4);
//校验id是否存在 区别修改审核或者新增审核
if (modelVersion.getId() != null){
modelVersionMapper.updateById(modelVersion);
}else {
modelVersionMapper.updateByName(modelVersion);
}
log.info("版本审核未通过");
continue;
}
//审核版本图片
String[] split = modelVersion.getFilePath().split(",");
for (String path : split) {
String s2 = BaiduCensor.ImageCnesor(path);
JSONObject jsonObject2 = JSONObject.parseObject(s2);
if (jsonObject2.getString("conclusion").equals("不合规")) {
//修改状态->跳出循环 判断下一个版本
// 获取 'data' 数组
JSONArray dataArray2 = jsonObject2.getJSONArray("data");
// 存储所有的失败原因
List<String> failureReasons = new ArrayList<>();
// 遍历 'data' 数组中的每个元素
for (Object itemObj : dataArray2) {
JSONObject item = (JSONObject) itemObj;
String msg = item.getString("msg");
failureReasons.add(msg);
}
// 使用逗号拼接所有的失败原因
String concatenatedReasons = String.join(", ", failureReasons);
modelVersion.setAuditText(concatenatedReasons);
modelVersion.setAuditStatus(4);
//校验id是否存在 区别修改审核或者新增审核
if (modelVersion.getId() != null){
modelVersionMapper.updateById(modelVersion);
}else {
modelVersionMapper.updateByName(modelVersion);
}
modelVersionMapper.updateByName(modelVersion);
log.info("图片审核未通过");
break;
}
}
//修改版本成功审核状态
modelProduct.setAuditText("");
modelVersion.setAuditStatus(1);
modelVersionMapper.updateByName(modelVersion);
log.info("全部通过审核");
}
}
});
}
@Override
public void updaModel(RequestModel requestModel) {
//修改模版的信息
ModelProduct modelProduct = requestModel.getModelProduct();
if (ObjectUtils.isEmpty(modelProduct)){
if (ObjectUtils.isNotEmpty(modelProduct)){
}
if (StringUtils.isNotNull(modelProduct.getId())){
modelProduct.setAuditSatus(3);
postMapper.updateModel(requestModel.getModelProduct());
modelProduct.setAuditStatus(3);
modelProduct.setUpdateTime(new Date());
postMapper.updateById(requestModel.getModelProduct());
}
}
//修改工作流版本的信息
@ -185,7 +331,7 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
//批量修改
for (ModelVersion modelVersion : requestModel.getModelVersionList()) {
modelVersion.setAuditSatus(3);
modelVersion.setAuditStatus(3);
modelVersionMapper.updateById(modelVersion);
}
@ -194,9 +340,11 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
getModelId()).build();
model.setUpdateTime(new Date());
postMapper.updateById(model);
}
//审核
audit(requestModel);
}
@Override

View File

@ -2,13 +2,17 @@ package com.mcwl.resource.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.constant.DictConstants;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.utils.StringUtils;
import com.mcwl.resource.domain.ModelVersion;
import com.mcwl.resource.mapper.ModelVersionMapper;
import com.mcwl.resource.service.ModelVersionService;
import com.mcwl.system.init.DictInit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@ -49,15 +53,30 @@ public class ModelVersionServiceImpl extends ServiceImpl< ModelVersionMapper,Mo
return modelVersionMapper.selectList(queryWrapper);
}
@Override
public AjaxResult selectByModelId(Long modelId) {
//根据模型ID查询所有的版本信息
LambdaQueryWrapper<ModelVersion> modelVersionLambdaQueryWrapper = new LambdaQueryWrapper<>();
modelVersionLambdaQueryWrapper.eq(ModelVersion::getModelId,modelId);
modelVersionLambdaQueryWrapper.eq(ModelVersion::getDelFlag,0);
List<ModelVersion> modelVersions = modelVersionMapper.selectList(modelVersionLambdaQueryWrapper);
for (ModelVersion modelVersion : modelVersions) {
ArrayList<String> arrayList = new ArrayList<>();
//获取
String[] split = modelVersion.getHigh().split(",");
for (String s : split) {
arrayList.add(DictInit.getDictValue(DictConstants.DICT_TYPE_MODEL_VERSION_HIGH,s));
}
modelVersion.setHighList(arrayList);
}
return AjaxResult.success(modelVersions);
}
}

View File

@ -0,0 +1,72 @@
package com.mcwl.resource.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.resource.domain.Report;
import com.mcwl.resource.domain.vo.PageVo;
import com.mcwl.resource.mapper.ReportMapper;
import com.mcwl.resource.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
*
*
* @author DaiZibo
* @date 2025/1/18
* @apiNote
*/
@Service
public class ReportServiceImpl implements ReportService {
@Autowired
private ReportMapper reportMapper;
@Override
public void addReport(Report report) {
report.setCreateTime(new Date());
report.setUserId(SecurityUtils.getUserId());
reportMapper.insert(report);
}
@Override
public AjaxResult selectReport(PageVo pageVo) {
Page<Report> page = new Page<>(pageVo.getPageNumber(), pageVo.getPageSize());
//构造查询条件
LambdaQueryWrapper<Report> reportLambdaQueryWrapper = new LambdaQueryWrapper<>();
reportLambdaQueryWrapper.eq(Report::getDelFlag, 0);
if (pageVo.getType() != null) {
reportLambdaQueryWrapper.eq(Report::getStatus, 0);
}
return AjaxResult.success(reportMapper.selectPage(page, reportLambdaQueryWrapper));
}
@Override
public void deleteReport(Long id) {
Report report = new Report().builder().id(id)
.delFlag(2).build();
reportMapper.updateById(report);
}
@Override
public void updateStatus(Long id) {
Report report = new Report().builder().id(id)
.status(1)
.build();
reportMapper.updateById(report);
}
}

View File

@ -40,11 +40,13 @@ public class WorkFlowCommentServiceImpl extends ServiceImpl<WorkFlowCommentMappe
@Override
public void comment(WorkFlowComment workFlowComment) {
Long parentId = workFlowComment.getParentId();
if (parentId != null){
WorkFlowComment mic = workFlowCommentMapper.selectById(parentId);
if (Objects.nonNull(parentId) && Objects.isNull(mic)) {
return;
}
}
workFlowComment.setUserId(SecurityUtils.getUserId());
workFlowComment.setCreateBy(SecurityUtils.getUsername());
workFlowComment.setUpdateBy(SecurityUtils.getUsername());

View File

@ -49,7 +49,7 @@ public class WorkFlowLikeServiceImpl extends ServiceImpl<WorkFlowLikeMapper, Wor
workFlow.setLikeCount(workFlow.getLikeCount() + 1);
}
// 更新点赞记录
baseMapper.updateById(workFlowLike);
baseMapper.updateStatus(workFlowLike);
// 更新图片点赞数
workFlowMapper.updateById(workFlow);
return;

View File

@ -137,6 +137,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
}
//修改为合格
workFlow.setAuditText("");
workFlow.setAuditStatus(workFlow.getJurisdiction());
flowMapper.updateById(workFlow);
}
@ -170,7 +171,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
}
// 使用逗号拼接所有的失败原因
String concatenatedReasons = String.join(", ", failureReasons);
workFlow.setAuditText(concatenatedReasons);
workFlowVersion.setAuditText(concatenatedReasons);
workFlowVersion.setAuditStatus(4);
//校验id是否存在 区别修改审核或者新增审核
if (workFlowVersion.getId() != null){
@ -202,7 +203,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
}
// 使用逗号拼接所有的失败原因
String concatenatedReasons = String.join(", ", failureReasons);
workFlow.setAuditText(concatenatedReasons);
workFlowVersion.setAuditText(concatenatedReasons);
workFlowVersion.setAuditStatus(4);
//校验id是否存在 区别修改审核或者新增审核
if (workFlowVersion.getId() != null){
@ -217,6 +218,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
}
//修改版本成功审核状态
workFlow.setAuditText("");
workFlowVersion.setAuditStatus(1);
workFlowVersionMapper.updateByName(workFlowVersion);
log.info("全部通过审核");

View File

@ -7,24 +7,30 @@
<insert id="addModelVersion">
INSERT INTO model_version (
version_name, model_type, file_path, trigger_words, sampling, high, vae, cfg,
model_id,version_name, model_type, file_path, trigger_words, sampling, high, vae, cfg,
is_free, is_public, is_encrypt, is_online_use, allow_download_image,
allow_software_use, allow_fusion, allow_commercial_use, allow_usage,
is_exclusive_model, sample_image_paths, hide_image_gen_info, audit_status,
audit_text, del_flag
)
VALUES
<foreach collection="list" item="item" separator=",">
<foreach collection="modelVersionList" item="item" separator=",">
(
#{item.versionName}, #{item.modelType}, #{item.filePath}, #{item.triggerWords},
#{modelProduct.id},#{item.versionName}, #{item.modelType}, #{item.filePath}, #{item.triggerWords},
#{item.sampling}, #{item.high}, #{item.vae}, #{item.cfg},
#{item.isFree}, #{item.isPublic}, #{item.isEncrypt}, #{item.isOnlineUse},
#{item.allowDownloadImage}, #{item.allowSoftwareUse}, #{item.allowFusion},
#{item.allowCommercialUse}, #{item.allowUsage}, #{item.isExclusiveModel},
#{item.sampleImagePaths}, #{item.hideImageGenInfo}, #{item.auditStatus},
#{item.auditText}, #{item.delFlag}
#{item.sampleImagePaths}, #{item.hideImageGenInfo}, 3,
#{item.auditText},'0'
)
</foreach>
</insert>
<update id="updateByName">
update model_version set audit_status = #{auditStatus},
audit_text = #{auditText}
where version_name = #{versionName} and model_id = #{modelId}
</update>
</mapper>

View File

@ -4,11 +4,23 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mcwl.resource.mapper.WorkFlowLikeMapper">
<update id="updateStatus">
UPDATE work_flow_like
SET user_id = #{userId},
work_flow_id = #{workFlowId},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
del_flag = #{delFlag}
WHERE id = #{id}
</update>
<select id="getLike" resultType="com.mcwl.resource.domain.WorkFlowLike">
select id,
user_id,
model_comment_id,
work_flow_id,
create_by,
create_time,
update_by,
@ -16,6 +28,7 @@
del_flag,
remark
from work_flow_like
where user_id = #{userId} and model_id = #{modelId}
where user_id = #{userId}
and work_flow_id = #{modelId}
</select>
</mapper>