文档拆分模块。
This commit is contained in:
+3
-2
@@ -176,11 +176,12 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
|
||||
// 将文件上传至腾讯云 cos
|
||||
String upload = MinioUtil.upload(mf, "/" + uploadCospath);
|
||||
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String userId = "";
|
||||
//存入文件表
|
||||
oSSFile.setFileName(orgName);
|
||||
oSSFile.setId(UuidUtils.getUUID());
|
||||
oSSFile.setCreateBy(loginUser.getUsername());
|
||||
oSSFile.setCreateBy(userId);
|
||||
oSSFile.setCreateTime(new Date());
|
||||
this.save(oSSFile);
|
||||
// 文件路径做特殊处理
|
||||
|
||||
+2
-2
@@ -206,8 +206,8 @@ public class DocumentSplitController {
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
List<String> list = Arrays.asList(map.getIds().split(","));
|
||||
documentSplitService.isHorizontalOverstep(map.getIds());
|
||||
documentSplitService.checkOutOperation(list);
|
||||
// documentSplitService.isHorizontalOverstep(map.getIds());
|
||||
// documentSplitService.checkOutOperation(list);
|
||||
sarFileSplitInfoService.deleteByIds(list);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.SUCCESSFULLY_DELETED_IN_BULK));
|
||||
}
|
||||
|
||||
+4
-4
@@ -40,9 +40,9 @@ public abstract class AbstractConditionBase {
|
||||
*/
|
||||
public String getUpdateByAndUpdateTime() {
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// return " update_by = " + "'" + sysUser.getUsername() + "'" + "," +
|
||||
// "update_time = " + FieldCommon.STR_TO_DATE_PREFIX + dateFormat.format(new Date()) + "','%Y-%m-%d %H:%i:%s')";
|
||||
return "";
|
||||
String userId = "";
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
return " update_by = " + "'" + userId + "'" + "," +
|
||||
"update_time = " + "str_to_date('" + dateFormat.format(new Date()) + "','%Y-%m-%d %H:%i:%s')";
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -45,10 +45,10 @@ public interface DocumentSplitMapper {
|
||||
/**
|
||||
* 文档拆分详情-列表查询
|
||||
* @param selectColumn
|
||||
* @param selectCondition
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> queryDocumentSplitDetail(@Param("selectColumn") String selectColumn, @Param("selectCondition") String selectCondition);
|
||||
List<Map<String, Object>> queryDocumentSplitDetail(@Param("selectColumn") String selectColumn, @Param("params") Map<String,Object> params);
|
||||
|
||||
/**
|
||||
* 文档拆分详情-编辑
|
||||
|
||||
+14
-37
@@ -184,50 +184,27 @@
|
||||
<if test="params.menu_id != null" >
|
||||
and lds.menu_id = #{params.menu_id}
|
||||
</if>
|
||||
<!--<if test="standNumber != null" >
|
||||
and ncl.STAND_NUMBER like concat(concat('%', #{standNumber}),'%')
|
||||
<if test="params.item_num != null" >
|
||||
and lds.item_num like concat(concat('%', #{params.item_num}),'%')
|
||||
</if>
|
||||
<if test="standName != null" >
|
||||
and ncl.STAND_NAME like concat(concat('%', #{standName}),'%')
|
||||
<if test="params.item_title != null" >
|
||||
and lds.item_title like concat(concat('%', #{params.item_title}),'%')
|
||||
</if>
|
||||
<if test="suitabilityResult != null" >
|
||||
and ncl.SUITABILITY_RESULT = #{suitabilityResult}
|
||||
<if test="params.item_content != null" >
|
||||
and lds.item_content like concat(concat('%', #{params.item_content}),'%')
|
||||
</if>
|
||||
<if test="suitabilityCategory != null" >
|
||||
and ncl.SUITABILITY_CATEGORY = #{suitabilityCategory}
|
||||
</if>
|
||||
<if test="whetherAuthenticationCorresponding != null" >
|
||||
and ncl.WHETHER_AUTHENTICATION_CORRESPONDING = #{whetherAuthenticationCorresponding}
|
||||
</if>
|
||||
<if test="authenticationCorrespondingType != null" >
|
||||
and (
|
||||
ncl.AUTHENTICATION_CORRESPONDING_TYPE = #{authenticationCorrespondingType}
|
||||
<foreach item="item" index="index" collection="authenticationCorrespondingType.split(',')">
|
||||
or ncl.AUTHENTICATION_CORRESPONDING_TYPE like concat(concat('%',#{item}),'%')
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="closedState != null" >
|
||||
and ncl.CLOSED_STATE = #{closedState}
|
||||
</if>
|
||||
<if test="ids != null and ids.size != 0">
|
||||
and ncl.ID in
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
<if test="params.ids != null" >
|
||||
and lds.id in
|
||||
<foreach collection="params.ids.split(',')" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="standId != null" >
|
||||
and ncl.STAND_ID = #{standId}
|
||||
</if>
|
||||
<if test="standIdList != null and standIdList.size != 0" >
|
||||
and sl.STAND_ID in
|
||||
<foreach collection="standIdList" item="standId" open="(" separator="," close=")">
|
||||
#{standId}
|
||||
<if test="params.menuIds != null" >
|
||||
and lds.menu_id in
|
||||
<foreach collection="params.menuIds.split(',')" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="projectLibraryId != null" >
|
||||
and ncl.PROJECT_LIBRARY_ID = #{projectLibraryId}
|
||||
</if>-->
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
|
||||
+128
-132
@@ -16,6 +16,7 @@ import com.jero.common.util.FileUtils;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.common.util.UUIDUtils;
|
||||
import com.jero.common.util.ZipUtil;
|
||||
import com.jero.modules.documenttool.common.DirectoryComparator;
|
||||
import com.jero.modules.documenttool.common.DocumentSplitCommon;
|
||||
import com.jero.modules.documenttool.entity.*;
|
||||
import com.jero.modules.documenttool.factory.ConditionMapFactory;
|
||||
@@ -25,10 +26,12 @@ import com.jero.modules.documenttool.mapper.DocumentSplitMapper;
|
||||
import com.jero.modules.documenttool.mapper.LawsDocumentSplitMapper;
|
||||
import com.jero.modules.documenttool.service.IDocumentSplitService;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
|
||||
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.FileSplitItemsEOMapper;
|
||||
import com.jero.modules.split.mapper.SarFileSplitItemsValEOMapper;
|
||||
import com.jero.modules.split.page.SarFileSplitMenuEOPage;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
@@ -61,6 +64,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -138,6 +142,9 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
@Value("#{'${adminRoleCode}'.split(',')}")
|
||||
private List<String> adminRoleCodeList;
|
||||
|
||||
@Autowired
|
||||
private FileSplitItemsEOMapper fileSplitItemsEOMapper;
|
||||
|
||||
@Override
|
||||
public IPage<DocumentSplitInfo> queryByPage(DocumentSplitInfo documentSplitInfo, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
@@ -204,7 +211,20 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
// 分页参数
|
||||
int pageNo = Integer.parseInt((String) parameter.get("pageNo"));
|
||||
int pageSize = Integer.parseInt((String) parameter.get("pageSize"));
|
||||
// String selectCondition = "order by create_time desc";
|
||||
// 树节点搜索
|
||||
if (parameter.containsKey(MENU_ID)){
|
||||
// 查询此节点下的所有子节点
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = new SarFileSplitMenuEO();
|
||||
sarFileSplitMenuEO.setId( (String) parameter.get(MENU_ID));
|
||||
List<SarFileSplitMenuEO> sarFileSplitMenuEOS = sarFileSplitMenuEOService.queryAllChildrenById(sarFileSplitMenuEO);
|
||||
if (!sarFileSplitMenuEOS.isEmpty()){
|
||||
String menuIds= sarFileSplitMenuEOS.stream()
|
||||
.map(SarFileSplitMenuEO::getId)
|
||||
.collect(Collectors.joining(","));
|
||||
parameter.put("menuIds",menuIds);
|
||||
parameter.remove(MENU_ID);
|
||||
}
|
||||
}
|
||||
// 查询数据
|
||||
IPage<Map<String, Object>> mapIPage = documentSplitMapper.queryDocumentSplitDetail(new Page<>(pageNo, pageSize), parameter);
|
||||
// // 翻译
|
||||
@@ -239,27 +259,11 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> queryDocumentSplitDetailByList(Map<String, Object> parameter) {
|
||||
// // 查询全部字段列表
|
||||
// List<LawsTag> fieldList = lawsCommonMapper.getFieldList(TableNameEnum.DOCUMENT_SPLIT.getTableName());
|
||||
// // 列表展示字段
|
||||
// List<LawsTag> fieldListSelect = fieldList.stream().filter(v -> YesOrNoEnum.YES.getValue()
|
||||
// .equals(String.valueOf(v.getIsShowList()))).collect(Collectors.toList());
|
||||
// // 搜索条件展示字段
|
||||
// List<LawsTag> fieldListCondition = fieldList.stream().filter(v -> YesOrNoEnum.YES.getValue()
|
||||
// .equals(String.valueOf(v.getIsQuery()))).collect(Collectors.toList());
|
||||
//
|
||||
// // sql查询列字段拼接
|
||||
// String selectColumn = getSelectColumn(fieldListSelect);
|
||||
// // sql where条件拼接
|
||||
// String selectCondition = getSelectCondition(parameter, fieldListCondition);
|
||||
// // 排序
|
||||
// selectCondition = orderBy(parameter, selectCondition, fieldListSelect);
|
||||
// // 查询数据
|
||||
// List<Map<String, Object>> list = documentSplitMapper.queryDocumentSplitDetail(selectColumn, selectCondition);
|
||||
// // 翻译
|
||||
// dicTranslate(list, fieldListSelect);
|
||||
// return list;
|
||||
return null;
|
||||
// sql查询列字段拼接
|
||||
String selectColumn = "*";
|
||||
// 查询数据
|
||||
List<Map<String, Object>> list = documentSplitMapper.queryDocumentSplitDetail(selectColumn, parameter);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -292,10 +296,10 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
|
||||
@Override
|
||||
public void add(SarFileSplitInfoEO sarFileSplitInfoEO) {
|
||||
// 企标权限校验
|
||||
enterpriseCheck(sarFileSplitInfoEO);
|
||||
// 唯一校验
|
||||
uniqueCheck(sarFileSplitInfoEO);
|
||||
// // 企标权限校验
|
||||
// enterpriseCheck(sarFileSplitInfoEO);
|
||||
// // 唯一校验
|
||||
// uniqueCheck(sarFileSplitInfoEO);
|
||||
// 保存文本拆分数据
|
||||
saveDocumentSplitInfo(sarFileSplitInfoEO);
|
||||
//拆分
|
||||
@@ -444,8 +448,6 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
|
||||
@Override
|
||||
public void editDocumentSplitDetail(Map<String, Object> parameter) {
|
||||
// // 水平越权
|
||||
// isHorizontalOverstep((String) parameter.get(INFO_ID));
|
||||
// // 处理map参数null值转为“”
|
||||
// mapValueNullToString(parameter);
|
||||
// // 查询全部字段列表
|
||||
@@ -477,14 +479,26 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
// updateSet.append(updateValue).append(",");
|
||||
// }
|
||||
// });
|
||||
// // 更新人和更新时间
|
||||
// 更新人和更新时间
|
||||
// String updateByAndUpdateTime = new UniversalImpl().getUpdateByAndUpdateTime();
|
||||
// updateSet.insert(0, updateByAndUpdateTime + ",");
|
||||
// updateSet.deleteCharAt(updateSet.length() - 1);
|
||||
// // where条件
|
||||
// String updateCondition = "id = '" + parameter.get(ID) + "'";
|
||||
// documentSplitMapper.editDocumentSplitDetail(updateSet.toString(), updateCondition);
|
||||
//
|
||||
|
||||
// 条目信息
|
||||
List<SarFileSplitItemsValEO> valList = JSON.parseArray(JSON.toJSONString(parameter.get("itemValEOList")), SarFileSplitItemsValEO.class);
|
||||
String itemContent = itemContentJoin(valList, (String) parameter.get(ID));
|
||||
|
||||
SarFileSplitItemsEO sarFileSplitItemsEO = new SarFileSplitItemsEO();
|
||||
sarFileSplitItemsEO.setId(parameter.get(ID).toString());
|
||||
sarFileSplitItemsEO.setItemNum(parameter.get(ITEM_NUM).toString());
|
||||
sarFileSplitItemsEO.setItemTitle(parameter.get(ITEM_TITLE).toString());
|
||||
sarFileSplitItemsEO.setModifyTime(new Date());
|
||||
sarFileSplitItemsEO.setItemContent(itemContent);
|
||||
this.fileSplitItemsEOMapper.updateSarFileSplitItemsInfo(sarFileSplitItemsEO);
|
||||
|
||||
// //条文解读更新
|
||||
// // 删除旧数据
|
||||
// documentSplitMapper.deleteItemsValByItemId((String) parameter.get(ID), DocumentSplitCommon.INTERPRETATION);
|
||||
@@ -493,13 +507,13 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
// documentSplitMapper.addBatchItemsVal(articlesList);
|
||||
// }
|
||||
//
|
||||
// // 条目信息更新
|
||||
// // 删除旧数据
|
||||
// documentSplitMapper.deleteItemsValByItemId((String) parameter.get(ID), "");
|
||||
// if (!Objects.isNull(valList) && !valList.isEmpty()){
|
||||
// // 添加新数据
|
||||
// documentSplitMapper.addBatchItemsVal(valList);
|
||||
// }
|
||||
// 条目信息更新
|
||||
// 删除旧数据
|
||||
documentSplitMapper.deleteItemsValByItemId((String) parameter.get(ID), "");
|
||||
if (!Objects.isNull(valList) && !valList.isEmpty()){
|
||||
// 添加新数据
|
||||
documentSplitMapper.addBatchItemsVal(valList);
|
||||
}
|
||||
}
|
||||
|
||||
private void mapValueNullToString(Map<String, Object> parameter) {
|
||||
@@ -538,7 +552,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
StringBuilder valContent = new StringBuilder();
|
||||
if (!Objects.isNull(valList) && !valList.isEmpty()){
|
||||
int index = 0;
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String userId = "";
|
||||
for (SarFileSplitItemsValEO sarFileSplitItemsValEO : valList) {
|
||||
// 条文内容拼接
|
||||
if (DocumentSplitCommon.TEXT.equals(sarFileSplitItemsValEO.getType())) {
|
||||
@@ -558,8 +573,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
sarFileSplitItemsValEO.setValidFlag(0);
|
||||
sarFileSplitItemsValEO.setCreationTime(new Date());
|
||||
sarFileSplitItemsValEO.setModifyTime(new Date());
|
||||
sarFileSplitItemsValEO.setCreationUser(sysUser.getId());
|
||||
sarFileSplitItemsValEO.setModifyUser(sysUser.getId());
|
||||
sarFileSplitItemsValEO.setCreationUser(userId);
|
||||
sarFileSplitItemsValEO.setModifyUser(userId);
|
||||
}
|
||||
}
|
||||
return valContent.toString();
|
||||
@@ -640,91 +655,74 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
|
||||
@Override
|
||||
public void mergeDocumentSplitDetail(Map<String, Object> parameter) {
|
||||
// // 查询全部字段列表
|
||||
// List<LawsTag> fieldList = lawsCommonMapper.getFieldList(TableNameEnum.DOCUMENT_SPLIT.getTableName());
|
||||
// // 列表展示字段
|
||||
// List<LawsTag> fieldListSelect = fieldList.stream().filter(v -> YesOrNoEnum.YES.getValue()
|
||||
// .equals(String.valueOf(v.getIsShowList()))).collect(Collectors.toList());
|
||||
// // sql查询列字段拼接
|
||||
// String selectColumn = getSelectColumn(fieldListSelect);
|
||||
// // 勾选数据ids
|
||||
// String ids = (String) parameter.get(IDS);
|
||||
// List<String> idList = Arrays.asList(ids.split(","));
|
||||
// // sql where条件拼接
|
||||
// String selectCondition = "where del_flag = 0 and s.id in ('" + String.join("','", idList) + "')";
|
||||
// // 排序
|
||||
// StringBuilder strSelectCondition = new StringBuilder(selectCondition);
|
||||
// // 查询数据
|
||||
// List<Map<String, Object>> listMap = documentSplitMapper.queryDocumentSplitDetail(selectColumn, strSelectCondition.toString());
|
||||
//
|
||||
// // 水平越权
|
||||
// List<String> listMapIdList = listMap.stream().map(v -> v.get(ID).toString()).collect(Collectors.toList());
|
||||
// List<LawsDocumentSplit> lawsDocumentSplitList = documentSplitMapper.queryLawsDocumentSplitInIds(listMapIdList);
|
||||
// isHorizontalOverstep(lawsDocumentSplitList.get(0).getInfoId());
|
||||
//
|
||||
// // 排序(根据条文号)
|
||||
// listMap.sort(new DirectoryComparator());
|
||||
// // 第一条数据
|
||||
// Map<String, Object> firstData = listMap.get(0);
|
||||
// listMap.remove(0);
|
||||
// // 合并数据(条文标题、条文内容)
|
||||
// String title = firstData.get(ITEM_TITLE) + " " + mergeData(listMap, ITEM_TITLE);
|
||||
// String content = firstData.get(ITEM_CONTENT) + mergeData(listMap, ITEM_CONTENT);
|
||||
// String updateByAndUpdateTime = new UniversalImpl().getUpdateByAndUpdateTime();
|
||||
// String updateSet = updateByAndUpdateTime +
|
||||
// "," + ITEM_TITLE + " = " + "' "+ title + "'" +
|
||||
// "," + ITEM_CONTENT + " = " + "'" + content + "'";
|
||||
// String updateCondition = "id = " + "'" + firstData.get(ID) + "'";
|
||||
// // 修改数据
|
||||
// documentSplitMapper.editDocumentSplitDetail(updateSet, updateCondition);
|
||||
// List<String> otherIds = listMap.stream().map(v -> (String)v.get(ID)).collect(Collectors.toList());
|
||||
// // 删除旧数据
|
||||
// lawsDocumentSplitMapper.deleteBatchIds(otherIds);
|
||||
//
|
||||
// // 目录更新
|
||||
// List<String> menuIdList = listMap.stream()
|
||||
// .filter(v -> !Objects.equals(v.get(MENU_ID), firstData.get(MENU_ID)))
|
||||
// .map(v -> (String) v.get(MENU_ID))
|
||||
// .distinct()
|
||||
// .collect(Collectors.toList());
|
||||
//
|
||||
// if (!menuIdList.isEmpty()){
|
||||
// // 判断被合并条款之前有没有复制过,复制过则不删除相关目录
|
||||
// List<LawsDocumentSplit> lawsDocumentSplits = documentSplitMapper.queryLawsDocumentSplitInIds(Collections.singletonList((String) firstData.get(ID)));
|
||||
// List<String> menuIds = documentSplitMapper.queryLawsDocumentSplitGroupByMenuId(lawsDocumentSplits.get(0).getInfoId());
|
||||
// if (CollectionUtils.isNotEmpty(menuIds)){
|
||||
// menuIdList = menuIdList.stream().filter(v -> !menuIds.contains(v)).collect(Collectors.toList());
|
||||
// }
|
||||
// if (!menuIdList.isEmpty()){
|
||||
// // 删除旧数据
|
||||
// documentSplitMapper.sarFileSplitMenuDeleteByIdList(menuIdList);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 修改条目
|
||||
// ArrayList<SarFileSplitItemsValEO> sarFileSplitItemsValEOSList = new ArrayList<>();
|
||||
// // 查询旧数据
|
||||
// for (Map<String, Object> map : listMap) {
|
||||
// String id = (String) map.get(ID);
|
||||
// sarFileSplitItemsValEOSList.addAll(documentSplitMapper.queryItemsValByItemId(id, ""));
|
||||
// }
|
||||
// List<SarFileSplitItemsValEO> sarFileSplitItemsValEOS = documentSplitMapper.queryItemsValByItemId((String) firstData.get(ID), "");
|
||||
// // 第一条数据信息的最大的排序字段值
|
||||
// Optional<SarFileSplitItemsValEO> sarFileSplitItemsValEOOptional = sarFileSplitItemsValEOS.stream().sorted(Comparator.comparing(v -> Integer.valueOf(String.valueOf(v.getDisplaySeq())))).findFirst();
|
||||
// sarFileSplitItemsValEOOptional.ifPresent(v ->{
|
||||
// // 排序字段
|
||||
// Integer displaySeq = v.getDisplaySeq();
|
||||
String selectColumn = "*";
|
||||
// 查询数据
|
||||
List<Map<String, Object>> listMap = documentSplitMapper.queryDocumentSplitDetail(selectColumn, parameter);
|
||||
|
||||
// 排序(根据条文号)
|
||||
listMap.sort(new DirectoryComparator());
|
||||
// 第一条数据
|
||||
Map<String, Object> firstData = listMap.get(0);
|
||||
listMap.remove(0);
|
||||
// 合并数据(条文标题、条文内容)
|
||||
String title = firstData.get(ITEM_TITLE) + " " + mergeData(listMap, ITEM_TITLE);
|
||||
String content = firstData.get(ITEM_CONTENT) + mergeData(listMap, ITEM_CONTENT);
|
||||
String updateByAndUpdateTime = new UniversalImpl().getUpdateByAndUpdateTime();
|
||||
String updateSet = updateByAndUpdateTime +
|
||||
"," + ITEM_TITLE + " = " + "' "+ title + "'" +
|
||||
"," + ITEM_CONTENT + " = " + "'" + content + "'";
|
||||
String updateCondition = "id = " + "'" + firstData.get(ID) + "'";
|
||||
// 修改数据
|
||||
documentSplitMapper.editDocumentSplitDetail(updateSet, updateCondition);
|
||||
List<String> otherIds = listMap.stream().map(v -> (String)v.get(ID)).collect(Collectors.toList());
|
||||
// 删除旧数据
|
||||
lawsDocumentSplitMapper.deleteBatchIds(otherIds);
|
||||
|
||||
// 目录更新
|
||||
List<String> menuIdList = listMap.stream()
|
||||
.filter(v -> !Objects.equals(v.get(MENU_ID), firstData.get(MENU_ID)))
|
||||
.map(v -> (String) v.get(MENU_ID))
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (!menuIdList.isEmpty()){
|
||||
// 判断被合并条款之前有没有复制过,复制过则不删除相关目录
|
||||
List<LawsDocumentSplit> lawsDocumentSplits = documentSplitMapper.queryLawsDocumentSplitInIds(Collections.singletonList((String) firstData.get(ID)));
|
||||
List<String> menuIds = documentSplitMapper.queryLawsDocumentSplitGroupByMenuId(lawsDocumentSplits.get(0).getInfoId());
|
||||
if (CollectionUtils.isNotEmpty(menuIds)){
|
||||
menuIdList = menuIdList.stream().filter(v -> !menuIds.contains(v)).collect(Collectors.toList());
|
||||
}
|
||||
if (!menuIdList.isEmpty()){
|
||||
// 删除旧数据
|
||||
documentSplitMapper.sarFileSplitMenuDeleteByIdList(menuIdList);
|
||||
}
|
||||
}
|
||||
|
||||
// 修改条目
|
||||
ArrayList<SarFileSplitItemsValEO> sarFileSplitItemsValEOSList = new ArrayList<>();
|
||||
// 查询旧数据
|
||||
for (Map<String, Object> map : listMap) {
|
||||
String id = (String) map.get(ID);
|
||||
sarFileSplitItemsValEOSList.addAll(documentSplitMapper.queryItemsValByItemId(id, ""));
|
||||
}
|
||||
List<SarFileSplitItemsValEO> sarFileSplitItemsValEOS = documentSplitMapper.queryItemsValByItemId((String) firstData.get(ID), "");
|
||||
// 第一条数据信息的最大的排序字段值
|
||||
Optional<SarFileSplitItemsValEO> sarFileSplitItemsValEOOptional = sarFileSplitItemsValEOS.stream().sorted(Comparator.comparing(v -> Integer.valueOf(String.valueOf(v.getDisplaySeq())))).findFirst();
|
||||
sarFileSplitItemsValEOOptional.ifPresent(v ->{
|
||||
// 排序字段
|
||||
Integer displaySeq = v.getDisplaySeq();
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// for (SarFileSplitItemsValEO fileSplitItemsValEO : sarFileSplitItemsValEOSList) {
|
||||
// displaySeq += 1;
|
||||
// fileSplitItemsValEO.setItemId(v.getItemId());
|
||||
// fileSplitItemsValEO.setDisplaySeq(displaySeq);
|
||||
// fileSplitItemsValEO.setModifyTime(new Date());
|
||||
// fileSplitItemsValEO.setModifyUser(sysUser.getUsername());
|
||||
// // 修改数据
|
||||
// sarFileSplitItemsValEOMapper.updateByPrimaryKeySelective(fileSplitItemsValEO);
|
||||
// }
|
||||
// } );
|
||||
String userId = "";
|
||||
for (SarFileSplitItemsValEO fileSplitItemsValEO : sarFileSplitItemsValEOSList) {
|
||||
displaySeq += 1;
|
||||
fileSplitItemsValEO.setItemId(v.getItemId());
|
||||
fileSplitItemsValEO.setDisplaySeq(displaySeq);
|
||||
fileSplitItemsValEO.setModifyTime(new Date());
|
||||
fileSplitItemsValEO.setModifyUser(userId);
|
||||
// 修改数据
|
||||
sarFileSplitItemsValEOMapper.updateByPrimaryKeySelective(fileSplitItemsValEO);
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -763,11 +761,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
|
||||
@Override
|
||||
public void copyDocumentSplitDetail(String id) {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// 查询数据
|
||||
Map<String, Object> resultMap = documentSplitMapper.queryLawsDocumentSplitById(id);
|
||||
// 水平越权
|
||||
isHorizontalOverstep(resultMap.get(INFO_ID).toString());
|
||||
// 字段名
|
||||
StringBuilder fieldsBuilder = new StringBuilder();
|
||||
// 字段值
|
||||
@@ -777,9 +772,9 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
String format = dateFormat.format(date);
|
||||
String newItemValId = UUID.randomUUID().toString().replace("-", "");
|
||||
resultMap.put(ID, newItemValId);
|
||||
resultMap.put("create_by", loginUser.getUsername());
|
||||
resultMap.put("create_by", "");
|
||||
resultMap.put(CREATE_TIME, format);
|
||||
resultMap.put("update_by", loginUser.getUsername());
|
||||
resultMap.put("update_by", "");
|
||||
resultMap.put("update_time", format);
|
||||
// 字段名和值
|
||||
manageData(resultMap, fieldsBuilder, valuesList);
|
||||
@@ -931,8 +926,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
public LawsDocumentSplitView queryView(Map<String, Object> parameter) {
|
||||
LawsDocumentSplitView lawsDocumentSplitView = new LawsDocumentSplitView();
|
||||
String id = (String) parameter.get(ID);
|
||||
// 水平越权
|
||||
isHorizontalOverstep(id);
|
||||
// // 水平越权
|
||||
// isHorizontalOverstep(id);
|
||||
// 文档拆分信息
|
||||
DocumentSplitInfo documentSplitInfo = new DocumentSplitInfo();
|
||||
documentSplitInfo.setId(id);
|
||||
@@ -1198,12 +1193,13 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
@Override
|
||||
public void saveDocumentSplitInfo(SarFileSplitInfoEO sarFileSplitInfoEO) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String userId = "";
|
||||
Date now = new Date();
|
||||
String infoId = UUID.randomUUID().toString().replace("-", "");
|
||||
sarFileSplitInfoEO.setId(infoId);
|
||||
sarFileSplitInfoEO.setSplitResult("成功");
|
||||
sarFileSplitInfoEO.setSplitStatus(SplitEnum.SPLIT_STATUS1.getValue());
|
||||
sarFileSplitInfoEO.setAuthor(sysUser.getId());
|
||||
sarFileSplitInfoEO.setAuthor(userId);
|
||||
sarFileSplitInfoEO.setCreateTime(now);
|
||||
sarFileSplitInfoEO.setUpdateTime(now);
|
||||
sarFileSplitInfoService.save(sarFileSplitInfoEO);
|
||||
|
||||
+13
-5
@@ -112,7 +112,7 @@
|
||||
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,applicable_components)
|
||||
update_by, item_content,sort_number)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">(
|
||||
#{item.id, jdbcType=VARCHAR}, #{item.infoId, jdbcType=VARCHAR}, #{item.itemNum, jdbcType=VARCHAR},
|
||||
@@ -120,8 +120,7 @@
|
||||
#{item.menuId, jdbcType=VARCHAR},
|
||||
#{item.creationUser, jdbcType=VARCHAR},
|
||||
#{item.creationTime, jdbcType=TIMESTAMP}, #{item.modifyTime, jdbcType=TIMESTAMP},
|
||||
#{item.modifyUser, jdbcType=VARCHAR}, #{item.itemContent, jdbcType=CLOB},#{item.zhan3Shi4Shun4Xu4, jdbcType=VARCHAR},
|
||||
#{item.applicableComponents, jdbcType=VARCHAR}
|
||||
#{item.modifyUser, jdbcType=VARCHAR}, #{item.itemContent, jdbcType=CLOB},#{item.zhan3Shi4Shun4Xu4, jdbcType=VARCHAR}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -139,8 +138,17 @@
|
||||
<if test="sarFileSplitItemsEO.zhan3Shi4Shun4Xu4 != null" >
|
||||
zhan3_shi4_shun4_xu4 = #{sarFileSplitItemsEO.zhan3Shi4Shun4Xu4},
|
||||
</if>
|
||||
modify_user = #{sarFileSplitItemsEO.modifyUser, jdbcType=VARCHAR},
|
||||
modify_time = #{sarFileSplitItemsEO.modifyTime, jdbcType=TIMESTAMP}
|
||||
<if test="sarFileSplitItemsEO.itemNum != null" >
|
||||
item_num = #{sarFileSplitItemsEO.itemNum},
|
||||
</if>
|
||||
<if test="sarFileSplitItemsEO.itemTitle != null" >
|
||||
item_title = #{sarFileSplitItemsEO.itemTitle},
|
||||
</if>
|
||||
<if test="sarFileSplitItemsEO.itemContent != null" >
|
||||
item_content = #{sarFileSplitItemsEO.itemContent},
|
||||
</if>
|
||||
update_by = #{sarFileSplitItemsEO.modifyUser, jdbcType=VARCHAR},
|
||||
update_time = #{sarFileSplitItemsEO.modifyTime, jdbcType=TIMESTAMP}
|
||||
</set>
|
||||
where id = #{sarFileSplitItemsEO.id, jdbcType=VARCHAR}
|
||||
</update>
|
||||
|
||||
+8
-6
@@ -838,10 +838,11 @@ public class FileSpiltService {
|
||||
sarFileSplitItemsEO.setId(UUIDUtils.randomUUID20());
|
||||
sarFileSplitItemsEO.setValidFlag(0);
|
||||
sarFileSplitItemsEO.setCreationTime(new Date());
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
sarFileSplitItemsEO.setCreationUser(loginUser.getUsername());
|
||||
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
String userId = "";
|
||||
sarFileSplitItemsEO.setCreationUser(userId);
|
||||
sarFileSplitItemsEO.setModifyTime(new Date());
|
||||
sarFileSplitItemsEO.setModifyUser(loginUser.getUsername());
|
||||
sarFileSplitItemsEO.setModifyUser(userId);
|
||||
return sarFileSplitItemsEO;
|
||||
}
|
||||
|
||||
@@ -1186,10 +1187,11 @@ public class FileSpiltService {
|
||||
sarFileSplitItemsValEO.setId(UUIDUtils.randomUUID20());
|
||||
sarFileSplitItemsValEO.setValidFlag(0);
|
||||
sarFileSplitItemsValEO.setCreationTime(new Date());
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
sarFileSplitItemsValEO.setCreationUser(loginUser.getUsername());
|
||||
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
String userId = "";
|
||||
sarFileSplitItemsValEO.setCreationUser(userId);
|
||||
sarFileSplitItemsValEO.setModifyTime(new Date());
|
||||
sarFileSplitItemsValEO.setModifyUser(loginUser.getUsername());
|
||||
sarFileSplitItemsValEO.setModifyUser(userId);
|
||||
sarFileSplitItemsValEO.setItemId(itemId);
|
||||
sarFileSplitItemsValEO.setType(type);
|
||||
sarFileSplitItemsValEO.setDisplaySeq(disPlaySql);
|
||||
|
||||
+7
-9
@@ -1681,20 +1681,21 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
|
||||
@Override
|
||||
public Result<?> importSplitResult(String splitFileId, String cut, SarFileSplitInfoEO sarFileSplitInfoEO) throws IOException {
|
||||
// 企标权限校验
|
||||
documentSplitService.enterpriseCheck(sarFileSplitInfoEO);
|
||||
// 唯一校验
|
||||
documentSplitService.uniqueCheck(sarFileSplitInfoEO);
|
||||
// // 企标权限校验
|
||||
// documentSplitService.enterpriseCheck(sarFileSplitInfoEO);
|
||||
// // 唯一校验
|
||||
// documentSplitService.uniqueCheck(sarFileSplitInfoEO);
|
||||
|
||||
// MultipartFile mFile = createMfileByPath(url);
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String userId = "";
|
||||
Date now = new Date();
|
||||
String infoId = UUID.randomUUID().toString().replace("-", "");
|
||||
sarFileSplitInfoEO.setId(infoId);
|
||||
sarFileSplitInfoEO.setSplitResult("成功");
|
||||
sarFileSplitInfoEO.setSplitStatus(SplitEnum.SPLIT_STATUS1.getValue());
|
||||
sarFileSplitInfoEO.setAuthor(sysUser.getId());
|
||||
sarFileSplitInfoEO.setAuthor(userId);
|
||||
sarFileSplitInfoEO.setCreateTime(now);
|
||||
sarFileSplitInfoEO.setUpdateTime(now);
|
||||
sarFileSplitInfoService.save(sarFileSplitInfoEO);
|
||||
@@ -3457,9 +3458,6 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
|
||||
@Override
|
||||
public void exportSplitInfo(String cut, String idList, Map<String, Object> parameter,String exportName, HttpServletResponse response, HttpServletRequest request) {
|
||||
// 水平越权
|
||||
documentSplitService.isHorizontalOverstep(String.valueOf(parameter.get("info_id")));
|
||||
|
||||
OutputStream os = null;
|
||||
OutputStream excelOS = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
|
||||
+28
-9
@@ -4,7 +4,9 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.documenttool.entity.LawsDocumentSplit;
|
||||
import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
import com.jero.modules.split.mapper.FileSplitItemsEOMapper;
|
||||
import com.jero.modules.split.mapper.SarFileSplitItemsValEOMapper;
|
||||
import com.jero.modules.split.mapper.SarFileSplitMenuEOMapper;
|
||||
import com.jero.modules.split.page.SarFileSplitMenuEOPage;
|
||||
@@ -46,6 +48,9 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
@Autowired
|
||||
private IFileSplitItemsEOService fileSplitItemsEOService;
|
||||
|
||||
@Autowired
|
||||
private FileSplitItemsEOMapper fileSplitItemsEOMapper;
|
||||
|
||||
// 通过ID查询该结点及结点下所有的节点排序的最大值
|
||||
public int getMaxDisplayByid(String menuID) {
|
||||
return dao.getMaxDisplayByid(menuID);
|
||||
@@ -59,15 +64,29 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
sarFileSplitMenuEO.setModifyTime(new Date());
|
||||
int count = dao.insertSelective(sarFileSplitMenuEO);
|
||||
// 新增对应条款
|
||||
Map<String, Object> parameter = new HashMap<>();
|
||||
if (StringUtils.isNotEmpty(sarFileSplitMenuEO.getName())) {
|
||||
parameter.put("item_num", sarFileSplitMenuEO.getName());
|
||||
}
|
||||
parameter.put("item_title", sarFileSplitMenuEO.getItemName());
|
||||
parameter.put("info_id", sarFileSplitMenuEO.getInfoId());
|
||||
parameter.put("menu_id", sarFileSplitMenuEO.getId());
|
||||
String itemId = UUID.randomUUID().toString().replace("-", "");
|
||||
fileSplitItemsEOService.insertInfo(parameter, itemId,"add");
|
||||
// Map<String, Object> parameter = new HashMap<>();
|
||||
// if (StringUtils.isNotEmpty(sarFileSplitMenuEO.getName())) {
|
||||
// parameter.put("item_num", sarFileSplitMenuEO.getName());
|
||||
// }
|
||||
// parameter.put("item_title", sarFileSplitMenuEO.getItemName());
|
||||
// parameter.put("info_id", sarFileSplitMenuEO.getInfoId());
|
||||
// parameter.put("menu_id", sarFileSplitMenuEO.getId());
|
||||
// String itemId = UUID.randomUUID().toString().replace("-", "");
|
||||
// fileSplitItemsEOService.insertInfo(parameter, itemId,"add");
|
||||
|
||||
LawsDocumentSplit lawsDocumentSplit = new LawsDocumentSplit();
|
||||
lawsDocumentSplit.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
lawsDocumentSplit.setItemNum(sarFileSplitMenuEO.getName());
|
||||
lawsDocumentSplit.setItemTitle(sarFileSplitMenuEO.getItemName());
|
||||
lawsDocumentSplit.setInterpretationArticles("");
|
||||
lawsDocumentSplit.setSortNumber(String.valueOf(sarFileSplitMenuEO.getDisplaySeq()));
|
||||
lawsDocumentSplit.setMenuId(sarFileSplitMenuEO.getId());
|
||||
lawsDocumentSplit.setInfoId(sarFileSplitMenuEO.getInfoId());
|
||||
lawsDocumentSplit.setDelFlag(0);
|
||||
lawsDocumentSplit.setCreateTime(new Date());
|
||||
lawsDocumentSplit.setUpdateTime(new Date());
|
||||
this.fileSplitItemsEOMapper.insertLawsDocumentSplit(lawsDocumentSplit);
|
||||
|
||||
// 之后的所有节点序号增加
|
||||
SarFileSplitMenuEOPage page = new SarFileSplitMenuEOPage();
|
||||
// page.setPId(sarFileSplitMenuEO.getPId());
|
||||
|
||||
Reference in New Issue
Block a user