feat(文档拆分): 列表页查询、拆分已入库文本
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ public enum TableEnum {
|
||||
BUSS_DOCUMENT_LIBRARY("buss_document_library"),
|
||||
OCR_RECORD("ocr_record"),
|
||||
FILE_SPLIT("sar_file_split_info"),
|
||||
FILE_SPLIT_ITEMS("sar_file_split_items"),
|
||||
FILE_SPLIT_ITEMS("laws_document_split"),
|
||||
TAG("onl_cgform_tag"),
|
||||
TAG_AREA("onl_cgform_area"),
|
||||
ONL_CGFORM_COLLECTION("onl_cgform_collection"),
|
||||
|
||||
+34
-19
@@ -1,11 +1,11 @@
|
||||
package com.jero.modules.split.controller;
|
||||
|
||||
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.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.LanguageEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.util.LineHumpUtil;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
@@ -15,6 +15,8 @@ import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.page.SarFileSplitInfoEOPage;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.split.vo.SplitFilePageInfoParam;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -25,12 +27,12 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
@@ -53,11 +55,14 @@ public class SarFileSplitInfoController extends JeroController<SarFileSplitInfoE
|
||||
@Autowired
|
||||
private IOSSFileService ossFileService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @param sarFileSplitInfoEOPage
|
||||
* @return
|
||||
*/
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @param sarFileSplitInfoEOPage
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("docComparsion:initiate:search")
|
||||
@AutoLog(value = "文档拆分表-分页列表查询Y")
|
||||
@ApiOperation(value="文档拆分表-分页列表查询", notes="文档拆分表-分页列表查询")
|
||||
@@ -65,11 +70,11 @@ public class SarFileSplitInfoController extends JeroController<SarFileSplitInfoE
|
||||
// @RequiresPermissions("split:sarFileSplitInfo:page")
|
||||
public Result<?> queryPageList(SarFileSplitInfoEOPage sarFileSplitInfoEOPage) {
|
||||
QueryWrapper<SarFileSplitInfoEO> queryWrapper = new QueryWrapper<>();
|
||||
if(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getSerialNumber())){
|
||||
sarFileSplitInfoEOPage.setSerialNumber(sarFileSplitInfoEOPage.getSerialNumber().replace("%","\\%"));
|
||||
if(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getSerialNumberOrName())){
|
||||
sarFileSplitInfoEOPage.setSerialNumberOrName(sarFileSplitInfoEOPage.getSerialNumberOrName().replace("%","\\%"));
|
||||
}
|
||||
if(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getTitle())){
|
||||
sarFileSplitInfoEOPage.setTitle(sarFileSplitInfoEOPage.getTitle().replace("%","\\%"));
|
||||
if(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getAuthor())){
|
||||
sarFileSplitInfoEOPage.setAuthor(sarFileSplitInfoEOPage.getAuthor().replace("%","\\%"));
|
||||
}
|
||||
if(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getFileId())){//判断是不是以及传回文档库
|
||||
queryWrapper.lambda().isNotNull(SarFileSplitInfoEO::getFileId);
|
||||
@@ -78,13 +83,23 @@ public class SarFileSplitInfoController extends JeroController<SarFileSplitInfoE
|
||||
sarFileSplitInfoEOPage.setOrderByField(LineHumpUtil.humpToLine2(sarFileSplitInfoEOPage.getOrderByField()));
|
||||
}
|
||||
|
||||
queryWrapper.lambda().like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getSerialNumber()), SarFileSplitInfoEO::getSerialNumber, sarFileSplitInfoEOPage.getSerialNumber())
|
||||
.like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getTitle()) && LanguageEnum.CN.getValue().equals(sarFileSplitInfoEOPage.getCut()), SarFileSplitInfoEO::getTitle, sarFileSplitInfoEOPage.getTitle())
|
||||
.like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getTitle()) && LanguageEnum.EN.getValue().equals(sarFileSplitInfoEOPage.getCut()), SarFileSplitInfoEO::getTitleEn, sarFileSplitInfoEOPage.getTitle());
|
||||
|
||||
// 标准编号/标准名称
|
||||
if (StringUtils.isNotBlank(sarFileSplitInfoEOPage.getSerialNumberOrName())){
|
||||
queryWrapper.and(qw ->
|
||||
qw.lambda().like(SarFileSplitInfoEO::getSerialNumber, sarFileSplitInfoEOPage.getSerialNumberOrName())
|
||||
.or().like(SarFileSplitInfoEO::getTitle, sarFileSplitInfoEOPage.getSerialNumberOrName()));
|
||||
}
|
||||
queryWrapper.lambda().eq(StringUtils.isNotBlank(sarFileSplitInfoEOPage.getSplitStatus()), SarFileSplitInfoEO::getSplitStatus, sarFileSplitInfoEOPage.getSplitStatus());
|
||||
if (StringUtils.isNotBlank(sarFileSplitInfoEOPage.getAuthor())){
|
||||
List<SysUser> list = sysUserService.list(new LambdaQueryWrapper<SysUser>().like(SysUser::getRealname, sarFileSplitInfoEOPage.getAuthor()));
|
||||
if (!list.isEmpty()){
|
||||
List<String> userIds = list.stream().map(SysUser::getId).collect(Collectors.toList());
|
||||
queryWrapper.lambda().in(SarFileSplitInfoEO::getAuthor, userIds);
|
||||
}
|
||||
}
|
||||
queryWrapper.orderBy(StringUtils.isNotBlank(sarFileSplitInfoEOPage.getOrderByField()), "1".equals(sarFileSplitInfoEOPage.getOrderBy())?true:false, sarFileSplitInfoEOPage.getOrderByField())
|
||||
.orderBy(StringUtils.isBlank(sarFileSplitInfoEOPage.getOrderByField()), false, "create_time");
|
||||
Page<SarFileSplitInfoEO> page = new Page<SarFileSplitInfoEO>(sarFileSplitInfoEOPage.getPageNo(), sarFileSplitInfoEOPage.getPageSize());
|
||||
Page<SarFileSplitInfoEO> page = new Page<>(sarFileSplitInfoEOPage.getPageNo(), sarFileSplitInfoEOPage.getPageSize());
|
||||
IPage<SarFileSplitInfoEO> pageList = sarFileSplitInfoService.page(page, queryWrapper);
|
||||
List<SarFileSplitInfoEO> rows = pageList.getRecords();
|
||||
sarFileSplitInfoService.dataProcessing(sarFileSplitInfoEOPage.getCut(), rows);
|
||||
@@ -213,9 +228,9 @@ public class SarFileSplitInfoController extends JeroController<SarFileSplitInfoE
|
||||
@GetMapping(value = "/splitFilePageInfo")
|
||||
// @RequiresPermissions("split:sarFileSplitInfo:splitFile")
|
||||
public Result<IPage<OSSFile>> splitFilePageInfo(SplitFilePageInfoParam param,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
Page<OSSFile> page = new Page<>(pageNo,pageSize);
|
||||
Page<OSSFile> ossFilePage = sarFileSplitInfoService.splitFilePageInfoList(page, request, param);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -85,10 +86,20 @@ public class SarFileSplitInfoEO implements Serializable {
|
||||
@ApiModelProperty(value = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
/**拆分状态(1:编辑中 2:已发布)*/
|
||||
@Excel(name = "拆分状态", width = 15)
|
||||
@ApiModelProperty(value = "拆分状态(1:编辑中 2:已发布)")
|
||||
@Dict(dicCode = "split_status")
|
||||
private String splitStatus;
|
||||
|
||||
/**编辑人*/
|
||||
@Excel(name = "编辑人", width = 15)
|
||||
@ApiModelProperty(value = "编辑人")
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname")
|
||||
private String author;
|
||||
|
||||
/**拆分结果*/
|
||||
@Excel(name = "拆分结果", width = 15, dicCode = "split_result")
|
||||
// @Dict(dicCode = "split_result")
|
||||
@ApiModelProperty(value = "拆分结果")
|
||||
@Excel(name = "拆分结果", width = 15)
|
||||
private String splitResult;
|
||||
|
||||
/**文件id*/
|
||||
@@ -101,6 +112,11 @@ public class SarFileSplitInfoEO implements Serializable {
|
||||
@ApiModelProperty(value = "文档库关联id")
|
||||
private String connectId;
|
||||
|
||||
/**标准关联id*/
|
||||
@Excel(name = "标准关联id", width = 15)
|
||||
@ApiModelProperty(value = "标准关联id")
|
||||
private String standardId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String flag;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.jero.modules.split.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -10,7 +9,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>SAR_FILE_SPLIT_ITEMS SarFileSplitItemsEOEntity<br>
|
||||
* <b>功能:</b>laws_document_split SarFileSplitItemsEOEntity<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2020-01-03 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
|
||||
+27
-26
@@ -4,48 +4,48 @@
|
||||
|
||||
<!--新增-->
|
||||
<insert id="insertInfo">
|
||||
insert into sar_file_split_items(${insertField})
|
||||
insert into laws_document_split(${insertField})
|
||||
values (${insertValue})
|
||||
</insert>
|
||||
|
||||
<!--分页-->
|
||||
<select id="getInfoPage" resultType="java.util.LinkedHashMap">
|
||||
select ${field}
|
||||
from sar_file_split_items left join SAR_FILE_SPLIT_MENU on SAR_FILE_SPLIT_ITEMS.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
from laws_document_split left join SAR_FILE_SPLIT_MENU on laws_document_split.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
${condition}
|
||||
</select>
|
||||
|
||||
<!--列表-->
|
||||
<select id="getInfoList" resultType="com.jero.modules.split.entity.SarFileSplitItemsEO">
|
||||
select ${field}
|
||||
from sar_file_split_items
|
||||
from laws_document_split
|
||||
${condition}
|
||||
</select>
|
||||
|
||||
<!--列表-->
|
||||
<select id="getInfoCount" resultType="integer">
|
||||
select count(1)
|
||||
from sar_file_split_items
|
||||
from laws_document_split
|
||||
${condition}
|
||||
</select>
|
||||
|
||||
<!--根据id查询-->
|
||||
<select id="selectByPrimaryKey" resultType="java.util.LinkedHashMap">
|
||||
select *
|
||||
from sar_file_split_items
|
||||
from laws_document_split
|
||||
where id = #{value}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from sar_file_split_items
|
||||
delete from laws_document_split
|
||||
where id = #{value}
|
||||
</delete>
|
||||
|
||||
<!-- 通过menuid 查询目录下所有的条目 -->
|
||||
<select id="queryItemsByMenuId" resultType="java.util.LinkedHashMap" parameterType="java.lang.String">
|
||||
select SAR_FILE_SPLIT_ITEMS.* from SAR_FILE_SPLIT_ITEMS
|
||||
left join SAR_FILE_SPLIT_MENU on SAR_FILE_SPLIT_ITEMS.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
where SAR_FILE_SPLIT_ITEMS.menu_id in (
|
||||
select laws_document_split.* from laws_document_split
|
||||
left join SAR_FILE_SPLIT_MENU on laws_document_split.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
where laws_document_split.menu_id in (
|
||||
SELECT m.id
|
||||
FROM SAR_FILE_SPLIT_MENU m,( SELECT ( @nodes := querySplitMenuChildren (#{menuId})) AS pids ) t
|
||||
WHERE
|
||||
@@ -56,7 +56,7 @@
|
||||
</select>
|
||||
|
||||
<select id="queryByItemsIds" resultType="java.util.LinkedHashMap" parameterType="java.util.List">
|
||||
select menu_id from SAR_FILE_SPLIT_ITEMS
|
||||
select menu_id from laws_document_split
|
||||
where id in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
@@ -65,19 +65,19 @@
|
||||
</select>
|
||||
|
||||
<select id="queryItemByIds" resultType="java.util.LinkedHashMap" parameterType="java.util.List">
|
||||
select SAR_FILE_SPLIT_ITEMS.* from SAR_FILE_SPLIT_ITEMS
|
||||
left join SAR_FILE_SPLIT_MENU on SAR_FILE_SPLIT_ITEMS.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
where SAR_FILE_SPLIT_ITEMS.id in
|
||||
select laws_document_split.* from laws_document_split
|
||||
left join SAR_FILE_SPLIT_MENU on laws_document_split.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
where laws_document_split.id in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by SAR_FILE_SPLIT_MENU.display_seq ASC
|
||||
</select>
|
||||
|
||||
<!--group by SAR_FILE_SPLIT_ITEMS.menu_id-->
|
||||
<!--group by laws_document_split.menu_id-->
|
||||
|
||||
<delete id="deleteByItemsIdList" parameterType="java.util.List">
|
||||
delete from SAR_FILE_SPLIT_ITEMS
|
||||
delete from laws_document_split
|
||||
where id in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
@@ -85,12 +85,12 @@
|
||||
</delete>
|
||||
|
||||
<select id="queryByOrdersForExport" resultType="java.util.LinkedHashMap">
|
||||
select sar_file_split_items.id,${field}
|
||||
from sar_file_split_items
|
||||
left join SAR_FILE_SPLIT_MENU on sar_file_split_items.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
select laws_document_split.id,${field}
|
||||
from laws_document_split
|
||||
left join SAR_FILE_SPLIT_MENU on laws_document_split.MENU_ID = SAR_FILE_SPLIT_MENU.id
|
||||
${condition}
|
||||
<if test="idList != null">
|
||||
and sar_file_split_items.id in
|
||||
and laws_document_split.id in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
@@ -99,7 +99,7 @@
|
||||
</select>
|
||||
|
||||
<delete id="deleteByMenuIds" parameterType="java.util.List">
|
||||
delete from sar_file_split_items
|
||||
delete from laws_document_split
|
||||
where menu_id in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
@@ -109,10 +109,10 @@
|
||||
<!-- 批量插入接口 -->
|
||||
<insert id="insertForeach" parameterType="java.util.List">
|
||||
|
||||
insert into sar_file_split_items
|
||||
(id, info_id, items_num, items_name, menu_id,
|
||||
creation_user, creation_time, modify_time,
|
||||
modify_user, iterms_conditions,zhan3_shi4_shun4_xu4)
|
||||
insert into laws_document_split
|
||||
(id, info_id, item_num, item_title, menu_id,
|
||||
create_by, create_time, update_time,
|
||||
update_by, Item_content,sort_number)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">(
|
||||
#{item.id, jdbcType=VARCHAR}, #{item.infoId, jdbcType=VARCHAR}, #{item.itemsNum, jdbcType=VARCHAR},
|
||||
@@ -124,15 +124,16 @@
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--根据infoid查询-->
|
||||
<select id="selectByInfoId" resultType="com.jero.modules.split.entity.SarFileSplitItemsEO">
|
||||
select *
|
||||
from sar_file_split_items
|
||||
from laws_document_split
|
||||
where info_id = #{value}
|
||||
</select>
|
||||
|
||||
<update id="updateSarFileSplitItemsInfo" parameterType="java.util.List">
|
||||
update sar_file_split_items
|
||||
update laws_document_split
|
||||
<set >
|
||||
<if test="sarFileSplitItemsEO.zhan3Shi4Shun4Xu4 != null" >
|
||||
zhan3_shi4_shun4_xu4 = #{sarFileSplitItemsEO.zhan3Shi4Shun4Xu4},
|
||||
|
||||
+6
-6
@@ -244,9 +244,9 @@
|
||||
<delete id="deleteValByInfoIds" parameterType="java.lang.String">
|
||||
delete from SAR_FILE_SPLIT_ITEMS_VAL
|
||||
where EXISTS (
|
||||
select 1 from SAR_FILE_SPLIT_ITEMS
|
||||
where SAR_FILE_SPLIT_ITEMS_VAL.ITEM_ID=SAR_FILE_SPLIT_ITEMS.id
|
||||
and SAR_FILE_SPLIT_ITEMS.INFO_ID in
|
||||
select 1 from laws_document_split
|
||||
where SAR_FILE_SPLIT_ITEMS_VAL.ITEM_ID=laws_document_split.id
|
||||
and laws_document_split.INFO_ID in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
@@ -292,9 +292,9 @@
|
||||
<delete id="deleteValByMenuIds" parameterType="java.lang.String">
|
||||
delete from SAR_FILE_SPLIT_ITEMS_VAL
|
||||
where EXISTS (
|
||||
select 1 from SAR_FILE_SPLIT_ITEMS
|
||||
where SAR_FILE_SPLIT_ITEMS_VAL.ITEM_ID=SAR_FILE_SPLIT_ITEMS.id
|
||||
and SAR_FILE_SPLIT_ITEMS.MENU_ID in
|
||||
select 1 from laws_document_split
|
||||
where SAR_FILE_SPLIT_ITEMS_VAL.ITEM_ID=laws_document_split.id
|
||||
and laws_document_split.MENU_ID in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.split.page;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -31,6 +32,10 @@ public class SarFileSplitInfoEOPage {
|
||||
/**编号*/
|
||||
private String serialNumber;
|
||||
|
||||
/**标准编号/标准名称*/
|
||||
@ApiModelProperty(value = "标准编号/标准名称")
|
||||
private String serialNumberOrName;
|
||||
|
||||
/**标题*/
|
||||
private String title;
|
||||
|
||||
@@ -46,6 +51,14 @@ public class SarFileSplitInfoEOPage {
|
||||
/**文件id*/
|
||||
private String fileId;
|
||||
|
||||
/**拆分状态*/
|
||||
@ApiModelProperty(value = "拆分状态")
|
||||
private String splitStatus;
|
||||
|
||||
/**编辑人*/
|
||||
@ApiModelProperty(value = "编辑人")
|
||||
private String author;
|
||||
|
||||
//分页
|
||||
private Integer pageNo;
|
||||
private Integer pageSize;
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>SAR_FILE_SPLIT_ITEMS SarFileSplitItemsEOPage<br>
|
||||
* <b>功能:</b>laws_document_split SarFileSplitItemsEOPage<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2020-01-03 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
|
||||
+1
-7
@@ -1,8 +1,6 @@
|
||||
package com.jero.modules.split.service.impl;
|
||||
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.itextpdf.text.ListLabel;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.MinioUtil;
|
||||
@@ -39,14 +37,9 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -401,6 +394,7 @@ public class FileSpiltService {
|
||||
sarFileSplitMenuEOMapper.insertForeach(treeList);
|
||||
for (int i = 0; i < messageList.size(); i++) {
|
||||
messageList.get(i).setZhan3Shi4Shun4Xu4(String.valueOf(i+1));
|
||||
messageList.get(i).setInfoId(sarFileSplitInfoEO.getId());
|
||||
}
|
||||
iSarFileSplitItemsEOService.insertForeach(messageList);
|
||||
iSarFileSplitItemsValEOService.insertForeach(itemValList);
|
||||
|
||||
+19
-19
@@ -542,7 +542,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
int pageNo = Integer.parseInt((String) parameter.get("pageNo"));
|
||||
int pageSize = Integer.parseInt((String) parameter.get("pageSize"));
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
IPage infoPage = dao.getInfoPage(page, " " + "sar_file_split_menu.display_seq,sar_file_split_items.*", condition);
|
||||
IPage infoPage = dao.getInfoPage(page, " " + "sar_file_split_menu.display_seq,laws_document_split.*", condition);
|
||||
|
||||
//树形数据字典
|
||||
List<SysCategory> categoryList = sysCategoryService.list();
|
||||
@@ -726,7 +726,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
if ("info_id".equals(key)) {
|
||||
String value = (String) entry.getValue();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
conditionSb.append(" and sar_file_split_items." + key + " ='" + value +"'");
|
||||
conditionSb.append(" and laws_document_split." + key + " ='" + value +"'");
|
||||
}
|
||||
} else if ("menu_id".equals(key)) {
|
||||
String value = (String) entry.getValue();
|
||||
@@ -741,7 +741,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
// .map(SarFileSplitMenuEO::getId)
|
||||
// .collect(Collectors.toList());
|
||||
String menuIds = StringUtils.join(menuIdList,"','");
|
||||
conditionSb.append(" and sar_file_split_items." + key + " in('" + menuIds + "')");
|
||||
conditionSb.append(" and laws_document_split." + key + " in('" + menuIds + "')");
|
||||
}
|
||||
} else if (!"pageNo".equals(key) && !"pageSize".equals(key)) {
|
||||
if (ObjectUtil.isNotEmpty(entry.getValue())) {
|
||||
@@ -756,7 +756,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
if(value.contains("%")){
|
||||
value = value.replace("%", "/%");
|
||||
}
|
||||
conditionSb.append(" and sar_file_split_items." + key + " like concat(concat('%','" + value + "'),'%') ESCAPE '/'");
|
||||
conditionSb.append(" and laws_document_split." + key + " like concat(concat('%','" + value + "'),'%') ESCAPE '/'");
|
||||
// conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%')");
|
||||
} else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldType)
|
||||
|| FieldTypeEnum.PULL_MORE.getValue().equals(fieldType)
|
||||
@@ -766,24 +766,24 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
StringBuilder condition = new StringBuilder();
|
||||
for (String valueTemp : value.split(",")) {
|
||||
valueSb.append("'" + valueTemp + "',");
|
||||
condition.append(" or sar_file_split_items." + key + " like concat(concat('%','" + valueTemp + "'),'%')");
|
||||
condition.append(" or laws_document_split." + key + " like concat(concat('%','" + valueTemp + "'),'%')");
|
||||
}
|
||||
condition.append(")");
|
||||
String substring = valueSb.substring(0, valueSb.length() - 1);
|
||||
//下拉单选或下拉多选
|
||||
conditionSb.append(" and (sar_file_split_items." + key + " in(" + substring + ")" + condition.toString());
|
||||
conditionSb.append(" and (laws_document_split." + key + " in(" + substring + ")" + condition.toString());
|
||||
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) {
|
||||
String value = (String) entry.getValue();
|
||||
//日期(区分单日期还时间范围)
|
||||
if (value.contains(",")) {
|
||||
conditionSb.append(" and " + "date_format(sar_file_split_items." + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'"
|
||||
+ " and " + "date_format(sar_file_split_items." + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'");
|
||||
conditionSb.append(" and " + "date_format(laws_document_split." + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'"
|
||||
+ " and " + "date_format(laws_document_split." + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'");
|
||||
} else {
|
||||
conditionSb.append(" and " + "date_format(sar_file_split_items." + key + ",'%Y-%m-%d') = '" + value + "'");
|
||||
conditionSb.append(" and " + "date_format(laws_document_split." + key + ",'%Y-%m-%d') = '" + value + "'");
|
||||
}
|
||||
} else if (FieldTypeEnum.TEXT_NUMBER.getValue().equals(fieldType)) {
|
||||
Double value = Double.valueOf(entry.getValue().toString());
|
||||
conditionSb.append(" and sar_file_split_items." + key + " =" + value);
|
||||
conditionSb.append(" and laws_document_split." + key + " =" + value);
|
||||
} else if (FieldTypeEnum.PERSON.getValue().equals(fieldType)) {
|
||||
String value = (String) entry.getValue();
|
||||
if(value.contains("%")){
|
||||
@@ -799,13 +799,13 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
StringBuilder condition = new StringBuilder();
|
||||
for (String valueTemp : userIdList) {
|
||||
valueSb.append("'" + valueTemp + "',");
|
||||
condition.append(" or sar_file_split_items." + key + " like concat(concat('%','" + valueTemp + "'),'%')");
|
||||
condition.append(" or laws_document_split." + key + " like concat(concat('%','" + valueTemp + "'),'%')");
|
||||
}
|
||||
condition.append(")");
|
||||
String substring = valueSb.substring(0, valueSb.length() - 1);
|
||||
conditionSb.append(" and (sar_file_split_items." + key + " in(" + substring + ")" + condition.toString());
|
||||
conditionSb.append(" and (laws_document_split." + key + " in(" + substring + ")" + condition.toString());
|
||||
} else {
|
||||
conditionSb.append(" and sar_file_split_items." + key + " like concat(concat('%','" + value + "'),'%')");
|
||||
conditionSb.append(" and laws_document_split." + key + " like concat(concat('%','" + value + "'),'%')");
|
||||
}
|
||||
|
||||
} else if (FieldTypeEnum.STANDARD.getValue().equals(fieldType)) {
|
||||
@@ -819,13 +819,13 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
StringBuilder condition = new StringBuilder();
|
||||
for (String valueTemp : idList) {
|
||||
valueSb.append("'" + valueTemp + "',");
|
||||
condition.append(" or sar_file_split_items." + key + " like concat(concat('%','" + valueTemp + "'),'%')");
|
||||
condition.append(" or laws_document_split." + key + " like concat(concat('%','" + valueTemp + "'),'%')");
|
||||
}
|
||||
condition.append(")");
|
||||
String substring = valueSb.substring(0, valueSb.length() - 1);
|
||||
conditionSb.append(" and (sar_file_split_items." + key + " in(" + substring + ")" + condition.toString());
|
||||
conditionSb.append(" and (laws_document_split." + key + " in(" + substring + ")" + condition.toString());
|
||||
} else {
|
||||
conditionSb.append(" and sar_file_split_items." + key + " like concat(concat('%','" + value + "'),'%')");
|
||||
conditionSb.append(" and laws_document_split." + key + " like concat(concat('%','" + value + "'),'%')");
|
||||
}
|
||||
} else {
|
||||
// 文本框,多日期
|
||||
@@ -833,7 +833,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
if(value.contains("%")){
|
||||
value = value.replace("%", "/%");
|
||||
}
|
||||
conditionSb.append(" and sar_file_split_items." + key + " like concat(concat('%','" + value + "'),'%')");
|
||||
conditionSb.append(" and laws_document_split." + key + " like concat(concat('%','" + value + "'),'%')");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -842,11 +842,11 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
//处理列表表头排序
|
||||
if("page".equals(type)) {
|
||||
conditionSb.append(" order by SAR_FILE_SPLIT_MENU.display_seq asc, zhan3_shi4_shun4_xu4 is null, zhan3_shi4_shun4_xu4 asc"); // 默认排序
|
||||
conditionSb.append(" order by SAR_FILE_SPLIT_MENU.display_seq asc, sort_number is null, sort_number asc"); // 默认排序
|
||||
|
||||
// TODO 处理空值排最后
|
||||
if (StringUtils.isNotBlank((String) parameter.get("orderByField"))) {
|
||||
conditionSb.append(", sar_file_split_items." + (String) parameter.get("orderByField"));
|
||||
conditionSb.append(", laws_document_split." + (String) parameter.get("orderByField"));
|
||||
if ("1".equals((String) parameter.get("orderBy"))) {
|
||||
conditionSb.append(" asc");//正序
|
||||
} else if ("2".equals((String) parameter.get("orderBy"))) {
|
||||
|
||||
+32
-5
@@ -11,6 +11,7 @@ import com.jero.common.constant.enums.ModuleEnum;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.LineHumpUtil;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
@@ -25,6 +26,7 @@ import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
import com.jero.modules.split.enums.SplitEnum;
|
||||
import com.jero.modules.split.enums.SplitFileTypeTypeEnum;
|
||||
import com.jero.modules.split.mapper.SarFileSplitInfoMapper;
|
||||
import com.jero.modules.split.mapper.SarFileSplitMenuEOMapper;
|
||||
@@ -35,6 +37,7 @@ import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import com.jero.modules.system.service.ISysDictService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
@@ -88,9 +91,19 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
|
||||
*/
|
||||
@Override
|
||||
public void add(SarFileSplitInfoEO sarFileSplitInfoEO) {
|
||||
// 唯一校验
|
||||
uniqueCheck(sarFileSplitInfoEO);
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
Date now = new Date();
|
||||
//保存拆分数据
|
||||
sarFileSplitInfoEO.setSplitResult("成功"); // TODO 这块之后可能不会用到
|
||||
String infoId = UUID.randomUUID().toString().replace("-", "");
|
||||
sarFileSplitInfoEO.setId(infoId);
|
||||
sarFileSplitInfoEO.setSplitResult("成功");
|
||||
sarFileSplitInfoEO.setSplitStatus(SplitEnum.SPLIT_STATUS1.getValue());
|
||||
sarFileSplitInfoEO.setAuthor(sysUser.getId());
|
||||
sarFileSplitInfoEO.setCreateTime(now);
|
||||
sarFileSplitInfoEO.setUpdateTime(now);
|
||||
save(sarFileSplitInfoEO);
|
||||
|
||||
/*SplitFileTypeTypeEnum enumByValue = SplitFileTypeTypeEnum.getEnumByValue(sarFileSplitInfoEO.getFileGroup());
|
||||
@@ -123,6 +136,20 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
|
||||
// sarFileSplitMenuEOMapper.insertSelective(sarFileSplitMenuEO);
|
||||
}
|
||||
|
||||
private void uniqueCheck(SarFileSplitInfoEO sarFileSplitInfoEO) {
|
||||
// 文件状态 + 标准号唯一,每个文件状态的标准只能拆分一次
|
||||
int count = count(new QueryWrapper<SarFileSplitInfoEO>().lambda()
|
||||
.eq(SarFileSplitInfoEO::getFileType, sarFileSplitInfoEO.getFileType())
|
||||
.eq(SarFileSplitInfoEO::getSerialNumber, sarFileSplitInfoEO.getSerialNumber()));
|
||||
if(count > 0){
|
||||
if(LanguageEnum.CN.equals(MessageUtils.getLanguage())) {
|
||||
throw new JeroBootException("不可重复拆分文件状态加标准号相同的数据!");
|
||||
}else{
|
||||
throw new JeroBootException("Non-repeatable split file status plus standard number the same data!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
@@ -259,10 +286,10 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
|
||||
}
|
||||
splitInfoEO.setFileType(fileType);
|
||||
// 处理文档库id字段 根据编号和标题查询
|
||||
List<Map<String, Object>> bussDocumentLibraryEOList = bussDocumentLibraryEOService.getListBySerialNumber(splitInfoEO.getSerialNumber());
|
||||
if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList)) {
|
||||
splitInfoEO.setDocumentId(bussDocumentLibraryEOList.get(0).get("id").toString());
|
||||
}
|
||||
// List<Map<String, Object>> bussDocumentLibraryEOList = bussDocumentLibraryEOService.getListBySerialNumber(splitInfoEO.getSerialNumber());
|
||||
// if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList)) {
|
||||
// splitInfoEO.setDocumentId(bussDocumentLibraryEOList.get(0).get("id").toString());
|
||||
// }
|
||||
if(StringUtils.isNotEmpty(splitInfoEO.getFileId())) {
|
||||
splitInfoEO.setFlag("1");
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user