parent
dfeabe5897
commit
32dd0de4cb
|
@ -0,0 +1,24 @@
|
|||
# docker一定要有openjdk8的镜像如果没有执行以下命令
|
||||
# docker pull openjdk:8
|
||||
FROM openjdk:8
|
||||
# 作者信息
|
||||
#LABEL authors="${发布人} <${邮箱}>"
|
||||
|
||||
# 创建我的工作目录(手动创建文件夹,此步骤省略)
|
||||
#RUN mkdir /root/yun
|
||||
|
||||
# 暴露端口(和服务端口保持一致)
|
||||
EXPOSE 8080
|
||||
|
||||
# 创建着陆点(创建文件夹) 后续路径和这个路径一致
|
||||
WORKDIR "/root/mcwl"
|
||||
|
||||
|
||||
# 复制新的运行程序 ./代表的是相对路径 读取的着陆点
|
||||
COPY ./ncwl-ai.jar /root/mcwl/ncwl-ai.jar
|
||||
|
||||
# 挂载出去日志目录 项目名不加jar
|
||||
VOLUME /root/mcwl/logs/ncwl-ai
|
||||
|
||||
# 运行你的jar 运行的是你copy出来的新的jar包
|
||||
CMD ["java", "-jar", "/root/mcwl/ncwl-ai.jar"]
|
|
@ -0,0 +1,75 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.CipherInputStream;
|
||||
import javax.crypto.CipherOutputStream;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.security.AlgorithmParameters;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/25
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
public class FileEncryptDecryptUtil {
|
||||
|
||||
private static final String ALGORITHM = "AES/CBC/PKCS5Padding";
|
||||
private static final String TRANSFORMATION = "AES";
|
||||
private static final String KEY = "iamkeyeeddzasdfs"; // 实际应用中应使用更安全的密钥生成方式
|
||||
private static byte[] SAVED_IV; // 静态变量存储IV,确保解密时可访问
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// 示例:加密文件
|
||||
encryptFile("D:\\ASE\\encryption\\测试文件1.txt", "D:\\ASE\\decode\\加密测试文件1.txt");
|
||||
// 解密文件
|
||||
// decryptFile("D:\\Temp\\test\\test\\caaaa", "D:\\Temp\\test\\test\\日报.xlsx");
|
||||
}
|
||||
|
||||
public static void encryptFile(String sourcePath, String encryptedPath) throws Exception {
|
||||
Cipher cipher = initCipher(Cipher.ENCRYPT_MODE);
|
||||
try (FileInputStream fis = new FileInputStream(sourcePath);
|
||||
FileOutputStream fos = new FileOutputStream(encryptedPath);
|
||||
CipherOutputStream cos = new CipherOutputStream(fos, cipher)) {
|
||||
byte[] buffer = new byte[1024];
|
||||
int read;
|
||||
while ((read = fis.read(buffer)) != -1) {
|
||||
cos.write(buffer, 0, read);
|
||||
}
|
||||
}
|
||||
System.out.println("加密完成");
|
||||
}
|
||||
|
||||
public static void decryptFile(String encryptedPath, String decryptedPath) throws Exception {
|
||||
Cipher cipher = initCipher(Cipher.DECRYPT_MODE);
|
||||
try (FileInputStream fis = new FileInputStream(encryptedPath);
|
||||
CipherInputStream cis = new CipherInputStream(fis, cipher);
|
||||
FileOutputStream fos = new FileOutputStream(decryptedPath)) {
|
||||
byte[] buffer = new byte[1024];
|
||||
int read;
|
||||
while ((read = cis.read(buffer)) != -1) {
|
||||
fos.write(buffer, 0, read);
|
||||
}
|
||||
}
|
||||
System.out.println("解密完成");
|
||||
}
|
||||
|
||||
private static Cipher initCipher(int mode) throws Exception {
|
||||
Cipher cipher = Cipher.getInstance(ALGORITHM);
|
||||
SecretKey secretKey = new SecretKeySpec(KEY.getBytes(), TRANSFORMATION);
|
||||
if (mode == Cipher.ENCRYPT_MODE && SAVED_IV == null) {
|
||||
cipher.init(mode, secretKey);
|
||||
AlgorithmParameters params = cipher.getParameters();
|
||||
SAVED_IV = params.getParameterSpec(IvParameterSpec.class).getIV();
|
||||
System.out.println("Generated IV: " + Base64.getEncoder().encodeToString(SAVED_IV));
|
||||
} else {
|
||||
cipher.init(mode, secretKey, new IvParameterSpec(SAVED_IV));
|
||||
}
|
||||
return cipher;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.mcwl.common.annotation.Anonymous;
|
||||
import com.mcwl.common.core.controller.BaseController;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
|
@ -24,7 +23,8 @@ import java.util.List;
|
|||
|
||||
|
||||
/**
|
||||
*模型
|
||||
* 模型
|
||||
*
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.web.controller.resource
|
||||
|
@ -150,39 +150,39 @@ public class MallProductController extends BaseController {
|
|||
modelService.removeById(modelVersion.getId());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询模型详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询模型详情")
|
||||
@GetMapping("/selectModelById")
|
||||
public AjaxResult selectModelById(@RequestParam Long id){
|
||||
public AjaxResult selectModelById(@RequestParam Long id) {
|
||||
|
||||
return modelService.selectModelById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 设置模型置顶状态
|
||||
*
|
||||
* @param id
|
||||
* @param isTop
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "设置模型置顶状态")
|
||||
@PutMapping("/{id}/top")
|
||||
public ResponseEntity<ModelProduct> setModelTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||
try {
|
||||
modelService.setModelTop(id, isTop);
|
||||
return ResponseEntity.ok().build();
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
}
|
||||
@GetMapping("/{id}/top")
|
||||
public AjaxResult setModelTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||
modelService.setModelTop(id, isTop);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取置顶的模型列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取置顶的模型列表")
|
||||
|
@ -193,11 +193,6 @@ public class MallProductController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 我的发布-模型列表
|
||||
*/
|
||||
|
@ -256,6 +251,4 @@ public class MallProductController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,12 +3,9 @@ package com.mcwl.web.controller.resource;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.mcwl.common.annotation.RepeatSubmit;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.common.core.page.PageDomain;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
import com.mcwl.resource.domain.dto.ModelImageRes;
|
||||
import com.mcwl.resource.domain.vo.ModelImageVo;
|
||||
|
@ -23,7 +20,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
|
@ -107,24 +103,22 @@ public class ModelImageController {
|
|||
|
||||
/**
|
||||
* 设置图片置顶
|
||||
*
|
||||
* @param id
|
||||
* @param isTop
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "设置图片置顶状态")
|
||||
@PutMapping("/{id}/top")
|
||||
public ResponseEntity<ModelImage> setModelImageTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||
try {
|
||||
modelImageLikeService.setModelImageTop(id, isTop);
|
||||
return ResponseEntity.ok().build();
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
}
|
||||
@GetMapping("/{id}/top")
|
||||
public AjaxResult setModelImageTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||
modelImageLikeService.setModelImageTop(id, isTop);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取置顶的图片列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取置顶的图片列表")
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.mcwl.web.controller.resource;
|
|||
|
||||
import com.mcwl.common.core.controller.BaseController;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.WorkFlow;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
|
@ -44,14 +43,12 @@ public class WorkFlowController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "设置工作流的置顶状态")
|
||||
@PutMapping("/{id}/top")
|
||||
public ResponseEntity<WorkFlow> setworkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||
try {
|
||||
@GetMapping("/{id}/top")
|
||||
public AjaxResult setworkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||
|
||||
workFlowService.setworkFlowTop(id, isTop);
|
||||
return ResponseEntity.ok().build();
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -168,9 +165,9 @@ public class WorkFlowController extends BaseController {
|
|||
*/
|
||||
@ApiOperation(value = "查询工作流详情")
|
||||
@GetMapping("/selectWorkFlowById")
|
||||
public AjaxResult selectWorkFlowById(@RequestParam Long id){
|
||||
public AjaxResult selectWorkFlowById(@RequestParam Long id,Integer type){
|
||||
|
||||
return workFlowService.selectWorkFlowById(id);
|
||||
return workFlowService.selectWorkFlowById(id,type);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -92,6 +92,15 @@ public class ModelImageVo {
|
|||
@ApiModelProperty(value = "点赞数")
|
||||
private Integer likeNum;
|
||||
|
||||
/**
|
||||
* 是否置顶
|
||||
*/
|
||||
@ApiModelProperty(value = "是否置顶")
|
||||
private Integer isTop;
|
||||
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ApiModelProperty(value = "审核状态")
|
||||
private Integer auditStatus;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,15 @@ public class ModelVo {
|
|||
@ApiModelProperty(value = "下载数")
|
||||
private Integer numbers;
|
||||
|
||||
/**
|
||||
* 是否置顶
|
||||
*/
|
||||
@ApiModelProperty(value = "是否置顶")
|
||||
private Integer isTop;
|
||||
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ApiModelProperty(value = "审核状态")
|
||||
private Integer auditStatus;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,16 @@ public class WorkFlowVo {
|
|||
@ApiModelProperty(value = "下载数")
|
||||
private Integer downloadNumber;
|
||||
|
||||
/**
|
||||
* 是否置顶
|
||||
*/
|
||||
@ApiModelProperty(value = "是否置顶")
|
||||
private Integer isTop;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ApiModelProperty(value = "审核状态")
|
||||
private Integer auditStatus;
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.mcwl.resource.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.WorkFlow;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -21,6 +22,6 @@ public interface WorkFlowMapper extends BaseMapper<WorkFlow> {
|
|||
List<WorkFlow> fetchWorkFlowSortedByTopStatus();
|
||||
|
||||
|
||||
void setworkFlowTop(Long id, int i);
|
||||
void setworkFlowTop(@Param("id") Long id, @Param("i") int i);
|
||||
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public interface WorkFlowService extends IService<WorkFlow> {
|
|||
|
||||
AjaxResult selectWorkFlow(PageVo pageVo);
|
||||
|
||||
AjaxResult selectWorkFlowById(Long id);
|
||||
AjaxResult selectWorkFlowById(Long id,Integer type);
|
||||
|
||||
TableDataInfo listByPage(ModelImagePageRes imagePageRes);
|
||||
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mcwl.common.constant.HttpStatus;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.common.core.page.PageDomain;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
|
@ -15,13 +13,10 @@ import com.mcwl.common.utils.SecurityUtils;
|
|||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelImageLike;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
import com.mcwl.resource.domain.vo.ModelImageLikeVo;
|
||||
import com.mcwl.resource.domain.vo.ModelImageVo;
|
||||
import com.mcwl.resource.mapper.ModelImageLikeMapper;
|
||||
import com.mcwl.resource.mapper.ModelImageMapper;
|
||||
import com.mcwl.resource.service.ModelImageLikeService;
|
||||
import com.mcwl.resource.service.ModelImageService;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -81,7 +76,7 @@ public class ModelImageLikeServiceImpl extends ServiceImpl<ModelImageLikeMapper,
|
|||
|
||||
@Override
|
||||
public void setModelImageTop(Long id, boolean isTop) {
|
||||
modelImageMapper.setModelImageTop(id,isTop?0:1);
|
||||
modelImageMapper.setModelImageTop(id,isTop?1:0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -31,7 +31,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
@ -180,11 +179,13 @@ public class ModelImageServiceImpl extends ServiceImpl<ModelImageMapper, ModelIm
|
|||
imagePageRes.setOrderByColumn("create_time");
|
||||
}
|
||||
// 设置排序
|
||||
OrderItem orderItem = OrderItem.desc(imagePageRes.getOrderByColumn());
|
||||
page.addOrder(orderItem);
|
||||
List<OrderItem> orderItemList = new ArrayList<>();
|
||||
orderItemList.add(OrderItem.desc("is_top"));
|
||||
orderItemList.add(OrderItem.desc(imagePageRes.getOrderByColumn()));
|
||||
page.addOrder(orderItemList);
|
||||
|
||||
LambdaQueryWrapper<ModelImage> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(imagePageRes.getStatus() != null, ModelImage::getStatus, imagePageRes.getStatus())
|
||||
lqw.eq(imagePageRes.getStatus() != null && imagePageRes.getStatus() != 0, ModelImage::getStatus, imagePageRes.getStatus())
|
||||
.eq(ModelImage::getUserId, SecurityUtils.getUserId())
|
||||
.ge(imagePageRes.getStartTime() != null, ModelImage::getCreateTime, imagePageRes.getStartTime())
|
||||
.le(imagePageRes.getEndTime() != null, ModelImage::getCreateTime, imagePageRes.getEndTime());
|
||||
|
|
|
@ -11,11 +11,8 @@ import com.mcwl.common.core.page.TableDataInfo;
|
|||
import com.mcwl.common.exception.ServiceException;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.resource.domain.ModelLike;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.WorkFlow;
|
||||
import com.mcwl.resource.domain.WorkFlowLike;
|
||||
import com.mcwl.resource.domain.vo.ModelLikeVo;
|
||||
import com.mcwl.resource.domain.vo.WorkFlowLikeVo;
|
||||
import com.mcwl.resource.mapper.WorkFlowLikeMapper;
|
||||
import com.mcwl.resource.mapper.WorkFlowMapper;
|
||||
|
@ -108,6 +105,9 @@ public class WorkFlowLikeServiceImpl extends ServiceImpl<WorkFlowLikeMapper, Wor
|
|||
|
||||
// 获取工作流信息
|
||||
WorkFlow workFlow = workFlowMapper.selectById(workFlowLike.getWorkFlowId());
|
||||
if (workFlow == null){
|
||||
continue;
|
||||
}
|
||||
workFlowLikeVo.setConverPath(workFlow.getCoverPath());
|
||||
workFlowLikeVo.setLikeNum(workFlow.getLikeCount());
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ import org.springframework.stereotype.Service;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 工作流 业务实现层
|
||||
|
@ -293,48 +292,57 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectWorkFlowById(Long id) {
|
||||
public AjaxResult selectWorkFlowById(Long id,Integer type) {
|
||||
|
||||
//查询详情
|
||||
WorkFlow workFlow = flowMapper.selectById(id);
|
||||
|
||||
//翻译属性 垂类
|
||||
if (StringUtils.isNotEmpty(workFlow.getCategory())) {
|
||||
workFlow.setCategory(DictInit.getDictValue(DictConstants.MODEL_CHILD_CATEGORY, workFlow.getCategory()));
|
||||
if (workFlow == null){
|
||||
return AjaxResult.error("工作流不存在");
|
||||
}
|
||||
|
||||
//主体
|
||||
if (StringUtils.isNotEmpty(workFlow.getTheme())) {
|
||||
ArrayList<String> strings = new ArrayList<>();
|
||||
String[] split = workFlow.getTheme().split(",");
|
||||
for (String s : split) {
|
||||
if (s != "") {
|
||||
strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_THEME, workFlow.getCategory()));
|
||||
}
|
||||
if (type == 1){
|
||||
|
||||
String category = workFlow.getCategory();
|
||||
//翻译属性 垂类
|
||||
if (StringUtils.isNotEmpty(category)) {
|
||||
workFlow.setCategory(DictInit.getDictValue(DictConstants.MODEL_CHILD_CATEGORY, workFlow.getCategory()));
|
||||
}
|
||||
workFlow.setThemeList(strings);
|
||||
}
|
||||
|
||||
//风格
|
||||
if (StringUtils.isNotEmpty(workFlow.getStyle())) {
|
||||
ArrayList<String> strings = new ArrayList<>();
|
||||
String[] split = workFlow.getTheme().split(",");
|
||||
for (String s : split) {
|
||||
if (s != "") {
|
||||
strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_STYLE, workFlow.getStyle()));
|
||||
//主体
|
||||
String theme = workFlow.getTheme();
|
||||
if (StringUtils.isNotEmpty(theme)) {
|
||||
ArrayList<String> strings = new ArrayList<>();
|
||||
String[] split = workFlow.getTheme().split(",");
|
||||
for (String s : split) {
|
||||
if (s != "") {
|
||||
strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_THEME, workFlow.getCategory()));
|
||||
}
|
||||
}
|
||||
workFlow.setThemeList(strings);
|
||||
}
|
||||
workFlow.setStyleList(strings);
|
||||
}
|
||||
|
||||
//功能
|
||||
if (StringUtils.isNotEmpty(workFlow.getFunctions())) {
|
||||
workFlow.setCategory(DictInit.getDictValue(DictConstants.WORK_FLOW_FUNCTIONS, workFlow.getFunctions()));
|
||||
}
|
||||
//风格
|
||||
if (StringUtils.isNotEmpty(workFlow.getStyle())) {
|
||||
ArrayList<String> strings = new ArrayList<>();
|
||||
String[] split = workFlow.getStyle().split(",");
|
||||
for (String s : split) {
|
||||
if (s != "") {
|
||||
strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_STYLE, workFlow.getStyle()));
|
||||
}
|
||||
}
|
||||
workFlow.setStyleList(strings);
|
||||
}
|
||||
|
||||
//功能
|
||||
if (StringUtils.isNotEmpty(workFlow.getFunctions())) {
|
||||
workFlow.setCategory(DictInit.getDictValue(DictConstants.WORK_FLOW_FUNCTIONS, workFlow.getFunctions()));
|
||||
}
|
||||
|
||||
//活动
|
||||
if (StringUtils.isNotEmpty(workFlow.getActivityParticipation())) {
|
||||
workFlow.setActivityParticipation(toActivityService.getById(workFlow.getActivityParticipation()).getActivityName());
|
||||
}
|
||||
|
||||
//活动
|
||||
if (StringUtils.isNotEmpty(workFlow.getActivityParticipation())) {
|
||||
workFlow.setActivityParticipation(toActivityService.getById(workFlow.getActivityParticipation()).getActivityName());
|
||||
}
|
||||
|
||||
return AjaxResult.success(workFlow);
|
||||
|
@ -349,14 +357,18 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
imagePageRes.setOrderByColumn("create_time");
|
||||
}
|
||||
// 设置排序
|
||||
OrderItem orderItem = OrderItem.desc(imagePageRes.getOrderByColumn());
|
||||
page.addOrder(orderItem);
|
||||
// 设置排序
|
||||
List<OrderItem> orderItemList = new ArrayList<>();
|
||||
orderItemList.add(OrderItem.desc("is_top"));
|
||||
orderItemList.add(OrderItem.desc(imagePageRes.getOrderByColumn()));
|
||||
page.addOrder(orderItemList);
|
||||
|
||||
LambdaQueryWrapper<WorkFlow> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(imagePageRes.getStatus() != null, WorkFlow::getAuditStatus, imagePageRes.getStatus())
|
||||
lqw.eq(imagePageRes.getStatus() != null && imagePageRes.getStatus() != 0 , WorkFlow::getAuditStatus, imagePageRes.getStatus())
|
||||
.eq(WorkFlow::getUserId, SecurityUtils.getUserId())
|
||||
.ge(imagePageRes.getStartTime() != null, WorkFlow::getCreateTime, imagePageRes.getStartTime())
|
||||
.le(imagePageRes.getEndTime() != null, WorkFlow::getCreateTime, imagePageRes.getEndTime());
|
||||
.le(imagePageRes.getEndTime() != null, WorkFlow::getCreateTime, imagePageRes.getEndTime())
|
||||
.eq(WorkFlow::getDelFlag,0);
|
||||
|
||||
baseMapper.selectPage(page, lqw);
|
||||
// 获取分页数据
|
||||
|
@ -388,7 +400,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
|
||||
@Override
|
||||
public void setworkFlowTop(Long id, boolean isTop) {
|
||||
flowMapper.setworkFlowTop(id,isTop?0:1);
|
||||
flowMapper.setworkFlowTop(id,isTop?1:0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.ModelImageMapper">
|
||||
<update id="setModelImageTop">
|
||||
UPDATE model_image SET is_top = #{isTop} WHERE image_id = #{imageId}
|
||||
UPDATE model_image SET is_top = #{isTop} WHERE id = #{id}
|
||||
</update>
|
||||
<update id="fetchModelImageSortedByTopStatus">
|
||||
SELECT is_top FROM model_image ORDER BY is_top DESC;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="setworkFlowTop">
|
||||
UPDATE work_flow SET is_top = #{isTop} WHERE id = #{id}
|
||||
UPDATE work_flow SET is_top = #{i} WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="fetchWorkFlowSortedByTopStatus" resultType="com.mcwl.resource.domain.WorkFlow">
|
||||
|
|
Loading…
Reference in New Issue