ソースを参照

2023 1 19 保存更新

zhuwei 1 年間 前
コミット
84893a0f91
16 ファイル変更403 行追加456 行削除
  1. 2 1
      blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  2. 2 2
      blade-common/src/main/java/org/springblade/common/utils/AsyncConfigurer.java
  3. 3 3
      blade-common/src/main/java/org/springblade/common/utils/CommonUtil.java
  4. 16 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TaskClient.java
  5. 11 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TaskClientImpl.java
  6. 11 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITaskService.java
  7. 9 15
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  8. 178 97
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java
  9. 15 5
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  10. 0 1
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PDFUtils.java
  11. 58 313
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  12. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  13. 0 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/ExcelInfoUtils.java
  14. 94 15
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/test.java
  15. 1 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java
  16. 2 2
      blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java

+ 2 - 1
blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java

@@ -73,7 +73,8 @@ public interface LauncherConstant {
     String APPLICATION_XXLJOB_ADMIN_NAME = APPLICATION_NAME_PREFIX + "xxljob-admin";
 
     /**
-     * nacos dev 地址 172.31.222.127   192.168.0.109     127.0.0.1    172.30.224.81(216.210)
+     * nacos dev 地址 215==172.31.222.127   192.168.0.109     127.0.0.1  210-=-172.30.224.81
+     * nacos dev 地址 172.31.222.127   192.168.0.109     127.0.0.1    172.30.224.81(39.108.216.210)
      */
     String NACOS_DEV_ADDR = "127.0.0.1:8848";
 

+ 2 - 2
blade-common/src/main/java/org/springblade/common/utils/AsyncConfigurer.java

@@ -15,7 +15,7 @@ public class AsyncConfigurer {
     /**
      * cpu 核心数量
      */
-    public static final int cpuNum =6 ;//Runtime.getRuntime().availableProcessors();
+    public static final int cpuNum =10 ;//Runtime.getRuntime().availableProcessors();
 
     /**
      * 线程池配置
@@ -25,7 +25,7 @@ public class AsyncConfigurer {
     @Bean("taskExecutor1")
     public ThreadPoolExecutor getAsyncExecutor() {
         return new ThreadPoolMonitor(cpuNum
-                , 12
+                , 20
                 , 30
                 , TimeUnit.SECONDS
                 , new LinkedBlockingQueue<>(2000)

+ 3 - 3
blade-common/src/main/java/org/springblade/common/utils/CommonUtil.java

@@ -509,15 +509,15 @@ public class CommonUtil {
     }
 
     public static String replaceOssUrl(String url) {
-      /*  String osName = System.getProperty("os.name");
+        String osName = System.getProperty("os.name");
         if (osName != null && osName.toLowerCase().contains("linux")) {
             // 如果当前操作系统是Linux系统
             Map<String, String> envMap = System.getenv();
             if (!envMap.containsKey("linuxtesttest")) {
                 // 如果当前环境变量不包含linuxtesttest,则替换URL中的oss路径
-                url = url.replace("oss-cn-hangzhou.aliyuncs.com", "oss-cn-hangzhou-internal.aliyuncs.com");
+                url = url.replace(".aliyuncs.com", "-internal.aliyuncs.com");
             }
-        }*/
+        }
         //后续删除
         System.out.println("replaceOssUrl " + url);
         return url;

+ 16 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TaskClient.java

@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import java.io.FileNotFoundException;
 import java.util.List;
 import java.util.Map;
 
@@ -34,6 +35,8 @@ public interface TaskClient {
     String QUERY_TASK_ALL_BATCH = API_PREFIX + "/query-contract-all-batch";
     String SAVE_TASK = API_PREFIX + "/save_task";
     String SAVE_TASK_PARALLEL = API_PREFIX + "/save_task_parallel";
+    String UDATE_DATA_FORMID = API_PREFIX + "/updateBusinessDataByFormDataId";
+    String TRIAL_TASK_PELATED = API_PREFIX + "/trialSelfTaskRelated";
     String QUERY_USER_TASK = API_PREFIX + "/query-user-task";
     String DELETE_USER_TASK = API_PREFIX + "/delete-user-task";
     String BATCH_RE_SIGN = API_PREFIX + "/re-sign";
@@ -131,4 +134,17 @@ public interface TaskClient {
     @GetMapping(value = "/getWebsocketMsgArchive")
     Map<String, String> getWebsocketMsgArchive(@RequestParam String projectId,@RequestParam  String contractId,@RequestParam  String userIdResult);
 
+    /**
+     * 电签成功,回调业务接口
+     */
+    @PostMapping(UDATE_DATA_FORMID)
+    void updateBusinessDataByFormDataId(@RequestBody Task task, @RequestParam Integer status, @RequestParam String newFileUrl,@RequestParam Long UserId);
+
+
+    /**
+     * 试验自检任务业务相关
+     */
+    @PostMapping(TRIAL_TASK_PELATED)
+    void trialSelfTaskRelated(@RequestBody TaskApprovalVO taskApprovalVO,@RequestParam String pdfUrlEVisa,@RequestParam String batchId) throws FileNotFoundException;
+
 }

+ 11 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TaskClientImpl.java

@@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.io.FileNotFoundException;
 import java.util.List;
 import java.util.Map;
 
@@ -176,5 +177,15 @@ public class TaskClientImpl implements TaskClient {
         return taskService.getTaskCountArchive(projectId, contractId, userIdResult);
     }
 
+    @Override
+    public void updateBusinessDataByFormDataId(Task task, Integer status, String newFileUrl, Long UserId) {
+        taskService.updateBusinessDataByFormDataId(task,status,newFileUrl,UserId);
+    }
+
+
+    @Override
+    public void trialSelfTaskRelated(TaskApprovalVO taskApprovalVO, String pdfUrlEVisa, String batchId)throws FileNotFoundException {
+        taskService.trialSelfTaskRelated(taskApprovalVO,pdfUrlEVisa,batchId);
+    }
 
 }

+ 11 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITaskService.java

@@ -104,4 +104,15 @@ public interface ITaskService extends BaseService<Task> {
      * 根据数据源id查询任务
      */
     Task getTaskByFormDataId(String formDataId);
+
+    /**
+     * 修改业务数据状态
+     */
+    void updateBusinessDataByFormDataId(Task task, Integer status, String newFileUrl, Long UserId);
+
+    /**
+     * 试验自检任务业务相关
+     */
+    void trialSelfTaskRelated(TaskApprovalVO taskApprovalVO, String pdfUrlEVisa, String batchId) throws FileNotFoundException;
+
 }

+ 9 - 15
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -131,9 +131,6 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 
     private final ITrialSelfInspectionRecordService iTrialSelfInspectionRecordService;
 
-    // 线程池
-    @Resource(name = "taskExecutor1")
-    private ThreadPoolExecutor executor;
 
     @Override
     public List<TaskParallel> queryApprovalUser(String formDataIds) {
@@ -579,8 +576,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     }
 
 
-    @Scheduled(cron = "0/20 * * * * ?")
-    public void SignInfo() throws InterruptedException {
+   // @Scheduled(cron = "0/20 * * * * ?")
+   /* public void SignInfo() throws InterruptedException {
         //执行代码
         logger.debug("扫描开始");
         List<TaskBatch> maps = taskBatchService.queryDataInfo();
@@ -599,7 +596,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     RedisTemplate.opsForValue().set("sign-" + taskApprovalVO.getFormDataId(), "1");
                     CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
                         try {
-                            /*===============执行批量任务===============*/
+                            *//*===============执行批量任务===============*//*
                             this.checkIsExsitTaskBatch(taskApprovalVO, taskBatchId, userId, nickName);
                         } catch (FileNotFoundException e) {
                             e.printStackTrace();
@@ -609,11 +606,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 }
             }
         }
