zhuwei 17 hours ago
parent
commit
18e9ce9fa2

+ 3 - 0
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/entity/ScanFile.java

@@ -49,4 +49,7 @@ public class ScanFile {
     private Integer isDeleted;
     @ApiModelProperty(value = "是否移动")
     private Integer isMove;
+    @ApiModelProperty(value = "识别状态 0:未扫描 1:识别中 2:识别成功 99:识别失败")
+    private Integer scanStatus;
+
 }

+ 1 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ScanFileServiceImpl.java

@@ -484,6 +484,7 @@ public class ScanFileServiceImpl  extends ServiceImpl<ScanFileMapper, ScanFile>
                     bladeFile.getLink(),//OSS路径
                     null,//负责人
                     0,
+                    0,
                     0
             );
             // 入库

+ 3 - 3
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/Archive2Controller.java

@@ -59,12 +59,12 @@ public class Archive2Controller {
     @Resource(name = "archivePoolExecutor")
     private ThreadPoolExecutor archExecutor;
 
-    //@Scheduled(cron = "0/30 * * * * ?")
+    @Scheduled(cron = "0/30 * * * * ?")
     public void SignTaskBatchPng() {
         //执行代码
         log.info("分解pdf专图片");
        // String sql = "SELECT distinct b.id,b.archive_id as archiveId ,REPLACE(b.file_url,'https://xinan1.zos.ctyun.cn','http://100.86.2.1:80') as fileUrl from u_archives_auto a ,u_archive_file b  where a.id=b.archive_id  and a.is_deleted=0 and b.is_deleted=0 and a.split_status=10 LIMIT 20";
-        String sql = "SELECT distinct b.id,b.archive_id as archiveId ,b.file_url as fileUrl from u_archives_auto a ,u_archive_file b  where a.id=b.archive_id  and a.is_deleted=0 and b.is_deleted=0 and a.split_status=10 and a.id=1945020959844990977 LIMIT 20";
+        String sql = "SELECT distinct b.id,b.archive_id as archiveId ,b.file_url as fileUrl from u_archives_auto a ,u_archive_file b  where a.id=b.archive_id  and a.is_deleted=0 and b.is_deleted=0 and a.split_status=10 LIMIT 20";
         List<TaskArchiveSplitVO> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TaskArchiveSplitVO.class));
 
         if (query != null && query.size() >= 1) {
@@ -332,7 +332,7 @@ public class Archive2Controller {
             }
         } catch (Exception e) {
             e.printStackTrace();
-            return "1";
+            return "0";
         }
     }
 

+ 3 - 3
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/ArchiveController.java

@@ -69,8 +69,8 @@ public class ArchiveController {
     public void SignTaskBatchPng() {
         //执行代码
         log.info("分解pdf专图片");
-        String sql = "SELECT distinct b.id,b.archive_id as archiveId ,REPLACE(b.file_url,'https://xinan1.zos.ctyun.cn','http://100.86.2.1:80') as fileUrl,c.id as taskId from u_archives_auto a , u_archive_file b ,u_task_split c  where a.id=b.archive_id and ((FIND_IN_SET(a.id,c.ids) and c.type=3) or (a.contract_id=c.contract_id and c.type=2)) and a.is_deleted=0 and b.is_deleted=0 and a.split_status not in(1,2) LIMIT 20";
-      //  String sql = "SELECT distinct b.id,b.archive_id as archiveId ,b.file_url as fileUrl,c.id as taskId from u_archives_auto a , u_archive_file b ,u_task_split c  where a.id=b.archive_id and ((FIND_IN_SET(a.id,c.ids) and c.type=3) or (a.contract_id=c.contract_id and c.type=2)) and a.is_deleted=0 and b.is_deleted=0 and a.split_status not in(1,2) and a.id=1947207326716919808 LIMIT 20";
+       // String sql = "SELECT distinct b.id,b.archive_id as archiveId ,REPLACE(b.file_url,'https://xinan1.zos.ctyun.cn','http://100.86.2.1:80') as fileUrl,c.id as taskId from u_archives_auto a , u_archive_file b ,u_task_split c  where a.id=b.archive_id and ((FIND_IN_SET(a.id,c.ids) and c.type=3) or (a.contract_id=c.contract_id and c.type=2)) and a.is_deleted=0 and b.is_deleted=0 and a.split_status not in(1,2) LIMIT 20";
+        String sql = "SELECT distinct b.id,b.archive_id as archiveId ,b.file_url as fileUrl,c.id as taskId from u_archives_auto a , u_archive_file b ,u_task_split c  where a.id=b.archive_id and ((FIND_IN_SET(a.id,c.ids) and c.type=3) or (a.contract_id=c.contract_id and c.type=2)) and a.is_deleted=0 and b.is_deleted=0 and a.split_status not in(1,2) LIMIT 20";
         List<TaskArchiveSplitVO> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TaskArchiveSplitVO.class));
 
         if (query != null && query.size() >= 1) {
@@ -170,7 +170,7 @@ public class ArchiveController {
             e.printStackTrace();
         }
     }
