ソースを参照

Merge remote-tracking branch 'origin/master'

chenr 2 ヶ月 前
コミット
2e329d13de
24 ファイル変更749 行追加93 行削除
  1. 7 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TrialSelfInspectionRecordClient.java
  2. 1 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsParam.java
  3. 7 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/PDFIndexInfo.java
  4. 9 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TrialSelfInspectionRecordClientImpl.java
  5. 0 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java
  6. 193 10
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java
  7. 3 7
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java
  8. 2 2
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  9. 21 27
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  10. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsParamController.java
  11. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java
  12. 0 17
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java
  13. 0 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ProjectAssignmentUserClientImpl.java
  14. 5 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreePrivateClientImpl.java
  15. 8 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java
  16. 4 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml
  17. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java
  18. 40 9
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  19. 0 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaDaoImpl.java
  20. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java
  21. 22 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/PdfAddimgUtil.java
  22. 5 0
      blade-service/blade-meter/pom.xml
  23. 32 2
      blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java
  24. 386 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/utils/PdfAddimgUtil.java

+ 7 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TrialSelfInspectionRecordClient.java

@@ -1,10 +1,14 @@
 package org.springblade.business.feign;
 
+import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.common.constant.BusinessConstant;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import java.util.HashMap;
+
 @FeignClient(value = BusinessConstant.APPLICATION_WEATHER_NAME)
 public interface TrialSelfInspectionRecordClient {
 
@@ -15,4 +19,7 @@ public interface TrialSelfInspectionRecordClient {
 
     @PostMapping(API_PREFIX + "/updateURL")
     void updateURL(@RequestParam String url, @RequestParam String pKeyId);
+
+    @PostMapping(API_PREFIX + "/previewGeneratedReportOrRecordNum")
+    HashMap<String,String> previewGeneratedReportOrRecordNum(@RequestBody TrialSelfInspectionRecordDTO dto);
 }

+ 1 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsParam.java

@@ -20,6 +20,7 @@ public class WbsParam extends BaseEntity {
     private String v;
     private String remark;
     private Integer type;
+    private Integer sort;
 
     /**
      * WBS树节点Id

+ 7 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/PDFIndexInfo.java

@@ -3,6 +3,8 @@ package org.springblade.manager.vo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class PDFIndexInfo {
 
@@ -10,4 +12,9 @@ public class PDFIndexInfo {
     String pkeyid;
     @ApiModelProperty(value = "pdf坐标位置")
     float[] dataInfo;
+
+    @ApiModelProperty(value = "原始坐标集合")
+    List<float[]> listData;
+
+
 }

+ 9 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TrialSelfInspectionRecordClientImpl.java

@@ -2,11 +2,14 @@ package org.springblade.business.feignClient;
 
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import lombok.AllArgsConstructor;
+import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.feign.TrialSelfInspectionRecordClient;
 import org.springblade.business.service.impl.TrialSelfInspectionRecordServiceImpl;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.HashMap;
+
 
 @RestController
 @AllArgsConstructor
@@ -14,6 +17,7 @@ public class TrialSelfInspectionRecordClientImpl implements TrialSelfInspectionR
 
     private TrialSelfInspectionRecordServiceImpl inspectionRecordService;
 
+
     @Override
     public void updateURL(String url, String pKeyId) {
         LambdaUpdateWrapper<TrialSelfInspectionRecord> updateWrapper = new LambdaUpdateWrapper<>();
@@ -21,4 +25,9 @@ public class TrialSelfInspectionRecordClientImpl implements TrialSelfInspectionR
         updateWrapper.eq(TrialSelfInspectionRecord::getId, pKeyId);
         inspectionRecordService.update(null, updateWrapper);
     }
+
+    @Override
+    public HashMap<String, String> previewGeneratedReportOrRecordNum(TrialSelfInspectionRecordDTO dto) {
+        return inspectionRecordService.buildNumberView(dto);
+    }
 }

+ 0 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java

@@ -45,5 +45,4 @@ public interface ITrialSelfInspectionRecordService extends BaseService<TrialSelf
 
 
     R getSamplePdfUrl(String id,String contrctId);
-
 }

+ 193 - 10
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -992,7 +992,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             //如果传递了编号就修改对应记录的值 以第一张表的数据为准
             this.updateRecordNoOrReportNo(obj, dto);
             //------编辑时记录表编号或报告单编号为Null的重新生成------
-            if(this.judgingParameters(dto)){
+            if(!this.judgingParameters(dto)){
                 this.reBuildNumber(obj, dto);
             }
 
@@ -1301,7 +1301,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                 if (recordNos.size() == 0 || ObjectUtil.isEmpty(recordNos)) {
                     maxRecordNo = "0001";
                 } else {
-                    List<String> numberRecordNos = new ArrayList<>();
+                   /* List<String> numberRecordNos = new ArrayList<>();
                     for (String recordNo : recordNos) {
                         String number = recordNo.split("-")[recordNo.split("-").length - 1];
                         numberRecordNos.add(number);
@@ -1311,8 +1311,11 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                         maxRecordNo = spUtils.buildSerial(maxRecordNo1, 4);
                     } else {
                         throw new ServiceException("当前编号已达到最大值9999,操作失败");
-                    }
+                    }*/
+
+                    maxRecordNo = recordNos.size()+"";
                 }
+
             }
 
             String maxReportNo = "";
@@ -1322,7 +1325,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                 if (reportNos.size() == 0 || ObjectUtil.isEmpty(reportNos)) {
                     maxReportNo = "0001";
                 } else {
-                    List<String> numberReportNo = new ArrayList<>();
+                    /*List<String> numberReportNo = new ArrayList<>();
                     for (String reportNo : reportNos) {
                         String number = reportNo.split("-")[reportNo.split("-").length - 1];
                         numberReportNo.add(number);
@@ -1332,7 +1335,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                         maxReportNo = spUtils.buildSerial(maxReportNo1, 4);
                     } else {
                         throw new ServiceException("当前编号已达到最大值9999,操作失败");
-                    }
+                    }*/
+                    maxReportNo = reportNos.size()+"";
+
                 }
             }
 
@@ -1373,9 +1378,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                 if (recordNos.size() == 0 || ObjectUtil.isEmpty(recordNos)) {
                     maxRecordNo = "0001";
                 } else {
-                    List<String> numberRecordNos = new ArrayList<>();
+                    /*List<String> numberRecordNos = new ArrayList<>();
                     for (String recordNo : recordNos) {
-                        String number = recordNo.split("-")[recordNo.split("-").length - 1];
+                        String number = (recordNo.split("-")[recordNo.split("-").length - 1]).replaceAll("]","");
                         numberRecordNos.add(number);
                     }
                     int maxRecordNo1 = Integer.parseInt(Collections.max(numberRecordNos)) + 1;
@@ -1383,7 +1388,8 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                         maxRecordNo = spUtils.buildSerial(maxRecordNo1, 4);
                     } else {
                         throw new ServiceException("当前编号已达到最大值9999,操作失败");
-                    }
+                    }*/
+                    maxRecordNo = recordNos.size()+"";
                 }
 
                 WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
