Parcourir la source

Merge remote-tracking branch 'origin/dev' into dev

LHB il y a 1 mois
Parent
commit
4ad16aad77

+ 24 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -68,6 +68,7 @@ import org.springblade.manager.vo.WbsTreeContractVO8;
 import org.springblade.manager.vo.WbsTreePrivateAddVO;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.system.cache.ParamCache;
+import org.springblade.system.entity.Dept;
 import org.springblade.system.entity.DictBiz;
 import org.springblade.system.feign.IDictBizClient;
 import org.springblade.system.user.feign.IUserClient;
@@ -2285,6 +2286,29 @@ public R<Boolean> copyContractTreeNode(@RequestBody CopyContractTreeNodeVO vo) {
                 if (StringUtils.isEmpty(contractId)) {
                     contractId = toCopyNode.getContractId();
                 }
+                String userRole = AuthUtil.getUserRole();
+                if(!"administrator".equals(userRole) && vo.getIsCopyData() == 1){
+                    // 查询当前节点有没有数据,有数据则不能复制
+                    if(vo.getClassifyType() != null && !vo.getClassifyType().isEmpty()) {
+                        List<InformationQuery> queries = informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getContractId, contractId)
+                                .in(InformationQuery::getClassify, vo.getClassifyType()).eq(InformationQuery::getWbsId, toCopyNode.getPKeyId()).in(InformationQuery::getStatus, 1, 2));
+                        if (!queries.isEmpty()) {
+                            Map<Integer, List<InformationQuery>> map = queries.stream().collect(Collectors.groupingBy(InformationQuery::getClassify));
+                            if (vo.getClassifyType().contains("1")) {
+                                List<InformationQuery> queryList = map.get(1);
+                                if (queryList != null && !queryList.isEmpty()) {
+                                    throw new ServiceException(toCopyNode.getFullName() + "节点有施工上报数据,不允许复制");
+                                }
+                            }
+                            if (vo.getClassifyType().contains("2")) {
+                                List<InformationQuery> queryList = map.get(2);
+                                if (queryList != null && !queryList.isEmpty()) {
+                                    throw new ServiceException(toCopyNode.getFullName() + "节点有监理上报数据,不允许复制");
+                                }
+                            }
+                        }
+                    }
+                }
             }
 
             WbsTreeContract needCopyNodeRoot = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -1404,7 +1404,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
     }
 
     public void submitTrialData(TrialSelfInspectionRecord obj, TrialSelfInspectionRecordDTO dto) {
-        String pdfURL = excelTabClient.saveTabData(dto, dto.getIsBatchSave(), dto.getType(), dto.getTableType(), dto.getId(), obj.getTableIds());
+        String pdfURL = excelTabClient.saveTabData(dto, dto.getIsBatchSave(), dto.getType(), dto.getTableType(), dto.getId(), dto.getTableIds());
         if (StringUtils.isNotEmpty(pdfURL) && !pdfURL.startsWith("500")) {
             String file_path = FileUtils.getSysLocalFileUrl();
             Long snowId = SnowFlakeUtil.getId();