Browse Source

电签检查

zhuwei 1 month ago
parent
commit
a849f8f022
23 changed files with 845 additions and 332 deletions
  1. 7 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/InformationQuery.java
  2. 8 3
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java
  3. 4 1
      blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/vo/SealStrategyVO.java
  4. 5 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ProjectInfo.java
  5. 9 7
      blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveFileController.java
  6. 38 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  7. 20 2
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java
  8. 7 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.java
  9. 22 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml
  10. 8 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java
  11. 3 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITaskService.java
  12. 60 50
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ArchiveFileServiceImpl.java
  13. 35 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  14. 256 219
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  15. 6 5
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/ChekSignData.java
  16. 3 3
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVController.java
  17. 54 7
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVDataServiceImpl.java
  18. 211 21
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/ScrDataServiceImpl.java
  19. 75 11
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PdfAddimgUtil.java
  20. 1 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ProjectInfoMapper.xml
  21. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaDaoImpl.java
  22. 7 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml
  23. 5 1
      blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

+ 7 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/InformationQuery.java

@@ -143,4 +143,11 @@ public class InformationQuery extends BaseEntity {
 
     @ApiModelProperty("重刷次数:如果次数大于5次 每次都是3,就停止重刷")
     private Integer saveAgainCount;
+
+    @ApiModelProperty("0-未检出,1-已提交,2-检查无误,3-检查有误")
+    private Integer chekStatus;
+
+    @ApiModelProperty("检查描述")
+    private String checkDesc;
+
 }

+ 8 - 3
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java

@@ -92,11 +92,11 @@ public class InformationQueryVO extends InformationQuery {
     @ApiModelProperty("重刷次数:如果次数大于5次 每次都是3,就停止重刷")
     private Integer saveAgainCount;
 
-    public void setWaitingUserList(String waitingUserName, Integer status) {
+    public void setWaitingUserList(String waitingUserName, Integer status, String userId) {
         if (this.waitingUserList == null) {
             this.waitingUserList = new ArrayList<>();
         }
-        this.waitingUserList.add(new WaitingUser(waitingUserName, status));
+        this.waitingUserList.add(new WaitingUser(waitingUserName, status, userId));
     }
 
     @Data
@@ -107,9 +107,14 @@ public class InformationQueryVO extends InformationQuery {
         @ApiModelProperty("审批状态,1未签字(黑色),2已签字(绿色),3已废除(黄色),999签字异常(红色)")
         private Integer status;
 
-        public WaitingUser(String waitingUserName, Integer status) {
+        @ApiModelProperty("用户ID")
+        private String userId;
+
+
+        public WaitingUser(String waitingUserName, Integer status, String userId) {
             this.waitingUserName = waitingUserName;
             this.status = status;
+            this.userId=userId;
         }
     }
 

+ 4 - 1
blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/vo/SealStrategyVO.java

@@ -74,9 +74,12 @@ public class SealStrategyVO {
     private String sealLocation;
 
     /**
-     * 签章原因,可以为空
+     * 用户名称
      */
     private String sealReason;
+
+    // 用户Id
+    private String userId;
     //坐标签章结束 ======================================
 
     /**

+ 5 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ProjectInfo.java

@@ -211,4 +211,9 @@ public class ProjectInfo extends BaseEntity {
     private String jlSuffix;
 
 
+    /**
+     *
+     */
+    @ApiModelProperty(value = "短信时间")
+    private int msTime;
 }

+ 9 - 7
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveFileController.java

@@ -68,6 +68,7 @@ public class ArchiveFileController extends BladeController {
     private final MetadataClassificationClient metadataClassificationClient;
     private final IArchivesAutoService autoService;
     private final CommonFileClient commonFileClient;
+
     /**
      * 上传文件
      *
@@ -102,11 +103,11 @@ public class ArchiveFileController extends BladeController {
                 int i = 1;
                 for (ArchiveFileVO saveVo : saveList) {
                     try {
-                        if(StringUtils.isNotEmpty(saveVo.getPdfFileUrl())&&saveVo.getPageNum()==null){
+                        if (StringUtils.isNotEmpty(saveVo.getPdfFileUrl()) && saveVo.getPageNum() == null) {
                             String num = commonFileClient.getPdfNum(saveVo.getPdfFileUrl());
                             saveVo.setFilePage(Integer.valueOf(num));
                         }
-                    }catch (Exception e){
+                    } catch (Exception e) {
                         saveVo.setFilePage(0);
                     }
                     saveVo.setId(SnowFlakeUtil.getId());
@@ -159,8 +160,8 @@ public class ArchiveFileController extends BladeController {
         if (queryVo.getNodeIds().isEmpty() || queryVo.getNodeIds().equals("")) {
 
         } else {
-            ArchiveTreeContract rootNode=  this.archiveTreeContractClient.getArchiveTreeContractById(Long.parseLong(queryVo.getNodeIds()));
-            if (rootNode != null && rootNode.getExtType()!= null ) {
+            ArchiveTreeContract rootNode = this.archiveTreeContractClient.getArchiveTreeContractById(Long.parseLong(queryVo.getNodeIds()));
+            if (rootNode != null && rootNode.getExtType() != null) {
                 queryVo.setExtType(1);
             }
 
@@ -188,6 +189,7 @@ public class ArchiveFileController extends BladeController {
             this.archiveFileClient.updateArchiveFileSort(vo);
             try {
                 for (ArchiveFileVO saveVo : vo.getList()) {
+                    //获取源信息
                     metadataClassificationClient.createMetadataFile(saveVo.getId(), 0);
                 }
             } catch (Exception e) {
@@ -425,7 +427,7 @@ public class ArchiveFileController extends BladeController {
     @ApiOperation(value = "文件收集-上传文件责任者")
     public R getMetadataFile(String fileId) {
         long id;
-        try  {
+        try {
             fileId = fileId.split("_")[0];
             id = Long.parseLong(fileId);
         } catch (Exception e) {
@@ -462,12 +464,12 @@ public class ArchiveFileController extends BladeController {
             //数据入库
             autoService.sendFileToEArchives(v);
         }
-        return  R.success("操作成功");
+        return R.success("操作成功");
     }
 
 
 
-    @PostMapping("/findAndReplace")
+   @PostMapping("/findAndReplace")
     @ApiOperationSupport(order = 12)
     @ApiOperation(value = "查找并替换", notes = "传入ids")
     public R findAndReplace(@RequestBody FindAndReplaceDto dto){

+ 38 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -5279,4 +5279,42 @@ public R<Object> customAddContractNode(@RequestBody CustomAddContractNodeDTO dto
         }
         throw new IllegalArgumentException("新数据中未找到根节点");
     }
+
+    // pdf 检查任务添加
+    /**
+     * 首件wbs 树
+     *
+     * @return 结果
+     */
+    @GetMapping("/updateCheckPdfInfo")
+    @ApiOperationSupport(order = 40)
+    @ApiOperation(value = "添加pdf检查接口")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "type", value = "1:节点添加 2:文件添加",required = true),
+            @ApiImplicitParam(name = "classify", value = "1施工2监理",required = true),
+            @ApiImplicitParam(name = "ids", value = "多个用,拼接", required = true)
+    })
+    public  R updateCheckPdfInfo(@RequestParam String type, @RequestParam String ids,@RequestParam String classify) {
+
+        return informationQueryService.updateCheckPdfInfo(type, ids,classify);
+    }
+
+    /**
+     * 首件wbs 树
+     *
+     * @return 结果
+     */
+    @GetMapping("/getCheckPdfPaceInfo")
+    @ApiOperationSupport(order = 40)
+    @ApiOperation(value = "添加pdf检查接口")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "type", value = "1:节点添加 2:文件添加",required = true),
+            @ApiImplicitParam(name = "classify", value = "1施工2监理",required = true),
+            @ApiImplicitParam(name = "ids", value = "多个用,拼接", required = true)
+    })
+    public  R<ChekPdfPaceVo> getCheckPdfPaceInfo(@RequestParam String contractId,@RequestParam String classify) {
+
+        ChekPdfPaceVo checkPdfPaceInfo = informationQueryService.getCheckPdfPaceInfo(contractId, classify);
+        return R.data(checkPdfPaceInfo);
+    }
 }

+ 20 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java

@@ -52,6 +52,7 @@ import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.ContractRelationJlyz;
 import org.springblade.manager.entity.ProjectInfo;
+import org.springblade.manager.feign.ProjectClient;
 import org.springblade.resource.feign.CommonFileClient;
 import org.springblade.resource.feign.NewISmsClient;
 import org.springblade.system.cache.ParamCache;
@@ -103,6 +104,7 @@ public class TaskController extends BladeController {
     private final ArchiveExpertConclusionClient conclusionClient;
     private final MessageWarningServiceImpl messageWarningServiceImpl;
     private final OperationLogClient operationLogClient;
+    private final ProjectClient projectClient;
 
     /**
      * 记录短信验证码超时时间
@@ -110,18 +112,23 @@ public class TaskController extends BladeController {
     @GetMapping("/save-sms-timeout")
     @ApiOperationSupport(order = 13)
     @ApiOperation(value = "记录短信验证码超时时间")
-    public void saveSmsTimeout(@RequestParam String code) {
+    public void saveSmsTimeout(@RequestParam String code,String projectId) {
         //获取账户记录
      ///   String aesKey = "O2BEeIv399qHQNhD6aGW8R8DEj4bqHXm";
      //   String accode = AesUtil.decryptFormBase64ToString(code, aesKey);
         DefaultConfig config = this.defaultConfigService.getOne(Wrappers.<DefaultConfig>lambdaQuery()
                 .eq(DefaultConfig::getCreateUser, AuthUtil.getUserId())
                 .isNotNull(DefaultConfig::getSmsCode));
+        int addTime = 1;
         if (config != null) {
+            if(projectId!=null && !projectId.equals("") && Func.isNotEmpty(projectId)){
+                ProjectInfo projectInfo = projectClient.getById(projectId);
+                addTime = projectInfo.getMsTime();
+            }
             //获取当前时间
             Date now = DateUtil.now();
             // 16 改为 1小时后超时
-            now = DateUtil.plusHours(now, 1);
+            now = DateUtil.plusHours(now, addTime);
 
             LambdaUpdateWrapper<DefaultConfig> wrapper = new LambdaUpdateWrapper<>();
             wrapper.set(DefaultConfig::getSmsTimeOut, DateUtil.format(now, "yyyy-MM-dd HH:mm:ss"));
@@ -2222,4 +2229,15 @@ public class TaskController extends BladeController {
         return R.data(true);
     }
 
+    /**
+     * 资料填报-任务管理- 电签签字
+     */
+    @PostMapping("/reSigningEVisaByUserIds")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "任务管理-一键重签", notes = "传入taskIds、下拉框的contractId、projectId")
+    public R<Object> reSigningEVisaByUserIds(@RequestParam String ids, @RequestParam String userIds) {
+
+       return taskService.reSigningEVisaByUserIds(ids,userIds);
+    }
+
 }

+ 7 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.java

@@ -17,6 +17,7 @@
 package org.springblade.business.mapper;
 
 import org.springblade.business.entity.InformationQuery;
+import org.springblade.business.vo.ChekPdfPaceVo;
 import org.springblade.business.vo.InformationQueryVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -145,4 +146,10 @@ public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
     List<TabBusstimeInfo> getTabussTimeInfo(@Param("tables") List<String> tables);
 
     List<Long> getInfoByNodeIds(@Param("ids") List<Long> ids);
+
+    int addCheckPdfInfoByNodeId(@Param("ids") String ids,@Param("classify") String classify);
+
+    int addCheckPdfInfoByIds(@Param("ids") List<String> ids,@Param("classify") String classify);
+
+    ChekPdfPaceVo getCheckPdfPaceInfo(@Param("contractId") String contractI, @Param("classify") String classify);
 }

+ 22 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -1008,4 +1008,26 @@
             #{id}
         </foreach>
     </select>
