优化抄送

master
chen 4 years ago
parent 056ceaa467
commit 6e3e045b10
  1. 40
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgCopyForServiceImpl.java

@ -16,6 +16,7 @@ import com.daqing.framework.domain.guarantee.DgCopyFor;
import com.daqing.framework.domain.guarantee.DgCopyUser;
import com.daqing.framework.domain.guarantee.DgProcessUser;
import com.daqing.framework.model.response.PromptSuccess;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -42,24 +43,29 @@ public class DgCopyForServiceImpl extends ServiceImpl<DgCopyForMapper, DgCopyFor
@Override
public boolean copySendUser(Integer businessId, Integer processId, String imgData) throws IOException {
//获取随机值
String snowflakeId = IdUtil.getSnowflake(6, 4).nextIdStr();
//文件扩展名
String ext = ".png";
//新文件名:雪花算法.文件扩展名
String newName = snowflakeId + ext;
//指定存放目录
String directory = PromptSuccess.UPLOAD_FILE_PATH;
// String directory = "D:/img/";
//图片完整路径
String imgPath = directory + newName;
String accessPath = "";
ImgUtil.generateImage(imgData, imgPath);
//拼接图片地址
//访问路径前缀
String serverPrefix = PromptSuccess.IMAGE_URL_PATH;
//访问路径
String accessPath = serverPrefix + newName;
//图片信息不为空,不生成图片地址
if(StringUtils.isNotEmpty(imgData)){
//获取随机值
String snowflakeId = IdUtil.getSnowflake(6, 4).nextIdStr();
//文件扩展名
String ext = ".png";
//新文件名:雪花算法.文件扩展名
String newName = snowflakeId + ext;
//指定存放目录
String directory = PromptSuccess.UPLOAD_FILE_PATH;
// String directory = "D:/img/";
//图片完整路径
String imgPath = directory + newName;
ImgUtil.generateImage(imgData, imgPath);
//拼接图片地址
//访问路径前缀
String serverPrefix = PromptSuccess.IMAGE_URL_PATH;
//访问路径
accessPath = serverPrefix + newName;
}
//取出抄送详情id
Integer copyForId = 0;
//添加之前判断是否抄送详情存在,如果存在则更新这条数据

Loading…
Cancel
Save