Commit a40a9be2 authored by wangzb's avatar wangzb

Merge remote-tracking branch 'origin/MVP1.5.4' into MVP1.5.4

parents bbcea31d e5b8b3db
package com.yifu.cloud.plus.v1.yifu.order.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -684,8 +683,6 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
*/
@Override
public R receiveOrderNew(OrderAttVo vo) throws IOException{
log.error("ssssssssssssssss"+JSON.toJSONString(vo));
if (Common.isEmpty(vo.getOrderNo())){
return R.failed(OrderConstants.ORDER_NO_IS_EMPTY);
}
......@@ -709,35 +706,35 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
}
}
if (vo.getFile1().equals("fileOne")) {
if (ArrayUtils.isNotEmpty(vo.getFile())) {
for (MultipartFile multipartFile : vo.getFile()) {
String fileName = System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename();
//filePath不传默认存储空间的根目录
//支持的附件格式
String key = fileName;
boolean flag = ossUtil.uploadFileByStream(multipartFile.getInputStream(), key, null);
if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
TOrderEnclosure orderEnclosure = new TOrderEnclosure();
orderEnclosure.setOrderNo(vo.getOrderNo());
orderEnclosure.setEnclosureName(multipartFile.getOriginalFilename());
orderEnclosure.setEnclosureFlag(CommonConstants.TWO_INTEGER);
orderEnclosure.setEnclosureAddress(key);
orderEnclosure.setDeleteFlag(CommonConstants.ZERO_INT);
try {
tOrderEnclosureService.save(orderEnclosure);
} catch (Exception e) {
log.error("订单接收OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
return R.failed("failed:" + e.getMessage());
if (vo.getFile1().equals("fileOne")) {
if (ArrayUtils.isNotEmpty(vo.getFile())) {
for (MultipartFile multipartFile : vo.getFile()) {
String fileName = System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename();
//filePath不传默认存储空间的根目录
//支持的附件格式
String key = fileName;
boolean flag = ossUtil.uploadFileByStream(multipartFile.getInputStream(), key, null);
if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
TOrderEnclosure orderEnclosure = new TOrderEnclosure();
orderEnclosure.setOrderNo(vo.getOrderNo());
orderEnclosure.setEnclosureName(multipartFile.getOriginalFilename());
orderEnclosure.setEnclosureFlag(CommonConstants.TWO_INTEGER);
orderEnclosure.setEnclosureAddress(key);
orderEnclosure.setDeleteFlag(CommonConstants.ZERO_INT);
try {
tOrderEnclosureService.save(orderEnclosure);
} catch (Exception e) {
log.error("订单接收OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
return R.failed("failed:" + e.getMessage());
}
} else {
return R.failed(OrderConstants.OPERATE_FAILED);
}
} else {
return R.failed(OrderConstants.OPERATE_FAILED);
}
}
}
}
}
if (vo.getFile1().equals("fileTwo")) {
if (ArrayUtils.isNotEmpty(vo.getFile())) {
for (MultipartFile multipartFile : vo.getFile()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment