浏览代码

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

yangyj 1 年之前
父节点
当前提交
d43ba58b17
共有 30 个文件被更改,包括 1109 次插入496 次删除
  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. 3 0
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/entity/ArchiveExpertConclusion.java
  5. 1 1
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/feign/ArchiveExpertConclusionClient.java
  6. 27 0
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/vo/ExpertInfoVO.java
  7. 16 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TaskClient.java
  8. 1 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveExpertConclusionController.java
  9. 1 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveExpertScoreController.java
  10. 14 16
      blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchivesAutoController.java
  11. 2 2
      blade-service/blade-archive/src/main/java/org/springblade/archive/feign/ArchiveExpertConclusionClientImpl.java
  12. 1 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchivesAutoMapper.xml
  13. 1 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/IArchiveExpertConclusionService.java
  14. 243 13
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExpertConclusionServiceImpl.java
  15. 38 3
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExpertScoreServiceImpl.java
  16. 230 0
      blade-service/blade-archive/src/main/java/org/springblade/archive/utils/ItextPdfUtils.java
  17. 128 0
      blade-service/blade-archive/src/main/java/org/springblade/archive/utils/MyPdfPageHelper.java
  18. 16 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java
  19. 11 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TaskClientImpl.java
  20. 11 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITaskService.java
  21. 9 15
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  22. 178 97
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java
  23. 15 5
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  24. 0 1
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PDFUtils.java
  25. 58 313
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  26. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  27. 0 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/ExcelInfoUtils.java
  28. 94 15
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/test.java
  29. 1 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java
  30. 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;

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

@@ -71,4 +71,7 @@ public class ArchiveExpertConclusion extends BaseEntity {
     @ApiModelProperty("任务")
     private Long taskId;
 
+    @ApiModelProperty("此轮抽检专家id,逗号分隔")
+    private String expertIds;
+
 }

+ 1 - 1
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/feign/ArchiveExpertConclusionClient.java

@@ -14,5 +14,5 @@ public interface ArchiveExpertConclusionClient {
     String API_PREFIX = "/api/archive/archiveExpertConclusion";
 
     @GetMapping(API_PREFIX + "/saveBaseTableInfo")
-    R saveBaseTableInfo(@RequestParam Long projectId, @RequestParam String appUrl,@RequestParam Long taskId);
+    R saveBaseTableInfo(@RequestParam Long projectId, @RequestParam String appUrl,@RequestParam Long taskId,@RequestParam String expertIds);
 }

+ 27 - 0
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/vo/ExpertInfoVO.java

@@ -0,0 +1,27 @@
+package org.springblade.archive.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @Param   档案抽检专家信息VO
+ * @Author wangwl
+ * @Date 2024/1/18 14:57
+ **/
+@Data
+public class ExpertInfoVO {
+    @ApiModelProperty("姓名")
+    private String name;
+
+    @ApiModelProperty("职位")
+    private String position;
+
+    @ApiModelProperty("是否为组长,0否1是")
+    private Integer isLeader;
+
+    @ApiModelProperty("身份证号")
+    private String idNumber;
+
+    @ApiModelProperty("手机号")
+    private String phone;
+}

+ 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;
+
 }

+ 1 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveExpertConclusionController.java

@@ -169,6 +169,6 @@ public class ArchiveExpertConclusionController extends BladeController {
     public R submitTable(@RequestBody ArchiveExpertConclusion conclusion) {
         conclusionService.updateById(conclusion);
         conclusionService.submitTable(conclusion);
-        return R.data("提交成功");
+        return R.data("结论生成成功");
     }
 }

+ 1 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveExpertScoreController.java

