Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ecea7d0644
|
|
@ -26,4 +26,6 @@ public interface BmContractService {
|
|||
BmContract disclaimer();
|
||||
|
||||
BmContract getContract(BmContract bmContract);
|
||||
|
||||
List<BmContract> getContractUrl(BmContract bmContract);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -199,7 +199,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();
|
||||
|
||||
|
|
@ -261,17 +262,19 @@ public class OrderController extends BaseController {
|
|||
}
|
||||
|
||||
@ApiOperation(value = "购物车协议(查看)-word方式")
|
||||
@GetMapping("/bookCarAgreement")
|
||||
public AjaxResult bookCarAgreement(OrderInfoDto orderInfoDto, Map<String, String> replacements) throws ParseException, IOException {
|
||||
@PostMapping("/bookCarAgreement")
|
||||
public AjaxResult bookCarAgreement(@RequestBody OrderInfoDto orderInfoDto) throws ParseException, IOException {
|
||||
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);
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH);
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Map<String, String> replacements = new HashMap<>();
|
||||
//装备所属公司
|
||||
replacements.put("${czcompanyName}", orderInfoDto.getCzcompanyName());
|
||||
//承租方所属公司
|
||||
|
|
|
|||
Loading…
Reference in New Issue