Merge remote-tracking branch 'origin/FOTON' into FOTON_RELEASE
This commit is contained in:
@@ -32,6 +32,9 @@ public class ActDefineStartMap {
|
||||
map.put("laws2","PolicyCommentProcessWorkFlow");
|
||||
map.put("laws3","KCSTPReviewProcessWorkFlow");
|
||||
|
||||
// 企标制修订流程及企业标准库流程
|
||||
map.put("buss1","bussLibraryWkflow");
|
||||
|
||||
//张超然
|
||||
map.put("20","StandardApplyMeetProcess");
|
||||
map.put("21","StandardMeetProcess");
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -31,5 +31,6 @@ public class WarningEO extends EarlyWarningEO {
|
||||
|
||||
private String standYear;
|
||||
|
||||
private String issueTime;
|
||||
|
||||
}
|
||||
|
||||
+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;
|
||||
}
|
||||
}
|
||||
|
||||
+23
@@ -56,6 +56,29 @@ public class SarStandUnqualifiedController extends BaseController<SarStandUnqual
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("未符合项整改新增")
|
||||
@PostMapping("/addOne")
|
||||
public ResponseMessage<Object> add(@RequestBody SarStandUnqualified sarStandUnqualified){
|
||||
sarStandUnqualified.setCreateTime(new Date());
|
||||
if (sarStandUnqualifiedService.save(sarStandUnqualified)) {
|
||||
return Result.success("新增成功");
|
||||
}
|
||||
else{
|
||||
return Result.error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("未符合项整改新增")
|
||||
@PostMapping("/updateOne")
|
||||
public ResponseMessage<Object> update(@RequestBody SarStandUnqualified sarStandUnqualified){
|
||||
if (sarStandUnqualifiedService.updateById(sarStandUnqualified)) {
|
||||
return Result.success("新增成功");
|
||||
}
|
||||
else{
|
||||
return Result.error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询未符合项
|
||||
* @param sarStandUnqualifiedPage:筛选、分页信息
|
||||
|
||||
+13
-2
@@ -5,6 +5,7 @@ import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.service.Impl.EarlyWarningEOServiceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -41,7 +42,7 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
||||
* @author zj
|
||||
* date 2021-06-15
|
||||
**/
|
||||
@GetMapping("/StandWarning")
|
||||
@GetMapping("/${restPath}/StandWarning")
|
||||
@ApiOperation("标准预警查询")
|
||||
public ResponseMessage newPageInfo(@RequestParam(defaultValue = "1", value = "newStandPage")int newStandPage, @RequestParam(defaultValue = "10", value = "newStandPageSize") int newStandPageSize,
|
||||
@RequestParam(defaultValue = "1", value = "oldStandPage")int oldStandPage, @RequestParam(defaultValue = "10", value = "oldStandPageSize") int oldStandPageSize,
|
||||
@@ -53,6 +54,16 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
||||
IPage<EarlyWarningEO> list4 = earlyWarningEOService.oldItemsQuery(oldItemsPage,oldItemsPageSize,earlyWarningEO);//在产车条款预警
|
||||
return getResponseMessage(list1, list2, list3, list4);
|
||||
}
|
||||
|
||||
@GetMapping("/getStandWarning")
|
||||
@ApiOperation("标准预警查询")
|
||||
public ResponseMessage<IPage<StandWarningEO>> getStandWaring(StandWarningEO queryPageEO){
|
||||
IPage<StandWarningEO> standWarning = earlyWarningEOService.getStandWarning(queryPageEO);
|
||||
return Result.success(standWarning);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private ResponseMessage getResponseMessage(IPage<EarlyWarningEO> list1, IPage<EarlyWarningEO> list2, IPage<EarlyWarningEO> list3, IPage<EarlyWarningEO> list4) {
|
||||
List<Map<String, Object>> listMap = new ArrayList<Map<String,Object>>();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
@@ -71,7 +82,7 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
||||
* date 2021-06-15
|
||||
**/
|
||||
@GetMapping("/ChangePermissions")
|
||||
@ApiOperation("更改权限")
|
||||
@ApiOperation("取消预警")
|
||||
public ResponseMessage ChangePermissions(String id) {
|
||||
String power = earlyWarningEOService.ChangePermissions(id);
|
||||
return Result.success("200",power);
|
||||
|
||||
+2
-3
@@ -2,14 +2,13 @@ package com.adc.da.slrs.sarStandWarning.dao;
|
||||
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
|
||||
|
||||
IPage<EarlyWarningEO> selectWarningPage(IPage<EarlyWarningEO> page, @Param(Constants.WRAPPER) QueryWrapper<EarlyWarningEO> queryWrapper);
|
||||
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO);
|
||||
|
||||
}
|
||||
|
||||
+14
-2
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.Tag;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -23,21 +25,27 @@ public class EarlyWarningEO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("标准id")
|
||||
@TableField("STAND_ID")
|
||||
private String standId;
|
||||
|
||||
@ApiModelProperty("标准类别")
|
||||
@TableField("STAND_TYPE")
|
||||
private String standType;
|
||||
|
||||
@ApiModelProperty("标准号")
|
||||
@TableField("STAND_CODE")
|
||||
private String standCode;
|
||||
|
||||
@ApiModelProperty("标准名称")
|
||||
@TableField("STAND_NAME")
|
||||
private String standName;
|
||||
|
||||
@ApiModelProperty("发布日期")
|
||||
@TableField("PUT_TIME")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date putTime;
|
||||
@@ -45,18 +53,23 @@ public class EarlyWarningEO extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private Date lastTime;
|
||||
|
||||
@ApiModelProperty("适用车型")
|
||||
@TableField("APPLY_TYPE")
|
||||
private String applyType;
|
||||
|
||||
@ApiModelProperty("责任工程师")
|
||||
@TableField("DUTY_ENGINEER")
|
||||
private String dutyEngineer;
|
||||
|
||||
@ApiModelProperty("条款(分解单)id")
|
||||
@TableField("ITEMS_ID")
|
||||
private String itemsId;
|
||||
|
||||
@ApiModelProperty("条款(分解单)编号")
|
||||
@TableField("ITEMS_NUM")
|
||||
private String itemsNum;
|
||||
|
||||
@ApiModelProperty("条款(分解单)名称")
|
||||
@TableField("ITEMS_NAME")
|
||||
private String itemsName;
|
||||
|
||||
@@ -72,7 +85,6 @@ public class EarlyWarningEO extends BaseEntity {
|
||||
@TableField("POWER")
|
||||
private String power;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String issueTime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.adc.da.slrs.sarStandWarning.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class StandWarningEO extends EarlyWarningEO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ApiModelProperty("新车型实施日期")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String XCXSSRQ;
|
||||
|
||||
@ApiModelProperty("在产车实施日期")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String ZCCSSRQ;
|
||||
|
||||
@ApiModelProperty("实施日期")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String SSRQ;
|
||||
|
||||
|
||||
private String standNum;
|
||||
|
||||
private String standSort;
|
||||
|
||||
private String standYear;
|
||||
|
||||
private String issueTime;
|
||||
|
||||
private Integer page;
|
||||
|
||||
private Integer pageSize;
|
||||
|
||||
@ApiModelProperty("范围查询新车型实施日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startXCXSSRQ;
|
||||
|
||||
@ApiModelProperty("范围查询新车型实施日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endXCXSSRQ;
|
||||
|
||||
@ApiModelProperty("范围查询在产车实施日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startZCCSSRQ;
|
||||
|
||||
@ApiModelProperty("范围查询在产车实施日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endZCCSSRQ;
|
||||
|
||||
@ApiModelProperty("范围查询实施日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startSSRQ;
|
||||
|
||||
|
||||
@ApiModelProperty("范围查询实施日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endSSRQ;
|
||||
|
||||
|
||||
@ApiModelProperty("范围查询发布日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startPutTime;
|
||||
|
||||
|
||||
@ApiModelProperty("范围查询发布日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endPutTime;
|
||||
}
|
||||
+4
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarStandWarning.service;
|
||||
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -16,4 +17,7 @@ public interface EarlyWarningEOService extends IService<EarlyWarningEO> {
|
||||
IPage<EarlyWarningEO> oldPolicyQuery(int current,int pageSize);
|
||||
String batchSave(List<EarlyWarningEO> earlyWarningEOS);
|
||||
String ChangePermissions(String id);
|
||||
|
||||
|
||||
IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage);
|
||||
}
|
||||
|
||||
+16
@@ -4,6 +4,7 @@ package com.adc.da.slrs.sarStandWarning.service.Impl;
|
||||
import com.adc.da.scheduled.entity.DataDTO;
|
||||
import com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.service.EarlyWarningEOService;
|
||||
import com.adc.da.sys.util.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -106,6 +107,17 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
}
|
||||
return "更改成功";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询标准预警
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage) {
|
||||
IPage<StandWarningEO> iPage = new Page<>(queryPage.getPage(),queryPage.getPageSize());
|
||||
return earlyWarningEODao.selectWarningPage(iPage,queryPage);
|
||||
}
|
||||
|
||||
private IPage<EarlyWarningEO> getEarlyWarningEOIPage(int current,int pageSize, QueryWrapper<EarlyWarningEO> wrapper) {
|
||||
wrapper.eq("power",1);
|
||||
Page<EarlyWarningEO> page = new Page<>(current, pageSize);
|
||||
@@ -144,4 +156,8 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
wrapper.like("APPLY_TYPE", earlyWarningEO.getApplyType());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -40,10 +40,10 @@ public class SarVppsTreeController extends BaseController<SarVppsTree> {
|
||||
|
||||
@ApiOperation("根据父ID查询子所有资源")
|
||||
@GetMapping("/childByList")
|
||||
public ResponseMessage<List<SarVppsTree>> childByList(String ids){
|
||||
SarVppsTree tree = new SarVppsTree();
|
||||
tree.setId(ids);
|
||||
List<SarVppsTree> tsResources = iSarVppsTreeService.recursionGetChildren(tree);
|
||||
public ResponseMessage<List<SarVppsTree>> childByList(SarVppsTree parent){
|
||||
// SarVppsTree tree = new SarVppsTree();
|
||||
// tree.setId(ids);
|
||||
List<SarVppsTree> tsResources = iSarVppsTreeService.recursionGetChildren(parent);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
@@ -66,6 +66,18 @@ public class SarVppsTree extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private String parentIdsName;
|
||||
|
||||
@ApiModelProperty("层级")
|
||||
@TableField("LEVEL")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty("类型")
|
||||
@TableField("TYPE")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("查询子节点条件")
|
||||
@TableField(exist = false)
|
||||
private String nextCondition;
|
||||
|
||||
@TableField(exist=false)
|
||||
private List<String> roleIds;
|
||||
|
||||
@@ -73,4 +85,6 @@ public class SarVppsTree extends BaseEntity {
|
||||
private List<String> childMenuIds;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+16
-5
@@ -27,8 +27,14 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
|
||||
@Override
|
||||
public List<SarVppsTree> getAll(SarVppsTree sarVppsTree) {
|
||||
QueryWrapper<SarVppsTree> tsResourceQueryWrapper=new QueryWrapper<>();
|
||||
tsResourceQueryWrapper.isNull("PID");
|
||||
tsResourceQueryWrapper.eq("TYPE",sarVppsTree.getType())
|
||||
.eq("LEVEL",0);
|
||||
List<SarVppsTree> list = this.baseMapper.selectList(tsResourceQueryWrapper);
|
||||
|
||||
list.forEach(item->{
|
||||
item.setCode(item.getVppsCode()+item.getChineseName());
|
||||
item.setId("10");
|
||||
});
|
||||
// for(SarVppsTree tree:list){
|
||||
// tree.setChildren(recursionGetChildren((tree)));
|
||||
// }
|
||||
@@ -44,11 +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.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;
|
||||
}
|
||||
}
|
||||
|
||||
+2276
File diff suppressed because it is too large
Load Diff
+209
@@ -0,0 +1,209 @@
|
||||
package com.adc.da.slrs.standardSplit.EventUtils;
|
||||
|
||||
/**
|
||||
* @Description: TODO
|
||||
* @author: super_liu
|
||||
* @date: 2021年11月28日 12:28
|
||||
*/
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文本差异高亮算法
|
||||
*
|
||||
* @Author : cron
|
||||
* @Date: 2020-01-15
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public class EventEditHistoryHighLightUtil {
|
||||
|
||||
/**
|
||||
* 传入2个字符串进行相比高亮显示
|
||||
* eg:
|
||||
* 原数据一:王五张三
|
||||
* 原数据二:张三李四
|
||||
* <span style='color:red'>王五</span>张三
|
||||
* 张三<span style='color:red'>李四</span>
|
||||
*/
|
||||
|
||||
public static String[] getHighLightDifferentOld(String a, String b) {
|
||||
String[] temp = getDiff(a, b);
|
||||
String[] result = {getHighLight(a, temp[0]), getHighLight(b, temp[1])};
|
||||
return result;
|
||||
}
|
||||
|
||||
private static String getHighLight(String source, String temp) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
char[] sourceChars = source.toCharArray();
|
||||
char[] tempChars = temp.toCharArray();
|
||||
boolean flag = false;
|
||||
for (int i = 0; i < sourceChars.length; i++) {
|
||||
if (tempChars[i] != ' ') {
|
||||
if (i == 0) {
|
||||
sb.append("<span style='color:red'>").append(sourceChars[i]);
|
||||
} else if (flag) {
|
||||
sb.append(sourceChars[i]);
|
||||
} else {
|
||||
sb.append("<span style='color:red'>").append(sourceChars[i]);
|
||||
}
|
||||
flag = true;
|
||||
if (i == sourceChars.length - 1) {
|
||||
sb.append("</span>");
|
||||
}
|
||||
} else if (flag) {
|
||||
sb.append("</span>").append(sourceChars[i]);
|
||||
flag = false;
|
||||
} else {
|
||||
sb.append(sourceChars[i]);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String[] getDiff(String a, String b) {
|
||||
String[] result = null;
|
||||
//选取长度较小的字符串用来穷举子串
|
||||
if (a.length() < b.length()) {
|
||||
result = getDiff(a, b, 0, a.length());
|
||||
} else {
|
||||
result = getDiff(b, a, 0, b.length());
|
||||
result = new String[]{result[1], result[0]};
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将a的指定部分与b进行比较生成比对结果
|
||||
*/
|
||||
private static String[] getDiff(String a, String b, int start, int end) {
|
||||
String[] result = new String[]{a, b};
|
||||
int len = result[0].length();
|
||||
while (len > 0) {
|
||||
for (int i = start; i < end - len + 1; i++) {
|
||||
String sub = result[0].substring(i, i + len);
|
||||
int idx = -1;
|
||||
if ((idx = result[1].indexOf(sub)) != -1) {
|
||||
result[0] = setEmpty(result[0], i, i + len);
|
||||
result[1] = setEmpty(result[1], idx, idx + len);
|
||||
if (i > 0) {
|
||||
//递归获取空白区域左边差异
|
||||
result = getDiff(result[0], result[1], 0, i);
|
||||
}
|
||||
if (i + len < end) {
|
||||
//递归获取空白区域右边差异
|
||||
result = getDiff(result[0], result[1], i + len, end);
|
||||
}
|
||||
len = 0;//退出while循环
|
||||
break;
|
||||
}
|
||||
}
|
||||
len = len / 2;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串s指定的区域设置成空格
|
||||
*/
|
||||
public static String setEmpty(String s, int start, int end) {
|
||||
char[] array = s.toCharArray();
|
||||
for (int i = start; i < end; i++) {
|
||||
array[i] = ' ';
|
||||
}
|
||||
return new String(array);
|
||||
}
|
||||
|
||||
//--------------new -------------------------
|
||||
|
||||
public static String[] getHighLightDifferent(String altbe, String altaf) {
|
||||
//字符串1 altbe 字符串2 altaf
|
||||
List<Integer> beList = rememberSpacing(altbe);
|
||||
List<Integer> afList = rememberSpacing(altaf);
|
||||
altbe = altbe.replace(" ", "");
|
||||
altaf = altaf.replace(" ", "");
|
||||
LinkedList<DiffMatchPatch.Diff> t = new DiffMatchPatch().diff_main(altbe, altaf);
|
||||
StringBuffer s1 = new StringBuffer();
|
||||
StringBuffer s2 = new StringBuffer();
|
||||
Integer indexBe = 0;
|
||||
Integer indexAf = 0;
|
||||
for (DiffMatchPatch.Diff diff : t) {
|
||||
StringBuffer diffTextBe = new StringBuffer(diff.text);
|
||||
StringBuffer diffTextAf = new StringBuffer(diff.text);
|
||||
if ("EQUAL".equalsIgnoreCase(diff.operation.toString())) {
|
||||
addSpacing(beList, indexBe, diffTextBe);
|
||||
addSpacing(afList, indexAf, diffTextAf);
|
||||
s1.append(diffTextBe);
|
||||
s2.append(diffTextAf);
|
||||
indexBe += diffTextBe.length();
|
||||
indexAf += diffTextAf.length();
|
||||
}
|
||||
indexBe = appendString2("DELETE", diff, s1, s2, beList, indexBe);
|
||||
indexAf = appendString2("INSERT", diff, s2, s1, afList, indexAf);
|
||||
}
|
||||
String[] result = new String[2];
|
||||
result[0] = s1.toString();
|
||||
result[1] = s2.toString();
|
||||
return result;
|
||||
}
|
||||
|
||||
// public static void appendString(String type, Diff diff, StringBuffer sbOne, StringBuffer sbTwo) {
|
||||
// if (type.equals(diff.operation.toString())) {
|
||||
// if (" ".equals(diff.text)) {
|
||||
// sbOne.append(" ");
|
||||
// sbTwo.append(" ");
|
||||
// } else {
|
||||
// sbOne.append("<em class='f-required'>").append(diff.text).append("</em>");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
private static List<Integer> rememberSpacing(String str) {
|
||||
List<Integer> list = new ArrayList<>();
|
||||
for (int i = 0; i < str.length(); i++) {
|
||||
if (' ' == str.charAt(i)) {
|
||||
list.add(i);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void addSpacing(List<Integer> list, Integer index, StringBuffer str) {
|
||||
for (Integer o : list) {
|
||||
if (o >= index && o < index + str.length()) {
|
||||
str.insert(o - index, ' ');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Integer appendString2(String type, DiffMatchPatch.Diff diff, StringBuffer sbOne,
|
||||
StringBuffer sbTwo, List<Integer> list, Integer i) {
|
||||
Integer result = i;
|
||||
if (type.equals(diff.operation.toString())) {
|
||||
StringBuffer sb = new StringBuffer(diff.text);
|
||||
for (Integer o : list) {
|
||||
if (o >= i && o < i + sb.length()) {
|
||||
sb.insert(o - i, ' ');
|
||||
}
|
||||
}
|
||||
sbOne.append("<span style='color:red;'>").append(sb).append("</span>");
|
||||
result = i + sb.length();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String a = "测试测试测试仅关注界面和功能,数据准确性在暂不测试";
|
||||
String b = "提交留言数据仅关注界面和功能,数据准确性在暂不测试";
|
||||
String[] anb = getHighLightDifferent(a, b);
|
||||
System.out.println(Arrays.toString(anb));
|
||||
|
||||
// String altbe = "提交留言数据仅关注界面和 功能,数据准确性在暂不测试";
|
||||
// String altaf = "提交留言数据仅关注界面和功能,数据准确性在暂不测试提交 留言数据仅关注界面和功能,数据准确性在暂不测试";
|
||||
// String[] highLightDifferentNew = getHighLightDifferent(altbe, altaf);
|
||||
// System.out.println(Arrays.toString(highLightDifferentNew));
|
||||
}
|
||||
|
||||
}
|
||||
+27
-4
@@ -5,8 +5,10 @@ import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.person.dao.PersonCollectEODao;
|
||||
import com.adc.da.person.dao.PersonShareEODao;
|
||||
import com.adc.da.slrs.standardSplit.dao.SarStandCompareHisEODao;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEO;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEOPage;
|
||||
import com.adc.da.slrs.standardSplit.service.SarFileSplitInfoEOService;
|
||||
import com.adc.da.slrs.standardSplit.service.SarItemsCompareHisEOService;
|
||||
import com.adc.da.slrs.standardSplit.service.SarStandCompareHisEOService;
|
||||
import com.adc.da.slrs.standardSplit.service.SarStandItemsCompareHisEOService;
|
||||
@@ -36,6 +38,9 @@ public class SarStandCompareHisEOController extends BaseController<SarStandCompa
|
||||
@Autowired
|
||||
private SarStandCompareHisEOService sarStandCompareHisEOService;
|
||||
|
||||
@Autowired
|
||||
private SarFileSplitInfoEOService sarFileSplitInfoEOService;
|
||||
|
||||
@Autowired
|
||||
private SarStandItemsCompareHisEOService sarStandItemsCompareHisEOService;
|
||||
|
||||
@@ -124,17 +129,35 @@ public class SarStandCompareHisEOController extends BaseController<SarStandCompa
|
||||
|
||||
@ApiOperation(value = "条款比对")
|
||||
@PostMapping("/clauseComparison")
|
||||
public ResponseMessage<Map<String,Object>> clauseComparison(String oldItemId, String newItemId, String standHisId) throws Exception {
|
||||
Map<String,Object> resultMap = sarStandCompareHisEOService.clauseComparison(oldItemId,newItemId,standHisId);
|
||||
public ResponseMessage<Map<String,Object>> clauseComparison(String oldItemId, String newItemId, String standHisId,String flag) throws Exception {
|
||||
Map<String,Object> resultMap = sarStandCompareHisEOService.clauseComparisonEvent(oldItemId,newItemId,standHisId,flag);
|
||||
return Result.success(resultMap);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "全文比对")
|
||||
@PostMapping("/fullTextComparison")
|
||||
public ResponseMessage<String> fullTextComparison(String leftStandard, String rightStandard) throws Exception {
|
||||
String id=UUIDUtils.randomUUID(32);
|
||||
SarStandCompareHisEO sarStandCompareHisEO =new SarStandCompareHisEO();
|
||||
SarFileSplitInfoEO leftInfo = sarFileSplitInfoEOService.selectByPrimaryKey(leftStandard);
|
||||
SarFileSplitInfoEO rightInfo = sarFileSplitInfoEOService.selectByPrimaryKey(rightStandard);
|
||||
//保存标准比对历史表数据
|
||||
SarStandCompareHisEO sarStandCompareHisEO = new SarStandCompareHisEO();
|
||||
// String id = UUIDUtils.randomUUID20();
|
||||
String id=UUIDUtils.randomUUID(32);
|
||||
sarStandCompareHisEO.setId(id);
|
||||
sarStandCompareHisEO.setOldStandId(leftStandard);
|
||||
sarStandCompareHisEO.setNewStandId(rightStandard);
|
||||
sarStandCompareHisEO.setOldFileType(leftInfo.getFileType());
|
||||
sarStandCompareHisEO.setNewFileType(rightInfo.getFileType());
|
||||
sarStandCompareHisEO.setOldStandName(leftInfo.getStandNameSplit());
|
||||
sarStandCompareHisEO.setNewStandName(rightInfo.getStandNameSplit());
|
||||
sarStandCompareHisEO.setOldStandNum(leftInfo.getStandNumSplit());
|
||||
sarStandCompareHisEO.setNewStandNum(rightInfo.getStandNumSplit());
|
||||
sarStandCompareHisEO.setOldSarType(leftInfo.getSarType());
|
||||
sarStandCompareHisEO.setNewSarType(rightInfo.getSarType());
|
||||
sarStandCompareHisEO.setCreateTime(new Date());
|
||||
sarStandCompareHisEO.setModifyTime(new Date());
|
||||
sarStandCompareHisEO.setCreateUser(LoginUserUtil.getUserId());
|
||||
sarStandCompareHisEO.setModifyUser(LoginUserUtil.getUserId());
|
||||
sarStandCompareHisEO.setCompareStatus("比对中");
|
||||
sarStandCompareHisEO.setCompareType("全文比对");
|
||||
sarStandCompareHisEO.setCreateTime(new Date());
|
||||
|
||||
+2
@@ -21,5 +21,7 @@ public interface SarStandCompareHisEOService {
|
||||
|
||||
Map<String,Object> clauseComparison(String oldItemId, String newItemId, String standHisId);
|
||||
|
||||
Map<String,Object> clauseComparisonEvent(String oldItemId, String newItemId, String standHisId,String flag);
|
||||
|
||||
Map<String,Object> fullTextComparison(String leftStandard, String rightStandard,String id) throws Exception;
|
||||
}
|
||||
|
||||
+134
-14
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.slrs.standardSplit.service.impl;
|
||||
|
||||
import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.slrs.standardSplit.EventUtils.EventEditHistoryHighLightUtil;
|
||||
import com.adc.da.slrs.standardSplit.dao.SarStandAttrDetailsEODao;
|
||||
import com.adc.da.slrs.standardSplit.dao.SarStandCompareHisEODao;
|
||||
import com.adc.da.slrs.standardSplit.entity.*;
|
||||
@@ -14,6 +15,7 @@ import com.adc.da.utils.treetool.TreeNode;
|
||||
import com.adc.da.utils.util.CompHanLPUtils;
|
||||
import com.adc.da.utils.util.DiffUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.util.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -112,6 +114,138 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
|
||||
return sarStandCompareHisEODao.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> clauseComparisonEvent(String oldItemId, String newItemId, String standHisId, String flag) {
|
||||
Map<String,Object> resultMap = new HashMap<String, Object>();
|
||||
String oldTxt = "";
|
||||
SarFileSplitItemsValEOPage oldPage = new SarFileSplitItemsValEOPage();
|
||||
oldPage.setItemId(oldItemId);
|
||||
oldPage.setType("TEXT");
|
||||
oldPage.setOrderBy("DISPLAY_SEQ,ID");
|
||||
List<SarFileSplitItemsValEO> oldList = sarFileSplitItemsValEOService.queryByList(oldPage);
|
||||
if(oldList!=null && !oldList.isEmpty()){
|
||||
for(int i = 1;i<=oldList.size();i++){
|
||||
if(i==oldList.size()) {
|
||||
oldTxt += oldList.get(i-1).getItemContent();
|
||||
}else{
|
||||
oldTxt += oldList.get(i-1).getItemContent() + "i#2\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
String newTxt = "";
|
||||
SarFileSplitItemsValEOPage newPage = new SarFileSplitItemsValEOPage();
|
||||
newPage.setItemId(newItemId);
|
||||
newPage.setType("TEXT");
|
||||
newPage.setOrderBy("DISPLAY_SEQ,ID");
|
||||
List<SarFileSplitItemsValEO> newList = sarFileSplitItemsValEOService.queryByList(newPage);
|
||||
if(newList!=null && !newList.isEmpty()){
|
||||
for(int i = 1;i<=newList.size();i++){
|
||||
if(i==newList.size()) {
|
||||
newTxt += newList.get(i-1).getItemContent();
|
||||
}else{
|
||||
newTxt += newList.get(i-1).getItemContent() + "i#2\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
String similarityDegree="";
|
||||
double similarity = 100.00;
|
||||
if(!StringUtils.isNotBlank(oldTxt.trim()) && !StringUtils.isNotBlank(newTxt.trim())){
|
||||
similarityDegree = "100.00";
|
||||
}else if(StringUtils.isNotBlank(oldTxt.trim()) && StringUtils.isNotBlank(newTxt.trim())){
|
||||
similarity = CompHanLPUtils.findSimilarity(oldTxt.trim(), newTxt.trim());
|
||||
NumberFormat nf = java.text.NumberFormat.getPercentInstance();
|
||||
//nf.setMaximumIntegerDigits(2);//小数点前保留几位
|
||||
nf.setMinimumFractionDigits(2);// 小数点后保留几位
|
||||
similarityDegree = nf.format(similarity);
|
||||
}else{
|
||||
similarity = 0.00;
|
||||
similarityDegree = "0.00";
|
||||
}
|
||||
resultMap.put("similarityDegree",similarityDegree);
|
||||
List<String> leftString = new ArrayList<>();
|
||||
List<String> rightString = new ArrayList<>();
|
||||
if(similarity >= 0.6){
|
||||
// DiffUtils diffUtils = new DiffUtils();
|
||||
// List<String> htmlDiffStr = diffUtils.getHtmlDiffStr(oldTxt.trim(), newTxt.trim());
|
||||
// List<String> stringList1 = Arrays.asList(htmlDiffStr.get(0).split("<br/>"));
|
||||
// for(String left : stringList1){
|
||||
// StringBuilder stringBuilder = new StringBuilder(left);
|
||||
// stringBuilder.append("</br>");
|
||||
// leftString.add(stringBuilder.toString());
|
||||
// }
|
||||
// List<String> stringList2 = Arrays.asList(htmlDiffStr.get(1).split("<br/>"));
|
||||
// for(String right : stringList2){
|
||||
// StringBuilder stringBuilder = new StringBuilder(right);
|
||||
// stringBuilder.append("</br>");
|
||||
// rightString.add(stringBuilder.toString());
|
||||
// }
|
||||
String[] anb = EventEditHistoryHighLightUtil.getHighLightDifferent(oldTxt.trim(), newTxt.trim());
|
||||
if(StringUtils.isNotBlank(flag) && flag.equals("2")){
|
||||
anb[0] = anb[0].replaceAll("red;", "#000000;background-color: red;").replaceAll("i#2\n", "<br/>");
|
||||
anb[1] = anb[1].replaceAll("red;", "#000000;background-color: rgb(51, 145, 206);").replaceAll("i#2\n", "<br/>");
|
||||
}else {
|
||||
anb[0] = anb[0].replaceAll("red;", "#000000;background-color: rgb(51, 145, 206);").replaceAll("i#2\n", "<br/>");
|
||||
anb[1] = anb[1].replaceAll("red;", "#000000;background-color: red;").replaceAll("i#2\n", "<br/>");
|
||||
}
|
||||
resultMap.put("leftString",anb[0]);
|
||||
resultMap.put("rightString",anb[1]);
|
||||
}else{
|
||||
String oldTxtTemp = oldTxt.replace("i#2\n", "<br/>");
|
||||
List<String> stringList1 = Arrays.asList(oldTxtTemp.split("<br/>"));
|
||||
for(String left : stringList1){
|
||||
StringBuilder stringBuilder = new StringBuilder(left);
|
||||
stringBuilder.append("</div>");
|
||||
stringBuilder.insert(0,"<div>");
|
||||
leftString.add(stringBuilder.toString());
|
||||
}
|
||||
resultMap.put("leftString",leftString);
|
||||
String newTxtTemp = newTxt.replace("i#2\n", "<br/>");
|
||||
List<String> stringList2 = Arrays.asList(newTxtTemp.split("<br/>"));
|
||||
for(String right : stringList2){
|
||||
StringBuilder stringBuilder = new StringBuilder(right);
|
||||
stringBuilder.append("</div>");
|
||||
stringBuilder.insert(0,"<div>");
|
||||
rightString.add(stringBuilder.toString());
|
||||
}
|
||||
resultMap.put("rightString",rightString);
|
||||
}
|
||||
//往条款比对历史表中添加数据
|
||||
if(standHisId != null && !standHisId.isEmpty()){
|
||||
SarFileSplitItemsEO leftEo = sarFileSplitItemsEOService.selectByPrimaryKey(oldItemId);
|
||||
SarFileSplitItemsEO rightEo = sarFileSplitItemsEOService.selectByPrimaryKey(newItemId);
|
||||
String leftItemsText = "";
|
||||
if(leftString != null && !leftString.isEmpty()){
|
||||
for(String left : leftString){
|
||||
leftItemsText += left;
|
||||
}
|
||||
}
|
||||
String rightItemsText = "";
|
||||
if(rightString != null && !rightString.isEmpty()){
|
||||
for(String right : rightString){
|
||||
rightItemsText += right;
|
||||
}
|
||||
}
|
||||
SarItemsCompareHisEO sarItemsCompareHisEO = new SarItemsCompareHisEO();
|
||||
sarItemsCompareHisEO.setId(UUIDUtils.randomUUID20());
|
||||
sarItemsCompareHisEO.setOldItemsId(leftEo.getId());
|
||||
sarItemsCompareHisEO.setOldItemsName(leftEo.getItemsName());
|
||||
sarItemsCompareHisEO.setOldItemsNum(leftEo.getItemsNum());
|
||||
sarItemsCompareHisEO.setOldItemsText(leftItemsText);
|
||||
sarItemsCompareHisEO.setNewItemsId(rightEo.getId());
|
||||
sarItemsCompareHisEO.setNewItemsName(rightEo.getItemsName());
|
||||
sarItemsCompareHisEO.setNewItemsNum(rightEo.getItemsNum());
|
||||
sarItemsCompareHisEO.setNewItemsText(rightItemsText);
|
||||
sarItemsCompareHisEO.setStandHisId(standHisId);
|
||||
sarItemsCompareHisEO.setSimilarityDegree(similarityDegree);
|
||||
sarItemsCompareHisEO.setCreateUser(LoginUserUtil.getUserId());
|
||||
sarItemsCompareHisEO.setModifyUser(LoginUserUtil.getUserId());
|
||||
sarItemsCompareHisEO.setModifyTime(new Date());
|
||||
sarItemsCompareHisEO.setCreateTime(new Date());
|
||||
sarItemsCompareHisEOService.insertSelective(sarItemsCompareHisEO);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> clauseComparison(String oldItemId, String newItemId, String standHisId) {
|
||||
Map<String,Object> resultMap = new HashMap<String, Object>();
|
||||
@@ -326,20 +460,6 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
|
||||
SarStandCompareHisEO sarStandCompareHisEO = new SarStandCompareHisEO();
|
||||
// String id = UUIDUtils.randomUUID20();
|
||||
sarStandCompareHisEO.setId(id);
|
||||
sarStandCompareHisEO.setOldStandId(leftStandId);
|
||||
sarStandCompareHisEO.setNewStandId(rightStandId);
|
||||
sarStandCompareHisEO.setOldFileType(leftInfo.getFileType());
|
||||
sarStandCompareHisEO.setNewFileType(rightInfo.getFileType());
|
||||
sarStandCompareHisEO.setOldStandName(leftInfo.getStandNameSplit());
|
||||
sarStandCompareHisEO.setNewStandName(rightInfo.getStandNameSplit());
|
||||
sarStandCompareHisEO.setOldStandNum(leftInfo.getStandNumSplit());
|
||||
sarStandCompareHisEO.setNewStandNum(rightInfo.getStandNumSplit());
|
||||
sarStandCompareHisEO.setOldSarType(leftInfo.getSarType());
|
||||
sarStandCompareHisEO.setNewSarType(rightInfo.getSarType());
|
||||
sarStandCompareHisEO.setCreateTime(new Date());
|
||||
sarStandCompareHisEO.setModifyTime(new Date());
|
||||
sarStandCompareHisEO.setCreateUser(LoginUserUtil.getUserId());
|
||||
sarStandCompareHisEO.setModifyUser(LoginUserUtil.getUserId());
|
||||
sarStandCompareHisEO.setCompareType(compareType);
|
||||
sarStandCompareHisEO.setCompareStatus("比对完成");
|
||||
dao.updateByPrimaryKeySelective(sarStandCompareHisEO);
|
||||
|
||||
+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">
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao">
|
||||
|
||||
<!-- Result Map-->
|
||||
<resultMap id="resultMap" type="com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO" >
|
||||
<id column="id" property="id" />
|
||||
<result column="STAND_ID" property="standId" />
|
||||
<result column="STAND_NAME" property="standName" />
|
||||
<result column="STAND_TYPE" property="standType"/>
|
||||
<result column="STAND_CODE" property="standCode"/>
|
||||
<result column="XCXSSRQ" property="XCXSSRQ"/>
|
||||
<result column="ZCCSSRQ" property="ZCCSSRQ"/>
|
||||
<result column="SSRQ" property="SSRQ"/>
|
||||
<result column="PUT_TIME" property="putTime" />
|
||||
<result column="APPLY_TYPE" property="applyType" />
|
||||
<result column="ITEMS_ID" property="itemsId" />
|
||||
<result column="ITEMS_NUM" property="itemsNum" />
|
||||
<result column="ITEMS_NAME" property="itemsName" />
|
||||
<result column="POLICY_ID" property="policyId" />
|
||||
<result column="POLICY_NAME" property="policyName" />
|
||||
<result column="DUTY_ENGINEER" property="dutyEngineer" />
|
||||
<result column="DUTY_ENGINEER" property="dutyEngineer" />
|
||||
<result column="DUTY_ENGINEER" property="dutyEngineer" />
|
||||
<result column="issue_time" property="issueTime" />
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao">
|
||||
|
||||
<!-- Result Map-->
|
||||
<resultMap id="resultMap" type="com.adc.da.slrs.sarStandWarning.entity.StandWarningEO" >
|
||||
<id column="ID" property="id" />
|
||||
<result column="STAND_ID" property="standId"></result>
|
||||
<result column="STAND_TYPE" property="standType"></result>
|
||||
<result column="STAND_CODE" property="standCode"></result>
|
||||
<result column="STAND_NAME" property="standName"></result>
|
||||
<result column="PUT_TIME" property="putTime"></result>
|
||||
<result column="APPLY_TYPE" property="applyType"></result>
|
||||
<result column="DUTY_ENGINEER" property="dutyEngineer"></result>
|
||||
<result column="ITEMS_ID" property="itemsId"></result>
|
||||
<result column="ITEMS_NUM" property="itemsNum"></result>
|
||||
<result column="ITEMS_NAME" property="itemsName"></result>
|
||||
<result column="POLICY_ID" property="policyId"></result>
|
||||
<result column="POLICY_NAME" property="policyName"></result>
|
||||
<result column="MARK" property="mark"></result>
|
||||
<result column="POWER" property="power"></result>
|
||||
|
||||
<result column="XCXSSRQ" property="XCXSSRQ"></result>
|
||||
<result column="ZCCSSRQ" property="ZCCSSRQ"></result>
|
||||
<result column="SSRQ" property="SSRQ"></result>
|
||||
</resultMap>
|
||||
|
||||
<sql id="stand_column">
|
||||
warning.id AS ID,
|
||||
sarInfo.ID AS STAND_ID,
|
||||
sarInfo.STAND_TYPE,
|
||||
CONCAT(sarInfo.STAND_SORT,' ',sarInfo.STAND_NUMBER,'-',sarInfo.STAND_YEAR) AS STAND_CODE,
|
||||
sarInfo.STAND_NAME,
|
||||
sarInfo.PUT_TIME,
|
||||
attr.SSRQ as SSRQ
|
||||
</sql>
|
||||
|
||||
|
||||
<sql id="stand_where">
|
||||
<if test="waringEO.standCode != null and waringEO.standCode != ''">
|
||||
AND trim(replace(CONCAT(
|
||||
sarInfo.STAND_SORT,
|
||||
' ',
|
||||
sarInfo.STAND_NUMBER,
|
||||
'-',
|
||||
sarInfo.STAND_YEAR
|
||||
),' ','')) LIKE trim(replace(CONCAT('%',#{waringEO.standCode},'%'),' ',''))
|
||||
</if>
|
||||
<if test="waringEO.standName != null and waringEO.standName != ''">
|
||||
AND sarInfo.STAND_NAME = #{waringEO.standName}
|
||||
</if>
|
||||
<if test="waringEO.startPutTime != null and waringEO.startPutTime != '' and waringEO.endPutTime != null and waringEO.endPutTime != '' ">
|
||||
AND (
|
||||
DATE_FORMAT( sarInfo.PUT_TIME, '%Y-%m-%d') >= DATE_FORMAT(
|
||||
#{waringEO.endPutTime},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
|
||||
AND
|
||||
DATE_FORMAT( sarInfo.PUT_TIME, '%Y-%m-%d') <= DATE_FORMAT(
|
||||
#{waringEO.endPutTime},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="waringEO.startSSRQ != null and waringEO.startSSRQ != '' and waringEO.endSSRQ != null and waringEO.endSSRQ != ''">
|
||||
AND (
|
||||
DATE_FORMAT( attr.SSRQ, '%Y-%m-%d') >= DATE_FORMAT(
|
||||
#{waringEO.startSSRQ},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
|
||||
AND
|
||||
DATE_FORMAT( attr.SSRQ, '%Y-%m-%d') <= DATE_FORMAT(
|
||||
#{waringEO.endSSRQ},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
)
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectWarningPage" resultMap="resultMap">
|
||||
SELECT
|
||||
<include refid="stand_column"/> ,
|
||||
attr.CLLX AS APPLY_TYPE ,
|
||||
attr.ZRGCS AS DUTY_ENGINEER ,
|
||||
NULL AS ITEMS_ID ,
|
||||
NULL AS ITEMS_NUM ,
|
||||
NULL AS ITEMS_NAME ,
|
||||
NULL AS POLICY_ID ,
|
||||
NULL AS POLICY_NAME ,
|
||||
MARK ,
|
||||
POWER,
|
||||
attr.XCXSSRQ AS XCXSSRQ ,
|
||||
attr.ZCCSSRQ AS ZCCSSRQ
|
||||
FROM sar_stand_warning AS warning
|
||||
LEFT JOIN sar_standards_info AS sarInfo on sarInfo.id=warning.STAND_ID
|
||||
LEFT JOIN sar_stand_attr_info AS attr on attr.STAND_ID=warning.STAND_ID
|
||||
<where>
|
||||
POWER = '1'
|
||||
|
||||
<include refid="stand_where"/>
|
||||
<if test="waringEO.applyType != null and waringEO.applyType != ''">
|
||||
AND attr.CLLX LIKE CONCAT('%', #{waringEO.applyType},'%')
|
||||
</if>
|
||||
<if test="waringEO.startXCXSSRQ != null and waringEO.startXCXSSRQ != '' and waringEO.endXCXSSRQ != null and waringEO.endXCXSSRQ != ''">
|
||||
AND (
|
||||
DATE_FORMAT( attr.XCXSSRQ, '%Y-%m-%d') >= DATE_FORMAT(
|
||||
#{waringEO.startXCXSSRQ},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
|
||||
AND
|
||||
DATE_FORMAT( attr.XCXSSRQ, '%Y-%m-%d') <= DATE_FORMAT(
|
||||
#{waringEO.endXCXSSRQ},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="waringEO.startZCCSSRQ != null and waringEO.startZCCSSRQ != '' and waringEO.endZCCSSRQ != null and waringEO.endZCCSSRQ != ''">
|
||||
AND (
|
||||
DATE_FORMAT( attr.ZCCSSRQ, '%Y-%m-%d') >= DATE_FORMAT(
|
||||
#{waringEO.startZCCSSRQ},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
|
||||
AND
|
||||
DATE_FORMAT( attr.ZCCSSRQ, '%Y-%m-%d') <= DATE_FORMAT(
|
||||
#{waringEO.endZCCSSRQ},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
<include refid="stand_column"/> ,
|
||||
items.APPLY_ARCTIC AS APPLY_TYPE ,
|
||||
items.DUTY_ENGINEER AS DUTY_ENGINEER ,
|
||||
items.ID AS ITEMS_ID ,
|
||||
items.ITEMS_NUM ,
|
||||
items.ITEMS_NAME ,
|
||||
NULL AS POLICY_ID ,
|
||||
NULL AS POLICY_NAME ,
|
||||
MARK ,
|
||||
POWER,
|
||||
items.XCXSSRQ AS XCXSSRQ ,
|
||||
items.ZCCSSRQ AS ZCCSSRQ
|
||||
FROM
|
||||
sar_stand_warning AS warning
|
||||
LEFT JOIN sar_standards_info AS sarInfo ON sarInfo.id = warning.STAND_ID
|
||||
LEFT JOIN sar_stand_items AS items ON items.STAND_ID = warning.STAND_ID
|
||||
LEFT JOIN sar_stand_attr_info AS attr ON attr.STAND_ID = warning.STAND_ID
|
||||
<where>
|
||||
POWER = '1'
|
||||
|
||||
<include refid="stand_where"/>
|
||||
<if test="waringEO.applyType != null and waringEO.applyType != ''">
|
||||
AND items.APPLY_ARCTIC LIKE CONCAT('%', #{waringEO.applyType},'%')
|
||||
</if>
|
||||
|
||||
<if test="waringEO.startXCXSSRQ != null and waringEO.startXCXSSRQ != '' and waringEO.endXCXSSRQ != null and waringEO.endXCXSSRQ != ''">
|
||||
AND (
|
||||
DATE_FORMAT( items.XCXSSRQ, '%Y-%m-%d') >= DATE_FORMAT(#{waringEO.startXCXSSRQ},'%Y-%m-%d')
|
||||
AND
|
||||
DATE_FORMAT( items.XCXSSRQ, '%Y-%m-%d') <= DATE_FORMAT(#{waringEO.endXCXSSRQ},'%Y-%m-%d')
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="waringEO.startZCCSSRQ != null and waringEO.startZCCSSRQ != '' and waringEO.endZCCSSRQ != null and waringEO.endZCCSSRQ != ''">
|
||||
AND(
|
||||
DATE_FORMAT( items.ZCCSSRQ, '%Y-%m-%d') >= DATE_FORMAT(#{waringEO.startZCCSSRQ},'%Y-%m-%d')
|
||||
AND
|
||||
DATE_FORMAT( items.ZCCSSRQ, '%Y-%m-%d') <= DATE_FORMAT(#{waringEO.endZCCSSRQ},'%Y-%m-%d' )
|
||||
)
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -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