From 61c5225319249e0be0a96abe472f238ef2d0f3f5 Mon Sep 17 00:00:00 2001 From: gaojiabao Date: Thu, 15 Jun 2023 15:04:57 +0800 Subject: [PATCH 01/12] =?UTF-8?q?39=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SarStandardsInfoController.java | 82 ++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java index 4d5e6efc..6c2c4ddf 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java @@ -29,6 +29,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.ApiOperation; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.hssf.usermodel.HSSFSheet; @@ -75,7 +82,6 @@ public class SarStandardsInfoController extends BaseController @Autowired private ISarStandFileService sarStandFileService; - @Value("${file.path}") private String filePath; @@ -1047,4 +1053,78 @@ public class SarStandardsInfoController extends BaseController public ResponseMessage fileNameTranslation (){ return sarStandardsInfoEOService.fileNameTranslation(); } + + @ApiOperation(value = "|SarStandardsInfoEO|编号+名称组合为唯一标识(国内海外)") + @PostMapping("/ceshi") + public ResponseMessage ceshi (String docx,String urlInfo){ + String e7FAFC9C22A8 = onlyofficePdfUtil("E7FAFC9C22A8", "1111111.pdf", docx,urlInfo); + return Result.success(e7FAFC9C22A8); + } + + private String onlyofficePdfUtil(String key,String title,String urlFile,String urlInfo){ + HttpClient client = HttpClients.createDefault(); + Map cmd = new HashMap<>(); + cmd.put("async",false); + cmd.put("filetype","docx"); + cmd.put("key",key); + cmd.put("title",title); + cmd.put("url",urlFile); + //http://47.92.92.38:8103/7.2.1-34/ConvertService.ashx + //https://example.com/url-to-example-document.docx + //String url = "http://47.92.92.38:8103/url-to-example-document.docx"; +// String url = "http://47.92.92.38:8103/7.2.1-34/downloadas"; + String url = ""; + if(urlInfo.equals("1")){ + url = "http://47.92.92.38:8103/7.2.1-34/ConvertService.ashx"; + } + if(urlInfo.equals("11")){ + url = "https://47.92.92.38:8103/7.2.1-34/ConvertService.ashx"; + } + if(urlInfo.equals("2")){ + url = "http://47.92.92.38:8103/url-to-example-document.docx"; + } + if(urlInfo.equals("22")){ + url = "http://47.92.92.38:8103/7.2.1-34/url-to-example-document.docx"; + } + if(urlInfo.equals("222")){ + url = "https://47.92.92.38:8103/url-to-example-document.docx"; + } + if(urlInfo.equals("2222")){ + url = "https://47.92.92.38:8103/7.2.1-34/url-to-example-document.docx"; + } + if(urlInfo.equals("3")){ + url = "https://example.com/url-to-example-document.docx"; + } + if(urlInfo.equals("33")){ + url = "http://example.com/url-to-example-document.docx"; + } + if(urlInfo.equals("333")){ + url = "http://example.com/7.2.1-34/url-to-example-document.docx"; + } + if(urlInfo.equals("3333")){ + url = "https://example.com/7.2.1-34/url-to-example-document.docx"; + } + //HttpGet httpGet=new HttpGet(url); + HttpPost httpPost=new HttpPost(url); + JSONObject jsonObject = null; + try { + httpPost.setHeader("Accept","application/json"); + httpPost.setHeader("Content-Type","Content-Type"); + HttpResponse res = client.execute(httpPost); + if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + // 返回json格式: + final String s = EntityUtils.toString(res.getEntity()); + jsonObject = JSONObject.parseObject(EntityUtils.toString(res.getEntity())); + jsonObject.get("fileUrl"); + + System.out.println(jsonObject); + }else { + jsonObject.put("fileUrl","失败!!!!!!"); + } + } catch (Exception e) { + System.out.println("服务间接口调用出错!"); + e.printStackTrace(); + } + return jsonObject.toJSONString(); + } } From 573890103fb027cef202029532ec35529fcb80e4 Mon Sep 17 00:00:00 2001 From: gaojiabao Date: Thu, 15 Jun 2023 15:31:13 +0800 Subject: [PATCH 02/12] =?UTF-8?q?39=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SarStandardsInfoController.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java index 6c2c4ddf..fcca9cfc 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java @@ -1075,34 +1075,34 @@ public class SarStandardsInfoController extends BaseController // String url = "http://47.92.92.38:8103/7.2.1-34/downloadas"; String url = ""; if(urlInfo.equals("1")){ - url = "http://47.92.92.38:8103/7.2.1-34/ConvertService.ashx"; + url = "http://39.98.140.126:8889/7.2.1-34/ConvertService.ashx"; } if(urlInfo.equals("11")){ - url = "https://47.92.92.38:8103/7.2.1-34/ConvertService.ashx"; + url = "https://39.98.140.126:8889/7.2.1-34/ConvertService.ashx"; } if(urlInfo.equals("2")){ - url = "http://47.92.92.38:8103/url-to-example-document.docx"; + url = "http://39.98.140.126:8889/url-to-example-document.docx"; } if(urlInfo.equals("22")){ - url = "http://47.92.92.38:8103/7.2.1-34/url-to-example-document.docx"; + url = "http://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx"; } if(urlInfo.equals("222")){ - url = "https://47.92.92.38:8103/url-to-example-document.docx"; + url = "https://39.98.140.126:8889/url-to-example-document.docx"; } if(urlInfo.equals("2222")){ - url = "https://47.92.92.38:8103/7.2.1-34/url-to-example-document.docx"; + url = "https://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx"; } if(urlInfo.equals("3")){ - url = "https://example.com/url-to-example-document.docx"; + url = "https://39.98.140.126:8889/url-to-example-document.docx"; } if(urlInfo.equals("33")){ - url = "http://example.com/url-to-example-document.docx"; + url = "http://39.98.140.126:8889/url-to-example-document.docx"; } if(urlInfo.equals("333")){ - url = "http://example.com/7.2.1-34/url-to-example-document.docx"; + url = "http://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx"; } if(urlInfo.equals("3333")){ - url = "https://example.com/7.2.1-34/url-to-example-document.docx"; + url = "https://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx"; } //HttpGet httpGet=new HttpGet(url); HttpPost httpPost=new HttpPost(url); From ede83fe43ea1d742ed0b7b76144a085c88b76577 Mon Sep 17 00:00:00 2001 From: gaojiabao Date: Fri, 16 Jun 2023 13:49:20 +0800 Subject: [PATCH 03/12] =?UTF-8?q?39=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SarStandardsInfoController.java | 66 ++++++++++++------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java index fcca9cfc..e02c3374 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java @@ -4,6 +4,8 @@ package com.adc.da.slrs.sarStandardsInfo.controller; import cn.hutool.core.util.ZipUtil; import com.adc.da.Log.BusinessType; import com.adc.da.Log.EpcLog; +import com.adc.da.att.service.IAttFileEOService; +import com.adc.da.att.vo.AttFileVo; import com.adc.da.common.FileUnZip; import com.adc.da.common.ReadExcel; import com.adc.da.exception.AdcDaBaseException; @@ -95,6 +97,9 @@ public class SarStandardsInfoController extends BaseController @Autowired ISarLawsInfoService sarLawsInfoEOService; + @Autowired + IAttFileEOService iAttFileEOService; + // @ApiOperation(value="SarStandardsInfoEO|反向标准操作") // @GetMapping(value = "/reverseQueryStand") // public void reverseQueryStand(@RequestParam(name="ids",required=true) String ids, String standName, String type) { @@ -1074,36 +1079,37 @@ public class SarStandardsInfoController extends BaseController //String url = "http://47.92.92.38:8103/url-to-example-document.docx"; // String url = "http://47.92.92.38:8103/7.2.1-34/downloadas"; String url = ""; + //"url": "https://127.0.0.1/document/example.docx" + if(urlInfo.equals("1")){ - url = "http://39.98.140.126:8889/7.2.1-34/ConvertService.ashx"; - } - if(urlInfo.equals("11")){ - url = "https://39.98.140.126:8889/7.2.1-34/ConvertService.ashx"; + url = "http://47.92.92.38:8103/7.2.1-34/ConvertService.ashx"; } if(urlInfo.equals("2")){ - url = "http://39.98.140.126:8889/url-to-example-document.docx"; - } - if(urlInfo.equals("22")){ - url = "http://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx"; - } - if(urlInfo.equals("222")){ - url = "https://39.98.140.126:8889/url-to-example-document.docx"; - } - if(urlInfo.equals("2222")){ - url = "https://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx"; + url = "http://39.98.140.126:8889/7.2.1-34/ConvertService.ashx"; } if(urlInfo.equals("3")){ - url = "https://39.98.140.126:8889/url-to-example-document.docx"; + url = "http://10.100.5.116:8088//7.2.1-34/ConvertService.ashx"; + } + + if(urlInfo.equals("11")){ + url = "http://47.92.92.38:8103/7.2.1-34/document/example.docx"; + } + if(urlInfo.equals("22")){ + url = "http://39.98.140.126:8889/7.2.1-34/document/example.docx"; } if(urlInfo.equals("33")){ - url = "http://39.98.140.126:8889/url-to-example-document.docx"; + url = "http://10.100.5.116:8088//7.2.1-34/document/example.docx"; + } + if(urlInfo.equals("111")){ + url = "http://47.92.92.38:8103/document/example.docx"; + } + if(urlInfo.equals("222")){ + url = "http://39.98.140.126:8889/document/example.docx"; } if(urlInfo.equals("333")){ - url = "http://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx"; - } - if(urlInfo.equals("3333")){ - url = "https://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx"; + url = "http://10.100.5.116:8088/document/example.docx"; } + //HttpGet httpGet=new HttpGet(url); HttpPost httpPost=new HttpPost(url); JSONObject jsonObject = null; @@ -1113,10 +1119,24 @@ public class SarStandardsInfoController extends BaseController HttpResponse res = client.execute(httpPost); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { // 返回json格式: - final String s = EntityUtils.toString(res.getEntity()); jsonObject = JSONObject.parseObject(EntityUtils.toString(res.getEntity())); - jsonObject.get("fileUrl"); - + Object fileUrl = jsonObject.get("fileUrl"); + logger.info("==============================================================="+jsonObject.toJSONString()); + if(fileUrl!=null){ + String urlStr = fileUrl.toString(); + if(StringUtils.isNotBlank(urlStr)){ + File file = new File(urlStr); + if(file.exists()){ + AttFileVo attFileVo = iAttFileEOService.saveFileInfo(file); + if(attFileVo!=null){ + logger.info("==============================================================="+attFileVo); + } + }else { + logger.info("===============================================================路径"+urlStr); + } + } + logger.info("==============================================================="+jsonObject.toJSONString()); + } System.out.println(jsonObject); }else { jsonObject.put("fileUrl","失败!!!!!!"); From e535793bde9e4a40498d6176a57079d8291dfc85 Mon Sep 17 00:00:00 2001 From: gaojiabao Date: Fri, 16 Jun 2023 16:38:33 +0800 Subject: [PATCH 04/12] =?UTF-8?q?mq=E6=89=B9=E9=87=8F=E6=96=87=E4=BB=B6pdf?= =?UTF-8?q?+=E5=AF=BC=E5=87=BA=E5=85=A8=E9=83=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SarBussStandFileController.java | 7 + .../service/ISarBussStandFileService.java | 2 + .../impl/SarBussStandFileServiceImpl.java | 53 +++++- .../SarBussionessStandController.java | 24 +++ .../impl/SarBussionessStandServiceImpl.java | 164 +++++++++--------- 5 files changed, 166 insertions(+), 84 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java index 22e08474..f439f28e 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java @@ -74,4 +74,11 @@ public class SarBussStandFileController extends BaseController public ResponseMessage> batchUpdateSarBussFile() throws Exception { return sarBussStandFileEOService.batchUpdateSarBussFile(); } + + @ApiOperation(value = "|SarBussStandFileEO|批量修改加密文件不能打开问题") + @GetMapping("/batchUpdateSarBussFileMQ") + /*@RequiresPermissions("lawss:sarLawsFile:list")*/ + public ResponseMessage> batchUpdateSarBussFileMQ() throws Exception { + return sarBussStandFileEOService.batchUpdateSarBussFileMQ(); + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java index 1e14182b..56c2d4f9 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java @@ -19,4 +19,6 @@ public interface ISarBussStandFileService extends IService { List selectFileByAttId(String attId) throws Exception; ResponseMessage> batchUpdateSarBussFile(); + + ResponseMessage> batchUpdateSarBussFileMQ(); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java index dba442bf..339249e0 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java @@ -1,25 +1,26 @@ package com.adc.da.slrs.sarBussStandFile.service.impl; +import com.adc.da.att.entity.AttFileEO; import com.adc.da.att.service.IAttFileEOService; import com.adc.da.att.vo.AttFileVo; import com.adc.da.common.UseModuleEnum; import com.adc.da.http.ResponseMessage; import com.adc.da.http.Result; +import com.adc.da.mq.CreateOnlineEditingFileMQService; import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile; import com.adc.da.slrs.sarBussStandFile.dao.SarBussStandFileDao; import com.adc.da.slrs.sarBussStandFile.service.ISarBussStandFileService; import com.adc.da.slrs.sarBussionessStand.service.impl.SarBussionessStandServiceImpl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; /** *

@@ -43,6 +44,9 @@ public class SarBussStandFileServiceImpl extends ServiceImpl selectFileByAttId(String attId) throws Exception{ return sarStandFileEODao.selectFileByAttId(attId); @@ -93,4 +97,47 @@ public class SarBussStandFileServiceImpl extends ServiceImpl> batchUpdateSarBussFileMQ() { + List sarBussStandFileArrayList = new ArrayList<>(); + QueryWrapper objectQueryWrapper = new QueryWrapper<>(); + objectQueryWrapper.eq("USE_MODEL","SOURCE_FILE"); + objectQueryWrapper.ne("FILE_SUFFIX","pdf"); + objectQueryWrapper.ne("FILE_SUFFIX","PDF"); + List sarBussStandFiles = sarStandFileEODao.selectList(objectQueryWrapper); + if(!sarBussStandFiles.isEmpty()){ + for (SarBussStandFile data :sarBussStandFiles) { + QueryWrapper QueryWrapper = new QueryWrapper<>(); + QueryWrapper.eq("ORI_ATT_ID",data.getOriAttId()); + QueryWrapper.eq("USE_MODEL", "WEB_FILE"); + List sarBussStandFileList = sarStandFileEODao.selectList(QueryWrapper); + if(sarBussStandFileList.isEmpty() && sarBussStandFileList.size()==0){ + AttFileEO fileInfo = attFileEOService.getFileInfo(sarBussStandFiles.get(0).getOriAttId()); + if(fileInfo!=null){ + String fileName = ""; + if(StringUtils.isNotBlank(fileInfo.getFileName())){ + String[] splitInfo = fileInfo.getFileName().split("\\."); + fileName = splitInfo[0]; + } + Map bussMap = new HashMap<>(); + bussMap.put("FILE_SUFFIX",sarBussStandFiles.get(0).getFileSuffix()); + bussMap.put("CONVERFILENAME",filePath+fileInfo.getFilePath()+fileInfo.getFileName()); + bussMap.put("SAVEPDFPATH",filePath+fileInfo.getFilePath()+fileName+".pdf"); + bussMap.put("STANDID",sarBussStandFiles.get(0).getStandId()); + bussMap.put("STANDFILECLASSIFY",sarBussStandFiles.get(0).getStandFileClassify()); + bussMap.put("FILENAME",filePath+fileInfo.getFilePath()+fileName+".pdf"); + bussMap.put("PASSWORD",sarBussStandFiles.get(0).getPassword()); + bussMap.put("OAIATTID",sarBussStandFiles.get(0).getOriAttId()); + logger.info("======================================word.doc发送mq================================="); + createOnlineEditingFileMQService.OnlineEditingFileMQ(bussMap); + sarBussStandFileArrayList.add(data); + }else { + logger.info("======================================word.doc转换失败================================="); + } + } + } + } + return Result.success(sarBussStandFileArrayList); + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java index ebffc100..26b95169 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java @@ -158,6 +158,30 @@ public class SarBussionessStandController extends BaseController rows = sarBussionessStandEOService.getSarBussionStandPage(page); + if(!rows.isEmpty()){ + for (SarBussionessStand data: rows){ + if(StringUtils.isNotBlank(exportContent)){ + exportContent = exportContent+","+data.getId(); + }else { + exportContent = data.getId(); + } + } + } + + } + exportType = "apart"; + } List datas = sarBussionessStandEOService.getSarBussionessStand(exportType,exportContent,userId); workbook = BussStandExportUtil.exportDatas(datas); os = response.getOutputStream(); diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java index 754e34af..413f9fef 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java @@ -398,41 +398,42 @@ public class SarBussionessStandServiceImpl extends ServiceImpl qw = new QueryWrapper<>(); - qw.eq("ID",page.getMenuId()); - qw.isNull("PARENT_ID"); - List children = iTsResourceService.list(qw); + if(StringUtils.isNotBlank(exportContent)) { + JSONObject jsonObject = JSONObject.fromObject(exportContent); + page = (SarBussionessStandEOPage) JSONObject.toBean(jsonObject, SarBussionessStandEOPage.class); + page.setPage(1); + page.setPageSize(10000); + //查询当前登录人角色拥有权限的菜单 + if (page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())) { + String treeType = page.getTreeType(); + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("ID", page.getMenuId()); + qw.isNull("PARENT_ID"); + List children = iTsResourceService.list(qw); - if(children.isEmpty() && !page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "tsr".equals(treeType)){ - List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); - if (getMenuIdList != null && !getMenuIdList.isEmpty()) { - page.setMenuRoleList(getMenuIdList); - } else { - page.setMenuRoleList(null); + if (children.isEmpty() && !page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "tsr".equals(treeType)) { + List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); + if (getMenuIdList != null && !getMenuIdList.isEmpty()) { + page.setMenuRoleList(getMenuIdList); + } else { + page.setMenuRoleList(null); + } + List ids = iTsResourceService.getChildMenuList(page.getMenuId()); + if (ids != null && !ids.isEmpty()) { + page.setMenuAllChildrenIdList(ids); + } + } else if (!page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "sarMs".equals(treeType)) { + List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); + if (getMenuIdList != null && !getMenuIdList.isEmpty()) { + page.setMenuRoleList(getMenuIdList); + } else { + page.setMenuRoleList(null); + } + List ids = iSarMenuStandardService.getChildMenuList(page.getMenuId()); + if (ids != null && !ids.isEmpty()) { + page.setMenuAllChildrenIdList(ids); + } } - List ids = iTsResourceService.getChildMenuList(page.getMenuId()); - if (ids != null && !ids.isEmpty()) { - page.setMenuAllChildrenIdList(ids); - } - }else if(!page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "sarMs".equals(treeType)){ - List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); - if (getMenuIdList != null && !getMenuIdList.isEmpty()) { - page.setMenuRoleList(getMenuIdList); - } else { - page.setMenuRoleList(null); - } - List ids = iSarMenuStandardService.getChildMenuList(page.getMenuId()); - if (ids != null && !ids.isEmpty()) { - page.setMenuAllChildrenIdList(ids); - } - } // if(children.isEmpty() && !page.getMenuId().equals("nomenu")){ // List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); @@ -446,14 +447,15 @@ public class SarBussionessStandServiceImpl extends ServiceImpl searchList = com.alibaba.fastjson.JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class); - String advanceStr = SarAdvanceSearchUtil.createSql(searchList,"SAR_BUSS_STAND_ATTR_INFO"); - if (com.adc.da.util.utils.StringUtils.isNotBlank(advanceStr)) { - page.setAdvanceSearchStr(advanceStr); - } else { - page.setAdvanceSearchStr(null); + } + if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) { + List searchList = com.alibaba.fastjson.JSONObject.parseArray(page.getAdvanceSearchVOStr(), SarAdvanceSearchVO.class); + String advanceStr = SarAdvanceSearchUtil.createSql(searchList, "SAR_BUSS_STAND_ATTR_INFO"); + if (com.adc.da.util.utils.StringUtils.isNotBlank(advanceStr)) { + page.setAdvanceSearchStr(advanceStr); + } else { + page.setAdvanceSearchStr(null); + } } } } @@ -4920,49 +4922,49 @@ public class SarBussionessStandServiceImpl extends ServiceImpl sarBussStandFilesList = sarBussStandFileEODao.selectList(objectQueryWrapperSarBussStandFile); if(sarBussStandFilesList.isEmpty() && sarBussStandFilesList.size()==0){ - AttFileVo attFileVo = attFileEOService.wordConversionFilePdf(sarBussStandFiles.get(0).getOriAttId()); - if(attFileVo!=null){ - SarBussStandFile sarBussStandFile = new SarBussStandFile(); - //sarBussStandFile.setId(); - String uuId = com.adc.da.util.utils.UUID.randomUUID(20); - sarBussStandFile.setId(uuId); - sarBussStandFile.setStandId(sarBussStandFiles.get(0).getStandId()); - sarBussStandFile.setStandFileClassify(sarBussStandFiles.get(0).getStandFileClassify()); - sarBussStandFile.setAttId(attFileVo.getId()); - sarBussStandFile.setFileName(filePath+attFileVo.getFilePath()+attFileVo.getFileName()); - sarBussStandFile.setFileSuffix(attFileVo.getFileSuffix()); - sarBussStandFile.setUseModel(UseModuleEnum.WEB_FILE.getValue()); - sarBussStandFile.setPassword(sarBussStandFiles.get(0).getPassword()); - sarBussStandFile.setValidFlag(0); - sarBussStandFile.setCreationTime(new Date()); - sarBussStandFile.setModifyTime(new Date()); - sarBussStandFile.setOriAttId(sarBussStandFiles.get(0).getOriAttId()); - sarBussStandFileEODao.insert(sarBussStandFile); - }else { - logger.info("======================================word.doc转换失败================================="); - } -// AttFileEO fileInfo = attFileEOService.getFileInfo(sarBussStandFiles.get(0).getOriAttId()); -// if(fileInfo!=null){ -// String fileName = ""; -// if(StringUtils.isNotBlank(fileInfo.getFileName())){ -// String[] splitInfo = fileInfo.getFileName().split("\\."); -// fileName = splitInfo[0]; -// } -// -// Map bussMap = new HashMap<>(); -// bussMap.put("FILE_SUFFIX",sarBussStandFiles.get(0).getFileSuffix()); -// bussMap.put("CONVERFILENAME",filePath+fileInfo.getFilePath()+fileInfo.getFileName()); -// bussMap.put("SAVEPDFPATH",filePath+fileInfo.getFilePath()+fileName+".pdf"); -// bussMap.put("STANDID",sarBussStandFiles.get(0).getStandId()); -// bussMap.put("STANDFILECLASSIFY",sarBussStandFiles.get(0).getStandFileClassify()); -// bussMap.put("FILENAME",filePath+fileInfo.getFilePath()+fileName+".pdf"); -// bussMap.put("PASSWORD",sarBussStandFiles.get(0).getPassword()); -// bussMap.put("OAIATTID",sarBussStandFiles.get(0).getOriAttId()); -// logger.info("======================================word.doc发送mq================================="); -// createOnlineEditingFileMQService.OnlineEditingFileMQ(bussMap); +// AttFileVo attFileVo = attFileEOService.wordConversionFilePdf(sarBussStandFiles.get(0).getOriAttId()); +// if(attFileVo!=null){ +// SarBussStandFile sarBussStandFile = new SarBussStandFile(); +// //sarBussStandFile.setId(); +// String uuId = com.adc.da.util.utils.UUID.randomUUID(20); +// sarBussStandFile.setId(uuId); +// sarBussStandFile.setStandId(sarBussStandFiles.get(0).getStandId()); +// sarBussStandFile.setStandFileClassify(sarBussStandFiles.get(0).getStandFileClassify()); +// sarBussStandFile.setAttId(attFileVo.getId()); +// sarBussStandFile.setFileName(filePath+attFileVo.getFilePath()+attFileVo.getFileName()); +// sarBussStandFile.setFileSuffix(attFileVo.getFileSuffix()); +// sarBussStandFile.setUseModel(UseModuleEnum.WEB_FILE.getValue()); +// sarBussStandFile.setPassword(sarBussStandFiles.get(0).getPassword()); +// sarBussStandFile.setValidFlag(0); +// sarBussStandFile.setCreationTime(new Date()); +// sarBussStandFile.setModifyTime(new Date()); +// sarBussStandFile.setOriAttId(sarBussStandFiles.get(0).getOriAttId()); +// sarBussStandFileEODao.insert(sarBussStandFile); // }else { // logger.info("======================================word.doc转换失败================================="); // } + AttFileEO fileInfo = attFileEOService.getFileInfo(sarBussStandFiles.get(0).getOriAttId()); + if(fileInfo!=null){ + String fileName = ""; + if(StringUtils.isNotBlank(fileInfo.getFileName())){ + String[] splitInfo = fileInfo.getFileName().split("\\."); + fileName = splitInfo[0]; + } + + Map bussMap = new HashMap<>(); + bussMap.put("FILE_SUFFIX",sarBussStandFiles.get(0).getFileSuffix()); + bussMap.put("CONVERFILENAME",filePath+fileInfo.getFilePath()+fileInfo.getFileName()); + bussMap.put("SAVEPDFPATH",filePath+fileInfo.getFilePath()+fileName+".pdf"); + bussMap.put("STANDID",sarBussStandFiles.get(0).getStandId()); + bussMap.put("STANDFILECLASSIFY",sarBussStandFiles.get(0).getStandFileClassify()); + bussMap.put("FILENAME",filePath+fileInfo.getFilePath()+fileName+".pdf"); + bussMap.put("PASSWORD",sarBussStandFiles.get(0).getPassword()); + bussMap.put("OAIATTID",sarBussStandFiles.get(0).getOriAttId()); + logger.info("======================================word.doc发送mq================================="); + createOnlineEditingFileMQService.OnlineEditingFileMQ(bussMap); + }else { + logger.info("======================================word.doc转换失败================================="); + } } } From c8d0cf9a76c15f119d94176a5e67073a561f64b7 Mon Sep 17 00:00:00 2001 From: gaojiabao Date: Fri, 16 Jun 2023 17:03:03 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E6=A0=87=E5=87=86?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=9F=A5=E8=AF=A2=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SarBussionessStandController.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java index 26b95169..07d9a10d 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java @@ -55,6 +55,7 @@ import io.swagger.annotations.Api; import com.adc.da.base.web.BaseController; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; +import springfox.documentation.spring.web.json.Json; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -160,7 +161,6 @@ public class SarBussionessStandController extends BaseController rows = sarBussionessStandEOService.getSarBussionStandPage(page); + exportContent = ""; if(!rows.isEmpty()){ for (SarBussionessStand data: rows){ if(StringUtils.isNotBlank(exportContent)){ From 1a11394e5b6a055050587c2ff031c89247c6ddf5 Mon Sep 17 00:00:00 2001 From: SUNJIABIN Date: Fri, 16 Jun 2023 17:36:04 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=97=B6=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ActSarItemsBussEOService.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsBussEOService.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsBussEOService.java index de331d2d..92edefad 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsBussEOService.java +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsBussEOService.java @@ -402,20 +402,6 @@ public class ActSarItemsBussEOService { standCode = sarBussionessStand.getStandCode(); } - QueryWrapperqueryWrapper = new QueryWrapper<>(); - queryWrapper.eq(sarBussionessStand.getStandCode() != null,"STAND_CODE",sarBussionessStand.getStandCode()) - .eq(sarBussionessStand.getStandName() != null,"STAND_NAME",sarBussionessStand.getStandName()); - List list = iSarBussionessStandService.list(queryWrapper); - Integer valIdFlag = 0; - for (SarBussionessStand stand :list){ - if ((list.size() ==1 && !list.get(0).getId().equals(stand.getId())) || list.size() >1){ - valIdFlag = stand.getValidFlag(); - if (valIdFlag == 0){ - logger.info("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在"); - throw new AdcDaBaseException("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在"); - } - } - } if (StringUtils.isNotBlank(standNum)){ sarBussionessStand.setStandNumber(standNum); @@ -494,6 +480,20 @@ public class ActSarItemsBussEOService { sarUpdLogEOService.createBaseProcessLog(standId,"BUSINESS",content,prcCreateUser); } else {//标准号、ID都不存在的情况 // 新增方法 + QueryWrapperqueryWrapper = new QueryWrapper<>(); + queryWrapper.eq(sarBussionessStand.getStandCode() != null,"STAND_CODE",sarBussionessStand.getStandCode()) + .eq(sarBussionessStand.getStandName() != null,"STAND_NAME",sarBussionessStand.getStandName()); + List list = iSarBussionessStandService.list(queryWrapper); + Integer valIdFlag = 0; + for (SarBussionessStand stand :list){ + if ((list.size() ==1 && !list.get(0).getId().equals(stand.getId())) || list.size() >1){ + valIdFlag = stand.getValidFlag(); + if (valIdFlag == 0){ + logger.info("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在"); + throw new AdcDaBaseException("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在"); + } + } + } sarBussionessStand.setPrcCreateUser(prcCreateUser); sarBussionessStand.setReplaceStandNum(DTQBBHBUSS); // 根据标准号判断数据是否已存在 From 078dfef0bf2d49d97acee6f7877c2bc3c932e752 Mon Sep 17 00:00:00 2001 From: gaojiabao Date: Fri, 16 Jun 2023 17:48:26 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SarBussionessStandController.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java index 07d9a10d..d3d87b51 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java @@ -172,6 +172,8 @@ public class SarBussionessStandController extends BaseController rows = sarBussionessStandEOService.getSarBussionStandPage(page); exportContent = ""; From fecfd518d5d0ee1b9d597dc4b8a879141213438f Mon Sep 17 00:00:00 2001 From: SUNJIABIN Date: Mon, 19 Jun 2023 09:15:34 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E6=96=B0=E5=A2=9E'=E4=BC=81=E6=A0=87?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=8A=82=E7=82=B9=E5=AE=8C=E6=88=90=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=92=8C=E5=85=A5=E5=BA=93=E6=8E=A5=E5=8F=A3=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E5=89=8D=E5=85=88=E6=89=A7=E8=A1=8C=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E5=92=8C=E5=90=8D=E7=A7=B0=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?'=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ActSarItemsBussEOService.java | 22 ------------------- .../SarBussionessStandController.java | 21 ++++++++++++++++++ 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsBussEOService.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsBussEOService.java index 92edefad..dcd7a327 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsBussEOService.java +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsBussEOService.java @@ -480,30 +480,8 @@ public class ActSarItemsBussEOService { sarUpdLogEOService.createBaseProcessLog(standId,"BUSINESS",content,prcCreateUser); } else {//标准号、ID都不存在的情况 // 新增方法 - QueryWrapperqueryWrapper = new QueryWrapper<>(); - queryWrapper.eq(sarBussionessStand.getStandCode() != null,"STAND_CODE",sarBussionessStand.getStandCode()) - .eq(sarBussionessStand.getStandName() != null,"STAND_NAME",sarBussionessStand.getStandName()); - List list = iSarBussionessStandService.list(queryWrapper); - Integer valIdFlag = 0; - for (SarBussionessStand stand :list){ - if ((list.size() ==1 && !list.get(0).getId().equals(stand.getId())) || list.size() >1){ - valIdFlag = stand.getValidFlag(); - if (valIdFlag == 0){ - logger.info("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在"); - throw new AdcDaBaseException("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在"); - } - } - } sarBussionessStand.setPrcCreateUser(prcCreateUser); sarBussionessStand.setReplaceStandNum(DTQBBHBUSS); - // 根据标准号判断数据是否已存在 -// QueryWrapperqueryWrapper = new QueryWrapper<>(); -// queryWrapper.eq(sarBussionessStand.getStandCode() != null,"STAND_CODE",sarBussionessStand.getStandCode()) -// .eq(sarBussionessStand.getStandName() != null,"STAND_NAME",sarBussionessStand.getStandName()); -// Integer count = iSarBussionessStandService.count(queryWrapper); -// if (count > 0){ -// throw new AdcDaBaseException("当前企标标准号和企标名称已存在"); -// } //制定和修订类型 清除历史版本 JSONObject atteObj = JSON.parseObject(sarBussionessStand.getSarStandAttrEOStr()); atteObj.remove("LSBBBUSS"); diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java index d3d87b51..81d47852 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java @@ -734,5 +734,26 @@ public class SarBussionessStandController extends BaseControllerqueryWrapper = new QueryWrapper<>(); + queryWrapper.eq(standCode != null,"STAND_CODE",standCode) + .eq(standName != null,"STAND_NAME",standName); + List list = sarBussionessStandEOService.list(queryWrapper); + Integer valIdFlag = 0; + for (SarBussionessStand stand :list){ + if ((list.size() ==1 && !list.get(0).getId().equals(stand.getId())) || list.size() >1){ + valIdFlag = stand.getValidFlag(); + if (valIdFlag == 0){ + logger.info("企标标准号"+ standCode +"和企标名称"+ standName +"已存在"); + return Result.error("企标标准号"+ standCode +"和企标名称"+ standName +"已存在"); + } + } + } + return Result.success("校验通过"); + } } From bb6ad10c5a28fa6aceebdc98fa11f68235fe86a6 Mon Sep 17 00:00:00 2001 From: SUNJIABIN Date: Mon, 19 Jun 2023 09:54:18 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E6=96=B0=E5=A2=9E'=E4=BC=81=E6=A0=87?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=8A=82=E7=82=B9=E5=AE=8C=E6=88=90=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=92=8C=E5=85=A5=E5=BA=93=E6=8E=A5=E5=8F=A3=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E5=89=8D=E5=85=88=E6=89=A7=E8=A1=8C=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E5=92=8C=E5=90=8D=E7=A7=B0=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?'=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SarBussionessStandController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java index 81d47852..f2a7dca8 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/controller/SarBussionessStandController.java @@ -736,9 +736,9 @@ public class SarBussionessStandController extends BaseControllerqueryWrapper = new QueryWrapper<>(); queryWrapper.eq(standCode != null,"STAND_CODE",standCode) .eq(standName != null,"STAND_NAME",standName); From 11c1a29710ddce2e1988533e90183cdc8c228a64 Mon Sep 17 00:00:00 2001 From: gaojiabao Date: Mon, 19 Jun 2023 13:43:48 +0800 Subject: [PATCH 10/12] =?UTF-8?q?39=20=E6=B5=8B=E8=AF=95=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=BC=96=E8=BE=91=E6=96=87=E4=BB=B6=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WorkFlowController.java | 9 +- .../OnlineFileLog/entity/OnlineFileLog.java | 3 + .../impl/SarBussionessStandServiceImpl.java | 103 ++++-- .../adc/da/utils/util/OnlyofficePdfUtil.java | 310 ++++++++++++++++++ 4 files changed, 394 insertions(+), 31 deletions(-) create mode 100644 adc-da-slrs/src/main/java/com/adc/da/utils/util/OnlyofficePdfUtil.java diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java index a6769c8e..e98b0c20 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java @@ -1041,7 +1041,7 @@ public class WorkFlowController extends BaseController { @ApiOperation(value = "查找在线编辑文件") @GetMapping("/selectOnlineFile") - public ResponseMessage selectOnlineFile(@RequestParam("onlineFileId") String onlineFileId,@RequestParam("standName") String standName) { + public ResponseMessage selectOnlineFile(@RequestParam("onlineFileId") String onlineFileId,@RequestParam("standName") String standName,@RequestParam("key") String key) { logger.info("======================standName===============================!!!!!!!!!!!!!!!!!!!!!!"+standName); String path = standEditFilePath+"/hisFile/"; File file = null; @@ -1091,6 +1091,7 @@ public class WorkFlowController extends BaseController { onlineFileLog.setCreateTime(new Date()); onlineFileLog.setFileName(String.valueOf(time)); onlineFileLog.setValidFlag("0"); + onlineFileLog.setFilekey(key); onlineFileLogDao.insert(onlineFileLog); logger.info("======================日志存入成功==============================="+onlineFileLog.toString()); if(StringUtils.isNotBlank(standName)) { @@ -1516,4 +1517,10 @@ public class WorkFlowController extends BaseController { public String fushen(){ return workFlowFeignClient.fushen(); } + + @ApiOperation(value = "|在线文件调用api") + @PostMapping("/conversionOnlineFilePDF") + public void conversionOnlineFilePDF(){ + // return workFlowFeignClient.conversionOnlineFilePDF(); + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/OnlineFileLog/entity/OnlineFileLog.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/OnlineFileLog/entity/OnlineFileLog.java index ee0ee521..4afe07b8 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/OnlineFileLog/entity/OnlineFileLog.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/OnlineFileLog/entity/OnlineFileLog.java @@ -67,6 +67,9 @@ public class OnlineFileLog extends BaseEntity { @TableField("VALID_FLAG") private String validFlag; + @ApiModelProperty(value = "文件key") + @TableField("FILE_KEY") + private String filekey; //跨服io流转换 @TableField(exist = false) private byte[] bytes; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java index 413f9fef..e766f5be 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java @@ -219,6 +219,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl sarBussStandFilesList = sarBussStandFileEODao.selectList(objectQueryWrapperSarBussStandFile); if(sarBussStandFilesList.isEmpty() && sarBussStandFilesList.size()==0){ -// AttFileVo attFileVo = attFileEOService.wordConversionFilePdf(sarBussStandFiles.get(0).getOriAttId()); + //存储的名称,key 路径 + QueryWrapper onlineFileLogWrapper = new QueryWrapper<>(); + onlineFileLogWrapper.eq("ATT_FILE_ID",sarBussStandFilesList.get(0).getOriAttId()); + List onlineFileLogs = onlineFileLogDao.selectList(onlineFileLogWrapper); + if(!onlineFileLogs.isEmpty()){ + if(StringUtils.isNotBlank(onlineFileLogs.get(0).getOLdFileName()) && StringUtils.isNotBlank(onlineFileLogs.get(0).getFilekey()) && StringUtils.isNotBlank(onlineFileLogs.get(0).getFilePath())){ + try { + onlyofficePdfUtil.downloadFile(onlineFileLogs.get(0).getOLdFileName(), onlineFileLogs.get(0).getFilekey(), onlineFileLogs.get(0).getFilePath()); + File file = new File(filePath+"/onlineFile/"+onlineFileLogs.get(0).getOLdFileName()); + if(file.exists()){ + AttFileVo attFileVo = attFileEOService.saveFileInfo(file); + if(attFileVo!=null){ + SarBussStandFile sarBussStandFile = new SarBussStandFile(); + //sarBussStandFile.setId(); + String uuId = com.adc.da.util.utils.UUID.randomUUID(20); + sarBussStandFile.setId(uuId); + sarBussStandFile.setStandId(sarBussStandFiles.get(0).getStandId()); + sarBussStandFile.setStandFileClassify(sarBussStandFiles.get(0).getStandFileClassify()); + sarBussStandFile.setAttId(attFileVo.getId()); + sarBussStandFile.setFileName(filePath+attFileVo.getFilePath()+attFileVo.getFileName()); + sarBussStandFile.setFileSuffix(attFileVo.getFileSuffix()); + sarBussStandFile.setUseModel(UseModuleEnum.WEB_FILE.getValue()); + sarBussStandFile.setPassword(sarBussStandFiles.get(0).getPassword()); + sarBussStandFile.setValidFlag(0); + sarBussStandFile.setCreationTime(new Date()); + sarBussStandFile.setModifyTime(new Date()); + sarBussStandFile.setOriAttId(sarBussStandFiles.get(0).getOriAttId()); + sarBussStandFileEODao.insert(sarBussStandFile); + }else { + logger.info("======================================word.doc转换失败================================="); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + }else { + logger.info("======================未能查询到在线编辑的日志文件================"); + } +// AttFileVo attFileVo = attFileEOService.onlineWordConversionFilePdf(sarBussStandFiles.get(0).getOriAttId()); // if(attFileVo!=null){ // SarBussStandFile sarBussStandFile = new SarBussStandFile(); // //sarBussStandFile.setId(); @@ -4943,28 +4986,28 @@ public class SarBussionessStandServiceImpl extends ServiceImpl bussMap = new HashMap<>(); - bussMap.put("FILE_SUFFIX",sarBussStandFiles.get(0).getFileSuffix()); - bussMap.put("CONVERFILENAME",filePath+fileInfo.getFilePath()+fileInfo.getFileName()); - bussMap.put("SAVEPDFPATH",filePath+fileInfo.getFilePath()+fileName+".pdf"); - bussMap.put("STANDID",sarBussStandFiles.get(0).getStandId()); - bussMap.put("STANDFILECLASSIFY",sarBussStandFiles.get(0).getStandFileClassify()); - bussMap.put("FILENAME",filePath+fileInfo.getFilePath()+fileName+".pdf"); - bussMap.put("PASSWORD",sarBussStandFiles.get(0).getPassword()); - bussMap.put("OAIATTID",sarBussStandFiles.get(0).getOriAttId()); - logger.info("======================================word.doc发送mq================================="); - createOnlineEditingFileMQService.OnlineEditingFileMQ(bussMap); - }else { - logger.info("======================================word.doc转换失败================================="); - } +// AttFileEO fileInfo = attFileEOService.getFileInfo(sarBussStandFiles.get(0).getOriAttId()); +// if(fileInfo!=null){ +// String fileName = ""; +// if(StringUtils.isNotBlank(fileInfo.getFileName())){ +// String[] splitInfo = fileInfo.getFileName().split("\\."); +// fileName = splitInfo[0]; +// } +// +// Map bussMap = new HashMap<>(); +// bussMap.put("FILE_SUFFIX",sarBussStandFiles.get(0).getFileSuffix()); +// bussMap.put("CONVERFILENAME",filePath+fileInfo.getFilePath()+fileInfo.getFileName()); +// bussMap.put("SAVEPDFPATH",filePath+fileInfo.getFilePath()+fileName+".pdf"); +// bussMap.put("STANDID",sarBussStandFiles.get(0).getStandId()); +// bussMap.put("STANDFILECLASSIFY",sarBussStandFiles.get(0).getStandFileClassify()); +// bussMap.put("FILENAME",filePath+fileInfo.getFilePath()+fileName+".pdf"); +// bussMap.put("PASSWORD",sarBussStandFiles.get(0).getPassword()); +// bussMap.put("OAIATTID",sarBussStandFiles.get(0).getOriAttId()); +// logger.info("======================================word.doc发送mq================================="); +// createOnlineEditingFileMQService.OnlineEditingFileMQ(bussMap); +// }else { +// logger.info("======================================word.doc转换失败================================="); +// } } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/utils/util/OnlyofficePdfUtil.java b/adc-da-slrs/src/main/java/com/adc/da/utils/util/OnlyofficePdfUtil.java new file mode 100644 index 00000000..52302513 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/utils/util/OnlyofficePdfUtil.java @@ -0,0 +1,310 @@ +package com.adc.da.utils.util; + + +import com.adc.da.http.ResponseMessage; +import com.adc.da.http.Result; +import com.alibaba.fastjson.JSONObject; +import org.apache.http.HttpEntity; +import org.apache.http.HttpStatus; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.PostMapping; + +import java.io.*; +import java.util.HashMap; +import java.util.Map; + +public class OnlyofficePdfUtil { + + @Value("${file.path}") + private String filePathInfo;//文件存储路径 + + public ResponseMessage downloadFile(String filePdfName, String key, String onlineFilePath) throws Exception { + + String filePath = filePathInfo+"/onlineFile/"+filePdfName; + + System.out.println("================"+filePath); + + String fileUrl = convertFile(key,onlineFilePath); + + System.out.println("=============================="+fileUrl); + + // 创建HttpClientBuilder + + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + + // HttpClient + + CloseableHttpClient closeableHttpClient = httpClientBuilder.build(); + + HttpGet get = new HttpGet(fileUrl); + + // 设置请求和传输超时时间 + + RequestConfig requestConfig = RequestConfig.custom() + + .setSocketTimeout(60000) + + .setConnectionRequestTimeout(60000) + + .setConnectTimeout(60000) + + .build(); + + get.setConfig(requestConfig); + + CloseableHttpResponse response = null; + + try { + + //发送get请求 + + response = closeableHttpClient.execute(get); + + if (response == null || response.getStatusLine() == null) { + + throw new Exception("发送GET请求失败,返回结果为空!"); + + } + + //返回状态是否200 + + int statusCode = response.getStatusLine().getStatusCode(); + + if (statusCode == HttpStatus.SC_OK) { + + //得到请求结果 + + HttpEntity entityRes = response.getEntity(); + + if (entityRes != null) { + + InputStream content = entityRes.getContent(); + + byte[] getData = readInputStream(content); + + File file = new File(filePath); + + FileOutputStream fos = new FileOutputStream(file); + + fos.write(getData); + + fos.close(); + + } + + } else { + + throw new Exception("发送GET请求出错:" + response); + + } + + } catch (Exception e) { + + throw new Exception("发送GET请求出现异常," + e.getMessage()); + + } finally { + + try { + + // 关闭连接释放资源 + + if (response != null) { + + response.close(); + + } + + if (closeableHttpClient != null) { + + closeableHttpClient.close(); + + } + + } catch (IOException e) { + + e.printStackTrace(); + + } + + } + + return Result.success(); + + } + + public String analysisXML(String xmlString) throws DocumentException { + + Document document = DocumentHelper.parseText(xmlString); + + Element rootElement = document.getRootElement(); + + String fileUrl = rootElement.elementText("FileUrl"); + + String newFileUrl = fileUrl.replaceAll("&", "&"); + + return newFileUrl; + + } + + public String convertFile(String key,String onlineFilePath) throws Exception{ + + String url = "http://47.92.92.38:8103/7.2.1-34/ConvertService.ashx"; + + Map map = new HashMap<>(); + + map.put("async",false); + + map.put("filetype","docx"); + + map.put("key",key); + + map.put("outputtype","pdf"); + + map.put("title","test.pdf"); + map.put("url","https://srms.foton.com.cn/file/"+onlineFilePath); + //map.put("url","https://srms.foton.com.cn/file/model/task_768330d8/task_768330d8_top_768330d8_node.docx"); + + JSONObject requestJson = new JSONObject(map); + + // 创建HttpClientBuilder + + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + + // HttpClient + + CloseableHttpClient closeableHttpClient = httpClientBuilder.build(); + + HttpPost httpPost = new HttpPost(url); + + // 设置请求和传输超时时间 + + RequestConfig requestConfig = RequestConfig.custom() + + .setSocketTimeout(60000) + + .setConnectionRequestTimeout(60000) + + .setConnectTimeout(60000) + + .build(); + + httpPost.setConfig(requestConfig); + + CloseableHttpResponse response = null; + + try { + + //设置post请求方式为JSON + + StringEntity data = new StringEntity(String.valueOf(requestJson), "UTF-8"); + + data.setContentType("application/json; charset=UTF-8"); + + httpPost.setEntity(data); + + + + //发送post请求 + + response = closeableHttpClient.execute(httpPost); + + if (response == null || response.getStatusLine() == null) { + + throw new Exception("发送POST请求失败,返回结果为空!"); + + } + + + + //返回状态是否200 + + int statusCode = response.getStatusLine().getStatusCode(); + + if (statusCode == HttpStatus.SC_OK) { + + //得到请求结果 + + HttpEntity entityRes = response.getEntity(); + + if (entityRes != null) { + + String responsetData = EntityUtils.toString(entityRes, "UTF-8"); + + String fileUrl = analysisXML(responsetData); + + return fileUrl; + + } + + } else { + + throw new Exception("发送POST-JSON请求出错:" + response); + + } + + } catch (Exception e) { + + throw new Exception("发送POST请求出现异常," + e.getMessage()); + + } finally { + + try { + + // 关闭连接释放资源 + + if (response != null) { + + response.close(); + + } + + if (closeableHttpClient != null) { + + closeableHttpClient.close(); + + } + + } catch (IOException e) { + + e.printStackTrace(); + + } + + } + + return null; + + } + + public static byte[] readInputStream(InputStream inputStream) throws IOException { + + byte[] buffer = new byte[1024]; + + int len = 0; + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + while((len = inputStream.read(buffer)) != -1) { + + bos.write(buffer, 0, len); + + } + + bos.close(); + + return bos.toByteArray(); + + } +} From 3a523968c9bb6ceabe74187536964d1a763d5ba1 Mon Sep 17 00:00:00 2001 From: gaojiabao Date: Mon, 19 Jun 2023 14:26:17 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SarBussionessStandServiceImpl.java | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java index e766f5be..d3a3d4f0 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java @@ -4965,49 +4965,6 @@ public class SarBussionessStandServiceImpl extends ServiceImpl bussMap = new HashMap<>(); -// bussMap.put("FILE_SUFFIX",sarBussStandFiles.get(0).getFileSuffix()); -// bussMap.put("CONVERFILENAME",filePath+fileInfo.getFilePath()+fileInfo.getFileName()); -// bussMap.put("SAVEPDFPATH",filePath+fileInfo.getFilePath()+fileName+".pdf"); -// bussMap.put("STANDID",sarBussStandFiles.get(0).getStandId()); -// bussMap.put("STANDFILECLASSIFY",sarBussStandFiles.get(0).getStandFileClassify()); -// bussMap.put("FILENAME",filePath+fileInfo.getFilePath()+fileName+".pdf"); -// bussMap.put("PASSWORD",sarBussStandFiles.get(0).getPassword()); -// bussMap.put("OAIATTID",sarBussStandFiles.get(0).getOriAttId()); -// logger.info("======================================word.doc发送mq================================="); -// createOnlineEditingFileMQService.OnlineEditingFileMQ(bussMap); -// }else { -// logger.info("======================================word.doc转换失败================================="); -// } } } From 579b54d2be9f018bb2b0d37561481aa027a23a5c Mon Sep 17 00:00:00 2001 From: gaojiabao Date: Mon, 19 Jun 2023 14:45:43 +0800 Subject: [PATCH 12/12] =?UTF-8?q?39=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SarBussionessStandServiceImpl.java | 5 +---- .../java/com/adc/da/utils/util/OnlyofficePdfUtil.java | 10 +++------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java index d3a3d4f0..af5509ce 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java @@ -219,9 +219,6 @@ public class SarBussionessStandServiceImpl extends ServiceImpl