代码初始化提交。
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,174 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>byd-structuredplugins</artifactId>
|
||||
<groupId>com.jero.boot</groupId>
|
||||
<version>2.5.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>laws-modules</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jero.boot</groupId>
|
||||
<artifactId>jero-system-local-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jero.boot</groupId>
|
||||
<artifactId>laws-module-system</artifactId>
|
||||
<version>${jero.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jero.boot</groupId>
|
||||
<artifactId>laws-base-generater</artifactId>
|
||||
<version>${jero.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-spring-boot-starter-rest-api</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<groupId>org.mybatis</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- Activiti生成流程图 -->
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-image-generator</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-json-converter</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-bpmn-model</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- bpmn 布局 -->
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-bpmn-layout</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xml-apis</groupId>
|
||||
<artifactId>xml-apis</artifactId>
|
||||
<version>1.4.01</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-ext</artifactId>
|
||||
<version>1.10</version>
|
||||
</dependency>
|
||||
|
||||
<!-- xml解析依赖-->
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-codec</artifactId>
|
||||
<version>1.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-css</artifactId>
|
||||
<version>1.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-svg-dom</artifactId>
|
||||
<version>1.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-svggen</artifactId>
|
||||
<version>1.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<version>2.2.3</version>
|
||||
<classifier>jdk15</classifier>
|
||||
<!-- jdk版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
</dependency>
|
||||
<!--中文分词工具包-->
|
||||
<dependency>
|
||||
<groupId>com.janeluo</groupId>
|
||||
<artifactId>ikanalyzer</artifactId>
|
||||
<version>2012_u6</version>
|
||||
</dependency>
|
||||
<!--HTML解析器-->
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.11.3</version>
|
||||
</dependency>
|
||||
<!--语言处理-->
|
||||
<dependency>
|
||||
<groupId>com.hankcs</groupId>
|
||||
<artifactId>hanlp</artifactId>
|
||||
<version>portable-1.7.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.pdfbox</groupId>
|
||||
<artifactId>pdfbox</artifactId>
|
||||
<version>2.0.27</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
<artifactId>json-simple</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.inversoft</groupId>
|
||||
<artifactId>prime-jwt</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
<!-- 导入zip文件使用到 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
<version>1.10.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aspose</groupId>
|
||||
<artifactId>aspose-words</artifactId>
|
||||
<version>21.1</version>
|
||||
<scope>system</scope>
|
||||
<classifier>jdk17</classifier>
|
||||
<systemPath>${project.basedir}/lib/aspose-words-21.1-jdk17-cracked.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jaxen</groupId>
|
||||
<artifactId>jaxen</artifactId>
|
||||
<version>1.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.jeuclid</groupId>
|
||||
<artifactId>jeuclid-core</artifactId>
|
||||
<version>3.1.9</version>
|
||||
</dependency>
|
||||
<!--<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
<version>3.17</version>
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
</project>
|
||||
+314
@@ -0,0 +1,314 @@
|
||||
package com.jero.modules.compare.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.enums.LanguageEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.compare.entity.SarFileCompareDetailVO;
|
||||
import com.jero.modules.compare.entity.SarFileCompareInfo;
|
||||
import com.jero.modules.compare.enums.ReleaseConditionEnum;
|
||||
import com.jero.modules.compare.service.ISarFileCompareInfoService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.util.MyStringUtils;
|
||||
import com.jero.modules.system.vo.IdMapBody;
|
||||
import com.jero.modules.system.vo.IdsMapBody;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 新旧拆分单对比
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-02
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "新旧拆分单对比")
|
||||
@ApiSupport(order = 306)
|
||||
@RestController
|
||||
@RequestMapping("/compare/sarFileCompareInfo")
|
||||
@Slf4j
|
||||
public class SarFileCompareInfoController extends JeroController<SarFileCompareInfo, ISarFileCompareInfoService> {
|
||||
@Autowired
|
||||
private ISarFileCompareInfoService sarFileCompareInfoService;
|
||||
@Autowired
|
||||
private OnlCgformFieldServiceImpl onlCgformFieldService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比-分页列表查询")
|
||||
@ApiOperation(value = "新旧拆分单对比-分页列表查询", notes = "新旧拆分单对比-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperationSupport(order = 1)
|
||||
public Result<?> queryPageList(@ApiParam("当前页") @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@ApiParam("每页条数") @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@ApiParam("国际化") @RequestParam(name = "cut", defaultValue = "cn") String cut,
|
||||
@ApiParam("标准号") @RequestParam(name = "serialNumber", defaultValue = "") String serialNumber,
|
||||
@ApiParam("标题") @RequestParam(name = "title", defaultValue = "") String title,
|
||||
@ApiParam("发布状态") @RequestParam(name = "releaseState", defaultValue = "") String releaseState,
|
||||
HttpServletRequest req) {
|
||||
LambdaQueryWrapper<SarFileCompareInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (MyStringUtils.isNotBlank(serialNumber)) {
|
||||
String finalSerialNumber = serialNumber.replace("%", "\\%");;
|
||||
queryWrapper.and(LambdaQueryWrapper -> LambdaQueryWrapper.like(SarFileCompareInfo::getSerialNumberLeft, finalSerialNumber).or().like(SarFileCompareInfo::getSerialNumberRight, finalSerialNumber));
|
||||
|
||||
}
|
||||
if (MyStringUtils.isNotBlank(title)) {
|
||||
String finalTitle = title.replace("%", "\\%");
|
||||
queryWrapper.and(i -> i.like(SarFileCompareInfo::getTitleLeft, finalTitle).or().like(SarFileCompareInfo::getTitleRight, finalTitle));
|
||||
}
|
||||
if (MyStringUtils.isNotBlank(releaseState)) {
|
||||
queryWrapper.and(LambdaQueryWrapper -> LambdaQueryWrapper.eq(SarFileCompareInfo::getReleaseState, releaseState));
|
||||
}
|
||||
queryWrapper.orderByDesc(SarFileCompareInfo::getCreateTime);
|
||||
Page<SarFileCompareInfo> page = new Page<>(pageNo, pageSize);
|
||||
IPage<SarFileCompareInfo> pageList = sarFileCompareInfoService.page(page, queryWrapper);
|
||||
|
||||
// 提取 编号1、编号2
|
||||
List<String> serialNumberList = new ArrayList<>();
|
||||
List<String> serialNumberLeftList = pageList.getRecords().stream().map(SarFileCompareInfo::getSerialNumberLeft).collect(Collectors.toList());
|
||||
List<String> serialNumberRightList = pageList.getRecords().stream().map(SarFileCompareInfo::getSerialNumberRight).collect(Collectors.toList());
|
||||
serialNumberList.addAll(serialNumberLeftList);
|
||||
serialNumberList.addAll(serialNumberRightList);
|
||||
|
||||
for (SarFileCompareInfo info : pageList.getRecords()) {
|
||||
info.setReleaseStateTitle(ReleaseConditionEnum.getTextByValue(info.getReleaseState(), cut));
|
||||
}
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比-列表查询")
|
||||
@ApiOperation(value = "新旧拆分单对比-列表查询", notes = "新旧拆分单对比-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
public Result<List<SarFileCompareInfo>> queryList() {
|
||||
List<SarFileCompareInfo> list = sarFileCompareInfoService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sarFileCompareInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比-添加")
|
||||
@ApiOperation(value = "新旧拆分单对比-添加", notes = "新旧拆分单对比-添加")
|
||||
@PostMapping(value = "/add")
|
||||
@ApiOperationSupport(order = 3)
|
||||
public Result<?> add(@Validated @RequestBody SarFileCompareInfo sarFileCompareInfo) {
|
||||
sarFileCompareInfoService.add(sarFileCompareInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sarFileCompareInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比-编辑")
|
||||
@ApiOperation(value = "新旧拆分单对比-编辑", notes = "新旧拆分单对比-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
@ApiOperationSupport(order = 4)
|
||||
public Result<?> edit(@Validated @RequestBody SarFileCompareInfo sarFileCompareInfo) {
|
||||
sarFileCompareInfoService.editById(sarFileCompareInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比-通过id删除")
|
||||
@ApiOperation(value = "新旧拆分单对比-通过id删除", notes = "新旧拆分单对比-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
@ApiOperationSupport(order = 5)
|
||||
public Result<?> delete(@RequestBody IdMapBody mapBody) {
|
||||
// 水平越权
|
||||
sarFileCompareInfoService.isHorizontalOverstep(mapBody.getId());
|
||||
sarFileCompareInfoService.deleteById(mapBody.getId());
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比-批量删除")
|
||||
@ApiOperation(value = "新旧拆分单对比-批量删除", notes = "新旧拆分单对比-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
@ApiOperationSupport(order = 6)
|
||||
public Result<?> deleteBatch(@RequestBody IdsMapBody mapBody) {
|
||||
// 水平越权
|
||||
sarFileCompareInfoService.isHorizontalOverstep(mapBody.getIds());
|
||||
this.sarFileCompareInfoService.deleteByIds(Arrays.asList(mapBody.getIds().split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比-通过id查询")
|
||||
@ApiOperation(value = "新旧拆分单对比-通过id查询", notes = "新旧拆分单对比-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
@ApiOperationSupport(order = 7)
|
||||
public Result<?> queryById(@ApiParam("id") @RequestParam(name = "id", required = true) String id) {
|
||||
SarFileCompareInfo sarFileCompareInfo = sarFileCompareInfoService.queryById(id);
|
||||
if (sarFileCompareInfo == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(sarFileCompareInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param sarFileCompareInfo
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SarFileCompareInfo sarFileCompareInfo) {
|
||||
return super.exportXls(request, sarFileCompareInfo, SarFileCompareInfo.class, "新旧拆分单对比");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, SarFileCompareInfo.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发起文档对比
|
||||
*
|
||||
* @param json
|
||||
* @return 对比详情ID
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比-发起文档对比")
|
||||
@ApiOperation(value = "新旧拆分单对比-发起文档对比", notes = "新旧拆分单对比-发起文档对比")
|
||||
@RequestMapping(value = "/fullTextComparison", method = RequestMethod.POST)
|
||||
@ApiOperationSupport(order = 8)
|
||||
public Result<?> fullTextComparison(@ApiParam("JSONObject格式数据") @RequestBody JSONObject json) {
|
||||
try {
|
||||
String leftStandard = json.get("leftStandard").toString();
|
||||
String rightStandard = json.get("rightStandard").toString();
|
||||
String remark = "";
|
||||
if (json.get("remark") != null) {
|
||||
remark = json.get("remark").toString();
|
||||
}
|
||||
String InfoId = sarFileCompareInfoService.fullTextComparison(leftStandard, rightStandard, remark);
|
||||
Result<String> r = new Result<>();
|
||||
r.setSuccess(true);
|
||||
r.setCode(CommonConstant.SC_OK_200);
|
||||
r.setResult(InfoId);
|
||||
return r;
|
||||
} catch (Exception ex) {
|
||||
log.error("发起文档对比失败:" + ex.getMessage());
|
||||
return Result.error("发起文档对比失败!" + ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改发布状态
|
||||
*
|
||||
* @param sarFileCompareInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比-更改发布状态")
|
||||
@ApiOperation(value = "新旧拆分单对比-更改发布状态", notes = "新旧拆分单对比-更改发布状态")
|
||||
@RequestMapping(value = "/changeState", method = RequestMethod.POST)
|
||||
@ApiOperationSupport(order = 9)
|
||||
public Result<?> changeState(@Validated @RequestBody SarFileCompareInfo sarFileCompareInfo) {
|
||||
SarFileCompareInfo info = sarFileCompareInfoService.queryById(sarFileCompareInfo.getId());
|
||||
// 水平越权
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if (!info.getCreateBy().equals(loginUser.getUsername())){
|
||||
if(LanguageEnum.CN.equals(MessageUtils.getLanguage())) {
|
||||
throw new JeroBootException("无权限!");
|
||||
}else{
|
||||
throw new JeroBootException("No access!");
|
||||
}
|
||||
}
|
||||
if (ReleaseConditionEnum.DRAFT.getValue().equals(sarFileCompareInfo.getReleaseState())) {
|
||||
info.setReleaseState(ReleaseConditionEnum.PUBLISHED.getValue());
|
||||
} else {
|
||||
info.setReleaseState(ReleaseConditionEnum.DRAFT.getValue());
|
||||
}
|
||||
sarFileCompareInfoService.editById(info);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 求对比详情
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比-请求对比详情")
|
||||
@ApiOperation(value = "新旧拆分单对比-请求对比详情", notes = "新旧拆分单对比-请求对比详情")
|
||||
@RequestMapping(value = "/getComparisonDetail", method = RequestMethod.POST)
|
||||
@ApiOperationSupport(order = 10)
|
||||
public Result<?> getComparisonDetail(@ApiParam("JSONObject格式数据") @RequestBody JSONObject json) {
|
||||
SarFileCompareDetailVO sarFileCompareDetailVO = sarFileCompareInfoService.getComparisonDetail(json.get("id").toString());
|
||||
return Result.OK(sarFileCompareDetailVO);
|
||||
}
|
||||
|
||||
@AutoLog(value = "新旧拆分单对比-编辑全文评论")
|
||||
@ApiOperation(value = "新旧拆分单对比-编辑全文评论", notes = "新旧拆分单对比-编辑全文评论")
|
||||
@PostMapping(value = "/editComments")
|
||||
@ApiOperationSupport(order = 11)
|
||||
public Result<?> editComments(@Validated @RequestBody SarFileCompareInfo sarFileCompareInfo) {
|
||||
// 水平越权
|
||||
sarFileCompareInfoService.isHorizontalOverstep(sarFileCompareInfo.getId());
|
||||
SarFileCompareInfo info = sarFileCompareInfoService.getById(sarFileCompareInfo.getId());
|
||||
info.setComments(sarFileCompareInfo.getComments());
|
||||
sarFileCompareInfoService.editById(info);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
}
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
package com.jero.modules.compare.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.compare.entity.SarFileCompareItemComment;
|
||||
import com.jero.modules.compare.entity.SarFileCompareResultVO;
|
||||
import com.jero.modules.compare.service.ISarFileCompareInfoService;
|
||||
import com.jero.modules.compare.service.ISarFileCompareItemCommentService;
|
||||
import com.jero.modules.system.vo.IdMapBody;
|
||||
import com.jero.modules.system.vo.IdsMapBody;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 新旧拆分单对比条款评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "新旧拆分单对比条款评论表")
|
||||
@RestController
|
||||
@RequestMapping("/compare/sarFileCompareItemComment")
|
||||
@Slf4j
|
||||
public class SarFileCompareItemCommentController extends JeroController<SarFileCompareItemComment, ISarFileCompareItemCommentService> {
|
||||
@Autowired
|
||||
private ISarFileCompareItemCommentService sarFileCompareItemCommentService;
|
||||
|
||||
@Autowired
|
||||
private ISarFileCompareInfoService sarFileCompareInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款评论表-分页列表查询")
|
||||
@ApiOperation(value = "新旧拆分单对比条款评论表-分页列表查询", notes = "新旧拆分单对比条款评论表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(SarFileCompareItemComment sarFileCompareItemComment,
|
||||
@ApiParam("当前页") @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@ApiParam("每页条数") @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<SarFileCompareItemComment> queryWrapper = QueryGenerator.initQueryWrapper(sarFileCompareItemComment, req.getParameterMap());
|
||||
Page<SarFileCompareItemComment> page = new Page<SarFileCompareItemComment>(pageNo, pageSize);
|
||||
IPage<SarFileCompareItemComment> pageList = sarFileCompareItemCommentService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款评论表-列表查询")
|
||||
@ApiOperation(value = "新旧拆分单对比条款评论表-列表查询", notes = "新旧拆分单对比条款评论表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<SarFileCompareItemComment>> queryList() {
|
||||
List<SarFileCompareItemComment> list = sarFileCompareItemCommentService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions(value = {"docComparison:dataComparison:consistentAssessment", "docComparison:dataComparison:save"}, logical = Logical.OR)
|
||||
@AutoLog(value = "新旧拆分单对比条款评论表-添加")
|
||||
@ApiOperation(value = "新旧拆分单对比条款评论表-添加", notes = "新旧拆分单对比条款评论表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
sarFileCompareItemCommentService.add(sarFileCompareItemComment);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 一致评估
|
||||
* @param sarFileCompareItemComment
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "一致评估")
|
||||
@ApiOperation(value = "一致评估", notes = "一致评估")
|
||||
@PostMapping(value = "/consensusAssessment")
|
||||
public Result<?> consensusAssessment(@Validated @RequestBody SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
sarFileCompareItemCommentService.consensusAssessment(sarFileCompareItemComment);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("docComparison:result:edit")
|
||||
@AutoLog(value = "新旧拆分单对比条款评论表-编辑")
|
||||
@ApiOperation(value = "新旧拆分单对比条款评论表-编辑", notes = "新旧拆分单对比条款评论表-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
sarFileCompareItemCommentService.editById(sarFileCompareItemComment);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@RequiresPermissions("docComparison:result:delete")
|
||||
@AutoLog(value = "新旧拆分单对比条款评论表-通过id删除")
|
||||
@ApiOperation(value = "新旧拆分单对比条款评论表-通过id删除", notes = "新旧拆分单对比条款评论表-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestBody IdMapBody mapBody) {
|
||||
// 水平越权
|
||||
SarFileCompareItemComment sarFileCompareItemComment = sarFileCompareItemCommentService.getById(mapBody.getId());
|
||||
sarFileCompareInfoService.isHorizontalOverstep(sarFileCompareItemComment.getInfoId());
|
||||
sarFileCompareItemCommentService.deleteById(mapBody.getId());
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款评论表-批量删除")
|
||||
@ApiOperation(value = "新旧拆分单对比条款评论表-批量删除", notes = "新旧拆分单对比条款评论表-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestBody IdsMapBody mapBody) {
|
||||
// 水平越权
|
||||
List<String> list = Arrays.asList(mapBody.getIds().split(","));
|
||||
List<SarFileCompareItemComment> sarFileCompareItemComments = sarFileCompareItemCommentService.listByIds(list);
|
||||
String infoIds = sarFileCompareItemComments.stream().map(SarFileCompareItemComment::getInfoId).collect(Collectors.joining(","));
|
||||
sarFileCompareInfoService.isHorizontalOverstep(infoIds);
|
||||
this.sarFileCompareItemCommentService.deleteByIds(list);
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款评论表-通过id查询")
|
||||
@ApiOperation(value = "新旧拆分单对比条款评论表-通过id查询", notes = "新旧拆分单对比条款评论表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@ApiParam("id") @RequestParam(name = "id", required = true) String id) {
|
||||
SarFileCompareItemComment sarFileCompareItemComment = sarFileCompareItemCommentService.queryById(id);
|
||||
if (sarFileCompareItemComment == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(sarFileCompareItemComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询对比结果
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("documentComparison:comparisonResults")
|
||||
@AutoLog(value = "新旧拆分单对比条款评论表-查询对比结果")
|
||||
@ApiOperation(value = "新旧拆分单对比条款评论表-查询对比结果", notes = "新旧拆分单对比条款评论表-查询对比结果")
|
||||
@GetMapping(value = "/queryCompareResult")
|
||||
public Result<SarFileCompareResultVO> queryCompareResult(@ApiParam("文档对比id") @RequestParam(name = "infoId", required = true) String infoId,
|
||||
@ApiParam("评论") @RequestParam(name = "comment", required = false) String comment) {
|
||||
SarFileCompareResultVO res = sarFileCompareItemCommentService.queryCompareResult(infoId,comment);
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
@RequiresPermissions("docComparison:result:exportComparisonReport")
|
||||
@AutoLog(value = "新旧拆分单对比条款评论表-导出结果")
|
||||
@ApiOperation(value = "新旧拆分单对比条款评论表-导出结果", notes = "新旧拆分单对比条款评论表-导出结果")
|
||||
@GetMapping(value = "/exportResXls")
|
||||
public void exportResXls(@ApiParam("文档对比id")@RequestParam(name = "infoId", required = true) String infoId,
|
||||
@ApiParam("选择id") @RequestParam(name = "selectIds", required = false) String selectIds,
|
||||
@ApiParam("include 注释") @RequestParam(name = "includeComments", required = true) boolean includeComments,
|
||||
@ApiParam("国际化") @RequestParam(name = "cut", required = true) String cut,
|
||||
HttpServletResponse response,HttpServletRequest request,
|
||||
@ApiParam("评论") @RequestParam(name = "comment", required = false) String comment) {
|
||||
sarFileCompareItemCommentService.exportResXls(request,response, infoId, selectIds, includeComments, cut,comment);
|
||||
}
|
||||
|
||||
}
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
package com.jero.modules.compare.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.compare.entity.SarFileCompareItem;
|
||||
import com.jero.modules.compare.service.ISarFileCompareItemService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 新旧拆分单对比条款表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-02
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="新旧拆分单对比条款表")
|
||||
@RestController
|
||||
@RequestMapping("/compare/sarFileCompareItem")
|
||||
@Slf4j
|
||||
public class SarFileCompareItemController extends JeroController<SarFileCompareItem, ISarFileCompareItemService> {
|
||||
@Autowired
|
||||
private ISarFileCompareItemService sarFileCompareItemService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款表-分页列表查询")
|
||||
@ApiOperation(value="新旧拆分单对比条款表-分页列表查询", notes="新旧拆分单对比条款表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(SarFileCompareItem sarFileCompareItem,
|
||||
@ApiParam("当前页") @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@ApiParam("每页条数") @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<SarFileCompareItem> queryWrapper = QueryGenerator.initQueryWrapper(sarFileCompareItem, req.getParameterMap());
|
||||
Page<SarFileCompareItem> page = new Page<SarFileCompareItem>(pageNo, pageSize);
|
||||
IPage<SarFileCompareItem> pageList = sarFileCompareItemService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款表-列表查询")
|
||||
@ApiOperation(value="新旧拆分单对比条款表-列表查询", notes="新旧拆分单对比条款表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<SarFileCompareItem>> queryList() {
|
||||
List<SarFileCompareItem> list = sarFileCompareItemService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款表-添加")
|
||||
@ApiOperation(value="新旧拆分单对比条款表-添加", notes="新旧拆分单对比条款表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody SarFileCompareItem sarFileCompareItem) {
|
||||
sarFileCompareItemService.add(sarFileCompareItem);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款表-编辑")
|
||||
@ApiOperation(value="新旧拆分单对比条款表-编辑", notes="新旧拆分单对比条款表-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody SarFileCompareItem sarFileCompareItem) {
|
||||
sarFileCompareItemService.editById(sarFileCompareItem);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款表-通过id删除")
|
||||
@ApiOperation(value="新旧拆分单对比条款表-通过id删除", notes="新旧拆分单对比条款表-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<?> delete(@ApiParam("id") @RequestParam(name="id",required=true) String id) {
|
||||
sarFileCompareItemService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款表-批量删除")
|
||||
@ApiOperation(value="新旧拆分单对比条款表-批量删除", notes="新旧拆分单对比条款表-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@ApiParam("ids") @RequestParam(name="ids",required=true) String ids) {
|
||||
this.sarFileCompareItemService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款表-通过id查询")
|
||||
@ApiOperation(value="新旧拆分单对比条款表-通过id查询", notes="新旧拆分单对比条款表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@ApiParam("id") @RequestParam(name="id",required=true) String id) {
|
||||
SarFileCompareItem sarFileCompareItem = sarFileCompareItemService.queryById(id);
|
||||
if(sarFileCompareItem==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(sarFileCompareItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param sarFileCompareItem
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SarFileCompareItem sarFileCompareItem) {
|
||||
return super.exportXls(request, sarFileCompareItem, SarFileCompareItem.class, "新旧拆分单对比条款表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, SarFileCompareItem.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 条款对比高亮
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比条款表-条款对比高亮")
|
||||
@ApiOperation(value="新旧拆分单对比条款表-条款对比高亮", notes="新旧拆分单对比条款表-条款对比高亮")
|
||||
@GetMapping(value = "/clauseComparison")
|
||||
@RequiresPermissions("documentComparison:edit")
|
||||
public Result<?> clauseComparison(@ApiParam("左侧id") @RequestParam(name="leftId",required=true) String leftId,
|
||||
@ApiParam("右侧id") @RequestParam(name="rightId",required=true) String rightId) {
|
||||
List<String> res = sarFileCompareItemService.clauseComparison(leftId,rightId);
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
}
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
package com.jero.modules.compare.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.compare.entity.SarFileCompareMenu;
|
||||
import com.jero.modules.compare.service.ISarFileCompareMenuService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 新旧拆分单对比目录表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="新旧拆分单对比目录表")
|
||||
@RestController
|
||||
@RequestMapping("/compare/sarFileCompareMenu")
|
||||
@Slf4j
|
||||
public class SarFileCompareMenuController extends JeroController<SarFileCompareMenu, ISarFileCompareMenuService> {
|
||||
@Autowired
|
||||
private ISarFileCompareMenuService sarFileCompareMenuService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sarFileCompareMenu
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比目录表-分页列表查询")
|
||||
@ApiOperation(value="新旧拆分单对比目录表-分页列表查询", notes="新旧拆分单对比目录表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(SarFileCompareMenu sarFileCompareMenu,
|
||||
@ApiParam("当前页") @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@ApiParam("每页条数") @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<SarFileCompareMenu> queryWrapper = QueryGenerator.initQueryWrapper(sarFileCompareMenu, req.getParameterMap());
|
||||
Page<SarFileCompareMenu> page = new Page<SarFileCompareMenu>(pageNo, pageSize);
|
||||
IPage<SarFileCompareMenu> pageList = sarFileCompareMenuService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比目录表-列表查询")
|
||||
@ApiOperation(value="新旧拆分单对比目录表-列表查询", notes="新旧拆分单对比目录表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<SarFileCompareMenu>> queryList() {
|
||||
List<SarFileCompareMenu> list = sarFileCompareMenuService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sarFileCompareMenu
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比目录表-添加")
|
||||
@ApiOperation(value="新旧拆分单对比目录表-添加", notes="新旧拆分单对比目录表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody SarFileCompareMenu sarFileCompareMenu) {
|
||||
sarFileCompareMenuService.add(sarFileCompareMenu);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sarFileCompareMenu
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比目录表-编辑")
|
||||
@ApiOperation(value="新旧拆分单对比目录表-编辑", notes="新旧拆分单对比目录表-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody SarFileCompareMenu sarFileCompareMenu) {
|
||||
sarFileCompareMenuService.editById(sarFileCompareMenu);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比目录表-通过id删除")
|
||||
@ApiOperation(value="新旧拆分单对比目录表-通过id删除", notes="新旧拆分单对比目录表-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<?> delete(@ApiParam("id") @RequestParam(name="id",required=true) String id) {
|
||||
sarFileCompareMenuService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比目录表-批量删除")
|
||||
@ApiOperation(value="新旧拆分单对比目录表-批量删除", notes="新旧拆分单对比目录表-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@ApiParam("ids") @RequestParam(name="ids",required=true) String ids) {
|
||||
this.sarFileCompareMenuService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比目录表-通过id查询")
|
||||
@ApiOperation(value="新旧拆分单对比目录表-通过id查询", notes="新旧拆分单对比目录表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@ApiParam("id") @RequestParam(name="id",required=true) String id) {
|
||||
SarFileCompareMenu sarFileCompareMenu = sarFileCompareMenuService.queryById(id);
|
||||
if(sarFileCompareMenu==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(sarFileCompareMenu);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param sarFileCompareMenu
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SarFileCompareMenu sarFileCompareMenu) {
|
||||
return super.exportXls(request, sarFileCompareMenu, SarFileCompareMenu.class, "新旧拆分单对比目录表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, SarFileCompareMenu.class);
|
||||
}
|
||||
|
||||
}
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
package com.jero.modules.compare.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.compare.entity.SarFileCompareResComVO;
|
||||
import com.jero.modules.compare.entity.SarFileCompareResComment;
|
||||
import com.jero.modules.compare.service.ISarFileCompareResCommentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 新旧拆分单对比结果评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "新旧拆分单对比结果评论表")
|
||||
@RestController
|
||||
@RequestMapping("/compare/sarFileCompareResComment")
|
||||
@Slf4j
|
||||
public class SarFileCompareResCommentController extends JeroController<SarFileCompareResComment, ISarFileCompareResCommentService> {
|
||||
@Autowired
|
||||
private ISarFileCompareResCommentService sarFileCompareResCommentService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sarFileCompareResComment
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比结果评论表-分页列表查询")
|
||||
@ApiOperation(value = "新旧拆分单对比结果评论表-分页列表查询", notes = "新旧拆分单对比结果评论表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(SarFileCompareResComment sarFileCompareResComment,
|
||||
@ApiParam("当前页") @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@ApiParam("每页条数") @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<SarFileCompareResComment> queryWrapper = QueryGenerator.initQueryWrapper(sarFileCompareResComment, req.getParameterMap());
|
||||
Page<SarFileCompareResComment> page = new Page<SarFileCompareResComment>(pageNo, pageSize);
|
||||
IPage<SarFileCompareResComment> pageList = sarFileCompareResCommentService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比结果评论表-列表查询")
|
||||
@ApiOperation(value = "新旧拆分单对比结果评论表-列表查询", notes = "新旧拆分单对比结果评论表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<SarFileCompareResComment>> queryList() {
|
||||
List<SarFileCompareResComment> list = sarFileCompareResCommentService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sarFileCompareResComment
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比结果评论表-添加")
|
||||
@ApiOperation(value = "新旧拆分单对比结果评论表-添加", notes = "新旧拆分单对比结果评论表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
@RequiresPermissions("docComparison:result:comment")
|
||||
public Result<?> add(@Validated @RequestBody SarFileCompareResComment sarFileCompareResComment) {
|
||||
sarFileCompareResCommentService.add(sarFileCompareResComment);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sarFileCompareResComment
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比结果评论表-编辑")
|
||||
@ApiOperation(value = "新旧拆分单对比结果评论表-编辑", notes = "新旧拆分单对比结果评论表-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody SarFileCompareResComment sarFileCompareResComment) {
|
||||
sarFileCompareResCommentService.editById(sarFileCompareResComment);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比结果评论表-通过id删除")
|
||||
@ApiOperation(value = "新旧拆分单对比结果评论表-通过id删除", notes = "新旧拆分单对比结果评论表-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<?> delete(@ApiParam("id") @RequestParam(name = "id", required = true) String id) {
|
||||
sarFileCompareResCommentService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比结果评论表-批量删除")
|
||||
@ApiOperation(value = "新旧拆分单对比结果评论表-批量删除", notes = "新旧拆分单对比结果评论表-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@ApiParam("ids") @RequestParam(name = "ids", required = true) String ids) {
|
||||
this.sarFileCompareResCommentService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新旧拆分单对比结果评论表-通过id查询")
|
||||
@ApiOperation(value = "新旧拆分单对比结果评论表-通过id查询", notes = "新旧拆分单对比结果评论表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@ApiParam("id") @RequestParam(name = "id", required = true) String id) {
|
||||
SarFileCompareResComment sarFileCompareResComment = sarFileCompareResCommentService.queryById(id);
|
||||
if (sarFileCompareResComment == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(sarFileCompareResComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param sarFileCompareResComment
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SarFileCompareResComment sarFileCompareResComment) {
|
||||
return super.exportXls(request, sarFileCompareResComment, SarFileCompareResComment.class, "新旧拆分单对比结果评论表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, SarFileCompareResComment.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据infoId查询列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("docComparison:result:comment")
|
||||
@AutoLog(value = "新旧拆分单对比结果评论表-根据infoId查询列表")
|
||||
@ApiOperation(value = "新旧拆分单对比结果评论表-根据infoId查询列表", notes = "新旧拆分单对比结果评论表-根据infoId查询列表")
|
||||
@GetMapping(value = "/queryListByInfoId")
|
||||
public Result<List<SarFileCompareResComVO>> queryListByInfoId(@ApiParam("id") @RequestParam(name = "id", required = true) String id,
|
||||
@ApiParam("字符") @RequestParam(name = "str", required = false) String str) {
|
||||
List<SarFileCompareResComVO> list = sarFileCompareResCommentService.queryListByInfoId(id, str);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
}
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SarFileCompareDetailVO {
|
||||
|
||||
/**
|
||||
* InfoId
|
||||
*/
|
||||
@ApiModelProperty("InfoId")
|
||||
private String InfoId;
|
||||
/**
|
||||
* 左侧标准号
|
||||
*/
|
||||
@ApiModelProperty("左侧标准号")
|
||||
private String serialNumberLeft;
|
||||
/**
|
||||
* 左侧文件名
|
||||
*/
|
||||
@ApiModelProperty("左侧文件名")
|
||||
private String fileNameLeft;
|
||||
/**
|
||||
* 右侧标准号
|
||||
*/
|
||||
@ApiModelProperty("右侧标准号")
|
||||
private String serialNumberRight;
|
||||
/**
|
||||
* 右侧文件名
|
||||
*/
|
||||
@ApiModelProperty("右侧文件名")
|
||||
private String fileNameRight;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 评论
|
||||
*/
|
||||
@ApiModelProperty("评论")
|
||||
private String comments;
|
||||
/**
|
||||
* 左侧菜单
|
||||
*/
|
||||
@ApiModelProperty("左侧菜单")
|
||||
private List<SarFileCompareMenuVo> menuLeft;
|
||||
/**
|
||||
* 左侧文本
|
||||
*/
|
||||
@ApiModelProperty("左侧文本")
|
||||
private List<SarFileCompareItem> textLeft;
|
||||
/**
|
||||
* 右侧菜单
|
||||
*/
|
||||
@ApiModelProperty("右侧菜单")
|
||||
private List<SarFileCompareMenuVo> menuRight;
|
||||
/**
|
||||
* 右侧文本
|
||||
*/
|
||||
@ApiModelProperty("右侧文本")
|
||||
private List<SarFileCompareItem> textRight;
|
||||
|
||||
public String getInfoId() {
|
||||
return InfoId;
|
||||
}
|
||||
|
||||
public void setInfoId(String infoId) {
|
||||
InfoId = infoId;
|
||||
}
|
||||
|
||||
public String getSerialNumberLeft() {
|
||||
return serialNumberLeft;
|
||||
}
|
||||
|
||||
public void setSerialNumberLeft(String serialNumberLeft) {
|
||||
this.serialNumberLeft = serialNumberLeft;
|
||||
}
|
||||
|
||||
public String getFileNameLeft() {
|
||||
return fileNameLeft;
|
||||
}
|
||||
|
||||
public void setFileNameLeft(String fileNameLeft) {
|
||||
this.fileNameLeft = fileNameLeft;
|
||||
}
|
||||
|
||||
public String getSerialNumberRight() {
|
||||
return serialNumberRight;
|
||||
}
|
||||
|
||||
public void setSerialNumberRight(String serialNumberRight) {
|
||||
this.serialNumberRight = serialNumberRight;
|
||||
}
|
||||
|
||||
public String getFileNameRight() {
|
||||
return fileNameRight;
|
||||
}
|
||||
|
||||
public void setFileNameRight(String fileNameRight) {
|
||||
this.fileNameRight = fileNameRight;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
public void setComments(String comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
public List<SarFileCompareItem> getTextLeft() {
|
||||
return textLeft;
|
||||
}
|
||||
|
||||
public void setTextLeft(List<SarFileCompareItem> textLeft) {
|
||||
this.textLeft = textLeft;
|
||||
}
|
||||
|
||||
public void addTextLeft(SarFileCompareItem text) {
|
||||
if (this.textLeft == null) {
|
||||
this.textLeft = new ArrayList<>();
|
||||
}
|
||||
this.textLeft.add(text);
|
||||
}
|
||||
|
||||
public List<SarFileCompareItem> getTextRight() {
|
||||
return textRight;
|
||||
}
|
||||
|
||||
public void setTextRight(List<SarFileCompareItem> textRight) {
|
||||
this.textRight = textRight;
|
||||
}
|
||||
|
||||
public void addTextRight(SarFileCompareItem text) {
|
||||
if (this.textRight == null) {
|
||||
this.textRight = new ArrayList<>();
|
||||
}
|
||||
this.textRight.add(text);
|
||||
}
|
||||
|
||||
public List<SarFileCompareMenuVo> getMenuLeft() {
|
||||
return menuLeft;
|
||||
}
|
||||
|
||||
public void setMenuLeft(List<SarFileCompareMenuVo> menuLeft) {
|
||||
this.menuLeft = menuLeft;
|
||||
}
|
||||
|
||||
public void addMenuLeft(SarFileCompareMenuVo menu) {
|
||||
if (this.menuLeft == null) {
|
||||
this.menuLeft = new ArrayList<>();
|
||||
}
|
||||
this.menuLeft.add(menu);
|
||||
}
|
||||
|
||||
public List<SarFileCompareMenuVo> getMenuRight() {
|
||||
return menuRight;
|
||||
}
|
||||
|
||||
public void setMenuRight(List<SarFileCompareMenuVo> menuRight) {
|
||||
this.menuRight = menuRight;
|
||||
}
|
||||
|
||||
public void addMenuRight(SarFileCompareMenuVo menu) {
|
||||
if (this.menuRight == null) {
|
||||
this.menuRight = new ArrayList<>();
|
||||
}
|
||||
this.menuRight.add(menu);
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
public class SarFileCompareExcelMergeCell {
|
||||
|
||||
/**
|
||||
* 左边的起始行
|
||||
*/
|
||||
@ApiModelProperty("左边的起始行")
|
||||
Integer leftStart;
|
||||
/**
|
||||
* 左边的结束行
|
||||
*/
|
||||
@ApiModelProperty("左边的结束行")
|
||||
Integer leftEnd;
|
||||
/**
|
||||
* 右边的起始行
|
||||
*/
|
||||
@ApiModelProperty("右边的起始行")
|
||||
Integer rightStart;
|
||||
/**
|
||||
* 右边的结束行
|
||||
*/
|
||||
@ApiModelProperty("右边的结束行")
|
||||
Integer rightEnd;
|
||||
|
||||
public Integer getLeftStart() {
|
||||
return leftStart;
|
||||
}
|
||||
|
||||
public void setLeftStart(Integer leftStart) {
|
||||
this.leftStart = leftStart;
|
||||
}
|
||||
|
||||
public Integer getLeftEnd() {
|
||||
return leftEnd;
|
||||
}
|
||||
|
||||
public void setLeftEnd(Integer leftEnd) {
|
||||
this.leftEnd = leftEnd;
|
||||
}
|
||||
|
||||
public Integer getRightStart() {
|
||||
return rightStart;
|
||||
}
|
||||
|
||||
public void setRightStart(Integer rightStart) {
|
||||
this.rightStart = rightStart;
|
||||
}
|
||||
|
||||
public Integer getRightEnd() {
|
||||
return rightEnd;
|
||||
}
|
||||
|
||||
public void setRightEnd(Integer rightEnd) {
|
||||
this.rightEnd = rightEnd;
|
||||
}
|
||||
|
||||
public SarFileCompareExcelMergeCell() {
|
||||
}
|
||||
|
||||
public SarFileCompareExcelMergeCell(Integer leftStart, Integer leftEnd, Integer rightStart, Integer rightEnd) {
|
||||
this.leftStart = leftStart;
|
||||
this.leftEnd = leftEnd;
|
||||
this.rightStart = rightStart;
|
||||
this.rightEnd = rightEnd;
|
||||
}
|
||||
}
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sar_file_compare_info")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="sar_file_compare_info对象", description="文档对比信息表")
|
||||
public class SarFileCompareInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**文档1*/
|
||||
@Excel(name = "文档1", width = 15)
|
||||
@ApiModelProperty(value = "文档1")
|
||||
private String fileIdLeft;
|
||||
|
||||
/**文档key1*/
|
||||
@Excel(name = "文档key1", width = 15)
|
||||
@ApiModelProperty(value = "文档key1")
|
||||
private String fileKeyLeft;
|
||||
|
||||
/**编号1*/
|
||||
@Excel(name = "编号1", width = 15)
|
||||
@ApiModelProperty(value = "编号1")
|
||||
private String serialNumberLeft;
|
||||
|
||||
/**标题1*/
|
||||
@Excel(name = "标题1", width = 15)
|
||||
@ApiModelProperty(value = "标题1")
|
||||
private String titleLeft;
|
||||
|
||||
/**文本状态1*/
|
||||
@Excel(name = "文本状态1", width = 15)
|
||||
@ApiModelProperty(value = "文本状态1")
|
||||
@Dict(dicCode = "process_manuscript")
|
||||
private String fileTypeLeft;
|
||||
|
||||
/**文件名称1*/
|
||||
@Excel(name = "文件名称1", width = 15)
|
||||
@ApiModelProperty(value = "文件名称1")
|
||||
private String fileNameLeft;
|
||||
|
||||
/**文档2*/
|
||||
@Excel(name = "文档2", width = 15)
|
||||
@ApiModelProperty(value = "文档2")
|
||||
private String fileIdRight;
|
||||
|
||||
/**文档key2*/
|
||||
@Excel(name = "文档key2", width = 15)
|
||||
@ApiModelProperty(value = "文档key2")
|
||||
private String fileKeyRight;
|
||||
|
||||
/**编号2*/
|
||||
@Excel(name = "编号2", width = 15)
|
||||
@ApiModelProperty(value = "编号2")
|
||||
private String serialNumberRight;
|
||||
|
||||
/**标题2*/
|
||||
@Excel(name = "标题2", width = 15)
|
||||
@ApiModelProperty(value = "标题2")
|
||||
private String titleRight;
|
||||
|
||||
/**文本状态2*/
|
||||
@Excel(name = "文本状态2", width = 15)
|
||||
@ApiModelProperty(value = "文本状态2")
|
||||
@Dict(dicCode = "process_manuscript")
|
||||
private String fileTypeRight;
|
||||
|
||||
/**文件名称2*/
|
||||
@Excel(name = "文件名称2", width = 15)
|
||||
@ApiModelProperty(value = "文件名称2")
|
||||
private String fileNameRight;
|
||||
|
||||
/**发布状态*/
|
||||
@Dict(dicCode = "release_state")
|
||||
@Excel(name = "发布状态", width = 15)
|
||||
@ApiModelProperty(value = "发布状态")
|
||||
private String releaseState;
|
||||
|
||||
/**发布状态-翻译后*/
|
||||
@TableField(exist = false)
|
||||
private String releaseStateTitle;
|
||||
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**评论*/
|
||||
@Excel(name = "评论", width = 15)
|
||||
@ApiModelProperty(value = "评论")
|
||||
private String comments;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "标准ID1")
|
||||
private String standardIdLeft;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "标准来源1")
|
||||
private String standardSourceLeft;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "标准ID2")
|
||||
private String standardIdRight;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "标准来源2")
|
||||
private String standardSourceRight;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createNameNo;
|
||||
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sar_file_compare_item")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="sar_file_compare_item对象", description="文档对比信息条款表")
|
||||
public class SarFileCompareItem implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**文档对比信息id*/
|
||||
@Excel(name = "文档对比信息id", width = 15)
|
||||
@ApiModelProperty(value = "文档对比信息id")
|
||||
private String infoId;
|
||||
|
||||
/**目录id*/
|
||||
@Excel(name = "目录id", width = 15)
|
||||
@ApiModelProperty(value = "目录id")
|
||||
private String menuId;
|
||||
|
||||
/**条款名称*/
|
||||
@Excel(name = "条款名称", width = 15)
|
||||
@ApiModelProperty(value = "条款名称")
|
||||
private String itemsName;
|
||||
|
||||
/**条款编号*/
|
||||
@Excel(name = "条款编号", width = 15)
|
||||
@ApiModelProperty(value = "条款编号")
|
||||
private String itemsNum;
|
||||
|
||||
/**条款正文*/
|
||||
@Excel(name = "条款正文", width = 15)
|
||||
@ApiModelProperty(value = "条款正文")
|
||||
private String itemsText;
|
||||
|
||||
/**条款展示编号*/
|
||||
@Excel(name = "条款展示编号", width = 15)
|
||||
@ApiModelProperty(value = "条款展示编号")
|
||||
private Integer itemsDisplayNum;
|
||||
|
||||
/**对应相似条目*/
|
||||
@Excel(name = "对应相似条目", width = 15)
|
||||
@ApiModelProperty(value = "对应相似条目")
|
||||
private Integer targetStand;
|
||||
|
||||
/**条款位置*/
|
||||
@Excel(name = "条款位置", width = 15)
|
||||
@ApiModelProperty(value = "条款位置")
|
||||
private String leftOrRight;
|
||||
|
||||
/**是否被评论(0或1)*/
|
||||
@Excel(name = "是否被评论(0或1)", width = 15)
|
||||
@ApiModelProperty(value = "是否被评论(0或1)")
|
||||
private Integer reviewed;
|
||||
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* 对比条目评论信息展示
|
||||
*/
|
||||
public class SarFileCompareItemComVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
/**
|
||||
* 左侧文件名称
|
||||
*/
|
||||
@ApiModelProperty("左侧文件名称")
|
||||
private String itemsNameLeft;
|
||||
/**
|
||||
* 左侧文件数量
|
||||
*/
|
||||
@ApiModelProperty("左侧文件数量")
|
||||
private String itemsNumLeft;
|
||||
/**
|
||||
* 左侧文件内容
|
||||
*/
|
||||
@ApiModelProperty("左侧文件内容")
|
||||
private String itemsTextLeft;
|
||||
/**
|
||||
* 右侧文件名称
|
||||
*/
|
||||
@ApiModelProperty("右侧文件名称")
|
||||
private String itemsNameRight;
|
||||
/**
|
||||
* 右侧文件数量
|
||||
*/
|
||||
@ApiModelProperty("右侧文件数量")
|
||||
private String itemsNumRight;
|
||||
/**
|
||||
* 右侧文件内容
|
||||
*/
|
||||
@ApiModelProperty("右侧文件内容")
|
||||
private String itemsTextRight;
|
||||
/**
|
||||
* 评论
|
||||
*/
|
||||
@ApiModelProperty("评论")
|
||||
private String comment;
|
||||
|
||||
public SarFileCompareItemComVO() {
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getItemsNameLeft() {
|
||||
return itemsNameLeft;
|
||||
}
|
||||
|
||||
public void setItemsNameLeft(String itemsNameLeft) {
|
||||
this.itemsNameLeft = itemsNameLeft;
|
||||
}
|
||||
|
||||
public String getItemsNumLeft() {
|
||||
return itemsNumLeft;
|
||||
}
|
||||
|
||||
public void setItemsNumLeft(String itemsNumLeft) {
|
||||
this.itemsNumLeft = itemsNumLeft;
|
||||
}
|
||||
|
||||
public String getItemsTextLeft() {
|
||||
return itemsTextLeft;
|
||||
}
|
||||
|
||||
public void setItemsTextLeft(String itemsTextLeft) {
|
||||
this.itemsTextLeft = itemsTextLeft;
|
||||
}
|
||||
|
||||
public String getItemsNameRight() {
|
||||
return itemsNameRight;
|
||||
}
|
||||
|
||||
public void setItemsNameRight(String itemsNameRight) {
|
||||
this.itemsNameRight = itemsNameRight;
|
||||
}
|
||||
|
||||
public String getItemsNumRight() {
|
||||
return itemsNumRight;
|
||||
}
|
||||
|
||||
public void setItemsNumRight(String itemsNumRight) {
|
||||
this.itemsNumRight = itemsNumRight;
|
||||
}
|
||||
|
||||
public String getItemsTextRight() {
|
||||
return itemsTextRight;
|
||||
}
|
||||
|
||||
public void setItemsTextRight(String itemsTextRight) {
|
||||
this.itemsTextRight = itemsTextRight;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
}
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sar_file_compare_item_comment")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="sar_file_compare_item_comment对象", description="文档对比信息条款评论表")
|
||||
public class SarFileCompareItemComment implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**文档对比信息id*/
|
||||
@Excel(name = "文档对比信息id", width = 15)
|
||||
@ApiModelProperty(value = "文档对比信息id")
|
||||
private String infoId;
|
||||
|
||||
/**条款id左*/
|
||||
@Excel(name = "条款id左", width = 15)
|
||||
@ApiModelProperty(value = "条款id左")
|
||||
private String itemsIdLeft;
|
||||
|
||||
/**条款id右*/
|
||||
@Excel(name = "条款id右", width = 15)
|
||||
@ApiModelProperty(value = "条款id右")
|
||||
private String itemsIdRight;
|
||||
|
||||
/**评论*/
|
||||
@Excel(name = "评论", width = 15)
|
||||
@ApiModelProperty(value = "评论")
|
||||
private String comment;
|
||||
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息目录表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sar_file_compare_menu")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="sar_file_compare_menu对象", description="文档对比信息目录表")
|
||||
public class SarFileCompareMenu implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**目录ID*/
|
||||
@Excel(name = "目录ID", width = 15)
|
||||
@ApiModelProperty(value = "目录ID")
|
||||
private String menuId;
|
||||
|
||||
/**信息ID*/
|
||||
@Excel(name = "信息ID", width = 15)
|
||||
@ApiModelProperty(value = "信息ID")
|
||||
private String infoId;
|
||||
|
||||
/**目录名称*/
|
||||
@Excel(name = "目录名称", width = 15)
|
||||
@ApiModelProperty(value = "目录名称")
|
||||
private String name;
|
||||
|
||||
/**父级目录ID*/
|
||||
@Excel(name = "父级目录ID", width = 15)
|
||||
@ApiModelProperty(value = "父级目录ID")
|
||||
private String parentId;
|
||||
|
||||
/**排序序号*/
|
||||
@Excel(name = "排序序号", width = 15)
|
||||
@ApiModelProperty(value = "排序序号")
|
||||
private Integer displaySeq;
|
||||
|
||||
/**目录位置*/
|
||||
@Excel(name = "目录位置", width = 15)
|
||||
@ApiModelProperty(value = "目录位置")
|
||||
private String leftOrRight;
|
||||
|
||||
/**条款名称*/
|
||||
@Excel(name = "条款名称", width = 15)
|
||||
@ApiModelProperty(value = "条款名称")
|
||||
private String itemName;
|
||||
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
public SarFileCompareMenu(String id, String createBy, Date createTime, String updateBy, Date updateTime, String sysOrgCode, String menuId, String infoId, String name, String parentId, Integer displaySeq, String leftOrRight, String itemName, String remarks) {
|
||||
this.id = id;
|
||||
this.createBy = createBy;
|
||||
this.createTime = createTime;
|
||||
this.updateBy = updateBy;
|
||||
this.updateTime = updateTime;
|
||||
this.sysOrgCode = sysOrgCode;
|
||||
this.menuId = menuId;
|
||||
this.infoId = infoId;
|
||||
this.name = name;
|
||||
this.parentId = parentId;
|
||||
this.displaySeq = displaySeq;
|
||||
this.leftOrRight = leftOrRight;
|
||||
this.itemName = itemName;
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public SarFileCompareMenu() {
|
||||
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import com.jero.modules.system.util.MyStringUtils;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SarFileCompareMenuVo extends SarFileCompareMenu {
|
||||
/**
|
||||
* 键
|
||||
*/
|
||||
@ApiModelProperty("键")
|
||||
private String key;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@ApiModelProperty("标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 子集
|
||||
*/
|
||||
@ApiModelProperty("子集")
|
||||
private List<SarFileCompareMenuVo> children;
|
||||
|
||||
public SarFileCompareMenuVo(SarFileCompareMenu menu) {
|
||||
super();
|
||||
this.setId(menu.getId());
|
||||
this.setCreateBy(menu.getCreateBy());
|
||||
this.setCreateTime(menu.getCreateTime());
|
||||
this.setUpdateBy(menu.getUpdateBy());
|
||||
this.setUpdateTime(menu.getUpdateTime());
|
||||
this.setSysOrgCode(menu.getSysOrgCode());
|
||||
this.setMenuId(menu.getMenuId());
|
||||
this.setInfoId(menu.getInfoId());
|
||||
this.setName(menu.getName());
|
||||
this.setParentId(menu.getParentId());
|
||||
this.setDisplaySeq(menu.getDisplaySeq());
|
||||
this.setLeftOrRight(menu.getLeftOrRight());
|
||||
this.setItemName(menu.getItemName());
|
||||
this.setKey(menu.getId());
|
||||
this.setTitle(menu.getName());
|
||||
if(MyStringUtils.isNoneBlank(menu.getItemName())){
|
||||
this.setTitle(menu.getName() + menu.getItemName());
|
||||
}
|
||||
this.setRemarks(menu.getRemarks());
|
||||
}
|
||||
|
||||
public List<SarFileCompareMenuVo> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<SarFileCompareMenuVo> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public void addChild(SarFileCompareMenuVo child) {
|
||||
if (null == this.children) {
|
||||
this.children = new ArrayList<>();
|
||||
}
|
||||
children.add(child);
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SarFileCompareResComVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
private String createTime;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@ApiModelProperty("内容")
|
||||
private String content;
|
||||
/**
|
||||
* 子集
|
||||
*/
|
||||
@ApiModelProperty("子集")
|
||||
private List<SarFileCompareResComVO> resComVoList;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public List<SarFileCompareResComVO> getResComVoList() {
|
||||
return resComVoList;
|
||||
}
|
||||
|
||||
public void setResComVoList(List<SarFileCompareResComVO> resComVoList) {
|
||||
this.resComVoList = resComVoList;
|
||||
}
|
||||
|
||||
public void addResComVo(SarFileCompareResComVO resComVo) {
|
||||
if (null == this.resComVoList) {
|
||||
this.resComVoList = new ArrayList<>();
|
||||
}
|
||||
this.resComVoList.add(resComVo);
|
||||
}
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息结果评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sar_file_compare_res_comment")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="sar_file_compare_res_comment对象", description="文档对比信息结果评论表")
|
||||
public class SarFileCompareResComment implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**文档对比信息id*/
|
||||
@Excel(name = "文档对比信息id", width = 15)
|
||||
@ApiModelProperty(value = "文档对比信息id")
|
||||
private String infoId;
|
||||
|
||||
/**回复评论ID*/
|
||||
@Excel(name = "回复评论ID", width = 15)
|
||||
@ApiModelProperty(value = "回复评论ID")
|
||||
private String parentId;
|
||||
|
||||
/**评论*/
|
||||
@Excel(name = "评论", width = 15)
|
||||
@ApiModelProperty(value = "评论")
|
||||
private String comment;
|
||||
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SarFileCompareResultVO {
|
||||
|
||||
/**
|
||||
* infoId
|
||||
*/
|
||||
@ApiModelProperty("infoId")
|
||||
private String infoId;
|
||||
/**
|
||||
* 左侧标准号
|
||||
*/
|
||||
@ApiModelProperty("左侧标准号")
|
||||
private String serialNumberLeft;
|
||||
/**
|
||||
* 左侧文件名
|
||||
*/
|
||||
@ApiModelProperty("左侧文件名")
|
||||
private String fileNameLeft;
|
||||
/**
|
||||
* 左侧文件id
|
||||
*/
|
||||
@ApiModelProperty("左侧文件id")
|
||||
private String fileIdLeft;
|
||||
/**
|
||||
* 右侧标准号
|
||||
*/
|
||||
@ApiModelProperty("右侧标准号")
|
||||
private String serialNumberRight;
|
||||
/**
|
||||
* 右侧文件名
|
||||
*/
|
||||
@ApiModelProperty("右侧文件名")
|
||||
private String fileNameRight;
|
||||
/**
|
||||
* 右侧文件id
|
||||
*/
|
||||
@ApiModelProperty("右侧文件id")
|
||||
private String fileIdRight;
|
||||
/**
|
||||
* 对比条目评论信息
|
||||
*/
|
||||
@ApiModelProperty("对比条目评论信息")
|
||||
private List<SarFileCompareItemComVO> resList;
|
||||
/**
|
||||
* 评论
|
||||
*/
|
||||
@ApiModelProperty("评论")
|
||||
private String comments;
|
||||
|
||||
public SarFileCompareResultVO() {
|
||||
}
|
||||
|
||||
public String getInfoId() {
|
||||
return infoId;
|
||||
}
|
||||
|
||||
public void setInfoId(String infoId) {
|
||||
this.infoId = infoId;
|
||||
}
|
||||
|
||||
public String getSerialNumberLeft() {
|
||||
return serialNumberLeft;
|
||||
}
|
||||
|
||||
public void setSerialNumberLeft(String serialNumberLeft) {
|
||||
this.serialNumberLeft = serialNumberLeft;
|
||||
}
|
||||
|
||||
public String getFileNameLeft() {
|
||||
return fileNameLeft;
|
||||
}
|
||||
|
||||
public void setFileNameLeft(String fileNameLeft) {
|
||||
this.fileNameLeft = fileNameLeft;
|
||||
}
|
||||
|
||||
public String getSerialNumberRight() {
|
||||
return serialNumberRight;
|
||||
}
|
||||
|
||||
public void setSerialNumberRight(String serialNumberRight) {
|
||||
this.serialNumberRight = serialNumberRight;
|
||||
}
|
||||
|
||||
public String getFileNameRight() {
|
||||
return fileNameRight;
|
||||
}
|
||||
|
||||
public void setFileNameRight(String fileNameRight) {
|
||||
this.fileNameRight = fileNameRight;
|
||||
}
|
||||
|
||||
public List<SarFileCompareItemComVO> getResList() {
|
||||
return resList;
|
||||
}
|
||||
|
||||
public void setResList(List<SarFileCompareItemComVO> resList) {
|
||||
this.resList = resList;
|
||||
}
|
||||
|
||||
public void addRes(SarFileCompareItemComVO item) {
|
||||
if (this.resList == null) {
|
||||
this.resList = new ArrayList<>();
|
||||
}
|
||||
this.resList.add(item);
|
||||
}
|
||||
|
||||
public String getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
public void setComments(String comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
public String getFileIdLeft() {
|
||||
return fileIdLeft;
|
||||
}
|
||||
|
||||
public void setFileIdLeft(String fileIdLeft) {
|
||||
this.fileIdLeft = fileIdLeft;
|
||||
}
|
||||
|
||||
public String getFileIdRight() {
|
||||
return fileIdRight;
|
||||
}
|
||||
|
||||
public void setFileIdRight(String fileIdRight) {
|
||||
this.fileIdRight = fileIdRight;
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.jero.modules.compare.enums;
|
||||
|
||||
public enum AssessConsistencyEnum {
|
||||
|
||||
SAME("一致"),
|
||||
DIFFERENT("差异");
|
||||
|
||||
private String value;
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
AssessConsistencyEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.jero.modules.compare.enums;
|
||||
|
||||
import com.jero.common.constant.enums.LanguageEnum;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 发布情况枚举类
|
||||
*/
|
||||
public enum ReleaseConditionEnum {
|
||||
|
||||
PUBLISHED("已发布","published","Published"),
|
||||
DRAFT("草稿","draft","Draft"),
|
||||
;
|
||||
|
||||
|
||||
String cnName;
|
||||
String enName;
|
||||
String value;
|
||||
|
||||
private ReleaseConditionEnum(String cnName, String value, String enName) {
|
||||
this.cnName = cnName;
|
||||
this.value = value;
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getCnName() {
|
||||
return cnName;
|
||||
}
|
||||
|
||||
public void setCnName(String cnName) {
|
||||
this.cnName = cnName;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static String getTextByValue(String value,String cut) {
|
||||
ReleaseConditionEnum[] values = values();
|
||||
for (ReleaseConditionEnum releaseConditionEnum : values) {
|
||||
if (releaseConditionEnum.value.equals(value)) {
|
||||
if(StringUtils.equals(cut, LanguageEnum.CN.getValue())){
|
||||
return releaseConditionEnum.cnName;
|
||||
}else if(StringUtils.equals(cut, LanguageEnum.EN.getValue())){
|
||||
return releaseConditionEnum.enName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.compare.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.compare.entity.SarFileCompareInfo;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SarFileCompareInfoMapper extends BaseMapper<SarFileCompareInfo> {
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.compare.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.compare.entity.SarFileCompareItemComment;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SarFileCompareItemCommentMapper extends BaseMapper<SarFileCompareItemComment> {
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.compare.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.compare.entity.SarFileCompareItem;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SarFileCompareItemMapper extends BaseMapper<SarFileCompareItem> {
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.compare.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.compare.entity.SarFileCompareMenu;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息目录表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SarFileCompareMenuMapper extends BaseMapper<SarFileCompareMenu> {
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.compare.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.compare.entity.SarFileCompareResComment;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息结果评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SarFileCompareResCommentMapper extends BaseMapper<SarFileCompareResComment> {
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?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.jero.modules.compare.mapper.SarFileCompareInfoMapper">
|
||||
<resultMap id="SarFileCompareInfoResultMap" type="com.jero.modules.compare.entity.SarFileCompareInfo">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="file_id_left" property="fileIdLeft" />
|
||||
<result column="file_key_left" property="fileKeyLeft" />
|
||||
<result column="serial_number_left" property="serialNumberLeft" />
|
||||
<result column="title_left" property="titleLeft" />
|
||||
<result column="file_type_left" property="fileTypeLeft" />
|
||||
<result column="file_name_left" property="fileNameLeft" />
|
||||
<result column="file_id_right" property="fileIdRight" />
|
||||
<result column="file_key_right" property="fileKeyRight" />
|
||||
<result column="serial_number_right" property="serialNumberRight" />
|
||||
<result column="title_right" property="titleRight" />
|
||||
<result column="file_type_right" property="fileTypeRight" />
|
||||
<result column="file_name_right" property="fileNameRight" />
|
||||
<result column="release_state" property="releaseState" />
|
||||
<result column="remark" property="remark" />
|
||||
<result column="comments" property="comments" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?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.jero.modules.compare.mapper.SarFileCompareItemCommentMapper">
|
||||
<resultMap id="SarFileCompareItemCommentResultMap" type="com.jero.modules.compare.entity.SarFileCompareItemComment">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="info_id" property="infoId" />
|
||||
<result column="items_id_left" property="itemsIdLeft" />
|
||||
<result column="items_id_right" property="itemsIdRight" />
|
||||
<result column="comment" property="comment" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?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.jero.modules.compare.mapper.SarFileCompareItemMapper">
|
||||
<resultMap id="SarFileCompareItemResultMap" type="com.jero.modules.compare.entity.SarFileCompareItem">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="info_id" property="infoId" />
|
||||
<result column="menu_id" property="menuId" />
|
||||
<result column="items_name" property="itemsName" />
|
||||
<result column="items_num" property="itemsNum" />
|
||||
<result column="items_text" property="itemsText" />
|
||||
<result column="items_display_num" property="itemsDisplayNum" />
|
||||
<result column="target_stand" property="targetStand" />
|
||||
<result column="left_or_right" property="leftOrRight" />
|
||||
<result column="remark" property="remark" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?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.jero.modules.compare.mapper.SarFileCompareMenuMapper">
|
||||
<resultMap id="SarFileCompareMenuResultMap" type="com.jero.modules.compare.entity.SarFileCompareMenu">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="menu_id" property="menuId" />
|
||||
<result column="info_id" property="infoId" />
|
||||
<result column="name" property="name" />
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="display_seq" property="displaySeq" />
|
||||
<result column="left_or_right" property="leftOrRight" />
|
||||
<result column="item_name" property="itemName" />
|
||||
<result column="remarks" property="remarks" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?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.jero.modules.compare.mapper.SarFileCompareResCommentMapper">
|
||||
<resultMap id="SarFileCompareResCommentResultMap" type="com.jero.modules.compare.entity.SarFileCompareResComment">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="info_id" property="infoId" />
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="comment" property="comment" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package com.jero.modules.compare.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.compare.entity.SarFileCompareDetailVO;
|
||||
import com.jero.modules.compare.entity.SarFileCompareInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-02
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISarFileCompareInfoService extends IService<SarFileCompareInfo> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareInfo
|
||||
* @return
|
||||
*/
|
||||
void add(SarFileCompareInfo sarFileCompareInfo);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareInfo
|
||||
* @return
|
||||
*/
|
||||
void editById(SarFileCompareInfo sarFileCompareInfo);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SarFileCompareInfo queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SarFileCompareInfo> queryList();
|
||||
|
||||
/**
|
||||
* 发起全文对比
|
||||
*
|
||||
* @param leftStandard
|
||||
* @param rightStandard
|
||||
* @param remark
|
||||
* @return
|
||||
*/
|
||||
String fullTextComparison(String leftStandard, String rightStandard, String remark) throws Exception;
|
||||
|
||||
/**
|
||||
* 求对比详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SarFileCompareDetailVO getComparisonDetail(String id);
|
||||
|
||||
/**
|
||||
* 是否水平越权
|
||||
* @param ids
|
||||
*/
|
||||
void isHorizontalOverstep(String ids);
|
||||
|
||||
void deleteByStandardId(String ids);
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.jero.modules.compare.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.compare.entity.SarFileCompareItemComment;
|
||||
import com.jero.modules.compare.entity.SarFileCompareResultVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISarFileCompareItemCommentService extends IService<SarFileCompareItemComment> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @return
|
||||
*/
|
||||
void add(SarFileCompareItemComment sarFileCompareItemComment);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @return
|
||||
*/
|
||||
void editById(SarFileCompareItemComment sarFileCompareItemComment);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SarFileCompareItemComment queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SarFileCompareItemComment> queryList();
|
||||
|
||||
SarFileCompareResultVO queryCompareResult(String infoId,String comment);
|
||||
|
||||
void exportResXls(HttpServletRequest request,HttpServletResponse response, String infoId, String selectIds, boolean includeComments, String cut,String comment);
|
||||
|
||||
void consensusAssessment(SarFileCompareItemComment sarFileCompareItemComment);
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package com.jero.modules.compare.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.compare.entity.SarFileCompareItem;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-02
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISarFileCompareItemService extends IService<SarFileCompareItem> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @return
|
||||
*/
|
||||
void add(SarFileCompareItem sarFileCompareItem);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @return
|
||||
*/
|
||||
void editById(SarFileCompareItem sarFileCompareItem);
|
||||
|
||||
/**
|
||||
* 标记被评论过
|
||||
* @param id
|
||||
*/
|
||||
void updateReviewedById(String id);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SarFileCompareItem queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SarFileCompareItem> queryList();
|
||||
|
||||
List<SarFileCompareItem> queryListByInfoId(String infoId);
|
||||
|
||||
Map<String, SarFileCompareItem> queryMapByInfoId(String infoId);
|
||||
|
||||
List<String> clauseComparison(String lid,String rid);
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.jero.modules.compare.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.compare.entity.SarFileCompareMenu;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息目录表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISarFileCompareMenuService extends IService<SarFileCompareMenu> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareMenu
|
||||
* @return
|
||||
*/
|
||||
void add(SarFileCompareMenu sarFileCompareMenu);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareMenu
|
||||
* @return
|
||||
*/
|
||||
void editById(SarFileCompareMenu sarFileCompareMenu);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SarFileCompareMenu queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SarFileCompareMenu> queryList();
|
||||
|
||||
|
||||
List<SarFileCompareMenu> queryListByInfoId(String infoId);
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package com.jero.modules.compare.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.compare.entity.SarFileCompareResComVO;
|
||||
import com.jero.modules.compare.entity.SarFileCompareResComment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息结果评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISarFileCompareResCommentService extends IService<SarFileCompareResComment> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareResComment
|
||||
* @return
|
||||
*/
|
||||
void add(SarFileCompareResComment sarFileCompareResComment);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareResComment
|
||||
* @return
|
||||
*/
|
||||
void editById(SarFileCompareResComment sarFileCompareResComment);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SarFileCompareResComment queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SarFileCompareResComment> queryList();
|
||||
|
||||
List<SarFileCompareResComVO> queryListByInfoId(String id, String str);
|
||||
|
||||
}
|
||||
+467
@@ -0,0 +1,467 @@
|
||||
package com.jero.modules.compare.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.LanguageEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.modules.compare.entity.*;
|
||||
import com.jero.modules.compare.enums.ReleaseConditionEnum;
|
||||
import com.jero.modules.compare.mapper.SarFileCompareInfoMapper;
|
||||
import com.jero.modules.compare.service.ISarFileCompareInfoService;
|
||||
import com.jero.modules.compare.service.ISarFileCompareItemService;
|
||||
import com.jero.modules.compare.service.ISarFileCompareMenuService;
|
||||
import com.jero.modules.compare.utils.CompHanLPUtils;
|
||||
import com.jero.modules.compare.utils.CompareConst;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
import com.jero.modules.split.service.IFileSplitItemsEOService;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.split.service.ISarFileSplitMenuEOService;
|
||||
import com.jero.modules.system.util.MyStringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-02
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInfoMapper, SarFileCompareInfo> implements ISarFileCompareInfoService {
|
||||
|
||||
@Autowired
|
||||
private ISarFileSplitMenuEOService sarFileSplitMenuEOService;
|
||||
|
||||
@Autowired
|
||||
private IFileSplitItemsEOService sarFileSplitItemsEOService;
|
||||
|
||||
@Autowired
|
||||
private ISarFileSplitInfoService sarFileSplitInfoEOService;
|
||||
|
||||
@Autowired
|
||||
private ISarFileCompareInfoService sarFileCompareInfoService;
|
||||
|
||||
@Autowired
|
||||
private ISarFileCompareItemService sarFileCompareItemService;
|
||||
|
||||
@Autowired
|
||||
private ISarFileCompareMenuService sarFileCompareMenuService;
|
||||
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(SarFileCompareInfo sarFileCompareInfo) {
|
||||
Date now = new Date();
|
||||
sarFileCompareInfo.setCreateTime(now);
|
||||
sarFileCompareInfo.setUpdateTime(now);
|
||||
save(sarFileCompareInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(SarFileCompareInfo sarFileCompareInfo) {
|
||||
Date now = new Date();
|
||||
sarFileCompareInfo.setUpdateTime(now);
|
||||
saveOrUpdate(sarFileCompareInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SarFileCompareInfo queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SarFileCompareInfo> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 全文对比
|
||||
*
|
||||
* @param leftStandard
|
||||
* @param rightStandard
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String fullTextComparison(String leftStandard, String rightStandard, String remark) throws Exception {
|
||||
SarFileCompareInfo sfcInfo = addStandCompareHis(leftStandard, rightStandard, remark);
|
||||
//文档对比信息目录
|
||||
List<SarFileSplitMenuEO> leftMenuEOList = sarFileSplitMenuEOService.queryByInfoId(leftStandard);
|
||||
Map<String, SarFileCompareMenu> leftMenuMap = wrapperMenuMap(leftMenuEOList, sfcInfo.getId(), CompareConst.POS_LEFT);
|
||||
sarFileCompareMenuService.saveBatch(leftMenuMap.values());
|
||||
List<SarFileSplitMenuEO> rightMenuEOList = sarFileSplitMenuEOService.queryByInfoId(rightStandard);
|
||||
Map<String, SarFileCompareMenu> rightMenuMap = wrapperMenuMap(rightMenuEOList, sfcInfo.getId(), CompareConst.POS_RIGHT);
|
||||
sarFileCompareMenuService.saveBatch(rightMenuMap.values());
|
||||
//文档对比信息条款
|
||||
List<SarFileSplitItemsEO> leftItemEOList = sarFileSplitItemsEOService.selectByInfoId(leftStandard);
|
||||
List<SarFileCompareItem> leftItemList = wrapperItemList(leftItemEOList, sfcInfo.getId(), leftMenuMap, CompareConst.POS_LEFT);
|
||||
List<SarFileSplitItemsEO> rightItemEOList = sarFileSplitItemsEOService.selectByInfoId(rightStandard);
|
||||
List<SarFileCompareItem> rightItemList = wrapperItemList(rightItemEOList, sfcInfo.getId(), rightMenuMap, CompareConst.POS_RIGHT);
|
||||
|
||||
if (!leftItemList.isEmpty() && !rightItemList.isEmpty()) {
|
||||
//双重循环找到相似度最高的条款做关联
|
||||
for (int i = 0; i < leftItemList.size(); i++) {
|
||||
String leftTxt = leftItemList.get(i).getItemsText();
|
||||
//初始化 假设未找到相似条目
|
||||
leftItemList.get(i).setTargetStand(-1);
|
||||
//定义初始化的相似度
|
||||
double compareSimilarity = 0.0;
|
||||
if (null != leftTxt && !leftTxt.isEmpty()) {
|
||||
for (int j = 0; j < rightItemList.size(); j++) {
|
||||
if(null == rightItemList.get(j).getTargetStand()){
|
||||
rightItemList.get(j).setTargetStand(-1);
|
||||
}
|
||||
String rightTxt = rightItemList.get(j).getItemsText();
|
||||
if (null != rightTxt && !rightTxt.isEmpty()) {
|
||||
double similarity = 0;
|
||||
// 使用正则表达式判断是否是纯<img>标签,不以</p>结尾,也不以</table>结尾
|
||||
String leftTxtTrim = leftTxt.trim();
|
||||
String rightTxtTrim = rightTxt.trim();
|
||||
boolean leftTxtMatches = Pattern.matches("<img[^>]+>(?<!</p>)(?<!</table>)", leftTxtTrim);
|
||||
boolean rightTxtMatches = Pattern.matches("<img[^>]+>(?<!</p>)(?<!</table>)", rightTxtTrim);
|
||||
if (leftTxtMatches && rightTxtMatches){
|
||||
// 如果是纯img标签直接对比内容
|
||||
if (leftTxtTrim.equals(rightTxtTrim)){
|
||||
similarity = 1;
|
||||
}
|
||||
}else {
|
||||
similarity = CompHanLPUtils.findSimilarity(leftTxt.trim(), rightTxt.trim());
|
||||
}
|
||||
//如果相似度超过0.6 并且该相似度比之前的相似度还高,那么该条款目前相似度最高
|
||||
if (similarity >= 0.6 && compareSimilarity < similarity) {
|
||||
compareSimilarity = similarity;
|
||||
leftItemList.get(i).setTargetStand(j);
|
||||
}
|
||||
}
|
||||
if (j >= rightItemList.size() - 1) {
|
||||
int ts = leftItemList.get(i).getTargetStand();
|
||||
if (ts > -1) {
|
||||
rightItemList.get(ts).setTargetStand(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sarFileCompareItemService.saveBatch(leftItemList);
|
||||
sarFileCompareItemService.saveBatch(rightItemList);
|
||||
return sfcInfo.getId();
|
||||
}
|
||||
|
||||
|
||||
private Map<String, SarFileCompareMenu> wrapperMenuMap(List<SarFileSplitMenuEO> list, String infoId, String leftOrRight) {
|
||||
Map<String, SarFileCompareMenu> resMap = new HashMap<>();
|
||||
for (SarFileSplitMenuEO meo : list) {
|
||||
SarFileCompareMenu sfcMenu = new SarFileCompareMenu();
|
||||
sfcMenu.setInfoId(infoId);
|
||||
sfcMenu.setMenuId(meo.getId());
|
||||
sfcMenu.setName(meo.getName());
|
||||
sfcMenu.setItemName(meo.getItemName());
|
||||
sfcMenu.setParentId(meo.getPId());
|
||||
sfcMenu.setDisplaySeq(meo.getDisplaySeq().intValue());
|
||||
sfcMenu.setRemarks(meo.getRemarks());
|
||||
sfcMenu.setLeftOrRight(leftOrRight);
|
||||
resMap.put(sfcMenu.getMenuId(), sfcMenu);
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
|
||||
private List<SarFileCompareItem> wrapperItemList(List<SarFileSplitItemsEO> list, String infoId, Map<String, SarFileCompareMenu> menuMap, String leftOrRight) {
|
||||
List<SarFileCompareItem> resList = new ArrayList<>();
|
||||
for (SarFileSplitItemsEO itemsEO : list) {
|
||||
SarFileCompareItem item = new SarFileCompareItem();
|
||||
item.setInfoId(infoId);
|
||||
item.setItemsName(itemsEO.getItemTitle());
|
||||
item.setMenuId(itemsEO.getMenuId());
|
||||
item.setItemsNum(itemsEO.getItemNum());
|
||||
item.setItemsText(itemsEO.getItemContent());
|
||||
SarFileCompareMenu menu = menuMap.get(itemsEO.getMenuId());
|
||||
if (menu != null) {
|
||||
item.setItemsDisplayNum(menu.getDisplaySeq());
|
||||
}
|
||||
item.setLeftOrRight(leftOrRight);
|
||||
item.setReviewed(CompareConst.NO_REVIEWED);
|
||||
resList.add(item);
|
||||
}
|
||||
Collections.sort(resList, Comparator.comparingInt(SarFileCompareItem::getItemsDisplayNum));
|
||||
return resList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存比对历史
|
||||
*
|
||||
* @param leftStandId
|
||||
* @param rightStandId
|
||||
* @param remark
|
||||
* @throws Exception
|
||||
*/
|
||||
public SarFileCompareInfo addStandCompareHis(String leftStandId, String rightStandId, String remark) throws Exception {
|
||||
SarFileSplitInfoEO leftInfo = sarFileSplitInfoEOService.queryById(leftStandId);
|
||||
SarFileSplitInfoEO rightInfo = sarFileSplitInfoEOService.queryById(rightStandId);
|
||||
//保存标准比对历史表数据
|
||||
SarFileCompareInfo sarFileCompareInfo = new SarFileCompareInfo();
|
||||
String id = UUID.randomUUID().toString();
|
||||
sarFileCompareInfo.setId(id);
|
||||
sarFileCompareInfo.setFileIdLeft(leftInfo.getFileId());
|
||||
// 处理文档库id字段 根据编号和标题查询
|
||||
// List<Map<String, Object>> bussDocumentLibraryEOList = bussDocumentLibraryEOService.getListBySerialNumber(leftInfo.getSerialNumber());
|
||||
// if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList)) {
|
||||
// sarFileCompareInfo.setFileKeyLeft(bussDocumentLibraryEOList.get(0).get("id").toString());
|
||||
// }
|
||||
sarFileCompareInfo.setFileKeyLeft(leftInfo.getStandardId());
|
||||
sarFileCompareInfo.setFileNameLeft(leftInfo.getFileName());
|
||||
sarFileCompareInfo.setTitleLeft(leftInfo.getTitle());
|
||||
sarFileCompareInfo.setFileTypeLeft(leftInfo.getFileType());
|
||||
sarFileCompareInfo.setSerialNumberLeft(leftInfo.getSerialNumber());
|
||||
|
||||
sarFileCompareInfo.setFileIdRight(rightInfo.getFileId());
|
||||
// 处理文档库id字段 根据编号和标题查询
|
||||
// List<Map<String, Object>> bussDocumentLibraryEOList1 = bussDocumentLibraryEOService.getListBySerialNumber(rightInfo.getSerialNumber());
|
||||
// if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList1)) {
|
||||
// sarFileCompareInfo.setFileKeyRight(bussDocumentLibraryEOList1.get(0).get("id").toString());
|
||||
// }
|
||||
sarFileCompareInfo.setFileKeyRight(rightInfo.getStandardId());
|
||||
sarFileCompareInfo.setFileNameRight(rightInfo.getFileName());
|
||||
sarFileCompareInfo.setFileTypeRight(rightInfo.getFileType());
|
||||
sarFileCompareInfo.setTitleRight(rightInfo.getTitle());
|
||||
sarFileCompareInfo.setSerialNumberRight(rightInfo.getSerialNumber());
|
||||
|
||||
sarFileCompareInfo.setReleaseState(ReleaseConditionEnum.DRAFT.getValue());
|
||||
sarFileCompareInfo.setRemark(remark);
|
||||
this.add(sarFileCompareInfo);
|
||||
return sarFileCompareInfo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SarFileCompareDetailVO getComparisonDetail(String id) {
|
||||
// 水平越权
|
||||
isHorizontalOverstep(id);
|
||||
SarFileCompareDetailVO sfVo = new SarFileCompareDetailVO();
|
||||
SarFileCompareInfo sfcInfo = this.queryById(id);
|
||||
sfVo.setInfoId(id);
|
||||
sfVo.setFileNameLeft(sfcInfo.getFileNameLeft());
|
||||
sfVo.setFileNameRight(sfcInfo.getFileNameRight());
|
||||
sfVo.setSerialNumberLeft(sfcInfo.getSerialNumberLeft());
|
||||
sfVo.setSerialNumberRight(sfcInfo.getSerialNumberRight());
|
||||
sfVo.setRemark(sfcInfo.getRemark());
|
||||
sfVo.setComments(sfcInfo.getComments());
|
||||
List<SarFileCompareMenu> menuList = sarFileCompareMenuService.queryListByInfoId(id);
|
||||
for (SarFileCompareMenu menu : menuList) {
|
||||
if (MyStringUtils.isBlank(menu.getParentId()) || "General catalogue".equals(menu.getName()) || "General Catalogue".equals(menu.getName())) {
|
||||
if (menu.getLeftOrRight().equals(CompareConst.POS_LEFT)) {
|
||||
SarFileCompareMenuVo menuLeft = new SarFileCompareMenuVo(menu);
|
||||
menuLeft.setChildren(getMenuChildren(menuList, CompareConst.POS_LEFT, menuLeft.getMenuId()));
|
||||
sfVo.addMenuLeft(menuLeft);
|
||||
} else if (menu.getLeftOrRight().equals(CompareConst.POS_RIGHT)) {
|
||||
SarFileCompareMenuVo menuRight = new SarFileCompareMenuVo(menu);
|
||||
menuRight.setChildren(getMenuChildren(menuList, CompareConst.POS_RIGHT, menuRight.getMenuId()));
|
||||
sfVo.addMenuRight(menuRight);
|
||||
}
|
||||
}
|
||||
if (sfVo.getMenuRight() != null && sfVo.getMenuRight().size() > 0 && sfVo.getMenuLeft() != null && sfVo.getMenuLeft().size() > 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
List<SarFileCompareItem> itemList = sarFileCompareItemService.queryListByInfoId(id);
|
||||
for (SarFileCompareItem item : itemList) {
|
||||
if (item.getLeftOrRight().equals(CompareConst.POS_LEFT)) {
|
||||
sfVo.addTextLeft(item);
|
||||
} else if (item.getLeftOrRight().equals(CompareConst.POS_RIGHT)) {
|
||||
sfVo.addTextRight(item);
|
||||
}
|
||||
}
|
||||
//修改标准目录顺序结构
|
||||
// List<SarFileCompareMenuVo> menuLeft = this.tree(sfVo.getMenuLeft());
|
||||
// List<SarFileCompareMenuVo> menuRight = this.tree(sfVo.getMenuRight());
|
||||
// sfVo.setMenuLeft(menuLeft);
|
||||
// sfVo.setMenuRight(menuRight);
|
||||
return sfVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void isHorizontalOverstep(String ids) {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
LambdaQueryWrapper<SarFileCompareInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
queryWrapper.in(SarFileCompareInfo::getId, idList);
|
||||
queryWrapper.and(qw ->
|
||||
qw.eq(SarFileCompareInfo::getCreateBy, loginUser.getUsername())
|
||||
.or().eq(SarFileCompareInfo::getReleaseState, ReleaseConditionEnum.PUBLISHED.getValue()));
|
||||
int count = sarFileCompareInfoService.count(queryWrapper);
|
||||
if (count <= 0 || count != idList.size()) {
|
||||
if(LanguageEnum.CN.equals(MessageUtils.getLanguage())) {
|
||||
throw new JeroBootException("无权限!");
|
||||
}else{
|
||||
throw new JeroBootException("No access!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByStandardId(String ids) {
|
||||
|
||||
}
|
||||
|
||||
private List<SarFileCompareMenuVo> tree(List<SarFileCompareMenuVo> list) {
|
||||
List<SarFileCompareMenuVo> compareMenuVos = new ArrayList<>();
|
||||
//先删除name是总目录的数据
|
||||
list = list.get(0).getChildren();
|
||||
/**
|
||||
* 根节点:
|
||||
* 1、没有"."
|
||||
* 2、其他对象都不等于 最后一个"."之前的数据
|
||||
*/
|
||||
|
||||
//查询根节点是哪一级,也就是"."最少的那一层
|
||||
int least = 100;
|
||||
for (SarFileCompareMenuVo menuVo : list) {
|
||||
String name = menuVo.getName();
|
||||
int i = countCharacters(name);
|
||||
if (least > i){
|
||||
least = i;
|
||||
}
|
||||
}
|
||||
//把第一级放入compareMenuVos
|
||||
for (SarFileCompareMenuVo compareMenuVo : list) {
|
||||
String name = compareMenuVo.getName();
|
||||
int i = countCharacters(name);
|
||||
if (least == i){
|
||||
compareMenuVos.add(compareMenuVo);
|
||||
}
|
||||
}
|
||||
//遍历第一级,寻找第二级
|
||||
List<SarFileCompareMenuVo> two = new ArrayList<>();
|
||||
for (SarFileCompareMenuVo compareMenuVo : list) {
|
||||
String name = compareMenuVo.getName();
|
||||
int i = countCharacters(name);
|
||||
if (least + 1 == i){
|
||||
two.add(compareMenuVo);
|
||||
}
|
||||
}
|
||||
for (SarFileCompareMenuVo compareMenuVo : compareMenuVos) {
|
||||
String name = compareMenuVo.getName();
|
||||
int length = name.length();
|
||||
//找到所有以name为前缀的数据
|
||||
List<SarFileCompareMenuVo> menuVos = two.stream().filter(SarFileCompareMenuVo -> SarFileCompareMenuVo.getName().startsWith(name)).collect(Collectors.toList());
|
||||
compareMenuVo.setChildren(menuVos);
|
||||
}
|
||||
//遍历第二级,寻找第三级
|
||||
List<SarFileCompareMenuVo> three = new ArrayList<>();
|
||||
for (SarFileCompareMenuVo compareMenuVo : list) {
|
||||
String name = compareMenuVo.getName();
|
||||
int i = countCharacters(name);
|
||||
if (least + 2 == i){
|
||||
three.add(compareMenuVo);
|
||||
}
|
||||
}
|
||||
for (SarFileCompareMenuVo compareMenuVo : compareMenuVos) {
|
||||
List<SarFileCompareMenuVo> children = compareMenuVo.getChildren();
|
||||
for (SarFileCompareMenuVo child : children) {
|
||||
String name = child.getName();
|
||||
//找到所有以name为前缀的数据
|
||||
List<SarFileCompareMenuVo> menuVos = three.stream().filter(SarFileCompareMenuVo -> SarFileCompareMenuVo.getName().startsWith(name)).collect(Collectors.toList());
|
||||
child.setChildren(menuVos);
|
||||
}
|
||||
}
|
||||
//遍历第三级,寻找第四级
|
||||
List<SarFileCompareMenuVo> four = new ArrayList<>();
|
||||
for (SarFileCompareMenuVo compareMenuVo : list) {
|
||||
String name = compareMenuVo.getName();
|
||||
int i = countCharacters(name);
|
||||
if (least + 3 == i){
|
||||
four.add(compareMenuVo);
|
||||
}
|
||||
}
|
||||
for (SarFileCompareMenuVo compareMenuVo : compareMenuVos) {
|
||||
List<SarFileCompareMenuVo> children = compareMenuVo.getChildren();
|
||||
for (SarFileCompareMenuVo child : children) {
|
||||
List<SarFileCompareMenuVo> vos = child.getChildren();
|
||||
for (SarFileCompareMenuVo vo : vos) {
|
||||
String name = vo.getName();
|
||||
//找到所有以name为前缀的数据
|
||||
List<SarFileCompareMenuVo> menuVos = four.stream().filter(SarFileCompareMenuVo -> SarFileCompareMenuVo.getName().startsWith(name)).collect(Collectors.toList());
|
||||
vo.setChildren(menuVos);
|
||||
}
|
||||
}
|
||||
}
|
||||
return compareMenuVos;
|
||||
}
|
||||
|
||||
public int countCharacters(String str) {
|
||||
return Math.toIntExact(str.chars().filter(ch -> ch == '.').count());
|
||||
}
|
||||
|
||||
private List<SarFileCompareMenuVo> getMenuChildren(List<SarFileCompareMenu> menuList, String leftOrRight, String pid) {
|
||||
List<SarFileCompareMenuVo> list = new ArrayList<>();
|
||||
for (SarFileCompareMenu menu : menuList) {
|
||||
if (menu.getLeftOrRight().equals(leftOrRight) && menu.getParentId() != null && menu.getParentId().equals(pid)) {
|
||||
SarFileCompareMenuVo menuVO = new SarFileCompareMenuVo(menu);
|
||||
menuVO.setChildren(getMenuChildren(menuList, leftOrRight, menuVO.getMenuId()));
|
||||
list.add(menuVO);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+685
@@ -0,0 +1,685 @@
|
||||
package com.jero.modules.compare.service.impl;
|
||||
|
||||
import com.aliyuncs.utils.IOUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.LanguageEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.common.util.MinioUtil;
|
||||
import com.jero.modules.compare.entity.*;
|
||||
import com.jero.modules.compare.enums.AssessConsistencyEnum;
|
||||
import com.jero.modules.compare.mapper.SarFileCompareItemCommentMapper;
|
||||
import com.jero.modules.compare.service.ISarFileCompareInfoService;
|
||||
import com.jero.modules.compare.service.ISarFileCompareItemCommentService;
|
||||
import com.jero.modules.compare.service.ISarFileCompareItemService;
|
||||
import com.jero.modules.compare.utils.ConvertHtml2Excel;
|
||||
import com.jero.modules.system.util.MyStringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.common.usermodel.HyperlinkType;
|
||||
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
|
||||
import org.apache.poi.hssf.usermodel.HSSFFont;
|
||||
import org.apache.poi.hssf.usermodel.HSSFPatriarch;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCompareItemCommentMapper, SarFileCompareItemComment> implements ISarFileCompareItemCommentService {
|
||||
|
||||
@Autowired
|
||||
private ISarFileCompareInfoService sarFileCompareInfoServiceImpl;
|
||||
|
||||
@Autowired
|
||||
private ISarFileCompareItemService SarFileCompareItemServiceImpl;
|
||||
|
||||
@Autowired
|
||||
private ISarFileCompareInfoService sarFileCompareInfoService;
|
||||
|
||||
@Value("${jero.path.upload}")
|
||||
private String filePath;
|
||||
@Value("${jero.path.uploadCos}")
|
||||
private String filePathCos;
|
||||
@Value("${jero.splitUrl}")
|
||||
private String splitUrl;
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
// 水平越权
|
||||
sarFileCompareInfoService.isHorizontalOverstep(sarFileCompareItemComment.getInfoId());
|
||||
Date now = new Date();
|
||||
sarFileCompareItemComment.setCreateTime(now);
|
||||
sarFileCompareItemComment.setUpdateTime(now);
|
||||
save(sarFileCompareItemComment);
|
||||
String itemIdLeft = sarFileCompareItemComment.getItemsIdLeft();
|
||||
SarFileCompareItemServiceImpl.updateReviewedById(sarFileCompareItemComment.getItemsIdLeft());
|
||||
SarFileCompareItemServiceImpl.updateReviewedById(sarFileCompareItemComment.getItemsIdRight());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
// 水平越权
|
||||
sarFileCompareInfoService.isHorizontalOverstep(sarFileCompareItemComment.getInfoId());
|
||||
SarFileCompareItemComment ic = queryById(sarFileCompareItemComment.getId());
|
||||
Date now = new Date();
|
||||
ic.setUpdateTime(now);
|
||||
ic.setComment(sarFileCompareItemComment.getComment());
|
||||
saveOrUpdate(ic);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
//删除时需要判断左侧跟右侧是否还有评论,如果没有,将对应的reviewed改为0
|
||||
String itemsIdLeft;
|
||||
String itemsIdRight;
|
||||
SarFileCompareItemComment sarFileCompareItemComment = queryById(id);
|
||||
itemsIdLeft = sarFileCompareItemComment.getItemsIdLeft();
|
||||
itemsIdRight = sarFileCompareItemComment.getItemsIdRight();
|
||||
removeById(id);
|
||||
|
||||
QueryWrapper<SarFileCompareItemComment> left = new QueryWrapper<>();
|
||||
left.eq("items_id_left", itemsIdLeft);
|
||||
if (baseMapper.selectCount(left) == 0) {
|
||||
SarFileCompareItem sarFileCompareItem = SarFileCompareItemServiceImpl.queryById(itemsIdLeft);
|
||||
sarFileCompareItem.setReviewed(0);
|
||||
SarFileCompareItemServiceImpl.saveOrUpdate(sarFileCompareItem);
|
||||
}
|
||||
QueryWrapper<SarFileCompareItemComment> right = new QueryWrapper<>();
|
||||
right.eq("items_id_right", itemsIdRight);
|
||||
if (baseMapper.selectCount(right) == 0) {
|
||||
SarFileCompareItem sarFileCompareItem = SarFileCompareItemServiceImpl.queryById(itemsIdRight);
|
||||
sarFileCompareItem.setReviewed(0);
|
||||
SarFileCompareItemServiceImpl.saveOrUpdate(sarFileCompareItem);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SarFileCompareItemComment queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SarFileCompareItemComment> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SarFileCompareResultVO queryCompareResult(String infoId,String comment) {
|
||||
// 水平越权
|
||||
sarFileCompareInfoService.isHorizontalOverstep(infoId);
|
||||
SarFileCompareResultVO resultVO = new SarFileCompareResultVO();
|
||||
SarFileCompareInfo sfcInfo = sarFileCompareInfoServiceImpl.queryById(infoId);
|
||||
resultVO.setInfoId(infoId);
|
||||
resultVO.setSerialNumberLeft(sfcInfo.getSerialNumberLeft());
|
||||
resultVO.setFileNameLeft(sfcInfo.getFileNameLeft());
|
||||
resultVO.setFileIdLeft(sfcInfo.getFileIdLeft());
|
||||
resultVO.setSerialNumberRight(sfcInfo.getSerialNumberRight());
|
||||
resultVO.setFileNameRight(sfcInfo.getFileNameRight());
|
||||
resultVO.setFileIdRight(sfcInfo.getFileIdRight());
|
||||
resultVO.setComments(sfcInfo.getComments());
|
||||
|
||||
List<SarFileCompareItemComment> list = queryListByInfoId(infoId,comment);
|
||||
Map<String, SarFileCompareItem> sfcItemMap = SarFileCompareItemServiceImpl.queryMapByInfoId(infoId);
|
||||
for (SarFileCompareItemComment sfcItemCom : list) {
|
||||
SarFileCompareItemComVO itemComVO = new SarFileCompareItemComVO();
|
||||
itemComVO.setId(sfcItemCom.getId());
|
||||
itemComVO.setComment(sfcItemCom.getComment());
|
||||
String itemIdLeft = sfcItemCom.getItemsIdLeft();
|
||||
if (!MyStringUtils.isEmpty(itemIdLeft)) {
|
||||
SarFileCompareItem sfcItem = sfcItemMap.get(itemIdLeft);
|
||||
if (null != sfcItem) {
|
||||
itemComVO.setItemsNameLeft(sfcItem.getItemsName());
|
||||
itemComVO.setItemsNumLeft(sfcItem.getItemsNum());
|
||||
itemComVO.setItemsTextLeft(sfcItem.getItemsText());
|
||||
}
|
||||
}
|
||||
String itemIdRight = sfcItemCom.getItemsIdRight();
|
||||
if (!MyStringUtils.isEmpty(itemIdRight)) {
|
||||
SarFileCompareItem sfcItem = sfcItemMap.get(itemIdRight);
|
||||
if (null != sfcItem) {
|
||||
itemComVO.setItemsNameRight(sfcItem.getItemsName());
|
||||
itemComVO.setItemsNumRight(sfcItem.getItemsNum());
|
||||
itemComVO.setItemsTextRight(sfcItem.getItemsText());
|
||||
}
|
||||
}
|
||||
resultVO.addRes(itemComVO);
|
||||
}
|
||||
return resultVO;
|
||||
|
||||
}
|
||||
|
||||
public List<SarFileCompareItemComment> queryListByInfoId(String infoId,String comment) {
|
||||
LambdaQueryWrapper<SarFileCompareItemComment> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (ObjectUtils.isNotEmpty(comment)) {
|
||||
if (AssessConsistencyEnum.SAME.getValue().equals(comment)) {
|
||||
queryWrapper.eq(SarFileCompareItemComment::getComment, comment);
|
||||
} else if (AssessConsistencyEnum.DIFFERENT.getValue().equals(comment)) {
|
||||
queryWrapper.ne(SarFileCompareItemComment::getComment, AssessConsistencyEnum.SAME.getValue());
|
||||
}
|
||||
}
|
||||
queryWrapper.eq(SarFileCompareItemComment::getInfoId, infoId);
|
||||
queryWrapper.orderBy(true, true, SarFileCompareItemComment::getCreateTime);
|
||||
List<SarFileCompareItemComment> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportResXls(HttpServletRequest request,HttpServletResponse response, String infoId, String selectIds, boolean includeComments, String cut,String comment) {
|
||||
// 水平越权
|
||||
sarFileCompareInfoService.isHorizontalOverstep(infoId);
|
||||
List<SarFileCompareItemComment> list = null;
|
||||
if (includeComments && MyStringUtils.isEmpty(selectIds)) {
|
||||
//只导出全文评论的情况
|
||||
list = new ArrayList<>();
|
||||
} else {
|
||||
LambdaQueryWrapper<SarFileCompareItemComment> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SarFileCompareItemComment::getInfoId, infoId);
|
||||
if (!MyStringUtils.isEmpty(selectIds)) {
|
||||
queryWrapper.in(SarFileCompareItemComment::getId, Arrays.asList(selectIds.split(",")));
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(comment)) {
|
||||
if (AssessConsistencyEnum.SAME.getValue().equals(comment)) {
|
||||
queryWrapper.eq(SarFileCompareItemComment::getComment, comment);
|
||||
} else if (AssessConsistencyEnum.DIFFERENT.getValue().equals(comment)) {
|
||||
queryWrapper.ne(SarFileCompareItemComment::getComment, AssessConsistencyEnum.SAME.getValue());
|
||||
}
|
||||
}
|
||||
queryWrapper.orderBy(true, true, SarFileCompareItemComment::getCreateTime);
|
||||
list = this.list(queryWrapper);
|
||||
}
|
||||
Map<String, SarFileCompareItem> sfcItemMap = SarFileCompareItemServiceImpl.queryMapByInfoId(infoId);
|
||||
|
||||
SarFileCompareInfo sarFileCompareInfo = sarFileCompareInfoServiceImpl.queryById(infoId);
|
||||
|
||||
OutputStream os = null;
|
||||
Workbook workbook = new HSSFWorkbook();
|
||||
log.info("-------------- workbook创建成功 -----------------");
|
||||
//在本地创建图片文件夹
|
||||
log.info("-------------- 在本地创建图片文件夹 -----------------");
|
||||
String dir = filePath + File.separator + UUID.randomUUID().toString().replace("-", "");
|
||||
File dirFile = new File(dir);
|
||||
if (dirFile.exists()){
|
||||
dirFile.delete();
|
||||
}
|
||||
dirFile.mkdirs();
|
||||
log.info("-------------- 文件夹创建成功:"+ dirFile.getAbsolutePath() +" -----------------");
|
||||
try {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String fileName = "导出对比结果 " + sdf.format(new Date()) + ".xlsx";
|
||||
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
|
||||
response.setContentType("application/force-download");
|
||||
//创建工作表对象
|
||||
String sheetName = "对比结果";
|
||||
if (LanguageEnum.CN.getValue().equals(MessageUtils.getLanguage().getValue())) {
|
||||
sheetName = "对比结果";
|
||||
} else {
|
||||
sheetName = "Comparing results";
|
||||
}
|
||||
Sheet sheet = workbook.createSheet(sheetName);
|
||||
HSSFPatriarch patriarch = (HSSFPatriarch) sheet.createDrawingPatriarch();
|
||||
// 创建头部
|
||||
String header = "";
|
||||
if (LanguageEnum.CN.getValue().equals(MessageUtils.getLanguage().getValue())) {
|
||||
header = "所选标准,条款号,条款名称,条款内容,所选标准,条款号,条款名称,条款内容,评论";
|
||||
} else {
|
||||
header = "Selected Standard,Number,Title,Content,Selected Standard,Number,Title,Content,Comment";
|
||||
}
|
||||
int[] columnWidth = {5000,5000, 5000, 10000, 5000,5000, 5000, 10000, 10000};
|
||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||
cellStyle.setAlignment(HorizontalAlignment.LEFT);
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
cellStyle.setWrapText(true);
|
||||
Row rowHeader = sheet.createRow(0);//开始创建标题行
|
||||
if (MyStringUtils.isNotBlank(header)) {
|
||||
String[] headerArr = header.split(",");
|
||||
for (int i = 0; i < headerArr.length; i++) {
|
||||
rowHeader.createCell(i).setCellValue(headerArr[i]);
|
||||
sheet.setColumnWidth(i, columnWidth[i]);
|
||||
}
|
||||
}
|
||||
//超链接样式
|
||||
CellStyle cellStyleLink =workbook.createCellStyle();
|
||||
HSSFFont font = ((HSSFWorkbook) workbook).createFont();
|
||||
font.setColor(HSSFColor.HSSFColorPredefined.LIGHT_BLUE.getIndex());
|
||||
cellStyleLink.setFont(font);
|
||||
cellStyleLink.setWrapText(true);
|
||||
int i = 1;
|
||||
//记录需要合并的单元格
|
||||
List<SarFileCompareExcelMergeCell> mergeCells = new ArrayList<>();
|
||||
for (SarFileCompareItemComment itemComment : list) {
|
||||
SarFileCompareExcelMergeCell sarFileCompareExcelMergeCell = new SarFileCompareExcelMergeCell();
|
||||
String[] leftSplit = null;
|
||||
String[] rightSplit = null;
|
||||
Row row = sheet.createRow(i);
|
||||
row.createCell(0).setCellValue(sarFileCompareInfo == null ? "" : sarFileCompareInfo.getTitleLeft() + " " + sarFileCompareInfo.getFileNameLeft());
|
||||
row.createCell(4).setCellValue(sarFileCompareInfo == null ? "" : sarFileCompareInfo.getTitleRight() + " " + sarFileCompareInfo.getFileNameRight());
|
||||
String itemIdLeft = itemComment.getItemsIdLeft();
|
||||
if (!MyStringUtils.isEmpty(itemIdLeft)) {
|
||||
SarFileCompareItem itemLeft = sfcItemMap.get(itemIdLeft);
|
||||
if (null != itemLeft) {
|
||||
row.createCell(1).setCellValue(itemLeft.getItemsNum());
|
||||
row.createCell(2).setCellValue(itemLeft.getItemsName());
|
||||
String text = itemLeft.getItemsText();
|
||||
if (MyStringUtils.isNotEmpty(text)){
|
||||
log.info("-------------- 开始开始拆分左侧图片、文字、表格 :" + text + "-----------------");
|
||||
String rowDataAndPath = getSplitContent(request, text);
|
||||
log.info("-------------- 左侧图片、文字、表格 拆分成功 :"+ rowDataAndPath +"-----------------");
|
||||
leftSplit = rowDataAndPath.split("---");
|
||||
if (leftSplit.length > 1) {
|
||||
for (int j = 0; j < leftSplit.length; j++) {
|
||||
if (ObjectUtils.isNotEmpty(leftSplit[j])) {
|
||||
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
||||
if (j > 0) {
|
||||
Row row2 = sheet.getRow(j + i);
|
||||
if (ObjectUtils.isEmpty(row2)) {
|
||||
row2 = sheet.createRow(j + i);
|
||||
}
|
||||
log.info("-------------- 开始开始处理左侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row2, i, j, leftSplit[j], 3);
|
||||
log.info("-------------- 左侧图片、表格 处理成功 -----------------");
|
||||
} else {
|
||||
log.info("-------------- 开始开始处理左侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row, i, j, leftSplit[j], 3);
|
||||
log.info("-------------- 左侧图片、表格 处理成功 -----------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
sarFileCompareExcelMergeCell.setLeftStart(i);
|
||||
sarFileCompareExcelMergeCell.setLeftEnd(i + leftSplit.length - 1);
|
||||
sarFileCompareExcelMergeCell.setRightStart(0);
|
||||
sarFileCompareExcelMergeCell.setRightEnd(0);
|
||||
mergeCells.add(sarFileCompareExcelMergeCell);
|
||||
} else {
|
||||
row.createCell(3).setCellValue(rowDataAndPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String itemIdRight = itemComment.getItemsIdRight();
|
||||
if (!MyStringUtils.isEmpty(itemIdRight)) {
|
||||
SarFileCompareItem itemRight = sfcItemMap.get(itemIdRight);
|
||||
if (null != itemRight) {
|
||||
row.createCell(5).setCellValue(itemRight.getItemsNum());
|
||||
row.createCell(6).setCellValue(itemRight.getItemsName());
|
||||
String text = itemRight.getItemsText();
|
||||
if (MyStringUtils.isNotEmpty(text)) {
|
||||
log.info("-------------- 开始开始拆分右侧图片、文字、表格 :"+ text +" -----------------");
|
||||
String rowDataAndPath = getSplitContent(request, text);
|
||||
log.info("-------------- 右侧图片、文字、表格 拆分成功 :"+ rowDataAndPath +" -----------------");
|
||||
rightSplit = rowDataAndPath.split("---");
|
||||
if (rightSplit.length > 1) {
|
||||
for (int j = 0; j < rightSplit.length; j++) {
|
||||
if (ObjectUtils.isNotEmpty(rightSplit[j])) {
|
||||
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
||||
if (j > 0) {
|
||||
Row row2 = sheet.getRow(j + i);
|
||||
if (ObjectUtils.isEmpty(row2)) {
|
||||
row2 = sheet.createRow(j + i);
|
||||
}
|
||||
log.info("-------------- 开始处理右侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row2, i, j, rightSplit[j], 7);
|
||||
log.info("-------------- 右侧图片、表格 处理成功 -----------------");
|
||||
} else {
|
||||
log.info("-------------- 开始处理右侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row, i, j, rightSplit[j], 7);
|
||||
log.info("-------------- 右侧图片、表格 处理成功 -----------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
sarFileCompareExcelMergeCell.setRightStart(i);
|
||||
sarFileCompareExcelMergeCell.setRightEnd(i + rightSplit.length - 1);
|
||||
mergeCells.add(sarFileCompareExcelMergeCell);
|
||||
} else {
|
||||
row.createCell(7).setCellValue(rowDataAndPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
row.createCell(8).setCellValue(itemComment.getComment());
|
||||
row.setRowStyle(cellStyle);
|
||||
for (int j = 0; j < 9; j++) {
|
||||
Cell cell = row.getCell(j);
|
||||
if (null != cell) {
|
||||
cell.setCellStyle(cellStyle);
|
||||
}
|
||||
}
|
||||
int left_length = ObjectUtils.isEmpty(leftSplit) ? 0 : leftSplit.length;
|
||||
int right_length = ObjectUtils.isEmpty(rightSplit) ? 0 : rightSplit.length;
|
||||
i = left_length > right_length ? i + left_length : i + right_length;
|
||||
}
|
||||
if (includeComments || MyStringUtils.isEmpty(selectIds)) {
|
||||
Row row = sheet.createRow(i);
|
||||
if (LanguageEnum.CN.getValue().equals(MessageUtils.getLanguage().getValue())) {
|
||||
row.createCell(0).setCellValue("全文评论");
|
||||
} else {
|
||||
row.createCell(0).setCellValue("The full text comments");
|
||||
}
|
||||
//合并单元格
|
||||
CellRangeAddress rangeAddress = new CellRangeAddress(row.getRowNum(), row.getRowNum(), 1, 6);
|
||||
sheet.addMergedRegion(rangeAddress);
|
||||
SarFileCompareInfo compareInfo = sarFileCompareInfoServiceImpl.queryById(infoId);
|
||||
row.createCell(1).setCellValue(compareInfo.getComments());
|
||||
row.getCell(1).setCellStyle(cellStyle);
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(mergeCells)) {
|
||||
log.info("-------------- 开始处理需要合并的单元格 -----------------");
|
||||
Set<SarFileCompareExcelMergeCell> mergeCellSet = new HashSet<>(mergeCells);
|
||||
for (SarFileCompareExcelMergeCell mergeCell : mergeCellSet) {
|
||||
Integer leftCount = 0;
|
||||
if (ObjectUtils.isNotEmpty(mergeCell.getLeftEnd())&&ObjectUtils.isNotEmpty(mergeCell.getLeftStart())) {
|
||||
leftCount = mergeCell.getLeftEnd() - mergeCell.getLeftStart() + 1;
|
||||
}
|
||||
Integer rightCount = 0;
|
||||
if (ObjectUtils.isNotEmpty(mergeCell.getRightEnd())&&ObjectUtils.isNotEmpty(mergeCell.getRightStart())) {
|
||||
rightCount = mergeCell.getRightEnd() - mergeCell.getRightStart() + 1;
|
||||
}
|
||||
Integer start = leftCount - rightCount >= 0 ? mergeCell.getLeftStart() : mergeCell.getRightStart();
|
||||
log.info("-------------- 合并开始行数:" + start + " -----------------");
|
||||
Integer end = leftCount - rightCount >= 0 ? mergeCell.getLeftEnd() : mergeCell.getRightEnd();
|
||||
log.info("-------------- 合并结束行数: " + end + " -----------------");
|
||||
//合并
|
||||
if (ObjectUtils.isNotEmpty(start)&&ObjectUtils.isNotEmpty(end)) {
|
||||
CellRangeAddress region0 = new CellRangeAddress(start, end, 0, 0);
|
||||
sheet.addMergedRegion(region0);
|
||||
CellRangeAddress region1 = new CellRangeAddress(start, end, 1, 1);
|
||||
sheet.addMergedRegion(region1);
|
||||
CellRangeAddress region2 = new CellRangeAddress(start, end, 2, 2);
|
||||
sheet.addMergedRegion(region2);
|
||||
CellRangeAddress region4 = new CellRangeAddress(start, end, 4, 4);
|
||||
sheet.addMergedRegion(region4);
|
||||
CellRangeAddress region5 = new CellRangeAddress(start, end, 5, 5);
|
||||
sheet.addMergedRegion(region5);
|
||||
CellRangeAddress region6 = new CellRangeAddress(start, end, 6, 6);
|
||||
sheet.addMergedRegion(region6);
|
||||
CellRangeAddress region7 = new CellRangeAddress(start, end, 8, 8);
|
||||
sheet.addMergedRegion(region7);
|
||||
}
|
||||
|
||||
}
|
||||
log.info("-------------- 单元格合并成功 -----------------");
|
||||
}
|
||||
|
||||
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
if (LanguageEnum.CN.getValue().equals(MessageUtils.getLanguage().getValue())) {
|
||||
throw new JeroBootException("下载文件失败");
|
||||
} else {
|
||||
throw new JeroBootException("Failed to download file");
|
||||
}
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理图片跟表格类型的数据
|
||||
* @param workbook
|
||||
* @param dir
|
||||
* @param patriarch
|
||||
* @param cellStyleLink
|
||||
* @param byteArrayOut
|
||||
* @param row
|
||||
* @param i
|
||||
* @param j
|
||||
* @param text
|
||||
* @param cellNum
|
||||
* @throws IOException
|
||||
*/
|
||||
private void handleSpecificData(Workbook workbook, String dir, HSSFPatriarch patriarch, CellStyle cellStyleLink, ByteArrayOutputStream byteArrayOut, Row row, int i, int j, String text, int cellNum) throws IOException {
|
||||
if (text.contains("/upFiles")) {
|
||||
row.setHeight((short) 3000); //设置行高
|
||||
//先将图片下载到本地
|
||||
log.info("-------------------------将图片下载到本地文件夹中----------------------------");
|
||||
String fileLastName = text.substring(text.lastIndexOf("/") + 1);
|
||||
if (MinioUtil.doesObjectExist(text)) {
|
||||
try (InputStream in = MinioUtil.download(text)) {
|
||||
copyFile2(in, dir + File.separator + fileLastName);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
File file = new File(dir + File.separator + fileLastName);
|
||||
log.info("-------------------------图片下载成功:"+ file.getAbsolutePath() +"----------------------------");
|
||||
if (file.exists()) {
|
||||
log.info("-------------------------将图片插入excel指定单元格中----------------------------");
|
||||
BufferedImage bufferImg = ImageIO.read(file);
|
||||
//获取文件后缀
|
||||
String fileName = file.getName();
|
||||
String formatName = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
//如果是jpg或者是jpeg,需要重画一下,否则会变色
|
||||
if (formatName.equalsIgnoreCase("jpg") || formatName.equalsIgnoreCase("jpeg")) { //重画一下,要么会变色
|
||||
BufferedImage tag;
|
||||
tag = new BufferedImage(bufferImg.getWidth(), bufferImg.getHeight(), BufferedImage.TYPE_INT_BGR);
|
||||
Graphics g = tag.getGraphics();
|
||||
g.drawImage(bufferImg, 0, 0, null); // 绘制缩小后的图
|
||||
g.dispose();
|
||||
bufferImg = tag;
|
||||
}
|
||||
ImageIO.write(bufferImg, formatName, byteArrayOut);
|
||||
//anchor主要用于设置图片的属性
|
||||
HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 600, 200, (short) cellNum, j + i, (short) cellNum, j + i);
|
||||
patriarch.createPicture(anchor, workbook.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG));
|
||||
log.info("-------------------------将图片插入成功----------------------------");
|
||||
}
|
||||
} else {
|
||||
Cell cell = row.createCell(cellNum);
|
||||
if (text.contains("<table")) {
|
||||
log.info("-------------------------开始处理表格----------------------------");
|
||||
tableAssociate(workbook, cellStyleLink, cell, text);
|
||||
log.info("-------------------------表格处理完毕----------------------------");
|
||||
} else {
|
||||
cell.setCellValue(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前excel中新开sheet生成表格,并在指定单元格用超链接关联
|
||||
* @param workbook
|
||||
* @param cellStyleLink
|
||||
* @param cell
|
||||
* @param tableHtml
|
||||
*/
|
||||
private void tableAssociate(Workbook workbook, CellStyle cellStyleLink, Cell cell, String tableHtml) {
|
||||
cell.setCellValue("点击查看详情");
|
||||
//新开sheet生成表格
|
||||
log.info("-------------------------开始生成表格----------------------------");
|
||||
if (StringUtils.isNotEmpty(tableHtml) && tableHtml.indexOf("<tbody>") < 0) {
|
||||
if (tableHtml.indexOf("<thead>") < 0) {
|
||||
tableHtml = tableHtml.replaceFirst("<tr>", "<tbody><tr>");
|
||||
tableHtml = tableHtml.replaceFirst("</table>", "</tbody></table>");
|
||||
} else {
|
||||
tableHtml = tableHtml.replaceFirst("</thead>", "</thead><tbody>");
|
||||
tableHtml = tableHtml.replaceFirst("</table>", "</tbody></table>");
|
||||
}
|
||||
}
|
||||
String cnt = "\n";
|
||||
tableHtml = tableHtml.replaceAll("<[\\s]*?br[^>]*?>|<[\\s]*?\\/[\\s]*?br[\\s]*?>", cnt);
|
||||
String tableSheetName = "表格" + System.currentTimeMillis();
|
||||
ConvertHtml2Excel.table2Excel(tableHtml, (HSSFWorkbook) workbook, tableSheetName);
|
||||
log.info("-------------------------表格生产完毕----------------------------");
|
||||
//添加超链接
|
||||
log.info("-------------------------开始添加超链接---------------------------");
|
||||
CreationHelper createHelper = workbook.getCreationHelper();
|
||||
Hyperlink hyperlink1 = createHelper.createHyperlink(HyperlinkType.DOCUMENT);
|
||||
String tableName = "#\'" + tableSheetName + "\'!A1";
|
||||
hyperlink1.setAddress(tableName);
|
||||
cell.setHyperlink(hyperlink1);// 链接
|
||||
cell.setCellStyle(cellStyleLink);
|
||||
log.info("-------------------------超链接添加完毕---------------------------");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文字、图片、表格分割后的内容
|
||||
* @param request
|
||||
* @param text
|
||||
* @return
|
||||
*/
|
||||
private String getSplitContent(HttpServletRequest request, String text) {
|
||||
text = text.replace("<p>", "").replace("</p>", "\r\n");
|
||||
//分割图片
|
||||
log.info("-------------------------开始分割文字与图片---------------------------");
|
||||
splitImg(text, request.getSession());
|
||||
log.info("-------------------------文字与图片分割完毕---------------------------");
|
||||
//分割表格
|
||||
log.info("-------------------------从剩余文字中开始分割表格---------------------------");
|
||||
String txtAndImg = (String) request.getSession().getAttribute("txtAndImg");
|
||||
txtAndImg = txtAndImg.replaceAll("table", "replaceTable");
|
||||
splitTable(txtAndImg, request.getSession());
|
||||
log.info("-------------------------表格分割完毕---------------------------");
|
||||
return (String) request.getSession().getAttribute("textAndTableAndImg");
|
||||
}
|
||||
|
||||
/**
|
||||
* 分割表格
|
||||
* @param textAndImg
|
||||
* @param session
|
||||
*/
|
||||
private void splitTable(String textAndImg,HttpSession session) {
|
||||
if (textAndImg.contains("<replaceTable")) {
|
||||
String left = textAndImg.substring(0, textAndImg.indexOf("<replaceTable"));
|
||||
String right = textAndImg.substring(textAndImg.indexOf("/replaceTable>") + 14);
|
||||
String table = textAndImg.substring(textAndImg.indexOf("<replaceTable"), textAndImg.indexOf("/replaceTable>")+14);
|
||||
table = table.replaceAll("replaceTable", "table");
|
||||
textAndImg = left + "---" + table + "---" + right;
|
||||
splitTable(textAndImg, session);
|
||||
} else {
|
||||
session.setAttribute("textAndTableAndImg", textAndImg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分割图片
|
||||
* @param text
|
||||
* @param session
|
||||
* @return
|
||||
*/
|
||||
private void splitImg(String text,HttpSession session) {
|
||||
if (text.contains("<img")) {
|
||||
String txtLeft = text.substring(0, text.indexOf("<img"));
|
||||
String txtRight = text.substring(text.indexOf("g\">") + 3);
|
||||
String img = text.substring(text.indexOf("<img"), text.indexOf("g\">"));
|
||||
String path = img.substring(img.lastIndexOf("=") + 1)+"g";
|
||||
text = txtLeft + "---" + path + "---" + txtRight;
|
||||
splitImg(text, session);
|
||||
} else {
|
||||
session.setAttribute("txtAndImg", text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 一致评估
|
||||
* @param sarFileCompareItemComment
|
||||
*/
|
||||
@Override
|
||||
public void consensusAssessment(SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
Date now = new Date();
|
||||
sarFileCompareItemComment.setCreateTime(now);
|
||||
sarFileCompareItemComment.setUpdateTime(now);
|
||||
sarFileCompareItemComment.setComment("一致");
|
||||
save(sarFileCompareItemComment);
|
||||
SarFileCompareItemServiceImpl.updateReviewedById(sarFileCompareItemComment.getItemsIdLeft());
|
||||
SarFileCompareItemServiceImpl.updateReviewedById(sarFileCompareItemComment.getItemsIdRight());
|
||||
}
|
||||
|
||||
public void copyFile2(InputStream in, String destPath) throws IOException {
|
||||
BufferedInputStream bis = new BufferedInputStream(in);
|
||||
BufferedOutputStream bos =
|
||||
new BufferedOutputStream(Files.newOutputStream(Paths.get(destPath),
|
||||
StandardOpenOption.CREATE,
|
||||
StandardOpenOption.TRUNCATE_EXISTING,
|
||||
StandardOpenOption.WRITE));
|
||||
// 打开输入流
|
||||
// FileInputStream fis = new FileInputStream(srcPath);
|
||||
// 打开输出流
|
||||
// FileOutputStream fos = new FileOutputStream(destPath);
|
||||
// 读取和写入信息
|
||||
byte[] bytes = new byte[1024 * 1024];
|
||||
int len;
|
||||
while ((len = bis.read(bytes)) > 0) {
|
||||
bos.write(bytes, 0, len);
|
||||
}
|
||||
// 关闭流 先开后关 后开先关
|
||||
// 先开后关,先开的输入流,再开的输出流,那么应该先关输出流,再关输入流
|
||||
// 先关外层,再关内层。如BufferedInputStream包装了一个FileInputStream,那么先关BufferedInputStream,再关FileInputStream。
|
||||
bos.close(); // 后开先关
|
||||
bis.close(); // 先开后关
|
||||
}
|
||||
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
package com.jero.modules.compare.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.compare.entity.SarFileCompareItem;
|
||||
import com.jero.modules.compare.mapper.SarFileCompareItemMapper;
|
||||
import com.jero.modules.compare.service.ISarFileCompareItemService;
|
||||
import com.jero.modules.compare.utils.CompareConst;
|
||||
import com.jero.modules.compare.utils.DiffUtils;
|
||||
import com.jero.modules.system.util.MyStringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-02
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SarFileCompareItemServiceImpl extends ServiceImpl<SarFileCompareItemMapper, SarFileCompareItem> implements ISarFileCompareItemService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(SarFileCompareItem sarFileCompareItem) {
|
||||
Date now = new Date();
|
||||
sarFileCompareItem.setCreateTime(now);
|
||||
sarFileCompareItem.setUpdateTime(now);
|
||||
save(sarFileCompareItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(SarFileCompareItem sarFileCompareItem) {
|
||||
Date now = new Date();
|
||||
sarFileCompareItem.setUpdateTime(now);
|
||||
saveOrUpdate(sarFileCompareItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateReviewedById(String id) {
|
||||
if (!MyStringUtils.isEmpty(id)) {
|
||||
SarFileCompareItem item = getById(id);
|
||||
if (null != item && item.getReviewed() == CompareConst.NO_REVIEWED) {
|
||||
item.setReviewed(CompareConst.REVIEWED);
|
||||
editById(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SarFileCompareItem queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SarFileCompareItem> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarFileCompareItem> queryListByInfoId(String infoId) {
|
||||
LambdaQueryWrapper<SarFileCompareItem> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SarFileCompareItem::getInfoId, infoId);
|
||||
queryWrapper.orderBy(true, true, SarFileCompareItem::getItemsDisplayNum);
|
||||
List<SarFileCompareItem> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, SarFileCompareItem> queryMapByInfoId(String infoId) {
|
||||
Map<String, SarFileCompareItem> resMap = new HashMap<String, SarFileCompareItem>();
|
||||
List<SarFileCompareItem> list = queryListByInfoId(infoId);
|
||||
for (SarFileCompareItem item : list) {
|
||||
resMap.put(item.getId(), item);
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> clauseComparison(String lid, String rid) {
|
||||
SarFileCompareItem leftItem = this.queryById(lid);
|
||||
SarFileCompareItem rightItem = this.queryById(rid);
|
||||
DiffUtils dmp = new DiffUtils();
|
||||
List<String> htmlDiffStr = dmp.getHtmlDiffStr(leftItem.getItemsText(), rightItem.getItemsText());
|
||||
return htmlDiffStr;
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
package com.jero.modules.compare.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.compare.entity.SarFileCompareMenu;
|
||||
import com.jero.modules.compare.mapper.SarFileCompareMenuMapper;
|
||||
import com.jero.modules.compare.service.ISarFileCompareMenuService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息目录表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SarFileCompareMenuServiceImpl extends ServiceImpl<SarFileCompareMenuMapper, SarFileCompareMenu> implements ISarFileCompareMenuService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareMenu
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(SarFileCompareMenu sarFileCompareMenu) {
|
||||
Date now = new Date();
|
||||
sarFileCompareMenu.setCreateTime(now);
|
||||
sarFileCompareMenu.setUpdateTime(now);
|
||||
save(sarFileCompareMenu);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareMenu
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(SarFileCompareMenu sarFileCompareMenu) {
|
||||
Date now = new Date();
|
||||
sarFileCompareMenu.setUpdateTime(now);
|
||||
saveOrUpdate(sarFileCompareMenu);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SarFileCompareMenu queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SarFileCompareMenu> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SarFileCompareMenu> queryListByInfoId(String infoId) {
|
||||
LambdaQueryWrapper<SarFileCompareMenu> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SarFileCompareMenu::getInfoId, infoId);
|
||||
queryWrapper.orderBy(true,true,SarFileCompareMenu::getDisplaySeq);
|
||||
List<SarFileCompareMenu> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
package com.jero.modules.compare.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jero.modules.compare.entity.SarFileCompareResComVO;
|
||||
import com.jero.modules.compare.entity.SarFileCompareResComment;
|
||||
import com.jero.modules.compare.mapper.SarFileCompareResCommentMapper;
|
||||
import com.jero.modules.compare.service.ISarFileCompareInfoService;
|
||||
import com.jero.modules.compare.service.ISarFileCompareResCommentService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.util.MyStringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息结果评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SarFileCompareResCommentServiceImpl extends ServiceImpl<SarFileCompareResCommentMapper, SarFileCompareResComment> implements ISarFileCompareResCommentService {
|
||||
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private ISarFileCompareInfoService sarFileCompareInfoService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareResComment
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(SarFileCompareResComment sarFileCompareResComment) {
|
||||
// 水平越权九
|
||||
sarFileCompareInfoService.isHorizontalOverstep(sarFileCompareResComment.getInfoId());
|
||||
Date now = new Date();
|
||||
sarFileCompareResComment.setCreateTime(now);
|
||||
sarFileCompareResComment.setUpdateTime(now);
|
||||
save(sarFileCompareResComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareResComment
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(SarFileCompareResComment sarFileCompareResComment) {
|
||||
Date now = new Date();
|
||||
sarFileCompareResComment.setUpdateTime(now);
|
||||
saveOrUpdate(sarFileCompareResComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SarFileCompareResComment queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SarFileCompareResComment> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
public List<SarFileCompareResComVO> queryListByInfoId(String id) {
|
||||
LambdaQueryWrapper<SarFileCompareResComment> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SarFileCompareResComment::getInfoId, id);
|
||||
queryWrapper.orderBy(true, true, SarFileCompareResComment::getCreateTime);
|
||||
List<SarFileCompareResComVO> resList = new ArrayList<>();
|
||||
List<SarFileCompareResComment> list = this.list(queryWrapper);
|
||||
for (SarFileCompareResComment rc : list) {
|
||||
if (MyStringUtils.isEmpty(rc.getParentId())) {
|
||||
SarFileCompareResComVO resComVO = wrapperSarFileCompareResComVO(rc);
|
||||
for (SarFileCompareResComment rc1 : list) {
|
||||
if (!MyStringUtils.isEmpty(rc1.getParentId()) && rc1.getParentId().equals(resComVO.getId())) {
|
||||
resComVO.addResComVo(wrapperSarFileCompareResComVO(rc1));
|
||||
}
|
||||
}
|
||||
resList.add(resComVO);
|
||||
}
|
||||
}
|
||||
// 填充属性
|
||||
for (SarFileCompareResComVO sarFileCompareResComVO : resList) {
|
||||
SysUser user = sysUserService.getUserByName(sarFileCompareResComVO.getName());
|
||||
if (!Objects.isNull(user)){
|
||||
sarFileCompareResComVO.setName(user.calcNameWorkNo());
|
||||
}
|
||||
}
|
||||
return resList;
|
||||
}
|
||||
|
||||
private SarFileCompareResComVO wrapperSarFileCompareResComVO(SarFileCompareResComment rc) {
|
||||
SarFileCompareResComVO resComVO = new SarFileCompareResComVO();
|
||||
resComVO.setId(rc.getId());
|
||||
resComVO.setCreateTime(sdf.format(rc.getCreateTime()));
|
||||
resComVO.setContent(rc.getComment());
|
||||
// 填充属性
|
||||
SysUser user = sysUserService.getUserByName(rc.getCreateBy());
|
||||
if (!Objects.isNull(user)){
|
||||
resComVO.setName(user.calcNameWorkNo());
|
||||
}
|
||||
return resComVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarFileCompareResComVO> queryListByInfoId(String id, String str) {
|
||||
// 水平越权九
|
||||
sarFileCompareInfoService.isHorizontalOverstep(id);
|
||||
if (MyStringUtils.isBlank(str)) {
|
||||
return queryListByInfoId(id);
|
||||
}
|
||||
LambdaQueryWrapper<SarFileCompareResComment> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SarFileCompareResComment::getInfoId, id);
|
||||
queryWrapper.like(SarFileCompareResComment::getComment, str);
|
||||
queryWrapper.orderBy(true, true, SarFileCompareResComment::getCreateTime);
|
||||
List<SarFileCompareResComment> list = this.list(queryWrapper);
|
||||
Map<String, SarFileCompareResComVO> resCommentMap = new HashMap<>();
|
||||
List<SarFileCompareResComment> subList = new ArrayList<>();
|
||||
//先找到一级评论
|
||||
for (SarFileCompareResComment rc : list) {
|
||||
if (MyStringUtils.isEmpty(rc.getParentId())) {
|
||||
resCommentMap.put(rc.getId(), wrapperSarFileCompareResComVO(rc));
|
||||
} else {
|
||||
subList.add(rc);
|
||||
}
|
||||
}
|
||||
//把回复评论放进一级评论下,没有一级评论要查出来放上
|
||||
for (SarFileCompareResComment rc : subList) {
|
||||
if (resCommentMap.keySet().contains(rc.getParentId())) {
|
||||
resCommentMap.get(rc.getParentId()).addResComVo(wrapperSarFileCompareResComVO(rc));
|
||||
} else {
|
||||
SarFileCompareResComment prc = this.queryById(rc.getParentId());
|
||||
SarFileCompareResComVO prcVo = wrapperSarFileCompareResComVO(prc);
|
||||
prcVo.addResComVo(wrapperSarFileCompareResComVO(rc));
|
||||
resCommentMap.put(prcVo.getId(), prcVo);
|
||||
}
|
||||
}
|
||||
ArrayList<SarFileCompareResComVO> sarFileCompareResComVOS = Lists.newArrayList(resCommentMap.values());
|
||||
// 填充属性
|
||||
for (SarFileCompareResComVO sarFileCompareResComVO : sarFileCompareResComVOS) {
|
||||
SysUser user = sysUserService.getUserByName(sarFileCompareResComVO.getName());
|
||||
if (!Objects.isNull(user)){
|
||||
sarFileCompareResComVO.setName(user.calcNameWorkNo());
|
||||
}
|
||||
}
|
||||
return sarFileCompareResComVOS;
|
||||
}
|
||||
}
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
package com.jero.modules.compare.utils;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.extra.tokenizer.Result;
|
||||
import cn.hutool.extra.tokenizer.TokenizerEngine;
|
||||
import cn.hutool.extra.tokenizer.TokenizerUtil;
|
||||
import cn.hutool.extra.tokenizer.Word;
|
||||
import cn.hutool.extra.tokenizer.engine.hanlp.HanLPEngine;
|
||||
import cn.hutool.extra.tokenizer.engine.jieba.JiebaEngine;
|
||||
import com.hankcs.hanlp.HanLP;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.wltea.analyzer.core.IKSegmenter;
|
||||
import org.wltea.analyzer.core.Lexeme;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
public class CompHanLPUtils {
|
||||
|
||||
|
||||
/**
|
||||
* 通过Ik 进行将句子分词
|
||||
*
|
||||
* @param text
|
||||
* @return
|
||||
*/
|
||||
public static Vector<String> participleIk(String text) {
|
||||
//对输入进行分词
|
||||
Vector<String> str = new Vector<>();
|
||||
try {
|
||||
StringReader reader = new StringReader(text);
|
||||
//当为true时,分词器进行最大词长切分
|
||||
IKSegmenter ik = new IKSegmenter(reader, true);
|
||||
Lexeme lexeme = null;
|
||||
while ((lexeme = ik.next()) != null) {
|
||||
str.add(lexeme.getLexemeText());
|
||||
}
|
||||
if (str.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
//分词后
|
||||
log.info("str分词后:" + str);
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 结巴分词
|
||||
*
|
||||
* @param text
|
||||
* @return
|
||||
*/
|
||||
public static Vector<String> participleJieBa(String text) {
|
||||
JiebaEngine engine = new JiebaEngine();
|
||||
Result results = engine.parse(text);
|
||||
//输出:这 两个 方法 的 区别 在于 返回 值
|
||||
String result = CollUtil.join((Iterator<Word>) results, ",");
|
||||
return new Vector<>(Arrays.asList(result.split(",")));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 中文分词
|
||||
*
|
||||
* @param text
|
||||
* @return
|
||||
*/
|
||||
public static Vector<String> participleChinese(String text) {
|
||||
//自动根据用户引入的分词库的jar来自动选择使用的引擎
|
||||
TokenizerEngine engine = TokenizerUtil.createEngine();
|
||||
//解析文本
|
||||
//String text = "这两个方法的区别在于返回值";
|
||||
Result results = engine.parse(text);
|
||||
//输出:这 两个 方法 的 区别 在于 返回 值
|
||||
String result = CollUtil.join((Iterator<Word>) results, ",");
|
||||
return new Vector<>(Arrays.asList(result.split(",")));
|
||||
}
|
||||
|
||||
/**
|
||||
* 采用 HanLP 进行自定义分词
|
||||
*/
|
||||
public static Vector<String> participleHanLP(String text) {
|
||||
TokenizerEngine engine = new HanLPEngine();
|
||||
//解析文本
|
||||
//String text = "这两个方法的区别在于返回值";
|
||||
Result results = engine.parse(text);
|
||||
//输出:这 两个 方法 的 区别 在于 返回 值
|
||||
String result = CollUtil.join((Iterator<Word>) results, ",");
|
||||
return new Vector<>(Arrays.asList(result.split(",")));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Java利用hanlp完成语句相似度分析
|
||||
*
|
||||
* @param sentenceOne
|
||||
* @param sentenceTwo
|
||||
* @return
|
||||
*/
|
||||
public static double findSimilarity(String sentenceOne, String sentenceTwo) {
|
||||
List<String> sentOneWords = getSplitWords(sentenceOne);
|
||||
List<String> sentTwoWords = getSplitWords(sentenceTwo);
|
||||
List<String> allWords = mergeList(sentOneWords, sentTwoWords);
|
||||
int[] statisticOne = statistic(allWords, sentOneWords);
|
||||
int[] statisticTwo = statistic(allWords, sentTwoWords);
|
||||
double dividend = 0;
|
||||
double divisor1 = 0;
|
||||
double divisor2 = 0;
|
||||
int length = statisticOne.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
dividend += statisticOne[i] * statisticTwo[i];
|
||||
divisor1 += Math.pow(statisticOne[i], 2);
|
||||
divisor2 += Math.pow(statisticTwo[i], 2);
|
||||
}
|
||||
return dividend / (Math.sqrt(divisor1) * Math.sqrt(divisor2));
|
||||
}
|
||||
|
||||
|
||||
private static int[] statistic(List<String> allWords, List<String> sentWords) {
|
||||
int[] result = new int[allWords.size()];
|
||||
int size = allWords.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
result[i] = Collections.frequency(sentWords, allWords.get(i));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 去重
|
||||
*
|
||||
* @param listOne
|
||||
* @param listTwo
|
||||
* @return
|
||||
*/
|
||||
private static List<String> mergeList(List<String> listOne, List<String> listTwo) {
|
||||
List<String> result = new ArrayList<>();
|
||||
result.addAll(listOne);
|
||||
result.addAll(listTwo);
|
||||
return result.stream().distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 过滤标签
|
||||
*
|
||||
* @param sentence
|
||||
* @return
|
||||
*/
|
||||
private static List<String> getSplitWords(String sentence) {
|
||||
// 去除掉html标签
|
||||
sentence = Jsoup.parse(sentence.replace(" ", "")).body().text();
|
||||
// 标点符号会被单独分为一个Term,去除之
|
||||
return HanLP.segment(sentence).stream().map(a -> a.word).filter(s -> !"`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、? ".contains(s)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.jero.modules.compare.utils;
|
||||
|
||||
public class CompareConst {
|
||||
/**
|
||||
* 在对比列表左侧
|
||||
*/
|
||||
public static String POS_LEFT = "LEFT";
|
||||
/**
|
||||
* 在对比列表右侧
|
||||
*/
|
||||
public static String POS_RIGHT = "RIGHT";
|
||||
|
||||
/**
|
||||
* 对比条目没有被评论
|
||||
*/
|
||||
public static int NO_REVIEWED = 0;
|
||||
/**
|
||||
* 对比条目已被评论
|
||||
*/
|
||||
public static int REVIEWED = 1;
|
||||
}
|
||||
+228
@@ -0,0 +1,228 @@
|
||||
package com.jero.modules.compare.utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.ss.util.CellUtil;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/****
|
||||
* html转excel
|
||||
* @author user
|
||||
*
|
||||
*/
|
||||
public class ConvertHtml2Excel {
|
||||
/**
|
||||
* html表格转excel
|
||||
*
|
||||
* @param tableHtml 如
|
||||
* <table>
|
||||
* ..
|
||||
* </table>
|
||||
* @return
|
||||
*/
|
||||
public static void table2Excel(String tableHtml, HSSFWorkbook wb,String tableSheetName) {
|
||||
HSSFSheet sheet = wb.createSheet(tableSheetName);
|
||||
List<CrossRangeCellMeta> crossRowEleMetaLs = new ArrayList<CrossRangeCellMeta>();
|
||||
int rowIndex = 0;
|
||||
try {
|
||||
Document data = DocumentHelper.parseText(tableHtml);
|
||||
// 生成表头
|
||||
Element thead = data.getRootElement().element("thead");
|
||||
HSSFCellStyle titleStyle = getTitleStyle(wb);
|
||||
int ls=0;//列数
|
||||
if (thead != null) {
|
||||
List<Element> trLs = thead.elements("tr");
|
||||
for (Element trEle : trLs) {
|
||||
HSSFRow row = sheet.createRow(rowIndex);
|
||||
List<Element> thLs = trEle.elements("th");
|
||||
ls=thLs.size();
|
||||
makeRowCell(thLs, rowIndex, row, 0, titleStyle, crossRowEleMetaLs);
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
// 生成表体
|
||||
Element tbody = data.getRootElement().element("tbody");
|
||||
HSSFCellStyle contentStyle = getContentStyle(wb);
|
||||
if (tbody != null) {
|
||||
List<Element> trLs = tbody.elements("tr");
|
||||
for (Element trEle : trLs) {
|
||||
HSSFRow row = sheet.createRow(rowIndex);
|
||||
List<Element> thLs = trEle.elements("th");
|
||||
int cellIndex = makeRowCell(thLs, rowIndex, row, 0, titleStyle, crossRowEleMetaLs);
|
||||
List<Element> tdLs = trEle.elements("td");
|
||||
makeRowCell(tdLs, rowIndex, row, cellIndex, contentStyle, crossRowEleMetaLs);
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
// 合并表头
|
||||
for (CrossRangeCellMeta crcm : crossRowEleMetaLs) {
|
||||
sheet.addMergedRegion(new CellRangeAddress(crcm.getFirstRow(), crcm.getLastRow(), crcm.getFirstCol(), crcm.getLastCol()));
|
||||
setRegionStyle(sheet, new CellRangeAddress(crcm.getFirstRow(), crcm.getLastRow(), crcm.getFirstCol(), crcm.getLastCol()),contentStyle);
|
||||
}
|
||||
for(int i=0;i<ls;i++){
|
||||
sheet.autoSizeColumn(i, true);//设置列宽
|
||||
}
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产行内容
|
||||
*
|
||||
* @return 最后一列的cell index
|
||||
*/
|
||||
/**
|
||||
* @param tdLs th或者td集合
|
||||
* @param rowIndex 行号
|
||||
* @param row POI行对象
|
||||
* @param startCellIndex
|
||||
* @param cellStyle 样式
|
||||
* @param crossRowEleMetaLs 跨行元数据集合
|
||||
* @return
|
||||
*/
|
||||
private static int makeRowCell(List<Element> tdLs, int rowIndex, HSSFRow row, int startCellIndex, HSSFCellStyle cellStyle,
|
||||
List<CrossRangeCellMeta> crossRowEleMetaLs) {
|
||||
int i = startCellIndex;
|
||||
for (int eleIndex = 0; eleIndex < tdLs.size(); i++, eleIndex++) {
|
||||
int captureCellSize = getCaptureCellSize(rowIndex, i, crossRowEleMetaLs);
|
||||
while (captureCellSize > 0) {
|
||||
for (int j = 0; j < captureCellSize; j++) {// 当前行跨列处理(补单元格)
|
||||
row.createCell(i);
|
||||
i++;
|
||||
}
|
||||
captureCellSize = getCaptureCellSize(rowIndex, i, crossRowEleMetaLs);
|
||||
}
|
||||
Element thEle = tdLs.get(eleIndex);
|
||||
String val = thEle.getTextTrim();
|
||||
if (StringUtils.isBlank(val)) {
|
||||
Element e = thEle.element("a");
|
||||
if (e != null) {
|
||||
val = e.getTextTrim();
|
||||
}
|
||||
}
|
||||
HSSFCell c = row.createCell(i);
|
||||
if (NumberUtils.isNumber(val)) {
|
||||
c.setCellValue(Double.parseDouble(val));
|
||||
c.setCellType(CellType.NUMERIC);
|
||||
} else {
|
||||
c.setCellValue(val);
|
||||
}
|
||||
int rowSpan = NumberUtils.toInt(thEle.attributeValue("rowspan"), 1);
|
||||
int colSpan = NumberUtils.toInt(thEle.attributeValue("colspan"), 1);
|
||||
c.setCellStyle(cellStyle);
|
||||
if (rowSpan > 1 || colSpan > 1) { // 存在跨行或跨列
|
||||
crossRowEleMetaLs.add(new CrossRangeCellMeta(rowIndex, i, rowSpan, colSpan));
|
||||
}
|
||||
if (colSpan > 1) {// 当前行跨列处理(补单元格)
|
||||
for (int j = 1; j < colSpan; j++) {
|
||||
i++;
|
||||
row.createCell(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置合并单元格的边框样式
|
||||
*
|
||||
* @param sheet
|
||||
* @param region
|
||||
* @param cs
|
||||
*/
|
||||
public static void setRegionStyle(HSSFSheet sheet, CellRangeAddress region, HSSFCellStyle cs) {
|
||||
for (int i = region.getFirstRow(); i <= region.getLastRow(); i++) {
|
||||
Row row = CellUtil.getRow(i, sheet);
|
||||
for (int j = region.getFirstColumn(); j <= region.getLastColumn(); j++) {
|
||||
Cell cell = CellUtil.getCell(row, (short) j);
|
||||
cell.setCellStyle(cs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得因rowSpan占据的单元格
|
||||
*
|
||||
* @param rowIndex 行号
|
||||
* @param colIndex 列号
|
||||
* @param crossRowEleMetaLs 跨行列元数据
|
||||
* @return 当前行在某列需要占据单元格
|
||||
*/
|
||||
private static int getCaptureCellSize(int rowIndex, int colIndex, List<CrossRangeCellMeta> crossRowEleMetaLs) {
|
||||
int captureCellSize = 0;
|
||||
for (CrossRangeCellMeta crossRangeCellMeta : crossRowEleMetaLs) {
|
||||
if (crossRangeCellMeta.getFirstRow() < rowIndex && crossRangeCellMeta.getLastRow() >= rowIndex) {
|
||||
if (crossRangeCellMeta.getFirstCol() <= colIndex && crossRangeCellMeta.getLastCol() >= colIndex) {
|
||||
captureCellSize = crossRangeCellMeta.getLastCol() - colIndex + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return captureCellSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得标题样式
|
||||
*
|
||||
* @param workbook
|
||||
* @return
|
||||
*/
|
||||
private static HSSFCellStyle getTitleStyle(HSSFWorkbook workbook) {
|
||||
short titlebackgroundcolor = HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex();
|
||||
short fontSize = 12;
|
||||
String fontName = "宋体";
|
||||
HSSFCellStyle style = workbook.createCellStyle();
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
style.setAlignment(HorizontalAlignment.CENTER);
|
||||
style.setBorderBottom(BorderStyle.THIN); //下边框
|
||||
style.setBorderLeft(BorderStyle.THIN);//左边框
|
||||
style.setBorderTop(BorderStyle.THIN);//上边框
|
||||
style.setBorderRight(BorderStyle.THIN);//右边框
|
||||
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
style.setFillForegroundColor(titlebackgroundcolor);// 背景色
|
||||
|
||||
HSSFFont font = workbook.createFont();
|
||||
font.setFontName(fontName);
|
||||
font.setFontHeightInPoints(fontSize);
|
||||
font.setBold(true);
|
||||
style.setFont(font);
|
||||
return style;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得内容样式
|
||||
*
|
||||
* @param wb
|
||||
* @return
|
||||
*/
|
||||
private static HSSFCellStyle getContentStyle(HSSFWorkbook wb) {
|
||||
short fontSize = 12;
|
||||
String fontName = "宋体";
|
||||
HSSFCellStyle style = wb.createCellStyle();
|
||||
style.setBorderBottom(BorderStyle.THIN);
|
||||
style.setBorderTop(BorderStyle.THIN);
|
||||
style.setBorderLeft(BorderStyle.THIN);
|
||||
style.setBorderRight(BorderStyle.THIN);
|
||||
HSSFFont font = wb.createFont();
|
||||
font.setFontName(fontName);
|
||||
font.setFontHeightInPoints(fontSize);
|
||||
style.setFont(font);
|
||||
style.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.jero.modules.compare.utils;
|
||||
|
||||
public class CrossRangeCellMeta {
|
||||
|
||||
public CrossRangeCellMeta(int firstRowIndex, int firstColIndex, int rowSpan, int colSpan) {
|
||||
super();
|
||||
this.firstRowIndex = firstRowIndex;
|
||||
this.firstColIndex = firstColIndex;
|
||||
this.rowSpan = rowSpan;
|
||||
this.colSpan = colSpan;
|
||||
}
|
||||
|
||||
private int firstRowIndex;
|
||||
private int firstColIndex;
|
||||
private int rowSpan;// 跨越行数
|
||||
private int colSpan;// 跨越列数
|
||||
|
||||
public int getFirstRow() {
|
||||
return firstRowIndex;
|
||||
}
|
||||
|
||||
public int getLastRow() {
|
||||
return firstRowIndex + rowSpan - 1;
|
||||
}
|
||||
|
||||
public int getFirstCol() {
|
||||
return firstColIndex;
|
||||
}
|
||||
|
||||
public int getLastCol() {
|
||||
return firstColIndex + colSpan - 1;
|
||||
}
|
||||
|
||||
public int getColSpan(){
|
||||
return colSpan;
|
||||
}
|
||||
}
|
||||
+2346
File diff suppressed because it is too large
Load Diff
+21
@@ -0,0 +1,21 @@
|
||||
package com.jero.modules.compare.utils.treeTool;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* List 排序 Comparator
|
||||
* @author david
|
||||
*/
|
||||
public class OrdNamComparator implements Comparator<TreeNode> {
|
||||
|
||||
@Override
|
||||
public int compare(TreeNode t1, TreeNode t2) {
|
||||
if (t1.getOrderNum() > t2.getOrderNum()) {
|
||||
return 1;
|
||||
}
|
||||
if (t1.getOrderNum() < t2.getOrderNum()) {
|
||||
return -1;
|
||||
}
|
||||
return t1.getNodeName().compareTo(t2.getNodeName());
|
||||
}
|
||||
}
|
||||
+174
@@ -0,0 +1,174 @@
|
||||
package com.jero.modules.compare.utils.treeTool;
|
||||
|
||||
import com.jero.modules.compare.utils.treeTool.annotation.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 构建树形建构
|
||||
*
|
||||
* @author David
|
||||
*/
|
||||
public class Tree<T> {
|
||||
/**
|
||||
* 用于存放treeNode的Map
|
||||
*/
|
||||
private LinkedHashMap<String, TreeNode> treeNodesMap = new LinkedHashMap<>();
|
||||
/**
|
||||
* 用于存放treeNode的list
|
||||
*/
|
||||
private List<TreeNode> treeNodesList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
public Tree(List<T> list) {
|
||||
initTreeNodeMap(list);
|
||||
initTreeNodeList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将List对象数据转为TreeNodeMap
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
private void initTreeNodeMap(List<T> list) {
|
||||
TreeNode treeNode;
|
||||
for (Object item : list) {
|
||||
treeNode = new TreeNode();
|
||||
treeNode.setNodeId(getFieldValue(item, "TreeNodeId"));
|
||||
treeNode.setNodeName(getFieldValue(item, "TreeNodeName"));
|
||||
treeNode.setParentNodeId(getFieldValue(item, "TreeNodeParentId"));
|
||||
if(StringUtils.isEmpty(getFieldValue(item, "TreeNodeLevel"))) {
|
||||
treeNode.setLevel(0);
|
||||
} else {
|
||||
treeNode.setLevel(Integer.parseInt(getFieldValue(item, "TreeNodeLevel")));
|
||||
}
|
||||
if(StringUtils.isEmpty(getFieldValue(item, "TreeNodeOrder"))) {
|
||||
treeNode.setOrderNum(0);
|
||||
} else {
|
||||
treeNode.setOrderNum(Integer.parseInt(getFieldValue(item, "TreeNodeOrder")));
|
||||
}
|
||||
treeNode.setLastNodeNum(1);
|
||||
treeNode.setData(item);
|
||||
treeNodesMap.put(treeNode.getNodeId(), treeNode);
|
||||
}
|
||||
Iterator<TreeNode> iterator = treeNodesMap.values().iterator();
|
||||
TreeNode parentTreeNode;
|
||||
while (iterator.hasNext()) {
|
||||
treeNode = iterator.next();
|
||||
if (StringUtils.isEmpty(treeNode.getParentNodeId())) {
|
||||
continue;
|
||||
}
|
||||
parentTreeNode = treeNodesMap.get(treeNode.getParentNodeId());
|
||||
if (parentTreeNode != null) {
|
||||
treeNode.setParent(parentTreeNode);
|
||||
parentTreeNode.addChild(treeNode);
|
||||
// 按照orderNum排序
|
||||
Collections.sort(parentTreeNode.getChildren(), new OrdNamComparator());
|
||||
// 判断这个节点是否是最子节点
|
||||
if (treeNode.getChildren().size() == 0) {
|
||||
treeNode.setLastNode(true);
|
||||
}
|
||||
// 计算每一个节点的最子节点的数量
|
||||
List<TreeNode> children = parentTreeNode.getChildren();
|
||||
if (children.size() > 0) {
|
||||
int sum = 0;
|
||||
for (TreeNode treeNode2 : children) {
|
||||
sum += treeNode2.getLastNodeNum();
|
||||
}
|
||||
parentTreeNode.setLastNodeNum(sum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getFieldValue(Object obj, String type) {
|
||||
Class clz = obj.getClass();
|
||||
Field[] fields = clz.getDeclaredFields();
|
||||
String value = null;
|
||||
try {
|
||||
for(Field field : fields){
|
||||
field.setAccessible(true);
|
||||
switch (type){
|
||||
case "TreeNodeId":
|
||||
if(field.isAnnotationPresent(TreeNodeId.class)) {
|
||||
value = String.valueOf(field.get(obj));
|
||||
}
|
||||
break;
|
||||
case "TreeNodeParentId":
|
||||
if(field.isAnnotationPresent(TreeNodeParentId.class)) {
|
||||
value = String.valueOf(field.get(obj));
|
||||
}
|
||||
break;
|
||||
case "TreeNodeName":
|
||||
if(field.isAnnotationPresent(TreeNodeName.class)) {
|
||||
value = String.valueOf(field.get(obj));
|
||||
}
|
||||
break;
|
||||
case "TreeNodeOrder":
|
||||
if(field.isAnnotationPresent(TreeNodeOrder.class)) {
|
||||
value = String.valueOf(field.get(obj));
|
||||
}
|
||||
break;
|
||||
case "TreeNodeLevel":
|
||||
if(field.isAnnotationPresent(TreeNodeLevel.class)) {
|
||||
value = String.valueOf(field.get(obj));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据treeNodesMap转为treeNodesList
|
||||
*/
|
||||
private void initTreeNodeList() {
|
||||
if (treeNodesList.size() > 0) {
|
||||
return;
|
||||
}
|
||||
if (treeNodesMap.size() == 0) {
|
||||
return;
|
||||
}
|
||||
Iterator<TreeNode> iterator = treeNodesMap.values().iterator();
|
||||
TreeNode treeNode;
|
||||
while (iterator.hasNext()) {
|
||||
treeNode = iterator.next();
|
||||
if (treeNode.getParent() == null) {
|
||||
this.treeNodesList.add(treeNode);
|
||||
this.treeNodesList.addAll(treeNode.getAllChildren());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<TreeNode> getTree() {
|
||||
return this.treeNodesList;
|
||||
}
|
||||
|
||||
public List<TreeNode> getRoot() {
|
||||
List<TreeNode> rootList = new ArrayList<>();
|
||||
if (this.treeNodesList.size() > 0) {
|
||||
for (TreeNode node : treeNodesList) {
|
||||
if (node.getParent() == null) {
|
||||
rootList.add(node);
|
||||
Collections.sort(rootList, new OrdNamComparator());
|
||||
}
|
||||
}
|
||||
}
|
||||
return rootList;
|
||||
}
|
||||
|
||||
public TreeNode getTreeNode(String nodeId) {
|
||||
return this.treeNodesMap.get(nodeId);
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
package com.jero.modules.compare.utils.treeTool;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author David
|
||||
*/
|
||||
public class TreeNode {
|
||||
|
||||
/**
|
||||
* 树节点ID
|
||||
*/
|
||||
@JSONField(ordinal = 1)
|
||||
private String nodeId;
|
||||
/**
|
||||
* 树节点名称
|
||||
*/
|
||||
@JSONField(ordinal = 2)
|
||||
private String nodeName;
|
||||
/**
|
||||
* 父节点ID
|
||||
*/
|
||||
@JSONField(ordinal = 3)
|
||||
private String parentNodeId;
|
||||
/**
|
||||
* 节点在树中的排序号
|
||||
*/
|
||||
@JSONField(ordinal = 4)
|
||||
private int orderNum;
|
||||
/**
|
||||
* 节点所在的层级
|
||||
*/
|
||||
@JSONField(ordinal = 5)
|
||||
private int level;
|
||||
/**
|
||||
* 最子节点的数量
|
||||
*/
|
||||
@JSONField(ordinal = 6)
|
||||
private int lastNodeNum;
|
||||
|
||||
/**
|
||||
* 是否是最子节点
|
||||
*/
|
||||
@JSONField(ordinal = 7)
|
||||
private boolean lastNode;
|
||||
|
||||
private Object data;
|
||||
|
||||
/**
|
||||
* 当前节点的儿子节点
|
||||
*/
|
||||
@JSONField(ordinal = 8)
|
||||
private List<TreeNode> children = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 当前节点的完整路径
|
||||
*/
|
||||
@JSONField(ordinal = 9)
|
||||
private String completeName;
|
||||
|
||||
/**
|
||||
* 当前节点的父级节点
|
||||
* 转json的时候忽略此属性,因为此属性到前端无作用
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private TreeNode parent;
|
||||
|
||||
/**
|
||||
* 当前节点的子孙节点
|
||||
* 转json的时候忽略此属性,因为此属性到前端无作用
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private List<TreeNode> allChildren = new ArrayList<>();
|
||||
|
||||
private int standFlag;
|
||||
|
||||
public TreeNode(TreeNode obj) {
|
||||
this.orderNum = obj.getOrderNum();
|
||||
this.level = obj.getLevel();
|
||||
this.lastNodeNum = obj.getLastNodeNum();
|
||||
}
|
||||
|
||||
public TreeNode() {
|
||||
}
|
||||
|
||||
public void addChild(TreeNode treeNode) {
|
||||
this.children.add(treeNode);
|
||||
}
|
||||
|
||||
public void removeChild(TreeNode treeNode) {
|
||||
this.children.remove(treeNode);
|
||||
}
|
||||
|
||||
public String getNodeId() {
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public void setNodeId(String nodeId) {
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public String getNodeName() {
|
||||
return nodeName;
|
||||
}
|
||||
|
||||
public void setNodeName(String nodeName) {
|
||||
this.nodeName = nodeName;
|
||||
}
|
||||
|
||||
public String getParentNodeId() {
|
||||
return parentNodeId;
|
||||
}
|
||||
|
||||
public void setParentNodeId(String parentNodeId) {
|
||||
this.parentNodeId = parentNodeId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public TreeNode getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(TreeNode parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public List<TreeNode> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<TreeNode> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public int getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(int orderNum) {
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public int getLastNodeNum() {
|
||||
return lastNodeNum;
|
||||
}
|
||||
|
||||
public void setLastNodeNum(int lastNodeNum) {
|
||||
this.lastNodeNum = lastNodeNum;
|
||||
}
|
||||
|
||||
public boolean isLastNode() {
|
||||
return lastNode;
|
||||
}
|
||||
|
||||
public void setLastNode(boolean lastNode) {
|
||||
this.lastNode = lastNode;
|
||||
}
|
||||
|
||||
public List<TreeNode> getAllChildren() {
|
||||
if (this.allChildren.isEmpty()) {
|
||||
for (TreeNode treeNode : this.children) {
|
||||
this.allChildren.add(treeNode);
|
||||
this.allChildren.addAll(treeNode.getAllChildren());
|
||||
}
|
||||
}
|
||||
return this.allChildren;
|
||||
}
|
||||
|
||||
public String getCompleteName() {
|
||||
return completeName;
|
||||
}
|
||||
|
||||
public void setCompleteName(String completeName) {
|
||||
this.completeName = completeName;
|
||||
}
|
||||
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getStandFlag() {
|
||||
return standFlag;
|
||||
}
|
||||
|
||||
public void setStandFlag(int standFlag) {
|
||||
this.standFlag = standFlag;
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.jero.modules.compare.utils.treeTool.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author david
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
@Documented
|
||||
public @interface TreeNodeId {
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.jero.modules.compare.utils.treeTool.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author david
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
@Documented
|
||||
public @interface TreeNodeLevel {
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.jero.modules.compare.utils.treeTool.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author david
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
@Documented
|
||||
public @interface TreeNodeName {
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.jero.modules.compare.utils.treeTool.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author david
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
@Documented
|
||||
public @interface TreeNodeOrder {
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.jero.modules.compare.utils.treeTool.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author david
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
@Documented
|
||||
public @interface TreeNodeParentId {
|
||||
}
|
||||
+523
@@ -0,0 +1,523 @@
|
||||
package com.jero.modules.document.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
//import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.entity.OSSFileForDocumentLibrary;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档库信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-01-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="文档库信息表")
|
||||
@RestController
|
||||
@RequestMapping("/document/bussDocumentLibraryEO")
|
||||
@Slf4j
|
||||
@Deprecated
|
||||
public class BussDocumentLibraryEOController extends JeroController<Object, IBussDocumentLibraryEOService> {
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
|
||||
|
||||
// /**
|
||||
// * 分页列表查询
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "分页查询")
|
||||
// @ApiOperation(value="分页查询", notes="分页查询")
|
||||
// @PostMapping(value = "/queryPageInfo")
|
||||
// @ResponseBody
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
// public JSONObject queryPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
// IPage infoPage = bussDocumentLibraryEOService.getInfoPage(parameter);
|
||||
// Result<IPage> ok = Result.OK(infoPage);
|
||||
// JSONObject jsonResult = JSONObject.fromObject(ok);
|
||||
// return jsonResult;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 代替标准分页列表查询
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "代替标准分页列表查询")
|
||||
// @ApiOperation(value="代替标准分页列表查询", notes="代替标准分页列表查询")
|
||||
// @PostMapping(value = "/replacePageInfo")
|
||||
// @ResponseBody
|
||||
// @RequiresPermissions("document:getInfoById")
|
||||
// public Result<IPage> replacePageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
// IPage infoPage = bussDocumentLibraryEOService.replacePageInfo(parameter);
|
||||
// return Result.OK(infoPage);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * ocr识别调取已入库文件
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "ocr识别调取已入库文件分页")
|
||||
// @ApiOperation(value="ocr识别调取已入库文件", notes="ocr识别调取已入库文件")
|
||||
// @PostMapping(value = "/ocrPageInfo")
|
||||
// @ResponseBody
|
||||
// @RequiresPermissions("document:ocrPageInfo")
|
||||
// public Result<IPage<Map<String,Object>>> ocrPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
// IPage<Map<String,Object>> infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
|
||||
// return Result.OK(infoPage);
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 文档翻译调取已入库文件
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档翻译调取已入库文件")
|
||||
// @ApiOperation(value="文档翻译调取已入库文件", notes="文档翻译调取已入库文件")
|
||||
// @PostMapping(value = "/transPageInfo")
|
||||
// @ResponseBody
|
||||
// @RequiresPermissions("documentTranslation:retrieval")
|
||||
// public Result<IPage<Map<String,Object>>> transPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
// IPage<Map<String,Object>> infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
|
||||
// return Result.OK(infoPage);
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 列表查询
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-列表查询")
|
||||
// @ApiOperation(value="文档库信息表-列表查询", notes="文档库信息表-列表查询")
|
||||
// @GetMapping(value = "/list")
|
||||
// public Result<List<BussDocumentLibraryEO>> queryList() {
|
||||
// List<BussDocumentLibraryEO> list = bussDocumentLibraryEOService.queryList();
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
|
||||
|
||||
// /**
|
||||
// * 通过id删除
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-通过id删除")
|
||||
// @ApiOperation(value="文档库信息表-通过id删除", notes="文档库信息表-通过id删除")
|
||||
// @GetMapping(value = "/delete")
|
||||
// @RequiresPermissions("document:deleteBatch")
|
||||
// public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
// bussDocumentLibraryEOService.deleteById(id);
|
||||
// return Result.OK("删除成功!");
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 批量删除
|
||||
// *
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-批量删除")
|
||||
// @ApiOperation(value="文档库信息表-批量删除", notes="文档库信息表-批量删除")
|
||||
// @GetMapping(value = "/deleteBatch")
|
||||
// @RequiresPermissions("document:deleteBatch")
|
||||
// public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids, String cut) {
|
||||
// this.bussDocumentLibraryEOService.deleteByIds(Arrays.asList(ids.split(",")),cut);
|
||||
// return Result.OK("批量删除成功!");
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 通过id查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-通过id查询")
|
||||
// @ApiOperation(value="文档库信息表-通过id查询", notes="文档库信息表-通过id查询")
|
||||
// @GetMapping(value = "/queryById")
|
||||
// @RequiresPermissions("document:queryById")
|
||||
// public Result<BussDocumentLibraryEO> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
// BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(id);
|
||||
// if(bussDocumentLibraryEO==null) {
|
||||
// return Result.error("未找到对应数据");
|
||||
// }
|
||||
// return Result.OK(bussDocumentLibraryEO);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 列表查询条件 标识传 1-->用于查询文档库字段属性
|
||||
* @param flag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-查询条件")
|
||||
@ApiOperation(value="文档库信息表-查询条件", notes="文档库信息表-查询条件")
|
||||
@GetMapping(value = "/queryCondition")
|
||||
@RequiresPermissions("document:queryPageInfo")
|
||||
public Result<List<Map<String,Object>>> queryCondition(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String,Object>> list = bussDocumentLibraryEOService.queryCondition(flag,cut,null);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 列表表头
|
||||
// * @param flag 标识传 1-->用于查询文档库字段属性
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-列表表头")
|
||||
// @ApiOperation(value="文档库信息表-列表表头", notes="文档库信息表-列表表头")
|
||||
// @GetMapping(value = "/getHeader")
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
// public Result<List<Map<String,Object>>> getHeader(@RequestParam(name="flag",required=true) String flag,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String,Object>> list = bussDocumentLibraryEOService.getHeader(flag,cut,null);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 新增表单
|
||||
// * @param flag 标识传 1-->用于查询文档库字段属性
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-新增表单")
|
||||
// @ApiOperation(value="文档库信息表-新增表单", notes="文档库信息表-新增表单")
|
||||
// @GetMapping(value = "/getAddForm")
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
// public Result<List<Map<String,Object>>> getAddForm(@RequestParam(name="flag",required=true) String flag,
|
||||
// @RequestParam(name="cut",required=true) String cut,
|
||||
// @RequestParam(name="type",required=true) String type) {
|
||||
// List<Map<String, Object>> list = bussDocumentLibraryEOService.getAddForm(flag,cut,type);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
|
||||
/**
|
||||
* ocr识别调取已入库文件-中英文切换
|
||||
* @param flag 标识传 1-->用于查询文档库字段属性
|
||||
* @return
|
||||
*/
|
||||
// @AutoLog(value = "文档库信息表-ocr表头和查询条件")
|
||||
// @ApiOperation(value="文档库信息表-ocr表头和查询条件", notes="文档库信息表-ocr表头和查询条件")
|
||||
// @GetMapping(value = "/getHeaderOrConditionForOcr")
|
||||
// @RequiresPermissions("document:ocrPageInfo")
|
||||
// public Result<List<Map<String,Object>>> getHeaderOrConditionForOcr(@RequestParam(name="flag",required=true) String flag,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForOcr(flag,cut);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param flag 标识传 1-->用于查询文档库字段属性
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-文档拆分表头和查询条件")
|
||||
// @ApiOperation(value="文档库信息表-文档拆分表头和查询条件", notes="文档库信息表-文档拆分表头和查询条件")
|
||||
// @GetMapping(value = "/getHeaderOrConditionForSplitFile")
|
||||
// @RequiresPermissions("split:sarFileSplitInfo:splitFile")
|
||||
// public Result<List<Map<String,Object>>> getHeaderOrConditionForSplitFile(@RequestParam(name="flag",required=true) String flag,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForSplit(flag,cut);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
/**
|
||||
* @param flag 标识传 1-->用于查询文档库字段属性
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-文档拆分表头和查询条件")
|
||||
@ApiOperation(value="文档库信息表-文档拆分表头和查询条件", notes="文档库信息表-文档拆分表头和查询条件")
|
||||
@GetMapping(value = "/getHeaderOrConditionForSplitResult")
|
||||
public Result<List<Map<String,Object>>> getHeaderOrConditionForSplitResult(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForSplit(flag,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 编辑数据查询
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
//// @AutoLog(value = "编辑数据查询")
|
||||
//// @ApiOperation(value="编辑数据查询", notes="编辑数据查询")
|
||||
//// @GetMapping(value = "/getDocumentInfoById")
|
||||
//// @RequiresPermissions("document:updateInfo")
|
||||
//// public Result<List<Map<String,Object>>> getDocumentInfoById(@RequestParam(name="id",required=true) String id,
|
||||
//// @RequestParam(name="cut",required=true) String cut) {
|
||||
//// List<Map<String, Object>> list = bussDocumentLibraryEOService.getDocumentInfoById(id,cut);
|
||||
//// return Result.OK(list);
|
||||
//// }
|
||||
// /**
|
||||
// * 详情数据查询
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
//// @AutoLog(value = "详情数据查询")
|
||||
//// @ApiOperation(value="详情数据查询", notes="详情数据查询")
|
||||
//// @GetMapping(value = "/getInfoById")
|
||||
//// @RequiresPermissions("document:queryPageInfo")
|
||||
//// public Result<List<Map<String,Object>>> getInfoById(@RequestParam(name="id",required=true) String id,
|
||||
//// @RequestParam(name="cut",required=true) String cut) {
|
||||
//// List<Map<String, Object>> list = bussDocumentLibraryEOService.getInfoById(id,cut);
|
||||
//// return Result.OK(list);
|
||||
//// }
|
||||
//
|
||||
//// @ApiOperation(value="详情目录查询", notes="详情目录查询")
|
||||
//// @GetMapping(value = "/getMenuList")
|
||||
//// public Result<List<Map<String,Object>>> getMenuList(@RequestParam(name="id",required=true) String id,
|
||||
//// @RequestParam(name="cut",required=true) String cut) {
|
||||
//// List<Map<String, Object>> list = bussDocumentLibraryEOService.getMenuList(id,cut);
|
||||
//// return Result.OK(list);
|
||||
//// }
|
||||
//
|
||||
//// /**
|
||||
//// * 新增数据
|
||||
//// * @param map
|
||||
//// * @return
|
||||
//// */
|
||||
//// @AutoLog(value = "新增数据")
|
||||
//// @ApiOperation(value="新增数据", notes="新增数据")
|
||||
//// @PostMapping(value = "/addInfo")
|
||||
//// @RequiresPermissions("document:getInfoById")
|
||||
//// public Result<String> getInfoById(@RequestBody Map<String,Object> map) {
|
||||
//// try {
|
||||
//// bussDocumentLibraryEOService.addInfo(map);
|
||||
//// } catch (Exception e) {
|
||||
//// return Result.error(e.getMessage());
|
||||
//// }
|
||||
//// return Result.OK("新增成功");
|
||||
//// }
|
||||
//// /**
|
||||
//// * 编辑数据
|
||||
//// * @param map
|
||||
//// * @return
|
||||
//// */
|
||||
//// @AutoLog(value = "编辑数据")
|
||||
//// @ApiOperation(value="编辑数据", notes="编辑数据")
|
||||
//// @PostMapping(value = "/updateInfo")
|
||||
//// @RequiresPermissions("document:updateInfo")
|
||||
//// public Result<String> updateInfo(@RequestBody Map<String,Object> map) {
|
||||
//// try {
|
||||
//// bussDocumentLibraryEOService.updateInfo(map);
|
||||
//// } catch (Exception e) {
|
||||
//// return Result.error(e.getMessage());
|
||||
//// }
|
||||
//// return Result.OK("编辑成功");
|
||||
//// }
|
||||
//
|
||||
//
|
||||
//// /**
|
||||
//// * 添加收藏
|
||||
//// * @param id
|
||||
//// * @return
|
||||
//// */
|
||||
//// @AutoLog(value = "添加收藏")
|
||||
//// @ApiOperation(value="添加收藏", notes="添加收藏")
|
||||
//// @GetMapping(value = "/addCollect")
|
||||
//// @RequiresPermissions("document:addCollect")
|
||||
//// public Result<String> addCollect(String id) {
|
||||
//// try {
|
||||
//// bussDocumentLibraryEOService.addCollect(id);
|
||||
//// } catch (Exception e) {
|
||||
//// return Result.error("收藏失败");
|
||||
//// }
|
||||
//// return Result.OK("收藏成功");
|
||||
//// }
|
||||
//
|
||||
//// /**
|
||||
//// * 取消收藏
|
||||
//// * @param id
|
||||
//// * @return
|
||||
//// */
|
||||
//// @AutoLog(value = "取消收藏")
|
||||
//// @ApiOperation(value="取消收藏", notes="取消收藏")
|
||||
//// @GetMapping(value = "/cancelCollect")
|
||||
//// @RequiresPermissions("document:addCollect")
|
||||
//// public Result<String> cancelCollect(String id) {
|
||||
//// try {
|
||||
//// bussDocumentLibraryEOService.cancelCollect(id);
|
||||
//// } catch (Exception e) {
|
||||
//// return Result.error("取消收藏失败");
|
||||
//// }
|
||||
//// return Result.OK("取消收藏成功");
|
||||
//// }
|
||||
//
|
||||
//// /**
|
||||
//// * 添加订阅
|
||||
//// * @param id
|
||||
//// * @return
|
||||
//// */
|
||||
//// @AutoLog(value = "添加订阅")
|
||||
//// @ApiOperation(value="添加订阅", notes="添加订阅")
|
||||
//// @GetMapping(value = "/addSubscribe")
|
||||
//// @RequiresPermissions("document:addSubscribe")
|
||||
//// public Result<String> addSubscribe(String id) {
|
||||
//// try {
|
||||
//// bussDocumentLibraryEOService.addSubscribe(id);
|
||||
//// } catch (Exception e) {
|
||||
//// return Result.error("订阅失败");
|
||||
//// }
|
||||
//// return Result.OK("订阅成功");
|
||||
//// }
|
||||
////
|
||||
//// /**
|
||||
//// * 取消订阅
|
||||
//// * @param id
|
||||
//// * @return
|
||||
//// */
|
||||
//// @AutoLog(value = "取消订阅")
|
||||
//// @ApiOperation(value="取消订阅", notes="取消订阅")
|
||||
//// @GetMapping(value = "/cancelSubscribe")
|
||||
//// @RequiresPermissions("document:addSubscribe")
|
||||
//// public Result<String> cancelSubscribe(String id) {
|
||||
//// try {
|
||||
//// bussDocumentLibraryEOService.cancelSubscribe(id);
|
||||
//// } catch (Exception e) {
|
||||
//// return Result.error("取消订阅失败");
|
||||
//// }
|
||||
//// return Result.OK("取消订阅成功");
|
||||
//// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "导出excel")
|
||||
// @GetMapping(value = "/exportExcel")
|
||||
// @RequiresPermissions("document:exportExcel")
|
||||
// public void exportExcel(@RequestParam Map<String,Object> map,
|
||||
// HttpServletResponse response,
|
||||
// HttpServletRequest request){
|
||||
// bussDocumentLibraryEOService.exportExcel(map,response,request);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "带文件导出")
|
||||
// @GetMapping(value = "/exportZip")
|
||||
// @RequiresPermissions("document:exportZip")
|
||||
// public void exportZip(@RequestParam Map<String,Object> map,
|
||||
// HttpServletResponse response,
|
||||
// HttpServletRequest request) throws Exception {
|
||||
// bussDocumentLibraryEOService.exportZip(map,response,request);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "模板下载")
|
||||
// @GetMapping(value = "/exportTemplate")
|
||||
// @RequiresPermissions("document:exportTemplate")
|
||||
// public void exportTemplate(@RequestParam Map<String,Object> map, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
// bussDocumentLibraryEOService.exportTemplate(map,response,request);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "导入.zip")
|
||||
// @PostMapping(value = "/importZip")
|
||||
// @RequiresPermissions("document:importZip")
|
||||
// public Result<String> importZip(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||
// @RequestParam(value = "cut",required = false) String cut) {
|
||||
// try {
|
||||
// bussDocumentLibraryEOService.importZip(file,cut);
|
||||
// } catch (Exception e) {
|
||||
// log.error(null,e);
|
||||
// return Result.error(e.getMessage());
|
||||
// }
|
||||
// return Result.OK("导入成功");
|
||||
// }
|
||||
|
||||
// @ApiOperation(value = "推送")
|
||||
// @GetMapping(value = "/pullMessage")
|
||||
// @RequiresPermissions("document:pullMessage")
|
||||
// public Result<String> pullMessage(String departIds, String userIds, String documentIds) {
|
||||
//
|
||||
// bussDocumentLibraryEOService.pullMessage(departIds,userIds,documentIds);
|
||||
//
|
||||
// return Result.OK("推送成功");
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// /**
|
||||
// * 验证文档是否被其他的文档绑定
|
||||
// *
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "验证文档是否被其他的文档绑定")
|
||||
// @ApiOperation(value="验证文档是否被其他的文档绑定", notes="验证文档是否被其他的文档绑定")
|
||||
// @GetMapping(value = "/verifyBind")
|
||||
// public Result<String> verifyBind(@RequestParam(name="ids",required=true) String ids) {
|
||||
// String msg = bussDocumentLibraryEOService.verifyBind(Arrays.asList(ids.split(",")));
|
||||
// return Result.OK(msg);
|
||||
// }
|
||||
|
||||
// @AutoLog(value = "虚拟中心添加调用文档库数据--分页")
|
||||
// @ApiOperation(value="虚拟中心添加调用文档库数据--分页", notes="虚拟中心添加调用文档库数据--分页")
|
||||
// @PostMapping(value = "/queryPageInfoDummy")
|
||||
// public Result<IPage<BussDocumentLibraryEO>> queryPageInfoDummy(@RequestBody BussDocumentLibraryEO bussDocumentLibraryEO,
|
||||
// HttpServletRequest req) {
|
||||
// QueryWrapper<BussDocumentLibraryEO> queryWrapper = QueryGenerator.initQueryWrapper(bussDocumentLibraryEO, req.getParameterMap());
|
||||
// Page<BussDocumentLibraryEO> page = new Page<BussDocumentLibraryEO>(bussDocumentLibraryEO.getPageNo(), bussDocumentLibraryEO.getPageSize());
|
||||
// IPage<BussDocumentLibraryEO> pageList = bussDocumentLibraryEOService.queryPageInfoDummy(page, queryWrapper,bussDocumentLibraryEO);
|
||||
// return Result.OK(pageList);
|
||||
// }
|
||||
|
||||
|
||||
// @ApiOperation(value="虚拟中心添加调用文档库数据--分页", notes="虚拟中心添加调用文档库数据--分页")
|
||||
// @PostMapping(value = "/queryPageDummy")
|
||||
// @ResponseBody
|
||||
// public JSONObject queryPageDummy(@RequestBody Map<String,Object> parameter) {
|
||||
// IPage infoPage = bussDocumentLibraryEOService.getPageDummy(parameter);
|
||||
// Result<IPage> ok = Result.OK(infoPage);
|
||||
// JSONObject jsonResult = JSONObject.fromObject(ok);
|
||||
// return jsonResult;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 查看已上传的文件
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @ApiOperation(value="查看已上传的文件", notes="查看已上传的文件")
|
||||
// @GetMapping(value = "/getFileInfos")
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
// public Result<List<OSSFileForDocumentLibrary>> getFileInfos(String id) {
|
||||
// List<OSSFileForDocumentLibrary> fileInfos = bussDocumentLibraryEOService.getFileInfos(id);
|
||||
// return Result.OK(fileInfos);
|
||||
// }
|
||||
// /**
|
||||
// * 根据id查询编号和标题
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @ApiOperation(value="查看已上传的文件", notes="查看已上传的文件")
|
||||
// @GetMapping(value = "/getTitle")
|
||||
// public Result<String> getTitle(String id, String cut) {
|
||||
// String title = bussDocumentLibraryEOService.getTitle(id, cut);
|
||||
// return Result.OK(title);
|
||||
// }
|
||||
// @ApiOperation(value="编辑ES数据(添加module_type_flag)", notes="编辑ES数据(添加module_type_flag)")
|
||||
// @GetMapping(value = "/updateES")
|
||||
// public Result<Integer> getTitle() {
|
||||
// int count = bussDocumentLibraryEOService.updateES();
|
||||
// return Result.OK(count);
|
||||
// }
|
||||
}
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
//package com.jero.modules.document.controller;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
//import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
//import com.jero.common.api.vo.Result;
|
||||
//import com.jero.common.aspect.annotation.AutoLog;
|
||||
//import com.jero.common.system.base.controller.JeroController;
|
||||
//import com.jero.common.system.query.QueryGenerator;
|
||||
//import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
//import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.validation.annotation.Validated;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//import org.springframework.web.servlet.ModelAndView;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
//import java.util.Arrays;
|
||||
//import java.util.List;
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * @Description: 文档库-分阶段实施详情表
|
||||
// * @Author: jero-boot
|
||||
// * @Date: 2023-02-22
|
||||
// * @Version: V1.0
|
||||
// */
|
||||
//@Api(tags="文档库-分阶段实施详情表")
|
||||
//@RestController
|
||||
//@RequestMapping("/document/phasedImplementationDetailsEO")
|
||||
//@Slf4j
|
||||
//public class PhasedImplementationDetailsEOController extends JeroController<PhasedImplementationDetailsEO, IPhasedImplementationDetailsEOService> {
|
||||
// @Autowired
|
||||
// private IPhasedImplementationDetailsEOService phasedImplementationDetailsEOService;
|
||||
//
|
||||
// /**
|
||||
// * 分页列表查询
|
||||
// *
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// * @param pageNo
|
||||
// * @param pageSize
|
||||
// * @param req
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-分页列表查询")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-分页列表查询", notes="文档库-分阶段实施详情表-分页列表查询")
|
||||
// @GetMapping(value = "/page")
|
||||
// public Result<?> queryPageList(PhasedImplementationDetailsEO phasedImplementationDetailsEO,
|
||||
// @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
// @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
// @RequestParam(name="cut", defaultValue="cn") String cut,
|
||||
// HttpServletRequest req) {
|
||||
// QueryWrapper<PhasedImplementationDetailsEO> queryWrapper = QueryGenerator.initQueryWrapper(phasedImplementationDetailsEO, req.getParameterMap());
|
||||
// Page<PhasedImplementationDetailsEO> page = new Page<PhasedImplementationDetailsEO>(pageNo, pageSize);
|
||||
// IPage<PhasedImplementationDetailsEO> pageList = phasedImplementationDetailsEOService.page(page, queryWrapper);
|
||||
// this.phasedImplementationDetailsEOService.disposeData(pageList.getRecords(),cut);
|
||||
// return Result.OK(pageList);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 列表查询
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-列表查询")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-列表查询", notes="文档库-分阶段实施详情表-列表查询")
|
||||
// @GetMapping(value = "/list")
|
||||
// public Result<List<PhasedImplementationDetailsEO>> queryList() {
|
||||
// List<PhasedImplementationDetailsEO> list = phasedImplementationDetailsEOService.queryList();
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 添加
|
||||
// *
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-添加")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-添加", notes="文档库-分阶段实施详情表-添加")
|
||||
// @PostMapping(value = "/add")
|
||||
// public Result<?> add(@Validated @RequestBody PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
// phasedImplementationDetailsEOService.add(phasedImplementationDetailsEO);
|
||||
// return Result.OK("添加成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 编辑
|
||||
// *
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-编辑")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-编辑", notes="文档库-分阶段实施详情表-编辑")
|
||||
// @PostMapping(value = "/edit")
|
||||
// public Result<?> edit(@Validated @RequestBody PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
// phasedImplementationDetailsEOService.editById(phasedImplementationDetailsEO);
|
||||
// return Result.OK("编辑成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过id删除
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-通过id删除")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-通过id删除", notes="文档库-分阶段实施详情表-通过id删除")
|
||||
// @PostMapping(value = "/delete")
|
||||
// public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
// phasedImplementationDetailsEOService.deleteById(id);
|
||||
// return Result.OK("删除成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 批量删除
|
||||
// *
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-批量删除")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-批量删除", notes="文档库-分阶段实施详情表-批量删除")
|
||||
// @PostMapping(value = "/deleteBatch")
|
||||
// public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
// this.phasedImplementationDetailsEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
// return Result.OK("批量删除成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过id查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-通过id查询")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-通过id查询", notes="文档库-分阶段实施详情表-通过id查询")
|
||||
// @GetMapping(value = "/queryById")
|
||||
// public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
// PhasedImplementationDetailsEO phasedImplementationDetailsEO = phasedImplementationDetailsEOService.queryById(id);
|
||||
// if(phasedImplementationDetailsEO==null) {
|
||||
// return Result.error("未找到对应数据");
|
||||
// }
|
||||
// return Result.OK(phasedImplementationDetailsEO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导出excel
|
||||
// *
|
||||
// * @param request
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// */
|
||||
// @RequestMapping(value = "/exportXls")
|
||||
// public ModelAndView exportXls(HttpServletRequest request, PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
// return super.exportXls(request, phasedImplementationDetailsEO, PhasedImplementationDetailsEO.class, "文档库-分阶段实施详情表");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过excel导入数据
|
||||
// *
|
||||
// * @param request
|
||||
// * @param response
|
||||
// * @return
|
||||
// */
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
// return super.importExcel(request, response, PhasedImplementationDetailsEO.class);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
+526
@@ -0,0 +1,526 @@
|
||||
//package com.jero.modules.document.controller;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
//import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
//import com.jero.common.api.vo.Result;
|
||||
//import com.jero.common.aspect.annotation.AutoLog;
|
||||
//import com.jero.common.system.base.controller.JeroController;
|
||||
//import com.jero.common.system.query.QueryGenerator;
|
||||
//import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
//import com.jero.modules.document.entity.OSSFileForDocumentLibrary;
|
||||
//import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import net.sf.json.JSONObject;
|
||||
//import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//import org.springframework.web.multipart.MultipartFile;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
//import java.util.Arrays;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * @Description: 文档库信息表
|
||||
// * @Author: jero-boot
|
||||
// * @Date: 2022-01-21
|
||||
// * @Version: V1.0
|
||||
// */
|
||||
//@Api(tags="文档库信息表")
|
||||
//@RestController
|
||||
//@RequestMapping("/phone/document/bussDocumentLibraryEO")
|
||||
//@Slf4j
|
||||
//public class PhoneBussDocumentLibraryEOController extends JeroController<BussDocumentLibraryEO, IBussDocumentLibraryEOService> {
|
||||
// @Autowired
|
||||
// private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 分页列表查询
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "分页查询")
|
||||
// @ApiOperation(value="分页查询", notes="分页查询")
|
||||
// @PostMapping(value = "/queryPageInfo")
|
||||
// @ResponseBody
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
// public JSONObject queryPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
// IPage infoPage = bussDocumentLibraryEOService.getInfoPage(parameter);
|
||||
// Result<IPage> ok = Result.OK(infoPage);
|
||||
// JSONObject jsonResult = JSONObject.fromObject(ok);
|
||||
// return jsonResult;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 代替标准分页列表查询
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "代替标准分页列表查询")
|
||||
// @ApiOperation(value="代替标准分页列表查询", notes="代替标准分页列表查询")
|
||||
// @PostMapping(value = "/replacePageInfo")
|
||||
// @ResponseBody
|
||||
// @RequiresPermissions("document:getInfoById")
|
||||
// public Result<?> replacePageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
// IPage infoPage = bussDocumentLibraryEOService.replacePageInfo(parameter);
|
||||
//// Result<IPage> ok = Result.OK(infoPage);
|
||||
//// JSONObject jsonResult = JSONObject.fromObject(ok);
|
||||
// return Result.OK(infoPage);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * ocr识别调取已入库文件
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "ocr识别调取已入库文件分页")
|
||||
// @ApiOperation(value="ocr识别调取已入库文件", notes="ocr识别调取已入库文件")
|
||||
// @PostMapping(value = "/ocrPageInfo")
|
||||
// @ResponseBody
|
||||
// @RequiresPermissions("document:ocrPageInfo")
|
||||
// public Result<IPage<Map<String,Object>>> ocrPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
// IPage<Map<String,Object>> infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
|
||||
// return Result.OK(infoPage);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 文档翻译调取已入库文件
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档翻译调取已入库文件")
|
||||
// @ApiOperation(value="文档翻译调取已入库文件", notes="文档翻译调取已入库文件")
|
||||
// @PostMapping(value = "/transPageInfo")
|
||||
// @ResponseBody
|
||||
// @RequiresPermissions("documentTranslation:retrieval")
|
||||
// public Result<IPage<Map<String,Object>>> transPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
// IPage<Map<String,Object>> infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
|
||||
// return Result.OK(infoPage);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 列表查询
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-列表查询")
|
||||
// @ApiOperation(value="文档库信息表-列表查询", notes="文档库信息表-列表查询")
|
||||
// @GetMapping(value = "/list")
|
||||
// public Result<List<BussDocumentLibraryEO>> queryList() {
|
||||
// List<BussDocumentLibraryEO> list = bussDocumentLibraryEOService.queryList();
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 通过id删除
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-通过id删除")
|
||||
// @ApiOperation(value="文档库信息表-通过id删除", notes="文档库信息表-通过id删除")
|
||||
// @GetMapping(value = "/delete")
|
||||
// @RequiresPermissions("document:deleteBatch")
|
||||
// public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
// bussDocumentLibraryEOService.deleteById(id);
|
||||
// return Result.OK("删除成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 批量删除
|
||||
// *
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-批量删除")
|
||||
// @ApiOperation(value="文档库信息表-批量删除", notes="文档库信息表-批量删除")
|
||||
// @GetMapping(value = "/deleteBatch")
|
||||
// @RequiresPermissions("document:deleteBatch")
|
||||
// public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids, String cut) {
|
||||
// this.bussDocumentLibraryEOService.deleteByIds(Arrays.asList(ids.split(",")),cut);
|
||||
// return Result.OK("批量删除成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过id查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-通过id查询")
|
||||
// @ApiOperation(value="文档库信息表-通过id查询", notes="文档库信息表-通过id查询")
|
||||
// @GetMapping(value = "/queryById")
|
||||
// @RequiresPermissions("document:queryById")
|
||||
// public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
// BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(id);
|
||||
// if(bussDocumentLibraryEO==null) {
|
||||
// return Result.error("未找到对应数据");
|
||||
// }
|
||||
// return Result.OK(bussDocumentLibraryEO);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 列表查询条件 标识传 1-->用于查询文档库字段属性
|
||||
// * @param flag
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-查询条件")
|
||||
// @ApiOperation(value="文档库信息表-查询条件", notes="文档库信息表-查询条件")
|
||||
// @GetMapping(value = "/queryCondition")
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
// public Result<List<Map<String,Object>>> queryCondition(@RequestParam(name="flag",required=true) String flag,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String,Object>> list = bussDocumentLibraryEOService.queryCondition(flag,cut,null);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 列表表头
|
||||
// * @param flag 标识传 1-->用于查询文档库字段属性
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-列表表头")
|
||||
// @ApiOperation(value="文档库信息表-列表表头", notes="文档库信息表-列表表头")
|
||||
// @GetMapping(value = "/getHeader")
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
// public Result<List<Map<String,Object>>> getHeader(@RequestParam(name="flag",required=true) String flag,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String,Object>> list = bussDocumentLibraryEOService.getHeader(flag,cut,null);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增表单
|
||||
// * @param flag 标识传 1-->用于查询文档库字段属性
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-新增表单")
|
||||
// @ApiOperation(value="文档库信息表-新增表单", notes="文档库信息表-新增表单")
|
||||
// @GetMapping(value = "/getAddForm")
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
// public Result<List<Map<String,Object>>> getAddForm(@RequestParam(name="flag",required=true) String flag,
|
||||
// @RequestParam(name="cut",required=true) String cut,
|
||||
// @RequestParam(name="type",required=true) String type) {
|
||||
// List<Map<String, Object>> list = bussDocumentLibraryEOService.getAddForm(flag,cut,type);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * ocr识别调取已入库文件-中英文切换
|
||||
// * @param flag 标识传 1-->用于查询文档库字段属性
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-ocr表头和查询条件")
|
||||
// @ApiOperation(value="文档库信息表-ocr表头和查询条件", notes="文档库信息表-ocr表头和查询条件")
|
||||
// @GetMapping(value = "/getHeaderOrConditionForOcr")
|
||||
// @RequiresPermissions("document:ocrPageInfo")
|
||||
// public Result<List<Map<String,Object>>> getHeaderOrConditionForOcr(@RequestParam(name="flag",required=true) String flag,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForOcr(flag,cut);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param flag 标识传 1-->用于查询文档库字段属性
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-文档拆分表头和查询条件")
|
||||
// @ApiOperation(value="文档库信息表-文档拆分表头和查询条件", notes="文档库信息表-文档拆分表头和查询条件")
|
||||
// @GetMapping(value = "/getHeaderOrConditionForSplitFile")
|
||||
// @RequiresPermissions("split:sarFileSplitInfo:splitFile")
|
||||
// public Result<List<Map<String,Object>>> getHeaderOrConditionForSplitFile(@RequestParam(name="flag",required=true) String flag,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForSplit(flag,cut);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * ocr识别调取已入库文件-中英文切换
|
||||
// * @param flag 标识传 1-->用于查询文档库字段属性
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库信息表-文档拆分表头和查询条件")
|
||||
// @ApiOperation(value="文档库信息表-文档拆分表头和查询条件", notes="文档库信息表-文档拆分表头和查询条件")
|
||||
// @GetMapping(value = "/getHeaderOrConditionForSplitResult")
|
||||
// @RequiresPermissions("split:sarFileSplitInfo:splitResult")
|
||||
// public Result<List<Map<String,Object>>> getHeaderOrConditionForSplitResult(@RequestParam(name="flag",required=true) String flag,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForSplit(flag,cut);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 编辑数据查询
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "编辑数据查询")
|
||||
// @ApiOperation(value="编辑数据查询", notes="编辑数据查询")
|
||||
// @GetMapping(value = "/getDocumentInfoById")
|
||||
// @RequiresPermissions("document:updateInfo")
|
||||
// public Result<List<Map<String,Object>>> getDocumentInfoById(@RequestParam(name="id",required=true) String id,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String, Object>> list = bussDocumentLibraryEOService.getDocumentInfoById(id,cut);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
// /**
|
||||
// * 详情数据查询
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "详情数据查询")
|
||||
// @ApiOperation(value="详情数据查询", notes="详情数据查询")
|
||||
// @GetMapping(value = "/getInfoById")
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
// public Result<List<Map<String,Object>>> getInfoById(@RequestParam(name="id",required=true) String id,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String, Object>> list = bussDocumentLibraryEOService.getInfoById(id,cut);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value="详情目录查询", notes="详情目录查询")
|
||||
// @GetMapping(value = "/getMenuList")
|
||||
// public Result<List<Map<String,Object>>> getMenuList(@RequestParam(name="id",required=true) String id,
|
||||
// @RequestParam(name="cut",required=true) String cut) {
|
||||
// List<Map<String, Object>> list = bussDocumentLibraryEOService.getMenuList(id,cut);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增数据
|
||||
// * @param map
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "新增数据")
|
||||
// @ApiOperation(value="新增数据", notes="新增数据")
|
||||
// @PostMapping(value = "/addInfo")
|
||||
// @RequiresPermissions("document:getInfoById")
|
||||
// public Result<?> getInfoById(@RequestBody Map<String,Object> map) {
|
||||
// try {
|
||||
// bussDocumentLibraryEOService.addInfo(map);
|
||||
// } catch (Exception e) {
|
||||
// return Result.error(e.getMessage());
|
||||
// }
|
||||
// return Result.OK("新增成功");
|
||||
// }
|
||||
// /**
|
||||
// * 编辑数据
|
||||
// * @param map
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "编辑数据")
|
||||
// @ApiOperation(value="编辑数据", notes="编辑数据")
|
||||
// @PostMapping(value = "/updateInfo")
|
||||
// @RequiresPermissions("document:updateInfo")
|
||||
// public Result<?> updateInfo(@RequestBody Map<String,Object> map) {
|
||||
// try {
|
||||
// bussDocumentLibraryEOService.updateInfo(map);
|
||||
// } catch (Exception e) {
|
||||
// return Result.error(e.getMessage());
|
||||
// }
|
||||
// return Result.OK("编辑成功");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 添加收藏
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "添加收藏")
|
||||
// @ApiOperation(value="添加收藏", notes="添加收藏")
|
||||
// @GetMapping(value = "/addCollect")
|
||||
// @RequiresPermissions("document:addCollect")
|
||||
// public Result<?> addCollect(String id) {
|
||||
// try {
|
||||
// bussDocumentLibraryEOService.addCollect(id);
|
||||
// } catch (Exception e) {
|
||||
// return Result.error("收藏失败");
|
||||
// }
|
||||
// return Result.OK("收藏成功");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 取消收藏
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "取消收藏")
|
||||
// @ApiOperation(value="取消收藏", notes="取消收藏")
|
||||
// @GetMapping(value = "/cancelCollect")
|
||||
// @RequiresPermissions("document:addCollect")
|
||||
// public Result<?> cancelCollect(String id) {
|
||||
// try {
|
||||
// bussDocumentLibraryEOService.cancelCollect(id);
|
||||
// } catch (Exception e) {
|
||||
// return Result.error("取消收藏失败");
|
||||
// }
|
||||
// return Result.OK("取消收藏成功");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 添加订阅
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "添加订阅")
|
||||
// @ApiOperation(value="添加订阅", notes="添加订阅")
|
||||
// @GetMapping(value = "/addSubscribe")
|
||||
// @RequiresPermissions("document:addSubscribe")
|
||||
// public Result<?> addSubscribe(String id) {
|
||||
// try {
|
||||
// bussDocumentLibraryEOService.addSubscribe(id);
|
||||
// } catch (Exception e) {
|
||||
// return Result.error("订阅失败");
|
||||
// }
|
||||
// return Result.OK("订阅成功");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 取消订阅
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "取消订阅")
|
||||
// @ApiOperation(value="取消订阅", notes="取消订阅")
|
||||
// @GetMapping(value = "/cancelSubscribe")
|
||||
// @RequiresPermissions("document:addSubscribe")
|
||||
// public Result<?> cancelSubscribe(String id) {
|
||||
// try {
|
||||
// bussDocumentLibraryEOService.cancelSubscribe(id);
|
||||
// } catch (Exception e) {
|
||||
// return Result.error("取消订阅失败");
|
||||
// }
|
||||
// return Result.OK("取消订阅成功");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "导出excel")
|
||||
// @GetMapping(value = "/exportExcel")
|
||||
// @RequiresPermissions("document:exportExcel")
|
||||
// public void exportExcel(@RequestParam Map<String,Object> map,
|
||||
// HttpServletResponse response,
|
||||
// HttpServletRequest request){
|
||||
// bussDocumentLibraryEOService.exportExcel(map,response,request);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "带文件导出")
|
||||
// @GetMapping(value = "/exportZip")
|
||||
// @RequiresPermissions("document:exportZip")
|
||||
// public void exportZip(@RequestParam Map<String,Object> map,
|
||||
// HttpServletResponse response,
|
||||
// HttpServletRequest request) throws Exception {
|
||||
// bussDocumentLibraryEOService.exportZip(map,response,request);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "模板下载")
|
||||
// @GetMapping(value = "/exportTemplate")
|
||||
// @RequiresPermissions("document:exportTemplate")
|
||||
// public void exportTemplate(@RequestParam Map<String,Object> map, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
// bussDocumentLibraryEOService.exportTemplate(map,response,request);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "导入.zip")
|
||||
// @PostMapping(value = "/importZip")
|
||||
// @RequiresPermissions("document:importZip")
|
||||
// public Result<?> importZip(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||
// @RequestParam(value = "cut",required = false) String cut) throws Exception {
|
||||
// try {
|
||||
// bussDocumentLibraryEOService.importZip(file,cut);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return Result.error(e.getMessage());
|
||||
// }
|
||||
// return Result.OK("导入成功");
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "推送")
|
||||
// @GetMapping(value = "/pullMessage")
|
||||
// @RequiresPermissions("document:pullMessage")
|
||||
// public Result<?> pullMessage(String departIds, String userIds, String documentIds) {
|
||||
//
|
||||
// bussDocumentLibraryEOService.pullMessage(departIds,userIds,documentIds);
|
||||
//
|
||||
// return Result.OK("推送成功");
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 验证文档是否被其他的文档绑定
|
||||
// *
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "验证文档是否被其他的文档绑定")
|
||||
// @ApiOperation(value="验证文档是否被其他的文档绑定", notes="验证文档是否被其他的文档绑定")
|
||||
// @GetMapping(value = "/verifyBind")
|
||||
// public Result<?> verifyBind(@RequestParam(name="ids",required=true) String ids) {
|
||||
// String msg = bussDocumentLibraryEOService.verifyBind(Arrays.asList(ids.split(",")));
|
||||
// return Result.OK(msg);
|
||||
// }
|
||||
//
|
||||
// @AutoLog(value = "虚拟中心添加调用文档库数据--分页")
|
||||
// @ApiOperation(value="虚拟中心添加调用文档库数据--分页", notes="虚拟中心添加调用文档库数据--分页")
|
||||
// @PostMapping(value = "/queryPageInfoDummy")
|
||||
// public Result<?> queryPageInfoDummy(@RequestBody BussDocumentLibraryEO bussDocumentLibraryEO,
|
||||
// HttpServletRequest req) {
|
||||
// QueryWrapper<BussDocumentLibraryEO> queryWrapper = QueryGenerator.initQueryWrapper(bussDocumentLibraryEO, req.getParameterMap());
|
||||
// Page<BussDocumentLibraryEO> page = new Page<BussDocumentLibraryEO>(bussDocumentLibraryEO.getPageNo(), bussDocumentLibraryEO.getPageSize());
|
||||
// IPage<BussDocumentLibraryEO> pageList = bussDocumentLibraryEOService.queryPageInfoDummy(page, queryWrapper,bussDocumentLibraryEO);
|
||||
// return Result.OK(pageList);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value="虚拟中心添加调用文档库数据--分页", notes="虚拟中心添加调用文档库数据--分页")
|
||||
// @PostMapping(value = "/queryPageDummy")
|
||||
// @ResponseBody
|
||||
// public JSONObject queryPageDummy(@RequestBody Map<String,Object> parameter) {
|
||||
// IPage infoPage = bussDocumentLibraryEOService.getPageDummy(parameter);
|
||||
// Result<IPage> ok = Result.OK(infoPage);
|
||||
// JSONObject jsonResult = JSONObject.fromObject(ok);
|
||||
// return jsonResult;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查看已上传的文件
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @ApiOperation(value="查看已上传的文件", notes="查看已上传的文件")
|
||||
// @GetMapping(value = "/getFileInfos")
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
// public Result<?> getFileInfos(String id) {
|
||||
// List<OSSFileForDocumentLibrary> fileInfos = bussDocumentLibraryEOService.getFileInfos(id);
|
||||
// return Result.OK(fileInfos);
|
||||
// }
|
||||
// /**
|
||||
// * 根据id查询编号和标题
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @ApiOperation(value="查看已上传的文件", notes="查看已上传的文件")
|
||||
// @GetMapping(value = "/getTitle")
|
||||
// public Result<?> getTitle(String id, String cut) {
|
||||
// String title = bussDocumentLibraryEOService.getTitle(id, cut);
|
||||
// return Result.OK(title);
|
||||
// }
|
||||
// @ApiOperation(value="编辑ES数据(添加module_type_flag)", notes="编辑ES数据(添加module_type_flag)")
|
||||
// @GetMapping(value = "/updateES")
|
||||
// public Result<?> getTitle() {
|
||||
// int count = bussDocumentLibraryEOService.updateES();
|
||||
// return Result.OK(count);
|
||||
// }
|
||||
//}
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
//package com.jero.modules.document.controller;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
//import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
//import com.jero.common.api.vo.Result;
|
||||
//import com.jero.common.aspect.annotation.AutoLog;
|
||||
//import com.jero.common.system.base.controller.JeroController;
|
||||
//import com.jero.common.system.query.QueryGenerator;
|
||||
////import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
////import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.validation.annotation.Validated;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//import org.springframework.web.servlet.ModelAndView;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
//import java.util.Arrays;
|
||||
//import java.util.List;
|
||||
//
|
||||
//
|
||||
///**
|
||||
//* @Description: 文档库-分阶段实施详情表
|
||||
//* @Author: jero-boot
|
||||
//* @Date: 2023-02-22
|
||||
//* @Version: V1.0
|
||||
//*/
|
||||
//@Api(tags="文档库-分阶段实施详情表")
|
||||
//@RestController
|
||||
//@RequestMapping("/phone/document/phasedImplementationDetailsEO")
|
||||
//@Slf4j
|
||||
//public class PhonePhasedImplementationDetailsEOController extends JeroController<PhasedImplementationDetailsEO, IPhasedImplementationDetailsEOService> {
|
||||
// @Autowired
|
||||
// private IPhasedImplementationDetailsEOService phasedImplementationDetailsEOService;
|
||||
//
|
||||
// /**
|
||||
// * 分页列表查询
|
||||
// *
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// * @param pageNo
|
||||
// * @param pageSize
|
||||
// * @param req
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-分页列表查询")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-分页列表查询", notes="文档库-分阶段实施详情表-分页列表查询")
|
||||
// @GetMapping(value = "/page")
|
||||
// public Result<?> queryPageList(PhasedImplementationDetailsEO phasedImplementationDetailsEO,
|
||||
// @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
// @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
// @RequestParam(name="cut", defaultValue="cn") String cut,
|
||||
// HttpServletRequest req) {
|
||||
// QueryWrapper<PhasedImplementationDetailsEO> queryWrapper = QueryGenerator.initQueryWrapper(phasedImplementationDetailsEO, req.getParameterMap());
|
||||
// Page<PhasedImplementationDetailsEO> page = new Page<PhasedImplementationDetailsEO>(pageNo, pageSize);
|
||||
// IPage<PhasedImplementationDetailsEO> pageList = phasedImplementationDetailsEOService.page(page, queryWrapper);
|
||||
// this.phasedImplementationDetailsEOService.disposeData(pageList.getRecords(),cut);
|
||||
// return Result.OK(pageList);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 列表查询
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-列表查询")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-列表查询", notes="文档库-分阶段实施详情表-列表查询")
|
||||
// @GetMapping(value = "/list")
|
||||
// public Result<List<PhasedImplementationDetailsEO>> queryList() {
|
||||
// List<PhasedImplementationDetailsEO> list = phasedImplementationDetailsEOService.queryList();
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 添加
|
||||
// *
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-添加")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-添加", notes="文档库-分阶段实施详情表-添加")
|
||||
// @PostMapping(value = "/add")
|
||||
// public Result<?> add(@Validated @RequestBody PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
// phasedImplementationDetailsEOService.add(phasedImplementationDetailsEO);
|
||||
// return Result.OK("添加成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 编辑
|
||||
// *
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-编辑")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-编辑", notes="文档库-分阶段实施详情表-编辑")
|
||||
// @PostMapping(value = "/edit")
|
||||
// public Result<?> edit(@Validated @RequestBody PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
// phasedImplementationDetailsEOService.editById(phasedImplementationDetailsEO);
|
||||
// return Result.OK("编辑成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过id删除
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-通过id删除")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-通过id删除", notes="文档库-分阶段实施详情表-通过id删除")
|
||||
// @PostMapping(value = "/delete")
|
||||
// public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
// phasedImplementationDetailsEOService.deleteById(id);
|
||||
// return Result.OK("删除成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 批量删除
|
||||
// *
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-批量删除")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-批量删除", notes="文档库-分阶段实施详情表-批量删除")
|
||||
// @PostMapping(value = "/deleteBatch")
|
||||
// public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
// this.phasedImplementationDetailsEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
// return Result.OK("批量删除成功!");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过id查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @AutoLog(value = "文档库-分阶段实施详情表-通过id查询")
|
||||
// @ApiOperation(value="文档库-分阶段实施详情表-通过id查询", notes="文档库-分阶段实施详情表-通过id查询")
|
||||
// @GetMapping(value = "/queryById")
|
||||
// public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
// PhasedImplementationDetailsEO phasedImplementationDetailsEO = phasedImplementationDetailsEOService.queryById(id);
|
||||
// if(phasedImplementationDetailsEO==null) {
|
||||
// return Result.error("未找到对应数据");
|
||||
// }
|
||||
// return Result.OK(phasedImplementationDetailsEO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导出excel
|
||||
// *
|
||||
// * @param request
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// */
|
||||
// @RequestMapping(value = "/exportXls")
|
||||
// public ModelAndView exportXls(HttpServletRequest request, PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
// return super.exportXls(request, phasedImplementationDetailsEO, PhasedImplementationDetailsEO.class, "文档库-分阶段实施详情表");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过excel导入数据
|
||||
// *
|
||||
// * @param request
|
||||
// * @param response
|
||||
// * @return
|
||||
// */
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
// return super.importExcel(request, response, PhasedImplementationDetailsEO.class);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
//package com.jero.modules.document.entity;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.annotation.IdType;
|
||||
//import com.baomidou.mybatisplus.annotation.TableField;
|
||||
//import com.baomidou.mybatisplus.annotation.TableId;
|
||||
//import com.baomidou.mybatisplus.annotation.TableName;
|
||||
//import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
//import com.jero.common.aspect.annotation.Dict;
|
||||
//import io.swagger.annotations.ApiModel;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.Data;
|
||||
//import lombok.EqualsAndHashCode;
|
||||
//import lombok.experimental.Accessors;
|
||||
//import org.springframework.format.annotation.DateTimeFormat;
|
||||
//
|
||||
//import java.io.Serializable;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * @Description: 文档库信息表
|
||||
// * @Author: jero-boot
|
||||
// * @Date: 2022-01-21
|
||||
// * @Version: V1.0
|
||||
// */
|
||||
//@Data
|
||||
//@TableName("buss_document_library")
|
||||
//@Accessors(chain = true)
|
||||
//@EqualsAndHashCode(callSuper = false)
|
||||
//@ApiModel(value="buss_document_library对象", description="文档库信息表")
|
||||
//public class BussDocumentLibraryEO implements Serializable {
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**主键*/
|
||||
// @TableId(type = IdType.ASSIGN_ID)
|
||||
// @ApiModelProperty(value = "主键")
|
||||
// private String id;
|
||||
//
|
||||
// /**编号*/
|
||||
// @ApiModelProperty(value = "编号")
|
||||
// private String serialNumber;
|
||||
//
|
||||
// /**标题*/
|
||||
// @ApiModelProperty(value = "标题")
|
||||
// private String title;
|
||||
//
|
||||
// private String titleEn;
|
||||
//
|
||||
// /**适用范围*/
|
||||
// @ApiModelProperty(value = "适用范围")
|
||||
// private String shi4Yong4Fan4Wei2;
|
||||
//
|
||||
// /**适用地区*/
|
||||
// @ApiModelProperty(value = "适用地区")
|
||||
// private String region;
|
||||
// /**适用地区*/
|
||||
// @ApiModelProperty(value = "类别")
|
||||
// private String lei4Bie2;
|
||||
//
|
||||
// /**状态*/
|
||||
// @ApiModelProperty(value = "状态")
|
||||
// @Dict(dicCode ="state")
|
||||
// private String state;
|
||||
//
|
||||
// /**技术领域*/
|
||||
// @ApiModelProperty(value = "技术领域")
|
||||
// @Dict(dicCode ="technology_territory")
|
||||
// private String technologyTerritory;
|
||||
//
|
||||
// /**新车型实施日期*/
|
||||
// @ApiModelProperty(value = "新车型实施日期")
|
||||
// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
// @DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
// private java.util.Date xin1Che1Xing2Shi2Shi1Ri4Qi1;
|
||||
//
|
||||
// /**在产车实施日期*/
|
||||
// @ApiModelProperty(value = "在产车实施日期")
|
||||
// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
// @DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
// private java.util.Date implementTime;
|
||||
//
|
||||
// /**对应标准*/
|
||||
// @ApiModelProperty(value = "对应标准")
|
||||
// private String correspondingStandard;
|
||||
//
|
||||
//
|
||||
// /**代替标准*/
|
||||
// @ApiModelProperty(value = "代替标准")
|
||||
// @Dict(dicCode ="replace_standard")
|
||||
// private String replaceStandard;
|
||||
//
|
||||
//
|
||||
// /**被代替标准*/
|
||||
// @ApiModelProperty(value = "被代替标准")
|
||||
// @Dict(dicCode ="replaced_standard")
|
||||
// private String replacedStandard;
|
||||
//
|
||||
//
|
||||
//
|
||||
// @TableField(exist = false)
|
||||
// private String cut;
|
||||
//
|
||||
// @TableField(exist = false)
|
||||
// private Integer pageNo;
|
||||
// @TableField(exist = false)
|
||||
// private Integer pageSize;
|
||||
//
|
||||
//}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.document.entity;
|
||||
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 17:25 2022/4/25
|
||||
*/
|
||||
@Data
|
||||
public class OSSFileForDocumentLibrary extends OSSFile {
|
||||
|
||||
// 拆分回传文档库,标准分解单专用
|
||||
private Integer splitFlag;
|
||||
private String splitInfoId;
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
//package com.jero.modules.document.entity;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.annotation.IdType;
|
||||
//import com.baomidou.mybatisplus.annotation.TableField;
|
||||
//import com.baomidou.mybatisplus.annotation.TableId;
|
||||
//import com.baomidou.mybatisplus.annotation.TableName;
|
||||
//import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
//import io.swagger.annotations.ApiModel;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.Data;
|
||||
//import lombok.EqualsAndHashCode;
|
||||
//import lombok.experimental.Accessors;
|
||||
//import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
//import org.springframework.format.annotation.DateTimeFormat;
|
||||
//
|
||||
//import java.io.Serializable;
|
||||
//import java.util.Date;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * @Description: 文档库-分阶段实施详情表
|
||||
// * @Author: jero-boot
|
||||
// * @Date: 2023-02-22
|
||||
// * @Version: V1.0
|
||||
// */
|
||||
//@Data
|
||||
//@TableName("phased_implementation_details")
|
||||
//@Accessors(chain = true)
|
||||
//@EqualsAndHashCode(callSuper = false)
|
||||
//@ApiModel(value="phased_implementation_details对象", description="文档库-分阶段实施详情表")
|
||||
//public class PhasedImplementationDetailsEO implements Serializable {
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**主键*/
|
||||
// @TableId(type = IdType.ASSIGN_ID)
|
||||
// @ApiModelProperty(value = "主键")
|
||||
// private String id;
|
||||
//
|
||||
// /**创建人*/
|
||||
// @ApiModelProperty(value = "创建人")
|
||||
// private String createBy;
|
||||
//
|
||||
// /**创建日期*/
|
||||
// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
// @ApiModelProperty(value = "创建日期")
|
||||
// private Date createTime;
|
||||
//
|
||||
// /**更新人*/
|
||||
// @ApiModelProperty(value = "更新人")
|
||||
// private String updateBy;
|
||||
//
|
||||
// /**更新日期*/
|
||||
// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
// @ApiModelProperty(value = "更新日期")
|
||||
// private Date updateTime;
|
||||
//
|
||||
// /**所属部门*/
|
||||
// @ApiModelProperty(value = "所属部门")
|
||||
// private String sysOrgCode;
|
||||
//
|
||||
// /**文档库id*/
|
||||
// @Excel(name = "文档库id", width = 15)
|
||||
// @ApiModelProperty(value = "文档库id")
|
||||
// private String bussDocumentLibraryId;
|
||||
//
|
||||
// /**法规编号/条款*/
|
||||
// @Excel(name = "法规编号/条款", width = 15)
|
||||
// @ApiModelProperty(value = "法规编号/条款")
|
||||
// private String standNumberOrClause;
|
||||
//
|
||||
// /**实施类型*/
|
||||
// @Excel(name = "实施类型", width = 15)
|
||||
// @ApiModelProperty(value = "实施类型")
|
||||
// private String implementationType;
|
||||
//
|
||||
// /**实施类型展示文本**/
|
||||
// @TableField(exist = false)
|
||||
// private String implementationTypeText;
|
||||
//
|
||||
// /**实施日期*/
|
||||
// @Excel(name = "实施日期", width = 15, format = "yyyy-MM-dd")
|
||||
// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
// @DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
// @ApiModelProperty(value = "实施日期")
|
||||
// private Date implementationDate;
|
||||
//
|
||||
// /**备注*/
|
||||
// @Excel(name = "备注", width = 15)
|
||||
// @ApiModelProperty(value = "备注")
|
||||
// private String remarks;
|
||||
//
|
||||
// /**排序号*/
|
||||
// @Excel(name = "排序号", width = 15)
|
||||
// @ApiModelProperty(value = "排序号")
|
||||
// private Integer orderNum;
|
||||
//}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.jero.modules.document.enums;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @date 2022/1/21 15:22
|
||||
* @auth zhn
|
||||
*/
|
||||
public enum FieldTypeEnum {
|
||||
/**
|
||||
* 旧的不用了
|
||||
* //属性类型 1输入框(字符串),2输入框(数字),3单选下拉框,4多选下拉框,5单日期选择,6多日期选择,7文件,8文本框,9人员选择,10标准选择
|
||||
* TREE("树形结构","0"),
|
||||
* TEXT_STRING("输入框(字符串)","1"),
|
||||
* TEXT_NUMBER("输入框(数字)","2"),
|
||||
* PULL_SINGLE("单选下拉框","3"),
|
||||
* PULL_MORE("多选下拉框","4"),
|
||||
* DATE_SINGLE("单日期选择","5"),
|
||||
* DATE_MORE("多日期选择","6"),
|
||||
* FILE("文件","7"),
|
||||
* TEXT("文本框","8"),
|
||||
* PERSON("人员选择","9"),
|
||||
* STANDARD("标准选择","10"),
|
||||
* TEXT_LINK("输入框(链接)","11");
|
||||
*/
|
||||
|
||||
DATE_SINGLE("单日期选择","1"),
|
||||
PERSON("单选用户弹框","2"),
|
||||
GROUP_SINGLE("单选组织机构弹框","3"),
|
||||
DATE_MORE("多日期选择","4"),
|
||||
TEXT_MANY("多行文本","5"),
|
||||
STANDARD("多选标准弹框","6"),
|
||||
GROUP_MANY("多选组织机构弹框","7"),
|
||||
FILE("上传文件","8"),
|
||||
TEXT("文本框","9"),
|
||||
PULL_SINGLE("下拉单选","10"),
|
||||
PULL_MORE("下拉多选","11"),
|
||||
TREE_BOX("树型结构(多选)","12"),
|
||||
TEXT_LINK("输入框(链接)","13"),
|
||||
YEAR_OPTION("年份选择","14"),
|
||||
TREE("树型结构(单选)","15");
|
||||
|
||||
|
||||
String name;
|
||||
String value;
|
||||
|
||||
FieldTypeEnum(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.jero.modules.document.enums;
|
||||
|
||||
/**
|
||||
* 实施类型枚举类
|
||||
*/
|
||||
public enum ImplementationTypeEnum {
|
||||
CAR_IN_PRODUCTION("1628228171473039361","在产车","New Vehicle","34e90bd6a000471bbdcd0ff325898740"),
|
||||
NEW_CAR_MODEL("1628228101830815745","新车型","New Type","2148610ff06641849106321531656bfc");
|
||||
|
||||
String id;
|
||||
String nameCn;
|
||||
String nameEn;
|
||||
String itemValue;
|
||||
|
||||
ImplementationTypeEnum(String id, String nameCn, String nameEn, String itemValue) {
|
||||
this.id = id;
|
||||
this.nameCn = nameCn;
|
||||
this.nameEn = nameEn;
|
||||
this.itemValue = itemValue;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getNameCn() {
|
||||
return nameCn;
|
||||
}
|
||||
|
||||
public String getNameEn() {
|
||||
return nameEn;
|
||||
}
|
||||
|
||||
public String getItemValue() {
|
||||
return itemValue;
|
||||
}
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.jero.modules.document.enums;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* 法规状态枚举
|
||||
* @date 2022/1/21 15:22
|
||||
* @auth zhn
|
||||
*/
|
||||
public enum LawsStateEnum {
|
||||
ACTIVE("现行","1"),
|
||||
ABOLISH("废止","2"),
|
||||
THE_UPCOMING("即将实施","3"),
|
||||
DRAFT("草稿","4"),
|
||||
BE_REPLACED("被替代","5");
|
||||
|
||||
|
||||
|
||||
String name;
|
||||
String value;
|
||||
|
||||
LawsStateEnum(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.jero.modules.document.enums;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @date 2022/1/21 15:22
|
||||
* @auth zhn
|
||||
*/
|
||||
public enum SearchEnum {
|
||||
INDEX_NAME_DOCUMENT("文档库索引名称","documentLibrary"),
|
||||
TYPE_NAME_DOCUMENT("文档库类型","document"),
|
||||
INDEX_NAME_LAWS_MONTHLY_REPORT("法规月报索引名称","lawsmonthlyreportmanage"),
|
||||
TYPE_NAME_LAWS_MONTHLY_REPORT("法规月报类型名称","lawsmonthlyreport"),
|
||||
FULL_TEXT_SEARCH("全部中文","fulltextsearchcn"),
|
||||
FULL_TEXT_SEARCH_CN("全部中文","fulltextsearchcn"),
|
||||
FULL_TEXT_SEARCH_EN("全部英文","fulltextsearchen"),
|
||||
INDEX_PROBLEM_KNOWLEDGE_BASE("问题知识库索引名称","problemKnowledgeBase"),
|
||||
TYPE_PROBLEM_KNOWLEDGE_BASE_CN("问题知识库类型","problemKnowledgeBaseTypeCn"),
|
||||
TYPE_PROBLEM_KNOWLEDGE_BASE_EN("问题知识库类型","problemKnowledgeBaseTypeEn");
|
||||
|
||||
String name;
|
||||
String value;
|
||||
|
||||
SearchEnum(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package com.jero.modules.document.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
//import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 文档库信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-01-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Deprecated
|
||||
public interface BussDocumentLibraryEOMapper extends BaseMapper<Object> {
|
||||
|
||||
// int insertInfo(@Param("insertField") String insertField,
|
||||
// @Param("insertValue") String insertValue);
|
||||
//
|
||||
// /**
|
||||
// * 分页查询
|
||||
// *
|
||||
// * @param page
|
||||
// * @param field
|
||||
// * @param condition
|
||||
// * @return
|
||||
// */
|
||||
// IPage<Map<String,Object>> getInfoPage(@Param("page") IPage<Map<String,Object>> page,
|
||||
// @Param("field") String field,
|
||||
// @Param("condition") String condition);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 列表查询
|
||||
// *
|
||||
// * @param
|
||||
// * @param field
|
||||
// * @param condition
|
||||
// * @return
|
||||
// */
|
||||
// List<Map<String, Object>> getInfoList(@Param("field") String field,
|
||||
// @Param("condition") String condition);
|
||||
//
|
||||
// /**
|
||||
// * 代替标准分页
|
||||
// *
|
||||
// * @param page
|
||||
// * @param field
|
||||
// * @param condition
|
||||
// * @return
|
||||
// */
|
||||
// IPage<Map<String, Object>> replacePageInfo(@Param("page") IPage page,
|
||||
// @Param("field") String field,
|
||||
// @Param("condition") String condition);
|
||||
//
|
||||
// /**
|
||||
// * ocr识别调取已入库文件分页
|
||||
// *
|
||||
// * @param page
|
||||
// * @param field
|
||||
// * @param condition
|
||||
// * @return
|
||||
// */
|
||||
// List<Map<String, Object>> ocrPageInfo(
|
||||
// @Param("field") String field,
|
||||
// @Param("condition") String condition);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 根据代替标准列表查询
|
||||
// *
|
||||
// * @param
|
||||
// * @param replaceStandard
|
||||
// * @return
|
||||
// */
|
||||
// List<Map<String, Object>> getInfoListByReplaceStandard(@Param("replaceStandard") String replaceStandard);
|
||||
//
|
||||
//
|
||||
List<Map<String,Object>> getListBySerialNumber(@Param("serialNumbers") String serialNumbers);
|
||||
|
||||
List<String> getListBySerialNumberFuzzy(@Param("serialNumber") String serialNumber);
|
||||
|
||||
|
||||
// List<Map<String,Object>> selectMapsAll(@Param("ids") String ids);
|
||||
//
|
||||
// List<Map<String,Object>> selectMapsAllBySerialNumber(@Param("serialNumberList") String serialNumberList);
|
||||
//
|
||||
// List<Map<String,Object>> getListInfo(@Param("condition") String condition);
|
||||
//
|
||||
// List<Map<String,Object>> selectMapsByDeleteIds(@Param("id") String id);
|
||||
//
|
||||
// void updateByDeleteId(@Param("correspondingStandardStr") String correspondingStandardStr,
|
||||
// @Param("replaceStandardStr") String replaceStandardStr,
|
||||
// @Param("id") String id );
|
||||
// List<Map<String, Object>> queryListByIds(@Param("ids") String ids);
|
||||
//
|
||||
// BussDocumentLibraryEO getBySerialNumber(@Param("serialNumber") String serialNumber);
|
||||
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
//package com.jero.modules.document.mapper;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
//import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
//
|
||||
///**
|
||||
// * @Description: 文档库-分阶段实施详情表
|
||||
// * @Author: jero-boot
|
||||
// * @Date: 2023-02-22
|
||||
// * @Version: V1.0
|
||||
// */
|
||||
//public interface PhasedImplementationDetailsEOMapper extends BaseMapper<PhasedImplementationDetailsEO> {
|
||||
//
|
||||
//}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
<?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.jero.modules.document.mapper.BussDocumentLibraryEOMapper">
|
||||
<!-- <resultMap id="BussDocumentLibraryEOResultMap" type="com.jero.modules.document.entity.BussDocumentLibraryEO">-->
|
||||
<!-- <id column="id" property="id" />-->
|
||||
<!-- <id column="serial_number" property="serialNumber" />-->
|
||||
<!-- <id column="title" property="title" />-->
|
||||
<!-- <id column="title_en" property="titleEn" />-->
|
||||
<!-- <id column="shi4_yong4_fan4_wei2" property="shi4Yong4Fan4Wei2" />-->
|
||||
<!-- <id column="state" property="state" />-->
|
||||
<!-- <id column="technology_territory" property="technologyTerritory" />-->
|
||||
<!-- <id column="xin1_che1_xing2_shi2_shi1_ri4_qi1" property="xin1Che1Xing2Shi2Shi1Ri4Qi1" />-->
|
||||
<!-- <id column="implement_time" property="implementTime" />-->
|
||||
<!-- <id column="corresponding_standard" property="correspondingStandard" />-->
|
||||
<!-- <id column="lei4_bie2" property="lei4Bie2" />-->
|
||||
<!-- </resultMap>-->
|
||||
|
||||
<!-- <insert id="insertInfo">-->
|
||||
<!-- insert into buss_document_library(${insertField})-->
|
||||
<!-- values (${insertValue})-->
|
||||
<!-- </insert>-->
|
||||
|
||||
<!-- <!–分页–>-->
|
||||
<!-- <select id="getInfoPage" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select ${field} from buss_document_library-->
|
||||
<!-- ${condition}-->
|
||||
<!-- </select>-->
|
||||
<!-- <!–列表–>-->
|
||||
<!-- <select id="getInfoList" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select ${field} from buss_document_library-->
|
||||
<!-- ${condition}-->
|
||||
<!-- </select>-->
|
||||
<!-- <!–代替标准分页–>-->
|
||||
<!-- <select id="replacePageInfo" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select ${field} from buss_document_library-->
|
||||
<!-- ${condition}-->
|
||||
<!-- </select>-->
|
||||
<!-- <!–ocr识别调取已入库文件分页–>-->
|
||||
<!-- <select id="ocrPageInfo" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select ${field}-->
|
||||
<!-- ${condition}-->
|
||||
<!-- </select>-->
|
||||
<!-- <!–根据代替标准列表查询–>-->
|
||||
<!-- <select id="getInfoListByReplaceStandard" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select * from buss_document_library-->
|
||||
<!-- where 1=1-->
|
||||
<!-- <if test="replaceStandard != null" >-->
|
||||
<!-- and replace_standard in-->
|
||||
<!-- <foreach collection="replaceStandard.split(',')" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- </select>-->
|
||||
<!-- <!–根据编码列表查询–>-->
|
||||
<!-- <select id="getListBySerialNumber" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select * from buss_document_library-->
|
||||
<!-- where 1=1-->
|
||||
<!-- <if test="serialNumbers != null" >-->
|
||||
<!-- and serial_number in-->
|
||||
<!-- <foreach collection="serialNumbers.split(',')" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <select id="getListBySerialNumberFuzzy" resultType="java.lang.String">-->
|
||||
<!-- select id from buss_document_library-->
|
||||
<!-- where serial_number like concat(concat('%',#{serialNumber}),'%')-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <!–分页–>-->
|
||||
<!-- <select id="selectMapsAll" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select * from buss_document_library-->
|
||||
<!-- where 1=1-->
|
||||
<!-- <if test="ids != null" >-->
|
||||
<!-- and id in-->
|
||||
<!-- <foreach collection="ids.split(',')" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <select id="selectMapsAllBySerialNumber" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select * from buss_document_library-->
|
||||
<!-- where 1=1-->
|
||||
<!-- <if test="serialNumberList != null" >-->
|
||||
<!-- and serial_number in-->
|
||||
<!-- <foreach collection="serialNumberList.split(',')" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <select id="getListInfo" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select * from buss_document_library-->
|
||||
<!-- where ${condition}-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <select id="selectMapsByDeleteIds" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select * from buss_document_library-->
|
||||
<!-- where corresponding_standard like concat(concat('%',#{id}),'%')-->
|
||||
<!-- or replace_standard like concat(concat('%',#{id}),'%')-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <update id="updateByDeleteId">-->
|
||||
<!-- update buss_document_library set-->
|
||||
<!-- corresponding_standard =#{correspondingStandardStr},replace_standard=#{replaceStandardStr}-->
|
||||
<!-- where id=#{id}-->
|
||||
<!-- </update>-->
|
||||
|
||||
<!-- <select id="queryListByIds" resultType="java.util.LinkedHashMap">-->
|
||||
<!-- select * from buss_document_library-->
|
||||
<!-- where id in-->
|
||||
<!-- <foreach collection="ids.split(',')" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <select id="getBySerialNumber" resultType="com.jero.modules.document.entity.BussDocumentLibraryEO">-->
|
||||
<!-- select * from buss_document_library-->
|
||||
<!-- where serial_number =#{serialNumber}-->
|
||||
<!-- </select>-->
|
||||
</mapper>
|
||||
+237
@@ -0,0 +1,237 @@
|
||||
package com.jero.modules.document.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
//import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.entity.OSSFileForDocumentLibrary;
|
||||
import com.jero.modules.document.vo.QueryConditionVO;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 文档库信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-01-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Deprecated
|
||||
public interface IBussDocumentLibraryEOService extends IService<Object> {
|
||||
|
||||
// /**
|
||||
// * 通过id删除
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// void deleteById(String id);
|
||||
//
|
||||
// /**
|
||||
// * 批量删除
|
||||
// *
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// void deleteByIds(List<String> ids,String cut);
|
||||
//
|
||||
// /**
|
||||
// * 通过id查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// BussDocumentLibraryEO queryById(String id);
|
||||
//
|
||||
// /**
|
||||
// * 列表查询
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// List<BussDocumentLibraryEO> queryList();
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> queryCondition(String flag, String cut,String searchFlag);
|
||||
|
||||
// /**
|
||||
// * 查询条件(法规清单或虚拟清单高级搜索需要的数据)
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// List<Map<String, Object>> queryConditionInventory(String flag, String cut);
|
||||
|
||||
// /**
|
||||
// * 列表表头
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// List<Map<String, Object>> getHeader(String flag, String cut,String searchFlag);
|
||||
//
|
||||
// /**
|
||||
// * 新增表单
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// List<Map<String, Object>> getAddForm(String flag, String cut, String type);
|
||||
//
|
||||
// /**
|
||||
// * 编辑数据查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// List<Map<String, Object>> getDocumentInfoById(String id, String cut);
|
||||
|
||||
// /**
|
||||
// * 详情数据查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// List<Map<String, Object>> getInfoById(String id, String cut);
|
||||
//
|
||||
// List<Map<String, Object>> getMenuList(String id, String cut);
|
||||
// /**
|
||||
// * 新增数据
|
||||
// *
|
||||
// * @param map
|
||||
// */
|
||||
// void addInfo(Map<String, Object> map);
|
||||
//
|
||||
// /**
|
||||
// * 编辑数据
|
||||
// *
|
||||
// * @param map
|
||||
// */
|
||||
// void updateInfo(Map<String, Object> map);
|
||||
|
||||
// /**
|
||||
// * 分页
|
||||
// *
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// IPage getInfoPage(Map<String, Object> parameter);
|
||||
//
|
||||
// /**
|
||||
// * 代替标准分页
|
||||
// *
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// IPage replacePageInfo(Map<String, Object> parameter);
|
||||
|
||||
// /**
|
||||
// * ocr识别调取已入库文件分页
|
||||
// *
|
||||
// * @param parameter
|
||||
// * @return
|
||||
// */
|
||||
// IPage<Map<String, Object>> ocrPageInfo(Map<String,Object> parameter);
|
||||
|
||||
// /**
|
||||
// * 添加收藏
|
||||
// *
|
||||
// * @param id
|
||||
// */
|
||||
// void addCollect(String id);
|
||||
//
|
||||
// /**
|
||||
// * 取消收藏
|
||||
// *
|
||||
// * @param id
|
||||
// */
|
||||
// void cancelCollect(String id);
|
||||
//
|
||||
// /**
|
||||
// * 添加订阅
|
||||
// *
|
||||
// * @param id
|
||||
// */
|
||||
// void addSubscribe(String id);
|
||||
//
|
||||
// /**
|
||||
// * 取消订阅
|
||||
// *
|
||||
// * @param id
|
||||
// */
|
||||
// void cancelSubscribe(String id);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 导出excel
|
||||
// *
|
||||
// * @param map
|
||||
// * @param response
|
||||
// * @param request
|
||||
// */
|
||||
// void exportExcel(Map<String, Object> map,
|
||||
// HttpServletResponse response,
|
||||
// HttpServletRequest request);
|
||||
//
|
||||
// void exportZip(Map<String, Object> map,
|
||||
// HttpServletResponse response,
|
||||
// HttpServletRequest request);
|
||||
|
||||
// /**
|
||||
// * 模板下载
|
||||
// *
|
||||
// * @param response
|
||||
// * @param request
|
||||
// */
|
||||
// void exportTemplate(Map<String, Object> map, HttpServletResponse response, HttpServletRequest request);
|
||||
//
|
||||
// /**
|
||||
// * ocr识别调取已入库文件-中英文切换
|
||||
// *
|
||||
// * @param flag
|
||||
// * @param cut
|
||||
// * @return
|
||||
// */
|
||||
// List<Map<String, Object>> getHeaderOrConditionForOcr(String flag, String cut);
|
||||
|
||||
List<Map<String, Object>> getHeaderOrConditionForSplit(String flag, String cut);
|
||||
|
||||
// String pullMessage(String departIds, String ids, String documentIds);
|
||||
//
|
||||
// void importZip(MultipartFile file,String cut);
|
||||
//
|
||||
// String verifyBind(List<String> ids);
|
||||
//
|
||||
// List<Map<String,Object>> queryListByIds(String ids);
|
||||
|
||||
List<Map<String, Object>> getListBySerialNumber(String serialNumbers);
|
||||
|
||||
List<String> getListBySerialNumberFuzzy(String serialNumber);
|
||||
|
||||
// List<OSSFileForDocumentLibrary> getFileInfos(String id);
|
||||
//
|
||||
//
|
||||
// IPage<BussDocumentLibraryEO> queryPageInfoDummy(Page<BussDocumentLibraryEO> page, QueryWrapper<BussDocumentLibraryEO> queryWrapper,BussDocumentLibraryEO bussDocumentLibraryEO);
|
||||
//
|
||||
// IPage getPageDummy(Map<String, Object> parameter);
|
||||
//
|
||||
// void isModifyForOcrAndSplit(Map<String, Object> parameter);
|
||||
//
|
||||
// String getTitle(String id,String cut);
|
||||
//
|
||||
// String sqlJoint(List<QueryConditionVO> queryConditionVOList);
|
||||
//
|
||||
// int updateES();
|
||||
//
|
||||
// /**
|
||||
// * 根据serialNumber获取BussDumentLibrar对象
|
||||
// * @param serialNumber
|
||||
// * @return
|
||||
// */
|
||||
// BussDocumentLibraryEO getBySerialNumber(String serialNumber);
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
//package com.jero.modules.document.service;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.extension.service.IService;
|
||||
//import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * @Description: 文档库-分阶段实施详情表
|
||||
// * @Author: jero-boot
|
||||
// * @Date: 2023-02-22
|
||||
// * @Version: V1.0
|
||||
// */
|
||||
//public interface IPhasedImplementationDetailsEOService extends IService<PhasedImplementationDetailsEO> {
|
||||
//
|
||||
// /**
|
||||
// * 保存
|
||||
// *
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// * @return
|
||||
// */
|
||||
// void add(PhasedImplementationDetailsEO phasedImplementationDetailsEO);
|
||||
//
|
||||
// /**
|
||||
// * 更新
|
||||
// *
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// * @return
|
||||
// */
|
||||
// void editById(PhasedImplementationDetailsEO phasedImplementationDetailsEO);
|
||||
//
|
||||
// /**
|
||||
// * 通过id删除
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// void deleteById(String id);
|
||||
//
|
||||
// /**
|
||||
// * 批量删除
|
||||
// *
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// void deleteByIds(List<String> ids);
|
||||
//
|
||||
// /**
|
||||
// * 通过id查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// PhasedImplementationDetailsEO queryById(String id);
|
||||
//
|
||||
// /**
|
||||
// * 列表查询
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// List<PhasedImplementationDetailsEO> queryList();
|
||||
//
|
||||
// boolean insertBatch(List<PhasedImplementationDetailsEO> phasedImplDetailsEOList);
|
||||
//
|
||||
// void disposeData(List<PhasedImplementationDetailsEO> datas, String cut);
|
||||
//}
|
||||
+5915
File diff suppressed because it is too large
Load Diff
+148
@@ -0,0 +1,148 @@
|
||||
//package com.jero.modules.document.service.impl;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
//import com.jero.common.constant.enums.LanguageEnum;
|
||||
//import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
//import com.jero.modules.document.enums.ImplementationTypeEnum;
|
||||
//import com.jero.modules.document.mapper.PhasedImplementationDetailsEOMapper;
|
||||
//import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
|
||||
//import org.apache.commons.collections4.CollectionUtils;
|
||||
//import org.apache.commons.lang3.StringUtils;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
//import java.util.Arrays;
|
||||
//import java.util.Date;
|
||||
//import java.util.List;
|
||||
//import java.util.stream.Collectors;
|
||||
//
|
||||
///**
|
||||
// * @Description: 文档库-分阶段实施详情表
|
||||
// * @Author: jero-boot
|
||||
// * @Date: 2023-02-22
|
||||
// * @Version: V1.0
|
||||
// */
|
||||
//@Service
|
||||
//public class PhasedImplementationDetailsEOServiceImpl extends ServiceImpl<PhasedImplementationDetailsEOMapper, PhasedImplementationDetailsEO> implements IPhasedImplementationDetailsEOService {
|
||||
//
|
||||
// /**
|
||||
// * 保存
|
||||
// *
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public void add(PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
// Date now = new Date();
|
||||
// phasedImplementationDetailsEO.setCreateTime(now);
|
||||
// phasedImplementationDetailsEO.setUpdateTime(now);
|
||||
// save(phasedImplementationDetailsEO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 更新
|
||||
// *
|
||||
// * @param phasedImplementationDetailsEO
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public void editById(PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
// Date now = new Date();
|
||||
// phasedImplementationDetailsEO.setUpdateTime(now);
|
||||
// saveOrUpdate(phasedImplementationDetailsEO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过id删除
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public void deleteById(String id) {
|
||||
// removeById(id);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 批量删除
|
||||
// *
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public void deleteByIds(List<String> ids) {
|
||||
// removeByIds(ids);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过id查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public PhasedImplementationDetailsEO queryById(String id) {
|
||||
// return getById(id);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 列表查询
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public List<PhasedImplementationDetailsEO> queryList() {
|
||||
// return list();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean insertBatch(List<PhasedImplementationDetailsEO> phasedImplDetailsEOList) {
|
||||
// boolean flag = true;
|
||||
// if(CollectionUtils.isNotEmpty(phasedImplDetailsEOList)){
|
||||
// try {
|
||||
// this.saveBatch(phasedImplDetailsEOList);
|
||||
// }catch (Exception ex){
|
||||
// flag = false;
|
||||
// ex.printStackTrace();
|
||||
// log.error("批量添加分阶段实施详情信息失败:" + ex.getMessage());
|
||||
// }
|
||||
// }
|
||||
// return flag;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void disposeData(List<PhasedImplementationDetailsEO> datas, String cut) {
|
||||
// if(CollectionUtils.isNotEmpty(datas)){
|
||||
// for (PhasedImplementationDetailsEO data : datas) {
|
||||
// String implementationType = data.getImplementationType();
|
||||
// if(StringUtils.isNotEmpty(implementationType)){
|
||||
// String[] implementationTypeArr = implementationType.split(",");
|
||||
// ImplementationTypeEnum[] implementationTypeEnums = ImplementationTypeEnum.values();
|
||||
//
|
||||
// String implementationTypeText = "";
|
||||
// if(StringUtils.equals(cut, LanguageEnum.CN.getValue())){
|
||||
// implementationTypeText = Arrays.stream(implementationTypeEnums).filter(implementationTypeEnum -> {
|
||||
// boolean flag = false;
|
||||
// for (String type : implementationTypeArr) {
|
||||
// if (org.apache.commons.lang3.StringUtils.equals(type, implementationTypeEnum.getItemValue())) {
|
||||
// flag = true;
|
||||
// }
|
||||
// }
|
||||
// return flag;
|
||||
// }).map(ImplementationTypeEnum::getNameCn).collect(Collectors.joining(","));
|
||||
// }else {
|
||||
// implementationTypeText = Arrays.stream(implementationTypeEnums).filter(implementationTypeEnum -> {
|
||||
// boolean flag = false;
|
||||
// for (String type : implementationTypeArr) {
|
||||
// if (org.apache.commons.lang3.StringUtils.equals(type, implementationTypeEnum.getItemValue())) {
|
||||
// flag = true;
|
||||
// }
|
||||
// }
|
||||
// return flag;
|
||||
// }).map(ImplementationTypeEnum::getNameEn).collect(Collectors.joining(","));
|
||||
// }
|
||||
// data.setImplementationTypeText(implementationTypeText);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
//package com.jero.modules.document.service.impl;
|
||||
//
|
||||
//import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
//import com.jero.modules.document.enums.LawsStateEnum;
|
||||
//import org.apache.commons.lang3.ObjectUtils;
|
||||
//import org.apache.commons.lang3.StringUtils;
|
||||
//import org.quartz.Job;
|
||||
//import org.quartz.JobExecutionContext;
|
||||
//import org.quartz.JobExecutionException;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//
|
||||
//import java.text.SimpleDateFormat;
|
||||
//import java.util.Date;
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * @description TODO 更新法规实施状态,需要更新国标/海外标准,目前仅处理了文档库是不对的
|
||||
// * @date 2022/9/25 10:03
|
||||
// * @auth zhn
|
||||
// */
|
||||
//public class TimedTaskLaws implements Job {
|
||||
// @Autowired
|
||||
// private BussDocumentLibraryEOServiceImpl bussDocumentLibraryEOService;
|
||||
//
|
||||
// /**
|
||||
// * 法规状态为即将实施的法规,根据新车型实施日期和在产车实施日期, 到期后自动更新状态为现行
|
||||
// * @param jobExecutionContext
|
||||
// * @throws JobExecutionException
|
||||
// */
|
||||
// @Override
|
||||
// public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// String currentTime = sdf.format(new Date());
|
||||
// //获取所有的法规
|
||||
// List<BussDocumentLibraryEO> bussDocumentLibraryEOList = bussDocumentLibraryEOService.list();
|
||||
// if(bussDocumentLibraryEOList.size() != 0){
|
||||
// for (BussDocumentLibraryEO bussDocumentLibraryEO : bussDocumentLibraryEOList) {
|
||||
// String xin1Che1Xing2Shi2Shi1Ri4Qi1Str = "";
|
||||
// String implementTimestr = "";
|
||||
//
|
||||
// String state = bussDocumentLibraryEO.getState();//状态
|
||||
// //新车型实施日期
|
||||
// Date xin1Che1Xing2Shi2Shi1Ri4Qi1 = bussDocumentLibraryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1();
|
||||
// //在产车实施日期
|
||||
// Date implementTime = bussDocumentLibraryEO.getImplementTime();
|
||||
// if(ObjectUtils.isNotEmpty(xin1Che1Xing2Shi2Shi1Ri4Qi1)){
|
||||
// xin1Che1Xing2Shi2Shi1Ri4Qi1Str = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1);
|
||||
// }
|
||||
// if(ObjectUtils.isNotEmpty(implementTime)){
|
||||
// implementTimestr = sdf.format(implementTime);
|
||||
// }
|
||||
// //法规状态为即将实施的法规,根据新车型实施日期和在产车实施日期, 到期后自动更新状态为现行
|
||||
// if(StringUtils.isNotBlank(state) && LawsStateEnum.THE_UPCOMING.getValue().equals(state)
|
||||
// && (currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str) || currentTime.equals(implementTimestr))){
|
||||
// BussDocumentLibraryEO bussDocumentLibraryEOTemp = new BussDocumentLibraryEO();
|
||||
// bussDocumentLibraryEOTemp.setId(bussDocumentLibraryEO.getId());
|
||||
// bussDocumentLibraryEOTemp.setState(LawsStateEnum.ACTIVE.getValue());
|
||||
// bussDocumentLibraryEOService.updateById(bussDocumentLibraryEOTemp);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.jero.modules.document.utils;
|
||||
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.MinioUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.text.PDFTextStripper;
|
||||
import org.apache.pdfbox.text.PDFTextStripperByArea;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @date 2022/3/21 17:04
|
||||
* @auth zhn
|
||||
*/
|
||||
@Slf4j
|
||||
public class ReadPdfUtil {
|
||||
|
||||
public static String readPdf(String path) {
|
||||
if(MinioUtil.doesObjectExist(path)){
|
||||
try (InputStream in = MinioUtil.download(path)) {
|
||||
if(Objects.isNull(in) || in.available() == 0){
|
||||
return null;
|
||||
}
|
||||
try (PDDocument document = PDDocument.load(in)) {
|
||||
document.getClass();
|
||||
PDFTextStripperByArea stripper = new PDFTextStripperByArea();
|
||||
stripper.setSortByPosition(true);
|
||||
PDFTextStripper tStripper = new PDFTextStripper();
|
||||
|
||||
String pdfFileInText = tStripper.getText(document);
|
||||
return pdfFileInText;
|
||||
|
||||
}catch (Exception e) {
|
||||
log.error("文件内容读取失败",e);
|
||||
// throw new JeroBootException("文件内容读取失败");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
log.error("文件内容读取失败",e);
|
||||
// throw new JeroBootException("文件内容读取失败");
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package com.jero.modules.document.utils;
|
||||
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.MinioUtil;
|
||||
import org.apache.poi.hwpf.extractor.WordExtractor;
|
||||
import org.apache.poi.ooxml.POIXMLDocument;
|
||||
import org.apache.poi.ooxml.extractor.POIXMLTextExtractor;
|
||||
import org.apache.poi.openxml4j.opc.OPCPackage;
|
||||
import org.apache.poi.openxml4j.util.ZipSecureFile;
|
||||
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
|
||||
import static com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl.copyFile;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @date 2022/3/21 17:04
|
||||
* @auth zhn
|
||||
*/
|
||||
public class ReadWordUtil {
|
||||
public static String readWord(String path,String uploadpath) {
|
||||
// String path = "E:\\DeskTop\\1111.doc";
|
||||
// path = "E:\\DeskTop\\22222.docx";
|
||||
// String path = "E:\\DeskTop\\标准所ISO-用户手册.doc";
|
||||
String str = "--";
|
||||
try {
|
||||
if (path.endsWith(".doc")) {
|
||||
if(MinioUtil.doesObjectExist(path)){
|
||||
InputStream in = MinioUtil.download(path);
|
||||
WordExtractor ex = new WordExtractor(in);
|
||||
str = ex.getText();
|
||||
ex.close();
|
||||
in.close();
|
||||
}
|
||||
} else if (path.endsWith("docx")) {
|
||||
//先把文件存到本地, 用完后在删除
|
||||
if(MinioUtil.doesObjectExist(path)){
|
||||
InputStream in = MinioUtil.download(path);
|
||||
String fileNowPath = uploadpath + "/tempZip/" ;
|
||||
File file = new File(fileNowPath);
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
file.mkdirs();
|
||||
File fileOld = new File(path);
|
||||
long currentTime = System.currentTimeMillis();
|
||||
copyFile(in, fileNowPath + File.separator + currentTime + fileOld.getName());
|
||||
File fileTemp = new File(fileNowPath + File.separator + currentTime + fileOld.getName());
|
||||
ZipSecureFile.setMinInflateRatio(0.001);
|
||||
String pathTemp = fileTemp.getPath();
|
||||
OPCPackage opcPackage = POIXMLDocument.openPackage(pathTemp);
|
||||
POIXMLTextExtractor extractor = new XWPFWordExtractor(opcPackage);
|
||||
str = extractor.getText().trim();
|
||||
extractor.close();
|
||||
fileTemp.delete();
|
||||
in.close();
|
||||
}
|
||||
} else {
|
||||
throw new JeroBootException("此文件不是word文件");
|
||||
}
|
||||
return str;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException("文件内容读取失败");
|
||||
}catch (NoSuchFieldError e){
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException("文件内容读取失败");
|
||||
}
|
||||
}
|
||||
// public static String readWord(String path) {
|
||||
//// String path = "E:\\DeskTop\\1111.doc";
|
||||
//// path = "E:\\DeskTop\\22222.docx";
|
||||
//// String path = "E:\\DeskTop\\标准所ISO-用户手册.doc";
|
||||
// String str = "";
|
||||
// try {
|
||||
// if (path.endsWith(".doc")) {
|
||||
// InputStream is = new FileInputStream(new File(path));
|
||||
// WordExtractor ex = new WordExtractor(is);
|
||||
// str = ex.getText();
|
||||
// ex.close();
|
||||
// } else if (path.endsWith("docx")) {
|
||||
// OPCPackage opcPackage = POIXMLDocument.openPackage(path);
|
||||
// POIXMLTextExtractor extractor = new XWPFWordExtractor(opcPackage);
|
||||
// str = extractor.getText();
|
||||
// extractor.close();
|
||||
// } else {
|
||||
// throw new JeroBootException("此文件不是word文件");
|
||||
// }
|
||||
// return str;
|
||||
// } catch (Exception e) {
|
||||
// throw new JeroBootException("文件内容读取失败");
|
||||
// }catch (NoSuchFieldError e){
|
||||
// throw new JeroBootException("文件内容读取失败");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.jero.modules.document.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @date 2022/5/20 14:37
|
||||
* @auth zhn
|
||||
*/
|
||||
@Data
|
||||
public class QueryConditionVO {
|
||||
//类型(and或or)
|
||||
private String type;
|
||||
//查询类型
|
||||
private String rule;
|
||||
//字段
|
||||
private String field;
|
||||
//字段值
|
||||
private String val;
|
||||
|
||||
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.jero.modules.log.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 更新log表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("buss_log")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="buss_log对象", description="更新log表")
|
||||
public class BussLogEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**文档id*/
|
||||
@Excel(name = "文档id", width = 15)
|
||||
@ApiModelProperty(value = "文档id")
|
||||
private String documentId;
|
||||
|
||||
/**日志内容*/
|
||||
@Excel(name = "日志内容", width = 15)
|
||||
@ApiModelProperty(value = "日志内容")
|
||||
private String content;
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.log.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.log.entity.BussLogEO;
|
||||
|
||||
/**
|
||||
* @Description: 更新log表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface BussLogEOMapper extends BaseMapper<BussLogEO> {
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?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.jero.modules.log.mapper.BussLogEOMapper">
|
||||
<resultMap id="BussLogEOResultMap" type="com.jero.modules.log.entity.BussLogEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="document_id" property="documentId" />
|
||||
<result column="content" property="content" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.jero.modules.log.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.log.entity.BussLogEO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 更新log表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IBussLogEOService extends IService<BussLogEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param bussLogEO
|
||||
* @return
|
||||
*/
|
||||
void add(BussLogEO bussLogEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param bussLogEO
|
||||
* @return
|
||||
*/
|
||||
void editById(BussLogEO bussLogEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
BussLogEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<BussLogEO> queryList();
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package com.jero.modules.log.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.log.entity.BussLogEO;
|
||||
import com.jero.modules.log.mapper.BussLogEOMapper;
|
||||
import com.jero.modules.log.service.IBussLogEOService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 更新log表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class BussLogEOServiceImpl extends ServiceImpl<BussLogEOMapper, BussLogEO> implements IBussLogEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param bussLogEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(BussLogEO bussLogEO) {
|
||||
Date now = new Date();
|
||||
bussLogEO.setCreateTime(now);
|
||||
bussLogEO.setUpdateTime(now);
|
||||
save(bussLogEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param bussLogEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(BussLogEO bussLogEO) {
|
||||
Date now = new Date();
|
||||
bussLogEO.setUpdateTime(now);
|
||||
saveOrUpdate(bussLogEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public BussLogEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BussLogEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
+440
@@ -0,0 +1,440 @@
|
||||
package com.jero.modules.onlyoffice.controller;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.CommonUtils;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.onlyoffice.entity.BusProcessModelHis;
|
||||
import com.jero.modules.onlyoffice.entity.OnlineFileLog;
|
||||
import com.jero.modules.onlyoffice.mapper.BusProcessModelHisMapper;
|
||||
import com.jero.modules.onlyoffice.mapper.OnlineFileLogDao;
|
||||
import com.jero.modules.onlyoffice.service.IBusProcessModelHisService;
|
||||
import com.jero.modules.onlyoffice.service.LawsUserInfoService;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* onlyoffice前端控制器
|
||||
* </p>
|
||||
*/
|
||||
@Api(tags = "onlyOffice操作")
|
||||
@RestController
|
||||
@RequestMapping("/onlyOffice")
|
||||
public class OnlyOfficeController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(OnlyOfficeController.class);
|
||||
|
||||
@Value("${file.path}")
|
||||
private String standEditFilePath;//文件存储路径
|
||||
|
||||
@Resource
|
||||
private IBusProcessModelHisService busProcessModelHisService;
|
||||
|
||||
@Resource
|
||||
private LawsUserInfoService lawsUserInfoService;
|
||||
|
||||
@Resource
|
||||
private BusProcessModelHisMapper busProcessModelHisMapper;
|
||||
@Resource
|
||||
private IOSSFileService ossFileService;
|
||||
|
||||
@Resource
|
||||
private OnlineFileLogDao onlineFileLogDao;
|
||||
|
||||
/**
|
||||
* 文件后缀黑名单
|
||||
*/
|
||||
@Value(value = "${jero.fileSuffixLimits}")
|
||||
private String[] fileSuffixLimits;
|
||||
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("/pageList")
|
||||
public Result<IPage<BusProcessModelHis>> pageList(HttpServletRequest req, BusProcessModelHis processModelHis,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
QueryWrapper<BusProcessModelHis> queryWrapper = QueryGenerator.initQueryWrapper(processModelHis, req.getParameterMap());
|
||||
Page<BusProcessModelHis> page = new Page<>(pageNo, pageSize);
|
||||
IPage<BusProcessModelHis> pageList = busProcessModelHisService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Result<String> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
boolean ok = busProcessModelHisService.removeById(id);
|
||||
if (ok) {
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除")
|
||||
@PostMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return Result.error("参数不识别!");
|
||||
} else {
|
||||
this.busProcessModelHisService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据Id获取文件信息
|
||||
* id是saveEditFile接口返回的id 也是bus_process_model_his表的id
|
||||
*/
|
||||
@ApiOperation(value = "根据Id获取文件信息")
|
||||
@GetMapping("/queryById")
|
||||
public Result<Map<String, String>> queryById(String id) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
BusProcessModelHis his = busProcessModelHisService.getById(id);
|
||||
map.put("fileName", his.getFileName());
|
||||
map.put("editFilePath", his.getEditFilePath());
|
||||
map.put("id", his.getId());
|
||||
return Result.OK(map);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|onlyOffice接收文件")
|
||||
@PostMapping("/receiveFile")
|
||||
public void receiveFile(HttpServletRequest request, HttpServletResponse response, String fileNm, String standNo, String fileId, String standName, String key) {
|
||||
logger.info("**********进入receiveFile接收文档接口************");
|
||||
logger.info("**********fileNm************" + fileNm + "=======");
|
||||
logger.info("**********standNo************" + standNo + "=======");
|
||||
logger.info("**********fileId************" + fileId + "=======");
|
||||
logger.info("**********standName************" + standName + "=======");
|
||||
logger.info("**********key************" + key + "=======");
|
||||
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 || status == 6)//MustSave, Corrupted
|
||||
{
|
||||
String downloadUri = (String) jsonObj.get("url");
|
||||
|
||||
try {
|
||||
logger.info("**********onlyoffice接收文档接口获得downloadUri************" + downloadUri);
|
||||
if (StringUtils.isNotEmpty(downloadUri)) {
|
||||
downloadUri = downloadUri.replace("laws.sinotruk.com", "onlyoffice-sa2of.yf-grp:8080");
|
||||
downloadUri = downloadUri.replace("onlyoffice.sinotruk.com", "onlyoffice-sa2of.yf-grp:8080");
|
||||
BusProcessModelHis modelHis = busProcessModelHisService.getById(fileId);
|
||||
String editFilePath = modelHis.getEditFilePath();
|
||||
String saveFileUrl = standEditFilePath + editFilePath;
|
||||
logger.info("**********onlyoffice文档下载路径************" + downloadUri);
|
||||
logger.info("**********onlyoffice文档保存本地路径************" + saveFileUrl);
|
||||
HttpUtil.downloadFileFromUrl(downloadUri, saveFileUrl);
|
||||
File file = new File(saveFileUrl);
|
||||
downloadNetFile(downloadUri, file);
|
||||
// 更新在线编辑当前节点编辑状态
|
||||
busProcessModelHisService.modelHisOneUpdStatusById(fileId);
|
||||
Object keyObj = jsonObj.get("key");
|
||||
if (keyObj != null) {
|
||||
key = keyObj.toString();
|
||||
logger.info("**********key************" + key + "=======");
|
||||
}
|
||||
lawsUserInfoService.selectOnlineFile(fileId, standName, key);
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|onlyOffice接收文件")
|
||||
@PostMapping("/receiveFileBefore")
|
||||
public void receiveFileBefore(HttpServletRequest request, HttpServletResponse response, String key, String fileNm, String standNo, String pid, String taskId, String standName) {
|
||||
logger.info("**********进入receiveFileBefore接收文档接口************");
|
||||
logger.info("**********fileNm************" + fileNm + "=======");
|
||||
logger.info("**********standNo************" + standNo + "=======");
|
||||
logger.info("**********pid************" + pid + "=======");
|
||||
logger.info("**********taskId************" + taskId + "=======");
|
||||
logger.info("**********standName************" + standName + "=======");
|
||||
logger.info("**********key************" + key + "=======");
|
||||
|
||||
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 || status == 6)//MustSave, Corrupted
|
||||
{
|
||||
String downloadUri = (String) jsonObj.get("url");
|
||||
|
||||
try {
|
||||
logger.info("**********onlyoffice接收文档接口获得downloadUri************" + downloadUri);
|
||||
if (StringUtils.isNotEmpty(downloadUri)) {
|
||||
String saveFileUrl = standEditFilePath +
|
||||
standNo + "/" +
|
||||
fileNm;
|
||||
File file = new File(saveFileUrl);
|
||||
downloadNetFile(downloadUri, file);
|
||||
// 更新在线编辑当前节点编辑状态
|
||||
busProcessModelHisService.modelHisOneUpdStatus(pid, taskId);
|
||||
QueryWrapper<BusProcessModelHis> objectQueryWrapper = new QueryWrapper<>();
|
||||
objectQueryWrapper.eq("P_ID", pid);
|
||||
objectQueryWrapper.eq("TASK_ID", taskId);
|
||||
BusProcessModelHis busProcessModelHis = busProcessModelHisMapper.selectOne(objectQueryWrapper);
|
||||
if (busProcessModelHis != null) {
|
||||
Object keyObj = jsonObj.get("key");
|
||||
if (keyObj != null) {
|
||||
key = keyObj.toString();
|
||||
logger.info("**********key************" + key + "=======");
|
||||
}
|
||||
lawsUserInfoService.selectOnlineFile(busProcessModelHis.getId(), standName, key);
|
||||
}
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/processEditFile")
|
||||
public BusProcessModelHis processEditFile(String id) {
|
||||
return busProcessModelHisService.processEditFile(id);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|model| 传入 模板文档名称(不带后缀)默认 docx")
|
||||
@GetMapping("/saveEditFile")
|
||||
public Result<BusProcessModelHis> saveEditFile(String model) {
|
||||
return Result.OK(busProcessModelHisService.saveEditFile(model));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "传入ossFileId获取在线编辑文件相关信息")
|
||||
@GetMapping("/saveEditFileWithOss")
|
||||
public Result<BusProcessModelHis> saveEditFileWithOss(String ossFileId) {
|
||||
return Result.OK(busProcessModelHisService.saveEditFileWithOss(ossFileId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据路径下载文件")
|
||||
@GetMapping("/downLoadFile")
|
||||
public void downLoadFile(@RequestParam(name = "path") String path, HttpServletResponse response) {
|
||||
busProcessModelHisService.downLoadFile(path, response);
|
||||
}
|
||||
|
||||
@GetMapping("/processModelHisOneUpdStatus")
|
||||
public BusProcessModelHis modelHisOneUpdStatus(String pid, String taskId) {
|
||||
return busProcessModelHisService.modelHisOneUpdStatus(pid, taskId);
|
||||
}
|
||||
|
||||
@GetMapping("/processModelHisOneCount")
|
||||
public BusProcessModelHis modelHisOneCount(String pid) {
|
||||
return busProcessModelHisService.modelHisOneCount(pid);
|
||||
}
|
||||
|
||||
@GetMapping("/processModelHisOne")
|
||||
public BusProcessModelHis modelHisOne(String pid, String taskId) {
|
||||
return busProcessModelHisService.modelHisOne(pid, taskId);
|
||||
}
|
||||
|
||||
@GetMapping("/processModelHisList")
|
||||
public List<BusProcessModelHis> evaluationHisList(String pid) {
|
||||
return busProcessModelHisService.modelHisList(pid);
|
||||
}
|
||||
|
||||
@PostMapping("/selectOnlineFile")
|
||||
public OnlineFileLog selectOnlineFile(@RequestParam("onlineFileId") String onlineFileId) {
|
||||
return busProcessModelHisService.selectOnlineFile(onlineFileId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据在线文件Id查询所有onlyoffice历史文件")
|
||||
@GetMapping("/getAllOnlyOfficeHisFileById")
|
||||
public Result<List<Map<String, String>>> getAllOnlyOfficeHisFileById(String fileId, String fileName) {
|
||||
List<Map<String, String>> fileList = new ArrayList<>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
LambdaQueryWrapper<OnlineFileLog> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(OnlineFileLog::getHisId, fileId);
|
||||
wrapper.eq(OnlineFileLog::getValidFlag, "0");
|
||||
wrapper.orderByDesc(OnlineFileLog::getCreateTime);
|
||||
List<OnlineFileLog> onlineFileLogList = onlineFileLogDao.selectList(wrapper);
|
||||
if (!onlineFileLogList.isEmpty()) {
|
||||
for (OnlineFileLog onlineFileLog : onlineFileLogList) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("id", onlineFileLog.getId());
|
||||
map.put("filePath", onlineFileLog.getFilePath());
|
||||
map.put("fileName", fileName);
|
||||
map.put("attFileId", onlineFileLog.getAttFileId());
|
||||
map.put("createTime", sdf.format(onlineFileLog.getCreateTime()));
|
||||
map.put("fileKey", onlineFileLog.getFileKey());
|
||||
fileList.add(map);
|
||||
}
|
||||
return Result.OK(fileList);
|
||||
}
|
||||
return Result.error("历史文件为空");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 文件上传统一方法
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/upload")
|
||||
@CrossOrigin(origins = "*", maxAge = 3600)
|
||||
public Result<OSSFile> upload(HttpServletRequest request, HttpServletResponse response) {
|
||||
Result<OSSFile> result = new Result<>();
|
||||
String savePath = "";
|
||||
String bizPath = request.getParameter("biz");
|
||||
|
||||
//sys/common/upload接口存在任意文件上传漏洞
|
||||
if (oConvertUtils.isNotEmpty(bizPath) && (bizPath.contains("../") || bizPath.contains("..\\"))) {
|
||||
throw new JeroBootException("上传目录bizPath,格式非法!");
|
||||
}
|
||||
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = multipartRequest.getFile("file");
|
||||
if (file == null) {
|
||||
return result;
|
||||
}
|
||||
// 文件类型是否处于黑名单
|
||||
if (CommonUtils.limitFileSuffix(file.getOriginalFilename(), fileSuffixLimits)) {
|
||||
result.setMessage("该文件类型不允许上传");
|
||||
result.setSuccess(false);
|
||||
result.setCode(0);
|
||||
return result;
|
||||
}
|
||||
if (oConvertUtils.isEmpty(bizPath)) {
|
||||
bizPath = "";
|
||||
}
|
||||
// 本地上传
|
||||
savePath = CommonUtils.uploadLocal(file, bizPath, standEditFilePath);
|
||||
if (oConvertUtils.isNotEmpty(savePath)) {
|
||||
//上传成功 进行数据库存储
|
||||
OSSFile ossFile = new OSSFile();
|
||||
// 文件名
|
||||
String fileName = file.getOriginalFilename();
|
||||
fileName = CommonUtils.getFileName(fileName);
|
||||
ossFile.setFileName(fileName);
|
||||
ossFile.setUrl(savePath);
|
||||
ossFileService.save(ossFile);
|
||||
result.setMessage(savePath);
|
||||
result.setResult(ossFile);
|
||||
result.setSuccess(true);
|
||||
} else {
|
||||
result.setMessage("上传失败!");
|
||||
result.setSuccess(false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+280
@@ -0,0 +1,280 @@
|
||||
package com.jero.modules.onlyoffice.entity;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>ATT_FILE AttFileEOEntity<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2018-09-07 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
// TODO 等在线编辑正式上线时,把该部分去掉,此部分在正式功能中无用
|
||||
public class AttFileEO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1284335706608668758L;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AttFileEO.class);
|
||||
|
||||
private String id;
|
||||
private String fileName;
|
||||
private String oldFileName;
|
||||
private String fileSuffix;
|
||||
private String filePath;
|
||||
private Integer validFlag;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date creationTime;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
private String tableName;
|
||||
|
||||
private String resId;
|
||||
|
||||
/**
|
||||
* 文件下载地址
|
||||
*/
|
||||
private String downLoadUrl;
|
||||
|
||||
|
||||
/**
|
||||
* java字段名转换为原始数据库列名。<b>如果不存在则返回null</b><br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>id -> id</li>
|
||||
* <li>fileName -> file_name</li>
|
||||
* <li>oldFileName -> old_file_name</li>
|
||||
* <li>fileSuffix -> file_suffix</li>
|
||||
* <li>filePath -> file_path</li>
|
||||
* <li>validFlag -> valid_flag</li>
|
||||
* <li>creationTime -> creation_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 "fileName":
|
||||
return "file_name";
|
||||
case "oldFileName":
|
||||
return "old_file_name";
|
||||
case "fileSuffix":
|
||||
return "file_suffix";
|
||||
case "filePath":
|
||||
return "file_path";
|
||||
case "validFlag":
|
||||
return "valid_flag";
|
||||
case "creationTime":
|
||||
return "creation_time";
|
||||
case "modifyTime":
|
||||
return "modify_time";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 原始数据库列名转换为java字段名。<b>如果不存在则返回null</b><br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>id -> id</li>
|
||||
* <li>file_name -> fileName</li>
|
||||
* <li>old_file_name -> oldFileName</li>
|
||||
* <li>file_suffix -> fileSuffix</li>
|
||||
* <li>file_path -> filePath</li>
|
||||
* <li>valid_flag -> validFlag</li>
|
||||
* <li>creation_time -> creationTime</li>
|
||||
* <li>modify_time -> modifyTime</li>
|
||||
*/
|
||||
public static String columnToField(String columnName) {
|
||||
if (columnName == null) {
|
||||
return null;
|
||||
}
|
||||
switch (columnName) {
|
||||
case "id":
|
||||
return "id";
|
||||
case "file_name":
|
||||
return "fileName";
|
||||
case "old_file_name":
|
||||
return "oldFileName";
|
||||
case "file_suffix":
|
||||
return "fileSuffix";
|
||||
case "file_path":
|
||||
return "filePath";
|
||||
case "valid_flag":
|
||||
return "validFlag";
|
||||
case "creation_time":
|
||||
return "creationTime";
|
||||
case "modify_time":
|
||||
return "modifyTime";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public String getId() {
|
||||
int tableNameIndex = this.id.lastIndexOf("_");
|
||||
if (tableNameIndex != -1) {
|
||||
String tableName = this.id.substring(0, tableNameIndex);
|
||||
this.tableName = tableName;
|
||||
} else {
|
||||
logger.error("文件ID格式错误:" + this.id);
|
||||
}
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setId(String id) {
|
||||
if (tableName != null && !tableName.isEmpty()) {
|
||||
this.id = tableName + "_" + id;
|
||||
}
|
||||
//此处注意保存时表结构是否存在
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public String getFileName() {
|
||||
return this.fileName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public String getOldFileName() {
|
||||
return this.oldFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setOldFileName(String oldFileName) {
|
||||
this.oldFileName = oldFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public String getFileSuffix() {
|
||||
return this.fileSuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setFileSuffix(String fileSuffix) {
|
||||
this.fileSuffix = fileSuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public String getFilePath() {
|
||||
return this.filePath;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public Integer getValidFlag() {
|
||||
return this.validFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setValidFlag(Integer validFlag) {
|
||||
this.validFlag = validFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public Date getCreationTime() {
|
||||
return this.creationTime;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setCreationTime(Date creationTime) {
|
||||
this.creationTime = creationTime;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public Date getModifyTime() {
|
||||
return this.modifyTime;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
if (this.tableName != null && !this.tableName.isEmpty()) {
|
||||
return this.tableName;
|
||||
} else {
|
||||
int tableNameIndex = this.id.lastIndexOf("_");
|
||||
if (tableNameIndex != -1) {
|
||||
String tableName = this.id.substring(0, tableNameIndex);
|
||||
this.tableName = tableName;
|
||||
} else {
|
||||
logger.error("文件ID格式错误:" + this.id);
|
||||
}
|
||||
return this.tableName;
|
||||
}
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public static long getSerialVersionUID() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
public String getResId() {
|
||||
return resId;
|
||||
}
|
||||
|
||||
public void setResId(String resId) {
|
||||
this.resId = resId;
|
||||
}
|
||||
|
||||
public String getDownLoadUrl() {
|
||||
return downLoadUrl;
|
||||
}
|
||||
|
||||
public void setDownLoadUrl(String downLoadUrl) {
|
||||
this.downLoadUrl = downLoadUrl;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.jero.modules.onlyoffice.entity;
|
||||
|
||||
// TODO 等在线编辑正式上线时,把该部分去掉,此部分在正式功能中无用
|
||||
public class AttFileVo {
|
||||
|
||||
private String id;
|
||||
private String fileName;
|
||||
private String oldFileName;
|
||||
private String fileSuffix;
|
||||
private String filePath;
|
||||
private String attId;
|
||||
|
||||
private String name;
|
||||
//识别文件名中的标准号和名称
|
||||
private String standNum;
|
||||
private String standName;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getOldFileName() {
|
||||
return oldFileName;
|
||||
}
|
||||
|
||||
public void setOldFileName(String oldFileName) {
|
||||
this.oldFileName = oldFileName;
|
||||
}
|
||||
|
||||
public String getFileSuffix() {
|
||||
return fileSuffix;
|
||||
}
|
||||
|
||||
public void setFileSuffix(String fileSuffix) {
|
||||
this.fileSuffix = fileSuffix;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
this.name = this.oldFileName;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getAttId() {
|
||||
this.attId=this.id;
|
||||
return this.attId;
|
||||
}
|
||||
|
||||
public void setAttId(String attId) {
|
||||
this.attId = attId;
|
||||
}
|
||||
|
||||
public String getStandNum() {
|
||||
return standNum;
|
||||
}
|
||||
|
||||
public void setStandNum(String standNum) {
|
||||
this.standNum = standNum;
|
||||
}
|
||||
|
||||
public String getStandName() {
|
||||
return standName;
|
||||
}
|
||||
|
||||
public void setStandName(String standName) {
|
||||
this.standName = standName;
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.jero.modules.onlyoffice.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程模块历史表 TODO 等在线编辑正式上线时,把该部分去掉,此部分在正式功能中无用
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-09-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="BusProcessModelHis对象", description="流程模块历史表")
|
||||
public class BusProcessModelHis implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准id")
|
||||
private String standId;
|
||||
|
||||
@ApiModelProperty(value = "处理人")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "信息")
|
||||
private String mesg;
|
||||
|
||||
@ApiModelProperty(value = "节点信息")
|
||||
private String taskInfo;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "流程实例id")
|
||||
private String pId;
|
||||
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
@TableField("prc_name")
|
||||
private String fileName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 是否编辑 0 未编辑 1 已编辑")
|
||||
private String editStatus;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 编辑文件存储路径")
|
||||
private String editFilePath;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 编辑类型 node 节点编辑 count 汇总编辑")
|
||||
private String editType;
|
||||
|
||||
@ApiModelProperty(value = "逻辑状态")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 访问编辑文件全路径")
|
||||
@TableField(exist = false)
|
||||
private String downLoadUrl;
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.jero.modules.onlyoffice.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("online_file_log")
|
||||
@ApiModel(value = "OnlineFileLog对象", description = "在线编辑日志表")
|
||||
public class OnlineFileLog {
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
private String hisId;
|
||||
|
||||
private String attFileId;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String oldFileName;
|
||||
|
||||
private String fileSuffix;
|
||||
|
||||
private String filePath;
|
||||
|
||||
private Integer count;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private byte[] bytes;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
private String validFlag;
|
||||
|
||||
@ApiModelProperty(value = "文件key")
|
||||
private String fileKey;
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.jero.modules.onlyoffice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.onlyoffice.entity.AttFileEO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
*
|
||||
* <br>
|
||||
* <b>功能:</b>ATT_FILE AttFileEODao<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2018-09-07 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
public interface AttFileEODao extends BaseMapper<AttFileEO> {
|
||||
|
||||
public void creatTableInfo(@Param("tableName") String tableName);
|
||||
|
||||
public int existTable(@Param("tableName") String tableName);
|
||||
|
||||
public AttFileEO selectFileInfoById(AttFileEO attFileEO);
|
||||
|
||||
public int updateFileInfoById(AttFileEO attFileEO);
|
||||
|
||||
public int insertData(AttFileEO attFileEO);
|
||||
|
||||
void deleteByIdInfo(String str, String id);
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.jero.modules.onlyoffice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.onlyoffice.entity.BusProcessModelHis;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程模块历史表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-09-17
|
||||
*/
|
||||
public interface BusProcessModelHisMapper extends BaseMapper<BusProcessModelHis> {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.jero.modules.onlyoffice.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.onlyoffice.entity.OnlineFileLog;
|
||||
|
||||
public interface OnlineFileLogDao extends BaseMapper<OnlineFileLog> {
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
<?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.jero.modules.onlyoffice.mapper.AttFileEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.jero.modules.onlyoffice.entity.AttFileEO" >
|
||||
<id column="id" property="id" />
|
||||
<result column="file_name" property="fileName" />
|
||||
<result column="old_file_name" property="oldFileName" />
|
||||
<result column="file_suffix" property="fileSuffix" />
|
||||
<result column="file_path" property="filePath" />
|
||||
<result column="valid_flag" property="validFlag" />
|
||||
<result column="creation_time" property="creationTime" />
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- ATT_FILE table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
id, file_name, old_file_name, file_suffix, file_path, valid_flag, creation_time, modify_time
|
||||
</sql>
|
||||
|
||||
<update id="creatTableInfo" parameterType="java.lang.String">
|
||||
create table ${tableName}
|
||||
(
|
||||
id varchar(100) not null primary key,
|
||||
file_name varchar(255) null,
|
||||
old_file_name varchar(255) null,
|
||||
file_suffix varchar(30) null,
|
||||
file_path varchar(255) null,
|
||||
valid_flag int(1) null,
|
||||
creation_time date null,
|
||||
modify_time date null
|
||||
)
|
||||
</update>
|
||||
|
||||
<select id="existTable" parameterType="java.lang.String" resultType="java.lang.Integer">
|
||||
select count(*) from information_schema.TABLES where table_name = #{tableName}
|
||||
</select>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="fileName != null" >
|
||||
and file_name ${fileNameOperator} #{fileName}
|
||||
</if>
|
||||
<if test="oldFileName != null" >
|
||||
and old_file_name ${oldFileNameOperator} #{oldFileName}
|
||||
</if>
|
||||
<if test="fileSuffix != null" >
|
||||
and file_suffix ${fileSuffixOperator} #{fileSuffix}
|
||||
</if>
|
||||
<if test="filePath != null" >
|
||||
and file_path ${filePathOperator} #{filePath}
|
||||
</if>
|
||||
<if test="validFlag != null" >
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="creationTime != null" >
|
||||
and creation_time ${creationTimeOperator} #{creationTime}
|
||||
</if>
|
||||
<if test="creationTime1 != null" >
|
||||
and creation_time >= #{creationTime1}
|
||||
</if>
|
||||
<if test="creationTime2 != null" >
|
||||
and creation_time <= #{creationTime2}
|
||||
</if>
|
||||
<if test="modifyTime != null" >
|
||||
and modify_time ${modifyTimeOperator} #{modifyTime}
|
||||
</if>
|
||||
<if test="modifyTime1 != null" >
|
||||
and modify_time >= #{modifyTime1}
|
||||
</if>
|
||||
<if test="modifyTime2 != null" >
|
||||
and modify_time <= #{modifyTime2}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insertData" parameterType="com.jero.modules.onlyoffice.entity.AttFileEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_ATT_FILE.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into ${tableName}(<include refid="Base_Column_List" />)
|
||||
values (#{id, jdbcType=VARCHAR}, #{fileName, jdbcType=VARCHAR}, #{oldFileName, jdbcType=VARCHAR}, #{fileSuffix, jdbcType=VARCHAR}, #{filePath, jdbcType=VARCHAR}, #{validFlag, jdbcType=INTEGER}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
|
||||
<select id="selectFileInfoById" resultMap="BaseResultMap" parameterType="com.jero.modules.onlyoffice.entity.AttFileEO">
|
||||
select <include refid="Base_Column_List" />
|
||||
from ${tableName}
|
||||
where id = #{id}
|
||||
|
||||
</select>
|
||||
<update id="updateFileInfoById">
|
||||
update ${tableName} set OLD_FILE_NAME = #{oldFileName} where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByIdInfo" parameterType="java.lang.String">
|
||||
delete from ${str} where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?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.jero.modules.onlyoffice.mapper.BusProcessModelHisMapper">
|
||||
|
||||
</mapper>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.jero.modules.onlyoffice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.onlyoffice.entity.AttFileEO;
|
||||
import com.jero.modules.onlyoffice.entity.AttFileVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public interface IAttFileEOService extends IService<AttFileEO> {
|
||||
|
||||
public AttFileVo saveFileInfo(File file);
|
||||
|
||||
public AttFileEO getFileInfo(String attId);
|
||||
|
||||
public AttFileEO updateFileInfo(String attId,String name);
|
||||
|
||||
void deleteById(String id);
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.jero.modules.onlyoffice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.onlyoffice.entity.BusProcessModelHis;
|
||||
import com.jero.modules.onlyoffice.entity.OnlineFileLog;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程模块历史表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-09-17
|
||||
*/
|
||||
public interface IBusProcessModelHisService extends IService<BusProcessModelHis> {
|
||||
|
||||
BusProcessModelHis modelHisOneUpdStatusById(String id);
|
||||
|
||||
BusProcessModelHis modelHisOneUpdStatus(String pid,String taskId);
|
||||
|
||||
BusProcessModelHis modelHisOneCount(String pid);
|
||||
|
||||
BusProcessModelHis processEditFile(String id);
|
||||
|
||||
BusProcessModelHis modelHisOne(String pid,String taskId);
|
||||
|
||||
BusProcessModelHis saveEditFile(String model);
|
||||
|
||||
BusProcessModelHis saveEditFileWithOss(String ossFileId);
|
||||
|
||||
void replaceFile(String hisId, String replaceId);
|
||||
|
||||
List<BusProcessModelHis> modelHisList(String pid);
|
||||
|
||||
OnlineFileLog selectOnlineFile(String onlineFileId);
|
||||
|
||||
void downLoadFile(String path, HttpServletResponse response);
|
||||
|
||||
String saveProcessFileToOss(String hisId);
|
||||
|
||||
}
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
package com.jero.modules.onlyoffice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.util.MinioUtil;
|
||||
import com.jero.common.util.UUIDUtils;
|
||||
import com.jero.modules.onlyoffice.entity.AttFileEO;
|
||||
import com.jero.modules.onlyoffice.entity.AttFileVo;
|
||||
import com.jero.modules.onlyoffice.entity.OnlineFileLog;
|
||||
import com.jero.modules.onlyoffice.mapper.AttFileEODao;
|
||||
import com.jero.modules.onlyoffice.mapper.OnlineFileLogDao;
|
||||
import com.jero.modules.onlyoffice.service.impl.AttFileEOServiceImpl;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2023-09-14 11:13
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LawsUserInfoService {
|
||||
|
||||
@Value("${file.path}")
|
||||
private String standEditFilePath;
|
||||
|
||||
@Resource
|
||||
private IBusProcessModelHisService busProcessModelHisService;
|
||||
|
||||
@Resource
|
||||
private OnlineFileLogDao onlineFileLogDao;
|
||||
|
||||
@Resource
|
||||
private IOSSFileService ossFileService;
|
||||
|
||||
/**
|
||||
* 查找在线编辑文件
|
||||
*
|
||||
* @param onlineFileId
|
||||
* @param standName
|
||||
* @param key
|
||||
*/
|
||||
public void selectOnlineFile(String onlineFileId, String standName, String key) {
|
||||
log.info("======================standName===============================!!!!!!!!!!!!!!!!!!!!!!" + standName);
|
||||
String path = standEditFilePath + "hisFile/";
|
||||
File file = null;
|
||||
FileOutputStream fileOutputStream = null;
|
||||
BufferedOutputStream bufferedOutputStream = null;
|
||||
//下载位置
|
||||
OnlineFileLog onlineFileLog = busProcessModelHisService.selectOnlineFile(onlineFileId);
|
||||
long time = System.currentTimeMillis();
|
||||
if (onlineFileLog == null) {
|
||||
return;
|
||||
}
|
||||
String fileName = UUIDUtils.randomUUID(20);
|
||||
try {
|
||||
file = new File(path + onlineFileLog.getOldFileName());
|
||||
boolean directory = file.isDirectory();
|
||||
log.info("**********path+onlineFileLog.getOldFileName()本地路径************" + path + onlineFileLog.getOldFileName());
|
||||
//目录是否存在
|
||||
if (!directory) {
|
||||
file.mkdirs();
|
||||
}
|
||||
file = new File(path + "/" + onlineFileLog.getOldFileName(), fileName + "." + onlineFileLog.getFileSuffix());
|
||||
log.info("**********parent路径************" + path + "/" + onlineFileLog.getOldFileName());
|
||||
log.info("**********child路径************" + onlineFileLog.getOldFileName() + "." + onlineFileLog.getFileSuffix());
|
||||
fileOutputStream = new FileOutputStream(file);
|
||||
bufferedOutputStream = new BufferedOutputStream(fileOutputStream);
|
||||
fileOutputStream.write(onlineFileLog.getBytes());
|
||||
fileOutputStream.close();
|
||||
//把文件下载到本地 然后获得文件的名称 通过文件名称 调用 filesave接口 获取id 进行日志存入
|
||||
log.info("======================文件存储到本地成功,作为存储与Att表的桥梁===============================");
|
||||
} catch (Exception e) {
|
||||
log.info("======================文件存储到本地失败===============================");
|
||||
} finally {
|
||||
try {
|
||||
if (bufferedOutputStream != null) {
|
||||
bufferedOutputStream.close();
|
||||
}
|
||||
if (fileOutputStream != null) {
|
||||
fileOutputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.info("======================文件流关闭失败===============================");
|
||||
}
|
||||
}
|
||||
// 把文件放置到本地
|
||||
OSSFile ossFile = new OSSFile();
|
||||
// 开始存储文件信息
|
||||
ossFile.setFileName(onlineFileLog.getOldFileName());
|
||||
String fileUrl = "hisFile/" + onlineFileLog.getOldFileName() + "/" + fileName + "." + onlineFileLog.getFileSuffix();
|
||||
ossFile.setUrl(fileUrl);
|
||||
ossFileService.save(ossFile);
|
||||
log.info("======================文件成功存储到Oss中===============================" + ossFile.toString());
|
||||
// 储存文件 一个文件夹 储存十个
|
||||
onlineFileLog.setAttFileId(ossFile.getId());
|
||||
onlineFileLog.setUpdateTime(new Date());
|
||||
onlineFileLog.setCreateTime(new Date());
|
||||
onlineFileLog.setFileName(String.valueOf(time));
|
||||
onlineFileLog.setValidFlag("0");
|
||||
onlineFileLog.setFileKey(key);
|
||||
onlineFileLog.setFilePath(fileUrl);
|
||||
onlineFileLogDao.insert(onlineFileLog);
|
||||
log.info("======================日志存入成功===============================");
|
||||
if (StringUtils.isNotBlank(standName)) {
|
||||
ossFile.setFileName(standName + ".docx");
|
||||
ossFileService.updateById(ossFile);
|
||||
log.info("======================文件名称修改成功===============================" + standName + ".docx" + "======" + "传入对象为:" + ossFile.getFileName());
|
||||
}
|
||||
QueryWrapper<OnlineFileLog> onlineFileLogQueryWrapperHis = new QueryWrapper<>();
|
||||
onlineFileLogQueryWrapperHis.eq("HIS_ID", onlineFileId);
|
||||
onlineFileLogQueryWrapperHis.eq("VALID_FLAG", "0");
|
||||
onlineFileLogQueryWrapperHis.orderByAsc("CREATE_TIME");
|
||||
List<OnlineFileLog> onlineFileLogs = onlineFileLogDao.selectList(onlineFileLogQueryWrapperHis);
|
||||
// 只保留最近的10个文件
|
||||
if (onlineFileLogs.size() > 10) {
|
||||
log.info("======================文件日志记录小于10===============================" + onlineFileLogs.size());
|
||||
QueryWrapper<OnlineFileLog> onlineFileLogQueryWrapper = new QueryWrapper<>();
|
||||
onlineFileLogQueryWrapper.eq("ID", onlineFileLogs.get(0).getId());
|
||||
OnlineFileLog onlineFileLogIsNot = onlineFileLogDao.selectOne(onlineFileLogQueryWrapper);
|
||||
if (onlineFileLogIsNot != null) {
|
||||
// 删除此处有关的数据
|
||||
OSSFile ossFileInfo = ossFileService.getById(onlineFileLogIsNot.getAttFileId());
|
||||
if (ossFileInfo != null) {
|
||||
// 删除所有相关文件和记录
|
||||
File fileAtt = new File(standEditFilePath + ossFileInfo.getUrl());
|
||||
boolean delete = fileAtt.delete();
|
||||
if (delete) {
|
||||
log.info("======================文件删除成功===============================" + ossFileInfo.getUrl());
|
||||
ossFileService.removeById(onlineFileLogIsNot.getAttFileId());
|
||||
onlineFileLogDao.deleteById(onlineFileLogs.get(0).getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("删除成功" + onlineFileLogs.get(0).getId());
|
||||
} else {
|
||||
log.info("======================文件日志记录小于10===============================" + onlineFileLogs.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
+169
@@ -0,0 +1,169 @@
|
||||
package com.jero.modules.onlyoffice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.util.UUIDUtils;
|
||||
import com.jero.modules.onlyoffice.entity.AttFileEO;
|
||||
import com.jero.modules.onlyoffice.entity.AttFileVo;
|
||||
import com.jero.modules.onlyoffice.mapper.AttFileEODao;
|
||||
import com.jero.modules.onlyoffice.service.IAttFileEOService;
|
||||
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;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
@Service("attFileEOService")
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
@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;
|
||||
|
||||
|
||||
/**
|
||||
* 保存文件并返回文件ID
|
||||
*
|
||||
* @param file
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AttFileVo saveFileInfo(File file) {
|
||||
/**
|
||||
* 1、首先生成文件保存的主键ID
|
||||
* 2、根据文件ID生成随机路径
|
||||
* 3、生成文件名
|
||||
* 3、保存文件
|
||||
* 4、获取文件相关信息
|
||||
* 5、判断当前表是否有存在,如果存在则执行insert语句 如果不存在则创建表结构
|
||||
* 5、保存入库并返回主键ID
|
||||
*/
|
||||
AttFileVo attFileVo = new AttFileVo();
|
||||
String fileId = UUIDUtils.randomUUID20();
|
||||
try {
|
||||
String uuidPath = UUIDUtils.getUUIDPath(fileId);
|
||||
|
||||
String FileSavePath = filePath + uuidPath + "/";
|
||||
File dir = new File(FileSavePath);
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
}
|
||||
|
||||
String fileName = file.getName();
|
||||
String fileSuffix = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
|
||||
String newFileName = fileId + "." + fileSuffix;
|
||||
File saveFile = new File(FileSavePath + newFileName);
|
||||
FileUtils.copyFile(file, saveFile);
|
||||
//开始存储文件信息
|
||||
String tableName = UUIDUtils.getAttTable();
|
||||
int existTable = this.baseMapper.existTable(tableName);
|
||||
if (existTable == 0) {
|
||||
this.baseMapper.creatTableInfo(tableName);
|
||||
}
|
||||
fileId = tableName + "_" + fileId;
|
||||
AttFileEO attFileEO = new AttFileEO();
|
||||
attFileEO.setTableName(tableName);
|
||||
attFileEO.setId(fileId);
|
||||
attFileEO.setOldFileName(fileName);
|
||||
attFileEO.setFileSuffix(fileSuffix);
|
||||
attFileEO.setFilePath(uuidPath);
|
||||
attFileEO.setFileName(newFileName);
|
||||
attFileEO.setValidFlag(0);
|
||||
attFileEO.setCreationTime(new Date());
|
||||
attFileEO.setModifyTime(new Date());
|
||||
this.baseMapper.insertData(attFileEO);
|
||||
attFileVo.setId(fileId);
|
||||
attFileVo.setFileName(newFileName);
|
||||
attFileVo.setFilePath(uuidPath);
|
||||
attFileVo.setFileSuffix(fileSuffix);
|
||||
attFileVo.setOldFileName(fileName);
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return attFileVo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据文件ID获取文件信息
|
||||
*
|
||||
* @param attId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AttFileEO getFileInfo(String attId) {
|
||||
/**
|
||||
* 根据ID获取文件信息
|
||||
*/
|
||||
AttFileEO attFileEO = new AttFileEO();
|
||||
AttFileEO attFileInfo = null;
|
||||
try {
|
||||
attFileEO.setId(attId);
|
||||
attFileInfo = this.baseMapper.selectFileInfoById(attFileEO);
|
||||
return attFileInfo;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return attFileEO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttFileEO updateFileInfo(String attId, String name) {
|
||||
/**
|
||||
* 根据ID获取文件信息
|
||||
*/
|
||||
AttFileEO attFileEO = new AttFileEO();
|
||||
AttFileEO attFileInfo = null;
|
||||
try {
|
||||
attFileEO.setId(attId);
|
||||
attFileInfo = this.baseMapper.selectFileInfoById(attFileEO);
|
||||
if (name.contains(".")) {
|
||||
int suffixIndex = name.lastIndexOf(".");
|
||||
String newSuffix = name.substring(suffixIndex + 1).trim();
|
||||
if (StringUtils.equals(newSuffix.toUpperCase(), attFileInfo.getFileSuffix().toUpperCase())) {
|
||||
attFileInfo.setOldFileName(name);
|
||||
} else {
|
||||
String filename = name.substring(0, suffixIndex).trim();
|
||||
attFileInfo.setOldFileName(filename + "." + attFileInfo.getFileSuffix());
|
||||
}
|
||||
} else {
|
||||
attFileInfo.setOldFileName(name.trim() + "." + attFileEO.getFileSuffix());
|
||||
}
|
||||
this.baseMapper.updateFileInfoById(attFileInfo);
|
||||
return attFileInfo;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return attFileInfo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
if (StringUtils.isNotBlank(id)) {
|
||||
String[] s = id.split("_");
|
||||
List<String> asList = Arrays.asList(s);
|
||||
String str = "att_file_" + asList.get(2);
|
||||
baseMapper.deleteByIdInfo(str, id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+438
@@ -0,0 +1,438 @@
|
||||
package com.jero.modules.onlyoffice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.util.CommonUtils;
|
||||
import com.jero.common.util.MinioUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.onlyoffice.entity.BusProcessModelHis;
|
||||
import com.jero.modules.onlyoffice.entity.OnlineFileLog;
|
||||
import com.jero.modules.onlyoffice.mapper.BusProcessModelHisMapper;
|
||||
import com.jero.modules.onlyoffice.mapper.OnlineFileLogDao;
|
||||
import com.jero.modules.onlyoffice.service.IBusProcessModelHisService;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import com.jero.modules.sys.controller.SysCommonController;
|
||||
import io.minio.errors.*;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程模块历史表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-09-17
|
||||
*/
|
||||
@Service
|
||||
public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHisMapper, BusProcessModelHis> implements IBusProcessModelHisService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(BusProcessModelHisServiceImpl.class);
|
||||
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
/**
|
||||
* 文件下载路径
|
||||
*/
|
||||
@Value("${file.downloadUrl}")
|
||||
private String downloadUrl;
|
||||
|
||||
@Value("${file.sourceFilePath}")
|
||||
private String sourceFilePath;
|
||||
|
||||
@Resource
|
||||
private OnlineFileLogDao onlineFileLogDao;
|
||||
|
||||
@Resource
|
||||
private IOSSFileService ossFileService;
|
||||
|
||||
@Value(value = "${jero.uploadType}")
|
||||
private String uploadType;
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis saveEditFile(String model) {
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
try {
|
||||
String preUuid2 = UUID.randomUUID().toString();
|
||||
String changUuid = preUuid2.substring(0, 8);
|
||||
String taskId = "task_" + changUuid;
|
||||
String topId = "top_" + changUuid;
|
||||
|
||||
String builderModel = "model" + "/";
|
||||
|
||||
File dir = new File(filePath + builderModel);
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
}
|
||||
String fileName = model + ".docx";
|
||||
modelHis.setFileName(fileName);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("model").append("/");
|
||||
builder.append(taskId).append("/");
|
||||
|
||||
File file = new File(filePath + builder.toString());
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
|
||||
String targetPath = builder.toString() + taskId + "_" + topId + "_node.docx";
|
||||
|
||||
File sourceFile = new File(sourceFilePath);
|
||||
File targetFile = new File(filePath + targetPath);
|
||||
FileUtils.copyFile(sourceFile, targetFile);
|
||||
|
||||
modelHis.setTaskId(taskId);
|
||||
modelHis.setPId(topId);
|
||||
modelHis.setEditFilePath(targetPath);
|
||||
modelHis.setDownLoadUrl(downloadUrl + targetPath);
|
||||
this.baseMapper.insert(modelHis);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
return modelHis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis saveEditFileWithOss(String ossFileId) {
|
||||
OSSFile ossFile = ossFileService.getById(ossFileId);
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
|
||||
try {
|
||||
String taskId = generateTaskId();
|
||||
String topId = generateTopId();
|
||||
String builderModel = "model" + "/";
|
||||
String targetPath = builderModel + taskId + "/" + taskId + "_" + topId + "_node.docx";
|
||||
|
||||
createDirectoryIfNotExists(filePath + builderModel);
|
||||
createDirectoryIfNotExists(filePath + builderModel + taskId + "/");
|
||||
|
||||
String fileUrl = ossFile.getUrl();
|
||||
String minioUrl = MinioUtil.getMinioUrl() + MinioUtil.getBucketName() + "/";
|
||||
String url = fileUrl.replace(minioUrl, "");
|
||||
|
||||
InputStream minioFile = MinioUtil.getMinioFile(MinioUtil.getBucketName(), url);
|
||||
|
||||
File targetFile = new File(filePath + targetPath);
|
||||
|
||||
try (OutputStream outputStream = new FileOutputStream(targetFile)) {
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead;
|
||||
while ((bytesRead = minioFile.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("文件写入失败:" + e.getMessage());
|
||||
}
|
||||
|
||||
modelHis.setFileName(ossFile.getFileName());
|
||||
modelHis.setTaskId(taskId);
|
||||
modelHis.setPId(topId);
|
||||
modelHis.setEditFilePath(targetPath);
|
||||
modelHis.setDownLoadUrl(downloadUrl + targetPath);
|
||||
this.baseMapper.insert(modelHis);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
|
||||
return modelHis;
|
||||
}
|
||||
|
||||
private String generateTaskId() {
|
||||
String preUuid2 = UUID.randomUUID().toString();
|
||||
return "task_" + preUuid2.substring(0, 8);
|
||||
}
|
||||
|
||||
private String generateTopId() {
|
||||
String preUuid2 = UUID.randomUUID().toString();
|
||||
return "top_" + preUuid2.substring(0, 8);
|
||||
}
|
||||
|
||||
private void createDirectoryIfNotExists(String directoryPath) {
|
||||
File dir = new File(directoryPath);
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnlineFileLog selectOnlineFile(String onlineFileId) {
|
||||
BusProcessModelHis busProcessModelHis = baseMapper.selectById(onlineFileId);
|
||||
OnlineFileLog onlineFileLog = new OnlineFileLog();
|
||||
byte[] bytes = new byte[0];
|
||||
if (busProcessModelHis != null) {
|
||||
//获取当前文件路径 返回文件路径的数字组
|
||||
try {
|
||||
String editFilePath = busProcessModelHis.getEditFilePath();
|
||||
File file = new File(filePath + editFilePath);
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(1024);
|
||||
byte[] aByte = new byte[1024];
|
||||
int n;
|
||||
while ((n = fileInputStream.read(aByte)) != -1) {
|
||||
byteArrayOutputStream.write(aByte, 0, n);
|
||||
}
|
||||
bytes = byteArrayOutputStream.toByteArray();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
onlineFileLog.setHisId(busProcessModelHis.getId());
|
||||
onlineFileLog.setFilePath(busProcessModelHis.getEditFilePath());
|
||||
if (StringUtils.isNotBlank(busProcessModelHis.getEditFilePath())) {
|
||||
String[] split = busProcessModelHis.getEditFilePath().split("\\.");
|
||||
onlineFileLog.setFileSuffix(split[1]);
|
||||
}
|
||||
if (StringUtils.isNotBlank(busProcessModelHis.getEditFilePath())) {
|
||||
String[] split = busProcessModelHis.getEditFilePath().split("/");
|
||||
String[] split1 = split[2].split("\\.");
|
||||
onlineFileLog.setOldFileName(split1[0]);
|
||||
}
|
||||
onlineFileLog.setBytes(bytes);
|
||||
}
|
||||
return onlineFileLog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downLoadFile(String path, HttpServletResponse response) {
|
||||
InputStream inputStream = null;
|
||||
OutputStream outputStream = null;
|
||||
try {
|
||||
File file = new File(filePath + path);
|
||||
inputStream = new BufferedInputStream(Files.newInputStream(file.toPath()));
|
||||
response.addHeader("Content-Disposition", "attachment;fileName="
|
||||
+ new String(file.getName().getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1));
|
||||
response.setContentType("application/force-download");// 设置强制下载不打开
|
||||
outputStream = response.getOutputStream();
|
||||
byte[] buf = new byte[1024];
|
||||
int len;
|
||||
while ((len = inputStream.read(buf)) > 0) {
|
||||
outputStream.write(buf, 0, len);
|
||||
}
|
||||
response.flushBuffer();
|
||||
} catch (IOException e) {
|
||||
log.error("预览文件失败" + e.getMessage());
|
||||
response.setStatus(404);
|
||||
} finally {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
if (outputStream != null) {
|
||||
try {
|
||||
outputStream.close();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 企标流程文件存储
|
||||
*
|
||||
* @param pid
|
||||
* @param taskId
|
||||
* @param fileSuffix
|
||||
* @param filePath 文件存储路径
|
||||
* @throws IOException
|
||||
*/
|
||||
public String saveProcessFile(String filePath, String pid, String taskId, String fileSuffix) {
|
||||
|
||||
String fileSavePath = "bussEdit" + getUUIDPath(pid, taskId);
|
||||
String newFileName = "";
|
||||
try {
|
||||
|
||||
File dir = new File(fileSavePath);
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
}
|
||||
|
||||
newFileName = fileSavePath + taskId + "_" + pid + "_node." + fileSuffix;
|
||||
File saveFile = new File(filePath + newFileName);
|
||||
FileUtils.write(saveFile, "", "UTF-8");
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return newFileName;
|
||||
}
|
||||
|
||||
public static String getUUIDPath(String pid, String taskId) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("/");
|
||||
builder.append(pid).append("/");
|
||||
// builder.append(taskId).append("/");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis modelHisOneUpdStatusById(String id) {
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
modelHis.setId(id);
|
||||
modelHis.setEditStatus("1");
|
||||
this.baseMapper.updateById(modelHis);
|
||||
return modelHis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis modelHisOneUpdStatus(String pid, String taskId) {
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("P_ID", pid);
|
||||
wrapper.eq("TASK_ID", taskId);
|
||||
List<BusProcessModelHis> hisList = this.baseMapper.selectList(wrapper);
|
||||
if (!hisList.isEmpty()) {
|
||||
modelHis = hisList.get(0);
|
||||
modelHis.setEditStatus("1");
|
||||
this.baseMapper.updateById(modelHis);
|
||||
}
|
||||
return modelHis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis modelHisOneCount(String pid) {
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("P_ID", pid);
|
||||
wrapper.eq("EDIT_TYPE", "count");
|
||||
List<BusProcessModelHis> hisList = this.baseMapper.selectList(wrapper);
|
||||
if (!hisList.isEmpty()) {
|
||||
modelHis = hisList.get(0);
|
||||
StringBuffer downloadFileUrl = new StringBuffer();
|
||||
downloadFileUrl.append(downloadUrl).append(modelHis.getEditFilePath() == null ? "" : modelHis.getEditFilePath());
|
||||
modelHis.setDownLoadUrl(downloadFileUrl.toString());
|
||||
}
|
||||
return modelHis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis processEditFile(String id) {
|
||||
BusProcessModelHis modelHis = this.baseMapper.selectById(id);
|
||||
if (StringUtils.isNotBlank(modelHis.getId())) {
|
||||
StringBuffer downloadFileUrl = new StringBuffer();
|
||||
downloadFileUrl.append(downloadUrl).append(modelHis.getEditFilePath() == null ? "" : modelHis.getEditFilePath());
|
||||
modelHis.setDownLoadUrl(downloadFileUrl.toString());
|
||||
}
|
||||
return modelHis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis modelHisOne(String pid, String taskId) {
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("P_ID", pid);
|
||||
wrapper.eq("TASK_ID", taskId);
|
||||
List<BusProcessModelHis> hisList = this.baseMapper.selectList(wrapper);
|
||||
if (!hisList.isEmpty()) {
|
||||
modelHis = hisList.get(0);
|
||||
StringBuffer downloadFileUrl = new StringBuffer();
|
||||
downloadFileUrl.append(downloadUrl).append(modelHis.getEditFilePath() == null ? "" : modelHis.getEditFilePath());
|
||||
modelHis.setDownLoadUrl(downloadFileUrl.toString());
|
||||
}
|
||||
return modelHis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusProcessModelHis> modelHisList(String pid) {
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("P_ID", pid);
|
||||
return this.baseMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceFile(String hisId, String replaceId) {
|
||||
// 找到修改后的文件上传到minio后 将相关信息替换原本的ossFile记录
|
||||
BusProcessModelHis his = this.getById(hisId);
|
||||
// 找到最新的文件记录 上传到minio
|
||||
LambdaQueryWrapper<OnlineFileLog> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(OnlineFileLog::getHisId, hisId);
|
||||
wrapper.eq(OnlineFileLog::getValidFlag, "0");
|
||||
wrapper.orderByDesc(OnlineFileLog::getCreateTime);
|
||||
List<OnlineFileLog> onlineFileLogList = onlineFileLogDao.selectList(wrapper);
|
||||
OnlineFileLog onlineFileLog = onlineFileLogList.get(0);
|
||||
if (onlineFileLog == null) {
|
||||
throw new RuntimeException("找不到最新的在线编辑文件记录");
|
||||
}
|
||||
OSSFile ossFile = ossFileService.getById(onlineFileLog.getAttFileId());
|
||||
// 获取文件
|
||||
String path = filePath + ossFile.getUrl();
|
||||
// 获取上传文件对象
|
||||
File file = new File(path);
|
||||
MultipartFile multipartFile = BusProcessModelHisServiceImpl.convert(file);
|
||||
String savePath = CommonUtils.upload(multipartFile, "", uploadType);
|
||||
OSSFile replaceFile = ossFileService.getById(replaceId);
|
||||
if (oConvertUtils.isNotEmpty(savePath)) {
|
||||
// 文件名
|
||||
String fileName = his.getFileName();
|
||||
fileName = CommonUtils.getFileName(fileName);
|
||||
replaceFile.setFileName(fileName);
|
||||
replaceFile.setUrl(savePath);
|
||||
ossFileService.updateById(replaceFile);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveProcessFileToOss(String hisId) {
|
||||
BusProcessModelHis his = this.getById(hisId);
|
||||
// 找到最新的文件记录 上传到minio
|
||||
LambdaQueryWrapper<OnlineFileLog> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(OnlineFileLog::getHisId, hisId);
|
||||
wrapper.eq(OnlineFileLog::getValidFlag, "0");
|
||||
wrapper.orderByDesc(OnlineFileLog::getCreateTime);
|
||||
List<OnlineFileLog> onlineFileLogList = onlineFileLogDao.selectList(wrapper);
|
||||
OnlineFileLog onlineFileLog = onlineFileLogList.get(0);
|
||||
OSSFile ossFile = ossFileService.getById(onlineFileLog.getAttFileId());
|
||||
// 获取文件
|
||||
String path = filePath + ossFile.getUrl();
|
||||
// 获取上传文件对象
|
||||
File file = new File(path);
|
||||
MultipartFile multipartFile = BusProcessModelHisServiceImpl.convert(file);
|
||||
String savePath = CommonUtils.upload(multipartFile, "", uploadType);
|
||||
if (oConvertUtils.isNotEmpty(savePath)) {
|
||||
// 文件名
|
||||
String fileName = his.getFileName();
|
||||
fileName = CommonUtils.getFileName(fileName);
|
||||
ossFile.setFileName(fileName);
|
||||
ossFile.setUrl(savePath);
|
||||
ossFileService.updateById(ossFile);
|
||||
}
|
||||
return ossFile.getId();
|
||||
}
|
||||
|
||||
public static MultipartFile convert(File file) {
|
||||
try (FileInputStream input = new FileInputStream(file)) {
|
||||
return new MockMultipartFile("file",
|
||||
file.getName(),
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
input);
|
||||
} catch (IOException e) {
|
||||
// 处理异常
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.jero.modules.split.common;
|
||||
|
||||
public class BasePage{
|
||||
private Integer page = 1;
|
||||
private Integer pageSize = 10;
|
||||
private Integer startIndex;
|
||||
private Integer endIndex;
|
||||
private String orderBy;
|
||||
private String order;
|
||||
private String q;
|
||||
private Pager pager = new Pager();
|
||||
|
||||
public BasePage() {
|
||||
}
|
||||
|
||||
public Pager getPager() {
|
||||
this.pager.setPageId(this.getPage());
|
||||
this.pager.setPageSize(this.getPageSize());
|
||||
String orderField = "";
|
||||
if (this.orderBy != null && this.orderBy.trim().length() > 0) {
|
||||
orderField = this.orderBy;
|
||||
}
|
||||
|
||||
if (orderField.trim().length() > 0 && this.order != null && this.order.trim().length() > 0) {
|
||||
orderField = orderField + " " + this.order;
|
||||
}
|
||||
|
||||
this.pager.setOrderField(orderField);
|
||||
return this.pager;
|
||||
}
|
||||
|
||||
public void setPager(Pager pager) {
|
||||
this.pager = pager;
|
||||
}
|
||||
|
||||
public Integer getPage() {
|
||||
return this.page;
|
||||
}
|
||||
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return this.pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getOrderBy() {
|
||||
return this.orderBy;
|
||||
}
|
||||
|
||||
public void setOrderBy(String orderBy) {
|
||||
this.orderBy = orderBy;
|
||||
}
|
||||
|
||||
public String getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
public void setOrder(String order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public String getQ() {
|
||||
return this.q;
|
||||
}
|
||||
|
||||
public void setQ(String q) {
|
||||
this.q = q;
|
||||
}
|
||||
|
||||
public Integer getStartIndex() {
|
||||
return this.startIndex;
|
||||
}
|
||||
|
||||
public void setStartIndex(Integer startIndex) {
|
||||
this.startIndex = (this.page - 1) * this.pageSize + 1;
|
||||
}
|
||||
|
||||
public Integer getEndIndex() {
|
||||
return this.endIndex;
|
||||
}
|
||||
|
||||
public void setEndIndex(Integer endIndex) {
|
||||
this.endIndex = this.page * this.pageSize;
|
||||
}
|
||||
}
|
||||
+293
@@ -0,0 +1,293 @@
|
||||
package com.jero.modules.split.common;
|
||||
|
||||
import com.jero.modules.system.util.MyStringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.ss.util.CellUtil;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/2/26 10:10
|
||||
*/
|
||||
public class ConvertHtml2Excel {
|
||||
|
||||
/**
|
||||
* html表格转excel
|
||||
*/
|
||||
public static HSSFWorkbook table2Excel(String tableHtml,HSSFWorkbook wb,String sheetName) throws Exception {
|
||||
// HSSFWorkbook wb = new HSSFWorkbook();
|
||||
HSSFSheet sheet = wb.createSheet(sheetName);
|
||||
List<Integer> moneyCols =new ArrayList<>();
|
||||
moneyCols.add(1);
|
||||
int headEndRow = 1;
|
||||
List<CrossRangeCellMeta> crossRowEleMetaLs = new ArrayList<CrossRangeCellMeta>();
|
||||
int rowIndex = 0;
|
||||
try {
|
||||
Document data = DocumentHelper.parseText(tableHtml);
|
||||
HSSFCellStyle contentStyle = getContentStyle(wb);
|
||||
// 生成表头
|
||||
Element thead = data.getRootElement().element("thead");
|
||||
HSSFCellStyle titleStyle = getTitleStyle(wb);
|
||||
int ls = 0;//列数
|
||||
if (thead != null) {
|
||||
List<Element> trLs = thead.elements("tr");
|
||||
for (Element trEle : trLs) {
|
||||
HSSFCellStyle style = rowIndex<=headEndRow?titleStyle:contentStyle;
|
||||
style.setWrapText(true);
|
||||
HSSFRow row = sheet.createRow(rowIndex);
|
||||
List<Element> thLs = trEle.elements("th");
|
||||
if(ls<thLs.size()) {
|
||||
ls = thLs.size();
|
||||
}
|
||||
int cellIndex = makeRowCell(thLs, rowIndex, row, 0, style, crossRowEleMetaLs, true,moneyCols);
|
||||
List<Element> tdLs = trEle.elements("td");
|
||||
if(ls<ls+tdLs.size()) {
|
||||
ls = ls + tdLs.size();
|
||||
}
|
||||
makeRowCell(tdLs, rowIndex, row, cellIndex, style, crossRowEleMetaLs, true,moneyCols);
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
// 生成表体
|
||||
Element tbody = data.getRootElement().element("tbody");
|
||||
if (tbody != null) {
|
||||
List<Element> trBody = tbody.elements("tr");
|
||||
for (Element trEle : trBody) {
|
||||
HSSFCellStyle style = rowIndex<=headEndRow?titleStyle:contentStyle;
|
||||
style.setWrapText(true);
|
||||
HSSFRow row = sheet.createRow(rowIndex);
|
||||
List<Element> thLs = trEle.elements("th");
|
||||
if(ls<thLs.size()) {
|
||||
ls = thLs.size();
|
||||
}
|
||||
int cellIndex = makeRowCell(thLs, rowIndex, row, 0, style, crossRowEleMetaLs, false,moneyCols);
|
||||
List<Element> tdLs = trEle.elements("td");
|
||||
if(ls<ls+tdLs.size()) {
|
||||
ls = ls + tdLs.size();
|
||||
}
|
||||
makeRowCell(tdLs, rowIndex, row, cellIndex, style, crossRowEleMetaLs, false,moneyCols);
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
// 生成表体
|
||||
Element tfoot = data.getRootElement().element("tfoot");
|
||||
if (tfoot != null) {
|
||||
List<Element> trFoot = tfoot.elements("tr");
|
||||
for (Element trEle : trFoot) {
|
||||
HSSFCellStyle style = rowIndex<=headEndRow?titleStyle:contentStyle;
|
||||
style.setWrapText(true);
|
||||
HSSFRow row = sheet.createRow(rowIndex);
|
||||
List<Element> thLs = trEle.elements("th");
|
||||
if(ls<thLs.size()) {
|
||||
ls = thLs.size();
|
||||
}
|
||||
int cellIndex = makeRowCell(thLs, rowIndex, row, 0, style, crossRowEleMetaLs, false,moneyCols);
|
||||
List<Element> tdLs = trEle.elements("td");
|
||||
if(ls<ls+tdLs.size()) {
|
||||
ls = ls + tdLs.size();
|
||||
}
|
||||
makeRowCell(tdLs, rowIndex, row, cellIndex, style, crossRowEleMetaLs, false,moneyCols);
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
// 合并表头
|
||||
for (CrossRangeCellMeta crcm : crossRowEleMetaLs) {
|
||||
sheet.addMergedRegion(new CellRangeAddress(crcm.getFirstRow(), crcm.getLastRow(), crcm.getFirstCol(), crcm.getLastCol()));
|
||||
HSSFCellStyle mergeStyle;
|
||||
if (crcm.isInHead()) {
|
||||
mergeStyle = titleStyle;
|
||||
} else {
|
||||
mergeStyle = contentStyle;
|
||||
}
|
||||
mergeStyle.setWrapText(true);
|
||||
setRegionStyle(sheet, new CellRangeAddress(crcm.getFirstRow(), crcm.getLastRow(), crcm.getFirstCol(), crcm.getLastCol()), mergeStyle);
|
||||
}
|
||||
for (int i = 0; i < ls; i++) {
|
||||
sheet.autoSizeColumn(i, true);//设置列宽
|
||||
sheet.setColumnWidth(i,30*256);
|
||||
// sheet.setColumnWidth(i,sheet.getColumnWidth(i)*15/10);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return wb;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产行内容
|
||||
*
|
||||
* @return 最后一列的cell index
|
||||
*/
|
||||
/**
|
||||
* @param tdLs th或者td集合
|
||||
* @param rowIndex 行号
|
||||
* @param row POI行对象
|
||||
* @param startCellIndex
|
||||
* @param cellStyle 样式
|
||||
* @param crossRowEleMetaLs 跨行元数据集合
|
||||
* @return
|
||||
*/
|
||||
private static int makeRowCell(List<Element> tdLs, int rowIndex, HSSFRow row, int startCellIndex, HSSFCellStyle cellStyle,
|
||||
List<CrossRangeCellMeta> crossRowEleMetaLs, boolean inHead, List<Integer> moneyCols) {
|
||||
int i = startCellIndex;
|
||||
for (int eleIndex = 0; eleIndex < tdLs.size(); i++, eleIndex++) {
|
||||
int captureCellSize = getCaptureCellSize(rowIndex, i, crossRowEleMetaLs);
|
||||
while (captureCellSize > 0) {
|
||||
for (int j = 0; j < captureCellSize; j++) {// 当前行跨列处理(补单元格)
|
||||
row.createCell(i);
|
||||
i++;
|
||||
}
|
||||
captureCellSize = getCaptureCellSize(rowIndex, i, crossRowEleMetaLs);
|
||||
}
|
||||
Element thEle = tdLs.get(eleIndex);
|
||||
String val = thEle.getText();
|
||||
if (MyStringUtils.isEmpty(val)) {
|
||||
Element e = thEle.element("a");
|
||||
if (e != null) {
|
||||
val = e.getText();
|
||||
}
|
||||
}
|
||||
HSSFCell c = row.createCell(i);
|
||||
if (NumberUtils.isNumber(val)) {
|
||||
if (moneyCols != null && moneyCols.contains(i)) {
|
||||
c.setCellType(CellType.STRING);
|
||||
c.setCellValue(val);
|
||||
} else {
|
||||
c.setCellValue(Double.parseDouble(val));
|
||||
c.setCellType(CellType.NUMERIC);
|
||||
}
|
||||
|
||||
} else {
|
||||
c.setCellType(CellType.STRING);
|
||||
c.setCellValue(new HSSFRichTextString(val));
|
||||
}
|
||||
int rowSpan = NumberUtils.toInt(thEle.attributeValue("rowspan"), 1);
|
||||
int colSpan = NumberUtils.toInt(thEle.attributeValue("colspan"), 1);
|
||||
c.setCellStyle(cellStyle);
|
||||
if (rowSpan > 1 || colSpan > 1) { // 存在跨行或跨列
|
||||
crossRowEleMetaLs.add(new CrossRangeCellMeta(rowIndex, i, rowSpan, colSpan, inHead));
|
||||
}
|
||||
if (colSpan > 1) {// 当前行跨列处理(补单元格)
|
||||
for (int j = 1; j < colSpan; j++) {
|
||||
i++;
|
||||
row.createCell(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置合并单元格的边框样式
|
||||
*
|
||||
* @param sheet
|
||||
* @param region
|
||||
* @param cs
|
||||
*/
|
||||
public static void setRegionStyle(HSSFSheet sheet, CellRangeAddress region, HSSFCellStyle cs) {
|
||||
for (int i = region.getFirstRow(); i <= region.getLastRow(); i++) {
|
||||
Row row = CellUtil.getRow(i, sheet);
|
||||
for (int j = region.getFirstColumn(); j <= region.getLastColumn(); j++) {
|
||||
Cell cell = CellUtil.getCell(row, (short) j);
|
||||
cell.setCellStyle(cs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得因rowSpan占据的单元格
|
||||
*
|
||||
* @param rowIndex 行号
|
||||
* @param colIndex 列号
|
||||
* @param crossRowEleMetaLs 跨行列元数据
|
||||
* @return 当前行在某列需要占据单元格
|
||||
*/
|
||||
private static int getCaptureCellSize(int rowIndex, int colIndex, List<CrossRangeCellMeta> crossRowEleMetaLs) {
|
||||
int captureCellSize = 0;
|
||||
for (CrossRangeCellMeta crossRangeCellMeta : crossRowEleMetaLs) {
|
||||
if (crossRangeCellMeta.getFirstRow() < rowIndex && crossRangeCellMeta.getLastRow() >= rowIndex) {
|
||||
if (crossRangeCellMeta.getFirstCol() <= colIndex && crossRangeCellMeta.getLastCol() >= colIndex) {
|
||||
captureCellSize = crossRangeCellMeta.getLastCol() - colIndex + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return captureCellSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得标题样式
|
||||
*
|
||||
* @param workbook
|
||||
* @return
|
||||
*/
|
||||
private static HSSFCellStyle getTitleStyle(HSSFWorkbook workbook) {
|
||||
short titlebackgroundcolor = HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex();
|
||||
short fontSize = 11;
|
||||
String fontName = "宋体";
|
||||
HSSFCellStyle style = workbook.createCellStyle();
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
style.setAlignment(HorizontalAlignment.CENTER);
|
||||
style.setBorderBottom(BorderStyle.THIN); //下边框
|
||||
style.setBorderLeft(BorderStyle.THIN);//左边框
|
||||
style.setBorderTop(BorderStyle.THIN);//上边框
|
||||
style.setBorderRight(BorderStyle.THIN);//右边框
|
||||
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
style.setFillForegroundColor(titlebackgroundcolor);// 背景色
|
||||
style.setWrapText(true);
|
||||
HSSFFont font = workbook.createFont();
|
||||
// font.setFontName(fontName);
|
||||
font.setFontHeightInPoints(fontSize);
|
||||
// font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
|
||||
style.setFont(font);
|
||||
return style;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得内容样式
|
||||
*
|
||||
* @param wb
|
||||
* @return
|
||||
*/
|
||||
private static HSSFCellStyle getContentStyle(HSSFWorkbook wb) {
|
||||
short fontSize = 11;
|
||||
// String fontName = "宋体";
|
||||
HSSFCellStyle style = wb.createCellStyle();
|
||||
style.setBorderBottom(BorderStyle.THIN);
|
||||
style.setBorderTop(BorderStyle.THIN);
|
||||
style.setBorderLeft(BorderStyle.THIN);
|
||||
style.setBorderRight(BorderStyle.THIN);
|
||||
HSSFFont font = wb.createFont();
|
||||
// font.setFontName(fontName);
|
||||
font.setFontHeightInPoints(fontSize);
|
||||
style.setFont(font);
|
||||
style.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||
return style;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// String cnt = "\n";
|
||||
// List<Integer> c =new ArrayList<>();
|
||||
// c.add(1);
|
||||
// String tableHtml = "<table><tbody><tr><td colspan='2'>11111111</td><td rowspan='3'>3333333333</td><td>444444444</td></tr><tr><td>5555555</td><td>66666</td><td></td></tr><tr><td></td><td>324234</td><td></td></tr></tbody></table>";
|
||||
// tableHtml = tableHtml.replaceAll("<[\\s]*?br[^>]*?>|<[\\s]*?\\/[\\s]*?br[\\s]*?>", cnt);
|
||||
// HSSFWorkbook hssfWorkbook = ConvertHtml2Excel.table2Excel(tableHtml,c,1);
|
||||
// hssfWorkbook.write(FileUtils.openOutputStream(new File("D:\\test\\test1.xls")));
|
||||
String tableHtml = "<table border=\"1\"><tbody><tr><td colspan='3'>自动切换前照灯近光的条件</td></tr><tr><td>外界环境光</td><td>近光灯</td><td>响应时间</td></tr><tr><td>小于1000 lx</td><td>开启</td><td>不大于2 s</td></tr><tr><td>1000 lx〜7000 lx</td><td>由制造商确定</td><td>由制造商确定</td></tr><tr><td>大于7000 lx</td><td>关闭</td><td>大于5 s,不大于300 s</td></tr><tr><td colspan='3'>注:使用经过余弦修正的照度计与车辆传感器安装位置等高的水平面上进行测量。</td></tr></tbody></table>";
|
||||
Document data = DocumentHelper.parseText(tableHtml);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.jero.modules.split.common;
|
||||
|
||||
/**
|
||||
* @Description: table转excel 跨行元素元数据
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/2/26 10:14
|
||||
*/
|
||||
public class CrossRangeCellMeta {
|
||||
|
||||
public CrossRangeCellMeta(int firstRowIndex, int firstColIndex, int rowSpan, int colSpan, boolean inHead) {
|
||||
super();
|
||||
this.firstRowIndex = firstRowIndex;
|
||||
this.firstColIndex = firstColIndex;
|
||||
this.rowSpan = rowSpan;
|
||||
this.colSpan = colSpan;
|
||||
this.inHead = inHead;
|
||||
}
|
||||
|
||||
private int firstRowIndex;
|
||||
private int firstColIndex;
|
||||
private int rowSpan;// 跨越行数
|
||||
private int colSpan;// 跨越列数
|
||||
private boolean inHead;
|
||||
|
||||
public boolean isInHead() {
|
||||
return inHead;
|
||||
}
|
||||
|
||||
public CrossRangeCellMeta setInHead(boolean inHead) {
|
||||
this.inHead = inHead;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getFirstRow() {
|
||||
return firstRowIndex;
|
||||
}
|
||||
|
||||
public int getLastRow() {
|
||||
return firstRowIndex + rowSpan - 1;
|
||||
}
|
||||
|
||||
public int getFirstCol() {
|
||||
return firstColIndex;
|
||||
}
|
||||
|
||||
public int getLastCol() {
|
||||
return firstColIndex + colSpan - 1;
|
||||
}
|
||||
|
||||
public int getColSpan() {
|
||||
return colSpan;
|
||||
}
|
||||
}
|
||||
+303
@@ -0,0 +1,303 @@
|
||||
package com.jero.modules.split.common;
|
||||
|
||||
import com.jero.common.constant.enums.LanguageEnum;
|
||||
import com.xkcoding.http.util.StringUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.tools.zip.ZipEntry;
|
||||
import org.apache.tools.zip.ZipFile;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
||||
public class FileUnZip {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(FileUnZip.class);
|
||||
|
||||
/**
|
||||
* 解压zip文件
|
||||
*
|
||||
* @param sourceFile,待解压的zip文件; toFolder,解压后的存放路径
|
||||
* @throws Exception
|
||||
* @author gaoyan
|
||||
**/
|
||||
public static String unZipFiles(String sourceFile, String descDir) throws IOException {
|
||||
File zipFile = new File(sourceFile);
|
||||
|
||||
File pathFile = new File(descDir);
|
||||
if (!pathFile.exists()) {
|
||||
pathFile.mkdirs();
|
||||
}
|
||||
ZipFile zip = null;
|
||||
try {
|
||||
zip = new ZipFile(zipFile,"gbk");
|
||||
} catch (Exception e) {
|
||||
zip = new ZipFile(zipFile,"utf-8");
|
||||
}
|
||||
String orgMkdirs = "";
|
||||
int count = 0;
|
||||
for (Enumeration entries = zip.getEntries(); entries.hasMoreElements(); ) {
|
||||
count ++;
|
||||
ZipEntry entry = (ZipEntry) entries.nextElement();
|
||||
String zipEntryName = entry.getName();
|
||||
String outPath = (descDir + "/" + zipEntryName).replaceAll("\\*", "/");
|
||||
if(count == 1){
|
||||
orgMkdirs = outPath.substring(0, outPath.lastIndexOf('/'));
|
||||
}
|
||||
//判断路径是否存在,不存在则创建文件路径
|
||||
File file = new File(outPath.substring(0, outPath.lastIndexOf('/')));
|
||||
if (!file.exists()) {
|
||||
// orgMkdirs = outPath.substring(0, outPath.lastIndexOf('/'));
|
||||
file.mkdirs();
|
||||
}else{
|
||||
// orgMkdirs = outPath.substring(0, outPath.lastIndexOf('/'));
|
||||
}
|
||||
//判断文件全路径是否为文件夹,如果是上面已经上传,不需要解压
|
||||
if (new File(outPath).isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
//输出文件路径信息
|
||||
// InputStream in = null;
|
||||
// OutputStream out = null;
|
||||
try(InputStream in =zip.getInputStream(entry);
|
||||
OutputStream out =new FileOutputStream(outPath)){
|
||||
byte[] buf1 = new byte[1024];
|
||||
int len;
|
||||
while ((len = in.read(buf1)) > 0) {
|
||||
out.write(buf1, 0, len);
|
||||
}
|
||||
}catch(IOException e){
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
zip.close();
|
||||
return orgMkdirs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解压zip文件
|
||||
* 解决解压文件下有多个文件夹时,读不到orgMkdirs问题
|
||||
* @param sourceFile,待解压的zip文件; descDir,解压后的存放路径
|
||||
* @throws Exception
|
||||
* @author gaoyan
|
||||
**/
|
||||
public static String unZipFiles2(String sourceFile, String descDir) throws IOException {
|
||||
File zipFile = new File(sourceFile);
|
||||
|
||||
File pathFile = new File(descDir);
|
||||
if (!pathFile.exists()) {
|
||||
pathFile.mkdirs();
|
||||
}
|
||||
ZipFile zip = new ZipFile(zipFile,"gbk");
|
||||
String orgMkdirsLast = "";
|
||||
for (Enumeration entries = zip.getEntries(); entries.hasMoreElements(); ) {
|
||||
ZipEntry entry = (ZipEntry) entries.nextElement();
|
||||
String zipEntryName = entry.getName();
|
||||
String outPath = (descDir + "/" + zipEntryName).replaceAll("\\*", "/");
|
||||
orgMkdirsLast = zipEntryName.substring(0, zipEntryName.indexOf('/'));
|
||||
//判断路径是否存在,不存在则创建文件路径
|
||||
File file = new File(outPath.substring(0, outPath.lastIndexOf('/')));
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
//判断文件全路径是否为文件夹,如果是上面已经上传,不需要解压
|
||||
if (new File(outPath).isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
//输出文件路径信息
|
||||
// InputStream in = null;
|
||||
// OutputStream out = null;
|
||||
try(InputStream in =zip.getInputStream(entry);
|
||||
OutputStream out =new FileOutputStream(outPath)){
|
||||
byte[] buf1 = new byte[1024];
|
||||
int len;
|
||||
while ((len = in.read(buf1)) > 0) {
|
||||
out.write(buf1, 0, len);
|
||||
}
|
||||
}catch(IOException e){
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
zip.close();
|
||||
String orgMkdirs = descDir + "/" + orgMkdirsLast;
|
||||
return orgMkdirs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归删除文件及文件夹
|
||||
*
|
||||
* @throws Exception
|
||||
* @author gaoyan
|
||||
* toFolder,解压后的存放路径
|
||||
**/
|
||||
public static boolean deleteDir(File dir) {
|
||||
if (dir.isDirectory()) {
|
||||
String[] children = dir.list();
|
||||
for (int i = 0; i < children.length; i++) {
|
||||
boolean success = deleteDir(new File(dir, children[i]));
|
||||
if (!success) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}else if(dir.isFile()){
|
||||
return dir.delete();
|
||||
}
|
||||
// 目录此时为空,可以删除
|
||||
return dir.delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取一个目录下所有的Excel文件
|
||||
* gaoyan
|
||||
*
|
||||
* @param path
|
||||
*/
|
||||
public static List<File> readExcelFile(String path) {
|
||||
File file = new File(path);
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤,只读取Excel文件
|
||||
if (fi.getName().contains(".xls") || fi.getName().contains(".xlsx")) {
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件名称读取固定目录下文件
|
||||
* 适用范围:filename内容 dir/file
|
||||
* gaoyan
|
||||
* @param filename
|
||||
*/
|
||||
public static List<File> readFileByFilename(String path,
|
||||
String filename,
|
||||
String cut,
|
||||
String errorMsg,
|
||||
List<String> msgList,
|
||||
String nameCn,
|
||||
String nameEn) {
|
||||
String filenameOne = "";
|
||||
String filenameTwo = "";
|
||||
if(filename.contains("/")){
|
||||
String[] strs = filename.split("/");
|
||||
if(strs.length >= 2){
|
||||
filenameOne = strs[0];
|
||||
filenameTwo = strs[1];
|
||||
}
|
||||
}
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (StringUtil.isNotEmpty(path)){
|
||||
File file = new File(path);
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
if(fi.isDirectory()){
|
||||
File[] filesTemp = fi.listFiles();
|
||||
for (File fileTemp : filesTemp) {
|
||||
// 对文件进行过滤
|
||||
if (fileTemp.getName().equals(filenameTwo) && fi.getName().equals(filenameOne) && StringUtils.isNotBlank(filenameOne)) {
|
||||
resultlist.add(fileTemp);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// 对文件进行过滤
|
||||
if (fi.getName().equals(filenameTwo) && fi.getPath().contains(filenameOne) && StringUtils.isNotBlank(filenameOne)) {
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(resultlist.size() == 0){
|
||||
String name = "";
|
||||
if(filename.contains("/")){
|
||||
name = filenameTwo;
|
||||
}else{
|
||||
name = filename;
|
||||
}
|
||||
if(LanguageEnum.CN.getValue().equals(cut)){
|
||||
errorMsg += nameCn + name + "格式不正确或者压缩包中没有" + name + "文件,请参考模板下载中的说明";
|
||||
}else{
|
||||
errorMsg += nameEn + name + " Incorrect format or not present in compressed package " + name + " file please refer to the description in template download;";
|
||||
}
|
||||
if(msgList != null){
|
||||
msgList.add(errorMsg);
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件名称读取固定目录下文件
|
||||
* 适用范围:filename内容 dir/file; file
|
||||
* @param path
|
||||
* @param filename
|
||||
* @return
|
||||
*/
|
||||
public static List<File> readFileByFilename(String path,String filename) {
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (StringUtil.isNotEmpty(path)){
|
||||
File file = new File(path);
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤
|
||||
if (fi.getName().equals(filename)) {
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
/**
|
||||
*@Description: 删除某个文件
|
||||
*@Param: [file]
|
||||
*@return: void
|
||||
*@Author: duyunbao
|
||||
*@date: 2019/5/23 20:31
|
||||
*/
|
||||
public static void delete(File file) {
|
||||
if (!file.exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.isFile() || file.list() == null) {
|
||||
file.delete();
|
||||
logger.info("删除了" + file.getName());
|
||||
} else {
|
||||
File[] files = file.listFiles();
|
||||
for (File a : files) {
|
||||
delete(a);
|
||||
}
|
||||
file.delete();
|
||||
logger.info("删除了" + file.getName());
|
||||
}
|
||||
}
|
||||
|
||||
public static List<File> readImpExcelFile(String path) {
|
||||
File file = new File(path);
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤,只读取Excel文件
|
||||
String name = fi.getName();
|
||||
// "导入模板".equals(fi.getName()) || "导入模板.xlsx".equals(fi.getName())
|
||||
if (name != null &&( fi.getName().contains(".xls") || fi.getName().contains(".xlsx") )){
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
package com.jero.modules.split.common;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 11:14 2022/3/2
|
||||
*/
|
||||
public class Pager {
|
||||
private int pageId = 1;
|
||||
private int rowCount = 0;
|
||||
private int pageSize = 10;
|
||||
private int pageCount = 0;
|
||||
private int pageOffset = 0;
|
||||
private int pageTail = 0;
|
||||
private String orderField;
|
||||
private boolean orderDirection = true;
|
||||
private boolean pageEnabled = true;
|
||||
private int length = 6;
|
||||
private int startIndex = 0;
|
||||
private int endIndex = 0;
|
||||
private int[] indexs;
|
||||
|
||||
public Pager() {
|
||||
}
|
||||
|
||||
public int getLength() {
|
||||
return this.length;
|
||||
}
|
||||
|
||||
public void setLength(int length) {
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public int[] getIndexs() {
|
||||
int len = this.getEndIndex() - this.getStartIndex() + 1;
|
||||
this.indexs = new int[len];
|
||||
|
||||
for(int i = 0; i < len; ++i) {
|
||||
this.indexs[i] = this.getStartIndex() + i;
|
||||
}
|
||||
|
||||
return this.indexs;
|
||||
}
|
||||
|
||||
public void setIndexs(int[] indexs) {
|
||||
this.indexs = indexs;
|
||||
}
|
||||
|
||||
public int getStartIndex() {
|
||||
this.startIndex = (this.pageId - 1) * this.pageSize + 1;
|
||||
return this.startIndex;
|
||||
}
|
||||
|
||||
public void setStartIndex(int startIndex) {
|
||||
System.out.println("startIndx:" + this.pageId + ":" + this.pageSize);
|
||||
this.startIndex = (this.pageId - 1) * this.pageSize + 1;
|
||||
}
|
||||
|
||||
public int getEndIndex() {
|
||||
this.endIndex = this.pageId * this.pageSize;
|
||||
return this.endIndex;
|
||||
}
|
||||
|
||||
public void setEndIndex(int endIndex) {
|
||||
this.endIndex = this.pageId * this.pageSize;
|
||||
}
|
||||
|
||||
protected void doPage() {
|
||||
this.pageCount = this.rowCount / this.pageSize + 1;
|
||||
if (this.rowCount % this.pageSize == 0 && this.pageCount > 1) {
|
||||
--this.pageCount;
|
||||
}
|
||||
|
||||
this.pageOffset = (this.pageId - 1) * this.pageSize;
|
||||
this.pageTail = this.pageOffset + this.pageSize;
|
||||
if (this.pageOffset + this.pageSize > this.rowCount) {
|
||||
this.pageTail = this.rowCount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String getOrderCondition() {
|
||||
String condition = "";
|
||||
if (this.orderField != null && this.orderField.length() != 0) {
|
||||
condition = " order by " + this.orderField + (this.orderDirection ? " " : " desc ");
|
||||
}
|
||||
|
||||
return condition;
|
||||
}
|
||||
|
||||
public String getMysqlQueryCondition() {
|
||||
String condition = "";
|
||||
if (this.pageEnabled) {
|
||||
}
|
||||
|
||||
return condition;
|
||||
}
|
||||
|
||||
public void setOrderDirection(boolean orderDirection) {
|
||||
this.orderDirection = orderDirection;
|
||||
}
|
||||
|
||||
public boolean isOrderDirection() {
|
||||
return this.orderDirection;
|
||||
}
|
||||
|
||||
public void setOrderField(String orderField) {
|
||||
this.orderField = orderField;
|
||||
}
|
||||
|
||||
public String getOrderField() {
|
||||
return this.orderField;
|
||||
}
|
||||
|
||||
public void setPageCount(int pageCount) {
|
||||
this.pageCount = pageCount;
|
||||
}
|
||||
|
||||
public int getPageCount() {
|
||||
return this.pageCount;
|
||||
}
|
||||
|
||||
public void setPageId(int pageId) {
|
||||
this.pageId = pageId;
|
||||
}
|
||||
|
||||
public int getPageId() {
|
||||
return this.pageId;
|
||||
}
|
||||
|
||||
public void setPageOffset(int pageOffset) {
|
||||
this.pageOffset = pageOffset;
|
||||
}
|
||||
|
||||
public int getPageOffset() {
|
||||
return this.pageOffset;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return this.pageSize;
|
||||
}
|
||||
|
||||
public void setPageTail(int pageTail) {
|
||||
this.pageTail = pageTail;
|
||||
}
|
||||
|
||||
public int getPageTail() {
|
||||
return this.pageTail;
|
||||
}
|
||||
|
||||
public void setRowCount(int rowCount) {
|
||||
this.rowCount = rowCount;
|
||||
this.doPage();
|
||||
}
|
||||
|
||||
public int getRowCount() {
|
||||
return this.rowCount;
|
||||
}
|
||||
|
||||
public boolean isPageEnabled() {
|
||||
return this.pageEnabled;
|
||||
}
|
||||
|
||||
public void setPageEnabled(boolean pageEnabled) {
|
||||
this.pageEnabled = pageEnabled;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user