Commit 7f1cd55c authored by wei's avatar wei 🎱

案卷需要校验重重

parent 7c37e00c
...@@ -6,18 +6,20 @@ import com.inet.dcs.document.core.service.ExtFilesService; ...@@ -6,18 +6,20 @@ import com.inet.dcs.document.core.service.ExtFilesService;
import com.inet.dcs.document.core.util.SearchUtil; import com.inet.dcs.document.core.util.SearchUtil;
import com.inet.dcs.document.entity.po.ExtFiles; import com.inet.dcs.document.entity.po.ExtFiles;
import com.yonde.dex.basedata.data.search.SearchItem; import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition; import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl; import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.exception.DxBusinessException; import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basic.feign.expand.ExtDxContextProjectServiceFeign; import com.yonde.dex.basic.feign.expand.ExtDxContextProjectServiceFeign;
import com.yonde.dex.context.common.vo.DxContextProjectVO;
import com.yonde.dex.context.common.vo.DxContextVO; import com.yonde.dex.context.common.vo.DxContextVO;
import com.yonde.dex.dao.service.DxDaoPluginExpander; import com.yonde.dex.dao.service.DxDaoPluginExpander;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection; import java.util.Collection;
import java.util.List;
/** /**
* @description: ExtFiles-ServiceImpl * @description: ExtFiles-ServiceImpl
...@@ -55,10 +57,29 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic ...@@ -55,10 +57,29 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
String caseNumber = this.getCaseNumber(v.getCaseNumber()); String caseNumber = this.getCaseNumber(v.getCaseNumber());
String categoryNumber = v.getCategoryNumber(); String categoryNumber = v.getCategoryNumber();
String volumeNumber = "2-".concat(projectCodeAndNumber + "-").concat(categoryNumber + "-").concat(caseNumber); String volumeNumber = "2-".concat(projectCodeAndNumber + "-").concat(categoryNumber + "-").concat(caseNumber);
List<ExtFilesVO> recursionByVolumeNumber = this.findRecursionByVolumeNumber(volumeNumber);
if (CollectionUtils.isNotEmpty(recursionByVolumeNumber)) {
throw new DxBusinessException("500", "案卷序号已存在");
}
v.setVolumeNumber(volumeNumber); v.setVolumeNumber(volumeNumber);
} }
} }
/**
* 根据案卷序号查询案卷
*
* @param volumeNumber
* @return
*/
private List<ExtFilesVO> findRecursionByVolumeNumber(String volumeNumber) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.searchItems(SearchItems.builder()
.item(new SearchItem("volumeNumber", SearchItem.Operator.EQ, volumeNumber, null))
.item(new SearchItem("latest", SearchItem.Operator.EQ, true, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
return (List<ExtFilesVO>) this.findRecursion(queryDoc).getContent();
}
private String getProjectCodeAndNumber(DxContextVO dxContext) { private String getProjectCodeAndNumber(DxContextVO dxContext) {
boolean projectClass = false; boolean projectClass = false;
// 项目群上的合同编号 // 项目群上的合同编号
......
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