|
@@ -18,17 +18,18 @@ package org.springblade.manager.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.mixsmart.utils.StringUtils;
|
|
import com.mixsmart.utils.StringUtils;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
-
|
|
|
|
-import javax.validation.Valid;
|
|
|
|
-
|
|
|
|
|
|
+import okhttp3.OkHttpClient;
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
|
+import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
|
|
+import org.springblade.core.oss.model.BladeFile;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
@@ -36,7 +37,10 @@ import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
|
|
import org.springblade.manager.entity.*;
|
|
import org.springblade.manager.entity.*;
|
|
import org.springblade.manager.feign.ProjectAssignmentUserClient;
|
|
import org.springblade.manager.feign.ProjectAssignmentUserClient;
|
|
import org.springblade.manager.service.*;
|
|
import org.springblade.manager.service.*;
|
|
|
|
+import org.springblade.manager.utils.FileUtils;
|
|
import org.springblade.manager.vo.*;
|
|
import org.springblade.manager.vo.*;
|
|
|
|
+import org.springblade.resource.feign.IOSSClient;
|
|
|
|
+import org.springblade.resource.feign.NewIOSSClient;
|
|
import org.springblade.system.entity.DictBiz;
|
|
import org.springblade.system.entity.DictBiz;
|
|
import org.springblade.system.entity.Role;
|
|
import org.springblade.system.entity.Role;
|
|
import org.springblade.system.feign.IDictBizClient;
|
|
import org.springblade.system.feign.IDictBizClient;
|
|
@@ -45,14 +49,12 @@ import org.springblade.system.user.entity.User;
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
import org.springblade.system.vo.RoleVO;
|
|
import org.springblade.system.vo.RoleVO;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
-import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.Iterator;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -85,6 +87,11 @@ public class SignPfxFileController extends BladeController {
|
|
|
|
|
|
private final ProjectAssignmentUserClient projectAssignmentUserClient;
|
|
private final ProjectAssignmentUserClient projectAssignmentUserClient;
|
|
|
|
|
|
|
|
+ private final ISignPfxFilePreService pfxFilePreService;
|
|
|
|
+ private final NewIOSSClient newIOSSClient;
|
|
|
|
+ private final IOSSClient iossClient;
|
|
|
|
+ private final OkHttpClient.Builder okHttpClientBuilder;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 根据合同段ID获取项目下的所有合同段
|
|
* 根据合同段ID获取项目下的所有合同段
|
|
*
|
|
*
|
|
@@ -439,11 +446,70 @@ public class SignPfxFileController extends BladeController {
|
|
return R.status(this.signPfxFileService.save(vo));
|
|
return R.status(this.signPfxFileService.save(vo));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 测试删除接口 无用
|
|
|
|
+ * @param type
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+/* @GetMapping("/deltest")
|
|
|
|
+ public R<Boolean> deltest(@RequestParam Integer type) {
|
|
|
|
+ if(type==1){
|
|
|
|
+ newIOSSClient.removeFile("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20241009/51c1e44a42ffefd6451ece7e4716077a.png");
|
|
|
|
+ }else if(type==2){
|
|
|
|
+ newIOSSClient.removeFile("357e9df39fafd5b342d36222b5624242.png");
|
|
|
|
+ }else {
|
|
|
|
+ newIOSSClient.removeFile("/upload/20241009/51c1e44a42ffefd6451ece7e4716077a.png");
|
|
|
|
+ }
|
|
|
|
+ return R.data(true);
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据用户设定尺寸压缩图片后上传至oss
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/compressAndUpload")
|
|
|
|
+ public R<BladeFile> compressAndUpload(@RequestParam MultipartFile file, @RequestParam double wide,@RequestParam double high) throws Exception {
|
|
|
|
+ String file_path = FileUtils.getSysLocalFileUrl();
|
|
|
|
+ String localImgPath = file_path + "print//" + UUID.randomUUID() + ".png";
|
|
|
|
+ // 检查文件是否存在
|
|
|
|
+ File newFile = new File(localImgPath);
|
|
|
|
+ if (!newFile.exists()) {
|
|
|
|
+ // 如果文件不存在,则创建目录
|
|
|
|
+ File parentDir = newFile.getParentFile();
|
|
|
|
+ if (parentDir != null && !parentDir.exists()) {
|
|
|
|
+ parentDir.mkdirs();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 保存文件
|
|
|
|
+ file.transferTo(newFile);
|
|
|
|
+ //图片压缩后的地址
|
|
|
|
+ UUID uuid = UUID.randomUUID();
|
|
|
|
+ String compressImgPath = file_path + "/print//" + uuid + ".png";
|
|
|
|
+ FileUtils.compressImage(localImgPath, compressImgPath, wide, high);
|
|
|
|
+ return R.data(newIOSSClient.uploadFile(uuid+".png", compressImgPath));
|
|
|
|
+ }
|
|
|
|
+ @PostMapping("/picPresave")
|
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
|
+ @ApiOperation(value = "预览图片新增准备", notes = "传入signPfxFile")
|
|
|
|
+ public R picPresave( @RequestParam MultipartFile file, @RequestParam double wide,@RequestParam double high) throws IOException {
|
|
|
|
+ SignPfxFilePreVo signPfxFilePreVo = new SignPfxFilePreVo();
|
|
|
|
+ signPfxFilePreVo.setFile(file);
|
|
|
|
+ signPfxFilePreVo.setWide(wide);
|
|
|
|
+ signPfxFilePreVo.setHigh(high);
|
|
|
|
+ return pfxFilePreService.picPresave(signPfxFilePreVo);
|
|
|
|
+ }
|
|
|
|
+ @PostMapping ("/prePicture")
|
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
|
+ @ApiOperation(value = "预览电签后的图片", notes = "传入signPfxFile")
|
|
|
|
+ public R prePicture( @RequestBody SignPfxFilePre signPfxFilePre) throws Exception {
|
|
|
|
+ return pfxFilePreService.prePicture(signPfxFilePre);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 修改 个人/企业证书信息表
|
|
* 修改 个人/企业证书信息表
|
|
*/
|
|
*/
|
|
@PostMapping("/update")
|
|
@PostMapping("/update")
|
|
- @ApiOperationSupport(order = 3)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
@ApiOperation(value = "修改", notes = "传入signPfxFile")
|
|
@ApiOperation(value = "修改", notes = "传入signPfxFile")
|
|
public R<Boolean> update(@Valid @RequestBody SignPfxFileVO vo) {
|
|
public R<Boolean> update(@Valid @RequestBody SignPfxFileVO vo) {
|
|
if (new Integer("2").equals(vo.getCertificateType())||new Integer("3").equals(vo.getCertificateType())) {
|
|
if (new Integer("2").equals(vo.getCertificateType())||new Integer("3").equals(vo.getCertificateType())) {
|
|
@@ -497,7 +563,7 @@ public class SignPfxFileController extends BladeController {
|
|
* 删除 个人/企业证书信息表
|
|
* 删除 个人/企业证书信息表
|
|
*/
|
|
*/
|
|
@PostMapping("/remove")
|
|
@PostMapping("/remove")
|
|
- @ApiOperationSupport(order = 4)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
return R.status(this.signPfxFileService.deleteLogic(Func.toLongList(ids)));
|
|
return R.status(this.signPfxFileService.deleteLogic(Func.toLongList(ids)));
|