Browse Source

数据修改

zhuwei 7 months ago
parent
commit
00fb333b94
14 changed files with 391 additions and 72 deletions
  1. 4 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTreePrivate.java
  2. 9 3
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVController.java
  3. 203 0
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController2.java
  4. 27 24
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVDataServiceImpl.java
  5. 12 0
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  6. 26 3
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PDFUtils.java
  7. 1 2
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/SignFtpUtil.java
  8. 49 13
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  9. 1 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml
  10. 24 5
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java
  11. 4 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsParamServiceImpl.java
  12. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java
  13. 22 17
      blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java
  14. 8 3
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/MiddleMeterApplyMapper.xml

+ 4 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTreePrivate.java

@@ -26,6 +26,10 @@ public class WbsTreePrivate extends BaseEntity {
     @ApiModelProperty(value = "pid")
     @ApiModelProperty(value = "pid")
     private Long pId;
     private Long pId;
 
 
+    //m_wbs_tree 的主键Id
+    @JsonProperty(value = "treePId")
+    private Long treePId;
+
     /**
     /**
      * 项目Id
      * 项目Id
      */
      */

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

@@ -56,13 +56,13 @@ public class EVController {
     @Resource(name = "taskExecutor1")
     @Resource(name = "taskExecutor1")
     private ThreadPoolExecutor executor;
     private ThreadPoolExecutor executor;
 
 
-    // @Scheduled(cron = "0/10 * * * * ?")
+     @Scheduled(cron = "0/10 * * * * ?")
     public void SignInfo() {
     public void SignInfo() {
         //执行代码
         //执行代码
         log.info("扫描开始");
         log.info("扫描开始");
-        String sql = "SELECT * from u_task_batch where is_deleted=0 and id in(SELECT max(id) as id from u_task_batch where  is_deleted=0 GROUP BY JSON_EXTRACT(json_data, '$.formDataId') ORDER BY sign_type ASC) LIMIT 10 ";
+        String sql = "SELECT * from u_task_batch where is_deleted=0 and id in(SELECT DISTINCT id from u_task_batch where  is_deleted=0 GROUP BY JSON_EXTRACT(json_data, '$.formDataId') ORDER BY sign_type ASC) LIMIT 10 ";
 
 
-       // String sql = "SELECT * from u_task_batch where is_deleted=0 and JSON_EXTRACT(json_data, '$.taskId')=1864831795413909504 ORDER BY sign_type ASC ";
+        //String sql = "SELECT * from u_task_batch where is_deleted=0 and id=1871438158680403970 ORDER BY sign_type ASC ";
 
 
         List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
         List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
         if (maps != null && maps.size() >= 1 ) {
         if (maps != null && maps.size() >= 1 ) {
@@ -82,6 +82,12 @@ public class EVController {
                     taskSignInfoVO.setSignFormat(signFormat);
                     taskSignInfoVO.setSignFormat(signFormat);
                     if(sigType.equals("2")){
                     if(sigType.equals("2")){
                         taskSignInfoVO.setSigType(2);
                         taskSignInfoVO.setSigType(2);
+                      String sql12 = "SELECT a.* from u_task a,u_task_parallel b where a.process_instance_id=b.process_instance_id and b.initiative=1 and  a.is_deleted=0 and b.is_deleted=0 and a.`status` in(1,2) and a.id="+taskSignInfoVO.getTaskId()+"";
+                      List<Map<String, Object>> maps12 = jdbcTemplate.queryForList(sql12);
+                      if(maps12!=null && maps12.size()>=1){
+                          jdbcTemplate.execute("delete from u_task_batch where id="+taskBatchId+"");
+                          aBoolean = true;
+                      }
                     }else{
                     }else{
                         taskSignInfoVO.setSigType(1);
                         taskSignInfoVO.setSigType(1);
                     }
                     }

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

@@ -0,0 +1,203 @@
+package org.springblade.evisa.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.business.entity.Task;
+import org.springblade.business.entity.TaskParallel;
+import org.springblade.business.feign.TaskClient;
+import org.springblade.business.vo.TaskApprovalVO;
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.utils.CommonUtil;
+import org.springblade.common.utils.SystemUtils;
+import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.evisa.service.EVisaService;
+import org.springblade.evisa.utils.FileUtils;
+import org.springblade.evisa.utils.PDFUtils;
+import org.springblade.evisa.utils.PdfAddimgUtil;
+import org.springblade.evisa.vo.EVisaTaskApprovalVO;
+import org.springblade.resource.feign.NewIOSSClient;
+import org.springblade.system.cache.ParamCache;
+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.Async;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+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
+@RequestMapping("/evisaInfo")
+@Api(value = "电签类", tags = "电签类接口")
+@Slf4j
+public class EVisaController2 {
+
+    @Autowired
+    StringRedisTemplate RedisTemplate;
+
+    // jdbc
+    private final JdbcTemplate jdbcTemplate;
+
+    //电签服务类
+    private final EVisaService eVisaService;
+
+    // 线程池
+    @Resource(name = "taskExecutor1")
+    private ThreadPoolExecutor executor;
+
+    private final TaskClient taskClient;
+
+    private final NewIOSSClient newIOSSClient;
+
+    // 电签主类
+   // @Scheduled(cron = "0/10 * * * * ?")
+    public void SignInfo() {
+        //执行代码
+        log.info("扫描开始");
+       // String sql = "SELECT c.* from (SELECT a.id,b.id as reportId,(SELECT COUNT(1) from u_task_parallel v where v.process_instance_id=a.process_instance_id and v.`status`=2) as count2  from u_task a , s_interim_pay_certificate b where a.meter_task_type=1 and a.is_deleted=0 and a.status=1 and a.form_data_id=b.contract_period_id and b.is_deleted=0 and b.pre_pdf_url is null) c where c.count2>=1 ";
+        //String sql = "SELECT * from u_task_batch where is_deleted=5 and `status`=2";
+        List<Map<String, Object>> maps = new ArrayList<>();//jdbcTemplate.queryForList(sql);
+
+        Map<String, Object> task = new HashMap<>();//taskClient.getTaskBatchList();
+        task.put("id","1869535635736363008");
+        task.put("reportId","1864482462625693696");
+
+        Map<String, Object> task1 = new HashMap<>();//taskClient.getTaskBatchList();
+        task.put("id","1871012255089295360");
+        task.put("reportId","1866674550960410625");
+
+        maps.add(task);
+      //  maps.add(task1);
+
+        if (maps != null && maps.size() >= 1) {//&& SystemUtils.isLinux()
+            for (Map<String, Object> dataInfo : maps) {
+                if (executor.getQueue().size()<=2 ) {
+                    String id = dataInfo.get("id") + "";
+                    String dataId = dataInfo.get("reportId") + "";
+
+                    Boolean aBoolean = RedisTemplate.hasKey("sign-" + dataId);
+
+                    if (!aBoolean) {
+                        RedisTemplate.opsForValue().set("sign-" + dataId, "1",900, TimeUnit.SECONDS);
+                        CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
+                            try {
+                                /*===============执行批量任务===============*/
+                                this.taskMeterPdfInfo2(id,dataId,0);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }, executor);
+                    }
+                }
+            }
+        }
+        System.out.println("队列数量" + executor.getQueue().size());
+        System.out.println("活跃数量" + executor.getActiveCount());
+        System.out.println("总共数量" + executor.getTaskCount());
+        System.out.println("完成数量" + executor.getCompletedTaskCount());
+    }
+
+    @Async
+    public void taskMeterPdfInfo2(@RequestParam String taskId, @RequestParam String reportId, @RequestParam Integer type) {
+        try {
+            Task task = jdbcTemplate.query("SELECT * FROM u_task WHERE id = ?", new Object[]{taskId}, new BeanPropertyRowMapper<>(Task.class)).stream().findAny().orElse(null);
+
+            String sql = "";
+            if (type == 0) {
+                sql = "select raw_url from s_interim_pay_certificate where id = ?";
+            } else {
+                sql = "select raw_url from s_material_start_statement where id = ?";
+            }
+            String pdfUrl = jdbcTemplate.queryForObject(sql, String.class, reportId);
+            if (StringUtils.isBlank(pdfUrl)) {
+            } else {
+                List<String> pdfSignIds = PDFUtils.getPdfSignIds(pdfUrl);
+                if (pdfSignIds.size() > 0) {
+                    String ids = String.join(",", pdfSignIds);
+                    String sqlp = "SELECT * from u_task_parallel WHERE process_instance_id = '" + task.getProcessInstanceId() + "' and `status`=2 and is_deleted=0";
+                    List<TaskParallel> taskParallels = jdbcTemplate.query(sqlp, new BeanPropertyRowMapper<>(TaskParallel.class));
+                    List<Map<String, Object>> maps = new ArrayList<>();
+                    for (TaskParallel parallel : taskParallels) {
+                        String sqlinfo = "SELECT * from ( SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + parallel.getTaskUser() + "' and is_deleted=0  ) as signature_file_url,a.type from m_textdict_info a where  a.type =2 and a.id in (" + ids + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + parallel.getTaskUser() + " and c.is_deleted=0 ) ) x where x.signature_file_url is not null ";
+                        List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
+                        Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
+                                .collect(Collectors.groupingBy(hada -> (Func.toStr(hada.get("id")))));
+
+                        for (String keyId : peopleByAge.keySet()) {
+                            int exId = 0;
+                            List<Map<String, Object>> keyList = peopleByAge.get(keyId);
+                            if (keyList != null && keyList.size() == 1) {
+                                maps.addAll(keyList);
+                                exId = 1;
+                            } else if (keyList != null && keyList.size() >= 2) {
+                                for (Map<String, Object> datax : keyList) {
+                                    if ((datax.get("project_id") + "").equals(task.getProjectId())) {
+                                        maps.add(datax);
+                                        exId = 1;
+                                    }
+                                }
+                            }
+                            if (exId == 0) {
+                                maps.add(keyList.get(0));
+                            }
+                        }
+                    }
+
+                    if (Func.isNotEmpty(maps) || maps.size() >= 1) {
+                        InputStream ossInputStream = CommonUtil.getOSSInputStream(pdfUrl);
+                        String localPdfPath = FileUtils.getSysLocalFileUrl() + "/pdf//" + task.getId() + ".pdf";
+                        CommonUtil.convert(ossInputStream, localPdfPath);
+                        PdfAddimgUtil.pdfAddImgInfo(localPdfPath, maps);
+                        String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+
+                            BladeFile bladeFile = this.newIOSSClient.uploadFile(task.getId() + ".pdf", localPdfPath);
+                            if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
+                                if (type == 0) {
+                                    jdbcTemplate.update("update s_interim_pay_certificate set pre_pdf_url ='"+bladeFile.getLink()+"' where id="+reportId);
+                                } else {
+                                    jdbcTemplate.update("update s_material_start_statement set pre_pdf_url ='"+bladeFile.getLink()+"' where id="+reportId);
+                                }
+                            }
+
+                    } else {
+                        System.out.println("没有签字Key");
+                    }
+
+                } else {
+                    System.out.println("没有签字Id");
+                }
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+}

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

@@ -83,8 +83,6 @@ public class EVDataServiceImpl implements EVDataService {
 
 
         String fileUrl = CommonUtil.replaceOssUrl(taskApp.getSignPdfUrl());
         String fileUrl = CommonUtil.replaceOssUrl(taskApp.getSignPdfUrl());
         List<String> eVisaConfigList = PDFUtils.getPdfSignIds(fileUrl, taskApp);
         List<String> eVisaConfigList = PDFUtils.getPdfSignIds(fileUrl, taskApp);
-         String ids = String.join(",", eVisaConfigList);
-
         if (eVisaConfigList == null || eVisaConfigList.size() == 0) {
         if (eVisaConfigList == null || eVisaConfigList.size() == 0) {
             //没有电签配置,默认当前任务为不签字审批,返回成功
             //没有电签配置,默认当前任务为不签字审批,返回成功
             taskApp.setSigState(2);
             taskApp.setSigState(2);
@@ -92,7 +90,8 @@ public class EVDataServiceImpl implements EVDataService {
             SignBackPdfInfo(taskApp);
             SignBackPdfInfo(taskApp);
             return;
             return;
         }
         }
-
+        // 获取pdf上的电签Ids
+        String ids = String.join(",", eVisaConfigList);
         if (taskApp.getRemarkType().equals("1")) { //安心签
         if (taskApp.getRemarkType().equals("1")) { //安心签
             //添加电签策略
             //添加电签策略
             List<SealStrategyVO> strategyListByAXQ = getStrategyListByAXQ(taskApp, ids);
             List<SealStrategyVO> strategyListByAXQ = getStrategyListByAXQ(taskApp, ids);
@@ -112,6 +111,7 @@ public class EVDataServiceImpl implements EVDataService {
                     }
                     }
                 }
                 }
                 SignBackPdfInfo(taskApp);
                 SignBackPdfInfo(taskApp);
+                return;
             }
             }
 
 
             //调用签字逻辑
             //调用签字逻辑
@@ -128,7 +128,7 @@ public class EVDataServiceImpl implements EVDataService {
             //添加电签策略
             //添加电签策略
             List<Map<String, Object>> strategyListByDFZX = getStrategyListByDFZX(taskApp, ids);
             List<Map<String, Object>> strategyListByDFZX = getStrategyListByDFZX(taskApp, ids);
             //调用签字逻辑
             //调用签字逻辑
-            String s = signTaskBatchByDFZX(strategyListByDFZX, fileUrl);
+            String s = signTaskBatchByDFZX(strategyListByDFZX, fileUrl,taskApp.getSigType());
             if (s.contains("sucess")) {
             if (s.contains("sucess")) {
                 taskApp.setLastFilePdfUrl(s.split("@@@@")[1]);
                 taskApp.setLastFilePdfUrl(s.split("@@@@")[1]);
                 taskApp.setSigState(1);
                 taskApp.setSigState(1);
@@ -210,14 +210,14 @@ public class EVDataServiceImpl implements EVDataService {
                     String pdfTrialUrlPosition = "";
                     String pdfTrialUrlPosition = "";
                     if ("2".equals(taskApp.getPdfDataType())) {
                     if ("2".equals(taskApp.getPdfDataType())) {
                         String taskStatus = "";
                         String taskStatus = "";
-                        if (taskApp.getSigState() == 1) {
+                        if (taskApp.getSigState() == 1 && taskApp.getSigType()==1) {
                             taskStatus = "待审批";
                             taskStatus = "待审批";
-                        } else if (taskApp.getSigState() == 2) {
+                        } else if (taskApp.getSigState() == 1 && taskApp.getSigType()==2) {
                             taskStatus = "已审批";
                             taskStatus = "已审批";
                         } else if (taskApp.getSigState() == 3) {
                         } else if (taskApp.getSigState() == 3) {
                             taskStatus = "已废除";
                             taskStatus = "已废除";
                         }
                         }
-                        String updTrial = "update u_trial_self_inspection_record set task_status='" + taskStatus + "',pdf_url='" + taskApp.getLastFilePdfUrl() + "' where id=(select b.trial_self_inspection_record_id from u_task b,u_task_parallel c where b.process_instance_id=c.process_instance_id and b.is_deleted=0 and c.is_deleted=0 and b.status in(1,2) and parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "')";
+                        String updTrial = "update u_trial_self_inspection_record set status="+taskApp.getSigType()+", task_status='" + taskStatus + "',pdf_url='" + taskApp.getLastFilePdfUrl() + "' where id=(select b.trial_self_inspection_record_id from u_task b,u_task_parallel c where b.process_instance_id=c.process_instance_id and b.is_deleted=0 and c.is_deleted=0 and b.status in(1,2) and parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "')";
                         jdbcTemplate.execute(updTrial);
                         jdbcTemplate.execute(updTrial);
 
 
                         /**
                         /**
@@ -292,11 +292,8 @@ public class EVDataServiceImpl implements EVDataService {
                 this.jdbcTemplate.execute(updateSql);
                 this.jdbcTemplate.execute(updateSql);
                 this.jdbcTemplate.execute("update u_task_parallel set e_visa_status=1,e_visa_content='" + taskApp.getSignSmg() + "' , status=2 , initiative=2 ,update_time=SYSDATE() where parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "'");
                 this.jdbcTemplate.execute("update u_task_parallel set e_visa_status=1,e_visa_content='" + taskApp.getSignSmg() + "' , status=2 , initiative=2 ,update_time=SYSDATE() where parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "'");
                 this.jdbcTemplate.execute("update u_task set status=" + taskApp.getSigType() + " ,update_time=SYSDATE() where id='" + taskApp.getTaskId() + "'");
                 this.jdbcTemplate.execute("update u_task set status=" + taskApp.getSigType() + " ,update_time=SYSDATE() where id='" + taskApp.getTaskId() + "'");
-                if (taskApp.getSigType() == 2) {
-                    this.jdbcTemplate.execute("delete from u_task_batch where JSON_EXTRACT(json_data, '$.taskId')=" + taskApp.getTaskId());
-                } else {
-                    this.jdbcTemplate.execute("delete from u_task_batch where id=" + taskApp.getId());
-                }
+                this.jdbcTemplate.execute("delete from u_task_batch where id=" + taskApp.getId());
+
             } else { //签字失败
             } else { //签字失败
                 this.jdbcTemplate.execute("update u_task_parallel set exe_count=(exe_count+1), e_visa_status=99,e_visa_content='" + taskApp.getSignSmg() + "' ,update_time=SYSDATE() where parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "'");
                 this.jdbcTemplate.execute("update u_task_parallel set exe_count=(exe_count+1), e_visa_status=99,e_visa_content='" + taskApp.getSignSmg() + "' ,update_time=SYSDATE() where parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "'");
                 this.jdbcTemplate.execute("update u_task set status=1 ,update_time=SYSDATE() where id='" + taskApp.getTaskId() + "'");
                 this.jdbcTemplate.execute("update u_task set status=1 ,update_time=SYSDATE() where id='" + taskApp.getTaskId() + "'");
@@ -353,7 +350,7 @@ public class EVDataServiceImpl implements EVDataService {
                     } else if ("3".equals(type)) {
                     } else if ("3".equals(type)) {
                         //首件,首件的资料由三个部分组成:封面、关联资料、总结报告
                         //首件,首件的资料由三个部分组成:封面、关联资料、总结报告
                         if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
                         if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
-                            String url = StringUtils.isNotEmpty(eVisaPdfUrl) ? eVisaPdfUrl : pdfUrl;
+                            String url = eVisaPdfUrl.length()>=10 ? eVisaPdfUrl : pdfUrl;
                             String s = getHppsToHttp(url);
                             String s = getHppsToHttp(url);
                             taskApp.setSignPdfUrl(s);
                             taskApp.setSignPdfUrl(s);
                         }
                         }
@@ -364,7 +361,7 @@ public class EVDataServiceImpl implements EVDataService {
                 String eVisaPdfUrl = map.get("pdf_file_url") + ""; //签字的PDF路径
                 String eVisaPdfUrl = map.get("pdf_file_url") + ""; //签字的PDF路径
                 String pdfUrl = map.get("file_url") + ""; //合并后的PDF路径
                 String pdfUrl = map.get("file_url") + ""; //合并后的PDF路径
                 if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
                 if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
-                    String url = StringUtils.isNotEmpty(eVisaPdfUrl) ? eVisaPdfUrl : pdfUrl;
+                    String url = eVisaPdfUrl.length()>=10 ? eVisaPdfUrl : pdfUrl;
                     taskApp.setSignPdfUrl(url);
                     taskApp.setSignPdfUrl(url);
                 }
                 }
             } else if (taskApp.getApprovalType() == 3) {
             } else if (taskApp.getApprovalType() == 3) {
@@ -372,7 +369,7 @@ public class EVDataServiceImpl implements EVDataService {
                 String eVisaPdfUrl = map.get("e_visa_pdf_url") + ""; //签字的PDF路径
                 String eVisaPdfUrl = map.get("e_visa_pdf_url") + ""; //签字的PDF路径
                 String pdfUrl = map.get("pdf_url") + ""; //合并后的PDF路径
                 String pdfUrl = map.get("pdf_url") + ""; //合并后的PDF路径
                 if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
                 if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
-                    String url = StringUtils.isNotEmpty(eVisaPdfUrl) ? eVisaPdfUrl : pdfUrl;
+                    String url = eVisaPdfUrl.length()>=10 ? eVisaPdfUrl : pdfUrl;
                     taskApp.setSignPdfUrl(url);
                     taskApp.setSignPdfUrl(url);
                 }
                 }
             } else if (taskApp.getApprovalType() == 4) { //档案走自定义 搓章的问题
             } else if (taskApp.getApprovalType() == 4) { //档案走自定义 搓章的问题
@@ -435,13 +432,16 @@ public class EVDataServiceImpl implements EVDataService {
 
 
         String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + task.getUserId() + "' and is_deleted=0  ) as sealId from m_textdict_info a where  a.type =2 and a.id in (" + ids + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
         String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + task.getUserId() + "' and is_deleted=0  ) as sealId from m_textdict_info a where  a.type =2 and a.id in (" + ids + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
         if (task.getSigType() == 2) {
         if (task.getSigType() == 2) {
-            sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,a.project_id,b.certificate_password,b.certificate_user_name,b.certificate_number from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
+            sqlinfo = "SELECT a.id as keyWord,a.pyzbx,a.pyzby,b.certificate_number as sealId from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
+            System.out.println("东方中讯--签章--"+sqlinfo);
+        }else{
+            System.out.println("东方中讯--签字--"+sqlinfo);
         }
         }
 
 
         List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
         List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
         List<Map<String, Object>> maps = new ArrayList<>();
         List<Map<String, Object>> maps = new ArrayList<>();
         Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
         Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
-                .collect(Collectors.groupingBy(hada -> (Func.toStr(hada.get("id")))));
+                .collect(Collectors.groupingBy(hada -> (Func.toStr(hada.get("keyWord")))));
 
 
         for (String keyId : peopleByAge.keySet()) {
         for (String keyId : peopleByAge.keySet()) {
             int exId = 0;
             int exId = 0;
@@ -470,9 +470,10 @@ public class EVDataServiceImpl implements EVDataService {
         String sqlinfo = "SELECT * from ( SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + task.getUserId() + "' and is_deleted=0  ) as signature_file_url from m_textdict_info a where  a.type =2 and a.id in (" + ids + ") and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.signature_file_url is not null ";
         String sqlinfo = "SELECT * from ( SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + task.getUserId() + "' and is_deleted=0  ) as signature_file_url from m_textdict_info a where  a.type =2 and a.id in (" + ids + ") and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.signature_file_url is not null ";
         if (task.getSigType() == 2) {
         if (task.getSigType() == 2) {
             sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,a.project_id,b.certificate_password,b.certificate_user_name,b.certificate_number from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
             sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,a.project_id,b.certificate_password,b.certificate_user_name,b.certificate_number from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
-            System.out.println("签字Sql=" + sqlinfo);
+            System.out.println("安心签--签章--=" + sqlinfo);
+        }else{
+            System.out.println("安心签--签字--=" + sqlinfo);
         }
         }
-
         List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
         List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
         if (maps2 == null && maps2.size() <= 0) {
         if (maps2 == null && maps2.size() <= 0) {
             return sealStrategyVOS;
             return sealStrategyVOS;
@@ -542,7 +543,7 @@ public class EVDataServiceImpl implements EVDataService {
     }
     }
 
 
     // 添加电签策略 -- 东方中讯
     // 添加电签策略 -- 东方中讯
-    public String signTaskBatchByDFZX(List<Map<String, Object>> maps, String pdfUrl) {
+    public String signTaskBatchByDFZX(List<Map<String, Object>> maps, String pdfUrl,int type) {
         if (maps != null && maps.size() > 0) {
         if (maps != null && maps.size() > 0) {
             String fileUrl = pdfUrl;
             String fileUrl = pdfUrl;
             for (Map<String, Object> dataMap : maps) {
             for (Map<String, Object> dataMap : maps) {
@@ -550,8 +551,10 @@ public class EVDataServiceImpl implements EVDataService {
                 daMa.put("keyWord", dataMap.get("keyWord"));
                 daMa.put("keyWord", dataMap.get("keyWord"));
                 daMa.put("sealId", dataMap.get("sealId"));
                 daMa.put("sealId", dataMap.get("sealId"));
                 // 设置图片显示大小
                 // 设置图片显示大小
-                daMa.put("showHeight", 30);
-                daMa.put("showWidth", 60);
+                if(type!=2){ //章
+                    daMa.put("showHeight", 30);
+                    daMa.put("showWidth", 60);
+                }
                 //设置显示签字体的位置
                 //设置显示签字体的位置
                 String yzx = dataMap.get("pyzby") + "";
                 String yzx = dataMap.get("pyzby") + "";
                 String xzx = dataMap.get("pyzbx") + "";
                 String xzx = dataMap.get("pyzbx") + "";
@@ -592,7 +595,6 @@ public class EVDataServiceImpl implements EVDataService {
                 BladeFile bladeFile = this.newIOSSClient.uploadFile(fileUrl.substring(fileUrl.lastIndexOf("/") + 1, fileUrl.length()), fileUrl);
                 BladeFile bladeFile = this.newIOSSClient.uploadFile(fileUrl.substring(fileUrl.lastIndexOf("/") + 1, fileUrl.length()), fileUrl);
                 if (bladeFile != null) {
                 if (bladeFile != null) {
                     System.out.println("pdf上传=" + bladeFile.getLink());
                     System.out.println("pdf上传=" + bladeFile.getLink());
-
                     return "sucess@@@@" + bladeFile.getLink();
                     return "sucess@@@@" + bladeFile.getLink();
                 } else {
                 } else {
                     return "电签成功";
                     return "电签成功";
@@ -692,6 +694,7 @@ public class EVDataServiceImpl implements EVDataService {
                 taskApp.setSigState(2);
                 taskApp.setSigState(2);
                 taskApp.setSignSmg("上传OSS失败" + fileUrl);
                 taskApp.setSignSmg("上传OSS失败" + fileUrl);
                 SignBackPdfInfo(taskApp);
                 SignBackPdfInfo(taskApp);
+                System.out.println("上传OSS失败");
                 return;
                 return;
             }
             }
         }
         }
@@ -699,7 +702,7 @@ public class EVDataServiceImpl implements EVDataService {
 
 
     public String getHppsToHttp(String url) {
     public String getHppsToHttp(String url) {
         String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
         String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
-        if (url.contains("https:") && sys_isonline.equals("20")) {
+        if (Func.isNotEmpty(sys_isonline) &&url.contains("https:") && sys_isonline.equals("20")) {
             return url.replace("https:", "http:");
             return url.replace("https:", "http:");
         }
         }
         return url;
         return url;

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

@@ -1033,6 +1033,10 @@ public class EVisaServiceImpl implements EVisaService {
     private Object[] signPdfByAXQZ_2(SealPdfVO pdfVO, byte[] fileByte, int typeGenerate) {
     private Object[] signPdfByAXQZ_2(SealPdfVO pdfVO, byte[] fileByte, int typeGenerate) {
         Object[] result = new Object[3];
         Object[] result = new Object[3];
         try {
         try {
+            String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+            if("20".equals(sys_isonline) || SystemUtils.isWindows() || SystemUtils.isMacOs()){
+                SIGN_HOST = "47.115.117.246";
+            }
             PaperlessClient paperlessClient = new PaperlessClient(SIGN_HOST, SIGN_PORT, 240000000, 810000000);
             PaperlessClient paperlessClient = new PaperlessClient(SIGN_HOST, SIGN_PORT, 240000000, 810000000);
             paperlessClient.setSSL(false);
             paperlessClient.setSSL(false);
             //*****************************************************************************
             //*****************************************************************************
@@ -1291,6 +1295,10 @@ public class EVisaServiceImpl implements EVisaService {
     @Override
     @Override
     public String createSeal(EVisaMakeSealVO vo) {
     public String createSeal(EVisaMakeSealVO vo) {
         try {
         try {
+            String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+            if("20".equals(sys_isonline) || SystemUtils.isWindows() || SystemUtils.isMacOs()){
+                SIGN_HOST = "47.115.117.246";
+            }
             PaperlessClient paperlessClient = new PaperlessClient(SIGN_HOST, SIGN_PORT, 240000000, 810000000);
             PaperlessClient paperlessClient = new PaperlessClient(SIGN_HOST, SIGN_PORT, 240000000, 810000000);
             paperlessClient.setSSL(false);
             paperlessClient.setSSL(false);
 
 
@@ -1365,6 +1373,10 @@ public class EVisaServiceImpl implements EVisaService {
     @Override
     @Override
     public List<CertBean> onlineCheckSeal(String pdfUrl) {
     public List<CertBean> onlineCheckSeal(String pdfUrl) {
         try {
         try {
+            String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+            if("20".equals(sys_isonline) || SystemUtils.isWindows() || SystemUtils.isMacOs()){
+                SIGN_HOST = "47.115.117.246";
+            }
             PaperlessClient paperlessClient = new PaperlessClient(SIGN_HOST, SIGN_PORT, 240000000, 810000000);
             PaperlessClient paperlessClient = new PaperlessClient(SIGN_HOST, SIGN_PORT, 240000000, 810000000);
             paperlessClient.setSSL(false);
             paperlessClient.setSSL(false);
 
 

+ 26 - 3
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PDFUtils.java

@@ -49,22 +49,32 @@ public class PDFUtils {
                         taskApp.setPdfDate(txt);
                         taskApp.setPdfDate(txt);
                     }
                     }
                 }
                 }
+
+                // 特殊处理
+                if(textStr.indexOf("1")>=0){
+                    String txt = textStr.substring(textStr.indexOf("1"));
+                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                        System.out.println(txt);
+                        eVisaConfigList.add(txt);
+                    }
+                }
             }
             }
 
 
+
             List<String> unique = eVisaConfigList.stream().distinct().collect(Collectors.toList());
             List<String> unique = eVisaConfigList.stream().distinct().collect(Collectors.toList());
             document.close();
             document.close();
             return unique;
             return unique;
         }catch (Exception e){
         }catch (Exception e){
             e.printStackTrace();
             e.printStackTrace();
-            return null;
+            System.out.println("pdf大小为0");
+            return eVisaConfigList;
         }
         }
     }
     }
 
 
-
     public static List<String>  getPdfSignIds(String pdfUrl) {
     public static List<String>  getPdfSignIds(String pdfUrl) {
         List<String> eVisaConfigList = new ArrayList<>();
         List<String> eVisaConfigList = new ArrayList<>();
         try  {
         try  {
-            InputStream inputStream = CommonUtil.getOSSInputStream(pdfUrl);
+            InputStream inputStream = new FileInputStream(new File(pdfUrl));//CommonUtil.getOSSInputStream(pdfUrl);
             PDDocument document = PDDocument.load(inputStream);
             PDDocument document = PDDocument.load(inputStream);
             PDFTextStripper stripper = new PDFTextStripper();
             PDFTextStripper stripper = new PDFTextStripper();
             String text = stripper.getText(document);
             String text = stripper.getText(document);
@@ -74,6 +84,10 @@ public class PDFUtils {
                 if(textStr.indexOf("*")>=0){
                 if(textStr.indexOf("*")>=0){
                     textStr = textStr.substring(textStr.lastIndexOf("*")+1,textStr.length());
                     textStr = textStr.substring(textStr.lastIndexOf("*")+1,textStr.length());
                 }
                 }
+                if(textStr.indexOf("1867379428376444928")>=0){
+                    System.out.println("");
+                }
+
                 String[] textS = Func.toStrArray("\\|\\|",textStr);
                 String[] textS = Func.toStrArray("\\|\\|",textStr);
                 for(String txt : textS){
                 for(String txt : textS){
                     for (int i = 0; i < txt.length(); i++) {
                     for (int i = 0; i < txt.length(); i++) {
@@ -86,6 +100,15 @@ public class PDFUtils {
                         eVisaConfigList.add(txt);
                         eVisaConfigList.add(txt);
                     }
                     }
                 }
                 }
+                //
+                if(textStr.indexOf("1")>=0){
+                    String txt = textStr.substring(textStr.indexOf("1"));
+                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                        System.out.println(txt);
+                        eVisaConfigList.add(txt);
+                    }
+                }
+
             }
             }
 
 
             List<String> unique = eVisaConfigList.stream().distinct().collect(Collectors.toList());
             List<String> unique = eVisaConfigList.stream().distinct().collect(Collectors.toList());

+ 1 - 2
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/SignFtpUtil.java

@@ -17,7 +17,7 @@ public class SignFtpUtil {
     private static final int PORT = 6233;
     private static final int PORT = 6233;
     private static final String USER = "signAdmin";
     private static final String USER = "signAdmin";
     private static final String PASS = "123456";
     private static final String PASS = "123456";
-    private static final int CONNECT_TIMEOUT = 90000; // 30秒
+    private static final int CONNECT_TIMEOUT = 900000; // 30秒
     private static final int DATA_TIMEOUT = 90000; // 30秒
     private static final int DATA_TIMEOUT = 90000; // 30秒
 
 
     /**
     /**
@@ -225,5 +225,4 @@ public class SignFtpUtil {
             }
             }
         }
         }
     }
     }
-
 }
 }

+ 49 - 13
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -2375,6 +2375,7 @@ public class ExcelTabController extends BladeController {
         if (ids.size() > 0) {
         if (ids.size() > 0) {
             //PDF路径
             //PDF路径
             List<String> pdfUrls = new ArrayList<>();
             List<String> pdfUrls = new ArrayList<>();
+
             for (String dataId : ids) {
             for (String dataId : ids) {
                 //查询对应的html
                 //查询对应的html
                 WbsTreePrivate tableNode = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, pkeyId));
                 WbsTreePrivate tableNode = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, pkeyId));
@@ -2408,21 +2409,56 @@ public class ExcelTabController extends BladeController {
                     Document doc = Jsoup.parse(htmlString);
                     Document doc = Jsoup.parse(htmlString);
                     Element table = doc.select("table").first();
                     Element table = doc.select("table").first();
                     Elements trs = table.select("tr");
                     Elements trs = table.select("tr");
+
                     //添加标题
                     //添加标题
-                    CellRange[] columns = sheet.getMergedCells();
-                    for (int i = 0; i < columns.length; i++) {
-                        CellRange cellRange = columns[i];
-
-                        if (cellRange.getStyle().getFont().getSize() >= 12 && (Func.isNotEmpty(cellRange.getValue2()) || Func.isNotEmpty(cellRange.getValue()))) {
-                            String title = projectInfo.getProjectName();
-                            if (title.length() >= 30) {
-                                cellRange.setRowHeight(40);
-                                cellRange.getStyle().setWrapText(true);
+                    String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+                    if("20".equals(sys_isonline)){ //甬台温
+                        CellRange[] columns = sheet.getMergedCells();
+                        for (int i = 0; i < columns.length; i++) {
+                            CellRange cellRange = columns[i];
+                            if (cellRange.getStyle().getFont().getSize() >= 12 && (Func.isNotEmpty(cellRange.getValue2()) || Func.isNotEmpty(cellRange.getValue()))) {
+                                String title = projectInfo.getProjectName();
+                                if (title.length() >= 30) {
+                                    cellRange.setRowHeight(40);
+                                    cellRange.getStyle().setWrapText(true);
+                                }
+                                cellRange.getStyle().getFont().setSize(18);
+                                cellRange.getStyle().setHorizontalAlignment(HorizontalAlignType.Center);
+                                cellRange.setText(projectInfo.getProjectName());
+                                break;
+                            }
+                        }
+                    }else{
+                        for (int i = 1; i < 6; i++) {
+                            Element tr = trs.get(i);
+                            Elements tds = tr.select("td");
+                            for (int j = 0; j < tds.size(); j++) {
+                                Element data = tds.get(j);
+                                String style = data.attr("style");
+                                if (style.contains("font-size")) {
+                                    int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt")));
+                                    if (StringUtils.isNotEmpty(data.text()) && fontsize >= 12) {
+                                        Element element = trs.get(i - 1).select("td").get(0);
+                                        String textainfo = element.text();
+                                        if(textainfo ==null || textainfo == "" || Func.isEmpty(textainfo)){
+                                            int x1, y1;
+                                            if (element.html().indexOf("el-tooltip") >= 0) {
+                                                x1 = Integer.parseInt(element.children().get(0).children().get(0).attr("x1"));
+                                                y1 = Integer.parseInt(element.children().get(0).children().get(0).attr("y1"));
+                                            } else {
+                                                x1 = Integer.parseInt(element.children().get(0).attr("x1"));
+                                                y1 = Integer.parseInt(element.children().get(0).attr("y1"));
+                                            }
+                                            if (x1 == 0) {
+                                                x1 = 1;
+                                            }
+                                            final CellRange cellRange = sheet.getCellRange(y1, x1);
+                                            cellRange.setText(projectInfo.getProjectName());
+                                            break;
+                                        }
+                                    }
+                                }
                             }
                             }
-                            cellRange.getStyle().getFont().setSize(18);
-                            cellRange.getStyle().setHorizontalAlignment(HorizontalAlignType.Center);
-                            cellRange.setText(projectInfo.getProjectName());
-                            break;
                         }
                         }
                     }
                     }
 
 

+ 1 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml

@@ -7,6 +7,7 @@
         <result column="project_id" property="projectId"/>
         <result column="project_id" property="projectId"/>
         <result column="p_key_id" property="pKeyId"/>
         <result column="p_key_id" property="pKeyId"/>
         <result column="id" property="id"/>
         <result column="id" property="id"/>
+        <result column="tree_p_id" property="treePId"/>
         <result column="w_id" property="wbsId"/>
         <result column="w_id" property="wbsId"/>
         <result column="is_deleted" property="isDeleted"/>
         <result column="is_deleted" property="isDeleted"/>
         <result column="status" property="status"/>
         <result column="status" property="status"/>

+ 24 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -24,6 +24,7 @@ import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
 import org.jsoup.select.Elements;
+import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.constant.MeasurementStorage;
 import org.springblade.common.constant.MeasurementStorage;
 import org.springblade.common.utils.BaseUtils;
 import org.springblade.common.utils.BaseUtils;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.CommonUtil;
@@ -57,6 +58,7 @@ import org.springblade.meter.vo.*;
 import org.springblade.resource.feign.CommonFileClient;
 import org.springblade.resource.feign.CommonFileClient;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.resource.vo.NewBladeFile;
 import org.springblade.resource.vo.NewBladeFile;
+import org.springblade.system.cache.ParamCache;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.context.annotation.Lazy;
@@ -4513,7 +4515,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
     public WbsTreePrivate wtpId(Long pkeyId){
     public WbsTreePrivate wtpId(Long pkeyId){
        WbsTreeContract wtc = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId,pkeyId));
        WbsTreeContract wtc = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId,pkeyId));
        if(!new Integer(1).equals(wtc.getIsCustom())) {
        if(!new Integer(1).equals(wtc.getIsCustom())) {
-           int loop = 0;
+           /*int loop = 0;
            while (wtc.getOldId() != null && loop < 10) {
            while (wtc.getOldId() != null && loop < 10) {
                loop++;
                loop++;
                WbsTreeContract tmp = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getId, wtc.getOldId()).eq(WbsTreeContract::getProjectId, wtc.getProjectId()).last(" limit 1 "));
                WbsTreeContract tmp = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getId, wtc.getOldId()).eq(WbsTreeContract::getProjectId, wtc.getProjectId()).last(" limit 1 "));
@@ -4522,8 +4524,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                } else {
                } else {
                    wtc = tmp;
                    wtc = tmp;
                }
                }
-           }
-           return this.wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getId, wtc.getId()).eq(WbsTreePrivate::getProjectId, wtc.getProjectId()));
+           }*/
+           return this.wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, wtc.getIsTypePrivatePid()).eq(WbsTreePrivate::getProjectId, wtc.getProjectId()));
        }else{
        }else{
            /*自定义节点的处理*/
            /*自定义节点的处理*/
            WbsTreePrivate wtp = new WbsTreePrivate();
            WbsTreePrivate wtp = new WbsTreePrivate();
@@ -4552,7 +4554,14 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                     "and is_deleted=0 " + " and (scope=0 or (scope=1 and wbs_id="+wbsId+") or(scope=2  and wbs_id="+wbsId+" and node_id="+nodeIdWbs+")or (scope =10 and project_id = " + projectId + ") or (scope=20 and project_id =" + projectId + " and node_id=" +nodeIdPrivate +"))");
                     "and is_deleted=0 " + " and (scope=0 or (scope=1 and wbs_id="+wbsId+") or(scope=2  and wbs_id="+wbsId+" and node_id="+nodeIdWbs+")or (scope =10 and project_id = " + projectId + ") or (scope=20 and project_id =" + projectId + " and node_id=" +nodeIdPrivate +"))");
             setFormula(list,efMap);
             setFormula(list,efMap);
             /*节点参数公式*/
             /*节点参数公式*/
-            setParamsFormula( wtp.getPKeyId(),origin.getId(),  list);
+
+            //
+            String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+            if("20".equals(sys_isonline)){
+                setParamsFormula( wtp.getPKeyId(),origin.getTreePId(),  list);
+            }else{
+                setParamsFormula( wtp.getPKeyId(),origin.getId(),  list);
+            }
             if(list.size()>0){
             if(list.size()>0){
                 return list;
                 return list;
             }
             }
@@ -5141,7 +5150,17 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             WbsTreePrivate publicWtp = this.getOriginWtp(privatePkeyId);
             WbsTreePrivate publicWtp = this.getOriginWtp(privatePkeyId);
 
 
             Map<String,Object> result = new HashMap<>(100);
             Map<String,Object> result = new HashMap<>(100);
-            List<WbsParam> total = this.getNodeWps(publicWtp.getId(),privatePkeyId);
+
+            String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+            List<WbsParam> total;
+            if("20".equals(sys_isonline)){
+                total = this.getNodeWps(publicWtp.getTreePId(),privatePkeyId);
+            }else{
+                total = this.getNodeWps(publicWtp.getId(),privatePkeyId);
+            }
+
+           // List<WbsParam> total = this.getNodeWps(publicWtp.getId(),privatePkeyId);
+
 /*            List<WbsParam> wpsPublic = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,publicWtp.getId()).eq(WbsParam::getType,1));
 /*            List<WbsParam> wpsPublic = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,publicWtp.getId()).eq(WbsParam::getType,1));
             if(Func.isNotEmpty(wpsPublic)){
             if(Func.isNotEmpty(wpsPublic)){
                 total.addAll(wpsPublic);
                 total.addAll(wpsPublic);

+ 4 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsParamServiceImpl.java

@@ -61,6 +61,9 @@ public class WbsParamServiceImpl extends BaseServiceImpl<WbsParamMapper, WbsPara
                     if (wp == null) {
                     if (wp == null) {
                         WbsTreePrivate publicWtp = this.getOriginWtp(wtp.getPKeyId());
                         WbsTreePrivate publicWtp = this.getOriginWtp(wtp.getPKeyId());
                         wp = this.getOne(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId, publicWtp.getId()).eq(WbsParam::getK, FILE_TITLE).last(" limit 1 "));
                         wp = this.getOne(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId, publicWtp.getId()).eq(WbsParam::getK, FILE_TITLE).last(" limit 1 "));
+                        if(wp==null){
+                            wp = this.getOne(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId, publicWtp.getTreePId()).eq(WbsParam::getK, FILE_TITLE).last(" limit 1 "));
+                        }
                     }
                     }
                     if (Func.isNotEmpty(wp)) {
                     if (Func.isNotEmpty(wp)) {
                         return CustomFunction.tree(nodes.stream().map(w->StringUtils.isNotEmpty(w.getFullName())?w.getFullName():w.getNodeName()).collect(Collectors.toList()), wp.getV()).toString();
                         return CustomFunction.tree(nodes.stream().map(w->StringUtils.isNotEmpty(w.getFullName())?w.getFullName():w.getNodeName()).collect(Collectors.toList()), wp.getV()).toString();
@@ -110,7 +113,7 @@ public class WbsParamServiceImpl extends BaseServiceImpl<WbsParamMapper, WbsPara
                 if(wtc.getIsTypePrivatePid()!=null){
                 if(wtc.getIsTypePrivatePid()!=null){
                     return this.wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId,wtc.getIsTypePrivatePid()));
                     return this.wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId,wtc.getIsTypePrivatePid()));
                 }else{
                 }else{
-                return this.wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getId,wtc.getOldId()).eq(WbsTreePrivate::getProjectId,wtc.getProjectId()).last(" limit 1 "));
+                    return this.wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getId,wtc.getOldId()).eq(WbsTreePrivate::getProjectId,wtc.getProjectId()).last(" limit 1 "));
                 }
                 }
             }else{
             }else{
                 wtc=tmp;
                 wtc=tmp;

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java

@@ -547,7 +547,7 @@ public class FileUtils {
 
 
         if(sys_isonline.equals("1")){ //正式环境
         if(sys_isonline.equals("1")){ //正式环境
             if (SystemUtils.isMacOs()) {
             if (SystemUtils.isMacOs()) {
-                file_path = "/www/wwwroot/Users/hongchuangyanfa/Desktop/";
+                file_path = "/Users/hongchuangyanfa/Desktop/";
             } else if (SystemUtils.isWindows()) {
             } else if (SystemUtils.isWindows()) {
                 file_path = "C://upload//";
                 file_path = "C://upload//";
             }
             }

+ 22 - 17
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -601,7 +601,8 @@ public class TaskController extends BladeController {
         task.setIsBuildAudit(approvalDTO.getIsBuildAudit());
         task.setIsBuildAudit(approvalDTO.getIsBuildAudit());
 
 
         task.setType(1);
         task.setType(1);
-        task.setApprovalType(5); //计量
+
+        task.setApprovalType(meterTaskType+4); //计量
         task.setFixedFlowId(ObjectUtil.isNotEmpty(approvalDTO.getFixedFlowId()) ? Long.parseLong(approvalDTO.getFixedFlowId()) : 0L);
         task.setFixedFlowId(ObjectUtil.isNotEmpty(approvalDTO.getFixedFlowId()) ? Long.parseLong(approvalDTO.getFixedFlowId()) : 0L);
         task.setStatus(1); //待审批
         task.setStatus(1); //待审批
         task.setIsDeleted(0);
         task.setIsDeleted(0);
@@ -3762,6 +3763,9 @@ public class TaskController extends BladeController {
                 }
                 }
                 if (task.getStatus() == 1){
                 if (task.getStatus() == 1){
                     String pre_pdf_url = (String) stringObjectMap.get("pre_pdf_url");
                     String pre_pdf_url = (String) stringObjectMap.get("pre_pdf_url");
+                    if (StringUtils.isBlank(pre_pdf_url)) {
+                        return R.data(pdfUrl);
+                    }
                     return R.data(pre_pdf_url);
                     return R.data(pre_pdf_url);
                 }
                 }
             }
             }
@@ -3773,35 +3777,36 @@ public class TaskController extends BladeController {
 
 
     //
     //
 
 
-    @Async
-    public R taskMeterPdfInfo2(@RequestParam Long taskId, @RequestParam String reportId, @RequestParam Integer type, @RequestParam Integer taskType) {
+
+    public void taskMeterPdfInfo2(@RequestParam Long taskId, @RequestParam String reportId, @RequestParam Integer type, @RequestParam Integer taskType) {
         try {
         try {
             Task task = jdbcTemplate.query("SELECT * FROM u_task WHERE id = ?", new Object[]{taskId}, new BeanPropertyRowMapper<>(Task.class)).stream().findAny().orElse(null);
             Task task = jdbcTemplate.query("SELECT * FROM u_task WHERE id = ?", new Object[]{taskId}, new BeanPropertyRowMapper<>(Task.class)).stream().findAny().orElse(null);
             if (task == null) {
             if (task == null) {
-                return R.fail("未找到任务相关信息");
+                System.out.println("未找到任务相关信息");
             }
             }
             if (task.getStatus() == 3) {
             if (task.getStatus() == 3) {
-                return R.fail("已废除无法查看报表");
+                System.out.println("已废除无法查看报表");
             }
             }
 
 
             String sql = "";
             String sql = "";
             if (type == 0) {
             if (type == 0) {
                 if(Func.isEmpty(reportId) || reportId==null){
                 if(Func.isEmpty(reportId) || reportId==null){
-                    sql = "select raw_url from s_interim_pay_certificate where contract_period_id = "+task.getFormDataId()+" ";
+                    sql = "select * from s_interim_pay_certificate where is_deleted=0 and contract_period_id = "+task.getFormDataId()+" ";
                 }else{
                 }else{
-                    sql = "select raw_url from s_interim_pay_certificate where id = "+reportId+"";
+                    sql = "select * from s_interim_pay_certificate where is_deleted=0 and id = "+reportId+"";
                 }
                 }
             } else {
             } else {
                 if(Func.isEmpty(reportId) || reportId==null){
                 if(Func.isEmpty(reportId) || reportId==null){
-                    sql = "select raw_url from s_material_start_statement where contract_period_id = "+task.getFormDataId()+"";
+                    sql = "select * from s_material_start_statement where is_deleted=0 and contract_period_id = "+task.getFormDataId()+"";
                 }else{
                 }else{
-                    sql = "select raw_url from s_material_start_statement where id = "+reportId+"";
+                    sql = "select * from s_material_start_statement where is_deleted=0 and id = "+reportId+"";
                 }
                 }
             }
             }
-            String pdfUrl = jdbcTemplate.queryForObject(sql, String.class);
-            if (StringUtils.isBlank(pdfUrl)) {
+            Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
+            String pdfUrl = stringObjectMap.get("raw_url")+"";
+            if (pdfUrl.length()<=10) {
                 calculate(reportId, type, taskType);
                 calculate(reportId, type, taskType);
-                return R.fail("电签报表生成中,等2分钟刷新查看");
+                System.out.println("电签报表生成中,等2分钟刷新查看");
             } else {
             } else {
                 List<String> pdfSignIds = PdfAddimgUtil.getPdfSignIds(pdfUrl);
                 List<String> pdfSignIds = PdfAddimgUtil.getPdfSignIds(pdfUrl);
                 if (pdfSignIds.size() > 0) {
                 if (pdfSignIds.size() > 0) {
@@ -3851,21 +3856,21 @@ public class TaskController extends BladeController {
                                 }
                                 }
                             }
                             }
                         } else {
                         } else {
-                            return R.data(FileUtils.getNetUrl(localPdfPath));
+                            System.out.println("");
                         }
                         }
 
 
                     } else {
                     } else {
-                        return R.data(pdfUrl);
+                        System.out.println("");
                     }
                     }
 
 
                 } else {
                 } else {
-                    return R.data(pdfUrl);
+                    System.out.println("");
                 }
                 }
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
             throw new RuntimeException(e);
             throw new RuntimeException(e);
         }
         }
-        return R.data("");
+        System.out.println("");
     }
     }
 
 
 
 
@@ -4411,7 +4416,7 @@ public class TaskController extends BladeController {
                 String UPSqlJL = " update u_task_parallel a set a.e_visa_status=1,e_visa_content='电签成功' where sort in( SELECT a.fixed_flow_branch_sort from u_task b,u_fixed_flow_link a where b.`status` in(1,2) and b.form_data_id='" + report.getPeriodId() + "' and a.fixed_flow_id=b.fixed_flow_id and a.flow_task_type=2 ) and a.process_instance_id in(SELECT process_instance_id from u_task b where b.`status` in(1,2) and b.form_data_id='" + report.getPeriodId() + "')";
                 String UPSqlJL = " update u_task_parallel a set a.e_visa_status=1,e_visa_content='电签成功' where sort in( SELECT a.fixed_flow_branch_sort from u_task b,u_fixed_flow_link a where b.`status` in(1,2) and b.form_data_id='" + report.getPeriodId() + "' and a.fixed_flow_id=b.fixed_flow_id and a.flow_task_type=2 ) and a.process_instance_id in(SELECT process_instance_id from u_task b where b.`status` in(1,2) and b.form_data_id='" + report.getPeriodId() + "')";
                 String DeSql = "delete from u_task_batch where task_parallel_id in(select b.process_instance_id from u_task b where b.`status` in(1,2) and b.form_data_id=" + report.getPeriodId() + ")";
                 String DeSql = "delete from u_task_batch where task_parallel_id in(select b.process_instance_id from u_task b where b.`status` in(1,2) and b.form_data_id=" + report.getPeriodId() + ")";
                 //删除以前存在的电签
                 //删除以前存在的电签
-                String sql = " insert INTO u_task_batch(id,task_parallel_id,json_data,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,nick_name) " + " SELECT a.id,a.process_instance_id,json_object('approvalFileList',json_array(),'approvalType',b.approval_type,'comment','','flag','OK','formDataId',b.form_data_id,'parallelProcessInstanceId',a.parallel_process_instance_id,'pass',true,'taskId',b.id) as  json_data,a.task_user,a.create_dept,a.create_time,a.update_user,a.update_time,1 as status,0 as is_deleted,a.task_user_name as nick_name " + " from u_task_parallel a,u_task b,u_fixed_flow_link c where b.`status` in(1,2) and  a.process_instance_id=b.process_instance_id and c.flow_task_type!=2 and a.sort = c.fixed_flow_branch_sort and c.fixed_flow_id=b.fixed_flow_id and b.form_data_id= '" + report.getPeriodId() + "'";
+                String sql = " insert INTO u_task_batch(id,task_parallel_id,json_data,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,nick_name,sign_format,sign_type) " + " SELECT a.id,a.process_instance_id,json_object('approvalFileList',json_array(),'approvalType',b.approval_type,'comment','','flag','OK','formDataId',b.form_data_id,'parallelProcessInstanceId',a.parallel_process_instance_id,'pass',true,'taskId',b.id) as  json_data,a.task_user,a.create_dept,a.create_time,a.update_user,a.update_time,1 as status,0 as is_deleted,a.task_user_name as nick_name ,1 as sign_format,1 as sign_type from u_task_parallel a,u_task b,u_fixed_flow_link c where b.`status` in(1,2) and  a.process_instance_id=b.process_instance_id and c.flow_task_type!=2 and a.sort = c.fixed_flow_branch_sort and c.fixed_flow_id=b.fixed_flow_id and b.form_data_id= '" + report.getPeriodId() + "'";
 
 
                 jdbcTemplate.execute(DeSql);
                 jdbcTemplate.execute(DeSql);
                 jdbcTemplate.execute(UPSql);
                 jdbcTemplate.execute(UPSql);

+ 8 - 3
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/MiddleMeterApplyMapper.xml

@@ -222,7 +222,7 @@
 <!--    </select>-->
 <!--    </select>-->
 
 
     <select id="getCurrentMeterMoney" resultType="java.math.BigDecimal">
     <select id="getCurrentMeterMoney" resultType="java.math.BigDecimal">
-        select current_period_pay
+        select sum(current_period_pay)
         from s_interim_pay_certificate_item where  chapter_seq=#{seq} and is_deleted = 0
         from s_interim_pay_certificate_item where  chapter_seq=#{seq} and is_deleted = 0
                                               and certificate_id =
                                               and certificate_id =
                                                   (select id from s_interim_pay_certificate
                                                   (select id from s_interim_pay_certificate
@@ -329,11 +329,16 @@
     </select>
     </select>
     <select id="getAllAncestors" resultType="org.springblade.manager.entity.WbsTreeContract">
     <select id="getAllAncestors" resultType="org.springblade.manager.entity.WbsTreeContract">
         select * from m_wbs_tree_contract where contract_id = #{contractId} and is_deleted = 0
         select * from m_wbs_tree_contract where contract_id = #{contractId} and is_deleted = 0
-        and p_id in
+        and (id in
         <foreach collection="ids" item="id" open="(" close=")" separator=",">
         <foreach collection="ids" item="id" open="(" close=")" separator=",">
             #{id}
             #{id}
         </foreach>
         </foreach>
-        group by p_id
+        or p_key_id in
+        <foreach collection="ids" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+            )
+        group by id
     </select>
     </select>
     <select id="getNodeInfo" resultType="org.springblade.meter.vo.WbsNodeVO">
     <select id="getNodeInfo" resultType="org.springblade.meter.vo.WbsNodeVO">
         SELECT id,parent_id,p_key_id as pId,
         SELECT id,parent_id,p_key_id as pId,