@@ -53,7 +53,7 @@ public class ArchiveExpertScoreController extends BladeController {
 
     @GetMapping("/test")
     public R test( Long projectId,Long conclusionId) throws Exception {
-        scoreService.buildScorePdf(projectId,conclusionId);
+        scoreService.saveBaseScoreInfo(projectId,conclusionId);
         return R.data("修改成功");
     }
 

+ 14 - 16
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchivesAutoController.java

@@ -913,25 +913,25 @@ public class ArchivesAutoController extends BladeController {
 		return R.data(vo);
 	}
 
-	/**
-	 * 在线excel 档案修改回调
-	 */
-	@PostMapping(value = "/callbackSave")
-	@ApiOperation(value = "onlyOffice保存回调", notes = "onlyOffice保存回调")
-	@ApiOperationSupport(order = 37)
-	@ResponseBody
-	public ExcelEditCallback callbackSave(@RequestBody ExcelEditCallback callback, HttpServletRequest request) {
-		String projectId = request.getParameter("projectId");
-		callback.setProjectId(Long.parseLong(projectId));
-		return archivesAutoService.callbackSave(callback);
-	}
+//	/**
+//	 * 在线excel 档案修改回调
+//	 */
+//	@PostMapping(value = "/callbackSave")
+//	@ApiOperation(value = "onlyOffice保存回调", notes = "onlyOffice保存回调")
+//	@ApiOperationSupport(order = 37)
+//	@ResponseBody
+//	public ExcelEditCallback callbackSave(@RequestBody ExcelEditCallback callback, HttpServletRequest request) {
+//		String projectId = request.getParameter("projectId");
+//		callback.setProjectId(Long.parseLong(projectId));
+//		return archivesAutoService.callbackSave(callback);
+//	}
 
 	/**
 	 * 档案预警-分页查询
 	 */
 	@PostMapping("/warningPage")
-	@ApiOperationSupport(order = 36)
-	@ApiOperation(value = "在线验收-编写报告", notes = "传入项目id,节点和整改状态,返回分页信息")
+	@ApiOperationSupport(order = 40)
+	@ApiOperation(value = "档案预警-分页查询", notes = "传入项目id,节点和整改状态,返回分页信息")
 	@ApiImplicitParams(value = {
 			@ApiImplicitParam(name = "rectification", value = "1待整改2已整改", required = true),
 			@ApiImplicitParam(name = "nodeId", value = "节点id", required = true),
@@ -944,6 +944,4 @@ public class ArchivesAutoController extends BladeController {
 	}
 
 
-
-
 }

+ 2 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/feign/ArchiveExpertConclusionClientImpl.java

@@ -16,7 +16,7 @@ public class ArchiveExpertConclusionClientImpl implements ArchiveExpertConclusio
 
 
     @Override
-    public R saveBaseTableInfo(Long projectId, String appUrl,Long taskId) {
-        return conclusionService.saveBaseTableInfo(projectId,appUrl,taskId);
+    public R saveBaseTableInfo(Long projectId, String appUrl,Long taskId,String expertIds) {
+        return conclusionService.saveBaseTableInfo(projectId,appUrl,taskId,expertIds);
     }
 }

+ 1 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchivesAutoMapper.xml

@@ -1144,7 +1144,7 @@
           and (atc.id = #{nodeId} or FIND_IN_SET(#{nodeId}, atc.ancestors))
     </select>
     <select id="getSpotCheck" resultType="org.springblade.archive.vo.ArchiveWarningVO">
-        select GROUP_CONCAT(aei.opinion) as allopinion,aei.archive_name ,aei.node_id,1 as sourceType
+        select GROUP_CONCAT(aei.opinion) as allopinion,aei.archive_name ,aei.node_id,1 as sourceType,
                (select uaf.file_name from u_archive_file uaf WHERE uaf.id = aei.file_id) as fileName,
                (select uaf.file_url from u_archive_file uaf WHERE uaf.id = aei.file_id) as fileUrl
         from m_archive_tree_contract atc join u_archive_expert_inspection aei on aei.node_id  = atc.id

+ 1 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/service/IArchiveExpertConclusionService.java

@@ -12,7 +12,7 @@ public interface IArchiveExpertConclusionService extends BaseService<ArchiveExpe
 
 
     //验收申请审批通过,创建当前报表基本信息
-    R saveBaseTableInfo(Long projectId,String appUrl,Long taskId);
+    R saveBaseTableInfo(Long projectId,String appUrl,Long taskId,String expertIds);
 
     Boolean getAppStatus(Long projectId);
 

+ 243 - 13
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExpertConclusionServiceImpl.java

@@ -3,6 +3,13 @@ package org.springblade.archive.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.itextpdf.text.Document;
+import com.itextpdf.text.Font;
+import com.itextpdf.text.PageSize;
+import com.itextpdf.text.pdf.BaseFont;
+import com.itextpdf.text.pdf.PdfPCell;
+import com.itextpdf.text.pdf.PdfPTable;
+import com.itextpdf.text.pdf.PdfWriter;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
 import org.springblade.archive.entity.ArchiveExpertConclusion;
@@ -11,17 +18,29 @@ import org.springblade.archive.mapper.ArchiveExpertConclusionMapper;
 import org.springblade.archive.mapper.ArchiveExpertScoreMapper;
 import org.springblade.archive.service.IArchiveExpertConclusionService;
 import org.springblade.archive.service.IArchiveExpertScoreService;
+import org.springblade.archive.utils.ItextPdfUtils;
+import org.springblade.archive.utils.MyPdfPageHelper;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.entity.ProjectInfo;
 import org.springblade.manager.feign.ProjectClient;
+import org.springblade.resource.feign.NewIOSSClient;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.user.feign.IUserClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.io.FileOutputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 @Service
 @AllArgsConstructor
@@ -31,9 +50,18 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
 
     private final ProjectClient projectClient;
 
+    private final IUserClient userClient;
+
+    private final NewIOSSClient newIOSSClient;
+    //表格高度
+    private static int high = 20;
+    //表格宽度
+    private static int widthPercentage = 80;
+
+
     @Override
     @Transactional
-    public R saveBaseTableInfo(Long projectId, String appUrl,Long taskId) {
+    public R saveBaseTableInfo(Long projectId, String appUrl,Long taskId,String expertIds) {
         //判断当前项目下是否存在抽检中的数据
         long count = this.count(new LambdaUpdateWrapper<ArchiveExpertConclusion>()
                 .eq(ArchiveExpertConclusion::getProjectId, projectId)
@@ -191,26 +219,228 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
     @Override
     @Transactional
     public void submitTable(ArchiveExpertConclusion conclusion) {
-        //生成结论pdf
-        //判断是否追加
-        if (conclusion.getIsBuildScore() == 1) {
-            String scoreUrl;
-            //调用生成
-            try {
-                 scoreUrl = scoreService.buildScorePdf(conclusion.getProjectId(), conclusion.getId());
-            }catch (Exception e){
-                throw new ServiceException("创建专家评分表PDF失败");
-            }
-            if (StringUtils.isNotBlank(scoreUrl)){
-                //合并PDF
+        String pdfUrl = "";
+        try {
+            //生成结论pdf
+            pdfUrl = buildPdf(conclusion);
+            if (StringUtils.isBlank(pdfUrl)){
+                throw new ServiceException("");
             }
+        }catch (Exception e){
+            throw new ServiceException("生成PDF失败");
         }
         //PDF电签
+        try {
+//            pdfUrl = ;
+        }catch (Exception e){
+            throw new ServiceException("PDF电签失败");
+        }
         //修改状态,插入结论PDF
+        conclusion.setTableUrl(pdfUrl);
         conclusion.setStatus(2);
         this.updateById(conclusion);
     }
 
+    private String buildPdf(ArchiveExpertConclusion conclusion) throws Exception {
+        //获取评分基础数据
+        List<ArchiveExpertScore> list1 = scoreService.list(new LambdaQueryWrapper<ArchiveExpertScore>()
+                .eq(ArchiveExpertScore::getProjectId, conclusion.getProjectId())
+                .eq(ArchiveExpertScore::getConclusionId, conclusion.getId()));
+        Map<Integer, List<ArchiveExpertScore>> map = list1.stream().collect(Collectors.groupingBy(ArchiveExpertScore::getUnitType));
+        //根据专家信息获取到具体的user
+        String expertIds = conclusion.getExpertIds();
+        if (StringUtils.isBlank(expertIds)){
+            throw new ServiceException("获取专家账号失败");
+        }
+        List<Long> userIds = Func.toLongList(expertIds);
+        List<User> users = userClient.userInfoByIds(userIds);
+        //获取专家组长
+        User us = null;
+        for (User user : users) {
+            if ("1656191696348082177".equals(user.getRoleId())){
+                us = user;
+            }
+        }
+        if (us == null){
+            throw new ServiceException("未获取到专家组长");
+        }
+        //新建一个pdf文档对象,前一个参数是纸张大小,后四个为边距
+        Document document = new Document(PageSize.A4, 10, 10, 80, 85);
+        //文件地址
+        String localFile = "C:\\Users\\泓创研发01\\Desktop\\"+conclusion.getId()+".pdf";
+        //建立一个书写器
+        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(localFile));
+        //页尾
+        MyPdfPageHelper helper = new MyPdfPageHelper();
+        writer.setPageEvent(helper);
+        document.open();
+        //创建字体
+        BaseFont baseFont2 =BaseFont.createFont("C:/WINDOWS/Fonts/simsun.ttc,0", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);
+        //字体对象,这里可以创建一个方法
+        Font sigFont = new Font(baseFont2, 0.1F, Font.NORMAL); //大小为0.1的正常字体
+        Font size13font = new Font(baseFont2, 13, Font.NORMAL); //大小为13的正常字体
+        Font size13bold = new Font(baseFont2, 13, Font.BOLD); //大小为13的粗字体
+        Font size14bold = new Font(baseFont2, 14, Font.BOLD); //大小为14的粗字体
+        Font size17bold = new Font(baseFont2, 17, Font.BOLD);  //大小为17的正常字体
+
+        String firstText = "重庆渝北至长寿高速公路(渝长高速公路扩能)";
+        String secondText = "档案专项验收意见";
+        ItextPdfUtils.tableHeader(document,size17bold,firstText);
+        ItextPdfUtils.tableHeader(document,size17bold,secondText);
+        ItextPdfUtils.blankRow(document,size13font,20);
+        //创建第二行
+        ItextPdfUtils.tableText(document,size13font,conclusion.getForeword());
+        String ss ="一、项目概况";
+        ItextPdfUtils.rowHeader(document,ss,size14bold,83,20);
+        ItextPdfUtils.tableText(document,size13font,conclusion.getGeneralSituation());
+        String ss2 ="二、项目档案管理情况";
+        ItextPdfUtils.rowHeader(document,ss2,size14bold,83,20);
+        ItextPdfUtils.tableText(document,size13font,conclusion.getAdminCondition());
+        String ss3 ="三、存在问题及建议";
+        ItextPdfUtils.rowHeader(document,ss3,size14bold,83,20);
+        ItextPdfUtils.tableText(document,size13font,conclusion.getQuestionSuggest());
+        ItextPdfUtils.blankRow(document,size13font,60);
+        //落款项目
+        ItextPdfUtils.endRight(document,size13font,"重庆渝北至长寿高速公路(渝长高速公路扩能)",widthPercentage);
+        //落款档案验收组
+        ItextPdfUtils.endRight(document,size13font,"档案验收组",60);
+        //落款日期
+        ItextPdfUtils.endRight(document,size13font,new SimpleDateFormat("yyyy年M月dd日").format(new Date()),63);
+        if (conclusion.getIsBuildScore() == 1) {
+            //评分表
+            //该数组是每个表格的宽度
+            float[] floats = new float[5];
+            floats[0] = 0.48f;
+            floats[1] = 0.13f;
+            floats[2] = 0.13f;
+            floats[3] = 0.13f;
+            floats[4] = 0.13f;
+            //末尾表格
+            float[] floats2 = new float[2];
+            floats2[0] = 0.48f;
+            floats2[1] = 0.52f;
+            //为每个单位生成评分表,
+            for (int i = 1; i <= 3; i++) {
+                //如果当前单位没有扣分项,则跳过生成当前单位评分表
+                List<ArchiveExpertScore> list = map.get(i);
+                Boolean isMark = false;
+                for (ArchiveExpertScore score : list) {
+                    if (score.getIntegralityDeduction() != 0 || score.getNormativeDeduction() != 0) {
+                        isMark = true;
+                        break;
+                    }
+                }
+                if (!isMark) {
+                    continue;
+                }
+                //换页生成
+                document.newPage();
+                ItextPdfUtils.startLeft(document, size13font, "附件", 80);
+                ItextPdfUtils.blankRow(document, size13font, 10);
+                String title = "项目档案验收评分表";
+                ItextPdfUtils.tableHeader(document, size17bold, title);
+                //设置单位
+                String unitName = "";
+                if (i == 1) {
+                    unitName = "总承包单位";
+                } else if (i == 2) {
+                    unitName = "监理单位";
+                } else {
+                    unitName = "施工单位";
+                }
+                ItextPdfUtils.rowHeader(document, unitName + ":", size13bold, 85, 30);
+                ItextPdfUtils.tableUnit(document, size13bold, unitName, 30);
+                //表头文字
+                String[] name = new String[]{"项目", "完整性", "扣分", "规范性", "扣分"};
+                //创建第二行,并设置第二行中的表格数
+                PdfPTable twoTable = new PdfPTable(name.length);
+                twoTable.setWidthPercentage(widthPercentage);
+                //设置表格的宽度
+                twoTable.setTotalWidth(floats);
+                //循环将表头数据添加到第二行表格中
+                for (int j = 0; j < name.length; j++) {
+                    PdfPCell pdfPCell = ItextPdfUtils.pdfTableStyle7(name[j], size13font, 30);
+                    twoTable.addCell(pdfPCell);
+                }
+                document.add(twoTable);
+                //将数据放入表格中
+
+                int allScore = 0;
+                int allPoints = 0;
+                for (int j = 0; j < list.size(); j++) {
+                    PdfPTable dataTable = new PdfPTable(5);
+                    dataTable.setWidths(floats);
+                    dataTable.setWidthPercentage(widthPercentage);
+                    ArchiveExpertScore score = list.get(j);
+                    dataTable.addCell(ItextPdfUtils.pdfTableStyle7(score.getScoreItem(), size13font, 25));
+                    dataTable.addCell(ItextPdfUtils.pdfTableStyle7(score.getIntegrality() + "", size13font, 25));
+                    dataTable.addCell(ItextPdfUtils.pdfTableStyle7(score.getIntegralityDeduction() + "", size13font, 25));
+                    dataTable.addCell(ItextPdfUtils.pdfTableStyle7(score.getNormative() + "", size13font, 25));
+                    dataTable.addCell(ItextPdfUtils.pdfTableStyle7(score.getNormativeDeduction() + "", size13font, 25));
+                    document.add(dataTable);
+                    allScore += score.getIntegrality() + score.getNormative();
+                    allPoints += score.getIntegralityDeduction() + score.getNormativeDeduction();
+                }
+                //末尾统计行
+                PdfPTable statRow = new PdfPTable(2);
+                statRow.setWidths(floats2);
+                statRow.setWidthPercentage(widthPercentage);
+                PdfPCell leftCell = ItextPdfUtils.pdfTableStyle7("总得分", size13font, 25);
+                statRow.addCell(leftCell);
+                PdfPCell rightCell = ItextPdfUtils.pdfTableStyle7(allScore - allPoints + "", size13font, 25);
+                statRow.addCell(rightCell);
+                document.add(statRow);
+
+            }
+        }
+        //生成签名表
+        document.newPage();
+        ItextPdfUtils.startLeft(document,size13font,"附件",80);
+        ItextPdfUtils.blankRow(document,size13font,10);
+        ItextPdfUtils.tableHeader(document,size17bold,firstText);
+        ItextPdfUtils.tableHeader(document,size17bold,"工程档案验收组成员签字表");
+        ItextPdfUtils.blankRow(document,size13font,30);
+        ItextPdfUtils.rowHeader2(document,"组  长:",size13font,us.getName()+us.getPhone().substring(0,3),sigFont);
+        ItextPdfUtils.blankRow(document,size13font,10);
+        //该数组是每个表格的宽度
+        float[] floats5 = new float[4];
+        floats5[0] = 0.1f;
+        floats5[1] = 0.4f;
+        floats5[2] = 0.25f;
+        floats5[3] = 0.25f;
+        //表头文字
+        String[] name2 = new String[]{"姓名", "单位", "职务职称", "签名"};
+        //创建第二行,并设置第二行中的表格数
+        PdfPTable twoTable2 = new PdfPTable(name2.length);
+        twoTable2.setWidthPercentage(widthPercentage);
+        twoTable2.setTotalWidth(floats5);
+        //循环将表头数据添加到第二行表格中
+        for (int i = 0; i < name2.length; i++) {
+            PdfPCell pdfPCell = ItextPdfUtils.pdfTableStyle6(name2[i], size13font, 35, true, true);
+            twoTable2.addCell(pdfPCell);
+        }
+        document.add(twoTable2);
+        //将数据放入表格中
+        for (int i = 0; i < users.size(); i++) {
+            User user = users.get(i);
+            PdfPTable dataTable = new PdfPTable(4);
+            dataTable.setWidths(floats5);
+            dataTable.setWidthPercentage(80);
+            dataTable.addCell(ItextPdfUtils.pdfTableStyle6(user.getName(), size13font, 50, true, true));
+            dataTable.addCell(ItextPdfUtils.pdfTableStyle6(user.getCompanyName(), size13font, 50, true, true));
+            dataTable.addCell(ItextPdfUtils.pdfTableStyle6(user.getPosition(), size13font, 50, true, true));
+            dataTable.addCell(ItextPdfUtils.pdfTableStyle6(user.getName()+user.getPhone().substring(0,3), sigFont, 50, true, true));
+            document.add(dataTable);
+        }
+        document.close();
+        writer.close();
+        BladeFile bladeFile = newIOSSClient.uploadFile("file.pdf", localFile);
+        if (bladeFile == null || StringUtils.isBlank(bladeFile.getLink())){
+            throw new ServiceException("文件上传失败");
+        }
+        return bladeFile.getLink();
+    }
+
     @Override
     public Boolean checkSubmit(Long projectId) {
         //判断当前用户职位是否为专家组长,专家组长允许提交

+ 38 - 3
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExpertScoreServiceImpl.java

@@ -46,11 +46,46 @@ public class ArchiveExpertScoreServiceImpl extends BaseServiceImpl<ArchiveExpert
     public void saveBaseScoreInfo(Long projectId,Long conclusionId) {
         List<ArchiveExpertScore> list = new ArrayList<>();
         //业主
-        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"业主评分项1",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"施工准备文件",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"工地试验室资质证书、延期文件、仪器标定证书",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"会议纪要、往来文件",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"桥隧工程风险评估报告",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"质评资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"进度进化控制文件",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"计量支付文件",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"工程变更令",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"总结",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"照片",10,0,10,0));
         //监理
-        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"监理评分项1",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"监理机构、制度",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"会议纪要、往来文件、监理费用、支付报表、监理日志、总结",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"工地试验室资质证书、延期文件、仪器标定证书",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"试验资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"质检资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"质评资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"安全资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"监理指令及回复、旁站记录、巡视记录",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"照片",10,0,10,0));
         //施工
-        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"施工评分项1",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"设计变更及竣工图",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"施工准备文件",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"试验资料(含工地试验室资质证书、仪器标定证书等)",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"质检资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"路基工程质检资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"路面工程质检资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"隧道工程质检资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"绿化工程质检资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"交通与安全工程质检资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"机电工程质检资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"房建工程质检资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"质评资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"进度进化控制文件",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"安全生产、文明施工资料",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"施工日志、大事记",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"计量支付文件",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"会议纪要、往来文件",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"照片",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"总结",10,0,10,0));
         this.saveBatch(list);
     }
 

+ 230 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/ItextPdfUtils.java

@@ -0,0 +1,230 @@
+package org.springblade.archive.utils;
+
+import com.itextpdf.text.*;
+import com.itextpdf.text.pdf.PdfPCell;
+import com.itextpdf.text.pdf.PdfPTable;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * @Param
+ * @Author wangwl
+ * @Date 2024/1/18 10:23
+ **/
+public class ItextPdfUtils {
+    //表格高度
+    private static int high = 20;
+    //表格宽度
+    private static int widthPercentage = 80;
+    //开始靠左,无边框
+    public static void startLeft(Document document, Font font, String text, Integer width) throws DocumentException {
+        PdfPTable twoTable = new PdfPTable(1);
+        twoTable.setWidthPercentage(width);
+        Paragraph phrase = new Paragraph(text,font);
+        PdfPCell pdfPCell = new PdfPCell(phrase);
+        pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); // 设置水平居左
+        pdfPCell.disableBorderSide(15);
+        twoTable.addCell(pdfPCell);
+        document.add(twoTable);
+    }
+
+    //末尾靠右,无边框
+    public static void endRight(Document document,Font font,String text,Integer width) throws DocumentException {
+        PdfPTable twoTable = new PdfPTable(1);
+        twoTable.setWidthPercentage(width);
+        Chunk chunk = new Chunk(text,font);
+        //设置行间距
+        chunk.setLineHeight(20);
+        Paragraph phrase = new Paragraph(0,chunk);
+        PdfPCell pdfPCell = new PdfPCell(phrase);
+        pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); // 设置水平居右
+        pdfPCell.disableBorderSide(15);
+        twoTable.addCell(pdfPCell);
+        document.add(twoTable);
+    }
+    //文本,每页占满,并且分隔换行
+    public static void tableText(Document document,Font size10font,String text) throws DocumentException {
+        PdfPTable twoTable = new PdfPTable(1);
+        twoTable.setWidthPercentage(widthPercentage);
+        //设置每页占满
+        twoTable.setSplitLate(false);
+        String[] split = text.split("\n");
+        for (String s : split) {
+            PdfPCell cell = pdfTableStyle2(s, size10font);
+            twoTable.addCell(cell);
+        }
+        document.add(twoTable);
+    }
+
+
+    //标题使用,居中无边框
+    public static void tableHeader(Document document,Font size17font,String title) throws DocumentException {
+        //创建第一行
+        PdfPTable tableName = new PdfPTable(1);
+        tableName.setWidthPercentage(widthPercentage);  //设置标题长度占纸张比例
+        PdfPCell cell = pdfTableStyle(title, size17font,high);
+        //给表格赋值
+        tableName.addCell(cell);
+        //将表格添加到文档对象中
+        document.add(tableName);
+    }
+
+    //单列小标题,无边框,靠左
+    public static void rowHeader(Document document,String context,Font font,int width,int high) throws DocumentException {
+        //创建小标题
+        PdfPTable tableName = new PdfPTable(1);
+        //为小标题设置宽度来做成首行缩进
+        tableName.setWidthPercentage(width);
+        PdfPCell cell = pdfTableStyle3(context, font,  false, true);
+        cell.setMinimumHeight(high);
+        cell.disableBorderSide(15);
+        //给表格赋值
+        tableName.addCell(cell);
+        //将表格添加到文档对象中
+        document.add(tableName);
+    }
+    //小标题,居中,有边框
+    public static void tableUnit(Document document,Font font,String unitName,int high) throws DocumentException {
+        //单位名称
+        PdfPTable two = new PdfPTable(1);
+        two.setWidthPercentage(widthPercentage);
+        PdfPCell cell2 = pdfTableStyle4(unitName, font,high);
+        two.addCell(cell2);
+        document.add(two);
+    }
+
+    //空白行
+    public static void blankRow(Document document,Font size14font,int high) throws DocumentException {
+        PdfPTable tableName = new PdfPTable(1);
+        tableName.setWidthPercentage(widthPercentage);  //设置标题长度占纸张比例
+        PdfPCell cell3 = pdfTableStyle("", size14font, high);
+        cell3.disableBorderSide(15);
+        //给表格赋值
+        tableName.addCell(cell3);
+        //将表格添加到文档对象中
+        document.add(tableName);
+    }
+
+
+    //带边框线,水平垂直居中的小标题
+    public static PdfPCell pdfTableStyle7(String content, Font font,int high) {
+        Paragraph phrase = new Paragraph(content,font);
+        PdfPCell pdfPCell = new PdfPCell(phrase);
+        pdfPCell.setMinimumHeight(high);
+        pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); // 设置水平居中
+        pdfPCell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); // 设置垂直居中
+        return pdfPCell;
+    }
+    //标题用的字体风格
+    public static PdfPCell pdfTableStyle(String content, Font font,int high) {
+        Paragraph phrase = new Paragraph(content,font);
+        PdfPCell pdfPCell = new PdfPCell(phrase);
+        pdfPCell.setMinimumHeight(high);
+        pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); // 设置当前行水平居中
+        pdfPCell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); // 设置垂直居中
+        pdfPCell.disableBorderSide(15);
+        return pdfPCell;
+    }
+
+    // 设置文本字体
+    public static PdfPCell pdfTableStyle2(String content, Font font) {
+        Chunk chunk = new Chunk("    "+content);
+        chunk.setFont(font);
+        //设置行间距
+        chunk.setLineHeight(20);
+        //每个字符间距
+        Paragraph phrase = new Paragraph(0,chunk);
+        PdfPCell pdfPCell = new PdfPCell(phrase);
+        pdfPCell.disableBorderSide(15);
+        pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); // 设置当前行水平居左
+        pdfPCell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); // 设置垂直居中
+        return pdfPCell;
+    }
+
+    // 设置小标题字体
+    public static PdfPCell pdfTableStyle3(String content, Font font,boolean isAlignCenter, boolean isAlignMidle) {
+        Chunk chunk = new Chunk("     "+content);
+        chunk.setFont(font);
+        //设置行间距
+        chunk.setLineHeight(20);
+        //每个字符间距
+//        chunk.setCharacterSpacing(4);
+        Paragraph phrase = new Paragraph(0,chunk);
+        PdfPCell pdfPCell = new PdfPCell(phrase);
+        if (isAlignCenter) {
+            pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); // 设置水平居中
+        }else {
+            pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); // 设置水平居中
+        }
+        if (isAlignMidle) {
+            pdfPCell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); // 设置垂直居中
+        }else {
+            pdfPCell.setVerticalAlignment(PdfPCell.ALIGN_LEFT); // 设置垂直居中
+        }
+
+        return pdfPCell;
+    }
+
+
+    //单位格式
+    public static PdfPCell pdfTableStyle4(String content, Font font,int high)  {
+        Paragraph phrase = new Paragraph(content, font);
+        PdfPCell pdfPCell = new PdfPCell(phrase);
+        pdfPCell.setMinimumHeight(high);
+        pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); // 设置当前行水平居左
+        pdfPCell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); // 设置垂直居中
+        return pdfPCell;
+    }
+
+    public static PdfPCell pdfTableStyle6(String content, Font font, int high, boolean isAlignCenter, boolean isAlignMidle) {
+        Paragraph phrase = new Paragraph(content, font);
+        PdfPCell pdfPCell = new PdfPCell(phrase);
+        pdfPCell.setMinimumHeight(high);
+        pdfPCell.setUseAscender(true); // 设置可以居中
+        pdfPCell.setBorderWidth(0.5F);
+        if (isAlignCenter) {
+            pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); // 设置水平居中
+        }else {
+            pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); // 设置水平居中
+        }
+        if (isAlignMidle) {
+            pdfPCell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); // 设置垂直居中
+        }else {
+            pdfPCell.setVerticalAlignment(PdfPCell.ALIGN_LEFT); // 设置垂直居中
+        }
+        return pdfPCell;
+    }
+
+    public static void rowHeader2(Document document,String context,Font font,String sigCode,Font sigFont) throws DocumentException {
+        //做左右分隔
+        float[] floats = new float[3];
+        floats[0] = 0.15f;
+        floats[1] = 0.6f;
+        floats[2] = 0.2f;
+        //创建小标题
+        PdfPTable tableName = new PdfPTable(3);
+        tableName.setTotalWidth(floats);
+        tableName.setWidthPercentage(widthPercentage);  //设置标题长度占纸张比例
+        Paragraph phrase1 = new Paragraph(context,font);
+        phrase1.setAlignment(PdfPCell.ALIGN_LEFT);
+        //签名
+        Paragraph phrase2 = new Paragraph(sigCode,sigFont);
+        phrase2.setAlignment(PdfPCell.ALIGN_LEFT);
+        Paragraph phrase3 = new Paragraph(new SimpleDateFormat("yyyy年M月dd日  ").format(new Date()).toString(), font);
+        phrase3.setAlignment(PdfPCell.ALIGN_RIGHT);
+        PdfPCell cell1 = new PdfPCell(phrase1);
+        cell1.disableBorderSide(15);
+        PdfPCell cell2 = new PdfPCell(phrase2);
+        cell2.disableBorderSide(15);
+        PdfPCell cell3 = new PdfPCell(phrase3);
+        cell3.disableBorderSide(15);
+        //给表格赋值
+        tableName.addCell(cell1);
+        tableName.addCell(cell2);
+        tableName.addCell(cell3);
+        //将表格添加到文档对象中
+        document.add(tableName);
+    }
+
+}

