mq批量文件pdf+导出全部功能
This commit is contained in:
+7
@@ -74,4 +74,11 @@ public class SarBussStandFileController extends BaseController<SarBussStandFile>
|
||||
public ResponseMessage<List<SarBussStandFile>> batchUpdateSarBussFile() throws Exception {
|
||||
return sarBussStandFileEOService.batchUpdateSarBussFile();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarBussStandFileEO|批量修改加密文件不能打开问题")
|
||||
@GetMapping("/batchUpdateSarBussFileMQ")
|
||||
/*@RequiresPermissions("lawss:sarLawsFile:list")*/
|
||||
public ResponseMessage<List<SarBussStandFile>> batchUpdateSarBussFileMQ() throws Exception {
|
||||
return sarBussStandFileEOService.batchUpdateSarBussFileMQ();
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -19,4 +19,6 @@ public interface ISarBussStandFileService extends IService<SarBussStandFile> {
|
||||
List<SarBussStandFile> selectFileByAttId(String attId) throws Exception;
|
||||
|
||||
ResponseMessage<List<SarBussStandFile>> batchUpdateSarBussFile();
|
||||
|
||||
ResponseMessage<List<SarBussStandFile>> batchUpdateSarBussFileMQ();
|
||||
}
|
||||
|
||||
+50
-3
@@ -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.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -43,6 +44,9 @@ public class SarBussStandFileServiceImpl extends ServiceImpl<SarBussStandFileDao
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Autowired
|
||||
private CreateOnlineEditingFileMQService createOnlineEditingFileMQService;
|
||||
|
||||
@Override
|
||||
public List<SarBussStandFile> selectFileByAttId(String attId) throws Exception{
|
||||
return sarStandFileEODao.selectFileByAttId(attId);
|
||||
@@ -93,4 +97,47 @@ public class SarBussStandFileServiceImpl extends ServiceImpl<SarBussStandFileDao
|
||||
logger.info("======================================转换完成================================="+objects.toString());
|
||||
return Result.success(objects);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage<List<SarBussStandFile>> batchUpdateSarBussFileMQ() {
|
||||
List<SarBussStandFile> sarBussStandFileArrayList = new ArrayList<>();
|
||||
QueryWrapper<SarBussStandFile> objectQueryWrapper = new QueryWrapper<>();
|
||||
objectQueryWrapper.eq("USE_MODEL","SOURCE_FILE");
|
||||
objectQueryWrapper.ne("FILE_SUFFIX","pdf");
|
||||
objectQueryWrapper.ne("FILE_SUFFIX","PDF");
|
||||
List<SarBussStandFile> sarBussStandFiles = sarStandFileEODao.selectList(objectQueryWrapper);
|
||||
if(!sarBussStandFiles.isEmpty()){
|
||||
for (SarBussStandFile data :sarBussStandFiles) {
|
||||
QueryWrapper<SarBussStandFile> QueryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper.eq("ORI_ATT_ID",data.getOriAttId());
|
||||
QueryWrapper.eq("USE_MODEL", "WEB_FILE");
|
||||
List<SarBussStandFile> 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<String, String> 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);
|
||||
}
|
||||
}
|
||||
|
||||
+24
@@ -158,6 +158,30 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(exportName+".xlsx",request));
|
||||
response.setContentType("application/force-download");
|
||||
//导出数据
|
||||
if(StringUtils.isNotBlank(exportContent)){
|
||||
if(exportContent.contains("pageSize") ){
|
||||
exportContent = "";
|
||||
SarBussionessStandEOPage page = new SarBussionessStandEOPage();
|
||||
page.setPage(1);
|
||||
int count = sarBussionessStandEOService.count();
|
||||
page.setPageSize(count);
|
||||
page.setValidFlag("0");
|
||||
page.setUserId(userId);
|
||||
page.setIsKU("1");
|
||||
List<SarBussionessStand> 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<SarBussionessStandExport> datas = sarBussionessStandEOService.getSarBussionessStand(exportType,exportContent,userId);
|
||||
workbook = BussStandExportUtil.exportDatas(datas);
|
||||
os = response.getOutputStream();
|
||||
|
||||
+83
-81
@@ -398,41 +398,42 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
if ("apart".equals(exportType)) {
|
||||
page.setIdlist(exportContent.split(","));
|
||||
} else {
|
||||
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<TsResource> qw = new QueryWrapper<>();
|
||||
qw.eq("ID",page.getMenuId());
|
||||
qw.isNull("PARENT_ID");
|
||||
List<TsResource> 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<TsResource> qw = new QueryWrapper<>();
|
||||
qw.eq("ID", page.getMenuId());
|
||||
qw.isNull("PARENT_ID");
|
||||
List<TsResource> children = iTsResourceService.list(qw);
|
||||
|
||||
if(children.isEmpty() && !page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "tsr".equals(treeType)){
|
||||
List<String> 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<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
} else {
|
||||
page.setMenuRoleList(null);
|
||||
}
|
||||
List<String> 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<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
} else {
|
||||
page.setMenuRoleList(null);
|
||||
}
|
||||
List<String> ids = iSarMenuStandardService.getChildMenuList(page.getMenuId());
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
}
|
||||
List<String> 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<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
} else {
|
||||
page.setMenuRoleList(null);
|
||||
}
|
||||
List<String> ids = iSarMenuStandardService.getChildMenuList(page.getMenuId());
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
}
|
||||
|
||||
// if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
||||
// List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||
@@ -446,14 +447,15 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
// page.setMenuAllChildrenIdList(ids);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
|
||||
List<SarAdvanceSearchVO> 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<SarAdvanceSearchVO> 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<SarBussionessStan
|
||||
objectQueryWrapperSarBussStandFile.eq("USE_MODEL", "WEB_FILE");
|
||||
List<SarBussStandFile> 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<String, String> 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<String, String> 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转换失败=================================");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user