|
@@ -745,6 +745,66 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
|
|
|
this.saveOrUpdateBatch(changeArchiveList);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 补充默认的组卷信息
|
|
|
+ * @param trees
|
|
|
+ * @param projectId
|
|
|
+ */
|
|
|
+ public void fillDefaultArchiveAutoInfo(List<ArchiveTreeContractVO2> trees,Long projectId){
|
|
|
+
|
|
|
+ List<ContractInfo> contractInfos = contractInfoService.selectContractInfoPageByPid(projectId.toString());
|
|
|
+ if (contractInfos == null || contractInfos.size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Map<Long,ContractInfo> contractMap = new LinkedHashMap<>();
|
|
|
+ for (ContractInfo contractInfo: contractInfos) {
|
|
|
+ if (contractInfo.getContractType() == 3) {
|
|
|
+ contractMap.put(0L,contractInfo);
|
|
|
+ }
|
|
|
+ contractMap.put(contractInfo.getId(),contractInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (ArchiveTreeContractVO2 child: trees) {
|
|
|
+ Long contractId = 0L;
|
|
|
+ if (child.getContractId() != null ) {
|
|
|
+ contractId = child.getContractId();
|
|
|
+ }
|
|
|
+ ContractInfo contractInfo = contractMap.get(contractId);
|
|
|
+ if (contractInfo != null) {
|
|
|
+ fillDefaultArchiveAutoInfo(child,contractInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param node
|
|
|
+ * @param contractInfo
|
|
|
+ */
|
|
|
+ public void fillDefaultArchiveAutoInfo(ArchiveTreeContractVO2 node,ContractInfo contractInfo){
|
|
|
+ if (StringUtils.isEmpty(node.getFileNumberPrefix())) {
|
|
|
+ node.setFileNumberPrefix(contractInfo.getPrefix());
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(node.getStorageTime()) && contractInfo.getStoragePeriod() != null) {
|
|
|
+ node.setStorageTime(contractInfo.getStoragePeriod().toString());
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(node.getRollor())) {
|
|
|
+ node.setRollor(contractInfo.getFiler());
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(node.getReviewer())) {
|
|
|
+ node.setReviewer(contractInfo.getReviewer());
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(node.getSpecification())) {
|
|
|
+ //默认30mm ,对应枚举 1
|
|
|
+ node.setSpecification("1");
|
|
|
+ }
|
|
|
+ //没有默认
|
|
|
+ if (StringUtils.isEmpty(node.getArchiveNameSuffix())) {
|
|
|
+ //node.setArchiveNameSuffix(contractInfo.getPrefix());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|