This commit is contained in:
sxu 2024-12-18 13:29:03 +08:00
parent ba1ad4b4df
commit e24e9d36b6
1 changed files with 8 additions and 1 deletions

View File

@ -32,6 +32,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -190,6 +191,9 @@ public class OrderController extends BaseController {
bmContract.setStatus(1); bmContract.setStatus(1);
bmContract.setOwnerCom(orderInfoDto.getCompanyId().longValue()); bmContract.setOwnerCom(orderInfoDto.getCompanyId().longValue());
List<BmContract> list = bmContractService.getContractUrl(bmContract); List<BmContract> list = bmContractService.getContractUrl(bmContract);
if (CollectionUtils.isEmpty(list)) {
return AjaxResult.error("请先上传合同");
}
String wordUrl = list.get(0).getBmFileInfoList().get(0).getFileUrl(); String wordUrl = list.get(0).getBmFileInfoList().get(0).getFileUrl();
InputStream inputStream = new URL(wordUrl).openStream(); InputStream inputStream = new URL(wordUrl).openStream();
@ -258,6 +262,9 @@ public class OrderController extends BaseController {
bmContract.setStatus(1); bmContract.setStatus(1);
bmContract.setOwnerCom(orderInfoDto.getCompanyId().longValue()); bmContract.setOwnerCom(orderInfoDto.getCompanyId().longValue());
List<BmContract> list = bmContractService.getContractUrl(bmContract); List<BmContract> list = bmContractService.getContractUrl(bmContract);
if (CollectionUtils.isEmpty(list)) {
return AjaxResult.error("请先上传合同");
}
String wordUrl = list.get(0).getBmFileInfoList().get(0).getFileUrl(); String wordUrl = list.get(0).getBmFileInfoList().get(0).getFileUrl();
InputStream inputStream = new URL(wordUrl).openStream(); InputStream inputStream = new URL(wordUrl).openStream();
XWPFDocument document = new XWPFDocument(inputStream); XWPFDocument document = new XWPFDocument(inputStream);
@ -271,7 +278,7 @@ public class OrderController extends BaseController {
//订单金额 //订单金额
replacements.put("${cost}", orderInfoDto.getCost().toString()); replacements.put("${cost}", orderInfoDto.getCost().toString());
//订单详情 //订单详情
StrBuilder orderDetail = new StrBuilder(); StringBuilder orderDetail = new StringBuilder();
List<OrderDetailDto> detailsList = orderInfoDto.getDetailsList(); List<OrderDetailDto> detailsList = orderInfoDto.getDetailsList();
for (OrderDetailDto orderDetailDto : detailsList) { for (OrderDetailDto orderDetailDto : detailsList) {
Date rentBeginTime = inputFormat.parse(orderDetailDto.getRentBeginTime().toString()); Date rentBeginTime = inputFormat.parse(orderDetailDto.getRentBeginTime().toString());