소스 검색

附件保存和关联数据签字问题

zhuwei 1 주 전
부모
커밋
ace8f206a3

+ 34 - 2
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVDataServiceImpl.java

@@ -428,10 +428,42 @@ public class EVDataServiceImpl implements EVDataService {
                 taskApp.setPdfDataType(type);
                 if (StringUtils.isNotEmpty(pdfTrialUrlPosition) || StringUtils.isNotEmpty(pdfTrialUrl) || StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
                     if ("1".equals(type)) {
-                        String approvalPdf = eVisaPdfUrl.length() >= 10 ? eVisaPdfUrl : pdfUrl;
+                       /* String approvalPdf = eVisaPdfUrl.length() >= 10 ? eVisaPdfUrl : pdfUrl;
                         approvalPdf = pdfTrialUrl.length() >= 10 ? pdfTrialUrl : approvalPdf;
                         approvalPdf = pdfTrialUrlPosition.length() >= 10 ? pdfTrialUrlPosition : approvalPdf;
-                        taskApp.setSignPdfUrl(getHppsToHttp(approvalPdf));
+                        taskApp.setSignPdfUrl(getHppsToHttp(approvalPdf));*/
+                        String nodeDdfUrl = map.get("node_pdf_url") + "";
+                        if(pdfTrialUrlPosition!=null && pdfTrialUrlPosition.length()>=10){
+                            taskApp.setSignPdfUrl(getHppsToHttp(pdfTrialUrlPosition));
+                        }else if(pdfTrialUrl!=null && pdfTrialUrl.length()>=10 ){
+                            if(eVisaPdfUrl!=null && eVisaPdfUrl.length()>=10){
+                                taskApp.setSignPdfUrl(getHppsToHttp(eVisaPdfUrl));
+                            }else{
+                                if(nodeDdfUrl!=null && nodeDdfUrl.length()>=10){
+                                    taskApp.setSignPdfUrl(getHppsToHttp(nodeDdfUrl));
+                                }else{
+                                    List<String> pdfList = new ArrayList<>();
+                                    pdfList.add(pdfUrl);
+                                    pdfList.add(pdfTrialUrl);
+                                    String file_path = FileUtils.getSysLocalFileUrl();
+                                    Long id = SnowFlakeUtil.getId();
+                                    String listPdf = file_path + "/pdf/" +id + ".pdf";
+                                    File pdf2 = ResourceUtil.getFile(listPdf);
+                                    if (pdf2.exists()) {
+                                        pdf2.delete();
+                                    }
+                                    FileUtils.mergePdfPublicMethods(pdfList, file_path);
+                                    BladeFile bladeFile = newIOSSClient.uploadFile(id+".pdf", file_path);
+                                    if (bladeFile != null) {
+                                        taskApp.setSignPdfUrl(getHppsToHttp(bladeFile.getLink()));
+                                    }
+                                }
+                            }
+                        }else if (eVisaPdfUrl!=null && eVisaPdfUrl.length()>=10){
+                            taskApp.setSignPdfUrl(getHppsToHttp(eVisaPdfUrl));
+                        }else if (pdfUrl!=null && pdfUrl.length()>=10){
+                            taskApp.setSignPdfUrl(getHppsToHttp(pdfUrl));
+                        }
                     } else if ("2".equals(type)) {
                         if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
                             //试验原始pdf

+ 0 - 1
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java

@@ -94,7 +94,6 @@ import java.net.URL;
 import java.nio.charset.StandardCharsets;
 import java.util.*;
 import java.util.stream.Collectors;
-
 @Service
 @AllArgsConstructor
 public class EVisaServiceImpl implements EVisaService {

+ 3 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/SubTable.java

@@ -114,12 +114,13 @@ public class SubTable {
 
 
     /**将项目信息写入附表元素*/
-    public void flush() {
+    public void flush(boolean isUpdate) {
         if(!checked()){
             return;
         }
+
         /*获取项目数据*/
-        List<Item> itemList =getPutOutList();
+        List<Item> itemList =getPutOutList(isUpdate);
         if (itemList.size() > 0) {
             /*行号,起始为0,当前行号整除列大小余0就是每页首行*/
             AtomicInteger index=new AtomicInteger(0);

+ 10 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -1836,11 +1836,12 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             List<FormData> inspectionList = new ArrayList<>();
             /*1检验表5评定表*/
             List<NodeTable> mainTable = tec.getTableAll().stream().filter(e -> (e.getTableType().equals(1) || e.getTableType().equals(5)) && !e.getNodeName().contains("附表") && tec.getCurrentNode().getNodeType() > 3).collect(Collectors.toList());
+            List<NodeTable> mainFBTable = tec.getTableAll().stream().filter(e -> (e.getTableType().equals(1) || e.getTableType().equals(5)) && e.getNodeName().contains("附表") && tec.getCurrentNode().getNodeType() > 3).collect(Collectors.toList());
             if (Func.isEmpty(mainTable)) {
                 return;
             }
             List<NodeTable> mainTableList = mainTable.stream().collect(Collectors.groupingBy(NodeTable::getInitTableName)).values().stream().map(l -> l.get(0)).collect(Collectors.toList());
-            /*NodeTable main = mainTable.get(0);*/
+            // 删除多少的主表信息
             List<Long> pkeyIdsMain = mainTableList.stream().map(NodeTable::getPKeyId).collect(Collectors.toList());
             if (mainTable.size() > 1) {
                 List<Long> removeIds = mainTable.stream().map(NodeTable::getPKeyId).filter(x -> !pkeyIdsMain.contains(x)).collect(Collectors.toList());
@@ -1857,6 +1858,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                     /*this.wbsTreeContractMapper.deleteLogicByIds(removeIds);*/
                 }
             }
+
+
             /*多余的表删除之后需要,裁剪多余表头数据保留全部实测数据然后重新设置增页大小*/
             for (NodeTable mt : mainTableList) {
                 tec.getKeyMappers().stream().filter(e -> e.getPkId().equals(mt.getPKeyId())).map(KeyMapper::getCode).forEach(e -> {
@@ -1880,7 +1883,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                     }
                 });
             }
-            if (Func.isNotEmpty(inspectionList)) {
+            // 校验附表的数据
                 /*检查是否存在附表,不存在挂载*/
                 List<NodeTable> subTabList = tec.getTableAll().stream().filter(e -> e.getNodeName().contains("附表") && (e.getTableType() == 1 || e.getTableType() == 5)).collect(Collectors.toList());
                 if (subTabList.size() == 0) {
@@ -1897,12 +1900,13 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 SubTable sta = new SubTable(subTableFds, tec, mainTableList);
                 sta.put(inspectionList);
                 /*把附表数据刷入对应的附表元素对象*/
-                sta.flush();
+                sta.flush(inspectionList.size()==0);
                 /*把主表的表头表尾信息拷贝*/
                 headerFooterSub(subTableFds, tec);
                 /*如果识别到手填内容需要在附表写入数据后,更新评定关联数据*/
+            /*if (Func.isNotEmpty(inspectionList)) {
             }else {
-                if(StringUtils.isNotEmpty(tec.getIsRemoveForSubTab())&&"1".equals(tec.getIsRemoveForSubTab())){
+               // if(StringUtils.isNotEmpty(tec.getIsRemoveForSubTab())&&"1".equals(tec.getIsRemoveForSubTab())){
                     List<NodeTable> subTabList = tec.getTableAll().stream().filter(e -> e.getNodeName().contains("附表") && (e.getTableType() == 1 || e.getTableType() == 5)).collect(Collectors.toList());
                     if(!subTabList.isEmpty()){
                         String queryIds = subTabList.stream().map(e -> e.getPKeyId() + "").collect(Collectors.joining(","));
@@ -1913,8 +1917,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                             this.wbsTreeContractMapper.deleteLogicByIds(ids);
                         }
                     }
-                }
-            }
+              //  }
+            }*/
         } catch (Exception e) {
             e.printStackTrace();
         }