Compare commits
No commits in common. "6dedc5a17063d857b78a8773862aa03883827470" and "821d852b5ba8eeabc1f3ac4f58faa77dc10af6c7" have entirely different histories.
6dedc5a170
...
821d852b5b
|
@ -1,24 +0,0 @@
|
||||||
# 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"]
|
|
|
@ -1,75 +0,0 @@
|
||||||
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,5 +1,6 @@
|
||||||
package com.mcwl.web.controller.resource;
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.mcwl.common.annotation.Anonymous;
|
import com.mcwl.common.annotation.Anonymous;
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
@ -24,7 +25,6 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*模型
|
*模型
|
||||||
*
|
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
* @Project:McWl
|
* @Project:McWl
|
||||||
* @Package:com.mcwl.web.controller.resource
|
* @Package:com.mcwl.web.controller.resource
|
||||||
|
@ -150,10 +150,8 @@ public class MallProductController extends BaseController {
|
||||||
modelService.removeById(modelVersion.getId());
|
modelService.removeById(modelVersion.getId());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询模型详情
|
* 查询模型详情
|
||||||
*
|
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -167,22 +165,24 @@ public class MallProductController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置模型置顶状态
|
* 设置模型置顶状态
|
||||||
*
|
|
||||||
* @param id
|
* @param id
|
||||||
* @param isTop
|
* @param isTop
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "设置模型置顶状态")
|
@ApiOperation(value = "设置模型置顶状态")
|
||||||
@GetMapping("/{id}/top")
|
@PutMapping("/{id}/top")
|
||||||
public AjaxResult setModelTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
public ResponseEntity<ModelProduct> setModelTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||||
|
try {
|
||||||
modelService.setModelTop(id, isTop);
|
modelService.setModelTop(id, isTop);
|
||||||
return AjaxResult.success();
|
return ResponseEntity.ok().build();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取置顶的模型列表
|
* 获取置顶的模型列表
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取置顶的模型列表")
|
@ApiOperation(value = "获取置顶的模型列表")
|
||||||
|
@ -193,6 +193,11 @@ public class MallProductController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 我的发布-模型列表
|
* 我的发布-模型列表
|
||||||
*/
|
*/
|
||||||
|
@ -251,4 +256,6 @@ public class MallProductController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,12 @@ package com.mcwl.web.controller.resource;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.mcwl.common.annotation.RepeatSubmit;
|
import com.mcwl.common.annotation.RepeatSubmit;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
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.PageDomain;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.resource.domain.ModelImage;
|
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.ModelImagePageRes;
|
||||||
import com.mcwl.resource.domain.dto.ModelImageRes;
|
import com.mcwl.resource.domain.dto.ModelImageRes;
|
||||||
import com.mcwl.resource.domain.vo.ModelImageVo;
|
import com.mcwl.resource.domain.vo.ModelImageVo;
|
||||||
|
@ -20,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片
|
* 图片
|
||||||
|
@ -103,22 +107,24 @@ public class ModelImageController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置图片置顶
|
* 设置图片置顶
|
||||||
*
|
|
||||||
* @param id
|
* @param id
|
||||||
* @param isTop
|
* @param isTop
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "设置图片置顶状态")
|
@ApiOperation(value = "设置图片置顶状态")
|
||||||
@GetMapping("/{id}/top")
|
@PutMapping("/{id}/top")
|
||||||
public AjaxResult setModelImageTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
public ResponseEntity<ModelImage> setModelImageTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||||
|
try {
|
||||||
modelImageLikeService.setModelImageTop(id, isTop);
|
modelImageLikeService.setModelImageTop(id, isTop);
|
||||||
return AjaxResult.success();
|
return ResponseEntity.ok().build();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取置顶的图片列表
|
* 获取置顶的图片列表
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取置顶的图片列表")
|
@ApiOperation(value = "获取置顶的图片列表")
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
import com.mcwl.resource.domain.WorkFlow;
|
import com.mcwl.resource.domain.WorkFlow;
|
||||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||||
import com.mcwl.resource.domain.vo.PageVo;
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
|
@ -43,12 +44,14 @@ public class WorkFlowController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "设置工作流的置顶状态")
|
@ApiOperation(value = "设置工作流的置顶状态")
|
||||||
@GetMapping("/{id}/top")
|
@PutMapping("/{id}/top")
|
||||||
public AjaxResult setworkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
public ResponseEntity<WorkFlow> setworkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||||
|
try {
|
||||||
workFlowService.setworkFlowTop(id, isTop);
|
workFlowService.setworkFlowTop(id, isTop);
|
||||||
return AjaxResult.success();
|
return ResponseEntity.ok().build();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -165,9 +168,9 @@ public class WorkFlowController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询工作流详情")
|
@ApiOperation(value = "查询工作流详情")
|
||||||
@GetMapping("/selectWorkFlowById")
|
@GetMapping("/selectWorkFlowById")
|
||||||
public AjaxResult selectWorkFlowById(@RequestParam Long id,Integer type){
|
public AjaxResult selectWorkFlowById(@RequestParam Long id){
|
||||||
|
|
||||||
return workFlowService.selectWorkFlowById(id,type);
|
return workFlowService.selectWorkFlowById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,15 +92,6 @@ public class ModelImageVo {
|
||||||
@ApiModelProperty(value = "点赞数")
|
@ApiModelProperty(value = "点赞数")
|
||||||
private Integer likeNum;
|
private Integer likeNum;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否置顶
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "是否置顶")
|
|
||||||
private Integer isTop;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 审核状态
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "审核状态")
|
|
||||||
private Integer auditStatus;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,15 +48,6 @@ public class ModelVo {
|
||||||
@ApiModelProperty(value = "下载数")
|
@ApiModelProperty(value = "下载数")
|
||||||
private Integer numbers;
|
private Integer numbers;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否置顶
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "是否置顶")
|
|
||||||
private Integer isTop;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 审核状态
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "审核状态")
|
|
||||||
private Integer auditStatus;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,16 +48,6 @@ public class WorkFlowVo {
|
||||||
@ApiModelProperty(value = "下载数")
|
@ApiModelProperty(value = "下载数")
|
||||||
private Integer downloadNumber;
|
private Integer downloadNumber;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否置顶
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "是否置顶")
|
|
||||||
private Integer isTop;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 审核状态
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "审核状态")
|
|
||||||
private Integer auditStatus;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.mcwl.resource.mapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.mcwl.resource.domain.WorkFlow;
|
import com.mcwl.resource.domain.WorkFlow;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -22,6 +21,6 @@ public interface WorkFlowMapper extends BaseMapper<WorkFlow> {
|
||||||
List<WorkFlow> fetchWorkFlowSortedByTopStatus();
|
List<WorkFlow> fetchWorkFlowSortedByTopStatus();
|
||||||
|
|
||||||
|
|
||||||
void setworkFlowTop(@Param("id") Long id, @Param("i") int i);
|
void setworkFlowTop(Long id, int i);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ public interface WorkFlowService extends IService<WorkFlow> {
|
||||||
|
|
||||||
AjaxResult selectWorkFlow(PageVo pageVo);
|
AjaxResult selectWorkFlow(PageVo pageVo);
|
||||||
|
|
||||||
AjaxResult selectWorkFlowById(Long id,Integer type);
|
AjaxResult selectWorkFlowById(Long id);
|
||||||
|
|
||||||
TableDataInfo listByPage(ModelImagePageRes imagePageRes);
|
TableDataInfo listByPage(ModelImagePageRes imagePageRes);
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package com.mcwl.resource.service.impl;
|
package com.mcwl.resource.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
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.core.metadata.OrderItem;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.mcwl.common.constant.HttpStatus;
|
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.domain.entity.SysUser;
|
||||||
import com.mcwl.common.core.page.PageDomain;
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
@ -13,10 +15,13 @@ import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.common.utils.StringUtils;
|
import com.mcwl.common.utils.StringUtils;
|
||||||
import com.mcwl.resource.domain.ModelImage;
|
import com.mcwl.resource.domain.ModelImage;
|
||||||
import com.mcwl.resource.domain.ModelImageLike;
|
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.ModelImageLikeVo;
|
||||||
|
import com.mcwl.resource.domain.vo.ModelImageVo;
|
||||||
import com.mcwl.resource.mapper.ModelImageLikeMapper;
|
import com.mcwl.resource.mapper.ModelImageLikeMapper;
|
||||||
import com.mcwl.resource.mapper.ModelImageMapper;
|
import com.mcwl.resource.mapper.ModelImageMapper;
|
||||||
import com.mcwl.resource.service.ModelImageLikeService;
|
import com.mcwl.resource.service.ModelImageLikeService;
|
||||||
|
import com.mcwl.resource.service.ModelImageService;
|
||||||
import com.mcwl.system.service.ISysUserService;
|
import com.mcwl.system.service.ISysUserService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -76,7 +81,7 @@ public class ModelImageLikeServiceImpl extends ServiceImpl<ModelImageLikeMapper,
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setModelImageTop(Long id, boolean isTop) {
|
public void setModelImageTop(Long id, boolean isTop) {
|
||||||
modelImageMapper.setModelImageTop(id,isTop?1:0);
|
modelImageMapper.setModelImageTop(id,isTop?0:1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@ -179,13 +180,11 @@ public class ModelImageServiceImpl extends ServiceImpl<ModelImageMapper, ModelIm
|
||||||
imagePageRes.setOrderByColumn("create_time");
|
imagePageRes.setOrderByColumn("create_time");
|
||||||
}
|
}
|
||||||
// 设置排序
|
// 设置排序
|
||||||
List<OrderItem> orderItemList = new ArrayList<>();
|
OrderItem orderItem = OrderItem.desc(imagePageRes.getOrderByColumn());
|
||||||
orderItemList.add(OrderItem.desc("is_top"));
|
page.addOrder(orderItem);
|
||||||
orderItemList.add(OrderItem.desc(imagePageRes.getOrderByColumn()));
|
|
||||||
page.addOrder(orderItemList);
|
|
||||||
|
|
||||||
LambdaQueryWrapper<ModelImage> lqw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ModelImage> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.eq(imagePageRes.getStatus() != null && imagePageRes.getStatus() != 0, ModelImage::getStatus, imagePageRes.getStatus())
|
lqw.eq(imagePageRes.getStatus() != null, ModelImage::getStatus, imagePageRes.getStatus())
|
||||||
.eq(ModelImage::getUserId, SecurityUtils.getUserId())
|
.eq(ModelImage::getUserId, SecurityUtils.getUserId())
|
||||||
.ge(imagePageRes.getStartTime() != null, ModelImage::getCreateTime, imagePageRes.getStartTime())
|
.ge(imagePageRes.getStartTime() != null, ModelImage::getCreateTime, imagePageRes.getStartTime())
|
||||||
.le(imagePageRes.getEndTime() != null, ModelImage::getCreateTime, imagePageRes.getEndTime());
|
.le(imagePageRes.getEndTime() != null, ModelImage::getCreateTime, imagePageRes.getEndTime());
|
||||||
|
|
|
@ -37,6 +37,7 @@ import org.springframework.stereotype.Service;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流 业务实现层
|
* 工作流 业务实现层
|
||||||
|
@ -292,25 +293,18 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult selectWorkFlowById(Long id,Integer type) {
|
public AjaxResult selectWorkFlowById(Long id) {
|
||||||
|
|
||||||
//查询详情
|
//查询详情
|
||||||
WorkFlow workFlow = flowMapper.selectById(id);
|
WorkFlow workFlow = flowMapper.selectById(id);
|
||||||
if (workFlow == null){
|
|
||||||
return AjaxResult.error("工作流不存在");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type == 1){
|
|
||||||
|
|
||||||
String category = workFlow.getCategory();
|
|
||||||
//翻译属性 垂类
|
//翻译属性 垂类
|
||||||
if (StringUtils.isNotEmpty(category)) {
|
if (StringUtils.isNotEmpty(workFlow.getCategory())) {
|
||||||
workFlow.setCategory(DictInit.getDictValue(DictConstants.MODEL_CHILD_CATEGORY, workFlow.getCategory()));
|
workFlow.setCategory(DictInit.getDictValue(DictConstants.MODEL_CHILD_CATEGORY, workFlow.getCategory()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//主体
|
//主体
|
||||||
String theme = workFlow.getTheme();
|
if (StringUtils.isNotEmpty(workFlow.getTheme())) {
|
||||||
if (StringUtils.isNotEmpty(theme)) {
|
|
||||||
ArrayList<String> strings = new ArrayList<>();
|
ArrayList<String> strings = new ArrayList<>();
|
||||||
String[] split = workFlow.getTheme().split(",");
|
String[] split = workFlow.getTheme().split(",");
|
||||||
for (String s : split) {
|
for (String s : split) {
|
||||||
|
@ -324,7 +318,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
||||||
//风格
|
//风格
|
||||||
if (StringUtils.isNotEmpty(workFlow.getStyle())) {
|
if (StringUtils.isNotEmpty(workFlow.getStyle())) {
|
||||||
ArrayList<String> strings = new ArrayList<>();
|
ArrayList<String> strings = new ArrayList<>();
|
||||||
String[] split = workFlow.getStyle().split(",");
|
String[] split = workFlow.getTheme().split(",");
|
||||||
for (String s : split) {
|
for (String s : split) {
|
||||||
if (s != "") {
|
if (s != "") {
|
||||||
strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_STYLE, workFlow.getStyle()));
|
strings.add(DictInit.getDictValue(DictConstants.WORK_FLOW_STYLE, workFlow.getStyle()));
|
||||||
|
@ -343,8 +337,6 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
||||||
workFlow.setActivityParticipation(toActivityService.getById(workFlow.getActivityParticipation()).getActivityName());
|
workFlow.setActivityParticipation(toActivityService.getById(workFlow.getActivityParticipation()).getActivityName());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return AjaxResult.success(workFlow);
|
return AjaxResult.success(workFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,18 +349,14 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
||||||
imagePageRes.setOrderByColumn("create_time");
|
imagePageRes.setOrderByColumn("create_time");
|
||||||
}
|
}
|
||||||
// 设置排序
|
// 设置排序
|
||||||
// 设置排序
|
OrderItem orderItem = OrderItem.desc(imagePageRes.getOrderByColumn());
|
||||||
List<OrderItem> orderItemList = new ArrayList<>();
|
page.addOrder(orderItem);
|
||||||
orderItemList.add(OrderItem.desc("is_top"));
|
|
||||||
orderItemList.add(OrderItem.desc(imagePageRes.getOrderByColumn()));
|
|
||||||
page.addOrder(orderItemList);
|
|
||||||
|
|
||||||
LambdaQueryWrapper<WorkFlow> lqw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<WorkFlow> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.eq(imagePageRes.getStatus() != null && imagePageRes.getStatus() != 0 , WorkFlow::getAuditStatus, imagePageRes.getStatus())
|
lqw.eq(imagePageRes.getStatus() != null, WorkFlow::getAuditStatus, imagePageRes.getStatus())
|
||||||
.eq(WorkFlow::getUserId, SecurityUtils.getUserId())
|
.eq(WorkFlow::getUserId, SecurityUtils.getUserId())
|
||||||
.ge(imagePageRes.getStartTime() != null, WorkFlow::getCreateTime, imagePageRes.getStartTime())
|
.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);
|
baseMapper.selectPage(page, lqw);
|
||||||
// 获取分页数据
|
// 获取分页数据
|
||||||
|
@ -400,7 +388,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setworkFlowTop(Long id, boolean isTop) {
|
public void setworkFlowTop(Long id, boolean isTop) {
|
||||||
flowMapper.setworkFlowTop(id,isTop?1:0);
|
flowMapper.setworkFlowTop(id,isTop?0:1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.mcwl.resource.mapper.ModelImageMapper">
|
<mapper namespace="com.mcwl.resource.mapper.ModelImageMapper">
|
||||||
<update id="setModelImageTop">
|
<update id="setModelImageTop">
|
||||||
UPDATE model_image SET is_top = #{isTop} WHERE id = #{id}
|
UPDATE model_image SET is_top = #{isTop} WHERE image_id = #{imageId}
|
||||||
</update>
|
</update>
|
||||||
<update id="fetchModelImageSortedByTopStatus">
|
<update id="fetchModelImageSortedByTopStatus">
|
||||||
SELECT is_top FROM model_image ORDER BY is_top DESC;
|
SELECT is_top FROM model_image ORDER BY is_top DESC;
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
<update id="setworkFlowTop">
|
<update id="setworkFlowTop">
|
||||||
UPDATE work_flow SET is_top = #{i} WHERE id = #{id}
|
UPDATE work_flow SET is_top = #{isTop} WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="fetchWorkFlowSortedByTopStatus" resultType="com.mcwl.resource.domain.WorkFlow">
|
<select id="fetchWorkFlowSortedByTopStatus" resultType="com.mcwl.resource.domain.WorkFlow">
|
||||||
|
|
Loading…
Reference in New Issue