+ 128 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/MyPdfPageHelper.java

@@ -0,0 +1,128 @@
+package org.springblade.archive.utils;
+
+import com.itextpdf.text.*;
+import com.itextpdf.text.pdf.*;
+
+import java.io.IOException;
+
+/**
+ * @Param   itext生成页脚
+ * @Author wangwl
+ * @Date 2024/1/17 16:31
+ **/
+public class MyPdfPageHelper extends PdfPageEventHelper {
+    /**
+     * 页眉
+     */
+    public String header = "";
+    /**
+     * 文档字体大小,页脚页眉最好和文本大小一致
+     */
+    public int presentFontSize = 12;
+    /**
+     * 文档页面大小,最好前面传入,否则默认为A4纸张
+     */
+    public Rectangle pageSize = PageSize.A4;
+    // 模板
+    public PdfTemplate total = null;
+    // 基础字体对象
+    public BaseFont bf = null;
+    // 利用基础字体生成的字体对象,一般用于生成中文文字
+    public Font fontDetail = null;
+
+    public MyPdfPageHelper() {
+
+    }
+
+    /**
+     * @param yeMei
+     *            页眉字符串
+     * @param presentFontSize
+     *            数据体字体大小
+     * @param pageSize
+     *            页面文档大小,A4,A5,A6横转翻转等Rectangle对象
+     */
+    public MyPdfPageHelper(String yeMei, int presentFontSize, Rectangle pageSize) {
+        this.header = yeMei;
+        this.presentFontSize = presentFontSize;
+        this.pageSize = pageSize;
+    }
+
+    public void setHeader(String header) {
+        this.header = header;
+    }
+
+    public void setPresentFontSize(int presentFontSize) {
+        this.presentFontSize = presentFontSize;
+    }
+
+    /**
+     * TODO 文档打开时创建模板
+     */
+    @Override
+    public void onOpenDocument(PdfWriter writer, Document document) {
+        total = writer.getDirectContent().createTemplate(50, 50);// 共页的矩形的长宽高
+    }
+
+    /**
+     * TODO 关闭每页的时候,写入页眉,写入'第几页共'这几个字。
+     */
+    @Override
+    public void onEndPage(PdfWriter writer, Document document) {
+        try {
+            if (bf == null) {
+                bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
+            }
+            if (fontDetail == null) {
+                fontDetail = new Font(bf, presentFontSize, Font.NORMAL);// 数据体字体
+            }
+        } catch (DocumentException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        // 拿到当前的PdfContentByte
+        PdfContentByte cb = writer.getDirectContent();
+
+        // 1.写入页眉     参数:要写入文本的页面对象,对齐,文字内容,X轴位置,Y轴位置,逆时针旋转的角度
+        ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, new Phrase(header, fontDetail), document.left(), document.top() + 20, 45);
+
+        // 2.写入页脚    前半部分的 第 X页/共
+        int pageS = writer.getPageNumber();
+        String foot1 = "第 " + pageS + " 页";
+        Phrase footer = new Phrase(foot1, fontDetail);
+
+        // 计算前半部分的foot1的长度,后面好定位最后一部分的'Y页'这俩字的x轴坐标,字体长度也要计算进去 = len
+        float len = bf.getWidthPoint(foot1, presentFontSize);
+
+        /**
+         *  写入页脚   前半部分的    第 X页/共
+         * x轴就是(右margin+左margin + right() -left()- len)/2.0F 再给偏移20F适合人类视觉感受,否则肉眼看上去就太偏左了
+         * y轴就是底边界-20,否则就贴边重叠到数据体里了就不是页脚了;注意Y轴是从下往上累加的,最上方的Top值是大于Bottom好几百开外的。
+         */
+        ColumnText.showTextAligned(cb, Element.ALIGN_CENTER, footer, (document.rightMargin() + document.right() + document.leftMargin() - document.left() - len) / 2.0F + 20F, document.bottom() - 20, 0);
+
+        /**
+         *  写入页脚  后半部分   ?页
+         *  注:因为共?页   中的?值是在doc.close() 后才能得到,所以这一先加入模板,最后结束的时候后边用值替换
+         * x=(右margin+左margin + right() -left())/2.0F
+         * y 轴和之前的保持一致,底边界-20
+         */
+//        cb.addTemplate(total, (document.rightMargin() + document.right() + document.leftMargin() - document.left()) / 2.0F + 20F, document.bottom() - 20); // 调节模版显示的位置
+    }
+
+    /**
+     * TODO 关闭文档时,替换模板,完成整个页眉页脚组件
+     */
+    @Override
+    public void onCloseDocument(PdfWriter writer, Document document) {
+        // 7.最后一步了,就是关闭文档的时候,将模板替换成实际的 Y 值,至此,page x of y 制作完毕,完美兼容各种文档size。
+        total.beginText();
+        total.setFontAndSize(bf, presentFontSize);// 生成的模版的字体、颜色
+        String foot2 = " " + writer.getPageNumber() + " 页";
+        total.showText(foot2);// 模版显示的内容
+        total.endText();
+        total.closePath();
+    }
+}

