Commit 89e2421b authored by wei's avatar wei 🎱

文件归所属案卷

parent 541742fb
package com.inet.dcs.document.common.vo.archivesOtherVO;
import com.inet.dcs.document.common.vo.ExtFilesVO;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import lombok.Data;
......@@ -13,10 +14,30 @@ import java.io.Serializable;
@Data
public class ExtFilesUpdateVO implements Serializable {
/**
* 文件id
* 移交单ID
*/
private Long transferDocumentId;
/**
* 文档id
*/
private Long docId;
/**
* 文档
*/
private DxDocumentVO dxDocumentVO;
/**
* 所属案卷ID
*/
private Long filesId;
/**
* 案卷
*/
private ExtFilesVO extFilesVO;
/**
* 所属案卷
*/
......
......@@ -366,6 +366,10 @@ public class Constants {
* 项目代号字典type
*/
public static final String PROJECT_CODE = "ProjectCode";
/**
* 项目类型
*/
public static final String PROJECT_CATEGORY = "projectCategory";
/**
* 设计阶段字典type
*/
......
package com.inet.dcs.document.core.controller;
import com.inet.dcs.document.common.vo.ExtTransferDocumentVO;
import com.inet.dcs.document.common.vo.archivesOtherVO.ExtFilesUpdateVO;
import com.inet.dcs.document.core.controller.shadow.ExtTransferDocumentControllerShadow;
import com.inet.dcs.document.core.service.ExtTransferDocumentService;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
......@@ -11,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @description: ExtTransferDocument-Controller
* @author: dexadmin
......@@ -39,6 +42,13 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex
return ApiResult.ok(ApiResult.SUCCESS, "更新案卷部分信息成功");
}
@ApiOperation(value = "保存文档案卷关联关系", notes = "保存文档案卷关联关系")
@PostMapping(value = "/saveFilesDocLink")
public ApiResult saveFilesDocLink(@RequestBody List<ExtFilesUpdateVO> extFilesUpdateVOList) {
extTransferDocumentService.saveFilesDocLink(extFilesUpdateVOList);
return ApiResult.ok(ApiResult.SUCCESS, "保存文档案卷关联关系成功");
}
@ApiOperation(value = "获取项目信息", notes = "获取项目信息")
@GetMapping(value = "/getTransferDocProject")
public ApiResult getTransferDocProjectById(@RequestParam("id") Long id) {
......@@ -52,7 +62,7 @@ public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S ex
}
@ApiOperation(value = "移交单下文件清单退档", notes = "移交单下文件清单退档")
@GetMapping(value = "/returnDocument")
@PostMapping(value = "/returnDocument")
public ApiResult returnDocument(@RequestParam("id") Long id,
@RequestParam("docId") Long docId) {
extTransferDocumentService.returnDocument(id, docId);
......
......@@ -22,6 +22,14 @@ public interface ExtFilesDocLinkService<V extends ExtFilesDocLinkVO> extends Ext
*/
List<ExtFilesDocLinkVO> getFilesDocLinkByTargetId(Long targetId);
/**
* 根据文档ID查询关联文件的target
*
* @param targetId
* @return
*/
List<ExtFilesDocLinkVO> getFilesDocLinkBySourceId(Long targetId);
/**
* 保存案卷和文件关联关系
*
......
......@@ -17,9 +17,10 @@ public interface ExtFilesService<V extends ExtFilesVO> extends ExtFilesServiceSh
/**
* 批量更新案卷部分信息
*
* @param extFilesUpdateVOList
* @param extFilesVO
* @param filesUpdateVO
*/
void updateExtFiles(List<ExtFilesUpdateVO> extFilesUpdateVOList);
void updateExtFiles(ExtFilesVO extFilesVO, ExtFilesUpdateVO filesUpdateVO);
/**
* 根据案卷编码查询案卷
......@@ -36,4 +37,5 @@ public interface ExtFilesService<V extends ExtFilesVO> extends ExtFilesServiceSh
* @return
*/
List<ExtFilesVO> getExtFilesByProjectCode(Long projectCode);
}
package com.inet.dcs.document.core.service;
import com.inet.dcs.document.common.vo.ExtTransferDocumentVO;
import com.inet.dcs.document.common.vo.archivesOtherVO.ExtFilesUpdateVO;
import com.inet.dcs.document.common.vo.archivesOtherVO.ExtTransferDocProjectVO;
import com.inet.dcs.document.core.service.shadow.ExtTransferDocumentServiceShadow;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
......@@ -12,11 +13,11 @@ import java.time.LocalDateTime;
import java.util.List;
/**
* @description: ExtTransferDocument-service
* @author: dexadmin
* @version: V
* @date: 2024-10-29 10:30:50
**/
* @description: ExtTransferDocument-service
* @author: dexadmin
* @version: V
* @date: 2024-10-29 10:30:50
**/
public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> extends ExtTransferDocumentServiceShadow<V> {
ExtTransferDocumentVO startWorkflow(Long id);
......@@ -34,4 +35,6 @@ public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> ext
void updateArchivingStatus(Long id);
void returnDocument(Long id, Long docId);
void saveFilesDocLink(List<ExtFilesUpdateVO> extFilesUpdateVOList);
}
......@@ -50,23 +50,31 @@ public class ExtFilesDocLinkServiceImpl<V extends ExtFilesDocLinkVO> implements
return (List<ExtFilesDocLinkVO>) this.findRecursion(queryDoc).getContent();
}
@Override
public List<ExtFilesDocLinkVO> getFilesDocLinkBySourceId(Long sourceId) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("target").build())
.searchItems(SearchItems.builder()
.item(new SearchItem("sourceId", SearchItem.Operator.EQ, sourceId, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
return (List<ExtFilesDocLinkVO>) this.findRecursion(queryDoc).getContent();
}
@Override
public void saveFilesDocLink(List<ExtFilesUpdateVO> extFilesUpdateVOList) {
List<ExtFilesDocLinkVO> extFilesDocLinkVOList = Lists.newArrayList();
for (ExtFilesUpdateVO extFilesUpdateVO : extFilesUpdateVOList) {
List<ExtFilesVO> filesVOList = extFilesService.findRecursionByVolumeNumber(extFilesUpdateVO.getBelongingCaseFile());
if (CollectionUtils.isNotEmpty(filesVOList)) {
ExtFilesDocLinkVO extFilesDocLinkVO = new ExtFilesDocLinkVO();
ExtFilesVO extFilesVO = filesVOList.get(0);
DxDocumentVO dxDocumentVO = extFilesUpdateVO.getDxDocumentVO();
ExtFilesVO extFilesVO = extFilesUpdateVO.getExtFilesVO();
extFilesDocLinkVO.setTarget(extFilesVO);
extFilesDocLinkVO.setTargetId(extFilesVO.getId());
DxDocumentVO dxDocumentVO = extFilesUpdateVO.getDxDocumentVO();
extFilesDocLinkVO.setSource(dxDocumentVO);
extFilesDocLinkVO.setSourceId(dxDocumentVO.getId());
extFilesDocLinkVO.setOperator(OperatorType.ADD);
extFilesDocLinkVOList.add(extFilesDocLinkVO);
}
}
if (CollectionUtils.isNotEmpty(extFilesDocLinkVOList)) {
this.saveRecursion((V) extFilesDocLinkVOList);
}
......
......@@ -5,6 +5,7 @@ import com.inet.dcs.document.common.vo.ExtFilesVO;
import com.inet.dcs.document.common.vo.archivesOtherVO.ExtFilesUpdateVO;
import com.inet.dcs.document.core.constants.Constants;
import com.inet.dcs.document.core.repository.ExtFilesRepository;
import com.inet.dcs.document.core.service.ExtDocService;
import com.inet.dcs.document.core.service.ExtFilesDocLinkService;
import com.inet.dcs.document.core.service.ExtFilesService;
import com.inet.dcs.document.core.util.SearchUtil;
......@@ -20,12 +21,8 @@ import com.yonde.dex.context.common.vo.DxContextProjectVO;
import com.yonde.dex.context.common.vo.DxContextVO;
import com.yonde.dex.dao.service.DxDaoPluginExpander;
import com.yonde.dex.dict.feign.DictDataFeignService;
import com.yonde.dex.dict.service.vo.DictDataVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -42,7 +39,6 @@ import java.util.List;
@Service(ExtFilesServiceImpl.BEAN_NAME)
public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesService<V>, DxDaoPluginExpander<V> {
public static final String BEAN_NAME = "extFilesServiceImpl";
@Autowired
......@@ -60,6 +56,9 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
@Autowired
private DictDataFeignService dictDataService;
@Autowired
private ExtDocService extDocService;
@Override
public void beforeSave(Collection<V> target) {
// 全宗号+项目号+项目代号+类别代号+盒号(三位流水号)+后缀“-(两位数字流水号)例如:2-20114272031-QH03-JS01-001-(01)
......@@ -95,6 +94,16 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
}
}
@Override
public void updateExtFiles(ExtFilesVO extFilesVO, ExtFilesUpdateVO filesUpdateVO) {
extFilesVO.setSecretCode(filesUpdateVO.getSecretCode());
extFilesVO.setStoragePeriod(filesUpdateVO.getStoragePeriod());
extFilesVO.setFileNumber(filesUpdateVO.getFileNumber());
extFilesVO.setPageNumber(filesUpdateVO.getPageNumber());
extFilesVO.setOperator(OperatorType.MODIFY);
this.saveRecursion((V) extFilesVO);
}
/**
* 根据案卷序号查询案卷
*
......@@ -126,8 +135,13 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
.item(new SearchItem("checkOuted", SearchItem.Operator.EQ, true, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
List<ExtFilesVO> content = (List<ExtFilesVO>) this.findRecursion(queryDoc).getContent();
return content;
List<ExtFilesVO> extFilesVOList = (List<ExtFilesVO>) this.findRecursion(queryDoc).getContent();
for (ExtFilesVO extFilesVO : extFilesVOList) {
DxContextVO dxContext = extFilesVO.getDxContext();
String projectClass = dxContext.getProjectClass();
dxContext.setProjectClass(extDocService.searchDictDataByDictCode(Constants.PROJECT_CATEGORY, projectClass));
}
return extFilesVOList;
}
private String getProjectCodeAndNumber(DxContextProjectVO dxContextProjectVO) {
......@@ -183,59 +197,6 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
return caseNumberBuilder.append(caseNumber).toString();
}
@Override
public void updateExtFiles(List<ExtFilesUpdateVO> extFilesUpdateVOList) {
List<ExtFilesVO> extFilesVOList = Lists.newArrayList();
List<DictDataVO> secretCodeDictList = dictDataService.getDictDatas(Constants.SECRET_CODE);
for (ExtFilesUpdateVO extFilesUpdateVO : extFilesUpdateVOList) {
List<ExtFilesVO> filesVOS = this.findRecursionByVolumeNumber(extFilesUpdateVO.getBelongingCaseFile());
if (CollectionUtils.isNotEmpty(filesVOS)) {
ExtFilesVO extFilesVO = filesVOS.get(0);
// 密级
String secretCode = extFilesVO.getSecretCode();
if (StringUtils.isBlank(secretCode)) {
secretCode = extFilesUpdateVO.getSecretCode();
} else {
}
extFilesVO.setSecretCode(secretCode);
// 年限
String storagePeriod = extFilesVO.getStoragePeriod();
if (StringUtils.isBlank(storagePeriod)) {
storagePeriod = extFilesUpdateVO.getStoragePeriod();
} else {
}
extFilesVO.setStoragePeriod(storagePeriod);
// 文件数
Integer fileNumber = extFilesVO.getFileNumber();
if (ObjectUtils.isEmpty(fileNumber)) {
fileNumber = extFilesUpdateVO.getFileNumber();
} else {
}
extFilesVO.setFileNumber(fileNumber);
// 总文件页数
Integer pageNumber = extFilesVO.getPageNumber();
if (ObjectUtils.isEmpty(pageNumber)) {
pageNumber = extFilesUpdateVO.getPageNumber();
} else {
}
extFilesVO.setPageNumber(pageNumber);
extFilesVO.setOperator(OperatorType.MODIFY);
extFilesVOList.add(extFilesVO);
}
}
if (CollectionUtils.isNotEmpty(extFilesVOList)) {
this.saveRecursion((V) extFilesVOList);
}
}
}
package com.inet.dcs.document.core.service.impl;
import com.inet.dcs.document.common.vo.ExtFilesDocLinkVO;
import com.inet.dcs.document.common.vo.ExtFilesVO;
import com.inet.dcs.document.common.vo.ExtTransferDocLinkVO;
import com.inet.dcs.document.common.vo.ExtTransferDocumentVO;
import com.inet.dcs.document.common.vo.archivesOtherVO.ExtFilesUpdateVO;
......@@ -16,6 +18,7 @@ import com.inet.dcs.document.core.service.expand.ExtDxDocumentService;
import com.inet.dcs.document.core.service.impl.expand.ExtDxDocumentServiceImpl;
import com.inet.dcs.document.core.util.SearchUtil;
import com.inet.dcs.document.entity.po.ExtTransferDocument;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
......@@ -24,6 +27,8 @@ import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basic.feign.expand.ExtDxContextProjectServiceFeign;
import com.yonde.dex.context.common.vo.DxContextProjectVO;
import com.yonde.dex.dao.service.DxDaoPluginExpander;
import com.yonde.dex.dict.feign.DictDataFeignService;
import com.yonde.dex.dict.service.vo.DictDataVO;
import com.yonde.dex.user.common.vo.DxUserInfoVO;
import com.yonde.dex.user.feign.DxUserInfoFeign;
import com.yonde.dex.wfc.common.enums.TaskStateEnum;
......@@ -32,6 +37,7 @@ import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -40,7 +46,6 @@ import java.time.ZoneId;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -85,6 +90,9 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
@Autowired
private DxUserInfoFeign userService;
@Autowired
private DictDataFeignService dictDataService;
@Override
public void postUpdate(Collection<V> target, Collection<V> origin) {
for (V v : target) {
......@@ -129,13 +137,6 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
String archiveNumber = extTransferDocLinkVO.getArchiveNumber();
// TODO 查询linK判断是否数据库存在
}
log.info("=================开始=绑定案卷关系同时反更新案卷信息================");
// 3.绑定案卷文件关联关系
this.saveFilesDocLink(transferDocLinkVOList);
// 4.更新案卷下部分信息
this.updateExtFilesByBelongingCaseFile(transferDocLinkVOList);
log.info("=================结束=绑定案卷关系同时反更新案卷信息================");
}
@Override
......@@ -187,7 +188,6 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
if (wf.getState().equals(TaskStateEnum.COMPLETE.name()) && (SignConstants.WfResultList.contains(wf.getResult()))) {
Date endTime = wf.getEndTime();
return endTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
}
}
}
......@@ -215,6 +215,47 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
}
@Override
public void saveFilesDocLink(List<ExtFilesUpdateVO> extFilesUpdateVOList) {
List<ExtFilesVO> extFilesVOList = Lists.newArrayList();
List<Long> extFilesDocLinkIds = Lists.newArrayList();
ExtFilesUpdateVO extFilesUpdateVO = extFilesUpdateVOList.get(0);
SearchQueryCondition queryCondition = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, extFilesUpdateVO.getFilesId());
ExtFilesVO extFilesVO = (ExtFilesVO) extFilesService.findRecursion(queryCondition).getContent().get(0);
extFilesVOList.add(extFilesVO);
for (ExtFilesUpdateVO extFilesUpdate : extFilesUpdateVOList) {
// 是否以前归属过案卷
List<ExtFilesDocLinkVO> filesDocLinkVOList = extFilesDocLinkService.getFilesDocLinkBySourceId(extFilesUpdate.getDocId());
if (ObjectUtils.isNotEmpty(filesDocLinkVOList)) {
ExtFilesDocLinkVO extFilesDocLinkVO = filesDocLinkVOList.get(0);
ExtFilesVO target = extFilesDocLinkVO.getTarget();
extFilesVOList.add(target);
extFilesDocLinkIds.add(extFilesDocLinkVO.getId());
}
SearchQueryCondition query = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, extFilesUpdate.getDocId());
DxDocumentVO dxDocumentVO = (DxDocumentVO) extDxDocumentService.findRecursion(query).getContent().get(0);
extFilesUpdate.setExtFilesVO(extFilesVO);
extFilesUpdate.setDxDocumentVO(dxDocumentVO);
}
// 1.删除以前关系并重新计算以前案卷下为文档下最大密级、保管年限、文件数,总文件数
if (CollectionUtils.isNotEmpty(extFilesDocLinkIds)) {
extFilesDocLinkService.deleteAllById(extFilesDocLinkIds);
}
// 2.绑定新的案卷文档关联关系
extFilesDocLinkService.saveFilesDocLink(extFilesUpdateVOList);
// 3.重新计算案卷下为文档下最大密级、保管年限、文件数,总文件数
if (CollectionUtils.isNotEmpty(extFilesVOList)) {
this.updateExtFilesByBelongingCaseFile(extFilesVOList);
}
}
@Override
public DxUserInfoVO getSignInfo(List<DxWfProcessTaskVO> activities, String activityName) {
for (DxWfProcessTaskVO wf : activities) {
......@@ -230,44 +271,63 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
return null;
}
private void saveFilesDocLink(List<ExtTransferDocLinkVO> transferDocLinkVOList) {
List<ExtFilesUpdateVO> extFilesUpdateVOList = Lists.newArrayList();
for (ExtTransferDocLinkVO extTransferDocLinkVO : transferDocLinkVOList) {
ExtFilesUpdateVO extFilesUpdateVO = new ExtFilesUpdateVO();
extFilesUpdateVO.setBelongingCaseFile(extTransferDocLinkVO.getBelongingCaseFile());
extFilesUpdateVO.setDxDocumentVO(extTransferDocLinkVO.getSource());
extFilesUpdateVOList.add(extFilesUpdateVO);
private void updateExtFilesByBelongingCaseFile(List<ExtFilesVO> extFilesVOList) {
for (ExtFilesVO extFilesVO : extFilesVOList) {
String volumeNumber = extFilesVO.getVolumeNumber();
int pageNumber = 0; //文件页数
String secretCode = ""; //最大密级
Integer secretCodeDictSeq = 0;
String storagePeriod = ""; //最大年限
Integer storagePeriodDictSeq = 0;
// 案卷下的文档
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("source").build())
.searchItems(SearchItems.builder()
.item(new SearchItem("belongingCaseFile", SearchItem.Operator.EQ, volumeNumber, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
List<ExtTransferDocLinkVO> extTransferDocLinkVOList = extTransferDocLinkService.findRecursion(queryDoc).getContent();
for (ExtTransferDocLinkVO extTransferDocLinkVO : extTransferDocLinkVOList) {
String secretCodeDoc = extTransferDocLinkVO.getSource().getSecretCode();
List<DictDataVO> dictDataVOByKey = this.getDictDataVOByKey(Constants.SECRET_CODE, secretCodeDoc);
// todo 获取最大密级和年限
if (CollectionUtils.isNotEmpty(dictDataVOByKey)) {
DictDataVO dictDataVO = dictDataVOByKey.get(0);
String dictKey = dictDataVO.getDictKey();
secretCodeDictSeq = dictDataVO.getDictSeq();
secretCode = this.getCompareMax(Constants.SECRET_CODE, secretCode, secretCodeDictSeq);
}
extFilesDocLinkService.saveFilesDocLink(extFilesUpdateVOList);
//storagePeriod = this.getCompareMax(Constants.SECRET_CODE, extTransferDocLinkVO.getStoragePeriod());
pageNumber += extTransferDocLinkVO.getPageNumber();
}
private void updateExtFilesByBelongingCaseFile(List<ExtTransferDocLinkVO> transferDocLinkVOList) {
Map<String, List<ExtTransferDocLinkVO>> belongingCaseFileMap = transferDocLinkVOList.stream()
.collect(Collectors.groupingBy(ExtTransferDocLinkVO::getBelongingCaseFile));
ExtFilesUpdateVO filesUpdateVO = new ExtFilesUpdateVO();
filesUpdateVO.setSecretCode(secretCode);
filesUpdateVO.setStoragePeriod(storagePeriod);
filesUpdateVO.setFileNumber(extTransferDocLinkVOList.size());
filesUpdateVO.setPageNumber(pageNumber);
extFilesService.updateExtFiles(extFilesVO, filesUpdateVO);
}
}
List<ExtFilesUpdateVO> extFilesUpdateVOList = Lists.newArrayList();
belongingCaseFileMap.forEach((key, value) -> {
ExtFilesUpdateVO extFilesUpdateVO = new ExtFilesUpdateVO();
String secretCode = ""; //最大密级
String storagePeriod = ""; //最大年限
int fileNumber = 0;
int pageNumber = value.size();
for (ExtTransferDocLinkVO extTransferDocLinkVO : value) {
// TODO 密级
extTransferDocLinkVO.getSource().getSecretCode();
// TODO 保存年限
extTransferDocLinkVO.getStoragePeriod();
// 文件页数
fileNumber += extTransferDocLinkVO.getPageNumber();
}
extFilesUpdateVO.setBelongingCaseFile(key);
extFilesUpdateVO.setSecretCode(secretCode);
extFilesUpdateVO.setStoragePeriod(storagePeriod);
extFilesUpdateVO.setFileNumber(fileNumber);
extFilesUpdateVO.setPageNumber(pageNumber);
extFilesUpdateVOList.add(extFilesUpdateVO);
});
extFilesService.updateExtFiles(extFilesUpdateVOList);
private String getCompareMax(String dictCode, String dictKey, Integer max) {
List<DictDataVO> dictDataVOList = this.getDictDataVOByKey(dictCode, dictKey);
if (CollectionUtils.isNotEmpty(dictDataVOList)) {
DictDataVO dictDataVO = dictDataVOList.get(0);
Integer dictSeq = dictDataVO.getDictSeq();
if (dictSeq > max) {
return dictDataVO.getDictKey();
}
}
return dictKey;
}
private List<DictDataVO> getDictDataVOByKey(String dictCode, String dictKey) {
List<DictDataVO> dictDataVOs = dictDataService.getDictDatas(dictCode);
if (CollectionUtils.isNotEmpty(dictDataVOs)) {
return dictDataVOs.stream().filter(dic -> dic.getDictKey().equals(dictKey)).collect(Collectors.toList());
}
return null;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment