|
@@ -608,8 +608,9 @@ public class ExcelTabController extends BladeController {
|
|
|
@ApiImplicitParams(value = {
|
|
|
@ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
|
|
|
})
|
|
|
- public R getExcelHtmlByBuss(Long pkeyId) throws IOException {
|
|
|
-
|
|
|
+ public R getExcelHtmlByBuss(Long pkeyId) throws Exception {
|
|
|
+ String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
if (wbsTreeContract == null) {
|
|
@@ -618,9 +619,16 @@ public class ExcelTabController extends BladeController {
|
|
|
if (wbsTreeContract.getHtmlUrl() == null) {
|
|
|
return R.fail("暂无表单!");
|
|
|
}
|
|
|
- File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
-// File file1 = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1578963584895942656.html");
|
|
|
- FileInputStream fileInputStream = new FileInputStream(file1);
|
|
|
+
|
|
|
+ String fileUrl = wbsTreeContract.getHtmlUrl();
|
|
|
+ File file1 = ResourceUtil.getFile(fileUrl);
|
|
|
+ InputStream fileInputStream = null;
|
|
|
+ if(file1.exists()){
|
|
|
+ fileInputStream = new FileInputStream(file1);;
|
|
|
+ }else{
|
|
|
+ String path = sys_file_net_url+fileUrl.replaceAll("//","/").replaceAll(file_path,"");
|
|
|
+ fileInputStream = CommonUtil.getOSSInputStream(path);
|
|
|
+ }
|
|
|
|
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
@@ -686,10 +694,10 @@ public class ExcelTabController extends BladeController {
|
|
|
// }
|
|
|
// }
|
|
|
WbsTreeContract process = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery()
|
|
|
- .eq(WbsTreeContract::getId,wbsTreeContract.getParentId())
|
|
|
- .eq(WbsTreeContract::getContractId,wbsTreeContract.getContractId())
|
|
|
- .eq(WbsTreeContract::getWbsId,wbsTreeContract.getWbsId()).last( "limit 1"));
|
|
|
- if(process!=null) {
|
|
|
+ .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
|
|
|
+ .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId())
|
|
|
+ .eq(WbsTreeContract::getWbsId, wbsTreeContract.getWbsId()).last("limit 1"));
|
|
|
+ if (process != null) {
|
|
|
this.excelTabService.gsColor(pkeyId, process.getPKeyId().toString(), wbsTreeContract.getProjectId(), doc);
|
|
|
}
|
|
|
doc.select("Col").remove();
|