Merge branch 'fix_foton_20231031' into 'dev_20230829_change'

Fix foton 20231031

See merge request laws-foton-slrs/foton-slrs-system-rest!138
This commit is contained in:
高嵩
2023-11-20 01:06:53 +00:00
5 changed files with 110 additions and 19 deletions
@@ -47,6 +47,7 @@ import com.adc.da.util.LoginUserUtil;
import com.adc.da.workFlow.entity.*; import com.adc.da.workFlow.entity.*;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -1148,6 +1149,31 @@ public class WorkFlowController extends BaseController {
return Result.success(); return Result.success();
} }
@ApiOperation(value = "根据在线文件Id查询所有onlyoffice历史文件")
@GetMapping("/getAllOnlyOfficeHisFileById")
public ResponseMessage<List<Map<String,String>>> getAllOnlyOfficeHisFileById(String fileId, String fileName) {
List<Map<String, String>> fileList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
LambdaQueryWrapper<OnlineFileLog> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OnlineFileLog::getHisId,fileId);
wrapper.eq(OnlineFileLog::getValidFlag, "0");
wrapper.orderByDesc(OnlineFileLog::getCreateTime);
List<OnlineFileLog> onlineFileLogList = onlineFileLogDao.selectList(wrapper);
if (onlineFileLogList.size() > 0) {
for (OnlineFileLog onlineFileLog : onlineFileLogList) {
Map<String, String> map = new HashMap<>();
map.put("id", onlineFileLog.getId());
map.put("fileName", fileName);
map.put("attFileId", onlineFileLog.getAttFileId());
map.put("createTime", sdf.format(onlineFileLog.getCreateTime()));
map.put("fileKey", onlineFileLog.getFilekey());
fileList.add(map);
}
return Result.success(fileList);
}
return Result.error("历史文件为空");
}
@ApiOperation(value = "查询问题和回答") @ApiOperation(value = "查询问题和回答")
@GetMapping("/selectWenDan") @GetMapping("/selectWenDan")
public Map<String,Object> selectWenDan(@RequestParam("taskId") String taskId) { public Map<String,Object> selectWenDan(@RequestParam("taskId") String taskId) {
@@ -1458,7 +1484,8 @@ public class WorkFlowController extends BaseController {
String s = ""; String s = "";
if (StringUtils.isBlank(prcName) || StringUtils.isBlank(json) || StringUtils.isBlank(sort)) { if (StringUtils.isBlank(prcName) || StringUtils.isBlank(json) || StringUtils.isBlank(sort)) {
return Result.error("参数为空"); return Result.error("参数为空");
} else { }
else {
prcName = sort + "-" + prcName + "-计划立项"; prcName = sort + "-" + prcName + "-计划立项";
} }
JSONObject jsonObject = JSON.parseObject(json); JSONObject jsonObject = JSON.parseObject(json);
@@ -1489,26 +1516,31 @@ public class WorkFlowController extends BaseController {
} }
} }
}else { }else {
s = workFlowFeignClient.endPrcName(prcName, esId); if ("4".equals(jsonObject.getString("type")) || "3".equals(jsonObject.getString("type"))) {
String[] split = s.split("-"); s = workFlowFeignClient.endPrcName(prcName, esId);
List<String> asList = Arrays.asList(split); if (StringUtils.isBlank(s)) {
if(split[0].equals("成功")){ return Result.error();
if(asList.size()>1){ }
String[] split = s.split("-");
List<String> asList = Arrays.asList(split);
if(split[0].equals("成功")){
if(asList.size()>1){
EndPrcName endPrcName = new EndPrcName();
Map<String, String> objectObjectMap = new HashMap<>();
objectObjectMap.put("ids",split[1]);
objectObjectMap.put("prcCreateUser","xxx");
String s1 = JSONObject.toJSONString(objectObjectMap);
endPrcName.setIds(s1);
endPrcName.setIsNot("1");
return Result.success(endPrcName);
}
EndPrcName endPrcName = new EndPrcName(); EndPrcName endPrcName = new EndPrcName();
Map<String, String> objectObjectMap = new HashMap<>(); endPrcName.setIsNot("2");
objectObjectMap.put("ids",split[1]); endPrcName.setIds("xxx");
objectObjectMap.put("prcCreateUser","xxx");
String s1 = JSONObject.toJSONString(objectObjectMap);
endPrcName.setIds(s1);
endPrcName.setIsNot("1");
return Result.success(endPrcName); return Result.success(endPrcName);
}else {
return Result.error();
} }
EndPrcName endPrcName = new EndPrcName();
endPrcName.setIsNot("2");
endPrcName.setIds("xxx");
return Result.success(endPrcName);
}else {
return Result.error();
} }
} }
return Result.success(); return Result.success();
@@ -154,6 +154,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
addInterceptor.excludePathPatterns("/api/OtConvert/convertFileToFileId"); addInterceptor.excludePathPatterns("/api/OtConvert/convertFileToFileId");
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarNew"); addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarNew");
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarNewOnlyOffice");
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarWaterMarkNew"); addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarWaterMarkNew");
addInterceptor.excludePathPatterns("/api/att/attFile/uploadNew"); addInterceptor.excludePathPatterns("/api/att/attFile/uploadNew");
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/importSarBussionessStandFile"); addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/importSarBussionessStandFile");
@@ -199,6 +200,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
// 政策资料导出接口 // 政策资料导出接口
addInterceptor.excludePathPatterns("/api/lawss/sarLawsInformation/exportLawsInformationInfo"); addInterceptor.excludePathPatterns("/api/lawss/sarLawsInformation/exportLawsInformationInfo");
// 获取onlyOffice历史文件接口
addInterceptor.excludePathPatterns("/api/lawss/activiti/getAllOnlyOfficeHisFileById");
// 内外部会议模板下载 // 内外部会议模板下载
addInterceptor.excludePathPatterns("/api/lawss/insideOutsideMeeting/exportTemplateFile"); addInterceptor.excludePathPatterns("/api/lawss/insideOutsideMeeting/exportTemplateFile");
@@ -211,7 +215,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
// 标准体系列表导出 // 标准体系列表导出
addInterceptor.excludePathPatterns("/api/lawss/sarMenuStandardLimit/standardSystemListExport"); addInterceptor.excludePathPatterns("/api/lawss/sarMenuStandardLimit/standardSystemListExport");
// // 添加自定义拦截器,并拦截对应 url // 添加自定义拦截器,并拦截对应 url
addInterceptor.addPathPatterns("/**"); addInterceptor.addPathPatterns("/**");
} }
} }
@@ -53,6 +53,7 @@ import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO; import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO;
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage; import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo; import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog;
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService; import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
import com.adc.da.slrs.sarUser.dao.TsUserDao; import com.adc.da.slrs.sarUser.dao.TsUserDao;
import com.adc.da.slrs.sarUser.service.ITsUserService; import com.adc.da.slrs.sarUser.service.ITsUserService;
@@ -347,6 +348,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
} }
} }
} }
// 添加删除记录
String content = "标准号:" + sarBussionessStand.getStandCode() + ""+ sarBussionessStand.getStandName() + "" + "删除成功";
sarUpdLogEOService.createBaseLog(id,"BUSINESS",content);
if(elasflag) { if(elasflag) {
//删除成功后将索引中对应数据删除 //删除成功后将索引中对应数据删除
StandLawsEO standLawsEO = new StandLawsEO(); StandLawsEO standLawsEO = new StandLawsEO();
@@ -2318,6 +2318,20 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
personCollectEODao.deleteByResId(id); personCollectEODao.deleteByResId(id);
// 删除分享表中数据 // 删除分享表中数据
personShareEODao.deleteByResId(id); personShareEODao.deleteByResId(id);
// 添加删除记录
String standCode = getDelStandInfoList.getStandSort() + " " + getDelStandInfoList.getStandNumber() + "-" + getDelStandInfoList.getStandYear();
String content = "标准号:" + standCode + ""+ getDelStandInfoList.getStandName() + "" + "删除成功";
try {
if ("INLAND".equals(getDelStandInfoList.getStandType())) {
sarUpdLogEOService.createBaseLog(id,"INLAND_STAND",content);
} else if ("FOREIGN".equals(getDelStandInfoList.getStandType())) {
sarUpdLogEOService.createBaseLog(id,"FOREIGN_STAND",content);
} else {
sarUpdLogEOService.createBaseLog(id,"OTHER_STAND",content);
}
} catch (Exception e) {
logger.error("添加删除记录失败", e);
}
if (elasflag) { if (elasflag) {
//删除成功后,将索引中对应数据删除 //删除成功后,将索引中对应数据删除
StandLawsEO standLawsEO = new StandLawsEO(); StandLawsEO standLawsEO = new StandLawsEO();
@@ -363,6 +363,43 @@ public class AttFileEOController {
} }
} }
@ApiOperation(value = "|File|在线编辑防止加密的接口下载文件")
@GetMapping("/downloadFileForSarNewOnlyOffice")
// @RequiresPermissions("sys:file:downloadFileForSar")
public void downloadFileForSarNewOnlyOffice(String fileId, HttpServletResponse response, HttpServletRequest request) throws Exception {
if(StringUtils.isNotBlank(fileId)){
if(!fileId.contains("ATT_FILE_")){
Map<String, String> bussMap = new HashMap<>();
bussMap.put("ONLINEID",fileId);
String id = createOnlineAttIdFileMQUtil.CreateOnlineAttIdFileMQ(bussMap);
if(StringUtils.isNotBlank(id)) {
fileId = id;
}
}
}
AttFileEO attFileEO = attFileEOService.getFileInfo(fileId);
InputStream is = null;
OutputStream os = null;
response.reset();
try {
String fileOldName = fileNameEncoding(attFileEO.getOldFileName(),request);
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
response.setHeader("Content-Disposition", "attachment;filename=\""+fileOldName+"\"");
response.setContentType("application/octet-stream");
File file = new File(filePath+attFileEO.getFilePath()+attFileEO.getFileName());
is = new FileInputStream(file);
os = response.getOutputStream();
IOUtils.copy(is, os);
os.flush();
} catch (IOException e) {
logger.error(e.getMessage(), e);
} finally {
IOUtils.closeQuietly(is);
IOUtils.closeQuietly(os);
}
}
@ApiOperation(value = "|File|下载文件加水印") @ApiOperation(value = "|File|下载文件加水印")
@GetMapping("/downloadFileForSarWaterMark") @GetMapping("/downloadFileForSarWaterMark")
// @RequiresPermissions("sys:file:downloadFileForSar") // @RequiresPermissions("sys:file:downloadFileForSar")