Commit bc362f75 authored by fangxinjiang's avatar fangxinjiang

项目订单 附件上传

parent 70014766
package com.yifu.cloud.plus.v1.yifu.order.controller; package com.yifu.cloud.plus.v1.yifu.order.controller;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.order.constants.OrderConstants;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService; import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService;
import com.yifu.cloud.plus.v1.yifu.order.util.EkpOrderFileTask;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderAddVO; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderAddVO;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderAttVo; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderAttVo;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderReplyAddVO; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderReplyAddVO;
...@@ -9,11 +13,17 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -9,11 +13,17 @@ import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File;
import java.io.IOException; import java.io.IOException;
/** /**
...@@ -29,7 +39,8 @@ import java.io.IOException; ...@@ -29,7 +39,8 @@ import java.io.IOException;
public class EkpOrderController { public class EkpOrderController {
@Resource @Resource
private TOrderService tOrderService; private TOrderService tOrderService;
@Autowired
private EkpOrderFileTask ekpOrderFileTask;
/** /**
* 接收处理ekp订单 * 接收处理ekp订单
* *
...@@ -41,9 +52,6 @@ public class EkpOrderController { ...@@ -41,9 +52,6 @@ public class EkpOrderController {
@Schema(description = "接收处理ekp订单") @Schema(description = "接收处理ekp订单")
@PostMapping(value = "/receiveOrder") @PostMapping(value = "/receiveOrder")
public R receiveOrder(OrderAddVO vo) throws IOException { public R receiveOrder(OrderAddVO vo) throws IOException {
log.error("vo.getCreateTime()111="+vo.getCreateTime());
log.error("vo.getCreateTime()222="+vo.getDeptNo());
log.error("vo.getCreateTime()333="+vo.getOrderNo());
return tOrderService.receiveOrder(vo); return tOrderService.receiveOrder(vo);
} }
...@@ -59,7 +67,26 @@ public class EkpOrderController { ...@@ -59,7 +67,26 @@ public class EkpOrderController {
@Schema(description = "接收处理ekp附件") @Schema(description = "接收处理ekp附件")
@PostMapping(value = "/receiveOrderNew") @PostMapping(value = "/receiveOrderNew")
public R receiveOrder(OrderAttVo vo) throws IOException { public R receiveOrder(OrderAttVo vo) throws IOException {
tOrderService.receiveOrderNew(vo); if (Common.isEmpty(vo.getOrderNo())){
return R.failed(OrderConstants.ORDER_NO_IS_EMPTY);
}
if (ArrayUtils.isNotEmpty(vo.getFile())){
if (vo.getFile().length > CommonConstants.TWENTY_INT){
return R.failed(OrderConstants.ENCLOSURE_SIZE_ERROR);
}
String fileName;
for (MultipartFile multipartFile : vo.getFile()) {
if(!Common.checkInsuranceFile(multipartFile.getOriginalFilename())){
return R.failed(OrderConstants.ENCLOSURE_TYPE_IS_ERROR);
}
if (multipartFile.getSize() > (CommonConstants.FIFTY_INT*CommonConstants.BYTE*CommonConstants.BYTE)){
return R.failed(OrderConstants.ENCLOSURE_SIZE_ERROR);
}
fileName = System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename();
ekpOrderFileTask.receiveOrderNew(multipartFile.getInputStream(),vo.getFile1(),vo.getOrderNo(),fileName
,multipartFile.getOriginalFilename());
}
}
return R.ok(); return R.ok();
} }
......
...@@ -10,6 +10,7 @@ import com.yifu.cloud.plus.v1.yifu.order.vo.*; ...@@ -10,6 +10,7 @@ import com.yifu.cloud.plus.v1.yifu.order.vo.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.util.List; import java.util.List;
/** /**
...@@ -99,27 +100,23 @@ public interface TOrderService extends IService<TOrder> { ...@@ -99,27 +100,23 @@ public interface TOrderService extends IService<TOrder> {
*/ */
R receiveOrder(OrderAddVO vo) throws IOException; R receiveOrder(OrderAddVO vo) throws IOException;
/** /**
* 接收处理ekp附件 * 接收处理ekp订单回复
* *
* @author licancan * @author licancan
* @param vo * @param vo
* @return {@link R} * @return {@link R}
* @throws IOException * @throws IOException
*/ */
R receiveOrderNew(OrderAttVo vo ) throws IOException; R receiveOrderReply(OrderReplyAddVO vo) throws IOException;
/** /**
* 接收处理ekp订单回复 * 接收处理ekp附件
* *
* @author licancan * @author licancan
* @param vo
* @return {@link R} * @return {@link R}
* @throws IOException * @throws IOException
*/ */
R receiveOrderReply(OrderReplyAddVO vo) throws IOException; void receiveOrderNew(InputStream inputStream, String file1, String orderNo, String fileName, String originalFileName) throws IOException;
/** /**
* 订单作废 * 订单作废
......
...@@ -45,6 +45,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -45,6 +45,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.net.URL; import java.net.URL;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
...@@ -677,323 +678,68 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme ...@@ -677,323 +678,68 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
* 接收处理ekp订单回复 * 接收处理ekp订单回复
* *
* @author licancan * @author licancan
* @param vo
* @return {@link R} * @return {@link R}
* @throws IOException * @throws IOException
*/ */
@Override @Override
public R receiveOrderNew(OrderAttVo vo) throws IOException{ public void receiveOrderNew(InputStream inputStream, String file1, String orderNo,String fileName,String originalFileName){
if (Common.isEmpty(vo.getOrderNo())){ R<Object> e;
return R.failed(OrderConstants.ORDER_NO_IS_EMPTY); if (file1.equals("fileOne")) {
} getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.TWO_INTEGER);
if (ArrayUtils.isNotEmpty(vo.getFile())){
if (vo.getFile().length > CommonConstants.TWENTY_INT){
return R.failed(OrderConstants.ENCLOSURE_SIZE_ERROR);
}
for (MultipartFile multipartFile : vo.getFile()) {
if(!Common.checkInsuranceFile(multipartFile.getOriginalFilename())){
return R.failed(OrderConstants.ENCLOSURE_TYPE_IS_ERROR);
}
if (multipartFile.getSize() > (CommonConstants.FIFTY_INT*CommonConstants.BYTE*CommonConstants.BYTE)){
return R.failed(OrderConstants.ENCLOSURE_SIZE_ERROR);
}
}
}
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);
}
}
}
}
if (vo.getFile1().equals("fileTwo")) {
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.THREE_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);
}
}
}
}
if (vo.getFile1().equals("fileThree")) {
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.FOUR_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);
}
}
}
}
if (vo.getFile1().equals("fileFour")) {
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.FIVE_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);
}
}
}
}
if (vo.getFile1().equals("fileFive")) {
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.SIX_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);
}
}
}
} if (vo.getFile1().equals("fileSix")) {
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.SEVEN_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 { if (file1.equals("fileTwo")) {
return R.failed(OrderConstants.OPERATE_FAILED); getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.THREE_INTEGER);
} }
if (file1.equals("fileThree")) {
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.FOUR_INTEGER);
} }
if (file1.equals("fileFour")) {
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.FIVE_INTEGER);
} }
if (file1.equals("fileFive")) {
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.SIX_INTEGER);
} if (file1.equals("fileSix")) {
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.SEVEN_INTEGER);
} }
if (vo.getFile1().equals("fileSeven")) { if (file1.equals("fileSeven")) {
if (ArrayUtils.isNotEmpty(vo.getFile())) { getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.EIGHT_INTEGER);
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.EIGHT_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 { if (file1.equals("fileEight")) {
return R.failed(OrderConstants.OPERATE_FAILED); getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.NINE_INTEGER);
} }
if (file1.equals("fileNine")) {
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.TEN_INTEGER);
} }
if (file1.equals("fileTen")) {
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.ELEVEN_INTEGER);
} }
} }
if (vo.getFile1().equals("fileEight")) {
if (ArrayUtils.isNotEmpty(vo.getFile())) { private R<Object> getObjectR(InputStream inputStream, String orderNo, String fileName, String originalFileName,Integer enclosureflag) {
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.NINE_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);
}
}
}
}
if (vo.getFile1().equals("fileNine")) {
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.TEN_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);
}
}
}
}
if (vo.getFile1().equals("fileTen")) {
if (ArrayUtils.isNotEmpty(vo.getFile())) {
for (MultipartFile multipartFile : vo.getFile()) {
String fileName = System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename();
//filePath不传默认存储空间的根目录 //filePath不传默认存储空间的根目录
//支持的附件格式 //支持的附件格式
String key = fileName; boolean flag = ossUtil.uploadFileByStream(inputStream, fileName, null);
boolean flag = ossUtil.uploadFileByStream(multipartFile.getInputStream(), key, null);
if (flag) { if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!"); log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
TOrderEnclosure orderEnclosure = new TOrderEnclosure(); TOrderEnclosure orderEnclosure = new TOrderEnclosure();
orderEnclosure.setOrderNo(vo.getOrderNo()); orderEnclosure.setOrderNo(orderNo);
orderEnclosure.setEnclosureName(multipartFile.getOriginalFilename()); orderEnclosure.setEnclosureName(originalFileName);
orderEnclosure.setEnclosureFlag(CommonConstants.ELEVEN_INTEGER); orderEnclosure.setEnclosureFlag(enclosureflag);
orderEnclosure.setEnclosureAddress(key); orderEnclosure.setEnclosureAddress(fileName);
orderEnclosure.setDeleteFlag(CommonConstants.ZERO_INT); orderEnclosure.setDeleteFlag(CommonConstants.ZERO_INT);
try { try {
tOrderEnclosureService.save(orderEnclosure); tOrderEnclosureService.save(orderEnclosure);
} catch (Exception e) { } catch (Exception e) {
log.error("订单接收OSS文件上传接口异常:" + e.getMessage()); log.error("订单接收OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key); ossUtil.deleteObject(null, fileName);
return R.failed("failed:" + e.getMessage()); return R.failed("failed:" + e.getMessage());
} }
} else { } else {
return R.failed(OrderConstants.OPERATE_FAILED); return R.failed(OrderConstants.OPERATE_FAILED);
} }
} return null;
}
} }
return R.ok(OrderConstants.OPERATE_SUCCESS);
}
public R invalidOrder(String id) { public R invalidOrder(String id) {
TOrder one = baseMapper.selectById(id); TOrder one = baseMapper.selectById(id);
if (Common.isNotNull(one) && CommonConstants.ZERO_INT != one.getOrderStatus()) { if (Common.isNotNull(one) && CommonConstants.ZERO_INT != one.getOrderStatus()) {
......
package com.yifu.cloud.plus.v1.yifu.order.util;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderAttVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.io.InputStream;
/**
* @Author fxj
* @Date 2023/6/25
* @Description
* @Version 1.0
*/
@Slf4j
@Component
public class EkpOrderFileTask {
@Autowired
TOrderService orderService;
/**
* @Author fxj
* @Description 订单附件上传
* @Date 15:58 2023/6/25
* @Param
* @return
**/
@Async
public void receiveOrderNew(InputStream inputStream, String file1, String orderNo, String fileName, String originalFileName){
synchronized (this){
try {
orderService.receiveOrderNew(inputStream,file1,orderNo,fileName,originalFileName);
} catch (IOException e) {
log.error("订单附件上传异常:",e);
}
}
}
}
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