|
@@ -19,9 +19,9 @@ 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.metadata.IPage;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
-import com.mixsmart.utils.StringUtils;
|
|
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import okhttp3.OkHttpClient;
|
|
import okhttp3.OkHttpClient;
|
|
@@ -34,7 +34,10 @@ 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;
|
|
import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
|
|
import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
|
|
-import org.springblade.manager.entity.*;
|
|
|
|
|
|
+import org.springblade.manager.entity.ContractInfo;
|
|
|
|
+import org.springblade.manager.entity.ProjectInfo;
|
|
|
|
+import org.springblade.manager.entity.SignPfxDeputy;
|
|
|
|
+import org.springblade.manager.entity.SignPfxFile;
|
|
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.utils.FileUtils;
|
|
@@ -53,7 +56,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
-import java.io.IOException;
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -469,7 +471,7 @@ public class SignPfxFileController extends BladeController {
|
|
@PostMapping("/compressAndUpload")
|
|
@PostMapping("/compressAndUpload")
|
|
public R<BladeFile> compressAndUpload(@RequestParam MultipartFile file, @RequestParam double wide,@RequestParam double high) throws Exception {
|
|
public R<BladeFile> compressAndUpload(@RequestParam MultipartFile file, @RequestParam double wide,@RequestParam double high) throws Exception {
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
- String localImgPath = file_path + "print//" + UUID.randomUUID() + ".png";
|
|
|
|
|
|
+ String localImgPath = file_path + "print//" + SnowFlakeUtil.getId() + ".png";
|
|
// 检查文件是否存在
|
|
// 检查文件是否存在
|
|
File newFile = new File(localImgPath);
|
|
File newFile = new File(localImgPath);
|
|
if (!newFile.exists()) {
|
|
if (!newFile.exists()) {
|
|
@@ -482,12 +484,13 @@ public class SignPfxFileController extends BladeController {
|
|
// 保存文件
|
|
// 保存文件
|
|
file.transferTo(newFile);
|
|
file.transferTo(newFile);
|
|
//图片压缩后的地址
|
|
//图片压缩后的地址
|
|
- UUID uuid = UUID.randomUUID();
|
|
|
|
- String compressImgPath = file_path + "/print//" + uuid + ".png";
|
|
|
|
|
|
+ Long id = SnowFlakeUtil.getId();
|
|
|
|
+ String compressImgPath = file_path + "/print//" + id + ".png";
|
|
FileUtils.compressImage(localImgPath, compressImgPath, wide, high);
|
|
FileUtils.compressImage(localImgPath, compressImgPath, wide, high);
|
|
- return R.data(newIOSSClient.uploadFile(uuid+".png", compressImgPath));
|
|
|
|
|
|
+ return R.data(newIOSSClient.uploadFile(id+".png", compressImgPath));
|
|
}
|
|
}
|
|
- @PostMapping("/picPresave")
|
|
|
|
|
|
+ /*弃用 预览电签图片之前的一个新增
|
|
|
|
+ @PostMapping("/picPresave")
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperation(value = "预览图片新增准备", notes = "传入signPfxFile")
|
|
@ApiOperation(value = "预览图片新增准备", notes = "传入signPfxFile")
|
|
public R picPresave( @RequestParam MultipartFile file, @RequestParam double wide,@RequestParam double high) throws IOException {
|
|
public R picPresave( @RequestParam MultipartFile file, @RequestParam double wide,@RequestParam double high) throws IOException {
|
|
@@ -496,15 +499,25 @@ public class SignPfxFileController extends BladeController {
|
|
signPfxFilePreVo.setWide(wide);
|
|
signPfxFilePreVo.setWide(wide);
|
|
signPfxFilePreVo.setHigh(high);
|
|
signPfxFilePreVo.setHigh(high);
|
|
return pfxFilePreService.picPresave(signPfxFilePreVo);
|
|
return pfxFilePreService.picPresave(signPfxFilePreVo);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
@PostMapping ("/prePicture")
|
|
@PostMapping ("/prePicture")
|
|
@ApiOperationSupport(order = 4)
|
|
@ApiOperationSupport(order = 4)
|
|
@ApiOperation(value = "预览电签后的图片", notes = "传入signPfxFile")
|
|
@ApiOperation(value = "预览电签后的图片", notes = "传入signPfxFile")
|
|
- public R prePicture( @RequestBody SignPfxFilePre signPfxFilePre) throws Exception {
|
|
|
|
- return pfxFilePreService.prePicture(signPfxFilePre);
|
|
|
|
|
|
+ public R prePicture(@RequestParam Optional<MultipartFile> file, @RequestParam Optional<String> fileStr, @RequestParam Optional<String> wide,@RequestParam Optional<String> high) throws Exception {
|
|
|
|
+ SignPfxFilePreVo signPfxFilePreVo = new SignPfxFilePreVo();
|
|
|
|
+ signPfxFilePreVo.setFile(file.orElse(null));
|
|
|
|
+ if(Func.isNotEmpty(wide.orElse(null)) && Func.isNotEmpty(high.orElse(null)) && !"null".equals(wide.get()) && !"null".equals(high.get())){
|
|
|
|
+ double wideDouble = Double.parseDouble(wide.get());
|
|
|
|
+ double highDouble = Double.parseDouble(high.get());
|
|
|
|
+ signPfxFilePreVo.setWide(wideDouble);
|
|
|
|
+ signPfxFilePreVo.setHigh(highDouble);
|
|
|
|
+ }else {
|
|
|
|
+ signPfxFilePreVo.setWide(null);
|
|
|
|
+ signPfxFilePreVo.setHigh(null);
|
|
|
|
+ }
|
|
|
|
+ signPfxFilePreVo.setFileStr(fileStr.orElse(null));
|
|
|
|
+ return pfxFilePreService.prePicture(signPfxFilePreVo);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 修改 个人/企业证书信息表
|
|
* 修改 个人/企业证书信息表
|
|
*/
|
|
*/
|