修改文档对比-添加结果评论以及数据库结构
This commit is contained in:
@@ -726,3 +726,107 @@ CREATE TABLE `laws_weilai`.`country_card_manage_release_detail` (
|
||||
`content` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '内容',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '问题知识库-country_card-管理发布明细表' ROW_FORMAT = Dynamic;
|
||||
|
||||
|
||||
-- 文档对比信息表 2022-08-07 已同步生产环境
|
||||
DROP TABLE IF EXISTS `sar_file_compare_info`;
|
||||
CREATE TABLE `sar_file_compare_info` (
|
||||
`id` varchar(36) NOT NULL,
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`file_id_left` varchar(36) DEFAULT NULL COMMENT '文档1',
|
||||
`file_key_left` varchar(32) DEFAULT NULL COMMENT '文档key1',
|
||||
`serial_number_left` varchar(36) DEFAULT NULL COMMENT '编号1',
|
||||
`title_left` varchar(255) DEFAULT NULL COMMENT '标题1',
|
||||
`file_type_left` varchar(36) DEFAULT NULL COMMENT '文本状态1',
|
||||
`file_name_left` varchar(255) DEFAULT NULL COMMENT '文件名称1',
|
||||
`file_id_right` varchar(36) DEFAULT NULL COMMENT '文档2',
|
||||
`file_key_right` varchar(32) DEFAULT NULL COMMENT '文档key2',
|
||||
`serial_number_right` varchar(36) DEFAULT NULL COMMENT '编号2',
|
||||
`title_right` varchar(255) DEFAULT NULL COMMENT '标题2',
|
||||
`file_type_right` varchar(36) DEFAULT NULL COMMENT '文本状态2',
|
||||
`file_name_right` varchar(255) DEFAULT NULL COMMENT '文件名称2',
|
||||
`release_state` varchar(36) DEFAULT NULL COMMENT '发布状态',
|
||||
`remark` varchar(1000) DEFAULT NULL COMMENT '备注',
|
||||
`comments` varchar(1000) DEFAULT NULL COMMENT '评论',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- 文档对比信息条目表 2022-08-07 已同步生产环境
|
||||
DROP TABLE IF EXISTS `sar_file_compare_item`;
|
||||
CREATE TABLE `sar_file_compare_item` (
|
||||
`id` varchar(36) NOT NULL,
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`info_id` varchar(36) DEFAULT NULL COMMENT '文档对比信息id',
|
||||
`menu_id` varchar(36) DEFAULT NULL COMMENT '目录id',
|
||||
`items_name` varchar(255) DEFAULT NULL COMMENT '条款名称',
|
||||
`items_num` varchar(255) DEFAULT NULL COMMENT '条款编号',
|
||||
`items_text` longtext COMMENT '条款正文',
|
||||
`items_display_num` int(11) DEFAULT NULL COMMENT '条款展示编号',
|
||||
`target_stand` int(11) DEFAULT NULL COMMENT '对应相似条目',
|
||||
`left_or_right` varchar(36) DEFAULT NULL COMMENT '条款位置',
|
||||
`reviewed` int(11) DEFAULT NULL COMMENT '是否被评论(0或1)',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- 文档对比信息条目评论表 2022-08-07 已同步生产环境
|
||||
DROP TABLE IF EXISTS `sar_file_compare_item_comment`;
|
||||
CREATE TABLE `sar_file_compare_item_comment` (
|
||||
`id` varchar(36) NOT NULL,
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`info_id` varchar(36) DEFAULT NULL COMMENT '文档对比信息id',
|
||||
`items_id_left` varchar(36) DEFAULT NULL COMMENT '条款id左',
|
||||
`items_id_right` varchar(36) DEFAULT NULL COMMENT '条款id右',
|
||||
`comment` longtext COMMENT '评论',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- 文档对比信息目录表 2022-08-07 已同步生产环境
|
||||
DROP TABLE IF EXISTS `sar_file_compare_menu`;
|
||||
CREATE TABLE `sar_file_compare_menu` (
|
||||
`id` varchar(36) NOT NULL,
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`menu_id` varchar(36) DEFAULT NULL COMMENT '目录ID',
|
||||
`info_id` varchar(36) DEFAULT NULL COMMENT '信息ID',
|
||||
`name` varchar(200) DEFAULT NULL COMMENT '目录名称',
|
||||
`parent_id` varchar(36) DEFAULT NULL COMMENT '父级目录ID',
|
||||
`display_seq` int(11) DEFAULT NULL COMMENT '排序序号',
|
||||
`left_or_right` varchar(32) DEFAULT NULL COMMENT '目录位置',
|
||||
`item_name` varchar(255) DEFAULT NULL COMMENT '条款名称',
|
||||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- 文档对比信息结果表 2022-08-07 已同步生产环境
|
||||
DROP TABLE IF EXISTS `sar_file_compare_res_comment`;
|
||||
CREATE TABLE `sar_file_compare_res_comment` (
|
||||
`id` varchar(36) NOT NULL,
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`info_id` varchar(36) DEFAULT NULL COMMENT '文档对比信息id',
|
||||
`parent_id` varchar(36) DEFAULT NULL COMMENT '回复评论ID',
|
||||
`comment` longtext COMMENT '评论',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+16
-4
@@ -8,6 +8,7 @@ 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.common.system.vo.LoginUser;
|
||||
import com.jero.modules.compare.entity.SarFileCompareDetailVO;
|
||||
import com.jero.modules.compare.entity.SarFileCompareInfo;
|
||||
import com.jero.modules.compare.service.ISarFileCompareInfoService;
|
||||
@@ -15,6 +16,7 @@ import com.jero.modules.docTranslation.enums.ReleaseConditionEnum;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -52,11 +54,10 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
|
||||
@AutoLog(value = "文档对比信息表-分页列表查询")
|
||||
@ApiOperation(value = "文档对比信息表-分页列表查询", notes = "文档对比信息表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(SarFileCompareInfo sarFileCompareInfo,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
public Result<?> queryPageList(SarFileCompareInfo sarFileCompareInfo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
||||
QueryWrapper<SarFileCompareInfo> queryWrapper = QueryGenerator.initQueryWrapper(sarFileCompareInfo, req.getParameterMap());
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
queryWrapper.eq("create_by", sysUser.getUsername()).or().eq("release_state", ReleaseConditionEnum.DRAFT.getValue());
|
||||
Page<SarFileCompareInfo> page = new Page<SarFileCompareInfo>(pageNo, pageSize);
|
||||
IPage<SarFileCompareInfo> pageList = sarFileCompareInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
@@ -228,4 +229,15 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
|
||||
SarFileCompareDetailVO sarFileCompareDetailVO = sarFileCompareInfoService.getComparisonDetail(json.get("id").toString());
|
||||
return Result.OK(sarFileCompareDetailVO);
|
||||
}
|
||||
|
||||
@AutoLog(value = "文档对比信息表-编辑全文评论")
|
||||
@ApiOperation(value = "文档对比信息表-编辑全文评论", notes = "文档对比信息表-编辑全文评论")
|
||||
@PutMapping(value = "/editComments")
|
||||
public Result<?> editComments(@Validated @RequestBody SarFileCompareInfo sarFileCompareInfo) {
|
||||
SarFileCompareInfo info = sarFileCompareInfoService.getById(sarFileCompareInfo.getId());
|
||||
info.setComments(sarFileCompareInfo.getComments());
|
||||
sarFileCompareInfoService.editById(info);
|
||||
return Result.OK("编辑评论成功!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+145
-143
@@ -1,170 +1,172 @@
|
||||
package com.jero.modules.compare.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.compare.entity.SarFileCompareItemComment;
|
||||
import com.jero.modules.compare.service.ISarFileCompareItemCommentService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.ISarFileCompareItemCommentService;
|
||||
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 io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
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-08-05
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="文档对比信息条款评论表")
|
||||
@Api(tags = "文档对比信息条款评论表")
|
||||
@RestController
|
||||
@RequestMapping("/compare/sarFileCompareItemComment")
|
||||
@Slf4j
|
||||
public class SarFileCompareItemCommentController extends JeroController<SarFileCompareItemComment, ISarFileCompareItemCommentService> {
|
||||
@Autowired
|
||||
private ISarFileCompareItemCommentService sarFileCompareItemCommentService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档对比信息条款评论表-分页列表查询")
|
||||
@ApiOperation(value="文档对比信息条款评论表-分页列表查询", notes="文档对比信息条款评论表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(SarFileCompareItemComment sarFileCompareItemComment,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@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);
|
||||
}
|
||||
@Autowired
|
||||
private ISarFileCompareItemCommentService sarFileCompareItemCommentService;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
@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="文档对比信息条款评论表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
sarFileCompareItemCommentService.editById(sarFileCompareItemComment);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档对比信息条款评论表-通过id删除")
|
||||
@ApiOperation(value="文档对比信息条款评论表-通过id删除", notes="文档对比信息条款评论表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
sarFileCompareItemCommentService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档对比信息条款评论表-批量删除")
|
||||
@ApiOperation(value="文档对比信息条款评论表-批量删除", notes="文档对比信息条款评论表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.sarFileCompareItemCommentService.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) {
|
||||
SarFileCompareItemComment sarFileCompareItemComment = sarFileCompareItemCommentService.queryById(id);
|
||||
if(sarFileCompareItemComment==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(sarFileCompareItemComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param sarFileCompareItemComment
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
return super.exportXls(request, sarFileCompareItemComment, SarFileCompareItemComment.class, "文档对比信息条款评论表");
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档对比信息条款评论表-分页列表查询")
|
||||
@ApiOperation(value = "文档对比信息条款评论表-分页列表查询", notes = "文档对比信息条款评论表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(SarFileCompareItemComment sarFileCompareItemComment,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, SarFileCompareItemComment.class);
|
||||
* 列表查询
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
@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 = "文档对比信息条款评论表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
sarFileCompareItemCommentService.editById(sarFileCompareItemComment);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档对比信息条款评论表-通过id删除")
|
||||
@ApiOperation(value = "文档对比信息条款评论表-通过id删除", notes = "文档对比信息条款评论表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
sarFileCompareItemCommentService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档对比信息条款评论表-批量删除")
|
||||
@ApiOperation(value = "文档对比信息条款评论表-批量删除", notes = "文档对比信息条款评论表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.sarFileCompareItemCommentService.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) {
|
||||
SarFileCompareItemComment sarFileCompareItemComment = sarFileCompareItemCommentService.queryById(id);
|
||||
if (sarFileCompareItemComment == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(sarFileCompareItemComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询对比结果
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档对比信息条款评论表-查询对比结果")
|
||||
@ApiOperation(value = "文档对比信息条款评论表-查询对比结果", notes = "文档对比信息条款评论表-查询对比结果")
|
||||
@GetMapping(value = "/queryCompareResult")
|
||||
public Result<SarFileCompareResultVO> queryCompareResult(@RequestParam(name = "infoId", required = true) String infoId) {
|
||||
SarFileCompareResultVO res = sarFileCompareItemCommentService.queryCompareResult(infoId);
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
@AutoLog(value = "文档对比信息条款评论表-导出结果")
|
||||
@ApiOperation(value = "文档对比信息条款评论表-导出结果", notes = "文档对比信息条款评论表-导出结果")
|
||||
@GetMapping(value = "/exportResXls")
|
||||
public Result<?> exportResXls(@RequestParam Map<String, Object> map,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
sarFileCompareItemCommentService.exportResXls(map, response, request);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
-5
@@ -21,7 +21,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
/**
|
||||
* @Description: 文档对比信息条款表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Date: 2022-08-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@@ -101,9 +101,9 @@ public class SarFileCompareItem implements Serializable {
|
||||
@ApiModelProperty(value = "条款位置")
|
||||
private String leftOrRight;
|
||||
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
/**是否被评论(0或1)*/
|
||||
@Excel(name = "是否被评论(0或1)", width = 15)
|
||||
@ApiModelProperty(value = "是否被评论(0或1)")
|
||||
private Integer reviewed;
|
||||
|
||||
}
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
/**
|
||||
* 对比条目评论信息展示
|
||||
*/
|
||||
public class SarFileCompareItemComVO {
|
||||
private String id;
|
||||
private String itemsNameLeft;
|
||||
private String itemsNumLeft;
|
||||
private String itemsTextLeft;
|
||||
private String itemsNameRight;
|
||||
private String itemsNumRight;
|
||||
private String itemsTextRight;
|
||||
private java.lang.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;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,7 +12,6 @@ public class SarFileCompareMenuVo extends SarFileCompareMenu {
|
||||
public SarFileCompareMenuVo(SarFileCompareMenu menu) {
|
||||
super();
|
||||
this.setId(menu.getId());
|
||||
this.setKey(menu.getId());
|
||||
this.setCreateBy(menu.getCreateBy());
|
||||
this.setCreateTime(menu.getCreateTime());
|
||||
this.setUpdateBy(menu.getUpdateBy());
|
||||
@@ -21,11 +20,12 @@ public class SarFileCompareMenuVo extends SarFileCompareMenu {
|
||||
this.setMenuId(menu.getMenuId());
|
||||
this.setInfoId(menu.getInfoId());
|
||||
this.setName(menu.getName());
|
||||
this.setTitle(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() + menu.getItemName());
|
||||
this.setRemarks(menu.getRemarks());
|
||||
}
|
||||
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.jero.modules.compare.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SarFileCompareResultVO {
|
||||
|
||||
private String infoId;
|
||||
private String serialNumberLeft;
|
||||
private String fileNameLeft;
|
||||
private String serialNumberRight;
|
||||
private String fileNameRight;
|
||||
private List<SarFileCompareItemComVO> resList;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package com.jero.modules.compare.enums;
|
||||
|
||||
public enum ValidFlagEnum {
|
||||
VALID_TRUE(0, "有效"), VALID_FALSE(1, "无效");
|
||||
|
||||
private int value;
|
||||
private String lable;
|
||||
|
||||
private ValidFlagEnum(int value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
+1
@@ -2,6 +2,7 @@ package com.jero.modules.compare.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jero.modules.compare.entity.SarFileCompareItemComVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.compare.entity.SarFileCompareItemComment;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
+12
@@ -2,7 +2,13 @@ package com.jero.modules.compare.service;
|
||||
|
||||
import com.jero.modules.compare.entity.SarFileCompareItemComment;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.compare.entity.SarFileCompareResultVO;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款评论表
|
||||
@@ -58,4 +64,10 @@ public interface ISarFileCompareItemCommentService extends IService<SarFileCompa
|
||||
* @return
|
||||
*/
|
||||
List<SarFileCompareItemComment> queryList();
|
||||
|
||||
SarFileCompareResultVO queryCompareResult(String infoId);
|
||||
|
||||
void exportResXls(Map<String, Object> map,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request);
|
||||
}
|
||||
|
||||
+11
@@ -2,8 +2,11 @@ package com.jero.modules.compare.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.compare.entity.SarFileCompareItem;
|
||||
import com.jero.modules.compare.utils.CompareConst;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款表
|
||||
@@ -29,6 +32,12 @@ public interface ISarFileCompareItemService extends IService<SarFileCompareItem>
|
||||
*/
|
||||
void editById(SarFileCompareItem sarFileCompareItem);
|
||||
|
||||
/**
|
||||
* 标记被评论过
|
||||
* @param id
|
||||
*/
|
||||
void updateReviewedById(String id);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
@@ -61,4 +70,6 @@ public interface ISarFileCompareItemService extends IService<SarFileCompareItem>
|
||||
List<SarFileCompareItem> queryList();
|
||||
|
||||
List<SarFileCompareItem> queryListByInfoId(String infoId);
|
||||
|
||||
Map<String, SarFileCompareItem> queryMapByInfoId(String infoId);
|
||||
}
|
||||
|
||||
+26
-28
@@ -1,6 +1,5 @@
|
||||
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.*;
|
||||
import com.jero.modules.compare.mapper.SarFileCompareInfoMapper;
|
||||
@@ -8,6 +7,7 @@ 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.docTranslation.enums.ReleaseConditionEnum;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsEO;
|
||||
@@ -128,33 +128,40 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
SarFileCompareInfo sfcInfo = addStandCompareHis(leftStandard, rightStandard, remark);
|
||||
|
||||
List<SarFileSplitMenuEO> leftMenuEOList = sarFileSplitMenuEOService.queryByInfoId(leftStandard);
|
||||
Map<String, SarFileCompareMenu> leftMenuMap = wrapperMenuMap(leftMenuEOList, sfcInfo.getId(), "LEFT");
|
||||
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(), "RIGHT");
|
||||
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, "LEFT");
|
||||
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, "RIGHT");
|
||||
List<SarFileCompareItem> rightItemList = wrapperItemList(rightItemEOList, sfcInfo.getId(), rightMenuMap, CompareConst.POS_RIGHT);
|
||||
|
||||
if (!leftItemList.isEmpty() && !rightItemList.isEmpty()) {
|
||||
//双重循环找到相似度最高的条款做关联
|
||||
for (SarFileCompareItem leftItem : leftItemList) {
|
||||
String leftTxt = leftItem.getItemsText();
|
||||
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 (SarFileCompareItem rightItem : rightItemList) {
|
||||
String rightTxt = rightItem.getItemsText();
|
||||
for (int j = 0; j < rightItemList.size(); j++) {
|
||||
String rightTxt = rightItemList.get(j).getItemsText();
|
||||
if (null != rightTxt && !rightTxt.isEmpty()) {
|
||||
double similarity = CompHanLPUtils.findSimilarity(leftTxt.trim(), rightTxt.trim());
|
||||
//如果相似度超过0.6 并且该相似度比之前的相似度还高,那么该条款目前相似度最高
|
||||
if (similarity >= 0.6 && compareSimilarity < similarity) {
|
||||
compareSimilarity = similarity;
|
||||
leftItem.setTargetStand(rightItem.getItemsDisplayNum());
|
||||
rightItem.setTargetStand(leftItem.getItemsDisplayNum());
|
||||
leftItemList.get(i).setTargetStand(j);
|
||||
}
|
||||
}
|
||||
if (j >= rightItemList.size() - 1) {
|
||||
int ts = leftItemList.get(i).getTargetStand();
|
||||
if(ts > -1){
|
||||
rightItemList.get(ts).setTargetStand(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,22 +205,13 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
item.setItemsDisplayNum(menu.getDisplaySeq());
|
||||
}
|
||||
item.setLeftOrRight(leftOrRight);
|
||||
item.setReviewed(CompareConst.NO_REVIEWED);
|
||||
resList.add(item);
|
||||
}
|
||||
|
||||
Collections.sort(resList, Comparator.comparingInt(SarFileCompareItem::getItemsDisplayNum));
|
||||
return resList;
|
||||
}
|
||||
|
||||
private void copySarFileSplitMenu(String infoId, String cInfoId) {
|
||||
LambdaQueryWrapper<SarFileSplitMenuEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SarFileSplitMenuEO::getInfoId, infoId);
|
||||
List<SarFileSplitMenuEO> menuEOList = sarFileSplitMenuEOService.list(queryWrapper);
|
||||
List<SarFileCompareMenu> sfcMenuList = new ArrayList<>();
|
||||
for (SarFileSplitMenuEO menuEO : menuEOList) {
|
||||
SarFileCompareMenu sfcMenu = new SarFileCompareMenu();
|
||||
sfcMenu.setInfoId(cInfoId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存比对历史
|
||||
@@ -264,13 +262,13 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
List<SarFileCompareMenu> menuList = sarFileCompareMenuService.queryListByInfoId(id);
|
||||
for (SarFileCompareMenu menu : menuList) {
|
||||
if ("General catalogue".equals(menu.getName())) {
|
||||
if (menu.getLeftOrRight().equals("LEFT")) {
|
||||
if (menu.getLeftOrRight().equals(CompareConst.POS_LEFT)) {
|
||||
SarFileCompareMenuVo menuLeft = new SarFileCompareMenuVo(menu);
|
||||
menuLeft.setChildren(getMenuChildren(menuList, "LEFT", menuLeft.getMenuId()));
|
||||
menuLeft.setChildren(getMenuChildren(menuList, CompareConst.POS_LEFT, menuLeft.getMenuId()));
|
||||
sfVo.addMenuLeft(menuLeft);
|
||||
} else if (menu.getLeftOrRight().equals("RIGHT")) {
|
||||
} else if (menu.getLeftOrRight().equals(CompareConst.POS_RIGHT)) {
|
||||
SarFileCompareMenuVo menuRight = new SarFileCompareMenuVo(menu);
|
||||
menuRight.setChildren(getMenuChildren(menuList, "RIGHT", menuRight.getMenuId()));
|
||||
menuRight.setChildren(getMenuChildren(menuList, CompareConst.POS_RIGHT, menuRight.getMenuId()));
|
||||
sfVo.addMenuRight(menuRight);
|
||||
}
|
||||
}
|
||||
@@ -280,9 +278,9 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
}
|
||||
List<SarFileCompareItem> itemList = sarFileCompareItemService.queryListByInfoId(id);
|
||||
for (SarFileCompareItem item : itemList) {
|
||||
if (item.getLeftOrRight().equals("LEFT")) {
|
||||
if (item.getLeftOrRight().equals(CompareConst.POS_LEFT)) {
|
||||
sfVo.addTextLeft(item);
|
||||
} else if (item.getLeftOrRight().equals("RIGHT")) {
|
||||
} else if (item.getLeftOrRight().equals(CompareConst.POS_RIGHT)) {
|
||||
sfVo.addTextRight(item);
|
||||
}
|
||||
}
|
||||
|
||||
+155
-49
@@ -1,89 +1,195 @@
|
||||
package com.jero.modules.compare.service.impl;
|
||||
|
||||
import com.jero.modules.compare.entity.SarFileCompareItemComment;
|
||||
import com.jero.modules.compare.mapper.SarFileCompareItemCommentMapper;
|
||||
import com.jero.modules.compare.service.ISarFileCompareItemCommentService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.aliyuncs.utils.IOUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.compare.entity.*;
|
||||
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.system.util.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-05
|
||||
* @Date: 2022-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCompareItemCommentMapper, SarFileCompareItemComment> implements ISarFileCompareItemCommentService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Autowired
|
||||
private ISarFileCompareInfoService sarFileCompareInfoServiceImpl;
|
||||
|
||||
@Autowired
|
||||
private ISarFileCompareItemService SarFileCompareItemServiceImpl;
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
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
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareItemComment
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(SarFileCompareItemComment sarFileCompareItemComment) {
|
||||
Date now = new Date();
|
||||
Date now = new Date();
|
||||
sarFileCompareItemComment.setUpdateTime(now);
|
||||
saveOrUpdate(sarFileCompareItemComment);
|
||||
saveOrUpdate(sarFileCompareItemComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SarFileCompareItemComment queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SarFileCompareItemComment> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SarFileCompareResultVO queryCompareResult(String infoId) {
|
||||
SarFileCompareResultVO resultVO = new SarFileCompareResultVO();
|
||||
SarFileCompareInfo sfcInfo = sarFileCompareInfoServiceImpl.queryById(infoId);
|
||||
resultVO.setInfoId(infoId);
|
||||
resultVO.setSerialNumberLeft(sfcInfo.getSerialNumberLeft());
|
||||
resultVO.setFileNameLeft(sfcInfo.getFileNameLeft());
|
||||
resultVO.setSerialNumberRight(sfcInfo.getSerialNumberRight());
|
||||
resultVO.setFileNameRight(sfcInfo.getFileNameRight());
|
||||
|
||||
|
||||
List<SarFileCompareItemComment> list = queryListByInfoId(infoId);
|
||||
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 (!StringUtils.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 (!StringUtils.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) {
|
||||
LambdaQueryWrapper<SarFileCompareItemComment> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SarFileCompareItemComment::getInfoId, infoId);
|
||||
queryWrapper.orderBy(true, true, SarFileCompareItemComment::getCreateTime);
|
||||
List<SarFileCompareItemComment> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportResXls(Map<String, Object> map, HttpServletResponse response, HttpServletRequest request) {
|
||||
String cut = (String) map.get("cut");
|
||||
OutputStream os = null;
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
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");
|
||||
//创建工作表对象
|
||||
Sheet sheet = workbook.createSheet();
|
||||
// 创建头部
|
||||
//String header = StringUtils.join(headerFieldList, ",");
|
||||
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
throw new JeroBootException("下载文件失败");
|
||||
} else {
|
||||
throw new JeroBootException("Failed to download file");
|
||||
}
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+79
-54
@@ -1,31 +1,35 @@
|
||||
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.entity.SarFileCompareMenu;
|
||||
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.system.util.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 文档对比信息条款表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-02
|
||||
* @Date: 2022-08-02
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SarFileCompareItemServiceImpl extends ServiceImpl<SarFileCompareItemMapper, SarFileCompareItem> implements ISarFileCompareItemService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(SarFileCompareItem sarFileCompareItem) {
|
||||
Date now = new Date();
|
||||
sarFileCompareItem.setCreateTime(now);
|
||||
@@ -33,68 +37,89 @@ public class SarFileCompareItemServiceImpl extends ServiceImpl<SarFileCompareIte
|
||||
save(sarFileCompareItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sarFileCompareItem
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(SarFileCompareItem sarFileCompareItem) {
|
||||
Date now = new Date();
|
||||
Date now = new Date();
|
||||
sarFileCompareItem.setUpdateTime(now);
|
||||
saveOrUpdate(sarFileCompareItem);
|
||||
saveOrUpdate(sarFileCompareItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Override
|
||||
public void updateReviewedById(String id) {
|
||||
if (!StringUtils.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
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SarFileCompareItem queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
* 列表查询
|
||||
*
|
||||
* @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 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;
|
||||
}
|
||||
}
|
||||
|
||||
+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;
|
||||
}
|
||||
+3
-3
@@ -130,12 +130,12 @@ public class ExtRepoDataServiceImpl extends ServiceImpl<ExtRepoDataMapper, ExtRe
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param folserId
|
||||
* @param folderId
|
||||
* @return
|
||||
*/
|
||||
public List<ExtRepoData> queryByFolder(String folserId) {
|
||||
public List<ExtRepoData> queryByFolder(String folderId) {
|
||||
LambdaQueryWrapper<ExtRepoData> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ExtRepoData::getSupFolder, folserId);
|
||||
queryWrapper.eq(ExtRepoData::getSupFolder, folderId);
|
||||
List<ExtRepoData> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
-1
@@ -269,7 +269,6 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
||||
* @return
|
||||
*/
|
||||
private List<ERFTreeData> getSubFolder(String supId, List<ExtRepoFolder> list, int level) throws Exception {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
List<ERFTreeData> resList = new ArrayList<ERFTreeData>();
|
||||
for (ExtRepoFolder erf : list) {
|
||||
if (supId.equals(erf.getSupFolder())) {
|
||||
|
||||
Reference in New Issue
Block a user