-        System.out.println("队列数量" + executor.getQueue().size());
-        System.out.println("活跃数量" + executor.getActiveCount());
-        System.out.println("总共数量" + executor.getTaskCount());
-        System.out.println("完成数量" + executor.getCompletedTaskCount());
-    }
+
+    }*/
 
     private void checkIsExsitTaskBatch(TaskApprovalVO taskApprovalVO, String batchId, Long userId, String nickName) throws FileNotFoundException {
         logger.info("【任务审核】当前批次开始电签。批次ID:" + batchId);
@@ -752,8 +746,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 
         } else {
             //废除,遵循只要某一个分支流程废除,则主流程废除、其它分支流程均自动结束
-            //完成/审批当前分支流程
-            this.newFlowClient.completeApprovalTask(taskId, parallelProcessInstanceId, comment).getData();
+
+
             //将分支状态更改为已废除
             this.taskParallelService.update(Wrappers.<TaskParallel>lambdaUpdate().set(TaskParallel::getStatus, 3)
                     .set(TaskParallel::getUpdateUser, taskApprovalVO.getUserId())
@@ -911,7 +905,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     /**
      * 试验自检任务业务相关
      */
-    private void trialSelfTaskRelated(TaskApprovalVO taskApprovalVO, String pdfUrlEVisa, String batchId) throws FileNotFoundException {
+    public void trialSelfTaskRelated(TaskApprovalVO taskApprovalVO, String pdfUrlEVisa, String batchId) throws FileNotFoundException {
         //============== 电签成功,修改试验状态,关联工程部位信息pdf(只有电签成功,才修改) ==============
         if ("OK".equals(taskApprovalVO.getFlag()) && StringUtils.isNotEmpty(pdfUrlEVisa)) {
             //已审批
@@ -1068,7 +1062,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     /**
      * 修改业务数据状态
      */
-    private void updateBusinessDataByFormDataId(Task task, Integer status, String newFileUrl, Long UserId) {
+    public void updateBusinessDataByFormDataId(Task task, Integer status, String newFileUrl, Long UserId) {
         switch (task.getApprovalType()) {
             case 1:
                 //资料填报

+ 178 - 97
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java

@@ -1,97 +1,178 @@
-//package org.springblade.evisa.controller;
-//
-//import com.alibaba.fastjson.JSON;
-//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-//import io.swagger.annotations.*;
-//import lombok.AllArgsConstructor;
-//import lombok.extern.slf4j.Slf4j;
-//import org.apache.commons.lang.StringUtils;
-//import org.springblade.business.entity.TaskBatch;
-//import org.springblade.business.vo.TaskApprovalVO;
-//import org.springblade.core.boot.ctrl.BladeController;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.data.redis.core.StringRedisTemplate;
-//import org.springframework.jdbc.core.JdbcTemplate;
-//import org.springframework.scheduling.annotation.Scheduled;
-//import org.springframework.web.bind.annotation.*;
-//
-//import javax.annotation.Resource;
-//import java.io.BufferedReader;
-//import java.io.FileNotFoundException;
-//import java.io.IOException;
-//import java.io.InputStreamReader;
-//import java.util.*;
-//import java.util.concurrent.*;
-//
-//import java.lang.management.ManagementFactory;
-//import java.lang.management.OperatingSystemMXBean;
-//import java.util.concurrent.locks.ReentrantLock;
-//
-///**
-// * 清表基础数据表 控制器
-// *
-// * @author BladeX
-// * @since 2022-05-18
-// */
-//@RestController
-//@AllArgsConstructor
-//@RequestMapping("/evisaInfo")
-//@Api(value = "电签类", tags = "电签类接口")
-//@Slf4j
-//public class EVisaController {
-//
-//    @Autowired
-//    StringRedisTemplate RedisTemplate;
-//
-//    private final JdbcTemplate jdbcTemplate;
-//
-//    // 线程池
-//   // @Resource(name = "taskExecutor1")
-//  //  private ThreadPoolExecutor executor;
-//
-//    // 电签主类
-//  //  @Scheduled(cron = "0 */1 * * * ?")
-//    public void SignInfo() {
-//
-//        //执行代码
-//        log.info("扫描开始");
-//        String sql = "SELECT * from u_task_batch where is_deleted =0 LIMIT 100";
-//        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
-//        if (maps != null && maps.size() >= 1) {
-//            for (Map<String, Object> dataInfo : maps) {
-//                String jsonData = dataInfo.get("json_data")+"";
-//                TaskApprovalVO taskApprovalVO = JSON.parseObject(jsonData, TaskApprovalVO.class);
-//                String taskBatchId = dataInfo.get("id").toString();
-//                Long userId = Long.valueOf(dataInfo.get("create_user")+"");
-//                String nickName = dataInfo.get("nick_name")+"";
-//                Boolean aBoolean = RedisTemplate.hasKey("sign-" + taskApprovalVO.getFormDataId());
-//                System.out.println(aBoolean);
-//
-//                RedisTemplate.opsForValue().set("sign-" + taskApprovalVO.getFormDataId(), "1", 600, TimeUnit.SECONDS);
-//
-//               /* String formDataId = taskApprovalVO.getFormDataId().substring(0,5);
-//                synchronized (formDataId){
-//                    executor.execute(new Runnable() {
-//                        @Override
-//                        public void run() {
-//                            checkIsExsitTaskBatch(taskApprovalVO,formDataId,userId,nickName);
-//                        }
-//                    });
-//                }*/
-//            }
-//        }
-//    }
-//
-//    public void checkIsExsitTaskBatch(TaskApprovalVO taskApprovalVO, String batchId, Long userId, String nickName){
-//           synchronized (batchId){
-//               try {
-//                   System.out.println("开始执行-------");
-//                   Thread.sleep(8000);
-//                   System.out.println(batchId);
-//                   System.out.println("结束执行-------");
-//               } catch (InterruptedException e) {
-//                   throw new RuntimeException(e);
-//               }
-//           }
-//    }
-//}
+package org.springblade.evisa.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.business.entity.Task;
+import org.springblade.business.entity.TaskBatch;
+import org.springblade.business.entity.TaskParallel;
+import org.springblade.business.feign.TaskClient;
+import org.springblade.business.vo.TaskApprovalVO;
+import org.springblade.evisa.service.EVisaService;
+import org.springblade.evisa.vo.EVisaTaskApprovalVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.io.FileNotFoundException;
+import java.util.*;
+import java.util.concurrent.*;
+
+
+/**
+ * 清表基础数据表 控制器
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/evisaInfo")
+@Api(value = "电签类", tags = "电签类接口")
+@Slf4j
+public class EVisaController {
+
+    @Autowired
+    StringRedisTemplate RedisTemplate;
+
+    // jdbc
+    private final JdbcTemplate jdbcTemplate;
+
+    //电签服务类
+    private final EVisaService eVisaService;
+
+    // 线程池
+    @Resource(name = "taskExecutor1")
+    private ThreadPoolExecutor executor;
+
+    private final TaskClient taskClient;
+
+    // 电签主类
+
+    @Scheduled(cron = "0/20 * * * * ?")
+    public void SignInfo() {
+        //执行代码
+        log.info("扫描开始");
+        String sql = "SELECT * from u_task_batch where is_deleted<>5 LIMIT 40";
+        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
+        if (maps != null && maps.size() >= 1) {
+            for (Map<String, Object> dataInfo : maps) {
+                if (executor.getQueue().size()<=40 ) {
+                    String jsonData = dataInfo.get("json_data") + "";
+                    TaskApprovalVO taskApprovalVO = JSON.parseObject(jsonData, TaskApprovalVO.class);
+                    String taskBatchId = dataInfo.get("id").toString();
+                    Long userId = Long.valueOf(dataInfo.get("create_user") + "");
+                    String nickName = dataInfo.get("nick_name") + "";
+                    Boolean aBoolean = RedisTemplate.hasKey("sign-" + taskApprovalVO.getFormDataId());
+                    taskApprovalVO.setId(taskBatchId);
+                    taskApprovalVO.setUserId(userId);
+                    taskApprovalVO.setNickName(nickName);
+                    System.out.println("---------" + aBoolean);
+                    if (!aBoolean) {
+                        RedisTemplate.opsForValue().set("sign-" + taskApprovalVO.getFormDataId(), "1",120, TimeUnit.SECONDS);
+                        CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
+                            try {
+                                /*===============执行批量任务===============*/
+                                this.checkIsExsitTaskBatch(taskApprovalVO);
+                            } 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());
+    }
+
+    public void checkIsExsitTaskBatch(TaskApprovalVO taskApprovalVO){
+        if ("OK".equals(taskApprovalVO.getFlag())) { // 同意
+            // 调用电签接口
+            String eVisaStatus = eVisaService.eVisa(JSONObject.parseObject(JSONObject.toJSONString(taskApprovalVO), EVisaTaskApprovalVO.class));
+
+
+            if (eVisaStatus == null || StringUtils.isEmpty(eVisaStatus)) {
+                //状态改为 == 4 --
+
+            } else if ("notpdfsgin".equals(eVisaStatus) || eVisaStatus.contains("notpdfsgin")) { //没有找到关键字Id
+               //状态改为 == 4 --
+                String up_task = "update u_task_batch set is_deleted=5 where id="+taskApprovalVO.getId();
+                jdbcTemplate.execute(up_task);
+
+                String up_task_par = "update u_task_parallel set status=99,e_visa_content='pdf关键字与数据库中id不匹配' ,update_time=SYSDATE() where parallel_process_instance_id='"+taskApprovalVO.getParallelProcessInstanceId()+"'";
+                jdbcTemplate.execute(up_task_par);
+
+            } else if ("success".equals(eVisaStatus) || eVisaStatus.contains("success")) { //成功操作
+                //将 状态改为
+                String up_task_par = "update u_task_parallel set status=2, e_visa_status=1,e_visa_content='电签成功' ,update_time=SYSDATE() where parallel_process_instance_id='"+taskApprovalVO.getParallelProcessInstanceId()+"'";
+                jdbcTemplate.execute(up_task_par);
+
+                //获取状态为1(待审批)的分支流程
+                List<Task> tasks = taskClient.queryTaskListByFormDataId(taskApprovalVO.getFormDataId());
+                Task masterTask = tasks.get(0);
+                String sql = "SELECT a.* from u_task_parallel a where a.process_instance_id=(SELECT process_instance_id from u_task_parallel b where  b.parallel_process_instance_id='"+taskApprovalVO.getParallelProcessInstanceId()+"') and is_deleted=0 and `status`=1 ";
+                List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
+                if (maps == null || maps.size() == 0) {
+                    //说明都审批完成,将主表状态更改为已完成
+                    String finalPdfUrl = null;
+                    if (eVisaStatus.contains("@@@@")) {
+                        finalPdfUrl = eVisaStatus.split("@@@@")[1];
+                    }
+                    //todo ===================== 执行合同章
+                    try {
+                        //执行合同章,返回的是盖有合同章的PDF路径
+                        finalPdfUrl = this.eVisaService.eVisaContractSeal(JSONObject.parseObject(JSONObject.toJSONString(taskApprovalVO), EVisaTaskApprovalVO.class), finalPdfUrl);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+
+                    //修改主流程状态为已完成
+                    String up_task = "update u_task set status=2,update_time=SYSDATE() where id="+taskApprovalVO.getTaskId();
+
+                    //修改对应的业务数据状态为已审批
+                    taskClient.updateBusinessDataByFormDataId(masterTask, 2, finalPdfUrl, taskApprovalVO.getUserId());
+
+                    //返回电签成功的pdf路径,给试验用
+                    try {
+                        taskClient.trialSelfTaskRelated(taskApprovalVO, finalPdfUrl, taskApprovalVO.getId());
+                    } catch (FileNotFoundException e) {
+                        throw new RuntimeException(e);
+                    }
+                }else {
+                    //只更新PDF路径
+                    taskClient.updateBusinessDataByFormDataId(masterTask, 1, eVisaStatus.contains("@@@@") ? eVisaStatus.split("@@@@")[1] : null, taskApprovalVO.getUserId());
+                    String finalPdfUrl = eVisaStatus.contains("@@@@") ? eVisaStatus.split("@@@@")[1] : null;
+                    try {
+                        taskClient.trialSelfTaskRelated(taskApprovalVO, finalPdfUrl, taskApprovalVO.getId());
+                    } catch (FileNotFoundException e) {
+                        throw new RuntimeException(e);
+                    }
+                }
+
+            }else if ("eVisaError".equals(eVisaStatus) || eVisaStatus.contains("eVisaError")) {
+
+            }else {
+
+            }
+            RedisTemplate.delete("sign-" + taskApprovalVO.getFormDataId());
+        }else{ //废除
+
+            // 修改 主 任务 u_task 表 状态改为3
+
+            String up_task_par = "update u_task_parallel set status=3 where parallel_process_instance_id="+taskApprovalVO.getParallelProcessInstanceId();
+
+            String up_task = "update u_task set status=3 where id="+taskApprovalVO.getTaskId();
+
+        }
+    }
+}

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

@@ -84,7 +84,8 @@ import java.util.*;
 @AllArgsConstructor
 public class EVisaServiceImpl implements EVisaService {
 
-    private static final String SIGN_HOST = "47.115.117.246";
+    private static final String SIGN_HOST = "172.30.224.79";
+    //private static final String SIGN_HOST = "47.115.117.246";
 
     private static final String SIGN_PORT = "8183";
 
@@ -92,6 +93,8 @@ public class EVisaServiceImpl implements EVisaService {
 
     private static final String NOT_PFX_OR_FILE = "notPfxOrFile";
 
+    private static final String NOT_PFX_SGIN = "notpdfsgin";
+
     private static final String ERROR = "error";
 
     private static final String SUCCESS = "success";
@@ -403,8 +406,9 @@ public class EVisaServiceImpl implements EVisaService {
         TaskApprovalVO taskFile = this.taskClient.queryBusinessDataTask(JSONObject.parseObject(JSONObject.toJSONString(task), TaskApprovalVO.class));
         if (taskFile == null || taskFile.getApprovalFileList().size() <= 0) {
             //没有找到业务文件,取消签章
+            System.out.println("------1------");
             RedisTemplate.delete("sign-" + task.getFormDataId());
-            return NOT_PFX_OR_FILE;
+            return NOT_PFX_SGIN;
         }
 
         //上锁
@@ -421,9 +425,11 @@ public class EVisaServiceImpl implements EVisaService {
                     continue;
                 }
                 String pdfUrl = file.getFileUrl();
+                pdfUrl = CommonUtil.replaceOssUrl(pdfUrl);
                 List<String> eVisaConfigList = PDFUtils.getPdfSignIds(pdfUrl);
                 if (eVisaConfigList == null || eVisaConfigList.size() == 0) {
                     //没有电签配置,默认当前任务为不签字审批,返回成功
+                    System.out.println("------2------");
                     RedisTemplate.delete("sign-" + task.getFormDataId());
                     return SUCCESS + "@@@@" + taskFile.getApprovalFileList().get(0).getFileUrl();
                 }
@@ -433,7 +439,6 @@ public class EVisaServiceImpl implements EVisaService {
                 //判断电签类型
 
                 if (taskFile.getRemarkType().equals("2")) {//东方 中讯 daMap.put("keyWord","1673632651551965184");
-
                     String sqlinfo = " SELECT a.id as keyWord,(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=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 )";
                     System.out.println("东方中讯-个人-user-id" + task.getUserId() + "--SQL=" + sqlinfo);
                     List<Map<String, Object>> maps = jdbcTemplate.queryForList(sqlinfo);
@@ -446,7 +451,9 @@ public class EVisaServiceImpl implements EVisaService {
 
                             byte[] fileByte;
                             if (fileUrl.indexOf("aliyuncs.com") >= 0) {
-                                fileByte = CommonUtil.InputStreamToBytes(CommonUtil.getOSSInputStream(fileUrl));
+
+                                URL url =new URL(pdfUrl);
+                                fileByte = IOUtils.toByteArray(url);
                             } else {
                                 FileReader fileReader = new FileReader(fileUrl);
                                 fileByte = fileReader.readBytes();
@@ -472,6 +479,7 @@ public class EVisaServiceImpl implements EVisaService {
                             }
                         }
                     } else {
+                        System.out.println("------3------");
                         RedisTemplate.delete("sign-" + task.getFormDataId());
                         return SUCCESS + "@@@@" + taskFile.getApprovalFileList().get(0).getFileUrl();
                     }
@@ -481,8 +489,9 @@ public class EVisaServiceImpl implements EVisaService {
                     System.out.println("安心签-个人-user-id" + task.getUserId() + "--SQL=" + sqlinfo);
                     if (maps == null || maps.size() <= 0) {
                         //没有签章,不执行电签
+                        System.out.println("------4------");
                         RedisTemplate.delete("sign-" + task.getFormDataId());
-                        return NOT_PFX_OR_FILE;
+                        return NOT_PFX_SGIN;
                     }
                     //准备签章策略
                     List<SealStrategyVO> sealStrategyVOS = new ArrayList<>();
@@ -534,6 +543,7 @@ public class EVisaServiceImpl implements EVisaService {
                 }
             }
         } catch (Exception e) {
+            System.out.println("------5------");
             RedisTemplate.delete("sign-" + task.getFormDataId());
             e.printStackTrace();
         }

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

@@ -72,7 +72,6 @@ public class PDFUtils {
         PdfDocument pdf = new PdfDocument();
         List<String> eVisaConfigList = new ArrayList<>();
         try {
-
             URL url =new URL(pdfUrl);
 /*            URLConnection conn = url.openConnection();
             conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");

+ 58 - 313
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -83,6 +83,7 @@ import java.awt.*;
 import java.awt.image.BufferedImage;
 import java.io.*;
 import java.net.URL;
+import java.net.URLConnection;
 import java.net.URLEncoder;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -314,13 +315,16 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "nodeId", value = "节点id", required = true)
     })
     public R putFileAttach(@RequestParam("file") MultipartFile file, Long nodeId) {
-        String file_path = "/Users/hongchuangyanfa/Desktop/";//FileUtils.getSysLocalFileUrl();
+        String file_path = FileUtils.getSysLocalFileUrl();
         ExcelTab detail = excelTabService.getById(nodeId);
 
         String filecode = SnowFlakeUtil.getId() + "";
         String thmlUrl = file_path + filecode + ".html";
         String exceUrl = file_path + filecode + "123.xlsx";
 
+        Workbook wb = new Workbook();
+        wb.loadFromMHtml(file.getInputStream());
+
         ExcelInfoUtils.excelInfo(file.getInputStream(), exceUrl, thmlUrl, "1");
         // 上传excel文件
         BladeFile bladeFile = newIOSSClient.uploadFile(file.getOriginalFilename(), exceUrl);
@@ -340,6 +344,57 @@ public class ExcelTabController extends BladeController {
     }
 
 
+    public static InputStream getOSSInputStream(String urlStr) throws Exception {
+        //获取OSS文件流
+        URL url =new URL(urlStr);
+        final URLConnection conn = url.openConnection();
+        conn.setConnectTimeout(500);
+        conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
+        try {
+            return conn.getInputStream();
+        } catch (Exception e){
+            return null;
+        }
+    }
+
+    @SneakyThrows
+    @PostMapping("/put-file-attach229")
+    @ApiOperationSupport(order = 229)
+    @ApiOperation(value = "清表上传229", notes = "清表上传229")
+    public void putFileAttach2() {
+        String sql="select id,file_url,html_url from m_excel_tab where alias LIKE '%1572469868132229121%' and LENGTH(file_url)>=10 and is_deleted=0";
+        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
+        for(Map<String, Object> ddat : maps){
+
+            String fileUrl = ddat.get("file_url")+"";
+            String nodeId = ddat.get("id")+"";
+            String htmlUrl = ddat.get("html_url")+"";
+            System.out.println("----------d"+nodeId+"d--------");
+            htmlUrl = htmlUrl.substring(htmlUrl.lastIndexOf("/")+1,htmlUrl.length());
+            String htmlUrl2 = "/Users/hongchuangyanfa/Desktop/html2/"+htmlUrl;
+
+            InputStream ossInputStream = getOSSInputStream(fileUrl);
+
+            String file_path = FileUtils.getSysLocalFileUrl();
+
+            String filecode = SnowFlakeUtil.getId() + "";
+        //    String thmlUrl = file_path + filecode + ".html";
+            String exceUrl = file_path + filecode + "123.xlsx";
+
+            ExcelInfoUtils.excelInfo(ossInputStream, exceUrl, htmlUrl2, "1");
+
+            // 解析html
+            expailHtmlInfo(htmlUrl2, Long.parseLong(nodeId));
+        }
+
+    }
+
+
+
+
+
+
+
     /**
      * 清表编辑 wbs 下拉框选择
      */
@@ -907,318 +962,6 @@ public class ExcelTabController extends BladeController {
         return doc.select("table").first() + "";
     }
 
-    // 上传解析 html
-    public void expailHtmlInfo12231(String thmlUrl, Long excelId) throws Exception {
-
-        // 读取
-        File file1 = ResourceUtil.getFile(thmlUrl);
-        String htmlString = IoUtil.readToString(new FileInputStream(file1));
-
-        /*
-           解析
-           1 解析样式
-           2 计算坐标
-           3 计算区域位置
-         */
-        // 样式集合
-        Document doc = Jsoup.parse(htmlString);
-        // 解析 style
-        Map<String, String> styleMap = getHtmlStyle(doc);
-        //解析
-        Element table = doc.select("table").first();
-        Elements trs = table.select("tr");
-        // 获取图片信息
-        Elements imgs = doc.select("img");
-        // 获取总行列数
-        int maxCol = doc.select("Col").size();
-        String[] rowData = new String[trs.size() + 5]; //本来加一的 害怕出现特殊情况 故意 加 5
-
-        // 行的状态
-        boolean index_state = false;
-        // 区域划分表示
-        int xy_type = 1;
-
-        // 解析 excel元素集合
-        List<ExctabCell> colTitle = new ArrayList<>();
-
-//      标题集合信息
-        List<Map<String, String>> zikey = new ArrayList<>();
-        for (int i = 0; i <= trs.size() - 1; i++) {
-            Element tr = trs.get(i);
-            Elements tds = tr.select("td");
-            String xyInof = getTrInfo(tds, styleMap, index_state, xy_type, maxCol, i, zikey);
-            xy_type = Integer.parseInt(xyInof.split(",")[0]);
-            tr.attr("xy_type", xyInof);
-            index_state = Boolean.parseBoolean(xyInof.split(",")[1]);
-
-            boolean istrue = Boolean.parseBoolean(xyInof.split(",")[3]);
-
-            // 计算单元格坐标
-            for (int j = 0; j < tds.size(); j++) {
-                {
-                    Element data = tds.get(j);
-                    int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
-                    int rowspan = data.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(data.attr("ROWSPAN"));
-                    String keyId = data.attr("class");
-                    if (StringUtils.isNotEmpty(keyId)) {
-                        data.removeAttr("class");
-                    }
-
-                    // 计算
-                    int x1 = Integer.parseInt(data.attr("x1"));
-                    int x2 = Integer.parseInt(data.attr("x2"));
-                    ;
-                    int y1 = Integer.parseInt(data.attr("y1"));
-                    ;
-                    int y2 = Integer.parseInt(data.attr("y2"));
-                    ;
-
-                    String textInfo = data.text().trim().replaceAll(" ", "");
-                    System.out.println("-------==" + textInfo);
-
-                    data.text(textInfo.replaceAll(" ", ""));
-                    if (textInfo.indexOf("□") < 0 && !textInfo.isEmpty() && !(textInfo.equals("/") && textInfo.length() < 2) && !(textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) && !textInfo.equals("—") && !textInfo.equals("-")) {  // 标题区域
-                        Map<String, String> dataInfo = new HashMap<String, String>();
-                        dataInfo.put("name", textInfo);
-                        dataInfo.put("x1", x1 + "");
-                        dataInfo.put("x2", x2 + "");
-                        dataInfo.put("y1", y1 + "");
-                        dataInfo.put("y2", y2 + "");
-                        dataInfo.put("xytype", xy_type + "");
-                        if (textInfo.indexOf("/") < 0 || (textInfo.indexOf("/") >= 0 && textInfo.length() > 1)) { // 带/为分割数据
-                            zikey.add(dataInfo);
-                        }
-                    } else { //空行
-                        List<Map<String, String>> left = new ArrayList<>();
-                        List<Map<String, String>> top = new ArrayList<>();
-                        for (int k = 0; k < zikey.size(); k++) {
-                            String name = zikey.get(k).get("name");
-                            int xx1 = Integer.parseInt(zikey.get(k).get("x1"));
-                            int xx2 = Integer.parseInt(zikey.get(k).get("x2"));
-                            int yy1 = Integer.parseInt(zikey.get(k).get("y1"));
-                            int yy2 = Integer.parseInt(zikey.get(k).get("y2"));
-                            int xytype2 = Integer.parseInt(zikey.get(k).get("xytype"));
-
-                            // 左匹配
-                            if (yy1 <= y1 && yy2 >= y2 && xx2 < x1 && xytype2 == xy_type) {
-                                left.add(zikey.get(k));
-                            }
-
-                            //向 上 匹配
-                            if (index_state) {
-                                if (xx1 <= x1 && xx2 >= x2 && yy2 < y1 && xytype2 == xy_type) {
-                                    top.add(zikey.get(k));
-                                }
-                            }
-                        }
-
-                        String inputText = "";
-                        // 特征值赛选 规则
-                        for (int k = 0; k < left.size(); k++) { // 左计算
-                            String name = left.get(k).get("name");
-                            int xx2 = Integer.parseInt(left.get(k).get("x2"));
-                            int yy2 = Integer.parseInt(left.get(k).get("y2"));
-
-                            if (!StringUtil.isNumeric(name) && name.length() <= 20) { // 数字不匹配
-                                if (index_state) { // 正向规则匹配
-                                    if (istrue) { // 是否空格等于值
-                                        if (x1 - xx2 <= 1 && y1 == yy2) {
-                                            inputText = name;
-                                        } else {
-                                            inputText += name + "_";
-                                        }
-                                    } else {
-                                        inputText += name + "_";
-                                    }
-                                } else {
-                                    if (x1 - xx2 <= 1 && y1 == yy2) {
-                                        inputText = name;
-                                    }
-                                }
-                            }
-                        }
-
-                        // 特征值赛选 规则
-                        if (top != null && top.size() >= 1) {
-                            for (int k = 0; k < top.size(); k++) { // 向上计算
-                                String name = top.get(k).get("name");
-                                if (!StringUtil.isNumeric(name) && name.length() <= 20) {
-                                    inputText += name + "_";
-                                }
-                            }
-                        }
-
-                        if (inputText != null && inputText != "" && inputText.indexOf("_") >= 0) {
-                            inputText = inputText.substring(0, inputText.lastIndexOf("_"));
-                        }
-
-                        // 质检表特殊处理匹配
-                        String parm = i + "," + j + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
-                        // 设置文本信息
-                        ExctabCell exctabCell = new ExctabCell();
-                        if ((textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) || inputText.indexOf("日期") >= 0) {
-                            if (inputText.indexOf("日期") >= 0) {
-                                data.empty().append("<el-date-picker type='date' @keyDowns='dateKeydown()' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='" + inputText + "'> </el-date-picker>");
-                            } else if (textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) {
-                                if (inputText.indexOf("专业监理工程师") >= 0) {
-                                    inputText = "专业监理工程师_年月日";
-                                } else if (inputText.indexOf("质检工程师") >= 0) {
-                                    inputText = "质检工程师_年月日";
-                                } else {
-                                    inputText = "年月日";
-                                }
-                            }
-                            data.empty().append("<el-date-picker @keyDowns='dateKeydown()'  type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
-                            exctabCell.setTextInfo(inputText);
-                            exctabCell.setExctabId(excelId);
-                            exctabCell.setIsDeleted(0);
-                            exctabCell.setXys(i + "_" + j);
-                            colTitle.add(exctabCell);
-                            data.attr("title", inputText);
-
-                        } else if (textInfo.indexOf("□") >= 0) { //多选框
-                            exctabCell.setTextInfo(inputText);
-                            exctabCell.setExctabId(excelId);
-                            exctabCell.setIsDeleted(0);
-                            exctabCell.setXys(i + "_" + j);
-                            colTitle.add(exctabCell);
-                            data.attr("title", inputText);
-                            // 添加多选框
-
-                            String[] cheText = textInfo.split("□");
-                            JSONArray objs = new JSONArray();
-                            if (cheText != null && cheText.length >= 1) {
-                                int key = 1;
-                                for (String keyval : cheText) {
-                                    JSONObject jsonObject = new JSONObject();
-                                    if (StringUtils.isNotEmpty(keyval)) {
-                                        jsonObject.put("key", key);
-                                        jsonObject.put("name", keyval);
-                                        objs.add(jsonObject);
-                                        keyId += 1;
-                                    }
-                                }
-                            } else {
-                                JSONObject jsonObject = new JSONObject();
-                                jsonObject.put("key", "1");
-                                jsonObject.put("name", "");
-                                objs.add(jsonObject);
-                            }
-
-                            String checkbox = "<hc-form-checkbox-group @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' :objs='" + objs + "'  @change='checkboxGroupChange' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " placeholder=''> </hc-form-checkbox-group>";
-                            data.empty().append(checkbox);
-                        } else {
-                            if (index_state) { // 区域内
-                                if (rowspan >= 1) {
-                                    data.empty().append("<el-input type='textarea' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft'  @keydown.shift.right='keyupShiftRight'  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
-                                } else {
-                                    data.empty().append("<el-input type='text' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft'  @keydown.shift.right='keyupShiftRight'  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
-                                }
-                            } else { // 区域外
-                                if (j == 0) {
-                                    if (colspan == maxCol && i >= 1) {
-                                        if (rowspan >= 1) {
-                                            data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='textarea'  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
-                                        } else {
-                                            data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='text' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
-                                        }
-                                    }
-                                } else {
-                                    Element bforData = tds.get(j - 1);
-                                    if (!bforData.text().isEmpty() || bforData.html().indexOf("hc-form-checkbox-group") >= 0) {
-                                        if (rowspan >= 1) {
-                                            data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='textarea' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
-                                        } else {
-                                            data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft'  @keydown.shift.right='keyupShiftRight' type='text' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
-                                        }
-                                    }
-                                }
-                            }
-
-                            if (!inputText.equals("")) {
-                                exctabCell.setExctabId(excelId);
-                                exctabCell.setTextInfo(inputText);
-                                if (inputText.contains("日期") || inputText.contains("年") || inputText.contains("月") || inputText.contains("日")) {
-                                    //日期
-                                    exctabCell.setTextElementType(4);
-                                } else if (inputText.indexOf("签字") >= 0) {
-                                    exctabCell.setTextElementType(6);
-                                } else {
-                                    //字符串
-                                    exctabCell.setTextElementType(1);
-                                }
-                                exctabCell.setIsDeleted(0);
-                                exctabCell.setXys(i + "_" + j);
-                                colTitle.add(exctabCell);
-                            }
-                            data.attr("title", inputText);
-                        }
-                    }
-                }
-            }
-        }
-
-        // 去掉重复的数
-        Map<String, String> groupMap2 = colTitle.stream()
-                .collect(Collectors.groupingBy(ExctabCell::getTextInfo, Collectors.mapping(ExctabCell::getXys, Collectors.joining(","))));
-        exctabCellService.DeletExcelByTableId(excelId + "");
-
-        List<ExctabCell> colTitle2 = new ArrayList<>();
-        for (String title : groupMap2.keySet()) {
-            ExctabCell exctabCell = new ExctabCell();
-            exctabCell.setExctabId(excelId);
-            exctabCell.setIsDeleted(0);
-            exctabCell.setTextInfo(title);
-            exctabCell.setCreateTime(new Date());
-
-            if (title.contains("日期") || title.contains("年") || title.contains("月") || title.contains("日")) {
-                //日期
-                exctabCell.setTextElementType(4);
-            } else {
-                //字符串
-                exctabCell.setTextElementType(1);
-            }
-            exctabCell.setXys(groupMap2.get(title));
-            colTitle2.add(exctabCell);
-        }
-        exctabCellService.saveBatch(colTitle2);
-
-        //对excel 的图片进行操作
-        ExcelTab exceltab = excelTabService.getById(excelId);
-        if (exceltab != null) {
-            // 获取excle 的数据
-            String fileUrl = exceltab.getFileUrl();
-            InputStream ossInputStream = CommonUtil.getOSSInputStream(fileUrl);
-            Workbook wb = new Workbook();
-            wb.loadFromMHtml(ossInputStream);
-            Worksheet sheet = wb.getWorksheets().get(0);
-            PicturesCollection pictures = sheet.getPictures();
-            if (pictures != null && pictures.size() >= 1) {
-                for (int i = 0; i < pictures.size(); i++) {
-                    ExcelPicture pic = pictures.get(i);
-                    int x = pic.getLeftColumn();
-                    int y = pic.getBottomRow();
-                    Elements select = doc.select("el-input[x1=" + x + "][y1=" + y + "]");
-
-                    if (select != null && select.size() >= 1) {
-                        Element element = select.get(0);
-                        Element elementP = element.parent();
-                        element.remove();
-                        Element imgele = imgs.get(i);
-                        imgele.removeAttr("class");
-                        elementP.append(imgele.toString());
-                    }
-                }
-            }
-            ossInputStream.close();
-        }
-        // 移除图片
-        imgs.remove();
-        // 保存
-        File writefile = new File(thmlUrl);
-        FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
-    }
-
     // 上传解析 html
     public void expailHtmlInfo(String thmlUrl, Long excelId) throws Exception {
 
@@ -1697,6 +1440,8 @@ public class ExcelTabController extends BladeController {
         // 移除图片
         imgs.remove();
         // 保存
+        exceltab.setIsDeleted(8);
+        excelTabService.saveOrUpdate(exceltab);
         File writefile = new File(thmlUrl);
         FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
     }

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

@@ -1553,7 +1553,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         String suffix = excelTab.getFileUrl().substring(index);
 
         if (".xls".equals(suffix)) {
-            workbook = new HSSFWorkbook(exceInp);
+            workbook = new XSSFWorkbook(exceInp);
         } else if (".xlsx".equals(suffix)) {
             workbook = new XSSFWorkbook(exceInp);
         }

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

@@ -444,5 +444,4 @@ public class ExcelInfoUtils {
        return  redata;
     }
 
-
 }

+ 94 - 15
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/test.java

@@ -1,24 +1,103 @@
 package org.springblade.manager.utils;
 
-import cn.hutool.http.useragent.UserAgentUtil;
-import cn.hutool.jwt.JWT;
-import cn.hutool.jwt.JWTUtil;
-import io.jsonwebtoken.Claims;
-import org.springblade.core.secure.utils.AuthUtil;
-import org.springblade.core.tool.utils.Charsets;
-import org.springblade.core.tool.utils.StringPool;
 
-import java.io.*;
-import java.util.Base64;
+import com.spire.xls.Workbook;
+import com.spire.xls.Worksheet;
+import com.spire.xls.core.spreadsheet.HTMLOptions;
+import org.springblade.common.utils.CommonUtil;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
 
 public class test {
-    public static void main11(String[] args) throws IOException {
-     String token ="bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJ1c2VyX25hbWUiOiJwZW5nY3QiLCJyZWFsX25hbWUiOiJQQ1QiLCJhdmF0YXIiOiJodHRwczovL2JsYWRleC1jaG9uZ3FpbmctaW5mby5vc3MtY24taGFuZ3pob3UuYWxpeXVuY3MuY29tLy91cGxvYWQvMjAyMjA2MTYvOGVkMzdhMTU2ZjJiMTc3ZDY5MTgxYzg3Njg5MjczOWYuanBnIiwiYXV0aG9yaXRpZXMiOlsiYWRtaW5pc3RyYXRvciJdLCJjbGllbnRfaWQiOiJjbGllbnQiLCJyb2xlX25hbWUiOiJhZG1pbmlzdHJhdG9yIiwibGljZW5zZSI6InBvd2VyZWQgYnkgYmxhZGV4IiwicG9zdF9pZCI6IjE1MzcyNjAzOTA3NzI1OTI2NDEiLCJ1c2VyX2lkIjoiMTUzNjk4NTA5NDU3MTgyMzEwNSIsInJvbGVfaWQiOiIxMTIzNTk4ODE2NzM4Njc1MjAxIiwicGhvbmUiOiIxODU4MDE0NzU1MCIsInNjb3BlIjpbImFsbCJdLCJuaWNrX25hbWUiOiJQQ1QiLCJvYXV0aF9pZCI6IiIsImRldGFpbCI6eyJ0eXBlIjoid2ViIn0sImV4cCI6MTcwMTMzNTM1OCwiZGVwdF9pZCI6IjE1MzY5ODMwNTYzNjIzODEzMTMiLCJqdGkiOiIzOGE2MDA4Yi01MzQ2LTQ5YjktOGU0OC1hOTNmYjNlNjYyMGYiLCJhY2NvdW50IjoicGVuZ2N0In0._IvCSHGZY8P74XcPWnRw7D46zWORsPCRKkB0HQgxjU0";
 
-        byte[] decoded = Base64.getDecoder().decode(token);
-        String token2 = new String(decoded, Charsets.UTF_8_NAME);
-        int index = token2.indexOf(StringPool.COLON);
-        System.out.println("ccd");
+/*
+    public static void main(String[] args) {
+        String excUrl = "/Users/hongchuangyanfa/Downloads/5e78576be270f74f71be2eb9c82de17f.xls";
+        Workbook wb = new Workbook();
+        String htmlUrl2 = "/Users/hongchuangyanfa/Desktop/pdf/1234.html";
+
+      //  InputStream inputStream = getOSSInputStream(fileUrl);
+
+        wb.loadFromMHtml(excUrl);
+
+        Worksheet sheet = wb.getWorksheets().get(0);
+        HTMLOptions options = new HTMLOptions();
+        options.setImageEmbedded(true);
+        // 校验excel 是否正常
+        sheet.saveToHtml(htmlUrl2, options);
     }
+*/
+
+    public static void main11(String[] args){
+        String id="";
+        try{
+            //首先加载驱动
+            Class.forName("com.mysql.cj.jdbc.Driver");
+
+            //提供JDBC连接的URL
+            String url="jdbc:mysql://47.115.117.246:3306/bladex";
+            String username="root";
+            String password="dianqian666";
+
+            //创建数据库的连接
+            Connection con = DriverManager.getConnection(url,username,password);
+
+            //创建一个statement执行者
+            String sql="select id,file_url,html_url from m_excel_tab where alias LIKE '%1572469868132229121%' and LENGTH(file_url)>=10 and is_deleted=0";
+            PreparedStatement statement = con.prepareStatement(sql);
+            //执行SQL语句
+            ResultSet result = statement.executeQuery();
+            Workbook wb = new Workbook();
 
+            //处理返回结果
+            while (result.next()){
+                String fileUrl = result.getString("file_url");
+                String htmlUrl = result.getString("html_url");
+                id = result.getString("id");
+                htmlUrl = htmlUrl.substring(htmlUrl.lastIndexOf("/")+1,htmlUrl.length());
+              String htmlUrl2 = "/Users/hongchuangyanfa/Desktop/pdf/"+htmlUrl;
+
+                InputStream inputStream = getOSSInputStream(fileUrl,id);
+
+                wb.loadFromMHtml(inputStream);
+
+                Worksheet sheet = wb.getWorksheets().get(0);
+                HTMLOptions options = new HTMLOptions();
+                options.setImageEmbedded(true);
+                // 校验excel 是否正常
+                sheet.saveToHtml(htmlUrl2, options);
+            }
+
+            //关闭JDBC对象
+            con.close();
+            result.close();
+            statement.close();
+            System.out.println("完成");
+        }catch(ClassNotFoundException e){
+            System.out.println("加载驱动失败!");
+        } catch(Exception e){
+            System.out.println(id);
+            e.printStackTrace();
+        }
+    }
+
+    public static InputStream getOSSInputStream(String urlStr,String id) throws Exception {
+        //获取OSS文件流
+        URL url =new URL(urlStr);
+        final URLConnection conn = url.openConnection();
+        conn.setConnectTimeout(500);
+        conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
+        try {
+            return conn.getInputStream();
+        } catch (Exception e){
+            System.out.println(id);
+            return null;
+        }
+    }
 }

+ 1 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -2036,6 +2036,7 @@ public class TaskController extends BladeController {
                 String param = taskParallel.getTaskUser() + "," + task.getProjectId() + "," + task.getContractId();
                 aopParamsSet.add(param);
             }
+
             return R.data(200, aopParamsSet, "操作成功");
         }
 

+ 2 - 2
blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java

@@ -456,7 +456,7 @@ public class UserController {
         //  this.loginByToken2(token);
         token = "bearer " + token;
         HttpClient httpClient = HttpClientBuilder.create().build();
-        HttpGet httpPost = new HttpGet("http://47.110.251.215:8090/blade-auth/oauth/user-info");
+        HttpGet httpPost = new HttpGet("http://39.108.216.210:8090/blade-auth/oauth/user-info");
         httpPost.setHeader("Authorization", token); //这个需要 client:
         List<NameValuePair> params = new ArrayList<NameValuePair>();
 
@@ -507,7 +507,7 @@ public class UserController {
             System.out.println("密码" + md5Pass);
 
             HttpClient httpClient = HttpClientBuilder.create().build();
-            HttpPost httpPost = new HttpPost("http://47.110.251.215:8090/blade-auth/oauth/token");
+            HttpPost httpPost = new HttpPost("http://39.108.216.210:8090/blade-auth/oauth/token");
             httpPost.setHeader("Authorization", "Basic YXJjaGl2ZXM6YXJjaGl2ZXNfc2VjcmV0");
             httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
             httpPost.setHeader("Tenant-Id", "000000");