|
@@ -9,7 +9,6 @@ import com.qmth.themis.business.enums.UploadFileEnum;
|
|
|
import com.qmth.themis.business.service.TBAttachmentService;
|
|
|
import com.qmth.themis.business.util.JacksonUtil;
|
|
|
import com.qmth.themis.business.util.OssUtil;
|
|
|
-import com.qmth.themis.common.contanst.Constants;
|
|
|
import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.themis.common.exception.BusinessException;
|
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
@@ -96,13 +95,7 @@ public class TBAttachmentServiceImpl extends ServiceImpl<TBAttachmentMapper, TBA
|
|
|
if (!Objects.equals(fileMd5, md5)) {
|
|
|
throw new BusinessException("md5不一致");
|
|
|
}
|
|
|
- tbAttachment = new TBAttachment();
|
|
|
- tbAttachment.setId(Constants.idGen.next());
|
|
|
- tbAttachment.setPath(path);
|
|
|
- tbAttachment.setName(fileName);
|
|
|
- tbAttachment.setType(format);
|
|
|
- tbAttachment.setSize(b);
|
|
|
- tbAttachment.setMd5(fileMd5);
|
|
|
+ tbAttachment = new TBAttachment(path, fileName, format, b, fileMd5);
|
|
|
|
|
|
boolean oss = (boolean) map.get(SystemConstant.OSS);
|
|
|
LocalDateTime nowTime = LocalDateTime.now();
|
|
@@ -187,13 +180,7 @@ public class TBAttachmentServiceImpl extends ServiceImpl<TBAttachmentMapper, TBA
|
|
|
log.info("format:{}", format);
|
|
|
log.info("size:{}", b);
|
|
|
log.info("md5:{}", md5);
|
|
|
- tbAttachment = new TBAttachment();
|
|
|
- tbAttachment.setId(Constants.idGen.next());
|
|
|
- tbAttachment.setPath(path);
|
|
|
- tbAttachment.setName(fileName);
|
|
|
- tbAttachment.setType(format);
|
|
|
- tbAttachment.setSize(b);
|
|
|
- tbAttachment.setMd5(md5);
|
|
|
+ tbAttachment = new TBAttachment(path, fileName, format, b, md5);
|
|
|
|
|
|
boolean oss = (boolean) map.get(SystemConstant.OSS);
|
|
|
LocalDateTime nowTime = LocalDateTime.now();
|