@@ -1412,7 +1418,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                 if (reportNos.size() == 0 || ObjectUtil.isEmpty(reportNos)) {
                     maxReportNo = "0001";
                 } else {
-                    List<String> numberReportNo = new ArrayList<>();
+                   /* List<String> numberReportNo = new ArrayList<>();
                     for (String reportNo : reportNos) {
                         String number = reportNo.split("-")[reportNo.split("-").length - 1];
                         numberReportNo.add(number);
@@ -1422,7 +1428,8 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                         maxReportNo = spUtils.buildSerial(maxReportNo1, 4);
                     } else {
                         throw new ServiceException("当前编号已达到最大值9999,操作失败");
-                    }
+                    }*/
+                    maxReportNo = reportNos.size()+"";
                 }
 
                 WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
@@ -1442,6 +1449,182 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             }
         }
     }
+    //提前构建记录或者报告编号 供用户保存前提交时使用(新增保存前显示系统引用的记录编号或者报告编号)
+    public HashMap<String,String> buildNumberView(TrialSelfInspectionRecordDTO dto) {
+        StringSPUtils spUtils = new StringSPUtils();
+        List<TrialSelfInspectionRecord> result = baseMapper.selectAll(dto.getNodeId(), dto.getContractId(), dto.getType());
+        List<TrialSelfInspectionRecord> trialSelfInspectionRecords = result.stream().filter(Objects::nonNull).collect(Collectors.toList());
+
+        //两种类型同时生成
+        if (dto.getTableType().contains("1,2") || dto.getTableType().contains("2,1") || dto.getTableType().contains("9,10") || dto.getTableType().contains("10,9")) {
+            String maxRecordNo = "";
+            if (StringUtils.isEmpty(dto.getRecordNo())) {
+                //获取记录表最大编号
+                List<String> recordNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getRecordNo).filter(ObjectUtils::isNotEmpty).collect(Collectors.toList());
+                if (recordNos.size() == 0 || ObjectUtil.isEmpty(recordNos)) {
+                    maxRecordNo = "0001";
+                } else {
+                   /* List<String> numberRecordNos = new ArrayList<>();
+                    for (String recordNo : recordNos) {
+                        String number = recordNo.split("-")[recordNo.split("-").length - 1];
+                        numberRecordNos.add(number);
+                    }
+                    int maxRecordNo1 = Integer.parseInt(Collections.max(numberRecordNos)) + 1;
+                    if (maxRecordNo1 < 9999 && maxRecordNo1 > 0) {
+                        maxRecordNo = spUtils.buildSerial(maxRecordNo1, 4);
+                    } else {
+                        throw new ServiceException("当前编号已达到最大值9999,操作失败");
+                    }*/
+
+                    maxRecordNo = recordNos.size()+"";
+                }
+
+            }
+
+            String maxReportNo = "";
+            if (StringUtils.isEmpty(dto.getReportNo())) {
+                //获取报告单最大编号
+                List<String> reportNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getReportNo).filter(ObjectUtils::isNotEmpty).collect(Collectors.toList());
+                if (reportNos.size() == 0 || ObjectUtil.isEmpty(reportNos)) {
+                    maxReportNo = "0001";
+                } else {
+                    /*List<String> numberReportNo = new ArrayList<>();
+                    for (String reportNo : reportNos) {
+                        String number = reportNo.split("-")[reportNo.split("-").length - 1];
+                        numberReportNo.add(number);
+                    }
+                    int maxReportNo1 = Integer.parseInt(Collections.max(numberReportNo)) + 1;
+                    if (maxReportNo1 < 9999 && maxReportNo1 > 0) {
+                        maxReportNo = spUtils.buildSerial(maxReportNo1, 4);
+                    } else {
+                        throw new ServiceException("当前编号已达到最大值9999,操作失败");
+                    }*/
+                    maxReportNo = reportNos.size()+"";
+
+                }
+            }
+
+            WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
+            ContractInfo contract = contractClient.getContractById(dto.getContractId());
+            int year = LocalDateTimeUtil.now().getYear();
+            if (wbsTreePrivate == null || contract == null) {
+                throw new ServiceException("未找到当前项目合同段的节点信息,操作失败!");
+            } else {
+                //记录表
+                if (StringUtils.isNotEmpty(maxRecordNo)) {
+                    String str1 = "JL" +
+                            "-" + contract.getContractNumber() +
+                            "-" + year +
+                            "-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
+                            "-" + maxRecordNo;
+                    HashMap<String, String> stringStringHashMap = new HashMap<>();
+                    stringStringHashMap.put("type","记录表");
+                    stringStringHashMap.put("valueStr",str1);
+                    return stringStringHashMap;
+                }
+
+                //报告单
+                if (StringUtils.isNotEmpty(maxReportNo)) {
+                    String str2 = "BG" +
+                            "-" + contract.getContractNumber() +
+                            "-" + year +
+                            "-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
+                            "-" + maxReportNo;
+                    HashMap<String, String> stringStringHashMap = new HashMap<>();
+                    stringStringHashMap.put("type","报告单");
+                    stringStringHashMap.put("valueStr",str2);
+                    return stringStringHashMap;
+                }
+            }
+        }
+
+        //记录表
+        else if (("1").equals(dto.getTableType()) || ("9").equals(dto.getTableType())) {
+            if (StringUtils.isEmpty(dto.getRecordNo())) {
+                //获取记录表最大编号
+                List<String> recordNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getRecordNo).filter(ObjectUtils::isNotEmpty).collect(Collectors.toList());
+                String maxRecordNo;
+                if (recordNos.size() == 0 || ObjectUtil.isEmpty(recordNos)) {
+                    maxRecordNo = "0001";
+                } else {
+                    /*List<String> numberRecordNos = new ArrayList<>();
+                    for (String recordNo : recordNos) {
+                        String number = (recordNo.split("-")[recordNo.split("-").length - 1]).replaceAll("]","");
+                        numberRecordNos.add(number);
+                    }
+                    int maxRecordNo1 = Integer.parseInt(Collections.max(numberRecordNos)) + 1;
+                    if (maxRecordNo1 < 9999 && maxRecordNo1 > 0) {
+                        maxRecordNo = spUtils.buildSerial(maxRecordNo1, 4);
+                    } else {
+                        throw new ServiceException("当前编号已达到最大值9999,操作失败");
+                    }*/
+                    maxRecordNo = recordNos.size()+"";
+                }
+
+                WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
+                ContractInfo contract = contractClient.getContractById(dto.getContractId());
+                int year = LocalDateTimeUtil.now().getYear();
+                if (wbsTreePrivate == null || contract == null) {
+                    throw new ServiceException("未找到当前项目合同段的节点信息,操作失败!");
+                } else {
+                    //记录表
+                    String str1 = "JL" +
+                            "-" + contract.getContractNumber() +
+                            "-" + year +
+                            "-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
+                            "-" + maxRecordNo;
+                    HashMap<String, String> stringStringHashMap = new HashMap<>();
+                    stringStringHashMap.put("type","记录表");
+                    stringStringHashMap.put("valueStr",str1);
+                    return stringStringHashMap;
+                }
+            }
+        }
+
+        //报告单
+        else if (("2").equals(dto.getTableType()) || ("10").equals(dto.getTableType())) {
+            if (StringUtils.isEmpty(dto.getReportNo())) {
+                //获取报告单最大编号
+                List<String> reportNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getReportNo).filter(ObjectUtils::isNotEmpty).collect(Collectors.toList());
+                String maxReportNo;
+                if (reportNos.size() == 0 || ObjectUtil.isEmpty(reportNos)) {
+                    maxReportNo = "0001";
+                } else {
+                   /* List<String> numberReportNo = new ArrayList<>();
+                    for (String reportNo : reportNos) {
+                        String number = reportNo.split("-")[reportNo.split("-").length - 1];
+                        numberReportNo.add(number);
+                    }
+                    int maxReportNo1 = Integer.parseInt(Collections.max(numberReportNo)) + 1;
+                    if (maxReportNo1 < 9999 && maxReportNo1 > 0) {
+                        maxReportNo = spUtils.buildSerial(maxReportNo1, 4);
+                    } else {
+                        throw new ServiceException("当前编号已达到最大值9999,操作失败");
+                    }*/
+                    maxReportNo = reportNos.size()+"";
+                }
+
+                WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
+                ContractInfo contract = contractClient.getContractById(dto.getContractId());
+                int year = LocalDateTimeUtil.now().getYear();
+                if (wbsTreePrivate == null || contract == null) {
+                    throw new ServiceException("未找到当前项目合同段的节点信息,操作失败!");
+                } else {
+                    //报告单
+                    String str2 = "BG" +
+                            "-" + contract.getContractNumber() +
+                            "-" + year +
+                            "-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
+                            "-" + maxReportNo;
+                    HashMap<String, String> stringStringHashMap = new HashMap<>();
+                    stringStringHashMap.put("type","报告单");
+                    stringStringHashMap.put("valueStr",str2);
+                    return stringStringHashMap;
+                }
+            }
+        }
+        return null;
+    }
 
     public IPage<TrialSelfInspectionRecordVO> trialDataPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) {
         QueryWrapper<TrialSelfInspectionRecord> queryWrapper = Condition.getQueryWrapper(dto);

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

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -63,7 +64,7 @@ public class EVisaController {
         //执行代码
         log.info("扫描开始");
         //String sql = "SELECT * from u_task_batch where json_data like '%1821798868568768512%' and is_deleted<>5  LIMIT 10";
-        String sql = "SELECT * from u_task_batch where is_deleted<>5 LIMIT 5";
+        String sql = "SELECT * from u_task_batch where is_deleted<>5 LIMIT 10";
         List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
         if (maps != null && maps.size() >= 1) {
             for (Map<String, Object> dataInfo : maps) {
@@ -98,12 +99,12 @@ public class EVisaController {
         System.out.println("完成数量" + executor.getCompletedTaskCount());
     }
 
+    @Transactional
     public void checkIsExsitTaskBatch(TaskApprovalVO taskApprovalVO){
         if ("OK".equals(taskApprovalVO.getFlag())) { // 同意
             // 调用电签接口
             String eVisaStatus = eVisaService.eVisa(JSONObject.parseObject(JSONObject.toJSONString(taskApprovalVO), EVisaTaskApprovalVO.class));
 
-
             if (eVisaStatus == null || StringUtils.isEmpty(eVisaStatus)) {
                 //状态改为 == 4 --
 
@@ -127,10 +128,6 @@ public class EVisaController {
                 List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
                 if (maps == null || maps.size() == 0) {
                     // 最后修改计量数据
-                    /*if(masterTask !=null && (masterTask.getApprovalType()==5 || masterTask.getApprovalType()==6 || masterTask.getApprovalType()==7 ) && masterTask.getFixedFlowId()!=null && masterTask.getFixedFlowId()!=0L ){
-                        String upsql = "update u_task_parallel set status=2 ,e_visa_status=1,e_visa_content='电签成功' ,update_time=SYSDATE()  where sort in(SELECT fixed_flow_branch_sort from u_fixed_flow_link where fixed_flow_id ="+masterTask.getFixedFlowId()+" and  flow_task_type=2 ) and process_instance_id="+masterTask.getProcessInstanceId()+"";
-                        jdbcTemplate.execute(upsql);
-                    }*/
 
                     //说明都审批完成,将主表状态更改为已完成
                     String finalPdfUrl = null;
@@ -198,7 +195,6 @@ public class EVisaController {
             jdbcTemplate.execute(up_task);
             jdbcTemplate.execute("update u_information_query set e_visa_pdf_url='',status=0 where id='"+taskApprovalVO.getFormDataId()+"'");
             RedisTemplate.delete("sign-" + taskApprovalVO.getFormDataId());
-
             //委托单
             if (taskApprovalVO.getApprovalType()==8) {
                 this.jdbcTemplate.execute("update u_entrust_info set status=1 where id=(SELECT wbs_id from u_information_query where id='"+taskApprovalVO.getFormDataId()+"')");

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

@@ -90,7 +90,7 @@ import java.util.stream.Collectors;
 @AllArgsConstructor
 public class EVisaServiceImpl implements EVisaService {
 
-    //private static final String SIGN_HOST = "172.30.224.79";
+   // private static final String SIGN_HOST = "172.30.224.79";
     private static final String SIGN_HOST = "47.115.117.246";
 
     private static final String SIGN_PORT = "8183";
@@ -1006,7 +1006,7 @@ public class EVisaServiceImpl implements EVisaService {
                             imageData = ImageUtil.resizeImage(imageData, 540, 540);
                         } else {
                             //非合同章
-                            imageData = ImageUtil.resizeImage(imageData, 480, 132);
+                            imageData = ImageUtil.resizeImage(imageData, 400, 200);
                         }
                     }
 

+ 21 - 27
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -21,6 +21,9 @@ import lombok.SneakyThrows;
 import org.apache.commons.codec.Charsets;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang3.ObjectUtils;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.WorkbookFactory;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -2466,32 +2469,23 @@ public class ExcelTabController extends BladeController {
                         }
                     }
                     // 组装电签设置
-                    QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
-                    queryWrapper.eq("type", 2);
-                    queryWrapper.eq("tab_id", tableNode.getPKeyId());
-
-                    final List<TextdictInfo> textdictInfos = this.textdictInfoService.getBaseMapper().selectList(queryWrapper);
-                    if (textdictInfos != null && !textdictInfos.isEmpty()) {
-                        textdictInfos.forEach(e -> {
-                            String key = e.getColKey();
-                            String[] keys = key.split("__");
-                            String[] trtd = keys[1].split("_");
-                            if (trs.size() > (Integer.parseInt(trtd[0]))) {
-                                Element trData = trs.get(Integer.parseInt(trtd[0]));
-                                Elements tdDatas = trData.select("td");
-                                if (tdDatas.size() > Integer.parseInt(trtd[1])) {
-                                    Element data = tdDatas.get(Integer.parseInt(trtd[1]));
-                                    int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
-                                    if (x1 == 0) {
-                                        x1 = 1;
-                                    }
-                                    int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
-                                    final CellRange cellRange = sheet.getCellRange(y1, x1);
-                                    cellRange.setText(e.getId() + "");
-                                    cellRange.getCellStyle().getFont().setColor(Color.white);
-                                }
+                    Elements dqids = table.getElementsByAttribute("dqid");
+                    for (Element element : dqids) {
+                        String dqid = element.attr("dqid");
+                        Elements x11 = element.getElementsByAttribute("x1");
+                        if (x11 != null && x11.size() >= 1) {
+                            Element element1 = x11.get(x11.size() - 1);
+                            int x1 = Func.toInt(element1.attr("x1"));
+                            int y1 = Func.toInt(element1.attr("y1"));
+
+                            CellRange cellRange = sheet.getCellRange(y1, x1);
+                            if (cellRange != null) {
+                                // 创建字体
+                                cellRange.setText(dqid);
+                                cellRange.getCellStyle().getExcelFont().setSize(1);
+                                cellRange.getCellStyle().getExcelFont().setColor(Color.WHITE);
                             }
-                        });
+                        }
                     }
 
                     Long fileName = SnowFlakeUtil.getId();
@@ -3631,8 +3625,8 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "id", value = "记录id-当做groupId", required = true),
             @ApiImplicitParam(name = "contractId", value = "合同段id", required = true)
     })
-    public R<List<Map<String, Object>>> getBussDataInfoTrial(Long id, Long pkeyId, Long contractId, Long entrustId) {
-        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, pkeyId, contractId, entrustId);
+    public R<List<Map<String, Object>>> getBussDataInfoTrial(Long id, Long pkeyId, Long contractId, Long entrustId ,Integer type,Long nodeId ) {
+        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, pkeyId, contractId, entrustId, type, nodeId);
         return R.data(bussDataInfoTrial);
     }
 

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

@@ -250,7 +250,7 @@ public class WbsParamController {
     @ApiOperation(value = "获取名称字典", notes = "获取名称字典")
     @GetMapping("/keymap")
     public R<List<WbsParamBean>> list2() {
-        LambdaQueryWrapper<WbsParam> queryWrapper = Wrappers.<WbsParam>query().lambda().eq(WbsParam::getType, 0).orderByDesc(WbsParam::getCreateTime);
+        LambdaQueryWrapper<WbsParam> queryWrapper = Wrappers.<WbsParam>query().lambda().eq(WbsParam::getType, 0).orderByDesc(WbsParam::getSort,WbsParam::getCreateTime);
         List<WbsParamBean> list = new ArrayList<>();
         List<WbsParam> data = this.service.list(queryWrapper);
         if (CollectionUtil.isNotEmpty(data)) {

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

@@ -707,7 +707,7 @@ public class WbsTreePrivateController extends BladeController {
                 }
 
                 //表单数据
-                List<Map<String, Object>> bussDataInfoTrial = iExcelTabService.getBussDataInfoTrial(id, treePrivate.getPKeyId(), Long.parseLong(contractId),null);
+                List<Map<String, Object>> bussDataInfoTrial = iExcelTabService.getBussDataInfoTrial(id, treePrivate.getPKeyId(), Long.parseLong(contractId),null,null,null);
                 if (bussDataInfoTrial != null && bussDataInfoTrial.size() > 0) {
                     bussDataInfoTrial.get(0).remove("group_id");
                     treePrivate.setBussDataInfoTrial(bussDataInfoTrial.get(0));

+ 0 - 17
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -73,23 +73,6 @@ public class ExcelTabClientImpl implements ExcelTabClient {
         String projectId = table.getString("projectId");
         String contractId = table.getString("contractId");
 
-    //    List<WbsTreePrivateVO4> wbsTreePrivateVO4s = wbsTreePrivateService.searchNodeAllTable(nodeId, type + "", "1", contractId, projectId, 0, id);
-/*        for (WbsTreePrivateVO4 treePrivate : wbsTreePrivateVO4s) {
-            if (tabIds.indexOf(treePrivate.getPKeyId() + "") < 0) {
-                List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, treePrivate.getPKeyId(), Long.parseLong(contractId));
-                Map<String, Object> dataInfo = bussDataInfoTrial.get(0);
-                dataInfo.put("pkeyId", treePrivate.getPKeyId());
-                dataInfo.put("projectId", treePrivate.getProjectId());
-                dataInfo.put("type", 1);
-                dataInfo.put("isBussShow", 1);
-                dataInfo.put("nodeId", nodeId);
-                dataInfo.put("contractId", contractId);
-                dataInfo.put("oper", true);
-                dataInfo.put("isCollapseLoad", true);
-                dataArray.add(dataInfo);
-            }
-        }*/
-
         //应用抽取的数据
         dataArray = excelTabService.addLoadDataInfo(dataArray);
 

+ 0 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ProjectAssignmentUserClientImpl.java

@@ -2,7 +2,6 @@ package org.springblade.manager.feign;
 
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
-import org.apache.commons.lang.StringUtils;
 import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.ContractRelationJlyz;

+ 5 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreePrivateClientImpl.java

@@ -13,13 +13,15 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.node.ForestNodeMerger;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.manager.entity.*;
+import org.springblade.manager.entity.TableFile;
+import org.springblade.manager.entity.TextdictInfo;
+import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.mapper.WbsTreePrivateMapper;
 import org.springblade.manager.service.IWbsTreePrivateService;
 import org.springblade.manager.service.impl.ExcelTabServiceImpl;
 import org.springblade.manager.service.impl.TextdictInfoServiceImpl;
 import org.springblade.manager.service.impl.WbsTreeContractServiceImpl;
-import org.springblade.manager.service.impl.WbsTreePrivateServiceImpl;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 import org.springblade.manager.vo.WbsTreePrivateVO;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
@@ -213,7 +215,7 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
 
     @Override
     public List<Map<String, Object>> getTrialDataInfo(String pKeyId, Long id) {
-        return excelTabServiceImpl.getBussDataInfoTrial(id, Long.parseLong(pKeyId), null,null);
+        return excelTabServiceImpl.getBussDataInfoTrial(id, Long.parseLong(pKeyId), null,null,null,null);
     }
 
     @Override

+ 8 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java

@@ -1857,11 +1857,13 @@ public class ExecutorMeter extends FormulaExecutor {
                     monthlySum.addAll(0,Collections.nCopies(offset,""));
                     monthlyCount.addAll(0,Collections.nCopies(offset,""));
                 }
+
+                //累计实际完成
                 FormulaUtils.elementFindByCode(fdm,ConstructionSchedule.TBN+":key_22").ifPresent(t->{
                     elementWriter.write(t,monthlySum);
                 });
 
-
+                //本月实际完成
                 FormulaUtils.elementFindByCode(fdm,ConstructionSchedule.TBN+":key_23").ifPresent(t->{
                     elementWriter.write(t,monthlyCount);
                 });
@@ -1900,18 +1902,21 @@ public class ExecutorMeter extends FormulaExecutor {
                     }).collect(Collectors.toList());
 
                     List<String> finalPlanMonthSum = planMonthSum;
+                    //key_27 计划累计实际完成
                     FormulaUtils.elementFindByCode(fdm, ConstructionSchedule.TBN + ":key_27").ifPresent(t -> {
                         elementWriter.write(t, finalPlanMonthSum);
                     });
-
                 }
+
+               // tec.getMeterInfo()/
+
                 /*上传图标*/
                 try {
                     String path=FormulaUtils.chapterScheduleChartUrl(actualMap,plannedMap,planStartDate.getYear(),planEndDate.getYear());
                     BladeFile chartFile= tec.getNewIOSSClient().uploadFile( ConstructionSchedule.TBN+ SnowFlakeUtil.getId() + ".png",path);
                     /*施工进度图*/
                     FormulaUtils.elementFindByCode(fdm, ConstructionSchedule.TBN + ":key_29").ifPresent(t -> {
-                        elementWriter.write(t, chartFile.getLink());
+                        elementWriter.write(t, actualMap);
                     });
                 }catch (Exception e){
                     e.printStackTrace();

+ 4 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml

@@ -848,13 +848,13 @@
     </select>
 
     <select id="apiTreeNodeHzrc" resultMap="apiTreeNodeHzrcResultMap">
-        select distinct a.p_key_id , a.id , a.parent_id , a.node_name ,1 as isMea, b.e_visa_pdf_url as fileUrl,
-                        (SELECT count(1) from u_task a ,u_task_parallel b,m_project_assignment_user c  where a.process_instance_id = b.process_instance_id and b.task_user = c.user_id and c.role_id in(
-                            SELECT id from blade_role where role_name like  '监理员%' and is_deleted=0) and c.contract_id=#{contractId} and a.form_data_id=b.id)
+        select distinct a.p_key_id , a.id , a.parent_id , a.node_name , b.e_visa_pdf_url as fileUrl,
+                        (SELECT count(1) from u_task e ,u_task_parallel f,m_project_assignment_user g  where e.process_instance_id = f.process_instance_id and f.task_user = g.user_id and g.role_id in(
+                            SELECT id from blade_role where role_name like  '监理员%' and is_deleted=0) and g.contract_id=1792792387901288450 and e.form_data_id=b.id )
                         AS isMea,
                         a.partition_Code as partitionCode,
                         b.taskStatus
-        from m_wbs_tree_contract a LEFT JOIN (SELECT c.e_visa_pdf_url ,d.`status` as taskStatus,c.wbs_id from u_information_query c,u_task d where d.form_data_id=c.id and  c.contract_id = #{contractId} and c.classify = #{classType})  b on a.p_key_id = b.wbs_id
+        from m_wbs_tree_contract a LEFT JOIN (SELECT c.e_visa_pdf_url ,d.`status` as taskStatus,c.wbs_id ,,d.id from u_information_query c,u_task d where d.form_data_id=c.id and  c.contract_id = #{contractId} and c.classify = #{classType})  b on a.p_key_id = b.wbs_id
         where
             a.is_deleted = 0
           and a.status = 1

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

@@ -136,7 +136,7 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
     /**
      * 获取试验用户端 单个表单接口数据
      */
-    List<Map<String, Object>> getBussDataInfoTrial(Long id, Long pkeyId, Long contractId, Long entrustId);
+    List<Map<String, Object>> getBussDataInfoTrial(Long id, Long pkeyId, Long contractId, Long entrustId, Integer type,Long nodeId);
 
     /**
      * 获取试验用户端 单个表单接口数据 - 关联施工

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

@@ -34,6 +34,7 @@ import org.springblade.business.entity.*;
 import org.springblade.business.feign.ContractLogClient;
 import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.business.feign.OperationLogClient;
+import org.springblade.business.feign.TrialSelfInspectionRecordClient;
 import org.springblade.business.vo.SaveContractLogVO;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
@@ -115,6 +116,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     private final IProjectInfoService projectInfoService;
     private final OperationLogClient operationLogClient;
     private final TableInfoServiceImpl tableInfoService;
+    private final TrialSelfInspectionRecordClient trialSelfInspectionRecordClient;
+
 
     @Autowired
     StringRedisTemplate RedisTemplate;
@@ -2351,8 +2354,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     this.setFirstData(dataInfo2, tableInfo);
                     //设置日志信息
                     this.setTheLogData(dataInfo2, tableInfo);
-
-
                 }
                 tableInfo.setContractId(dataInfo2.getString("contractId"));
 
@@ -2423,13 +2424,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
      * 试验 获取填报信息
      */
     @Override
-    public List<Map<String, Object>> getBussDataInfoTrial(Long groupId, Long pkeyId, Long contractId, Long entrustId) {
+    public List<Map<String, Object>> getBussDataInfoTrial(Long groupId, Long pkeyId, Long contractId, Long entrustId, Integer type,Long nodeId) {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         List<Map<String, Object>> list = new ArrayList<>();
         Map<String, Object> reData = new HashMap<>();
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
-                .select(WbsTreePrivate::getInitTableName, WbsTreePrivate::getHtmlUrl, WbsTreePrivate::getPKeyId, WbsTreePrivate::getProjectId)
+                .select(WbsTreePrivate::getInitTableName, WbsTreePrivate::getHtmlUrl, WbsTreePrivate::getPKeyId, WbsTreePrivate::getProjectId, WbsTreePrivate::getParentId, WbsTreePrivate::getTableType)
                 .eq(WbsTreePrivate::getPKeyId, pkeyId));
         if (wbsTreePrivate == null) {
             return list;
@@ -2499,6 +2500,29 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 //通过html获取页面上的key值 返回key值对应的数据
                 setBasicFormData(doc, reData, sampleInfo, trialMaterialMobilization,entrustInfo);
             }
+            //第一次新增 回显系统生成的编号
+            if(type != null && nodeId != null){
+                TrialSelfInspectionRecordDTO trialSelfInspectionRecordDTO = new TrialSelfInspectionRecordDTO();
+                trialSelfInspectionRecordDTO.setTableType(wbsTreePrivate.getTableType().toString());
+                trialSelfInspectionRecordDTO.setProjectId(wbsTreePrivate.getProjectId());
+                trialSelfInspectionRecordDTO.setContractId(contractId);
+                trialSelfInspectionRecordDTO.setNodeId(nodeId);
+                trialSelfInspectionRecordDTO.setType(type);
+                HashMap<String, String> stringStringHashMap = trialSelfInspectionRecordClient.previewGeneratedReportOrRecordNum(trialSelfInspectionRecordDTO);
+                String mapType = stringStringHashMap.get("type");
+                if("报告单".equals(mapType)){
+                    //获取页面上的key值
+                    String bgbhKey = doc.select("el-input[placeholderxx~=报告编号.*]").attr("keyname");
+                    reData.put(bgbhKey, stringStringHashMap.get("valueStr"));
+                }else {
+                    //获取页面上的key值
+                    String jlbhKey = doc.select("el-input[placeholderxx~=记录编号.*]").attr("keyname");
+                    if(ObjectUtil.isEmpty(jlbhKey)){
+                        jlbhKey = doc.select("el-input[placeholderxx~=记录编 号.*]").attr("keyname");
+                    }
+                    reData.put(jlbhKey, stringStringHashMap.get("valueStr"));
+                }
+            }
 
 
             //匹配
@@ -2745,7 +2769,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         if (wbsTreePrivate.getHtmlUrl() == null) {
             return list;
         }
-
         //表单是否存储在
         String tabName = wbsTreePrivate.getInitTableName();
         String isExitSql = "select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
@@ -2904,7 +2927,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
 
         //获取数据信息info
-        List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(id, pkeyId, Long.parseLong(contractId),null);
+        List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(id, pkeyId, Long.parseLong(contractId),null,null,null);
         Map<String, Object> DataInfo = new HashMap<>();
         if (bussDataInfoTrial.size() > 0) {
             DataInfo.putAll(bussDataInfoTrial.stream().findAny().orElse(null));
@@ -3913,8 +3936,16 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                             newStyle.setFont(redFont);
                             newStyle.setShrinkToFit(true);
                             cell.setCellStyle(newStyle);
-                            cell.setCellValue(dqid);
-                            sign.add(dqid);
+                            if(dqid.contains("||")){
+                                String[] split = dqid.split("\\|\\|");
+                                for (String singleDqid : split) {
+                                    cell.setCellValue(singleDqid);
+                                    sign.add(singleDqid);
+                                }
+                            }else {
+                                cell.setCellValue(dqid);
+                                sign.add(dqid);
+                            }
                         }
                     }
                 }
@@ -3981,7 +4012,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
 
         //获取数据信息info
-        List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(groupId, pkeyId, Long.parseLong(contractId),null);
+        List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(groupId, pkeyId, Long.parseLong(contractId),null,null,null);
         Map<String, Object> DataInfo = new HashMap<>();
         if (bussDataInfoTrial.size() > 0) {
             DataInfo.putAll(bussDataInfoTrial.stream().findAny().orElse(null));

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

@@ -1,6 +1,5 @@
 package org.springblade.manager.service.impl;
 
-import com.mixsmart.utils.CustomFunction;
 import com.mixsmart.utils.StringUtils;
 import lombok.RequiredArgsConstructor;
 import org.springblade.common.utils.BaseUtils;
@@ -21,7 +20,6 @@ import org.springframework.stereotype.Service;
 
 import java.time.format.DateTimeFormatter;
 import java.util.*;
-import java.util.function.BiFunction;
 import java.util.function.Function;
 
 /**

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

@@ -3024,7 +3024,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             }
             return Jsoup.parse(IoUtil.readToString(inputStreamByUrl));
          },(v1,v2)->v2));
-        /*元素绑定单元格信息*/
+        /*元素绑定单元格信息(坐标位置)*/
         Map<String,Map<String,String>> coordinateMap = new HashMap<>();
         /*电签关键字和坐标*/
         Map<String,Map<String,String>> eSignMaps=new HashMap<>();

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

@@ -168,7 +168,28 @@ public class PdfAddimgUtil {
         return result;
     }
 
-    private static List<PdfPageContentPositions> getPdfContentPostionsList(
+    /**
+     * findKeywordPostions
+     *
+     * @param pdfData
+     * @return List<float [ ]> : float[0]:pageNum float[1]:x float[2]:y
+     * @throws IOException
+     */
+    public static List<PDFIndexInfo> findAllwordPostions(byte[] pdfData) throws IOException {
+        List<PDFIndexInfo> result = new ArrayList<PDFIndexInfo>();
+        List<PdfPageContentPositions> pdfPageContentPositions = getPdfContentPostionsList(pdfData);
+
+        for (PdfPageContentPositions pdfPageContentPosition : pdfPageContentPositions) {
+            PDFIndexInfo pdfIndexInfo = new PDFIndexInfo();
+            pdfIndexInfo.setListData(pdfPageContentPosition.getPositions());
+            pdfIndexInfo.setPkeyid(pdfPageContentPosition.getContent());
+            result.add(pdfIndexInfo);
+        }
+        return result;
+    }
+
+
+    static List<PdfPageContentPositions> getPdfContentPostionsList(
             byte[] pdfData) throws IOException {
         PdfReader reader = new PdfReader(pdfData);
 

+ 5 - 0
blade-service/blade-meter/pom.xml

@@ -85,6 +85,11 @@
             <version>2.9.1.RELEASE</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.pdfbox</groupId>
+            <artifactId>pdfbox</artifactId>
+            <version>2.0.24</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 32 - 2
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -79,6 +79,7 @@ import org.springblade.meter.service.IMaterialStartStatementService;
 import org.springblade.meter.service.ITaskRepealMessageService;
 import org.springblade.meter.service.impl.*;
 import org.springblade.meter.utils.CollectionUtils;
+import org.springblade.meter.utils.CreateDashedLine;
 import org.springblade.meter.utils.FileUtils;
 import org.springblade.meter.vo.*;
 import org.springblade.resource.feign.NewIOSSClient;
@@ -3745,7 +3746,6 @@ public class TaskController extends BladeController {
                         PdfCopy pdfCopy = new PdfCopy(doc, new FileOutputStream(rs.getPdfPath()));
                         int pageCount;
                         doc.open();
-                        /* String tile = rs.getName().contains("封面") ? projectName : projectName + StringPool.DASH + rs.getName();*/
                         String title = rs.createTitle(projectName);
                         // 添加签字时间
                         List<DqTime> dqTimes= dqTimeMap.get().get(rs.getPkeyId());
@@ -3858,9 +3858,39 @@ public class TaskController extends BladeController {
                         if (reader != null) reader.close();
                         doc.close();
                         rs.setPdfOssPath(CompletableFuture.supplyAsync(() -> {
+                            String local = rs.getPdfPath();
                             String url = "无效链接";
                             try {
-                                BladeFile bladeFile = newIOSSClient.uploadFile(rs.getName() + SnowFlakeUtil.getId() + ".pdf", rs.getPdfPath());
+                                if(rs.getPkeyId() == 1760845593422331904l){
+
+                                    Map<String, Object> dataMap = rs.getData().get(0);
+                                    // key_39 实际
+                                    String key39= rs.getCoordinateMap().get("key_39");
+                                    String[] split39 = key39.split(";");
+                                    // key_34 累计
+                                    String key34= rs.getCoordinateMap().get("key_34");
+                                    String[] split34 = key34.split(";");
+                                    List<String> list39 = new ArrayList<>();
+                                    for(String val39:split39){
+                                        String data39 = dataMap.get(val39) + "";
+                                        if(data39!=null && Func.isNotEmpty(data39)){
+                                            list39.add(data39);
+                                        }
+
+                                    }
+                                    CreateDashedLine.getPDFInfo(local,list39,"1");
+
+                                    List<String> list34 = new ArrayList<>();
+                                    for(String val34:split34){
+                                        String data34 = dataMap.get(val34) + "";
+                                        if(data34!=null && Func.isNotEmpty(data34)) {
+                                            list34.add(dataMap.get(val34) + "");
+                                        }
+                                    }
+                                    CreateDashedLine.getPDFInfo(local,list34,"2");
+                                }
+
+                                BladeFile bladeFile = newIOSSClient.uploadFile(rs.getName() + SnowFlakeUtil.getId() + ".pdf", local);
                                 url = bladeFile.getLink();
                             } catch (Exception e) {
                                 e.printStackTrace();

+ 386 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/utils/PdfAddimgUtil.java

@@ -0,0 +1,386 @@
+package org.springblade.meter.utils;
+
+import com.itextpdf.text.BaseColor;
+import com.itextpdf.text.Element;
+import com.itextpdf.text.Image;
+import com.itextpdf.text.Rectangle;
+import com.itextpdf.text.pdf.*;
+import com.itextpdf.text.pdf.parser.*;
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.entity.TextdictInfo;
+import org.springblade.manager.vo.PDFIndexInfo;
+import org.springblade.system.cache.ParamCache;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class PdfAddimgUtil {
+
+    public static void pdfAddImgInfo(String pdfUrl, String keyword, Map<Long, TextdictInfo> textMap) throws Exception {
+        String file_path = FileUtils.getSysLocalFileUrl();
+        String signImg = file_path+"/print/241dc221f83929a87d55ce700d6a4cd7.png";
+
+        File pdfFile = new File(pdfUrl);
+        byte[] pdfData = new byte[(int) pdfFile.length()];
+        FileInputStream inputStream = null;
+        try {
+            inputStream = new FileInputStream(pdfFile);
+            inputStream.read(pdfData);
+        } catch (IOException e) {
+            throw e;
+        } finally {
+            if (inputStream != null) {
+                try {
+                    inputStream.close();
+                } catch (IOException e) {
+                    inputStream.close();
+                }
+            }
+        }
+
+
+        List<PDFIndexInfo> positions = findKeywordPostions(pdfData, keyword);
+
+        System.out.println("total:" + positions.size());
+        if (positions != null && positions.size() > 0) {
+
+            for (int i = 0; i < positions.size(); i++) {
+
+                PDFIndexInfo pdfIndexInfo = positions.get(i);
+                float[] position = pdfIndexInfo.getDataInfo();
+                TextdictInfo textdictInfo = textMap.get(Func.toLong(pdfIndexInfo.getPkeyid()));
+                float pyzbx = 0;
+                float pyzby = 0;
+                String type ="2";
+                if(textdictInfo!=null){
+                    pyzbx = Func.toFloat(textdictInfo.getPyzbx());
+                    pyzby = Func.toFloat(textdictInfo.getPyzby());
+                    type = textdictInfo.getType()+"";
+                }
+                gaizhang(pdfFile, new File(pdfUrl), (int) position[0], position[1], position[2], signImg,pyzbx,pyzby,type);
+            }
+        }
+    }
+
+    public static void gaizhang(File src, File dest, int page, float x, float y, String imagePath,float pyzbx,float pyzby,String type) throws Exception {
+        // 读取模板文件
+        InputStream input = new FileInputStream(src);
+        PdfReader reader = new PdfReader(input);
+        PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest));
+        Rectangle pageSize = reader.getPageSize(1);
+        float height = pageSize.getHeight();
+        float width = pageSize.getWidth();
+        if(type.equals("6")){
+            x = width * x - 27+pyzbx;
+            y = height - height * y - 30+pyzby;
+            imagePath = "/Users/hongchuangyanfa/Desktop/print/ht1234567890.png";
+        }else{
+            x = width * x - 20+pyzbx;
+            y = height - height * y - 8+pyzby;
+        }
+
+        // 读图片
+        Image image = Image.getInstance(imagePath);
+
+        // 获取操作的页面
+        PdfContentByte under = stamper.getOverContent(page);
+        // 添加图片
+
+        // 设置图片的新宽度和高度
+        float newWidth = 75f; // 新的宽度
+        float newHeight = image.getScaledHeight() * (newWidth / image.getScaledWidth()); // 根据宽度计算高度
+        image.scaleAbsolute(newWidth, newHeight); // 设置图片的新尺寸
+        //调整图片尺寸
+        image.setAbsolutePosition(x, y);
+        under.addImage(image);
+        // 假设的under.addImage方法,需要传入图片路径和大小参数
+        stamper.close();
+        reader.close();
+    }
+
+    /**
+     * 【功能描述:添加图片和文字水印】 【功能详细描述:功能详细描述】
+     *
+     * @param srcFile    待加水印文件
+     * @param destFile   加水印后存放地址
+     * @param text       加水印的文本内容
+     * @param textWidth  文字横坐标
+     * @param textHeight 文字纵坐标
+     * @throws Exception
+     */
+    public void addWaterMark(String srcFile, String destFile, String text,
+                             int textWidth, int textHeight) throws Exception {
+        // 待加水印的文件
+        PdfReader reader = new PdfReader(srcFile);
+        // 加完水印的文件
+        PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(
+                destFile));
+        int total = reader.getNumberOfPages() + 1;
+        PdfContentByte content;
+        // 设置字体
+        BaseFont font = BaseFont.createFont();
+        // 循环对每页插入水印
+        for (int i = 1; i < total; i++) {
+            // 水印的起始
+            content = stamper.getUnderContent(i);
+            // 开始
+            content.beginText();
+            // 设置颜色 默认为蓝色
+            content.setColorFill(BaseColor.BLUE);
+            // content.setColorFill(Color.GRAY);
+            // 设置字体及字号
+            content.setFontAndSize(font, 38);
+            // 设置起始位置
+            // content.setTextMatrix(400, 880);
+            content.setTextMatrix(textWidth, textHeight);
+            // 开始写入水印
+            content.showTextAligned(Element.ALIGN_LEFT, text, textWidth,
+                    textHeight, 45);
+            content.endText();
+        }
+        stamper.close();
+    }
+
+    /**
+     * findKeywordPostions
+     *
+     * @param pdfData
+     * @param keyword
+     * @return List<float [ ]> : float[0]:pageNum float[1]:x float[2]:y
+     * @throws IOException
+     */
+    public static List<PDFIndexInfo> findKeywordPostions(byte[] pdfData,
+                                                    String keyword) throws IOException {
+        List<PDFIndexInfo> result = new ArrayList<PDFIndexInfo>();
+        List<PdfPageContentPositions> pdfPageContentPositions = getPdfContentPostionsList(pdfData);
+
+        for (PdfPageContentPositions pdfPageContentPosition : pdfPageContentPositions) {
+            List<PDFIndexInfo> charPositions = findPositions(keyword,
+                    pdfPageContentPosition);
+            if (charPositions == null || charPositions.size() < 1) {
+                continue;
+            }
+            result.addAll(charPositions);
+        }
+        return result;
+    }
+
+    /**
+     * findKeywordPostions
+     *
+     * @param pdfData
+     * @return List<float [ ]> : float[0]:pageNum float[1]:x float[2]:y
+     * @throws IOException
+     */
+    public static List<PDFIndexInfo> findAllwordPostions(byte[] pdfData) throws IOException {
+        List<PDFIndexInfo> result = new ArrayList<PDFIndexInfo>();
+        List<PdfPageContentPositions> pdfPageContentPositions = getPdfContentPostionsList(pdfData);
+
+        for (PdfPageContentPositions pdfPageContentPosition : pdfPageContentPositions) {
+            PDFIndexInfo pdfIndexInfo = new PDFIndexInfo();
+            pdfIndexInfo.setListData(pdfPageContentPosition.getPositions());
+            pdfIndexInfo.setPkeyid(pdfPageContentPosition.getContent());
+            result.add(pdfIndexInfo);
+        }
+        return result;
+    }
+
+
+    static List<PdfPageContentPositions> getPdfContentPostionsList(
+            byte[] pdfData) throws IOException {
+        PdfReader reader = new PdfReader(pdfData);
+
+        List<PdfPageContentPositions> result = new ArrayList<PdfPageContentPositions>();
+
+        int pages = reader.getNumberOfPages();
+        for (int pageNum = 1; pageNum <= pages; pageNum++) {
+            float width = reader.getPageSize(pageNum).getWidth();
+            float height = reader.getPageSize(pageNum).getHeight();
+
+            PdfRenderListener pdfRenderListener = new PdfRenderListener(
+                    pageNum, width, height);
+
+            // 解析pdf,定位位置
+            PdfContentStreamProcessor processor = new PdfContentStreamProcessor(
+                    pdfRenderListener);
+            PdfDictionary pageDic = reader.getPageN(pageNum);
+            PdfDictionary resourcesDic = pageDic.getAsDict(PdfName.RESOURCES);
+            try {
+                processor.processContent(ContentByteUtils
+                        .getContentBytesForPage(reader, pageNum), resourcesDic);
+            } catch (IOException e) {
+                reader.close();
+                throw e;
+            }
+
+            String content = pdfRenderListener.getContent();
+            List<CharPosition> charPositions = pdfRenderListener
+                    .getcharPositions();
+
+            List<float[]> positionsList = new ArrayList<float[]>();
+            for (CharPosition charPosition : charPositions) {
+                float[] positions = new float[]{charPosition.getPageNum(),
+                        charPosition.getX(), charPosition.getY()};
+                positionsList.add(positions);
+            }
+
+            PdfPageContentPositions pdfPageContentPositions = new PdfPageContentPositions();
+            pdfPageContentPositions.setContent(content);
+            pdfPageContentPositions.setPostions(positionsList);
+
+            result.add(pdfPageContentPositions);
+        }
+        reader.close();
+        return result;
+    }
+
+
+    private static List<PDFIndexInfo> findPositions(String keyword,
+                                                    PdfPageContentPositions pdfPageContentPositions) {
+
+        List<PDFIndexInfo> result =new ArrayList<>();
+        String content = pdfPageContentPositions.getContent();
+        List<float[]> charPositions = pdfPageContentPositions.getPositions();
+
+        List<String> strList = Func.toStrList(keyword);
+        for (String text : strList) {
+            for (int pos = 0; pos < content.length(); ) {
+                PDFIndexInfo data= new PDFIndexInfo();
+                int positionIndex = content.indexOf(text, pos);
+                if (positionIndex == -1) {
+                    break;
+                }
+                float[] postions = charPositions.get(positionIndex);
+                data.setDataInfo(postions);
+                data.setPkeyid(text);
+                result.add(data);
+                pos = positionIndex + 1;
+            }
+        }
+        return result;
+    }
+
+
+    private static class PdfPageContentPositions {
+        private String content;
+        private List<float[]> positions;
+
+        public String getContent() {
+            return content;
+        }
+
+        public void setContent(String content) {
+            this.content = content;
+        }
+
+        public List<float[]> getPositions() {
+            return positions;
+        }
+
+        public void setPostions(List<float[]> positions) {
+            this.positions = positions;
+        }
+    }
+
+    private static class PdfRenderListener implements RenderListener {
+        private int pageNum;
+        private float pageWidth;
+        private float pageHeight;
+        private StringBuilder contentBuilder = new StringBuilder();
+        private List<CharPosition> charPositions = new ArrayList<CharPosition>();
+
+        public PdfRenderListener(int pageNum, float pageWidth, float pageHeight) {
+            this.pageNum = pageNum;
+            this.pageWidth = pageWidth;
+            this.pageHeight = pageHeight;
+        }
+
+        @Override
+        public void beginTextBlock() {
+
+        }
+
+        @Override
+        public void renderText(TextRenderInfo renderInfo) {
+            List<TextRenderInfo> characterRenderInfos = renderInfo
+                    .getCharacterRenderInfos();
+            for (TextRenderInfo textRenderInfo : characterRenderInfos) {
+                String word = textRenderInfo.getText();
+                if (word.length() > 1) {
+                    word = word.substring(word.length() - 1, word.length());
+                }
+                com.itextpdf.awt.geom.Rectangle2D.Float rectangle = textRenderInfo.getAscentLine()
+                        .getBoundingRectange();
+                double x = rectangle.getMinX();
+                double y = rectangle.getMaxY();
+
+                float xPercent = Math.round(x / pageWidth * 10000) / 10000f;
+                float yPercent = Math.round((1 - y / pageHeight) * 10000) / 10000f;//
+
+                CharPosition charPosition = new CharPosition(pageNum, xPercent,
+                        yPercent);
+                charPositions.add(charPosition);
+                contentBuilder.append(word);
+            }
+        }
+
+        @Override
+        public void endTextBlock() {
+
+        }
+
+        @Override
+        public void renderImage(ImageRenderInfo renderInfo) {
+
+        }
+
+        public String getContent() {
+            return contentBuilder.toString();
+        }
+
+        public List<CharPosition> getcharPositions() {
+            return charPositions;
+        }
+    }
+
+    private static class CharPosition {
+        private int pageNum = 0;
+        private float x = 0;
+        private float y = 0;
+
+        public CharPosition(int pageNum, float x, float y) {
+            this.pageNum = pageNum;
+            this.x = x;
+            this.y = y;
+        }
+
+        public int getPageNum() {
+            return pageNum;
+        }
+
+        public float getX() {
+            return x;
+        }
+
+        public float getY() {
+            return y;
+        }
+
+        @Override
+        public String toString() {
+            return "[pageNum=" + this.pageNum + ",x=" + this.x + ",y=" + this.y
+                    + "]";
+        }
+    }
+
+    public static String getNetUrl(String fileUrl){
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
+
+        String path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path, "");
+        return path;
+    }
+}