租赁协议

This commit is contained in:
liang.chao 2024-12-18 10:29:32 +08:00
parent 3def5e57ca
commit 398e076594
3 changed files with 18 additions and 2 deletions

View File

@ -26,4 +26,6 @@ public interface BmContractService {
BmContract disclaimer();
BmContract getContract(BmContract bmContract);
List<BmContract> getContractUrl(BmContract bmContract);
}

View File

@ -132,6 +132,18 @@ public class BmContractServiceImpl implements BmContractService {
return bmContractMapper.getContract(bmContract);
}
@Override
public List<BmContract> getContractUrl(BmContract bmContract) {
List<BmContract> list = bmContractMapper.list(bmContract);
for (BmContract contract : list) {
BmFileInfo bmFileInfo = new BmFileInfo();
bmFileInfo.setModelId(Long.valueOf(contract.getId())).setTaskType(MaterialConstants.APPENDICES_OF_CONTRACT).setFileType(0L);
List<BmFileInfo> bmFileInfos = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo);
contract.setBmFileInfoList(bmFileInfos);
}
return list;
}
private String getString() {
//根据前台传过来的数据生成需求编号
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");

View File

@ -182,7 +182,8 @@ public class OrderController extends BaseController {
List<OrderDetailDto> orderDetailsByOrderId = orderMapper.selectOrderDetailsByOderId(orderId);
BmContract bmContract = new BmContract();
bmContract.setStatus(1);
List<BmContract> list = bmContractService.list(bmContract);
bmContract.setOwnerCom(orderInfoDto.getCompanyId().longValue());
List<BmContract> list = bmContractService.getContractUrl(bmContract);
String wordUrl = list.get(0).getBmFileInfoList().get(0).getFileUrl();
InputStream inputStream = new URL(wordUrl).openStream();
@ -249,7 +250,8 @@ public class OrderController extends BaseController {
if (orderInfoDto != null) {
BmContract bmContract = new BmContract();
bmContract.setStatus(1);
List<BmContract> list = bmContractService.list(bmContract);
bmContract.setOwnerCom(orderInfoDto.getCompanyId().longValue());
List<BmContract> list = bmContractService.getContractUrl(bmContract);
String wordUrl = list.get(0).getBmFileInfoList().get(0).getFileUrl();
InputStream inputStream = new URL(wordUrl).openStream();
XWPFDocument document = new XWPFDocument(inputStream);