Commit 093a68ee authored by fangxinjiang's avatar fangxinjiang

项目订单 附件上传

parent 328adaf6
......@@ -52,7 +52,7 @@ public class EkpOrderController {
@Schema(description = "接收处理ekp订单")
@PostMapping(value = "/receiveOrder")
public R receiveOrder(OrderAddVO vo) throws IOException {
return tOrderService.receiveOrder(vo);
return tOrderService.receiveOrder(vo,ekpOrderFileTask);
}
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrder;
import com.yifu.cloud.plus.v1.yifu.order.util.EkpOrderFileTask;
import com.yifu.cloud.plus.v1.yifu.order.vo.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -95,10 +96,11 @@ public interface TOrderService extends IService<TOrder> {
*
* @author licancan
* @param vo
* @param ekpOrderFileTask
* @return {@link R}
* @throws IOException
*/
R receiveOrder(OrderAddVO vo) throws IOException;
R receiveOrder(OrderAddVO vo, EkpOrderFileTask ekpOrderFileTask) throws IOException;
/**
* 接收处理ekp订单回复
......@@ -118,6 +120,8 @@ public interface TOrderService extends IService<TOrder> {
*/
void receiveOrderNew(InputStream inputStream, String file1, String orderNo, String fileName, String originalFileName) throws IOException;
void receiveOrderFileAsc(InputStream inputStream, String orderNo, String fileName, String originalFileName);
/**
* 订单作废
*
......
......@@ -31,6 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.order.service.TOrderEnclosureService;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderHandlerService;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderReplyService;
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.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.order.vo.*;
import lombok.extern.slf4j.Slf4j;
......@@ -466,12 +467,13 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
*
* @author licancan
* @param vo
* @param ekpOrderFileTask
* @return {@link R}
* @throws IOException
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R receiveOrder(OrderAddVO vo) throws IOException{
public R receiveOrder(OrderAddVO vo, EkpOrderFileTask ekpOrderFileTask) throws IOException{
if (Common.isEmpty(vo.getOrderNo())){
return R.failed(OrderConstants.ORDER_NO_IS_EMPTY);
......@@ -558,12 +560,10 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
fileName = System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename();
//filePath不传默认存储空间的根目录
//支持的附件格式
getObjectR(multipartFile.getInputStream(),vo.getOrderNo(),fileName,multipartFile.getOriginalFilename(),CommonConstants.ZERO_INT);
ekpOrderFileTask.receiveOrderFileAsc(multipartFile.getInputStream(),vo.getOrderNo(),fileName,multipartFile.getOriginalFilename());
}
}
return R.ok(OrderConstants.OPERATE_SUCCESS);
}
......@@ -657,14 +657,15 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
}
/**
* @Author fxj
* @Description 附件上传
* @Date 9:38 2023/6/26
* @Param
* @return
**/
* 接收处理ekp订单回复
*
* @author licancan
* @return {@link R}
* @throws IOException
*/
@Override
public void receiveOrderNew(InputStream inputStream, String file1, String orderNo, String fileName, String originalFileName){
R<Object> e;
if (file1.equals("fileOne")) {
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.TWO_INTEGER);
}
......@@ -695,6 +696,18 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.ELEVEN_INTEGER);
}
}
/**
* 接收处理ekp订单回复
*
* @author licancan
* @return {@link R}
* @throws IOException
*/
@Override
public void receiveOrderFileAsc(InputStream inputStream, String orderNo, String fileName, String originalFileName){
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.TWO_INTEGER);
}
private R<Object> getObjectR(InputStream inputStream, String orderNo, String fileName, String originalFileName,Integer enclosureflag) {
//filePath不传默认存储空间的根目录
......
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;
......@@ -38,4 +37,9 @@ public class EkpOrderFileTask {
}
}
}
@Async
public void receiveOrderFileAsc(InputStream inputStream,String orderNo, String fileName, String originalFileName){
orderService.receiveOrderFileAsc(inputStream,orderNo,fileName,originalFileName);
}
}
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