Merge branch 'develop_master' into FOTON
# Conflicts: # adc-da-main/src/main/resources/application.properties
This commit is contained in:
@@ -0,0 +1,368 @@
|
||||
//package com.adc.da.convert.mq;
|
||||
//
|
||||
//import com.adc.da.att.entity.AttFileEO;
|
||||
//import com.adc.da.att.service.IAttFileEOService;
|
||||
//import com.adc.da.common.SarTypeEnum;
|
||||
//import com.adc.da.common.UseModuleEnum;
|
||||
//import com.adc.da.convert.common.AsposeOfficeConvertUtils;
|
||||
//import com.adc.da.mq.CreateMQService;
|
||||
//import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
|
||||
//import com.adc.da.slrs.otConvertMq.service.IOtConvertMqService;
|
||||
//import com.adc.da.slrs.sarBussStandFile.dao.SarBussStandFileDao;
|
||||
//import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile;
|
||||
//import com.adc.da.slrs.sarLawsFile.dao.SarLawsFileDao;
|
||||
//import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
|
||||
//import com.adc.da.slrs.sarStandFile.dao.SarStandFileDao;
|
||||
//import com.adc.da.slrs.sarStandFile.entity.SarStandFile;
|
||||
//import com.adc.da.sys.util.LoginUserUtil;
|
||||
//import com.adc.da.util.http.ResponseMessage;
|
||||
//import com.adc.da.util.http.Result;
|
||||
//import com.adc.da.util.utils.StringUtils;
|
||||
//import com.adc.da.util.utils.UUID;
|
||||
//import com.rabbitmq.client.Channel;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
//import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
//import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
//import org.springframework.amqp.support.AmqpHeaders;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.messaging.Message;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import java.io.File;
|
||||
//import java.util.Date;
|
||||
//import java.util.Map;
|
||||
//
|
||||
//@Component
|
||||
//public class SendUploadConvertService {
|
||||
//
|
||||
// // 文档转换远程服务IP地址s
|
||||
// @Value("${convert.host}")
|
||||
// private String convertHost;
|
||||
//
|
||||
// @Value("${server.port}")
|
||||
// private String port;
|
||||
//
|
||||
// @Value("${file.path}")
|
||||
// private String localFilePath;
|
||||
//
|
||||
// @Autowired
|
||||
// private IAttFileEOService attFileEOService;
|
||||
//
|
||||
// @Autowired
|
||||
// private CreateMQService convertMq;
|
||||
//
|
||||
// @Autowired
|
||||
// private IOtConvertMqService convertMqEOService;
|
||||
//
|
||||
// @Autowired
|
||||
// private SarStandFileDao sarStandFileEODao;
|
||||
//
|
||||
// @Autowired
|
||||
// private SarBussStandFileDao sarBussStandFileEODao;
|
||||
//
|
||||
// @Autowired
|
||||
// private SarLawsFileDao sarLawsFileDao;
|
||||
//
|
||||
// private static final Logger logger = LoggerFactory.getLogger(SendUploadConvertService.class);
|
||||
//
|
||||
// @RabbitListener(bindings = @QueueBinding(
|
||||
// value = @Queue(value = "createUploadConvertMQ_SQ_GSAR_RELEASE", durable = "true"),
|
||||
// exchange = @Exchange(value = "convertUpload-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
|
||||
// key = "convertUpload-key_SQ_GSAR_RELEASE"))
|
||||
// public void createMQ(Map<String,Object> convertInfo, Message message, Channel channel) throws Exception{
|
||||
// try{
|
||||
// try{
|
||||
// Thread.sleep(5000);
|
||||
// insertConvertMsg(convertInfo);
|
||||
// }catch(InterruptedException e){
|
||||
// logger.error(e.toString());
|
||||
// Thread.currentThread().interrupt();
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// logger.error("文档转换消息队列进入添加数据方法前失败!");
|
||||
// logger.error(e.getMessage(),e);
|
||||
// }finally {
|
||||
// Long tag = (Long) message.getHeaders().get(AmqpHeaders.DELIVERY_TAG);
|
||||
// channel.basicAck(tag,false);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public void insertConvertMsg(Map<String,Object> convertInfo) throws Exception{
|
||||
// docUploadConvert(convertMqEO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @Description 文件转换
|
||||
// * Date 2018/8/21 15:51
|
||||
// * @Param [path]
|
||||
// * @return com.adc.da.util.http.ResponseMessage
|
||||
// **/
|
||||
// public ResponseMessage docUploadConvert(OtConvertMq convertMqEO) throws Exception{
|
||||
// //保存在数据库中的ID
|
||||
// String path = localFilePath + convertMqEO.getFilePath();
|
||||
// path = path.replace("//","/");
|
||||
// String convertId = convertMqEO.getId();
|
||||
// try {
|
||||
// //进入转换方法中,修改OT_CONVERT表中状态为转换中
|
||||
// convertMqEO.setId(convertId);
|
||||
// convertMqEO.setModifyTime(new Date());
|
||||
// convertMqEO.setMqState(3);
|
||||
// convertMqEOService.updateById(convertMqEO);
|
||||
// //开始转换。。。。。。
|
||||
// if(!"".equals(path)){
|
||||
// String converfilename = path.replaceAll("\\\\", "/");
|
||||
// logger.info("*****上传路径:*******"+localFilePath);
|
||||
// logger.info("************文件路径:**********" + convertMqEO.getFilePath());
|
||||
//// logger.info("************接口:**********" + port);
|
||||
// logger.info("*****上传路径替换,加入文件名*******"+converfilename);
|
||||
// //截取文件类型
|
||||
// int index = converfilename.lastIndexOf(".");
|
||||
// String fileType = converfilename.substring(index,converfilename.length());
|
||||
// String fileOriName = converfilename.substring(0,index);
|
||||
//// //调用转换类DocConverter,并将需要转换的文件传递给该类的构造方法
|
||||
//// DocConverterPdf d = new DocConverterPdf(converfilename,fileType);
|
||||
//// d.setConvertHost(convertHost);
|
||||
//// //调用conver方法开始转换,先执行doc2pdf()将office文件转换为pdf;再执行pdf2swf()将pdf转换为swf;
|
||||
//// File getPdf = d.conver(fileType);
|
||||
//// //调用getswfPath()方法,打印转换后的swf文件路径
|
||||
//// String dPath = d.getpdfPath();
|
||||
// String savePdfFileName = converfilename.substring(0, converfilename.lastIndexOf("."));
|
||||
// String savePdfPath = savePdfFileName+".pdf";
|
||||
// AsposeOfficeConvertUtils.convertOfficeFileToPDF(fileType,converfilename,savePdfPath);
|
||||
// File pdfFile = new File(savePdfPath);
|
||||
// logger.info("*****转换后的pdf文件路径*******"+savePdfPath);
|
||||
// //判断是否转换成功,修改数据状态
|
||||
// if(!savePdfPath.isEmpty() && pdfFile.length()>0){
|
||||
// // 上传转换后文件
|
||||
// String pdfId = attFileEOService.saveFileAttId(pdfFile);
|
||||
// logger.info("////////转换后文件id"+pdfId);
|
||||
// int count = 0;
|
||||
// if("0".equals(convertMqEO.getAddOrUp())){
|
||||
// count = insertConvertDocToFiles(convertMqEO,pdfId,fileOriName,fileType);
|
||||
// } else {
|
||||
// //查询之前在资源与文件关联表中是否有转换成功的数据,如果有执行修改,没有执行新增
|
||||
// if(StringUtils.isNotEmpty(convertMqEO.getPdfId())){
|
||||
// count = updateConvertDocToFIles(convertMqEO,pdfId);
|
||||
// } else {
|
||||
// count = insertConvertDocToFiles(convertMqEO,pdfId,fileOriName,fileType);
|
||||
// }
|
||||
// }
|
||||
// convertMqEO.setId(convertId);
|
||||
// if (count>0) {
|
||||
// // 转换成功
|
||||
// convertMqEO.setModifyTime(new Date());
|
||||
// convertMqEO.setMqState(1);
|
||||
// convertMqEOService.updateById(convertMqEO);
|
||||
// } else {
|
||||
// // 转换失败
|
||||
// convertMqEO.setModifyTime(new Date());
|
||||
// convertMqEO.setMqState(2);
|
||||
// convertMqEOService.updateById(convertMqEO);
|
||||
// }
|
||||
// } else {
|
||||
// // 转换失败
|
||||
// convertMqEO.setId(convertId);
|
||||
// convertMqEO.setModifyTime(new Date());
|
||||
// convertMqEO.setMqState(2);
|
||||
// convertMqEOService.updateById(convertMqEO);
|
||||
//// if(convertMqEO.getAgainNum()<=5){
|
||||
//// throw new Exception("转换失败");
|
||||
//// }
|
||||
// }
|
||||
// return Result.success(savePdfPath);
|
||||
// } else {
|
||||
// logger.error("转换时未获取到文件路径!");
|
||||
// return Result.error("文件存储失败,请重试");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// // 转换失败
|
||||
// logger.error("转换过程中失败!");
|
||||
// logger.error(e.getMessage(),e);
|
||||
// convertMqEO.setId(convertId);
|
||||
// convertMqEO.setMqState(2);
|
||||
// convertMqEOService.updateById(convertMqEO);
|
||||
//// this.restartUploadConvert(convertMqEO);
|
||||
// return Result.error("r0072", "文件转换失败,请重试");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public ResponseMessage restartUploadConvert(OtConvertMq convertInfo) throws Exception{
|
||||
// OtConvertMq convertMqEO = new OtConvertMq();
|
||||
// convertMqEO.setLawsId(convertInfo.getLawsId());
|
||||
// convertMqEO.setConvertType(convertInfo.getConvertType());
|
||||
// convertMqEO.setAttId(convertInfo.getAttId());
|
||||
// convertMqEO.setOriAttId(convertInfo.getOriAttId());
|
||||
// convertMqEO.setId(convertInfo.getId());
|
||||
// convertMqEO.setFilePath(convertInfo.getFilePath());
|
||||
// convertMqEO.setAddOrUp(convertInfo.getAddOrUp());
|
||||
// convertMqEO.setPdfId(convertInfo.getPdfId());
|
||||
// convertMqEO.setStandFileClassify(convertInfo.getStandFileClassify());
|
||||
// int countAdd = 0;
|
||||
// convertMqEO.setAddOrUp("1");
|
||||
// int againNumNew = Integer.valueOf(convertInfo.getAgainNum());
|
||||
// convertMqEO.setAgainNum(againNumNew+1);
|
||||
// convertMq.sendMQ(convertMqEO);
|
||||
// return Result.success("true","已重新加入转换","");
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @Author yangxuenan
|
||||
// * @Description 修改标准法规文件表pdf信息
|
||||
// * Date 2018/10/31 17:09
|
||||
// * @Param [convertMq, pdfId]
|
||||
// * @return int
|
||||
// **/
|
||||
// public int updateConvertDocToFIles(OtConvertMq convertMq,String pdfId){
|
||||
// int countSuccess = 0;
|
||||
// if(SarTypeEnum.STAND.getValue().equals(convertMq.getConvertType())){
|
||||
// SarStandFile lawsFile = new SarStandFile();
|
||||
// lawsFile.setId(convertMq.getPdfId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
// countSuccess = sarStandFileEODao.updateByPrimaryKeySelective(lawsFile);
|
||||
// } else if (SarTypeEnum.LAWS_STAND.getValue().equals(convertMq.getConvertType())) {
|
||||
// SarLawsFile lawsFile = new SarLawsFile();
|
||||
// lawsFile.setId(convertMq.getPdfId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// countSuccess = sarLawsFileDao.updateByPrimaryKeySelective(lawsFile);
|
||||
// } else if (SarTypeEnum.BUSINESS.getValue().equals(convertMq.getConvertType())) {
|
||||
// SarBussStandFile lawsFile = new SarBussStandFile();
|
||||
// lawsFile.setId(convertMq.getPdfId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setUseModule(UseModuleEnum.WEB_FILE.getValue());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// countSuccess = sarBussStandFileEODao.updateByPrimaryKeySelective(lawsFile);
|
||||
// }else if (SarTypeEnum.RECORDS.getValue().equals(convertMq.getConvertType())) {
|
||||
//// SarBussRecordsFileEO lawsFile = new SarBussRecordsFileEO();
|
||||
//// lawsFile.setId(convertMq.getPdfId());
|
||||
//// lawsFile.setRecordsId(convertMq.getLawsId());
|
||||
//// lawsFile.setAttId(pdfId);
|
||||
//// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
//// lawsFile.setValidFlag("0");
|
||||
//// lawsFile.setCreationTime(new Date());
|
||||
//// lawsFile.setModifyTime(new Date());
|
||||
//// countSuccess = sarBussRecordsFileEODao.updateByPrimaryKeySelective(lawsFile);
|
||||
// }
|
||||
// else {
|
||||
//// SarFileSplitItemsFileEO lawsFile = new SarFileSplitItemsFileEO();
|
||||
//// lawsFile.setId(convertMq.getPdfId());
|
||||
//// lawsFile.setAttId(pdfId);
|
||||
////// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
//// lawsFile.setModifyTime(new Date());
|
||||
//// countSuccess = sarFileSplitItemsFileEODao.updateByPrimaryKeySelective(lawsFile);
|
||||
// }
|
||||
// return countSuccess;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @Author yangxuenan
|
||||
// * @Description 添加标准法规文件表pdf信息
|
||||
// * Date 2018/10/30 21:52
|
||||
// * @Param [convertMq]
|
||||
// * @return int
|
||||
// **/
|
||||
// public int insertConvertDocToFiles(OtConvertMq convertMq,String pdfId,String fileOriName,String fileType) {
|
||||
// int countSuccess = 0;
|
||||
// String creationUser = LoginUserUtil.getUserId();
|
||||
// if(SarTypeEnum.STAND.getValue().equals(convertMq.getConvertType())){
|
||||
// SarStandFile lawsFile = new SarStandFile();
|
||||
// lawsFile.setId(UUID.randomUUID(20));
|
||||
// lawsFile.setStandId(convertMq.getLawsId());
|
||||
//// lawsFile.setResId(convertMq.getResId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setValidFlag("0");
|
||||
// lawsFile.setCreationUser(creationUser);
|
||||
// lawsFile.setCreationTime(new Date());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
// lawsFile.setStandFileClassify(convertMq.getStandFileClassify());
|
||||
// lawsFile.setFileName(fileOriName+".pdf");
|
||||
// lawsFile.setFileSuffix("pdf");
|
||||
// countSuccess = sarStandFileEODao.insertSelective(lawsFile);
|
||||
// } else if (SarTypeEnum.LAWS_STAND.getValue().equals(convertMq.getConvertType())) {
|
||||
// SarLawsFile lawsFile = new SarLawsFile();
|
||||
// lawsFile.setId(UUID.randomUUID(20));
|
||||
// lawsFile.setLawsId(convertMq.getLawsId());
|
||||
// lawsFile.setResId(convertMq.getResId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
// lawsFile.setValidFlag(0);
|
||||
// lawsFile.setCreationTime(new Date());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// lawsFile.setLawsFileClassify(convertMq.getLawsFileClassify());
|
||||
// lawsFile.setFileName(fileOriName+".pdf");
|
||||
// lawsFile.setFileSuffix("pdf");
|
||||
// countSuccess = sarLawsFileDao.insertSelective(lawsFile);
|
||||
// } else if (SarTypeEnum.BUSINESS.getValue().equals(convertMq.getConvertType())) {
|
||||
// SarBussStandFile lawsFile = new SarBussStandFile();
|
||||
// lawsFile.setId(UUID.randomUUID(20));
|
||||
// lawsFile.setStandId(convertMq.getLawsId());
|
||||
// lawsFile.setResId(convertMq.getResId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setUseModule(UseModuleEnum.WEB_FILE.getValue());
|
||||
// lawsFile.setStandFileClassify(convertMq.getStandFileClassify());
|
||||
// lawsFile.setFileName(fileOriName+".pdf");
|
||||
// lawsFile.setFileSuffix("pdf");
|
||||
// lawsFile.setValidFlag(0);
|
||||
// lawsFile.setCreationTime(new Date());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// countSuccess = sarBussStandFileEODao.insertSelective(lawsFile);
|
||||
// }
|
||||
// else if (SarTypeEnum.RECORDS.getValue().equals(convertMq.getConvertType())) {
|
||||
//// SarBussRecordsFileEO lawsFile = new SarBussRecordsFileEO();
|
||||
//// lawsFile.setId(UUID.randomUUID(20));
|
||||
//// lawsFile.setRecordsId(convertMq.getLawsId());
|
||||
//// lawsFile.setResId(convertMq.getResId());
|
||||
//// lawsFile.setAttId(pdfId);
|
||||
//// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
//// lawsFile.setRecordsFileClassify(convertMq.getStandFileClassify());
|
||||
//// lawsFile.setFileName(fileOriName+".pdf");
|
||||
//// lawsFile.setFileSuffix("pdf");
|
||||
//// lawsFile.setValidFlag("0");
|
||||
//// lawsFile.setCreationTime(new Date());
|
||||
//// lawsFile.setModifyTime(new Date());
|
||||
//// countSuccess = sarBussRecordsFileEODao.insertSelective(lawsFile);
|
||||
// }else {
|
||||
//// SarFileSplitItemsFileEO lawsFile = new SarFileSplitItemsFileEO();
|
||||
//// lawsFile.setId(UUID.randomUUID(20));
|
||||
//// lawsFile.setStandId(convertMq.getLawsId());
|
||||
//// lawsFile.setResId(convertMq.getResId());
|
||||
//// lawsFile.setAttId(pdfId);
|
||||
////// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
//// lawsFile.setValidFlag(0);
|
||||
//// lawsFile.setCreationTime(new Date());
|
||||
//// lawsFile.setModifyTime(new Date());
|
||||
//// countSuccess = sarFileSplitItemsFileEODao.insertSelective(lawsFile);
|
||||
// }
|
||||
// return countSuccess;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 文档转换逻辑
|
||||
// * @param attFileEO
|
||||
// */
|
||||
// public void insertOrUpdateStandInfo(AttFileEO attFileEO){
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
+63
-4
@@ -1,18 +1,38 @@
|
||||
package com.adc.da.convert.otConvert.controller;
|
||||
|
||||
|
||||
import com.adc.da.att.controller.AttFileEOController;
|
||||
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.convert.common.AsposeOfficeConvertUtils;
|
||||
import com.adc.da.convert.mq.CreateConvertMQService;
|
||||
import com.adc.da.convert.otConvert.service.IOtConvertService;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.convert.otConvert.entity.OtConvert;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -24,12 +44,51 @@ import com.adc.da.base.web.BaseController;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "|OtConvert| 文档转换")
|
||||
@RequestMapping("/OtConvert")
|
||||
@RequestMapping("/${restPath}/OtConvert")
|
||||
public class OtConvertController extends BaseController<OtConvert> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(OtConvertController.class);
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Value("${upload.file.white.lists}")
|
||||
private String uploadFileWhiteLists; //上传文件白名单
|
||||
|
||||
@Autowired
|
||||
private IOtConvertService iOtConvertService;
|
||||
|
||||
@Autowired
|
||||
private IAttFileEOService attFileEOService;
|
||||
|
||||
@Autowired
|
||||
private CreateConvertMQService createConvertMQService;
|
||||
|
||||
@ApiOperation(value = "|OtActConvertEO|根据文件ID获取流程转换文档")
|
||||
@GetMapping(value = "/getConvertFileByAttId")
|
||||
public ResponseMessage getConvertFileByAttId(String attId) throws Exception {
|
||||
// 根据attId查到地址
|
||||
if(StringUtils.isNotBlank(attId)){
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("ACT_FILE_ID",attId);
|
||||
List<OtConvert> resultList = iOtConvertService.list(wrapper);
|
||||
if(resultList!=null && !resultList.isEmpty()){
|
||||
OtConvert convertEO = resultList.get(0);
|
||||
if(StringUtils.isNotBlank(convertEO.getConvertFileId())){
|
||||
AttFileEO attFileEO = attFileEOService.getFileInfo(convertEO.getConvertFileId());
|
||||
convertEO.setConvertFileInfo(attFileEO);
|
||||
return Result.success(convertEO);
|
||||
}else{
|
||||
return Result.success("-100","查询的转件文件未找到,请检查状态",convertEO);
|
||||
}
|
||||
}else{
|
||||
return Result.error("-1","查询的转换记录不存在",null);
|
||||
}
|
||||
}else{
|
||||
return Result.error("-1","查询的转换文档ID不存在",null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author super_liu
|
||||
* @Description 查询文件信息
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.adc.da.convert.otConvert.entity;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>OT_ACT_CONVERT OtActConvertEOEntity<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2021-03-19 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
public class OtActConvertEO extends BaseEntity {
|
||||
|
||||
private String id;
|
||||
private String actFileId;
|
||||
private String convertState;
|
||||
private String convertFileId;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
// 转换后文件信息
|
||||
private AttFileEO ConvertFileInfo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* java字段名转换为原始数据库列名。<b>如果不存在则返回null</b><br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>id -> id</li>
|
||||
* <li>actFileId -> act_file_id</li>
|
||||
* <li>convertState -> convert_state</li>
|
||||
* <li>convertFileId -> convert_file_id</li>
|
||||
* <li>createTime -> create_time</li>
|
||||
* <li>modifyTime -> modify_time</li>
|
||||
*/
|
||||
public static String fieldToColumn(String fieldName) {
|
||||
if (fieldName == null) { return null; };
|
||||
switch (fieldName) {
|
||||
case "id": return "id";
|
||||
case "actFileId": return "act_file_id";
|
||||
case "convertState": return "convert_state";
|
||||
case "convertFileId": return "convert_file_id";
|
||||
case "createTime": return "create_time";
|
||||
case "modifyTime": return "modify_time";
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 原始数据库列名转换为java字段名。<b>如果不存在则返回null</b><br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>id -> id</li>
|
||||
* <li>act_file_id -> actFileId</li>
|
||||
* <li>convert_state -> convertState</li>
|
||||
* <li>convert_file_id -> convertFileId</li>
|
||||
* <li>create_time -> createTime</li>
|
||||
* <li>modify_time -> modifyTime</li>
|
||||
*/
|
||||
public static String columnToField(String columnName) {
|
||||
if (columnName == null) { return null; };
|
||||
switch (columnName) {
|
||||
case "id": return "id";
|
||||
case "act_file_id": return "actFileId";
|
||||
case "convert_state": return "convertState";
|
||||
case "convert_file_id": return "convertFileId";
|
||||
case "create_time": return "createTime";
|
||||
case "modify_time": return "modifyTime";
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 主键 **/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/** 主键 **/
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/** 流程中待转换文件ID **/
|
||||
public String getActFileId() {
|
||||
return this.actFileId;
|
||||
}
|
||||
|
||||
/** 流程中待转换文件ID **/
|
||||
public void setActFileId(String actFileId) {
|
||||
this.actFileId = actFileId;
|
||||
}
|
||||
|
||||
/** 转换状态:LODING:待转换 SUCCESS:成功 ERROR:错误 **/
|
||||
public String getConvertState() {
|
||||
return this.convertState;
|
||||
}
|
||||
|
||||
/** 转换状态:LODING:待转换 SUCCESS:成功 ERROR:错误 **/
|
||||
public void setConvertState(String convertState) {
|
||||
this.convertState = convertState;
|
||||
}
|
||||
|
||||
/** 转换后文件ID **/
|
||||
public String getConvertFileId() {
|
||||
return this.convertFileId;
|
||||
}
|
||||
|
||||
/** 转换后文件ID **/
|
||||
public void setConvertFileId(String convertFileId) {
|
||||
this.convertFileId = convertFileId;
|
||||
}
|
||||
|
||||
/** 数据创建时间 **/
|
||||
public Date getCreateTime() {
|
||||
return this.createTime;
|
||||
}
|
||||
|
||||
/** 数据创建时间 **/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
/** 数据修改时间 **/
|
||||
public Date getModifyTime() {
|
||||
return this.modifyTime;
|
||||
}
|
||||
|
||||
/** 数据修改时间 **/
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
|
||||
public AttFileEO getConvertFileInfo() {
|
||||
return ConvertFileInfo;
|
||||
}
|
||||
|
||||
public void setConvertFileInfo(AttFileEO convertFileInfo) {
|
||||
ConvertFileInfo = convertFileInfo;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.adc.da.convert.otConvert.entity;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
@@ -62,5 +63,7 @@ public class OtConvert extends BaseEntity {
|
||||
@TableField("VALID_FLAG")
|
||||
private Integer validFlag;
|
||||
|
||||
|
||||
// 转换后文件信息
|
||||
@TableField(exist = false)
|
||||
private AttFileEO ConvertFileInfo;
|
||||
}
|
||||
|
||||
@@ -63,6 +63,10 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
addInterceptor.excludePathPatterns("/api/sarStandUnqualified/sar-stand-unqualified/exportStandUnqulifiedExcel");
|
||||
//文件预览
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/getFileInfo");
|
||||
// onlyOffice 回调
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/recieveFile");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/getSyncPdfFileInfo");
|
||||
//附件下载
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSar");
|
||||
//水印下载
|
||||
|
||||
@@ -132,8 +132,11 @@ verifyCodeMode=1
|
||||
# =============================================================================
|
||||
# file模块上传文件的服务器地址
|
||||
file.path=/data/slrs/file
|
||||
# 文件下载地址参数(弃用)
|
||||
file.downloadUrl=
|
||||
|
||||
stand.edit.file.path = /usr/laws/file/
|
||||
# onlyoffice 预览地址
|
||||
file.downloadUrl=http://10.100.5.116:1080/file/
|
||||
|
||||
#上传文件白名单-以,分隔
|
||||
upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg,pptx,ppt
|
||||
|
||||
|
||||
+8
-6
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarModelTree.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
|
||||
import com.adc.da.slrs.sarModelTree.service.ISarModelTreeService;
|
||||
import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
@@ -38,17 +39,18 @@ public class SarModelTreeController extends BaseController<SarModelTree> {
|
||||
@ApiOperation("查询父所有资源")
|
||||
@GetMapping("/list")
|
||||
public ResponseMessage<List<SarModelTree>> getAll(){
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
|
||||
// TODO List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null);
|
||||
// List<SarModuleTree> tsResources = iSarModuleTreeService.getAll(null);
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
@ApiOperation("根据父ID查询子所有资源")
|
||||
@GetMapping("/childByList")
|
||||
public ResponseMessage<List<SarModelTree>> childByList(String ids){
|
||||
SarModelTree tree = new SarModelTree();
|
||||
tree.setId(ids);
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(tree);
|
||||
public ResponseMessage<List<SarModelTree>> childByList(SarModelTree parentTree){
|
||||
// List<SarModuleTree> tsResources = iSarModuleTreeService.recursionGetChildren(parentTree);
|
||||
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(parentTree);
|
||||
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
|
||||
@@ -70,7 +70,13 @@ public class SarModuleTree {
|
||||
@TableField("CREATIONDATE")
|
||||
private String creationdate;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer level;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String model;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String nextCondition;
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,15 +1,16 @@
|
||||
package com.adc.da.slrs.sarModelTree.service;
|
||||
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISarModuleTreeService {
|
||||
|
||||
List<SarModelTree> getAll(SarModelTree sarModelTree);
|
||||
List<SarModuleTree> getAll(SarModuleTree root);
|
||||
|
||||
List<SarModelTree> recursionGetChildren(SarModelTree parent);
|
||||
List<SarModuleTree> recursionGetChildren(SarModuleTree parent);
|
||||
|
||||
public Head analysisJsonAndStorage(String json);
|
||||
|
||||
|
||||
+12
-4
@@ -32,6 +32,9 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
|
||||
// for(SarModelTree tree:list){
|
||||
// tree.setChildren(recursionGetChildren((tree)));
|
||||
// }
|
||||
list.forEach(item->{
|
||||
item.setId(item.getName());
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -44,11 +47,16 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
|
||||
public List<SarModelTree> recursionGetChildren(SarModelTree parent){
|
||||
QueryWrapper<SarModelTree> sarMenuQueryWrapper=new QueryWrapper<>();
|
||||
sarMenuQueryWrapper.orderByAsc("SORT");
|
||||
sarMenuQueryWrapper.in("PID",parent.getId());
|
||||
// sarMenuQueryWrapper.in("PID",parent.getId());
|
||||
sarMenuQueryWrapper.eq("PID",parent.getId());
|
||||
List<SarModelTree> children=this.baseMapper.selectList(sarMenuQueryWrapper);
|
||||
for(SarModelTree sarMenu:children){
|
||||
sarMenu.setChildren(recursionGetChildren((sarMenu)));
|
||||
}
|
||||
// for(SarModelTree sarMenu:children){
|
||||
// sarMenu.setChildren(recursionGetChildren((sarMenu)));
|
||||
// }
|
||||
|
||||
children.forEach(item->{
|
||||
item.setId(item.getName());
|
||||
});
|
||||
return children;
|
||||
}
|
||||
}
|
||||
|
||||
+55
-15
@@ -15,9 +15,11 @@ import com.google.gson.JsonParser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@@ -27,16 +29,27 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
|
||||
private SarModuleTreeServiceImpl sarModuleTreeService;
|
||||
|
||||
/**
|
||||
* @param sarModelTree
|
||||
* @return 所有的根节点
|
||||
*/
|
||||
@Override
|
||||
public List<SarModelTree> getAll(SarModelTree sarModelTree) {
|
||||
public List<SarModuleTree> getAll(SarModuleTree root) {
|
||||
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
|
||||
treeQueryWrapper.groupBy("FTVSTYPE1");
|
||||
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
|
||||
treeQueryWrapper.select("FTVSTYPE1")
|
||||
.groupBy("FTVSTYPE1");
|
||||
|
||||
List<Map<String, Object>> moduleTreeList = this.baseMapper.selectMaps(treeQueryWrapper);
|
||||
|
||||
List<SarModuleTree> collect = moduleTreeList.stream()
|
||||
.map(item -> {
|
||||
SarModuleTree sarModuleTree = new SarModuleTree();
|
||||
sarModuleTree.setNextCondition(item.get("FTVSTYPE1").toString());
|
||||
sarModuleTree.setLevel(1);
|
||||
sarModuleTree.setModel(item.get("FTVSTYPE1").toString());
|
||||
return sarModuleTree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
//返回转换元素后的数组
|
||||
return listTransform(moduleTreeList);
|
||||
return collect;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,20 +58,47 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SarModelTree> recursionGetChildren(SarModelTree parent) {
|
||||
public List<SarModuleTree> recursionGetChildren(SarModuleTree parent) {
|
||||
|
||||
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
|
||||
treeQueryWrapper.eq("GUID",parent.getId());
|
||||
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
|
||||
Integer level =parent.getLevel();
|
||||
|
||||
switch (parent.getLevel()){
|
||||
case 1:
|
||||
level=2;
|
||||
break;
|
||||
case 6:
|
||||
return null;
|
||||
}
|
||||
|
||||
String column="FTVSTYPE"+(level+1);
|
||||
|
||||
treeQueryWrapper.select(column)
|
||||
.eq("FTVSTYPE"+parent.getLevel(),parent.getNextCondition())
|
||||
.groupBy(column);
|
||||
|
||||
List<Map<String, Object>> moduleTreeList = this.baseMapper.selectMaps(treeQueryWrapper);
|
||||
|
||||
Integer finalLevel = level;
|
||||
List<SarModuleTree> collect = moduleTreeList.stream()
|
||||
.map(item -> {
|
||||
SarModuleTree sarModuleTree = new SarModuleTree();
|
||||
sarModuleTree.setNextCondition(item.get(column).toString()); //查询子节点条件
|
||||
sarModuleTree.setLevel(finalLevel + 1);
|
||||
//拼接前端显示名称
|
||||
// switch (finalLevel){
|
||||
// case 3:
|
||||
// sarModuleTree.setModel(item.get(column).toString());//前端显示名称
|
||||
// break;
|
||||
// case
|
||||
// }
|
||||
|
||||
|
||||
Map<String, List<SarModuleTree>> collect = moduleTreeList.stream().collect(Collectors.groupingBy(SarModuleTree::getFtvstype1));
|
||||
collect.forEach((k, v)->{
|
||||
SarModelTree modelTree = new SarModelTree();
|
||||
//TODO 生成树型结构
|
||||
// modelTree
|
||||
});
|
||||
return null;
|
||||
return sarModuleTree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+28
-23
@@ -155,24 +155,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
page.setPageSize(findStandDto.getSize());
|
||||
page.setUserId(null);
|
||||
List<SarStandardsInfo> pageInfo = null;
|
||||
try {
|
||||
pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// try {
|
||||
// pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
List<String> standId = new ArrayList<>();
|
||||
for (SarStandardsInfo standardsInfo : pageInfo){
|
||||
if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
|
||||
standId.add(standardsInfo.getId());
|
||||
}
|
||||
}
|
||||
// for (SarStandardsInfo standardsInfo : pageInfo){
|
||||
//// if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
|
||||
// standId.add(standardsInfo.getId());
|
||||
//// }
|
||||
// }
|
||||
|
||||
List<LawsDto> list=new ArrayList<>();
|
||||
if (standId==null || standId.size()==0){
|
||||
list = null;
|
||||
}else {
|
||||
// if (standId==null || standId.size()==0){
|
||||
// list = null;
|
||||
// }else {
|
||||
list = sarLawsAttrDetailedListDao.selectLawsByIdC((findStandDto.getPage()-1)*findStandDto.getSize(),findStandDto.getPage()*findStandDto.getSize(),standId,findStandDto.getStandName(), findStandDto.getStandType(),findStandDto.getFileType());
|
||||
}
|
||||
// }
|
||||
IPage<LawsDto> page1=new Page<>();
|
||||
page1.setRecords(list);
|
||||
page1.setTotal(sarLawsAttrDetailedListDao.selectLawsByIdCount(standId,findStandDto.getStandName(),findStandDto.getStandType(),findStandDto.getFileType()).size());
|
||||
@@ -195,6 +195,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
public List<SarStandItemsDto> findAllItems(String type,String[] ids){
|
||||
List<SarStandItemsDto> list=dao.selectAllItemsByIds(type,ids);
|
||||
List<SarStandItemsDto> res=new ArrayList<>();
|
||||
List<SarStandItemsDto> chinese=new ArrayList<>();
|
||||
if (null == list || list.isEmpty()){
|
||||
return list;
|
||||
}else {
|
||||
@@ -206,20 +207,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
if (a>0){
|
||||
mark=mark.substring(0,a);
|
||||
}
|
||||
if (null != map.get(Integer.valueOf(mark))){
|
||||
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
|
||||
}else {
|
||||
integerList.add(Integer.valueOf(mark));
|
||||
List<SarStandItemsDto> middle=new ArrayList<>();
|
||||
middle.add(sarStandItemsDto);
|
||||
map.put(Integer.valueOf(mark),middle);
|
||||
}
|
||||
try {
|
||||
if (null != map.get(Integer.valueOf(mark))) {
|
||||
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
|
||||
} else {
|
||||
integerList.add(Integer.valueOf(mark));
|
||||
List<SarStandItemsDto> middle = new ArrayList<>();
|
||||
middle.add(sarStandItemsDto);
|
||||
map.put(Integer.valueOf(mark), middle);
|
||||
}
|
||||
}catch (Exception e){
|
||||
chinese.add(sarStandItemsDto);
|
||||
}
|
||||
});
|
||||
Collections.sort(integerList);
|
||||
integerList.forEach(integer -> {
|
||||
res.addAll(map.get(integer));
|
||||
});
|
||||
|
||||
res.addAll(chinese);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,9 @@ public class SarVppsTree extends BaseEntity {
|
||||
@TableField("TYPE")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("查询子节点条件")
|
||||
@TableField(exist = false)
|
||||
private String nextCondition;
|
||||
|
||||
@TableField(exist=false)
|
||||
private List<String> roleIds;
|
||||
@@ -82,4 +85,6 @@ public class SarVppsTree extends BaseEntity {
|
||||
private List<String> childMenuIds;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+11
-6
@@ -31,7 +31,10 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
|
||||
.eq("LEVEL",0);
|
||||
List<SarVppsTree> list = this.baseMapper.selectList(tsResourceQueryWrapper);
|
||||
|
||||
list.forEach(item->item.setVppsCode("10"));
|
||||
list.forEach(item->{
|
||||
item.setCode(item.getVppsCode()+item.getChineseName());
|
||||
item.setId("10");
|
||||
});
|
||||
// for(SarVppsTree tree:list){
|
||||
// tree.setChildren(recursionGetChildren((tree)));
|
||||
// }
|
||||
@@ -47,14 +50,16 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
|
||||
public List<SarVppsTree> recursionGetChildren(SarVppsTree parent){
|
||||
QueryWrapper<SarVppsTree> sarMenuQueryWrapper=new QueryWrapper<>();
|
||||
sarMenuQueryWrapper.orderByAsc("SORT");
|
||||
// sarMenuQueryWrapper.in("PID",parent.getId());
|
||||
|
||||
sarMenuQueryWrapper.eq("LEVEL", parent.getLevel()+1)
|
||||
.eq("TYPE",parent.getType())
|
||||
.like("VPPS_CODE",parent.getVppsCode());
|
||||
.like("VPPS_CODE",parent.getId());
|
||||
List<SarVppsTree> children=this.baseMapper.selectList(sarMenuQueryWrapper);
|
||||
// for(SarVppsTree sarMenu:children){
|
||||
// sarMenu.setChildren(recursionGetChildren((sarMenu)));
|
||||
// }
|
||||
|
||||
children.forEach(item->{
|
||||
item.setId(item.getVppsCode());
|
||||
item.setCode(item.getVppsCode()+item.getChineseName());
|
||||
});
|
||||
return children;
|
||||
}
|
||||
}
|
||||
|
||||
+87
-78
@@ -99,95 +99,43 @@
|
||||
order by number
|
||||
</select>
|
||||
<select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
|
||||
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
|
||||
select distinct c.ID,c.* from (
|
||||
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
|
||||
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
|
||||
standSortShow,
|
||||
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
|
||||
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||
a.ID = b.STAND_ID
|
||||
left join sar_stand_items ssi on ssi.stand_id = a.id
|
||||
FROM sar_stand_items ssi
|
||||
left join sar_standards_info a on ssi.stand_id = a.id
|
||||
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
|
||||
<where>
|
||||
1=1
|
||||
<if test="standName != null">
|
||||
and
|
||||
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
|
||||
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||
and
|
||||
</if>
|
||||
<if test="fileType !=null">
|
||||
ssi.FILE_TYPE = #{fileType} and
|
||||
and ssi.FILE_TYPE = #{fileType}
|
||||
</if>
|
||||
<if test="standType !=null">
|
||||
a.STAND_TYPE = #{standType} and
|
||||
and a.STAND_TYPE = #{standType}
|
||||
</if>
|
||||
a.ID IN
|
||||
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
|
||||
UNION
|
||||
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
|
||||
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
|
||||
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||
a.ID = b.STAND_ID
|
||||
left join sar_stand_items ssi on ssi.stand_id = a.id
|
||||
<where>
|
||||
<if test="standName != null">
|
||||
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
|
||||
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||
and
|
||||
</if>
|
||||
<if test="fileType !=null">
|
||||
ssi.FILE_TYPE = #{fileType} and
|
||||
</if>
|
||||
<if test="standType !=null">
|
||||
a.STAND_TYPE = #{standType} and
|
||||
</if>
|
||||
a.ID IN
|
||||
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
limit #{start},#{end}
|
||||
</select>
|
||||
|
||||
<select id="selectLawsByIdCount" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
|
||||
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
|
||||
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
|
||||
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||
a.ID = b.STAND_ID
|
||||
left join sar_stand_items ssi on ssi.stand_id = a.id
|
||||
<where>
|
||||
<if test="standName != null">
|
||||
and
|
||||
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
|
||||
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||
|
||||
</if>
|
||||
<if test="fileType !=null">
|
||||
and
|
||||
ssi.FILE_TYPE = #{fileType}
|
||||
</if>
|
||||
<if test="standType !=null">
|
||||
and
|
||||
a.STAND_TYPE = #{standType}
|
||||
</if>
|
||||
|
||||
<if test="param1 !=null and param1.size()>0 " >
|
||||
and
|
||||
a.ID IN
|
||||
<if test="param1 != null and param1.size()>0">
|
||||
and a.ID IN
|
||||
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
UNION
|
||||
|
||||
UNION all
|
||||
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
|
||||
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
|
||||
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||
a.ID = b.STAND_ID
|
||||
left join sar_stand_items ssi on ssi.stand_id = a.id
|
||||
FROM sar_stand_items ssi
|
||||
left join sar_standards_info a on ssi.stand_id = a.id
|
||||
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
|
||||
<where>
|
||||
1=1
|
||||
<if test="standName != null">
|
||||
@@ -196,21 +144,82 @@
|
||||
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||
</if>
|
||||
<if test="fileType !=null">
|
||||
and
|
||||
ssi.FILE_TYPE = #{fileType}
|
||||
and ssi.FILE_TYPE = #{fileType}
|
||||
</if>
|
||||
<if test="standType !=null">
|
||||
and
|
||||
a.STAND_TYPE = #{standType}
|
||||
and a.STAND_TYPE = #{standType}
|
||||
</if>
|
||||
<if test="param1 !=null and param1.size()>0 " >
|
||||
and
|
||||
a.ID IN
|
||||
<if test="param1 != null and param1.size()>0">
|
||||
and a.ID IN
|
||||
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
)c
|
||||
limit #{start},#{end}
|
||||
</select>
|
||||
|
||||
<select id="selectLawsByIdCount" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
|
||||
select distinct c.ID,c.* from (
|
||||
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
|
||||
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
|
||||
standSortShow,
|
||||
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
|
||||
FROM sar_stand_items ssi
|
||||
left join sar_standards_info a on ssi.stand_id = a.id
|
||||
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
|
||||
<where>
|
||||
1=1
|
||||
<if test="standName != null">
|
||||
and
|
||||
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
|
||||
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||
</if>
|
||||
<if test="fileType !=null">
|
||||
and ssi.FILE_TYPE = #{fileType}
|
||||
</if>
|
||||
<if test="standType !=null">
|
||||
and a.STAND_TYPE = #{standType}
|
||||
</if>
|
||||
<if test="param1 != null and param1.size()>0">
|
||||
and a.ID IN
|
||||
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
UNION all
|
||||
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
|
||||
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
|
||||
standSortShow,
|
||||
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
|
||||
FROM sar_stand_items ssi
|
||||
left join sar_standards_info a on ssi.stand_id = a.id
|
||||
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
|
||||
<where>
|
||||
1=1
|
||||
<if test="standName != null">
|
||||
and
|
||||
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
|
||||
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||
</if>
|
||||
<if test="fileType !=null">
|
||||
and ssi.FILE_TYPE = #{fileType}
|
||||
</if>
|
||||
<if test="standType !=null">
|
||||
and a.STAND_TYPE = #{standType}
|
||||
</if>
|
||||
<if test="param1 != null and param1.size()>0">
|
||||
and a.ID IN
|
||||
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
)c
|
||||
</select>
|
||||
|
||||
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">
|
||||
|
||||
@@ -21,6 +21,7 @@ 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.scheduling.annotation.Async;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import sun.misc.BASE64Encoder;
|
||||
@@ -30,6 +31,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.file.Files;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -56,6 +59,9 @@ public class AttFileEOController {
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Value("${stand.edit.file.path}")
|
||||
private String standEditFilePath;
|
||||
|
||||
// @Autowired
|
||||
// private RoleEOService roleEOService;
|
||||
//
|
||||
@@ -66,6 +72,89 @@ public class AttFileEOController {
|
||||
private String uploadFileWhiteLists; //上传文件白名单
|
||||
|
||||
|
||||
@ApiOperation(value = "|获取企标文件")
|
||||
@GetMapping("/getBusStandFileByAttId")
|
||||
public ResponseMessage<AttFileEO> getBusStandFileByAttId(String attId){
|
||||
AttFileEO attFileEO = attFileEOService.saveOrGetBusFileInfo(attId);
|
||||
return Result.success(attFileEO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|onlyOffice接收文件")
|
||||
@PostMapping("/recieveFile")
|
||||
public void recieveFile(HttpServletRequest request, HttpServletResponse response, String fileNm,String standNo){
|
||||
logger.info("**********进入onlyoffice接收文档接口************");
|
||||
try {
|
||||
PrintWriter writer = response.getWriter();
|
||||
String body = "";
|
||||
try {
|
||||
Scanner scanner = new Scanner(request.getInputStream());
|
||||
scanner.useDelimiter("\\A");
|
||||
body = scanner.hasNext() ? scanner.next() : "";
|
||||
scanner.close();
|
||||
} catch (Exception ex) {
|
||||
writer.write("get request.getInputStream error:" + ex.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (body.isEmpty()) {
|
||||
writer.write("empty request.getInputStream");
|
||||
return;
|
||||
}
|
||||
|
||||
net.sf.json.JSONObject jsonObj = net.sf.json.JSONObject.fromObject(body);
|
||||
logger.info("**********onlyoffice接收文档接口获得结果body************" + body);
|
||||
int status = (Integer) jsonObj.get("status");
|
||||
|
||||
int saved = 0;
|
||||
if (status == 2 || status == 3)//MustSave, Corrupted
|
||||
{
|
||||
String downloadUri = (String) jsonObj.get("url");
|
||||
|
||||
try {
|
||||
logger.info("**********onlyoffice接收文档接口获得downloadUri************" + downloadUri);
|
||||
if (StringUtils.isNotEmpty(downloadUri)) {
|
||||
File file = new File(standEditFilePath + standNo + "\\" + fileNm);
|
||||
downloadNetFile(downloadUri, file);
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
saved = 1;
|
||||
logger.info("**********onlyoffice接收文档接口异常************" + ex.getMessage());
|
||||
logger.error(ex.getMessage(),ex);
|
||||
}
|
||||
} else if (status == 4) {
|
||||
logger.info("**********onlyoffice接收文档接口开始修改文件状态状态4************");
|
||||
|
||||
logger.info("**********onlyoffice接收文档接口修改文件状态成功状态4************");
|
||||
}
|
||||
logger.info("onlyoffice编辑完成--------------");
|
||||
writer.write("{\"error\":" + saved + "}");
|
||||
} catch (IOException e) {
|
||||
logger.info("**********onlyoffice接收文档接口异常************" + e.getMessage());
|
||||
logger.error(e.getMessage(),e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void downloadNetFile(String downloadUrl, File file) {
|
||||
try {
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(file);
|
||||
URL url = new URL(downloadUrl);
|
||||
URLConnection connection = url.openConnection();
|
||||
InputStream inputStream = connection.getInputStream();
|
||||
int length = 0;
|
||||
byte[] bytes = new byte[1024];
|
||||
while ((length = inputStream.read(bytes)) != -1) {
|
||||
fileOutputStream.write(bytes, 0, length);
|
||||
}
|
||||
fileOutputStream.close();
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
logger.error("download error ! url :{}, exception:{}", downloadUrl, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="|File|上传文件")
|
||||
@PostMapping(value="/upload",consumes="multipart/*",headers="content-type=multipart/form-data" )
|
||||
@CrossOrigin(origins = "*", maxAge = 3600)
|
||||
@@ -104,6 +193,8 @@ public class AttFileEOController {
|
||||
String standName = oriFileName.replace(standNumber,"");
|
||||
fileInfo.setStandName(standName);
|
||||
}
|
||||
// 上传转换文件
|
||||
fileToConvert();
|
||||
return Result.success("true", "上传成功", fileInfo);
|
||||
} else {
|
||||
return Result.error("文件上传失败");
|
||||
@@ -116,6 +207,12 @@ public class AttFileEOController {
|
||||
}
|
||||
}
|
||||
|
||||
@Async
|
||||
void fileToConvert(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value="|File|上传文件")
|
||||
@PostMapping(value="/uploadFiles",consumes="multipart/*",headers="content-type=multipart/form-data" )
|
||||
@CrossOrigin(origins = "*", maxAge = 3600)
|
||||
|
||||
@@ -10,6 +10,8 @@ import java.util.List;
|
||||
|
||||
public interface IAttFileEOService extends IService<AttFileEO> {
|
||||
|
||||
AttFileEO saveOrGetBusFileInfo(String attId);
|
||||
|
||||
public AttFileVo saveFileInfo(File file);
|
||||
|
||||
public AttFileVo saveFileInfo(MultipartFile file);
|
||||
|
||||
@@ -11,6 +11,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
@@ -28,10 +30,77 @@ import java.util.List;
|
||||
@Slf4j
|
||||
public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> implements IAttFileEOService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AttFileEOServiceImpl.class);
|
||||
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
/**
|
||||
* 文件下载路径
|
||||
*/
|
||||
@Value("${file.downloadUrl}")
|
||||
private String downloadUrl;
|
||||
|
||||
public AttFileEO saveOrGetBusFileInfo(String attId){
|
||||
AttFileEO attFileEO=new AttFileEO();
|
||||
if(StringUtils.isNotBlank(attId)){
|
||||
attFileEO = this.getFileInfo(attId);
|
||||
//2020年10月25日 此处补充文件的下载地址
|
||||
StringBuffer downloadFileUrl = new StringBuffer();
|
||||
downloadFileUrl.append(downloadUrl).append(attFileEO.getFilePath()).append(attFileEO.getFileName());
|
||||
attFileEO.setDownLoadUrl(downloadFileUrl.toString());
|
||||
}else{
|
||||
String fileId = UUIDUtils.randomUUID20();
|
||||
try {
|
||||
String uuidPath = UUIDUtils.getUUIDPath(fileId);
|
||||
|
||||
String FileSavePath = filePath + uuidPath;
|
||||
File dir = new File(FileSavePath);
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
}
|
||||
File defaultBusFile =new File(filePath+"/modal/newStandFile.docx");
|
||||
if(!defaultBusFile.exists()){
|
||||
logger.error("默认标准文件不存在");
|
||||
}
|
||||
String fileName = "标准正文.docx";
|
||||
String fileSuffix = ".docx";
|
||||
String newFileName = fileId + fileSuffix;
|
||||
File saveFile = new File(FileSavePath + newFileName);
|
||||
// FileUtil.copyInputStreamToFile(file.get, saveFile);
|
||||
FileUtils.copyFile(defaultBusFile,saveFile);
|
||||
//开始存储文件信息
|
||||
String tableName = UUIDUtils.getAttTable();
|
||||
int existTable = this.baseMapper.existTable(tableName);
|
||||
if (existTable == 0) {
|
||||
this.baseMapper.creatTableInfo(tableName);
|
||||
}
|
||||
fileId = tableName + "_" + fileId;
|
||||
|
||||
attFileEO.setTableName(tableName);
|
||||
attFileEO.setId(fileId);
|
||||
attFileEO.setOldFileName(fileName);
|
||||
attFileEO.setFileSuffix(fileSuffix);
|
||||
attFileEO.setFilePath(uuidPath);
|
||||
attFileEO.setFileName(newFileName);
|
||||
attFileEO.setValidFlag(ValidFlagEnum.VALID_TRUE.getValue());
|
||||
attFileEO.setCreationTime(new Date());
|
||||
attFileEO.setModifyTime(new Date());
|
||||
this.baseMapper.insert(attFileEO);
|
||||
//2020年10月25日 此处补充文件的下载地址
|
||||
StringBuffer downloadFileUrl=new StringBuffer();
|
||||
downloadFileUrl.append(filePath).append(uuidPath).append(newFileName);
|
||||
attFileEO.setDownLoadUrl(downloadFileUrl.toString());
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
return attFileEO;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存文件并返回文件ID
|
||||
|
||||
Reference in New Issue
Block a user