+
+    <update id="addCheckPdfInfoByNodeId" >
+        update u_information_query a set a.chek_status=1
+        where a.is_deleted = 0 and a.classify=#{classify} and a.wbs_id
+        in( select b.p_key_id from m_wbs_tree_contract b where b.is_deleted = 0 and b.ancestors_p_id like CONCAT(CONCAT('%', #{ids}), '%') and b.is_deleted = 0) and a.status in(1,2)
+    </update>
+
+    <update id="addCheckPdfInfoByIds">
+        update u_information_query set chek_status=1
+        where is_deleted = 0 and classify=#{classify} and id in
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+
+    <select id="getCheckPdfPaceInfo" resultType="org.springblade.business.vo.ChekPdfPaceVo">
+        SELECT c.TotalCount,c.finishCount, IF(FLOOR(finishCount/TotalCount),null,0) as pace from (
+           SELECT COUNT(1) as TotalCount,IF(SUM(IF(status = 'chek_status', 1, 0)),null,0) AS finishCount from u_information_query where contract_id=#{contractId} and classify=#{classify} and chek_status in(1,2,3)
+        ) c
+    </select>
+
 </mapper>

+ 8 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java

@@ -18,11 +18,13 @@ package org.springblade.business.service;
 
 import com.alibaba.fastjson.JSONObject;
 import org.springblade.business.entity.InformationQuery;
+import org.springblade.business.vo.ChekPdfPaceVo;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.business.vo.InformationQueryVO;
 import org.springblade.business.vo.QueryProcessDataVO;
 import org.springblade.core.mp.base.BaseService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.tool.api.R;
 import org.springblade.manager.entity.TabBusstimeInfo;
 import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
@@ -162,4 +164,10 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
     List<Long> getInfoByNodeIds(List<Long> ids);
 
     void createNewInformationQueriesByStatusForLock(Collection<String> ids);
+
+    // 测试节点信息
+    R updateCheckPdfInfo(String type, String ids, String classify);
+
+    ChekPdfPaceVo getCheckPdfPaceInfo(String contractId, String classify);
+
 }

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

@@ -136,4 +136,7 @@ public interface ITaskService extends BaseService<Task> {
     R reSigningEVisaStatus0(List<reSigningEVisaStatus> dtos, String header) throws Exception;
 
     void logSaveAgain(LogSaveAgainDto dto) throws Exception;
+
+    //
+    R reSigningEVisaByUserIds(String ids, String userIds);
 }

+ 60 - 50
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ArchiveFileServiceImpl.java

@@ -75,7 +75,7 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
         pageVoList.forEach(vos -> {
             vos.setIsApprovalValue(new Integer("0").equals(vos.getStatus()) ? "未上报" : new Integer("1").equals(vos.getStatus()) ? "待审批" : new Integer("2").equals(vos.getStatus()) ? "已审批" : "已废除");
             vos.setIsCertificationValue(new Integer("1").equals(vos.getIsCertification()) ? "已认证" : "未认证");
-            vos.setIsArchive(vos.getIsArchive()==null?0: vos.getIsArchive());
+            vos.setIsArchive(vos.getIsArchive() == null ? 0 : vos.getIsArchive());
             if (StringUtils.isNotEmpty(vos.getSheetSource())) {
                 sheetSourceList.forEach(source -> {
                     if (source.getDictKey().equals(vos.getSheetSource())) {
@@ -83,9 +83,9 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
                     }
                 });
             }
-            fileIds.append(vos.getId()+",");
+            fileIds.append(vos.getId() + ",");
         });
-        if(vo.getRectification() != null &&(vo.getRectification() == 1 || vo.getRectification() == 2)) {
+        if (vo.getRectification() != null && (vo.getRectification() == 1 || vo.getRectification() == 2)) {
             Map<String, Map<String, Object>> allopinion = archiveInspectionInfoClient.getAllopinion(fileIds.toString());
             if (allopinion != null) {
                 pageVoList.forEach(vos -> {
@@ -135,41 +135,51 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
         for (int i = 0; i < list.size(); i++) {
             listInt.add(list.get(i).getSort());
         }
-        //按照从大到小进行排序
-//		Collections.sort(listInt, new Comparator<Integer>() {
-//			@Override
-//			public int compare(Integer integer, Integer t1) {
-//				return integer-t1;
-//			}
-//		});
+
         StringBuffer ids = new StringBuffer();
+        StringBuffer ids2 = new StringBuffer();
+        Map<Long, Integer> mapkey = new HashMap<>();
         Collections.sort(listInt);
         for (int i = 0; i < list.size(); i++) {
+            ids2.append(list.get(i).getId() + ",");
             list.get(i).setSort(listInt.get(i));
-            if(list.get(i).getIsUpdateUrl() != null && list.get(i).getIsUpdateUrl() == 1) {
+            if (list.get(i).getIsUpdateUrl() != null && list.get(i).getIsUpdateUrl() == 1) {
                 ids.append(list.get(i).getId() + ",");
-                if(list.get(i).getRectification() != null && list.get(i).getRectification() == 1){
+                if (list.get(i).getRectification() != null && list.get(i).getRectification() == 1) {
                     list.get(i).setRectification(2);
                 }
             }
         }
-        if(ids != null && ids.length()>0){
-        List<String> removeFiles = new ArrayList<>();
-        List<ArchiveFile> archiveFileByFileIds = baseMapper.getArchiveFileByFileIds(Func.toLongList(ids.toString()));
-        if(archiveFileByFileIds!=null && archiveFileByFileIds.size()>0){
-            for(ArchiveFile archiveFile:archiveFileByFileIds){
-                if(StringUtils.isNotEmpty(archiveFile.getFileUrl().trim())){
-                    removeFiles.add(archiveFile.getFileUrl());
+        // 删除oss文件
+        if (ids != null && ids.length() > 0) {
+            List<String> removeFiles = new ArrayList<>();
+            List<ArchiveFile> archiveFileByFileIds = baseMapper.getArchiveFileByFileIds(Func.toLongList(ids.toString()));
+            if (archiveFileByFileIds != null && archiveFileByFileIds.size() > 0) {
+                for (ArchiveFile archiveFile : archiveFileByFileIds) {
+                    if (StringUtils.isNotEmpty(archiveFile.getFileUrl().trim())) {
+                        removeFiles.add(archiveFile.getFileUrl());
+                    }
+                    mapkey.put(archiveFile.getId(), archiveFile.getIsApproval());
                 }
+                executorService.execute(() -> {
+                    iossClient.removeFiles(removeFiles);
+                });
             }
-            executorService.execute(()->{
-                iossClient.removeFiles(removeFiles);
-            });
         }
+
+        //获取所有文件
+        if (ids2 != null && ids2.length() > 0) {
+            List<ArchiveFile> archiveFileByFileIds = baseMapper.getArchiveFileByFileIds(Func.toLongList(ids2.toString()));
+            if (archiveFileByFileIds != null && archiveFileByFileIds.size() > 0) {
+                for (ArchiveFile archiveFile : archiveFileByFileIds) {
+                    mapkey.put(archiveFile.getId(), archiveFile.getIsApproval());
+                }
+            }
         }
+
         for (ArchiveFile vo : list) {
             // 修改所有的认证状态,如果是不需要认证就设置为已认证,如果是需要认证就设置为未认证
-            if (Func.isNotEmpty(vo.getIsNeedCertification())){
+            if (Func.isNotEmpty(vo.getIsNeedCertification())) {
                 if (vo.getIsNeedCertification() == 0) {
                     vo.setIsCertification(1);
                 } else if (vo.getIsNeedCertification() == 1) {
@@ -177,10 +187,10 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
                 }
             }
             //循环查看是否把需要审批改为不需要审批,  不可能把不需要审批改为需要审批 ,0不需要,1需要
-            if (vo.getStatus() != null && vo.getStatus() == 0 && vo.getIsApproval() != null &&  vo.getIsApproval() == 0) {
+            if (vo.getStatus() != null && vo.getStatus() == 0 && vo.getIsApproval() != null && vo.getIsApproval() == 0) {
                 vo.setStatus(2);
             }
-            if(vo.getIsApproval() != null && vo.getIsApproval() == 1){
+            if (vo.getIsApproval() != null && vo.getIsApproval() == 1 && vo.getIsApproval() != mapkey.get(vo.getId())) {
                 Set<String> aopParamsSet = new HashSet<>();
                 //判断现在的数据是否是待审批数据,只有上报状态、未认证状态的数据才能撤销
                 ArchiveFile archiveFile = jdbcTemplate.queryForObject("select * from u_archive_file where id = " + vo.getId(), new BeanPropertyRowMapper<>(ArchiveFile.class));
@@ -303,43 +313,43 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
 
     @Override
     public void addArchiveFileEx(List<ArchiveFile> files) {
-        executorService.execute(()->{
+        executorService.execute(() -> {
             this.saveBatch(files);
         });
     }
 
     @Override
     public void updateArchiveFileEx(List<ArchiveFile> files) {
-        executorService.execute(()->{
+        executorService.execute(() -> {
             this.updateBatchById(files);
         });
     }
 
     @Override
     public boolean sortByFileTime(Long nodeId) {
-     String sql="SELECT id,file_time,node_id FROM u_archive_file WHERE node_id IN (SELECT id FROM m_archive_tree_contract WHERE  FIND_IN_SET("+nodeId+",ancestors)) AND is_deleted=0";
-     List<ArchiveFile> list=jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(ArchiveFile.class));
-     if(list.size()>0){
-         Map<String, List<ArchiveFile>> group = list.stream()
-             .collect(Collectors.groupingBy(ArchiveFile::getNodeId));
-         for (Map.Entry<String, List<ArchiveFile>> entry : group.entrySet()) {
-             List<ArchiveFile> archiveFiles = entry.getValue();
-             archiveFiles.sort((a, b) -> {
-                 if (a.getFileTime() == null && b.getFileTime() == null) return 0;
-                 if (a.getFileTime() == null) return -1;
-                 if (b.getFileTime() == null) return 1;
-                 return a.getFileTime().compareTo(b.getFileTime());
-             });
-             int sort = 0;
-             for (ArchiveFile file : archiveFiles) {
-                 file.setSort(sort++);
-             }
-             this.updateBatchById(archiveFiles);
-         }
-         return true;
-     }else {
-         return false;
-     }
+        String sql = "SELECT id,file_time,node_id FROM u_archive_file WHERE node_id IN (SELECT id FROM m_archive_tree_contract WHERE  FIND_IN_SET(" + nodeId + ",ancestors)) AND is_deleted=0";
+        List<ArchiveFile> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ArchiveFile.class));
+        if (list.size() > 0) {
+            Map<String, List<ArchiveFile>> group = list.stream()
+                    .collect(Collectors.groupingBy(ArchiveFile::getNodeId));
+            for (Map.Entry<String, List<ArchiveFile>> entry : group.entrySet()) {
+                List<ArchiveFile> archiveFiles = entry.getValue();
+                archiveFiles.sort((a, b) -> {
+                    if (a.getFileTime() == null && b.getFileTime() == null) return 0;
+                    if (a.getFileTime() == null) return -1;
+                    if (b.getFileTime() == null) return 1;
+                    return a.getFileTime().compareTo(b.getFileTime());
+                });
+                int sort = 0;
+                for (ArchiveFile file : archiveFiles) {
+                    file.setSort(sort++);
+                }
+                this.updateBatchById(archiveFiles);
+            }
+            return true;
+        } else {
+            return false;
+        }
     }
 
 }

+ 35 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -15,6 +15,7 @@ import org.springblade.business.feign.TaskClient;
 import org.springblade.business.mapper.InformationQueryMapper;
 import org.springblade.business.service.*;
 import org.springblade.business.utils.FileUtils;
+import org.springblade.business.vo.ChekPdfPaceVo;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.business.vo.InformationQueryVO;
 import org.springblade.business.vo.QueryProcessDataVO;
@@ -872,7 +873,7 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
                     eVisaFailedInfo = taskPa.getEVisaContent();
                 }
             }
-            vo.setWaitingUserList(taskPa.getTaskUserName(), taskPa.getEVisaStatus());
+            vo.setWaitingUserList(taskPa.getTaskUserName(), taskPa.getEVisaStatus(), taskPa.getTaskUser());
             vo.setEVisaFailedInfo(eVisaFailedInfo);
         }
     }
@@ -1110,4 +1111,37 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
             }
         }
     }
+
+    @Override
+    public R updateCheckPdfInfo(String type, String ids,String classify) {
+        if(type==null || Func.isNull(type)){
+            return R.fail("type不能weinull");
+        }
+        if(ids==null || Func.isNull(ids)){
+            return R.fail("ids不能weinull");
+        }
+        if(classify==null || Func.isNull(classify)){
+            return R.fail("classify不能weinull");
+        }
+        List<String> strList = Func.toStrList((ids));
+        if(type.equals("1")){
+
+            this.baseMapper.addCheckPdfInfoByNodeId(ids,classify);
+        } else if (type.equals("2")) {
+            this.baseMapper.addCheckPdfInfoByIds(strList,classify);
+        }else{
+            return R.fail("type有误,无法处理该业务");
+        }
+        return R.success("操作成功");
+    }
+    @Override
+    public ChekPdfPaceVo getCheckPdfPaceInfo(String contractId, String classify) {
+       /* ChekPdfPaceVo da = new ChekPdfPaceVo();
+        da.setPace(20);
+        da.setTotalCount(100);
+        da.setFinishCount(20);*/
+
+        ChekPdfPaceVo checkPdfPaceInfo = baseMapper.getCheckPdfPaceInfo(contractId, classify);
+        return checkPdfPaceInfo;
+    }
 }

+ 256 - 219
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -134,9 +134,9 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     private final TrialSelfInspectionRecordMapper trialSelfInspectionRecordMapper;
     private final WbsTreeContractStatisticsClientImpl wbsTreeContractStatisticsClient;
     //超级管理员的角色id
-    private final String SUPER_ADMIN_ROLE_ID ="1123598816738675201";
+    private final String SUPER_ADMIN_ROLE_ID = "1123598816738675201";
     //泓创智诚公司的部门id
-    private final Long  HONGCHENG_DEPT_ID = 1536982621165592577L;
+    private final Long HONGCHENG_DEPT_ID = 1536982621165592577L;
 
     @Autowired
     StringRedisTemplate RedisTemplate;
@@ -247,7 +247,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     //封面
                     String url = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
                     String s = getHppsToHttp(url);
-                    vo.setApprovalFileList(query.getName(), s, query.getWbsId()+"", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
+                    vo.setApprovalFileList(query.getName(), s, query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
                 }
                 //不是签章时再查关联资料,因为关联资料都是审批好的pdf,存在关键字,不能再执行签 字/章
                 if (!isTask) {
@@ -257,7 +257,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     }
                     InformationQueryFile queryFile = this.informationQueryFileService.getOne(Wrappers.<InformationQueryFile>lambdaQuery().eq(InformationQueryFile::getQueryId, query.getId()));
                     if (queryFile != null) {
-                        vo.setApprovalFileList(queryFile.getName(), getHppsToHttp(queryFile.getPdfUrl()),query.getWbsId()+"", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
+                        vo.setApprovalFileList(queryFile.getName(), getHppsToHttp(queryFile.getPdfUrl()), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
                     }
                 }
 
@@ -280,13 +280,13 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     //资料填报原始pdf
 //                    String approvalPdf = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
                     /** 修改需求,任务查看时,附件不在列表中显示,需要拼接在电签后面。如果此处修改影响其他地方,则到时候再说*/
-                    if(isTask){
+                    if (isTask) {
                         String approvalPdf = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
-                        vo.setApprovalFileList(query.getName(), this.getHppsToHttp(approvalPdf), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
-                    }else{
+                        vo.setApprovalFileList(query.getName(), this.getHppsToHttp(approvalPdf), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
+                    } else {
                         String approvalPdf = StringUtils.isNotEmpty(query.getNodePdfUrl()) ? query.getNodePdfUrl() : query.getEVisaPdfUrl();
                         String approvalPdf2 = StringUtils.isNotEmpty(approvalPdf) ? approvalPdf : query.getPdfUrl();
-                        vo.setApprovalFileList(query.getName(), this.getHppsToHttp(approvalPdf2), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
+                        vo.setApprovalFileList(query.getName(), this.getHppsToHttp(approvalPdf2), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
                     }
 
                     //试验关联文件合并pdf
@@ -296,7 +296,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                             query.setPdfTrialUrl(replaceHTTPURL);
                         }
                         String trialPdf = StringUtils.isNotEmpty(query.getPdfTrialUrl()) ? query.getPdfTrialUrl() : null;
-                        vo.setApprovalFileList(query.getName() + "(关联试验文件)", getHppsToHttp(trialPdf), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
+                        vo.setApprovalFileList(query.getName() + "(关联试验文件)", getHppsToHttp(trialPdf), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
                     }
 
                     //试验关联的工程部位信息合并pdf
@@ -307,7 +307,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                         }
 
                         String trailpdf = StringUtils.isNotEmpty(query.getPdfTrialUrlPosition()) ? query.getPdfTrialUrlPosition() : null;
-                        vo.setApprovalFileList(query.getName() + "(关联试验工程部位信息文件)", getHppsToHttp(trailpdf), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
+                        vo.setApprovalFileList(query.getName() + "(关联试验工程部位信息文件)", getHppsToHttp(trailpdf), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
                     }
                 }
             } else if (new Integer("2").equals(query.getType())) {
@@ -329,14 +329,14 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     //试验原始pdf
                     String approvalPdf = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
                     try {
-                        String sql="Select * from u_trial_self_inspection_record where id="+query.getWbsId();
+                        String sql = "Select * from u_trial_self_inspection_record where id=" + query.getWbsId();
                         TrialSelfInspectionRecord record = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class));
-                        String sql1="select * from u_entrust_info where id="+record.getEntrustId();
+                        String sql1 = "select * from u_entrust_info where id=" + record.getEntrustId();
                         EntrustInfo entrustInfo = jdbcTemplate.queryForObject(sql1, new BeanPropertyRowMapper<>(EntrustInfo.class));
                         List<String> pdfList = new ArrayList<>();
-                        if(entrustInfo!=null){
+                        if (entrustInfo != null) {
                             pdfList.add(approvalPdf);
-                            pdfList.add(entrustInfo.getEntrustEPdf()!=null?entrustInfo.getEntrustEPdf():entrustInfo.getEntrustPdf());
+                            pdfList.add(entrustInfo.getEntrustEPdf() != null ? entrustInfo.getEntrustEPdf() : entrustInfo.getEntrustPdf());
                             if (pdfList.size() > 0) {
                                 String file_path = FileUtils.getSysLocalFileUrl();
                                 Long id = SnowFlakeUtil.getId();
@@ -353,10 +353,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                                 }
                             }
                         }
-                    }catch (Exception e){
+                    } catch (Exception e) {
                         e.printStackTrace();
                     }
-                    vo.setApprovalFileList(query.getName(), getHppsToHttp(approvalPdf), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
+                    vo.setApprovalFileList(query.getName(), getHppsToHttp(approvalPdf), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
 
                     //试验关联的原材料检测报告合并pdf (wbsId=试验记录id)
                     String sqlRecord = "select old_pdf_url from u_trial_raw_material_self_record where self_record_id =" + query.getWbsId();
@@ -369,7 +369,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                             }
                         }
                         String clPdf = StringUtils.isNotEmpty(recordObj.getOldPdfUrl()) ? recordObj.getOldPdfUrl() : null;
-                        vo.setApprovalFileList(query.getName() + "(原材料检测报告)", getHppsToHttp(clPdf), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
+                        vo.setApprovalFileList(query.getName() + "(原材料检测报告)", getHppsToHttp(clPdf), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
                     }
                 }
             }
@@ -401,6 +401,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
         }
         return url;
     }
+
     private String getHppsToHttp(String url) {
         String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
         if (url.contains("https:") && sys_isonline.equals("20")) {
@@ -627,9 +628,9 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
         Long userId = AuthUtil.getUserId();
         String nickName = AuthUtil.getNickName();
         // 批量审批接口
-        if(taskApprovalVOS!=null && taskApprovalVOS.size()>0){
+        if (taskApprovalVOS != null && taskApprovalVOS.size() > 0) {
             TaskApprovalVO taskAppr = taskApprovalVOS.get(0);
-            if(taskAppr.getFlag().equals("OK")){ //同意
+            if (taskAppr.getFlag().equals("OK")) { //同意
                 List<String> taskIds = taskApprovalVOS.stream().map(TaskApprovalVO::getParallelProcessInstanceId).distinct().collect(Collectors.toList());
                 this.taskParallelService.update(Wrappers.<TaskParallel>lambdaUpdate()
                         .set(TaskParallel::getEVisaContent, "当前等待电签的批次较多,请等待几分钟后刷新页面查看........")
@@ -657,12 +658,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     taskList.add(taskBatch);
                     //设置委托单的状态
                     try {
-                        String sql="SELECT uei.* FROM u_entrust_info uei JOIN u_trial_self_inspection_record utsr ON uei.id = utsr.entrust_id JOIN u_information_query uiq ON utsr.id = uiq.wbs_id WHERE uiq.id = "+taskApprovalVO.getFormDataId()+" and uiq.status !=3 and uiq.is_deleted=0";
+                        String sql = "SELECT uei.* FROM u_entrust_info uei JOIN u_trial_self_inspection_record utsr ON uei.id = utsr.entrust_id JOIN u_information_query uiq ON utsr.id = uiq.wbs_id WHERE uiq.id = " + taskApprovalVO.getFormDataId() + " and uiq.status !=3 and uiq.is_deleted=0";
                         List<EntrustInfo> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(EntrustInfo.class));
-                        if(!query.isEmpty()){
+                        if (!query.isEmpty()) {
                             EntrustInfo entrustInfo = query.get(0);
-                            if(entrustInfo.getStatus()==3){
-                                String update="update u_entrust_info set status = 4 where id="+entrustInfo.getId();
+                            if (entrustInfo.getStatus() == 3) {
+                                String update = "update u_entrust_info set status = 4 where id=" + entrustInfo.getId();
                                 jdbcTemplate.execute(update);
                             }
                         }
@@ -671,7 +672,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     }
                 }
                 this.taskBatchService.saveBatch(taskList);
-            }else if (taskAppr.getFlag().equals("NO")){ //废除
+            } else if (taskAppr.getFlag().equals("NO")) { //废除
                 Set<String> taskIds = taskApprovalVOS.stream().map(TaskApprovalVO::getTaskId).collect(Collectors.toSet());
                 List<Task> tasks = this.listByIds(taskIds);
                 Map<String, Task> taskMap = tasks.stream().collect(Collectors.toMap(task -> task.getId() + "", task -> task));
@@ -688,19 +689,19 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     // 废除信息
                     Integer appType = taskApp.getApprovalType();
                     //质检系统
-                    String up_task_par = "update u_task_parallel set status=3 , e_visa_content = '驳回成功,驳回原因:" + taskApp.getComment() + "', initiative=10,update_time=SYSDATE(),update_user="+userId+"  where parallel_process_instance_id='"+taskApp.getParallelProcessInstanceId()+"'";
-                    String up_task = "update u_task set status=3, update_time=SYSDATE(),update_user="+userId+" where id='"+taskApp.getTaskId()+"'";
-                    this.jdbcTemplate.execute("delete from u_task_batch where JSON_UNQUOTE(JSON_EXTRACT(json_data, '$.taskId'))="+taskApp.getTaskId()+"");
+                    String up_task_par = "update u_task_parallel set status=3 , e_visa_content = '驳回成功,驳回原因:" + taskApp.getComment() + "', initiative=10,update_time=SYSDATE(),update_user=" + userId + "  where parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "'";
+                    String up_task = "update u_task set status=3, update_time=SYSDATE(),update_user=" + userId + " where id='" + taskApp.getTaskId() + "'";
+                    this.jdbcTemplate.execute("delete from u_task_batch where JSON_UNQUOTE(JSON_EXTRACT(json_data, '$.taskId'))=" + taskApp.getTaskId() + "");
                     jdbcTemplate.execute(up_task_par);
                     jdbcTemplate.execute(up_task);
 
-                    if(taskApp.getApprovalType() == 3){
-                        jdbcTemplate.execute("update u_contract_log set status=3 where id='"+taskApp.getFormDataId()+"'");
-                    }else if (taskApp.getApprovalType()==8) {
-                        this.jdbcTemplate.execute("update u_entrust_info set status=1 where id=(SELECT wbs_id from u_information_query where id='"+taskApp.getFormDataId()+"')");
-                        this.jdbcTemplate.execute("update u_information_query set status=3 where id='"+taskApp.getFormDataId()+"'");
-                    }else {
-                        jdbcTemplate.execute("update u_information_query set e_visa_pdf_url='',status=3 where id='"+taskApp.getFormDataId()+"'");
+                    if (taskApp.getApprovalType() == 3) {
+                        jdbcTemplate.execute("update u_contract_log set status=3 where id='" + taskApp.getFormDataId() + "'");
+                    } else if (taskApp.getApprovalType() == 8) {
+                        this.jdbcTemplate.execute("update u_entrust_info set status=1 where id=(SELECT wbs_id from u_information_query where id='" + taskApp.getFormDataId() + "')");
+                        this.jdbcTemplate.execute("update u_information_query set status=3 where id='" + taskApp.getFormDataId() + "'");
+                    } else {
+                        jdbcTemplate.execute("update u_information_query set e_visa_pdf_url='',status=3 where id='" + taskApp.getFormDataId() + "'");
                         InformationQuery informationQuery = informationQueryService.getById(taskApp.getFormDataId());
                         Long primaryKeyId = informationQuery.getWbsId();
                         informationQuery.setStatus(0);
@@ -768,7 +769,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     }
 
 
-   // @Scheduled(cron = "0/20 * * * * ?")
+    // @Scheduled(cron = "0/20 * * * * ?")
    /* public void SignInfo() throws InterruptedException {
         //执行代码
         logger.debug("扫描开始");
@@ -1119,7 +1120,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
      * 质检-日志重签
      */
     @Override
-    public void logReSigningEVisa( String logids,Long logPkeyId, Long nodePrimaryKeyId, String contractId ,HttpServletRequest request, Integer type) {
+    public void logReSigningEVisa(String logids, Long logPkeyId, Long nodePrimaryKeyId, String contractId, HttpServletRequest request, Integer type) {
         List<Task> taskList = jdbcTemplate.query("select * from u_task where is_deleted = 0 and status != 3 and  form_data_id in(" + logids + ")", new BeanPropertyRowMapper<>(Task.class));
         if (taskList.size() > 0) {
             //获取任务详情信息Map
@@ -1141,14 +1142,14 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 for (Task task : taskList) {
                     ContractLog contractLog = contractLogMap.get(Long.valueOf(task.getFormDataId()));
                     R result = new R();
-                    jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+task.getId()+"%'");
+                    jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%" + task.getId() + "%'");
                     boolean b = false;
-                    if(type == 1){
-                         b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
+                    if (type == 1) {
+                        b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
                                 .set(ContractLog::getEVisaPdfUrl, null)
                                 .set(ContractLog::getPdfUrl, null));
-                    }else {
-                         b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
+                    } else {
+                        b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
                                 .set(ContractLog::getEVisaPdfUrl, null));
                     }
 
@@ -1158,12 +1159,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                         long startTime_1 = System.currentTimeMillis();
                         //获取详细的日志数据
 
-                        result = excelTabClient.getTheContractLogBusinessData(logPkeyId.toString(), nodePrimaryKeyId.toString(), contractLog.getRecordTime(), contractId,contractLog.getCreateUser());
+                        result = excelTabClient.getTheContractLogBusinessData(logPkeyId.toString(), nodePrimaryKeyId.toString(), contractLog.getRecordTime(), contractId, contractLog.getCreateUser());
                         long endTime_1 = System.currentTimeMillis();
                         long executionTime_1 = endTime_1 - startTime_1;
                         log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
-                    }else{
-                        if (!b){
+                    } else {
+                        if (!b) {
                             throw new ServiceException("清空电签PDF失败");
                         }
                         result.setData("成功");
@@ -1188,7 +1189,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                             }
                         }
                         long startTime_2 = System.currentTimeMillis();
-                        if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
+                        if (taskApprovalVOS != null && taskApprovalVOS.size() >= 1) {
                             this.batchCompleteApprovalTask(taskApprovalVOS);
                         }
                         long endTime_2 = System.currentTimeMillis();
@@ -1216,7 +1217,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
             }
 
-        }else {
+        } else {
             throw new ServiceException("未获取到任务信息,操作失败!");
         }
     }
@@ -1245,13 +1246,13 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             try {
                 for (Task task : taskList) {
                     R result = new R();
-                    jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+task.getId()+"%'");
+                    jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%" + task.getId() + "%'");
                     boolean b = false;
-                    if(type == 1){
+                    if (type == 1) {
                         b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
                                 .eq(InformationQuery::getId, task.getFormDataId())
                                 .set(InformationQuery::getEVisaPdfUrl, null));
-                    }else {
+                    } else {
                         b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
                                 .eq(InformationQuery::getId, task.getFormDataId())
                                 .set(InformationQuery::getEVisaPdfUrl, null));
@@ -1260,12 +1261,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     if (type == 1) {
                         //重新保存
                         long startTime_1 = System.currentTimeMillis();
-                        result = this.saveTrialSelfNodePdf(dto,queryMap.get(task.getFormDataId()));
+                        result = this.saveTrialSelfNodePdf(dto, queryMap.get(task.getFormDataId()));
                         long endTime_1 = System.currentTimeMillis();
                         long executionTime_1 = endTime_1 - startTime_1;
                         log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
-                    }else{
-                        if (!b){
+                    } else {
+                        if (!b) {
                             throw new ServiceException("清空电签PDF失败");
                         }
                         result.setData("成功");
@@ -1276,7 +1277,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                         List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
                         for (TaskParallel taskParallel : taskParallelList) {
                             //待审批的不进行重签, 存在待审批,但是电签状态是失败的
-                            if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent()) ) {
+                            if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent())) {
                                 TaskApprovalVO approvalVO = new TaskApprovalVO();
                                 approvalVO.setTaskId(task.getId().toString());
                                 approvalVO.setFlag("OK");
@@ -1290,7 +1291,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                             }
                         }
                         long startTime_2 = System.currentTimeMillis();
-                        if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
+                        if (taskApprovalVOS != null && taskApprovalVOS.size() >= 1) {
                             this.batchCompleteApprovalTask(taskApprovalVOS);
                         }
                         long endTime_2 = System.currentTimeMillis();
@@ -1316,7 +1317,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 e.printStackTrace();
                 throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
             }
-        }else {
+        } else {
             throw new ServiceException("未获取到任务信息,操作失败!");
         }
 
@@ -1327,10 +1328,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     public void reSigningEntrust(List<ReSigningEntrustDto> dtos, String header, HttpServletRequest request) {
         String taskIds = dtos.stream().map(d -> d.getTaskId()).collect(Collectors.joining(","));
         Map<String, ReSigningEntrustDto> map = dtos.stream()
-            .filter(dto -> dto.getTaskId() != null) // 确保taskId不为空
-            .collect(Collectors.toMap(ReSigningEntrustDto::getTaskId, dto -> dto));
+                .filter(dto -> dto.getTaskId() != null) // 确保taskId不为空
+                .collect(Collectors.toMap(ReSigningEntrustDto::getTaskId, dto -> dto));
         Map<Long, ReSigningEntrustDto> longMap = map.values().stream()
-            .collect(Collectors.toMap(ReSigningEntrustDto::getTaskIdLong, dto -> dto));
+                .collect(Collectors.toMap(ReSigningEntrustDto::getTaskIdLong, dto -> dto));
         //查询任务信息
         List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
         if (taskList.size() > 0) {
@@ -1339,8 +1340,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             Map<String, List<TaskParallel>> taskParallelGroupMap = new HashMap<>();
             if (processInstanceIds.size() > 0) {
                 String resultIds = processInstanceIds.stream()
-                    .map(id -> "'" + id + "'")
-                    .collect(Collectors.joining(","));
+                        .map(id -> "'" + id + "'")
+                        .collect(Collectors.joining(","));
                 taskParallelGroupMap = jdbcTemplate.query("select parallel_process_instance_id,process_instance_id,e_visa_status,task_user,task_user_name,status from u_task_parallel where process_instance_id in(" + resultIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
             }
             Map<String, List<TaskParallel>> finalTaskParallelGroupMap = taskParallelGroupMap;
@@ -1348,20 +1349,20 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 for (int i = 0; i < taskList.size(); i++) {
                     ReSigningEntrustDto dto = longMap.get(taskList.get(i).getId());
                     R result = new R();
-                    jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+taskList.get(i).getId()+"%'");
+                    jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%" + taskList.get(i).getId() + "%'");
                     boolean b = false;
-                    if(dto.getType() == 1){
+                    if (dto.getType() == 1) {
                         b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
-                            .eq(InformationQuery::getId, taskList.get(i).getFormDataId())
-                            .set(InformationQuery::getEVisaPdfUrl, null)
-                            .set(InformationQuery::getPdfUrl, null));
-                        String update="update u_entrust_info set entrust_e_pdf=null,entrust_pdf=null where id="+dto.getEntrustId();
+                                .eq(InformationQuery::getId, taskList.get(i).getFormDataId())
+                                .set(InformationQuery::getEVisaPdfUrl, null)
+                                .set(InformationQuery::getPdfUrl, null));
+                        String update = "update u_entrust_info set entrust_e_pdf=null,entrust_pdf=null where id=" + dto.getEntrustId();
                         jdbcTemplate.update(update);
-                    }else {
+                    } else {
                         b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
-                            .eq(InformationQuery::getId, taskList.get(i).getFormDataId())
-                            .set(InformationQuery::getEVisaPdfUrl, null));
-                        String update="update u_entrust_info set entrust_e_pdf=null where id="+dto.getEntrustId();
+                                .eq(InformationQuery::getId, taskList.get(i).getFormDataId())
+                                .set(InformationQuery::getEVisaPdfUrl, null));
+                        String update = "update u_entrust_info set entrust_e_pdf=null where id=" + dto.getEntrustId();
                         jdbcTemplate.update(update);
                     }
 
@@ -1369,12 +1370,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     if (dto.getType() == 1) {
                         //重新保存
                         long startTime_1 = System.currentTimeMillis();
-                        result=excelTabClient.saveReEntrustTabData(dto,header);
+                        result = excelTabClient.saveReEntrustTabData(dto, header);
                         long endTime_1 = System.currentTimeMillis();
                         long executionTime_1 = endTime_1 - startTime_1;
                         log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
-                    }else{
-                        if (!b){
+                    } else {
+                        if (!b) {
                             throw new ServiceException("清空电签PDF失败");
                         }
                         result.setData("成功");
@@ -1385,7 +1386,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                         List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(taskList.get(i).getProcessInstanceId());
                         for (TaskParallel taskParallel : taskParallelList) {
                             //待审批的不进行重签, 存在待审批,但是电签状态是失败的
-                            if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent()) ) {
+                            if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent())) {
                                 TaskApprovalVO approvalVO = new TaskApprovalVO();
                                 approvalVO.setTaskId(taskList.get(i).getId().toString());
                                 approvalVO.setFlag("OK");
@@ -1399,11 +1400,11 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                             }
                         }
                         long startTime_2 = System.currentTimeMillis();
-                        if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
+                        if (taskApprovalVOS != null && taskApprovalVOS.size() >= 1) {
                             this.batchCompleteApprovalTask(taskApprovalVOS);
                         }
-                        if(result.getData()!=null){
-                            String update="update u_entrust_info set entrust_pdf= '"+result.getData()+"' where id="+dto.getEntrustId();
+                        if (result.getData() != null) {
+                            String update = "update u_entrust_info set entrust_pdf= '" + result.getData() + "' where id=" + dto.getEntrustId();
                             jdbcTemplate.update(update);
                         }
                         long endTime_2 = System.currentTimeMillis();
@@ -1412,8 +1413,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     } else {
                         //修改重签状态为保存PDF失败
                         this.taskParallelService.update(Wrappers.<TaskParallel>lambdaUpdate()
-                            .set(TaskParallel::getEVisaContent, "重新保存PDF失败")
-                            .eq(TaskParallel::getProcessInstanceId, taskList.get(i).getProcessInstanceId()));
+                                .set(TaskParallel::getEVisaContent, "重新保存PDF失败")
+                                .eq(TaskParallel::getProcessInstanceId, taskList.get(i).getProcessInstanceId()));
                     }
                 }
             } catch (Exception e) {
@@ -1421,14 +1422,13 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
             }
 
-        }else {
+        } else {
             throw new ServiceException("未获取到任务信息,操作失败!");
         }
     }
 
 
-
-    private R saveTrialSelfNodePdf(TrialResignDto dto,String trialId) {
+    private R saveTrialSelfNodePdf(TrialResignDto dto, String trialId) {
         //试验记录id
         String trialIds = dto.getTrialIds();
         TrialSelfInspectionRecord tRecord = trialSelfInspectionRecordMapper.selectById(trialIds);
@@ -1551,7 +1551,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 //                } else {
 //                    throw new ServiceException("开启并行流程失败");
 //                }
-                  taskParallelArray.add(new TaskParallel(vo.getProcessInstanceId(), SnowFlakeUtil.getId() + "", link.getFixedFlowLinkUser().toString(), link.getFixedFlowLinkUserName()));
+                taskParallelArray.add(new TaskParallel(vo.getProcessInstanceId(), SnowFlakeUtil.getId() + "", link.getFixedFlowLinkUser().toString(), link.getFixedFlowLinkUserName()));
             }
             //设置流程信息
             vo.setProcessDefinitionId(taskFlowId);
@@ -1661,8 +1661,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
         try {
             System.out.println("----- 电签成功--------");
             //添加nodePdf的值
-            List<Map<String, Object>> mapList = jdbcTemplate.queryForList("select *,domain_url as url from m_table_file where is_deleted = 0 and type in (10,11,12) and tab_id = (select wbs_id from u_information_query WHERE id = + "+formDataId+")");
-            if(Func.isNotEmpty(mapList)&&mapList.size()>=1) {
+            List<Map<String, Object>> mapList = jdbcTemplate.queryForList("select *,domain_url as url from m_table_file where is_deleted = 0 and type in (10,11,12) and tab_id = (select wbs_id from u_information_query WHERE id = + " + formDataId + ")");
+            if (Func.isNotEmpty(mapList) && mapList.size() >= 1) {
                 String file_path = org.springblade.business.utils.FileUtils.getSysLocalFileUrl();
                 List<String> datainfo = new ArrayList<>();
                 datainfo.add(newFileUrl);
@@ -1685,7 +1685,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     nodePdfUrl = org.springblade.business.utils.FileUtils.getNetUrl(listPdf);
                 }
 
-            }else{
+            } else {
                 nodePdfUrl = newFileUrl;
             }
 
@@ -1744,7 +1744,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 //修改试验业务状态(已审批的情况下修改)
                 if (new Integer(2).equals(queryinfo.getType()) && ObjectUtil.isNotEmpty(queryinfo.getWbsId()) && status != 3) {
                     jdbcTemplate.execute("update u_trial_self_inspection_record set task_status = '已审批' where id = " + queryinfo.getWbsId());
-                    jdbcTemplate.execute("update u_entrust_info set status = 4 where id = (select entrust_id from u_trial_self_inspection_record where id = '" + queryinfo.getWbsId()+ "')");
+                    jdbcTemplate.execute("update u_entrust_info set status = 4 where id = (select entrust_id from u_trial_self_inspection_record where id = '" + queryinfo.getWbsId() + "')");
                 }
 
             }
@@ -1789,7 +1789,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             ArchiveProjectConfig archiveProjectConfig = archiveAutoClient.getByProjectIdOrNew(query.getProjectId());
 
             //测试阶段,必须打开项目配置才能同步wbs节点
-            if (archiveProjectConfig != null ) {
+            if (archiveProjectConfig != null) {
                 //废除
                 if (status == 0) {
                     delArchiveFileBusinessData(query.getProjectId(), query.getWbsId());
@@ -1904,104 +1904,106 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             archiveFileService.deleteLogic(ids);
         }
     }
-/*
-    @Override
-    public void reSigningEVisa(String taskIds, String contractId, String projectId,String header,HttpServletRequest request) {
-        List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
-        if (taskList.size() > 0) {
-            List<String> dataIdList = taskList.stream().map(Task::getFormDataId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
-            List<InformationQuery> informationQueryList = jdbcTemplate.query("select * from u_information_query where id in(" + StringUtils.join(dataIdList, ",") + ")", new BeanPropertyRowMapper<>(InformationQuery.class));
-            if (informationQueryList.size() > 0) {
-                List<Long> nodePKeyIdList = informationQueryList.stream().map(InformationQuery::getWbsId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
-                if (nodePKeyIdList.size() > 0) {
-                    try {
-                      //  重新保存
-                        long startTime_1 = System.currentTimeMillis();
-                        R result = this.saveNodePdf( ,StringUtils.join(nodePKeyIdList, ","), contractId, projectId,header);
-                        long endTime_1 = System.currentTimeMillis();
-                        long executionTime_1 = endTime_1 - startTime_1;
-                        log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
 
-                       // 重新电签
-                        if (result != null && "成功".equals(result.getData())) {
-
-                            List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
-                           // 获取任务详情信息Map
-                            Set<String> processInstanceIds = taskList.stream().map(Task::getProcessInstanceId).collect(Collectors.toSet());
-                            Map<String, List<TaskParallel>> taskParallelGroupMap = new HashMap<>();
-                            if (processInstanceIds.size() > 0) {
-                                String resultIds = processInstanceIds.stream()
-                                        .map(id -> "'" + id + "'")
-                                        .collect(Collectors.joining(","));
-                                taskParallelGroupMap = jdbcTemplate.query("select parallel_process_instance_id,process_instance_id,e_visa_status,task_user,task_user_name,status from u_task_parallel where process_instance_id in(" + resultIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
-                            }
-                            Map<String, List<TaskParallel>> finalTaskParallelGroupMap = taskParallelGroupMap;
-
-                            for (Task task : taskList) {
-                                List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
-                                for (TaskParallel taskParallel : taskParallelList) {
-                                    //待审批的不进行重签, 存在待审批,但是电签状态是失败的
-                                    if (!(new Integer(1)).equals(taskParallel.getStatus()) || (taskParallel.getEVisaStatus() != null && taskParallel.getEVisaStatus() == 99)) {
-                                        TaskApprovalVO approvalVO = new TaskApprovalVO();
-                                        approvalVO.setTaskId(task.getId().toString());
-                                        approvalVO.setFlag("OK");
-                                        approvalVO.setComment("重新发起电签");
-                                        approvalVO.setApprovalType(1);
-                                        approvalVO.setFormDataId(task.getFormDataId());
-                                        approvalVO.setParallelProcessInstanceId(taskParallel.getParallelProcessInstanceId());
-                                        approvalVO.setYsNickName(taskParallel.getTaskUserName());
-                                        approvalVO.setUserId(Long.parseLong(taskParallel.getTaskUser()));
-                                        taskApprovalVOS.add(approvalVO);
+    /*
+        @Override
+        public void reSigningEVisa(String taskIds, String contractId, String projectId,String header,HttpServletRequest request) {
+            List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
+            if (taskList.size() > 0) {
+                List<String> dataIdList = taskList.stream().map(Task::getFormDataId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
+                List<InformationQuery> informationQueryList = jdbcTemplate.query("select * from u_information_query where id in(" + StringUtils.join(dataIdList, ",") + ")", new BeanPropertyRowMapper<>(InformationQuery.class));
+                if (informationQueryList.size() > 0) {
+                    List<Long> nodePKeyIdList = informationQueryList.stream().map(InformationQuery::getWbsId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
+                    if (nodePKeyIdList.size() > 0) {
+                        try {
+                          //  重新保存
+                            long startTime_1 = System.currentTimeMillis();
+                            R result = this.saveNodePdf( ,StringUtils.join(nodePKeyIdList, ","), contractId, projectId,header);
+                            long endTime_1 = System.currentTimeMillis();
+                            long executionTime_1 = endTime_1 - startTime_1;
+                            log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
+
+                           // 重新电签
+                            if (result != null && "成功".equals(result.getData())) {
+
+                                List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
+                               // 获取任务详情信息Map
+                                Set<String> processInstanceIds = taskList.stream().map(Task::getProcessInstanceId).collect(Collectors.toSet());
+                                Map<String, List<TaskParallel>> taskParallelGroupMap = new HashMap<>();
+                                if (processInstanceIds.size() > 0) {
+                                    String resultIds = processInstanceIds.stream()
+                                            .map(id -> "'" + id + "'")
+                                            .collect(Collectors.joining(","));
+                                    taskParallelGroupMap = jdbcTemplate.query("select parallel_process_instance_id,process_instance_id,e_visa_status,task_user,task_user_name,status from u_task_parallel where process_instance_id in(" + resultIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
+                                }
+                                Map<String, List<TaskParallel>> finalTaskParallelGroupMap = taskParallelGroupMap;
+
+                                for (Task task : taskList) {
+                                    List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
+                                    for (TaskParallel taskParallel : taskParallelList) {
+                                        //待审批的不进行重签, 存在待审批,但是电签状态是失败的
+                                        if (!(new Integer(1)).equals(taskParallel.getStatus()) || (taskParallel.getEVisaStatus() != null && taskParallel.getEVisaStatus() == 99)) {
+                                            TaskApprovalVO approvalVO = new TaskApprovalVO();
+                                            approvalVO.setTaskId(task.getId().toString());
+                                            approvalVO.setFlag("OK");
+                                            approvalVO.setComment("重新发起电签");
+                                            approvalVO.setApprovalType(1);
+                                            approvalVO.setFormDataId(task.getFormDataId());
+                                            approvalVO.setParallelProcessInstanceId(taskParallel.getParallelProcessInstanceId());
+                                            approvalVO.setYsNickName(taskParallel.getTaskUserName());
+                                            approvalVO.setUserId(Long.parseLong(taskParallel.getTaskUser()));
+                                            taskApprovalVOS.add(approvalVO);
+                                        }
                                     }
                                 }
+                                long startTime_2 = System.currentTimeMillis();
+                                this.batchCompleteApprovalTask(taskApprovalVOS);
+                                long endTime_2 = System.currentTimeMillis();
+                                long executionTime_2 = endTime_2 - startTime_2;
+                                log.info("batchCompleteApprovalTask执行时间:" + executionTime_2 + " 毫秒");
+                            } else {
+                                throw new ServiceException("重新保存PDF信息失败");
                             }
-                            long startTime_2 = System.currentTimeMillis();
-                            this.batchCompleteApprovalTask(taskApprovalVOS);
-                            long endTime_2 = System.currentTimeMillis();
-                            long executionTime_2 = endTime_2 - startTime_2;
-                            log.info("batchCompleteApprovalTask执行时间:" + executionTime_2 + " 毫秒");
-                        } else {
-                            throw new ServiceException("重新保存PDF信息失败");
-                        }
 
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                        throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
+                        }
                     }
                 }
             }
+            throw new ServiceException("未获取到任务信息,操作失败!");
+        }*/
+    @Override
+    public R reSigningEVisaStatus0(List<reSigningEVisaStatus> dtos, String header) throws Exception {
+        if (dtos.size() > 0) {
+            Set<Long> newIds = dtos.stream().map(reSigningEVisaStatus::getId).collect(Collectors.toSet());
+            //正在重刷的不允许再次重刷
+            informationQueryService.update(Wrappers.<InformationQuery>update().lambda()
+                    .set(InformationQuery::getSaveAgain, 0)
+                    .ne(InformationQuery::getSaveAgain, 1)
+                    .in(InformationQuery::getId, newIds));
         }
-        throw new ServiceException("未获取到任务信息,操作失败!");
-    }*/
-        @Override
-        public R reSigningEVisaStatus0(List<reSigningEVisaStatus> dtos, String header) throws Exception {
-         if(dtos.size()>0){
-             Set<Long> newIds = dtos.stream().map(reSigningEVisaStatus::getId).collect(Collectors.toSet());
-             //正在重刷的不允许再次重刷
-             informationQueryService.update(Wrappers.<InformationQuery>update().lambda()
-                     .set(InformationQuery::getSaveAgain, 0)
-                     .ne(InformationQuery::getSaveAgain, 1)
-                     .in(InformationQuery::getId, newIds));
-        }
-         return R.success("操作成功");
+        return R.success("操作成功");
     }
 
     @Override
     public void logSaveAgain(LogSaveAgainDto dto) throws Exception {
         List<ContractLog> contractLogList = jdbcTemplate.query("select * from u_contract_log where id in (" + dto.getLogIds() + ")", new BeanPropertyRowMapper<>(ContractLog.class));
-        if(contractLogList.size()>0){
+        if (contractLogList.size() > 0) {
             for (ContractLog contractLog : contractLogList) {
                 contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
-                    .set(ContractLog::getEVisaPdfUrl, null)
-                    .set(ContractLog::getPdfUrl, null));
+                        .set(ContractLog::getEVisaPdfUrl, null)
+                        .set(ContractLog::getPdfUrl, null));
                 //excelTabClient.getTheContractLogBusinessData(dto.getLogPkeyId(), dto.getNodePrimaryKeyId(), contractLog.getRecordTime(), dto.getContractId(), contractLog.getCreateUser());
-                excelTabClient.getTheLogPdInfo(dto.getLogPkeyId(), dto.getNodePrimaryKeyId(), contractLog.getRecordTime(), dto.getContractId(),contractLog.getCreateUser());
+                excelTabClient.getTheLogPdInfo(dto.getLogPkeyId(), dto.getNodePrimaryKeyId(), contractLog.getRecordTime(), dto.getContractId(), contractLog.getCreateUser());
             }
         }
     }
 
+
     @Override
-    public void reSigningEVisa(String classify, String taskIds, String contractId, String projectId, Integer type, String header,HttpServletRequest request ) {
+    public void reSigningEVisa(String classify, String taskIds, String contractId, String projectId, Integer type, String header, HttpServletRequest request) {
         //查询任务信息
         List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
         if (taskList.size() > 0) {
@@ -2023,27 +2025,27 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             try {
                 for (Task task : taskList) {
                     R result = new R();
-                    jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+task.getId()+"%'");
+                    jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%" + task.getId() + "%'");
                     boolean b = false;
-                    if(type == 1){
-                         b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
-                                .eq(InformationQuery::getId, task.getFormDataId())
-                                .set(InformationQuery::getEVisaPdfUrl, null)
+                    if (type == 1) {
+                        b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
+                                        .eq(InformationQuery::getId, task.getFormDataId())
+                                        .set(InformationQuery::getEVisaPdfUrl, null)
 //                                .set(InformationQuery::getPdfUrl, null)
-                         );
-                    }else {
-                        if(task.getApprovalType()==3){
-                           b=contractLogService.update(new LambdaUpdateWrapper<ContractLog>()
-                               .eq(ContractLog::getId,task.getFormDataId())
-                               .set(ContractLog::getEVisaPdfUrl,null));
-                           if(!b){
-                               jdbcTemplate.update("update u_task set is_deleted=1 where id="+task.getId());
-                               return;
-                           }
-                        }else {
+                        );
+                    } else {
+                        if (task.getApprovalType() == 3) {
+                            b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>()
+                                    .eq(ContractLog::getId, task.getFormDataId())
+                                    .set(ContractLog::getEVisaPdfUrl, null));
+                            if (!b) {
+                                jdbcTemplate.update("update u_task set is_deleted=1 where id=" + task.getId());
+                                return;
+                            }
+                        } else {
                             b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
-                                .eq(InformationQuery::getId, task.getFormDataId())
-                                .set(InformationQuery::getEVisaPdfUrl, null));
+                                    .eq(InformationQuery::getId, task.getFormDataId())
+                                    .set(InformationQuery::getEVisaPdfUrl, null));
                         }
 
                     }
@@ -2057,55 +2059,55 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                         //重新保存
                         long startTime_1 = System.currentTimeMillis();
                         //质检资料
-                        if(task.getApprovalType()==1 || task.getApprovalType()== 9){
-                            String sql="select type from u_information_query where id="+task.getFormDataId();
+                        if (task.getApprovalType() == 1 || task.getApprovalType() == 9) {
+                            String sql = "select type from u_information_query where id=" + task.getFormDataId();
                             Integer InformationType = jdbcTemplate.queryForObject(sql, new SingleColumnRowMapper<>(Integer.class));
-                            if(InformationType==1){
+                            if (InformationType == 1) {
                                 result = this.saveNodePdf(typeMap.get(task.getFormDataId()), queryMap.get(task.getFormDataId()), contractId, projectId, header);
-                            }else {
-                                TrialResignDto dto=new TrialResignDto();
+                            } else {
+                                TrialResignDto dto = new TrialResignDto();
                                 dto.setType(1);
                                 dto.setProjectId(projectId);
                                 dto.setTrialIds(queryMap.get(task.getFormDataId()));
-                                result=this.saveTrialSelfNodePdf(dto,queryMap.get(task.getFormDataId()));
+                                result = this.saveTrialSelfNodePdf(dto, queryMap.get(task.getFormDataId()));
                             }
 
                         }
                         //日志资料
-                        if(task.getApprovalType()==3){
+                        if (task.getApprovalType() == 3) {
                             ContractLog contractLog = jdbcTemplate.queryForObject("select * from u_contract_log where id =" + task.getFormDataId(), new BeanPropertyRowMapper<>(ContractLog.class));
-                            result = excelTabClient.getTheContractLogBusinessData(contractLog.getTableId().toString(), contractLog.getWbsNodeId().toString(), contractLog.getRecordTime(), contractId,contractLog.getCreateUser());
+                            result = excelTabClient.getTheContractLogBusinessData(contractLog.getTableId().toString(), contractLog.getWbsNodeId().toString(), contractLog.getRecordTime(), contractId, contractLog.getCreateUser());
                         }
                         //委托单重签
-                        if(task.getApprovalType()==8){
-                            String sql="SELECT * from u_entrust_info where id=(select wbs_id from u_information_query where id="+task.getFormDataId()+")";
+                        if (task.getApprovalType() == 8) {
+                            String sql = "SELECT * from u_entrust_info where id=(select wbs_id from u_information_query where id=" + task.getFormDataId() + ")";
                             EntrustInfo info = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(EntrustInfo.class));
-                            ReSigningEntrustDto dto=new ReSigningEntrustDto(info.getId().toString(),task.getId().toString(),contractId,info.getNodeId(),2,1);
-                            result=excelTabClient.saveReEntrustTabData(dto,header);
-                            if(result.getCode()==200){
-                                if(result.getData()!=null){
+                            ReSigningEntrustDto dto = new ReSigningEntrustDto(info.getId().toString(), task.getId().toString(), contractId, info.getNodeId(), 2, 1);
+                            result = excelTabClient.saveReEntrustTabData(dto, header);
+                            if (result.getCode() == 200) {
+                                if (result.getData() != null) {
                                     informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
-                                        .eq(InformationQuery::getId, task.getFormDataId())
-                                        .set(InformationQuery::getPdfUrl,result.getData()));
+                                            .eq(InformationQuery::getId, task.getFormDataId())
+                                            .set(InformationQuery::getPdfUrl, result.getData()));
                                 }
                             }
                         }
                         long endTime_1 = System.currentTimeMillis();
                         long executionTime_1 = endTime_1 - startTime_1;
                         log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
-                    }else{
-                        if (!b){
+                    } else {
+                        if (!b) {
                             throw new ServiceException("清空电签PDF失败");
                         }
                         result.setData("成功");
                     }
                     //重新电签
-                    if (result != null && ("成功".equals(result.getData())||200==result.getCode())) {
+                    if (result != null && ("成功".equals(result.getData()) || 200 == result.getCode())) {
                         List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
                         List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
                         for (TaskParallel taskParallel : taskParallelList) {
                             //待审批的不进行重签, 存在待审批,但是电签状态是失败的
-                            if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent()) ) {
+                            if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent())) {
                                 TaskApprovalVO approvalVO = new TaskApprovalVO();
                                 approvalVO.setTaskId(task.getId().toString());
                                 approvalVO.setFlag("OK");
@@ -2119,7 +2121,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                             }
                         }
                         long startTime_2 = System.currentTimeMillis();
-                        if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
+                        if (taskApprovalVOS != null && taskApprovalVOS.size() >= 1) {
                             this.batchCompleteApprovalTask(taskApprovalVOS);
                         }
                         long endTime_2 = System.currentTimeMillis();
@@ -2136,7 +2138,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 Long userId = AuthUtil.getUserId(request);
                 String userName = AuthUtil.getNickName(request);
                 //判断是否是超级管理员并且是泓创智诚下的部门
-                if(judgeRoleIdAndDeptId(userId)){
+                if (judgeRoleIdAndDeptId(userId)) {
                     //满足去除当前填报人的条件 去除当前任务的填报人中当前操作人的信息
                     removeUserAndName(taskIds, userId, userName);
                 }
@@ -2145,7 +2147,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
             }
 
-        }else {
+        } else {
             throw new ServiceException("未获取到任务信息,操作失败!");
         }
     }
@@ -2156,32 +2158,31 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     }
 
 
-
     /**
      * 返回true代表满足条件 是超级管理员并且部门是在泓创智诚下面的部门
      */
-    public boolean judgeRoleIdAndDeptId(Long userId ){
+    public boolean judgeRoleIdAndDeptId(Long userId) {
         try {
-            String sqlForUser = "select role_id ,dept_id from blade_user where id = "+userId;
+            String sqlForUser = "select role_id ,dept_id from blade_user where id = " + userId;
             User user = jdbcTemplate.queryForObject(sqlForUser, new BeanPropertyRowMapper<>(User.class));
-            String sqlforSkipDept = "select id from blade_dept where parent_id = "+HONGCHENG_DEPT_ID + " or id = "+HONGCHENG_DEPT_ID;
+            String sqlforSkipDept = "select id from blade_dept where parent_id = " + HONGCHENG_DEPT_ID + " or id = " + HONGCHENG_DEPT_ID;
             List<Dept> depts = jdbcTemplate.query(sqlforSkipDept, new BeanPropertyRowMapper<>(Dept.class));
             String roleId = user.getRoleId();
             String deptId = user.getDeptId();
-            if(roleId==null||deptId==null){
+            if (roleId == null || deptId == null) {
                 return true;
             }
             //既是超级管理员同时是泓创下面的部门才允许跳过填报人赋值
-            if(roleId!=null&&roleId.contains(SUPER_ADMIN_ROLE_ID)){
+            if (roleId != null && roleId.contains(SUPER_ADMIN_ROLE_ID)) {
                 Boolean flag = false;
                 for (Dept dept : depts) {
-                    if(deptId!=null&&deptId.contains(dept.getId().toString())){
+                    if (deptId != null && deptId.contains(dept.getId().toString())) {
                         flag = true;
                         return flag;
                     }
                 }
                 return flag;
-            }else {
+            } else {
                 return false;
             }
         } catch (DataAccessException e) {
@@ -2197,26 +2198,26 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
         try {
             String[] split1 = taskIds.split(",");
             for (String taskId : split1) {
-                String sqlForInformationQuery = "select * from u_information_query where id = (select form_data_id from u_task where id =" +taskId+ ")";
+                String sqlForInformationQuery = "select * from u_information_query where id = (select form_data_id from u_task where id =" + taskId + ")";
                 InformationQuery informationQuery = jdbcTemplate.queryForObject(sqlForInformationQuery, new BeanPropertyRowMapper<>(InformationQuery.class));
                 String fileUserIdAndName = informationQuery.getFileUserIdAndName();
-                if (StringUtils.isNotEmpty(fileUserIdAndName) && fileUserIdAndName.contains(userId + "-" + userName)){
+                if (StringUtils.isNotEmpty(fileUserIdAndName) && fileUserIdAndName.contains(userId + "-" + userName)) {
                     String[] split = fileUserIdAndName.split(",");
-                    if(split != null && split.length > 0){
+                    if (split != null && split.length > 0) {
                         ArrayList<String> list = new ArrayList<>(Arrays.asList(split));
                         for (int i = 0; i < list.size(); i++) {
-                            if(list.get(i).contains(userId + "-" + userName)){
+                            if (list.get(i).contains(userId + "-" + userName)) {
                                 list.remove(i);
                             }
                         }
                         String fileUserIdAndNameNew = String.join(",", list);
-                        String sqlForUpdateInformationQuery = "update  u_information_query set file_user_id_and_name = '"+fileUserIdAndNameNew+"' where id = (select form_data_id from u_task where id =" +taskId+ ")";
+                        String sqlForUpdateInformationQuery = "update  u_information_query set file_user_id_and_name = '" + fileUserIdAndNameNew + "' where id = (select form_data_id from u_task where id =" + taskId + ")";
                         jdbcTemplate.execute(sqlForUpdateInformationQuery);
                     }
                 }
             }
         } catch (DataAccessException e) {
-           throw new RuntimeException("去除对应的填报人信息异常");
+            throw new RuntimeException("去除对应的填报人信息异常");
         }
     }
 
@@ -2224,7 +2225,43 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     public Task getTaskByFormDataId(String formDataId) {
         return getOne(Wrappers.<Task>lambdaQuery()
                 .eq(Task::getIsDeleted, 0)
+                .in(Task::getStatus, 0,1, 2)
                 .eq(Task::getFormDataId, formDataId));
     }
 
+    @Override
+    public R reSigningEVisaByUserIds(String ids, String userIds) {
+        if (Func.isEmpty(ids) && ids == null) {
+            return R.fail("未获取到taskIds,操作失败!");
+        }
+        String ids2 = "";
+        if (Func.isEmpty(ids) && ids == null) {
+            ids2 = "'"+ids +"'";
+        } else {
+            String[] split = ids.split(",");
+            for (String id : split) {
+                ids2 += "'"+ id + "',";
+            }
+            ids2 = ids2.substring(0, ids2.length() - 1);
+        }
+
+        String sqlqu = "update u_information_query set status=2,e_visa_pdf_url='' where id in( " + ids + ") and is_deleted=0 ";
+        String sqlForTask = "update u_task set status=2 where form_data_id in( " + ids2 + ") and status in(1,2) and is_deleted=0 ";
+        String sqlForTaskPall = "UPDATE u_task_parallel a  set a.`status`=2 , a.e_visa_status=1 ,a.e_visa_content='电签成功' where a.process_instance_id in(select process_instance_id  from u_task b  where b.form_data_id in( " + ids2 + ") and b.status in(0,1,2) and b.is_deleted = 0)  and a.`status` in(0,1)";
+
+        String taskBtech = "insert into u_task_batch(id,task_parallel_id,json_data,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,nick_name,sign_format,sign_type)  " +
+                " SELECT a.id,a.process_instance_id,json_object('approvalFileList',json_array(),'approvalType',b.approval_type,'comment','','flag','OK','formDataId',b.form_data_id,'parallelProcessInstanceId',a.parallel_process_instance_id,'pass',true,'taskId',b.id) as  json_data,a.task_user,a.create_dept,a.create_time,a.update_user,a.update_time,1 as status,0 as is_deleted,a.task_user_name as nick_name ,1 as sign_format,1 as sign_type from u_task_parallel a,u_task b where b.`status` in(1,2) and a.`status` in(2)  and   a.process_instance_id=b.process_instance_id " +
+                " and b.form_data_id in( " + ids2 + ") and a.parallel_process_instance_id not in(SELECT JSON_EXTRACT(c.json_data, '$.parallelProcessInstanceId') from u_task_batch c)";
+
+        if(userIds!=null && userIds.length()>=1){
+            taskBtech += " and b.task_user in("+userIds+")";
+            sqlForTaskPall += " and a.task_user in("+userIds+")";
+        }
+        jdbcTemplate.execute(sqlqu);
+        jdbcTemplate.execute(sqlForTask);
+        jdbcTemplate.execute(sqlForTaskPall);
+        jdbcTemplate.execute(taskBtech);
+
+        return R.success("操作成功");
+    }
 }

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

@@ -45,25 +45,26 @@ public class ChekSignData {
     @Resource(name = "taskExecutor1")
     private ThreadPoolExecutor executor;
 
-  //  @Scheduled(cron = "0/10 * * * * ?")
+    @Scheduled(cron = "0/10 * * * * ?")
     public void SignInfo() {
         // 质检SQL
-        String sql = "SELECT a.id ,a.e_visa_pdf_url,b.process_instance_id,a.contract_id,a.project_id,c.remark_type from u_information_query a ,u_task b ,m_project_info c where b.id=1903019571036553216 and c.id=a.project_id  and a.`status` in(1,2) and a.is_deleted=0 and a.e_visa_pdf_url is not null  and b.form_data_id = a.id and b.`status` in(2) ";
+        String sql = "SELECT a.id ,a.e_visa_pdf_url,b.process_instance_id,a.contract_id,a.project_id,c.remark_type from u_information_query a ,u_task b ,m_project_info c where  c.id=a.project_id  and a.`status` in(1,2) and a.is_deleted=0 and a.e_visa_pdf_url is not null  and b.form_data_id = a.id and b.`status` in(1,2) and a.chek_status=1 LIMIT 30";
 
         List<ScrSignInfoVO> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ScrSignInfoVO.class));
         if (query != null && query.size() >= 1 ) {
             for (ScrSignInfoVO dataInfo : query) {
-                if (executor.getQueue().size()<=6 ) {
+                if (executor.getQueue().size()<=30 ) {
                     Long nodeId = dataInfo.getId();
-                    Boolean aBoolean = RedisTemplate.hasKey("sign-" + nodeId);
+                    Boolean aBoolean = RedisTemplate.hasKey("chek-" + nodeId);
 
                     if (!aBoolean) {
-                        RedisTemplate.opsForValue().set("sign-" + nodeId, "1",3600, TimeUnit.SECONDS);
+                        RedisTemplate.opsForValue().set("chek-" + nodeId, "1",3600, TimeUnit.SECONDS);
                         CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
                             try {
                                 /*===============执行批量任务===============*/
                                 scrDataService.sctTaskBatch(dataInfo);
                             } catch (Exception e) {
+                                RedisTemplate.delete("chek-" + nodeId);
                                 e.printStackTrace();
                             }
                         }, executor);

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

@@ -58,7 +58,7 @@ public class EVController {
     @Resource(name = "taskExecutor1")
     private ThreadPoolExecutor executor;
 
-    @Scheduled(cron = "0/10 * * * * ?")
+    //@Scheduled(cron = "0/10 * * * * ?")
     public void SignInfo() {
         //执行代码
 
@@ -74,8 +74,8 @@ public class EVController {
                 "sign_type as sigType ," +
                 "(select count(0) from u_task_parallel b INNER JOIN u_task c on b.process_instance_id = c.process_instance_id " +
                 "where c.id = JSON_UNQUOTE(JSON_EXTRACT(a.json_data, '$.taskId')) and b.is_deleted = 0 and (b.status = 1 or b.initiative = 1)) isSignature" +
-                " from u_task_batch a where is_deleted=0 GROUP BY JSON_EXTRACT(json_data, '$.formDataId'),sign_type ORDER BY sign_type DESC ";
-                //and JSON_UNQUOTE(JSON_EXTRACT(json_data,'$.taskId')) in(SELECT id from u_task where project_id =1792760669353865218 and is_deleted =0 and approval_type=1 )
+                " from u_task_batch a where is_deleted=0  GROUP BY JSON_EXTRACT(json_data, '$.formDataId'),sign_type ORDER BY sign_type DESC ";
+
         List<TaskSignInfoVO> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TaskSignInfoVO.class));
 
         if (query != null && query.size() >= 1) {

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

@@ -101,6 +101,7 @@ public class EVDataServiceImpl implements EVDataService {
                 //添加电签策略
                 List<SealStrategyVO> strategyListByAXQ = getStrategyListByAXQ(taskApp, ids);
 
+
                 ids = ids.replaceAll("\\✹", "");
                 if (strategyListByAXQ == null || Func.isEmpty(strategyListByAXQ) || strategyListByAXQ.size() == 0) {
                     ids = ids.replaceAll("✹", "");
@@ -121,7 +122,8 @@ public class EVDataServiceImpl implements EVDataService {
                     SignBackPdfInfo(taskApp);
                     return;
                 }
-
+                // 保存电签策略
+                addSignatureDataByAXQZ(strategyListByAXQ, taskApp.getFormDataId(),taskApp.getRemarkType());
                 //调用签字逻辑
                 signTaskBatchByAXQZ(strategyListByAXQ, taskApp);
                 if (taskApp.getSigState() != 1) {
@@ -135,6 +137,7 @@ public class EVDataServiceImpl implements EVDataService {
             } else if (taskApp.getRemarkType().equals("2") || taskApp.getRemarkType().equals("3")) { //东方中讯
                 //添加电签策略
                 List<Map<String, Object>> strategyListByDFZX = getStrategyListByDFZX(taskApp, ids);
+                addSignatureDataByDFZX(strategyListByDFZX,taskApp.getFormDataId(),taskApp.getRemarkType());
                 //调用签字逻辑
                 String s = signTaskBatchByDFZX(strategyListByDFZX, fileUrl, taskApp.getSigType(),taskApp.getRemarkType(),taskApp.getContractId());
                 if (s.contains("sucess")) {
@@ -537,9 +540,9 @@ public class EVDataServiceImpl implements EVDataService {
             for (int i = 0; i < strArray.length; i++) {
                 List<Map<String, Object>> maps2 = null;
                 if (dqIds.length() > 0) {
-                    String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + strArray[i] + "' and is_deleted=0  ) as sealId from m_textdict_info a where  a.type =2 and a.id in (" + dqIds + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + strArray[i] + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
+                    String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + strArray[i] + "' and is_deleted=0  ) as sealId,'1' as type,'"+strArray[i]+"' as userId from m_textdict_info a where  a.type =2 and a.id in (" + dqIds + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + strArray[i] + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
                     if (task.getSigType() == 2) {
-                        sqlinfo = "SELECT a.id as keyWord,a.pyzbx,a.pyzby,b.certificate_number as sealId from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + dqIds + ")";
+                        sqlinfo = "SELECT a.id as keyWord,a.pyzbx,a.pyzby,b.certificate_number as sealId,'2' as type,'"+strArray[i]+"' as userId from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + dqIds + ")";
                         System.out.println("东方中讯--签章--" + sqlinfo);
                     } else {
                         System.out.println("东方中讯--签字--" + sqlinfo);
@@ -569,7 +572,7 @@ public class EVDataServiceImpl implements EVDataService {
                     }
                 }
                 if (signIds.length() > 0 && task.getSigType() != 2) {
-                    String sql = "SELECT * from ( SELECT a.conf_id as keyWord,0.0 as pyzbx ,0.0 as pyzby,(SELECT acc_code from blade_user where id = " + strArray[i] + " and is_deleted=0  ) as sealId " +
+                    String sql = "SELECT * from ( SELECT a.conf_id as keyWord,0.0 as pyzbx ,0.0 as pyzby,(SELECT acc_code from blade_user where id = " + strArray[i] + " and is_deleted=0  ) as sealId,'1' as type " +
                             "from m_sign_config_relation a where a.type = 1 and a.is_deleted = 0 and a.conf_id in (" + signIds + ") " +
                             "and a.relation_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id= " + task.getContractId() + " and user_id= " + strArray[i] + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
                     List<Map<String, Object>> maps3 = jdbcTemplate.queryForList(sql);
@@ -592,6 +595,49 @@ public class EVDataServiceImpl implements EVDataService {
         return maps;
     }
 
+
+    //  添加电签策略 -- 保存流水信息
+    public void addSignatureDataByAXQZ(List<SealStrategyVO> strategyListByAXQ,String formDataId,String markType) {
+        System.out.println("www");
+        String deleteSql = "delete from m_sign_data where query_id = '" + formDataId + "' and user_id in( ";
+        String insertsql = "INSERT INTO m_sign_data (id, query_id, text_id, user_id, sign_time, type, img_url, sign_type) VALUES (?, ?, ?, ?, SYSDATE(), ?, ?, ?)";
+        List<Object[]> batchArgs = new ArrayList<>();
+        for (SealStrategyVO sealStrategyVO : strategyListByAXQ) {
+            long newPkId = SnowFlakeUtil.getId(); //主键Id
+            String type = "1";
+            if(sealStrategyVO.isCompanySeal()){
+                type = "2";
+            }
+            batchArgs.add(new Object[]{newPkId, formDataId, sealStrategyVO.getKeyword(), sealStrategyVO.getUserId(), type, sealStrategyVO.getImageUrl(), markType});
+            deleteSql+= sealStrategyVO.getUserId() +",";
+        }
+        // 添加更多数据...
+        jdbcTemplate.execute(deleteSql+"1=1)");
+        int[] updateCounts = jdbcTemplate.batchUpdate(insertsql, batchArgs);
+        System.out.println("123");
+    }
+
+    //  添加电签策略 -- 保存流水信息
+    public void addSignatureDataByDFZX(List<Map<String, Object>> strategyListByAXQ,String formDataId,String markType) {
+        System.out.println("www");
+        String deleteSql = "delete from m_sign_data where query_id = '" + formDataId + "' and user_id in( ";
+        String insertsql = "INSERT INTO m_sign_data (id, query_id, text_id, user_id, sign_time, type, img_url, sign_type) VALUES (?, ?, ?, ?, SYSDATE(), ?, ?, ?)";
+        List<Object[]> batchArgs = new ArrayList<>();
+        for (Map<String, Object> map : strategyListByAXQ) {
+            long newPkId = SnowFlakeUtil.getId(); //主键Id
+            String userId = map.get("userId")+"";
+            String type = map.get("type")+"";
+            batchArgs.add(new Object[]{newPkId, formDataId, map.get("keyWord"), userId, type, map.get("sealId"), markType});
+            deleteSql+=userId +",";
+         }
+        // 添加更多数据...
+        jdbcTemplate.execute(deleteSql+"1=1)");
+        int[] updateCounts = jdbcTemplate.batchUpdate(insertsql, batchArgs);
+        System.out.println("123");
+    }
+
+
+
     // 添加电签策略 -- 安心签
     public List<SealStrategyVO> getStrategyListByAXQ(TaskSignInfoVO task, String ids) {
         // 获取任务所有的人签字的信息
@@ -620,9 +666,9 @@ public class EVDataServiceImpl implements EVDataService {
                 String userId =strArray[i];
                 List<Map<String, Object>> maps2 = null;
                 if (dqIds.length() > 0) {
-                    String sqlinfo = "SELECT * from ( SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as signature_file_url, (SELECT wide from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as wide ,(SELECT high from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as high from m_textdict_info a where  a.type =2 and a.id in (" + dqIds + ") and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + userId + " and c.is_deleted=0 ) ) x where x.signature_file_url is not null ";
+                    String sqlinfo = "SELECT * from ( SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as signature_file_url, (SELECT wide from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as wide ,(SELECT high from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as high ,'"+userId+"' as userId from m_textdict_info a where  a.type =2 and a.id in (" + dqIds + ") and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + userId + " and c.is_deleted=0 ) ) x where x.signature_file_url is not null ";
                     if (task.getSigType() == 2) {
-                        sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,a.project_id,b.certificate_password,b.certificate_user_name,b.certificate_number ,b.wide,b.high from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + dqIds + ") ";
+                        sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,a.project_id,b.certificate_password,b.certificate_user_name,b.certificate_number ,b.wide,b.high,'321987456' as userId from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + dqIds + ") ";
                         System.out.println("安心签--签章--=" + sqlinfo);
                     } else {
                         System.out.println("安心签--签字--=" + sqlinfo);
@@ -697,6 +743,7 @@ public class EVDataServiceImpl implements EVDataService {
                             vo.setHeight(eVisaConfig.get("high") + "");
                             vo.setWidth(eVisaConfig.get("wide") + "");
                             vo.setProjectId(eVisaConfig.get("project_id") + "");
+                            vo.setUserId(eVisaConfig.get("userId") + "");
                         } else if (task.getSigType() == 2) {
                             vo.setSealCode(EVisaConstant.SIGN_SEAL_CODE + eVisaConfig.get("sfId"));
                             vo.setSealPassword(eVisaConfig.get("certificate_password") + "");
@@ -711,6 +758,7 @@ public class EVDataServiceImpl implements EVDataService {
                             vo.setHeight(eVisaConfig.get("high") + "");
                             vo.setWidth(eVisaConfig.get("wide") + "");
                             vo.setProjectId(eVisaConfig.get("project_id") + "");
+                            vo.setUserId(eVisaConfig.get("userId") + "");
                         }
                         sealStrategyVOS.add(vo);
                     }
@@ -817,7 +865,6 @@ public class EVDataServiceImpl implements EVDataService {
     public void signTaskBatchByAXQZ(List<SealStrategyVO> list, TaskSignInfoVO taskApp) {
 
         String pdfUrl = Func.notNull(taskApp.getLastFilePdfUrl()) ? taskApp.getLastFilePdfUrl() : taskApp.getSignPdfUrl();
-
         if (Func.isEmpty(pdfUrl) || list == null) {
             taskApp.setLastFilePdfUrl(pdfUrl);
         }

+ 211 - 21
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/ScrDataServiceImpl.java

@@ -7,12 +7,16 @@ import org.apache.pdfbox.pdmodel.common.PDRectangle;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget;
 import org.springblade.business.vo.ScrSignInfoVO;
+import org.springblade.business.vo.TaskSignInfoVO;
 import org.springblade.common.utils.CommonUtil;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.CollectionUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.evisa.service.ScrDataService;
 import org.springblade.evisa.utils.PdfAddimgUtil;
 import org.springblade.evisa.vo.SignKeyVO;
 import org.springblade.manager.vo.PDFIndexInfo;
+import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
 
@@ -25,7 +29,7 @@ import java.util.stream.Collectors;
 public class ScrDataServiceImpl implements ScrDataService {
 
     private final JdbcTemplate jdbcTemplate;
-
+    private final StringRedisTemplate RedisTemplate;
     // 主流程
     @Override
     public void sctTaskBatch(ScrSignInfoVO taskApp) throws Exception {
@@ -34,9 +38,6 @@ public class ScrDataServiceImpl implements ScrDataService {
     }
 
 
-
-
-
     /**
      * 电签检查
      */
@@ -55,16 +56,29 @@ public class ScrDataServiceImpl implements ScrDataService {
         List<String> positions = pdfSignIds.getEVisaConfigList();
         Map<String, String> dataMap = pdfSignIds.getDataMap();
 
-        List<String> sucess = new ArrayList<>();
+        List<String> sucessUser = new ArrayList<>();
+        List<String> sucessCompan = new ArrayList<>();
         String ids = String.join(",", positions);
-        List<Map<String, Object>> strategyListByDFZX = getStrategyListByDFZX(taskApp, ids);
+        ids = ids.replaceAll("✹", "");
+        String remarkType = taskApp.getRemarkType();
+        List<Map<String, Object>> strategyListByDFZX = new ArrayList<>();
+        if(remarkType.equals("1")){
+            strategyListByDFZX = getStrategyListByAXQ(taskApp, ids);
+        } else if (remarkType.equals("2") || remarkType.equals("3")) {
+            strategyListByDFZX = getStrategyListByDFZX(taskApp, ids);
+        }
+
         if(strategyListByDFZX==null || strategyListByDFZX.size()==0){
 
-            System.out.println("为获取到签字的关键字");
+            String sql2 = "UPDATE u_information_query set chek_status=10 where id='"+taskApp.getId()+"'";
+            jdbcTemplate.execute(sql2);
+
+            RedisTemplate.delete("chek-" + taskApp.getId());
+            System.out.println(taskApp.getProcessInstanceId()+"-"+"总共:" );
             return;
         }
 
- /*       positions = strategyListByDFZX.stream().map(map -> map.get("keyWord").toString()).collect(Collectors.toList());
+        positions = strategyListByDFZX.stream().map(map -> map.get("keyWord").toString()).collect(Collectors.toList());
         String keyWord = String.join(",", positions);
         List<PDFIndexInfo> pdfIndexInfo = PdfAddimgUtil.findKeywordPostions(pdfData, keyWord);
 
@@ -110,11 +124,27 @@ public class ScrDataServiceImpl implements ScrDataService {
 
                             List<Map<String, Object>> mapList = newMap.get(pkeyid);
                             String keyData = dataMap.get(pkeyid);
+                            String userId="";
+                            String type="";
                             if (mapList != null && mapList.size() >= 0) {
                                 Map<String, Object> map = mapList.get(0);
                                 Float pyzbx = Func.toFloat(map.get("pyzbx"));
                                 Float pyzby = Func.toFloat(map.get("pyzby"));
-                                if(taskApp.getRemarkType().equals("2")){ //东方中讯
+                                 type = map.get("type")+"";
+                                userId = map.get("userId")+"";
+                                if(taskApp.getRemarkType().equals("3")){ //东方中讯
+                                    if(type.equals("1")){ //个人签字
+                                        keyw = keyw + pyzbx - 20;
+                                        keyh = keyh + pyzby ;
+
+                                    }else if(type.equals("2")){
+                                        keyw = keyw + pyzbx -21;
+                                        keyh = keyh + pyzby-16;
+                                        if(keyData.indexOf("||")>0){
+                                            keyw += 10;
+                                        }
+                                    }
+                                }else if(taskApp.getRemarkType().equals("2")){ //东方中讯
                                     if(imgH>=100){ //个人签字
                                         keyw = keyw + pyzbx - 20;
                                         keyh = keyh + pyzby - 15;
@@ -130,8 +160,14 @@ public class ScrDataServiceImpl implements ScrDataService {
                                     keyh = keyh + pyzby;
                                 }
                             }
+                            System.out.println("type="+type+" imgX:" + "keyid="+pkeyid+"imgX:" + imgX + " keyw:" + keyw + " imgY:" + imgY + " keyh:" + keyh+"-imgH-"+imgH);
                             if (Math.abs(imgX - keyw) <= threshold && Math.abs(imgY - keyh) <= threshold) {
-                                sucess.add(pkeyid);
+                                if(type.equals("1")){ //个人
+                                    sucessUser.add(pkeyid);
+                                }
+                                if(type.equals("2")){ //企业章
+                                    sucessCompan.add(pkeyid);
+                                }
                                 System.out.println("keyid="+pkeyid+"imgX:" + imgX + " keyw:" + keyw + " imgY:" + imgY + " keyh:" + keyh+"-imgH-"+imgH);
                                 break;
                             }
@@ -140,32 +176,186 @@ public class ScrDataServiceImpl implements ScrDataService {
                 }
             }
         }
-        Set<String> differentElements = new HashSet<>(positions);
-        // 使用retainAll方法来移除两个集合中相同的元素,留下不同的元素
-        differentElements.removeAll(sucess);
 
-        System.out.println(taskApp.getId() +"-"+"总共:" + positions.size() + "-剩下-" + differentElements.size());*/
+        boolean isSign = false;
+        //判断章是否签完
+        List<String> companList = strategyListByDFZX.stream().filter(item -> item.get("type").equals("2")).map(map -> map.get("keyWord").toString()).collect(Collectors.toList());
+        if(companList!=null && companList.size()>0){
+            Set<String> differentElements = new HashSet<>(companList);
+            differentElements.removeAll(sucessCompan);
+            if(differentElements==null || differentElements.size()==0){
+                isSign = true ;
+            }
+            System.out.println(taskApp.getId() +"-"+"章总共:" + companList.size() + "-剩下-" + differentElements.size());
+        }else{
+            isSign = true ;
+        }
+
+
+        //判断个人是否签完
+        List<String> userList = strategyListByDFZX.stream().filter(item -> item.get("type").equals("1")).map(map -> map.get("keyWord").toString()).collect(Collectors.toList());
+        Map<String, String> dataUserMap = new HashMap<>(dataMap);
+
+        if(sucessUser!=null && sucessUser.size()>0 && isSign){
+            for(String user:sucessUser){
+                for(String mapkey:dataMap.keySet()){
+                    String mapval = dataMap.get(mapkey);
+                    if(mapval.contains(user)){
+                        dataUserMap.remove(mapkey) ;
+                    }
+                }
+            }
+            if(dataUserMap.keySet()==null || dataUserMap.keySet().size()==0){
+                isSign = true ;
+            }else{
+                isSign = false ;
+            }
+            System.out.println(taskApp.getId() +"-"+"个人总共:" + sucessUser.size() + "-剩下-" +dataUserMap.keySet().size());
+        }
+
+
+        if( isSign){
+            String sql2 = "UPDATE u_information_query set chek_status=2 where id='"+taskApp.getId()+"'";
+            jdbcTemplate.execute(sql2);
+        }else{
+            String sql2 = "UPDATE u_information_query set chek_status=3 where id='"+taskApp.getId()+"'";
+            jdbcTemplate.execute(sql2);
+        }
+        RedisTemplate.delete("chek-" + taskApp.getId());
+      //  System.out.println(taskApp.getProcessInstanceId()+"-"+"总共:" );
+      //  System.out.println(taskApp.getId() +"-"+"总共:" + positions.size() + "-剩下-" + differentElements.size());
     }
 
 
+
+    // 添加电签策略 -- 安心签
+    public List<Map<String, Object>> getStrategyListByAXQ(ScrSignInfoVO task, String ids) {
+        String sql = "select task_user,count(1) as total,initiative,status,(select  count(1) from u_task_parallel where process_instance_id = '" + task.getProcessInstanceId() + "' and initiative=2 and status=2) as pCount from u_task_parallel where process_instance_id = '" + task.getProcessInstanceId() + "'";
+        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
+        ArrayList<String> strArray = new ArrayList();
+        int total = 0;
+        int pCount = 0;
+        if (mapList != null && mapList.size() >= 1) {
+            for (int i = 0; i < mapList.size(); i++) {
+                Map<String, Object> map = mapList.get(i);
+                if(i==0){
+                    total = Func.toInt(map.get("total"));
+                    pCount = Func.toInt(map.get("pCount"));
+                }
+                if(map.get("initiative").equals("2") && map.get("status").equals("2")){
+                    strArray.add(map.get("task_user").toString());
+                }
+            }
+        }
+
+
+        List<Map<String, Object>> maps = new ArrayList<>();
+        String[] split = ids.split(",");
+        StringBuilder dqIds = new StringBuilder();
+        StringBuilder signIds = new StringBuilder();
+        for (String id : split) {
+            if (id != null && id.contains("✹")) {
+                signIds.append(id.substring(1)).append( ",");
+            } else {
+                dqIds.append(id).append( ",");
+            }
+        }
+        if (dqIds.length()>0) {
+            dqIds.deleteCharAt(dqIds.length()-1);
+        }
+        if (signIds.length()>0) {
+            signIds.deleteCharAt(signIds.length()-1);
+        }
+        if(strArray!=null && strArray.size()>0) {
+            for (int i = 0; i < strArray.size(); i++) {
+                List<Map<String, Object>> maps2 = null;
+                if (dqIds.length() > 0) {
+                    String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + strArray.get(i) + "' and is_deleted=0  ) as sealId from m_textdict_info a where  a.type =2 and a.id in (" + dqIds + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + strArray.get(i) + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
+                    if (total==pCount) {
+                        sqlinfo = "SELECT a.id as keyWord,a.pyzbx,a.pyzby,b.certificate_number as sealId from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + dqIds + ")";
+                        System.out.println("东方中讯--签章--" + sqlinfo);
+                    } else {
+                        System.out.println("东方中讯--签字--" + sqlinfo);
+                    }
+                    maps2 = jdbcTemplate.queryForList(sqlinfo);
+                    maps2 = jdbcTemplate.queryForList(sqlinfo);
+                }
+                if(CollectionUtil.isNotEmpty(maps2)) {
+                    Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
+                            .collect(Collectors.groupingBy(hada -> (Func.toStr(hada.get("keyWord")))));
+                    for (String keyId : peopleByAge.keySet()) {
+                        int exId = 0;
+                        List<Map<String, Object>> keyList = peopleByAge.get(keyId);
+                        if (keyList != null && keyList.size() == 1) {
+                            maps.addAll(keyList);
+                            exId = 1;
+                        } else if (keyList != null && keyList.size() >= 2) {
+                            for (Map<String, Object> datax : keyList) {
+                                if ((datax.get("project_id") + "").equals(task.getProjectId())) {
+                                    maps.add(datax);
+                                    exId = 1;
+                                }
+                            }
+                        }
+                        if (exId == 0) {
+                            maps.add(keyList.get(0));
+                        }
+                    }
+                }
+             /*   if (signIds.length() > 0 && task.getSigType() != 2) {
+                    String sql = "SELECT * from ( SELECT a.conf_id as keyWord,0.0 as pyzbx ,0.0 as pyzby,(SELECT acc_code from blade_user where id = " + strArray[i] + " and is_deleted=0  ) as sealId " +
+                            "from m_sign_config_relation a where a.type = 1 and a.is_deleted = 0 and a.conf_id in (" + signIds + ") " +
+                            "and a.relation_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id= " + task.getContractId() + " and user_id= " + strArray[i] + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
+                    List<Map<String, Object>> maps3 = jdbcTemplate.queryForList(sql);
+                    System.out.println("东方中讯--签字--key =" + sql);
+                    if (!maps3.isEmpty()) {
+                        Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
+                                .collect(Collectors.groupingBy(hada -> (Func.toStr(hada.get("keyWord")))));
+                        for (String keyId : peopleByAge.keySet()) {
+                            List<Map<String, Object>> keyList = peopleByAge.get(keyId);
+                            if (keyList != null && !keyList.isEmpty()) {
+                                Map<String, Object> map = keyList.get(0);
+                                map.put("keyWord", "✹" + map.get("keyWord"));
+                                maps.add(map);
+                            }
+                        }
+                    }
+                }*/
+            }
+        }
+        return maps;
+    }
+
     // 添加电签策略 -- 东方中讯
     public List<Map<String, Object>> getStrategyListByDFZX(ScrSignInfoVO taskApp, String ids) {
         List<Map<String, Object>> maps = new ArrayList<>();
         List<Map<String, Object>> maps2 = new ArrayList<>();
-        String sql = "select * from u_task_parallel where process_instance_id = '" + taskApp.getProcessInstanceId() + "' and initiative=2 and status=2";
+     //   String sql = "select * from u_task_parallel where process_instance_id = '" + taskApp.getProcessInstanceId() + "' and initiative=2 and status=2";
+
+        String sql = "select task_user,initiative,status,(select  count(1) from u_task_parallel where process_instance_id = '" + taskApp.getProcessInstanceId() + "' and initiative=2 and status=2) as pCount from u_task_parallel where process_instance_id = '" + taskApp.getProcessInstanceId() + "'";
         List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
+
+        int total = mapList.size();
+        int pCount = 0;
+
         if (mapList != null && mapList.size() > 0) {
             for (Map<String, Object> task : mapList) {
                 String taskUserId = Func.toStr(task.get("task_user"));
-                String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + taskUserId + "' 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=" + taskApp.getContractId() + " and user_id=" + taskUserId + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
-                System.out.println("扫描-签字-sql=" + sqlinfo);
-                List<Map<String, Object>> maps3 = jdbcTemplate.queryForList(sqlinfo);
-                maps2.addAll(maps3);
+                String initiative = Func.toStr(task.get("initiative"));
+                String status = Func.toStr(task.get("status"));
+                if(initiative.equals("2") && status.equals("2")) {
+                    String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + taskUserId + "' and is_deleted=0  ) as sealId,'" + taskUserId + "' as userId,'1' as type from m_textdict_info a where  a.type =2 and a.id in (" + ids + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + taskApp.getContractId() + " and user_id=" + taskUserId + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
+                    System.out.println("扫描-签字-sql=" + sqlinfo);
+                    List<Map<String, Object>> maps3 = jdbcTemplate.queryForList(sqlinfo);
+                    maps2.addAll(maps3);
+                }
             }
+            pCount = Func.toInt(mapList.get(0).get("pCount"));
+
         }
         // 添加章
-        if (taskApp.getStatus().equals("2")) {
-            String sqlinfo = "SELECT a.id as keyWord,a.pyzbx,a.pyzby,b.certificate_number as sealId from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + taskApp.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
+        if (total==pCount) {
+            String sqlinfo = "SELECT a.id as keyWord,a.pyzbx,a.pyzby,b.certificate_number as sealId,'2' as type from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + taskApp.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
             System.out.println("扫描-签章-sql=" + sqlinfo);
             List<Map<String, Object>> maps3 = jdbcTemplate.queryForList(sqlinfo);
             if (mapList != null && mapList.size() > 0) {

+ 75 - 11
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PdfAddimgUtil.java

@@ -8,6 +8,7 @@ import com.itextpdf.text.pdf.*;
 import com.itextpdf.text.pdf.parser.*;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.text.PDFTextStripper;
+import org.springblade.business.vo.TaskSignInfoVO;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.core.tool.utils.Func;
@@ -21,6 +22,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 public class PdfAddimgUtil {
@@ -392,26 +395,26 @@ public class PdfAddimgUtil {
     }
 
 
-    public static SignKeyVO getPdfSignIds(String pdfUrl) {
-        SignKeyVO signKeyVO = new SignKeyVO();
+    public static SignKeyVO  getPdfSignIds(String pdfUrl) {
         List<String> eVisaConfigList = new ArrayList<>();
         Map<String,String> dataMap = new HashMap<>();
-        InputStream inputStream;
+        SignKeyVO signKeyVO = new SignKeyVO();
         try  {
-            if(pdfUrl.indexOf("http")>=0){
-                inputStream = CommonUtil.getOSSInputStream(pdfUrl);
-            }else{
-                inputStream = new FileInputStream(new File(pdfUrl));
-            }
+            InputStream inputStream = CommonUtil.getOSSInputStream(pdfUrl);
             PDDocument document = PDDocument.load(inputStream);
             PDFTextStripper stripper = new PDFTextStripper();
             String text = stripper.getText(document);
             String[] lines = text.split("[ \\n]+");
+
+            Pattern pattern = Pattern.compile("(\\d{4}[年-]\\d{2}[月-]\\d{2}日?)");
+
             for(int k=0;k<lines.length;k++){
                 String textStr = lines[k];
-                if(textStr.indexOf("*")>=0){
+                int index = textStr.indexOf("*");
+                if(index>=0 && textStr.lastIndexOf("*")+1 < textStr.length() && textStr.charAt(index+1) != '✹'){
                     textStr = textStr.substring(textStr.lastIndexOf("*")+1,textStr.length());
                 }
+
                 String[] textS = Func.toStrArray("\\|\\|",textStr);
                 for(String txt : textS){
                     for (int i = 0; i < txt.length(); i++) {
@@ -419,21 +422,82 @@ public class PdfAddimgUtil {
                             txt=txt.substring(0,i);
                         }
                     }
-                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
+                        eVisaConfigList.add(txt);
+                        dataMap.put(txt,textStr);
+                    }
+                }
+
+                textS = Func.toStrArray("\\*",textStr);
+                for(String txt : textS){
+                    for (int i = 0; i < txt.length(); i++) {
+                        if (!Character.isDigit(txt.charAt(i))) {
+                            txt=txt.substring(0,i);
+                        }
+                    }
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         eVisaConfigList.add(txt);
                         dataMap.put(txt,textStr);
                     }
                 }
+
+                // 特殊处理
+                if(textStr.indexOf("1")>=0){
+                    String txt = textStr.substring(textStr.indexOf("1"));
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
+                        System.out.println(txt);
+                        eVisaConfigList.add(txt);
+                        dataMap.put(txt,textStr);
+                    }
+                }
+                if (textStr.contains("✹") && textStr.indexOf("✹") + 1 < textStr.length()) {
+                    String textString = textStr.substring(textStr.indexOf("✹") + 1);
+                    if (textString.contains("||✹")) {
+                        String[] textS1 = Func.toStrArray("\\|\\|✹",textString);
+                        for(String txt : textS1){
+                            for (int i = 0; i < txt.length(); i++) {
+                                if (!Character.isDigit(txt.charAt(i))) {
+                                    txt=txt.substring(0,i);
+                                }
+                            }
+                            if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
+                                eVisaConfigList.add("✹" + txt);
+                            }
+                        }
+                    }
+                    if (textString.contains("*✹")) {
+                        String[] textS1 = Func.toStrArray("\\*✹",textString);
+                        for(String txt : textS1){
+                            for (int i = 0; i < txt.length(); i++) {
+                                if (!Character.isDigit(txt.charAt(i))) {
+                                    txt=txt.substring(0,i);
+                                }
+                            }
+                            if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
+                                eVisaConfigList.add("✹" + txt);
+                            }
+                        }
+                    }
+                    if(textString.startsWith("1")){
+                        if (textString.length() >= 15 && Func.isNumeric(textString)) {
+                            eVisaConfigList.add("✹" + textString);
+                        }
+                    }
+                }
             }
 
+
             List<String> unique = eVisaConfigList.stream().distinct().collect(Collectors.toList());
             document.close();
+
             signKeyVO.setEVisaConfigList(unique);
             signKeyVO.setDataMap(dataMap);
             return signKeyVO;
         }catch (Exception e){
             e.printStackTrace();
-            return null;
+            System.out.println("pdf大小为0");
+            return signKeyVO;
         }
     }
+
 }

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

@@ -28,6 +28,7 @@
         <result column="project_subgrade" property="projectSubgrade"/>
         <result column="project_remark" property="projectRemark"/>
         <result column="state" property="state"/>
+        <result column="ms_time" property="msTime"/>
         <result column="is_open_sign" property="isOpenSign"/>
         <result column="reference_wbs_template_id" property="referenceWbsTemplateId"/>
         <result column="reference_wbs_template_type" property="referenceWbsTemplateType"/>

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

@@ -117,7 +117,7 @@ public class FormulaDaoImpl implements IFormulaDao {
     @Override
     public Function<Long, MeterApproveOpinion> getApproveOpinionFc() {
         return  periodId-> {
-            List<MeterApproveOpinion> beans = this.jdbcTemplate.query("select b.* from u_task  a join s_meter_approve_opinion b on a.id=b.task_id where  a.form_data_id="+periodId, new BeanPropertyRowMapper<>(MeterApproveOpinion.class));
+            List<MeterApproveOpinion> beans = this.jdbcTemplate.query("select b.* from u_task  a join s_meter_approve_opinion b on a.id=b.task_id where  b.is_deleted=0 and a.is_deleted=0 and a.`status` in(0,1,2) and  a.form_data_id="+periodId, new BeanPropertyRowMapper<>(MeterApproveOpinion.class));
             if(beans.size()>0){
                 return beans.get(0);
             }

+ 7 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml

@@ -145,6 +145,8 @@
             query.pdf_url,
             query.e_visa_pdf_url,
             query.task_id,
+            query.chek_status,
+            query.check_desc,
             query.sj_record_ids
         FROM
             (
@@ -165,6 +167,8 @@
                 iq.pdf_url,
                 iq.e_visa_pdf_url,
                 iq.wbs_id,
+                iq.chek_status,
+                iq.check_desc,
                 t.id AS task_id,
                 iq.sj_record_ids
             FROM
@@ -216,6 +220,9 @@
                 <if test="query.firstTitle == null or query.firstTitle == ''">
                     AND iq.type != 3
                 </if>
+                <if test="query.chekStatus != null and query.chekStatus != ''">
+                    AND iq.chek_status = #{query.chekStatus}
+                </if>
                 <if test="query.wbsIds != null">
                     AND iq.wbs_id IN
                     <foreach collection="query.wbsIds" item="wbsIdc" open="(" separator="," close=")">

+ 5 - 1
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@@ -1938,6 +1938,10 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
             vo.setTaskStatus(vo.getStatus().toString());
         }
 
+        if (vo.getChekStatus() != null) {
+            vo.setChekStatus(vo.getChekStatus());
+        }
+
         long startTime = System.currentTimeMillis();
         List<InformationQuery> result = new ArrayList<>();
         List<List<String>> partition = Lists.partition(vo.getWbsIds(), 500);
@@ -2225,7 +2229,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
                     eVisaFailedInfo = taskPa.getEVisaContent();
                 }
             }
-            vo.setWaitingUserList(taskPa.getTaskUserName(), taskPa.getEVisaStatus());
+            vo.setWaitingUserList(taskPa.getTaskUserName(), taskPa.getEVisaStatus(), taskPa.getTaskUser());
             vo.setEVisaFailedInfo(eVisaFailedInfo);
         }
     }