+ 16 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java

@@ -655,6 +655,8 @@ public class TaskController extends BladeController {
                                 //都是完成状态,则修改主任务的状态
                                 task.setStatus(2);
                                 taskService.updateById(task);
+                                //专家账号id集合
+                                StringBuilder expertIds = new StringBuilder();
                                 //保存专家账号
                                 String formDataId = task.getFormDataId();
                                 List<SaveApplyDTO.ExpertInfo> expertInfoList = JSON.parseArray(formDataId, SaveApplyDTO.ExpertInfo.class);
@@ -667,6 +669,11 @@ public class TaskController extends BladeController {
                                     //如果当前账户已经存在,则代表账号已经注册,直接跳过当前
                                     R<User> r = userClient.userByAccount(AuthUtil.getTenantId(), dto.getAccount());
                                     if (r.getData() != null) {
+                                        if (expertIds.length() == 0){
+                                            expertIds.append(r.getData().getId());
+                                        }else {
+                                            expertIds.append(","+r.getData().getId());
+                                        }
                                         continue;
                                     }
                                     StringSPUtils stringSPUtils = new StringSPUtils();
@@ -690,11 +697,19 @@ public class TaskController extends BladeController {
                                     }
                                     list.add(projectDTO);
                                     dto.setProjectAndUserList(list);
+                                    //设置id
+                                    Long id = SnowFlakeUtil.getId();
+                                    dto.setId(id);
                                     //单个保存专家信息
                                     R<Boolean> booleanR = userClient.saveUserDTO(dto);
                                     if (booleanR.getData() == null || !booleanR.isSuccess()) {
                                         throw new ServiceException(booleanR.getMsg());
                                     }
+                                    if (expertIds.length() == 0){
+                                        expertIds.append(id);
+                                    }else {
+                                        expertIds.append(","+id);
+                                    }
                                 }
                                 //修改档案类型
                                 String archiveIds = task.getArchiveIds();
@@ -706,7 +721,7 @@ public class TaskController extends BladeController {
                                     }
                                 }
                                 //创建报表基本信息,报表中会自动创建评分基础信息
-                                R r = conclusionClient.saveBaseTableInfo(Long.parseLong(task.getProjectId()), task.getAttachmentPdfUrl(),task.getId());
+                                R r = conclusionClient.saveBaseTableInfo(Long.parseLong(task.getProjectId()), task.getAttachmentPdfUrl(),task.getId(),expertIds.toString());
                                 if (r == null ){
                                     throw new ServiceException("调用档案服务失败");
                                 }

+ 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;
@@ -316,13 +317,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);
@@ -342,6 +346,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 下拉框选择
      */
@@ -909,318 +964,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 {
 
@@ -1699,6 +1442,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

@@ -1822,7 +1822,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");