-   // @Scheduled(cron = "0/30 * * * * ?")
+  //  @Scheduled(cron = "0/30 * * * * ?")
     public void SplitPdfInfo() {
         //执行代码
         log.info("分解html开始");

+ 1 - 1
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/ChekSignData.java

@@ -47,7 +47,7 @@ public class ChekSignData {
     @Resource(name = "taskExecutor1")
     private ThreadPoolExecutor executor;
 
-    @Scheduled(cron = "0/10 * * * * ?")
+//    @Scheduled(cron = "0/10 * * * * ?")
     public void SignInfo() {
         // 质检SQL
         String sql = "SELECT a.id ,a.e_visa_pdf_url,b.process_instance_id,a.contract_id,a.project_id,c.remark_type from u_information_query a ,u_task b ,m_project_info c where  c.id=a.project_id  and a.`status` in(1,2) and a.is_deleted=0 and a.e_visa_pdf_url is not null  and b.form_data_id = a.id and b.`status` in(1,2) and a.chek_status=1 LIMIT 30";

+ 1 - 1
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVController.java

@@ -58,7 +58,7 @@ public class EVController {
     @Resource(name = "taskExecutor1")
     private ThreadPoolExecutor executor;
 
-    @Scheduled(cron = "0/10 * * * * ?")
+   // @Scheduled(cron = "0/10 * * * * ?")
     public void SignInfo() {
         //执行代码
 

+ 228 - 0
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/ScanFileController.java

@@ -0,0 +1,228 @@
+package org.springblade.evisa.controller;
+
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.rendering.PDFRenderer;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springblade.common.utils.CommonUtil;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.IoUtil;
+import org.springblade.evisa.utils.FileUtils;
+import org.springblade.evisa.vo.ArchivesSplitInfoVO;
+import org.springblade.evisa.vo.TaskArchiveSplitVO;
+import org.springblade.resource.feign.NewIOSSClient;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+
+/**
+ * 扫描文件的分解识别
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+@RestController
+@AllArgsConstructor
+@Api(value = "扫描文件的分解识别", tags = "扫描文件的分解识别接口")
+@Slf4j
+public class ScanFileController {
+
+    private final StringRedisTemplate RedisTemplate;
+
+    private final JdbcTemplate jdbcTemplate;
+
+    private final NewIOSSClient newIOSSClient;
+
+    // 线程池
+    @Resource(name = "archivePoolExecutor")
+    private ThreadPoolExecutor archExecutor;
+
+ //   @Scheduled(cron = "0/30 * * * * ?")
+    public void SignTaskBatchPng() {
+        //执行代码
+        log.info("扫描文件的分解识别");
+       // String sql = "SELECT distinct b.id,b.archive_id as archiveId ,REPLACE(b.file_url,'https://xinan1.zos.ctyun.cn','http://100.86.2.1:80') as fileUrl,c.id as taskId from u_archives_auto a , u_archive_file b ,u_task_split c  where a.id=b.archive_id and ((FIND_IN_SET(a.id,c.ids) and c.type=3) or (a.contract_id=c.contract_id and c.type=2)) and a.is_deleted=0 and b.is_deleted=0 and a.split_status not in(1,2) LIMIT 20";
+        String sql = "SELECT a.id,a.oss_url as fileUrl, b.id as taskId  from scan_file a,u_task_split b where ((FIND_IN_SET(a.id,b.ids) and b.type=3) or (a.contract_id=b.contract_id and b.type=2)) and b.data_type=2 and a.is_deleted=0 and b.is_deleted=0 ";
+        List<TaskArchiveSplitVO> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TaskArchiveSplitVO.class));
+
+        if (query != null && query.size() >= 1) {
+            for (TaskArchiveSplitVO dataInfo : query) {
+                if (archExecutor.getQueue().size() <= 20) {
+                    Boolean aBoolean = RedisTemplate.hasKey("scanpdf-" + dataInfo.getArchiveId());
+                    if (!aBoolean) {
+                        RedisTemplate.opsForValue().setIfAbsent("scanpdf-" + dataInfo.getArchiveId(), "1", 600, TimeUnit.SECONDS);
+                        CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
+                            try {
+                                signTaskBatchpngToHtml(dataInfo);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }, archExecutor);
+                    }
+                }
+            }
+        }
+        System.out.println("队列_扫描分解_img" + archExecutor.getQueue().size());
+        System.out.println("活跃_扫描分解__img" + archExecutor.getActiveCount());
+        System.out.println("总共_扫描分解__img" + archExecutor.getTaskCount());
+        System.out.println("完成_扫描分解__img" + archExecutor.getCompletedTaskCount());
+    }
+
+    // 分解第一页的任务
+
+    public void signTaskBatchpngToHtml(TaskArchiveSplitVO taskSign) {
+        try {
+            String fileUrl = taskSign.getFileUrl();
+            String archiveId = taskSign.getArchiveId();
+            String id = taskSign.getId();
+            String taskId = taskSign.getTaskId();
+            List<String> listPdf = new ArrayList<>();
+
+            String firstUrl = FileUtils.getSysLocalFileUrl() + "archiveScan/" + archiveId + "first__" + 1 + "__.pdf";
+            File file = new File(firstUrl);
+            if (!file.exists()) {
+                int pdfByPage = getPdfByPage(1, 1, fileUrl, firstUrl);
+            }
+
+            // 保存第一页为300DPI图片
+            String imagePath = FileUtils.getSysLocalFileUrl() + "archiveScan/" + archiveId + "first__" + 1 + "__.png";
+            File imgfile = new File(imagePath);
+            if (!imgfile.exists()) {
+                int dataNum = savePdfAsImage(1, firstUrl, imagePath);
+            }
+
+            file.delete();
+            String state = getImgDataInfo(imagePath, "1");
+
+
+        } catch (Exception e) {
+            System.out.println("12321312");
+            e.printStackTrace();
+        }
+    }
+
+    public static String getImgDataInfo(String fileUrl, String type) {
+        String lasHhtmlUrl = "";
+        try {
+            // 定义Python解释器路径和脚本路径
+            String pythonScript = "/Users/hongchuangyanfa/PycharmProjects/PythonProject/ScanPngInfo.py";
+            // 构建命令
+            ProcessBuilder pb = new ProcessBuilder("python3", pythonScript, fileUrl, type);
+            Process process = pb.start();
+
+            // 读取Python脚本输出
+            BufferedReader reader = new BufferedReader(
+                    new InputStreamReader(process.getInputStream()));
+            String htmlUrl;
+            while ((htmlUrl = reader.readLine()) != null) {
+                System.out.println("222" + htmlUrl);
+                if (htmlUrl.indexOf("标题123x") >= 0) {
+                    System.out.println(htmlUrl);
+                }
+
+                if (htmlUrl.indexOf("单位") >= 0) {
+                    System.out.println(htmlUrl);
+                }
+                if (htmlUrl.indexOf("时间") >= 0) {
+                    System.out.println(htmlUrl);
+                }
+            }
+            // 等待进程结束
+            int exitCode = process.waitFor();
+            if (exitCode == 0) {
+                return lasHhtmlUrl;
+            } else {
+                return "1";
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "1";
+        }
+    }
+
+
+    public static int getPdfByPage(int startPage, int endPage, String filePath, String savePath) {
+        try {
+            InputStream inputStreamByUrl = CommonUtil.getOSSInputStream3(filePath);
+            // 加载PDF文件
+            PDDocument document = PDDocument.load(inputStreamByUrl);
+            // 创建新文档
+            PDDocument newDocument = new PDDocument();
+
+            // 注意:PDFBox中的页面索引从0开始
+            int actualStart = Math.max(0, startPage - 1); // 将用户输入的1转换为0
+            int actualEnd = Math.min(document.getNumberOfPages() - 1, endPage - 1); // 将用户输入的10转换为9
+
+            // 添加指定范围的页面
+            for (int i = actualStart; i <= actualEnd; i++) {
+                PDPage page = document.getPage(i);
+                newDocument.addPage(page);
+            }
+
+            // 保存为新文件
+            newDocument.save(savePath);
+            newDocument.close();
+            document.close();
+            return 0;
+        } catch (Exception e) {
+            return 1;
+        }
+    }
+
+    public static int savePdfAsImage(int pageNum, String filePath, String outputPath) {
+        try (InputStream inputStream = FileUtils.getInputStreamByUrl(filePath);
+             PDDocument document = PDDocument.load(inputStream)) {
+
+            // 验证页码范围
+            if (pageNum < 1 || pageNum > document.getNumberOfPages()) {
+                return 1;
+            }
+
+            PDFRenderer renderer = new PDFRenderer(document);
+
+            // 设置DPI为300
+            final int DPI = 300;
+
+            // 渲染指定页面(注意PDFBox使用0-based索引)
+            //BufferedImage image = renderer.renderImage(pageNum - 1, DPI / 72f);
+            BufferedImage image = renderer.renderImageWithDPI(0, DPI); // 0 表示第一页
+            // 确保输出目录存在
+            File outputFile = new File(outputPath);
+            outputFile.getParentFile().mkdirs();
+
+            // 保存为PNG格式(可改为JPG等)
+            ImageIO.write(image, "PNG", outputFile);
+
+            log.info("PDF页面已成功保存为图片: {}", outputPath);
+            inputStream.close();
+            document.close();
+            return 0;
+        } catch (Exception e) {
+            log.error("PDF转图片失败", e);
+            return 1;
+        }
+    }
+
+}

+ 0 - 181
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/testTaskInfo.java

@@ -1,181 +0,0 @@
-package org.springblade.evisa.controller;
-
-import io.swagger.annotations.Api;
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.pdfbox.pdmodel.PDDocument;
-import org.apache.pdfbox.pdmodel.PDPage;
-import org.apache.pdfbox.rendering.PDFRenderer;
-import org.jsoup.Jsoup;
-import org.jsoup.nodes.Document;
-import org.jsoup.nodes.Element;
-import org.jsoup.select.Elements;
-import org.springblade.common.utils.CommonUtil;
-import org.springblade.common.utils.SnowFlakeUtil;
-import org.springblade.core.launch.StartEventListener;
-import org.springblade.core.oss.model.BladeFile;
-import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.IoUtil;
-import org.springblade.evisa.utils.FileUtils;
-import org.springblade.evisa.vo.ArchivesSplitInfoVO;
-import org.springblade.evisa.vo.TaskArchiveSplitVO;
-import org.springblade.resource.feign.NewIOSSClient;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.StringRedisTemplate;
-import org.springframework.jdbc.core.BeanPropertyRowMapper;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import javax.imageio.ImageIO;
-import java.awt.image.BufferedImage;
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-
-/**
- * 清表基础数据表 控制器
- *
- * @author BladeX
- * @since 2022-05-18
- */
-@RestController
-@AllArgsConstructor
-@Api(value = "电签类", tags = "电签类接口")
-@Slf4j
-public class testTaskInfo {
-
-    private final StringRedisTemplate RedisTemplate;
-
-    private final JdbcTemplate jdbcTemplate;
-
-    private final NewIOSSClient newIOSSClient;
-
-    // 线程池
-    @Resource(name = "archivePoolExecutor")
-    private ThreadPoolExecutor archExecutor;
-    @Autowired
-    private StartEventListener startEventListener;
-
-    //@Scheduled(cron = "0/20 * * * * ?")
-    public void SignTaskBatchPng() {
-        //执行代码
-        log.info("分解pdf专图片");
-     
-        String sql = "select * from u_information_query_zhu where is_deleted=0 and wbs_id=1932616157764780032 ";
-        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
-        if (mapList != null && mapList.size() >= 1) {
-            for (Map<String, Object> dataInfo : mapList) {
-
-                String ndid=dataInfo.get("id")+"";
-                String contractId=dataInfo.get("contract_id")+"";
-                String projectId=dataInfo.get("project_id")+"";
-                String classify=dataInfo.get("classify")+"";
-                String wbs_id=dataInfo.get("wbs_id")+"";
-
-
-                if (archExecutor.getQueue().size() <= 30) {
-                    Boolean aBoolean = RedisTemplate.hasKey("taskIdxx-" + ndid);
-                    if (!aBoolean) {
-                        RedisTemplate.opsForValue().setIfAbsent("taskIdxx-" + ndid, "1", 600, TimeUnit.SECONDS);
-                        CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
-                            try {
-                                signTaskBatchpngToHtml(ndid,contractId,projectId,classify,wbs_id);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            }
-                        }, archExecutor);
-                    }
-                }
-            }
-        }
-        System.out.println("队列数量_img" + archExecutor.getQueue().size());
-        System.out.println("活跃数量_img" + archExecutor.getActiveCount());
-        System.out.println("总共数量_img" + archExecutor.getTaskCount());
-        System.out.println("完成数量_img" + archExecutor.getCompletedTaskCount());
-    }
-
-    // 分解第一页的任务
-
-    public void signTaskBatchpngToHtml(String ndid,String contractId,String projectId,String classify,String wbs_id) {
-        //
-
-        String taownInfo = "";
-        if(classify.equals("1")){
-            taownInfo="1,2,3";
-        }
-        if(classify.equals("2")){
-            taownInfo="4,5,6";
-        }
-        String  node_info = "select * from m_wbs_tree_contract where is_deleted=0 and table_owner in("+taownInfo+") and p_id = '" + wbs_id + "'";
-        List<Map<String, Object>> nodeInfoList = jdbcTemplate.queryForList(node_info);
-        if(nodeInfoList!=null && nodeInfoList.size()>=1){
-          String priIds = nodeInfoList.stream().map(m -> m.get("is_type_private_pid")).map(Object::toString).collect(Collectors.joining(","));
-            String qweq = nodeInfoList.get(0).get("ancestors_p_id")+"";
-            System.out.println("qweq"+qweq);
-            List<String> str = Func.toStrList(qweq);
-
-            for(int i=1;i<=5;i++){
-                String anId = str.get(str.size() - i-1);
-                String sqldat ="";
-                if(i==5){
-                    sqldat= " SELECT c.p_id, c.aaCount,(SELECT b.id from u_information_query a ,u_task b where a.id=b.form_data_id and a.wbs_id=c.p_id and b.contract_id="+contractId+"  and  a.is_deleted=0 and b.is_deleted=0 ORDER BY a.`status` desc LIMIT 1) as taskId from ("+
-                            "select p_id,count(1) as aaCount from m_wbs_tree_contract where is_deleted=0 and contract_id = '" + contractId + "' and table_owner in ( " + taownInfo + " ) and is_type_private_pid in("+priIds+") and p_id<>"+wbs_id+" group by p_id "+
-                            " ) c ";
-                }else{
-                    sqldat= " SELECT c.p_id, c.aaCount,(SELECT b.id from u_information_query a ,u_task b where a.id=b.form_data_id and a.wbs_id=c.p_id and a.is_deleted=0 and b.contract_id="+contractId+"  and b.is_deleted=0 ORDER BY a.`status` desc LIMIT 1) as taskId from ("+
-                            "select p_id,count(1) as aaCount from m_wbs_tree_contract where is_deleted=0 and contract_id = '" + contractId + "' and table_owner in ( " + taownInfo + " ) and is_type_private_pid in("+priIds+") and ancestors_p_id like '%"+anId+"%' and p_id<>"+wbs_id+" group by p_id "+
-                            " ) c ";
-                }
-
-                List<Map<String, Object>> noInfoList = jdbcTemplate.queryForList(sqldat);
-                if(noInfoList!=null && noInfoList.size()>=1){
-                    for(Map<String, Object> noInfo : noInfoList) {
-                        Integer exceptxx = Integer.parseInt(noInfo.get("aaCount")+"");
-                        String taskId = noInfo.get("taskId")+"";
-                        if(exceptxx >= nodeInfoList.size() && taskId.length()>4){
-                            long newPkId = SnowFlakeUtil.getId();
-                            long projInstand = SnowFlakeUtil.getId();
-                            String dataInfo = " insert into u_task(id,process_definition_id,process_instance_id,project_id,contract_id,start_time,end_time,report_user,report_user_name,task_name,task_content,task_user,fixed_flow_id,form_data_id,batch,type,approval_type,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,trial_self_inspection_record_id,archive_ids,attachment_pdf_url,task_create_timestamp,meter_task_type,meter_task_repeal_desc,task_common_money,is_build_audit) " +
-                                    "SELECT "+newPkId+",process_definition_id,"+projInstand+",project_id,contract_id,start_time,end_time,report_user,report_user_name,task_name,task_content,task_user,fixed_flow_id,"+ndid+",batch,type,approval_type,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,trial_self_inspection_record_id,archive_ids,attachment_pdf_url,task_create_timestamp,meter_task_type,meter_task_repeal_desc,task_common_money,is_build_audit from u_task where id="+taskId;
-
-                            // 添加任务
-
-                            String peall = "SELECT a.* from u_task_parallel a ,u_task b  where a.process_instance_id=b.process_instance_id and b.id='"+taskId+"' and a.is_deleted=0 and b.is_deleted=0 ";
-                            List<Map<String, Object>> mapList = jdbcTemplate.queryForList(peall);
-                            if(mapList!=null && mapList.size()>=1){
-                                for (Map<String, Object> mapData : mapList){
-                                    String pallId= mapData.get("id")+"";
-                                    long projInstaxnd = SnowFlakeUtil.getId();
-                                    String datadx = " insert into u_task_parallel(id,process_instance_id,parallel_process_instance_id,e_visa_status,e_visa_content,task_user,task_user_name,initiative,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,sort,exe_count) " +
-                                             " SELECT "+projInstaxnd+","+projInstand+","+projInstaxnd+",e_visa_status,e_visa_content,task_user,task_user_name,initiative,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,sort,exe_count from u_task_parallel where id='"+pallId+"'";
-
-                                    jdbcTemplate.execute(datadx);
-                                }
-                            }
-
-                            jdbcTemplate.execute(dataInfo);
-                            String updateSql = "update u_information_query_zhu set is_deleted=1 where id="+ndid;
-                            jdbcTemplate.execute(updateSql);
-                            // 修改完成情况
-                            RedisTemplate.delete("taskIdxx-" + ndid);
-                            return;
-                        }
-                    }
-                }
-            }
-        }
-
-        String updatel = "update u_information_query_zhu set is_deleted=5 where id="+ndid;
-        jdbcTemplate.execute(updatel);
-        RedisTemplate.delete("taskIdxx-" + ndid);
-    }
-
-}

+ 6 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -687,7 +687,12 @@ public class ExcelTabController extends BladeController {
                 }
             }
         }
-        saveOldHtmlConfig(aPrivate, doc);
+
+        //第一次关联 或者 原来数据上没有html时,不需要 去复制默认值超做
+        if(aPrivate!=null && (aPrivate.getHtmlUrl()+"").length()>=10){
+            saveOldHtmlConfig(aPrivate, doc);
+        }
+
         File writefile = new File(thmlUrl);
         FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
 

+ 6 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -1160,7 +1160,12 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                         for (SaveUserInfoByProjectDTO sg : userRoleInfoSG) {
                             if (sg.getUserId().equals(jl.getUserId())) {
                                 //如果监理合同段与施工合同段中有相同的用户信息,就移除,一个用户只能存在一个合同段中
-                                iterator.remove();
+                                System.out.println(iterator.hasNext());
+                                try {
+                                    iterator.remove();
+                                }catch (Exception e){
+                                    continue;
+                                }
                             }
                         }
                     }