zhuwei 1 éve
szülő
commit
9a982b87eb
24 módosított fájl, 218 hozzáadás és 86 törlés
  1. 1 0
      blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java
  2. 1 1
      blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  3. 1 0
      blade-common/src/main/java/org/springblade/common/utils/FileUtils.java
  4. 13 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/PDFIndexInfo.java
  5. 0 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/utils/FileUtils.java
  6. 13 7
      blade-service/blade-business/src/main/java/org/springblade/business/utils/PDFUtil.java
  7. 1 1
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  8. 5 2
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PDFUtils.java
  9. 0 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  10. 36 13
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java
  11. 3 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.java
  12. 8 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.xml
  13. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/ITextdictInfoService.java
  14. 49 14
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  15. 9 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java
  16. 4 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java
  17. 20 5
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java
  18. 39 20
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/PdfAddimgUtil.java
  19. 2 4
      blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java
  20. 1 1
      blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.java
  21. 5 2
      blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml
  22. 1 1
      blade-service/blade-system/src/main/java/org/springblade/system/service/IDeptService.java
  23. 3 3
      blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java
  24. 1 1
      blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java

+ 1 - 0
blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java

@@ -59,6 +59,7 @@ public interface CommonConstant {
     String DEFAULT_PARAM_PASSWORD = "account.initPassword";
 
     String SYS_LOCAL_URL = "sys.local.url";
+    String SYS_ISONLINE = "sys.isonline";
     //计量wbs 主键Id值
     String SYS_MEASURE_IDS = "sys.measure.ids";
 

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

@@ -76,7 +76,7 @@ public interface LauncherConstant {
      * nacos dev 地址 215==172.31.222.127   192.168.0.109     127.0.0.1  210-=-172.30.224.81
      * nacos dev 地址 172.31.222.127   192.168.0.109     127.0.0.1    172.30.224.81(39.108.216.210)
      */
-    String NACOS_DEV_ADDR = "127.0.0.1:8848";
+    String NACOS_DEV_ADDR = "152.168.2.11:8848";
 
     /**
      * nacos prod 地址

+ 1 - 0
blade-common/src/main/java/org/springblade/common/utils/FileUtils.java

@@ -1,6 +1,7 @@
 package org.springblade.common.utils;
 
 import lombok.SneakyThrows;
+import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.vo.FileSize;
 import org.springframework.web.multipart.MultipartFile;
 

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

@@ -0,0 +1,13 @@
+package org.springblade.manager.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class PDFIndexInfo {
+
+    @ApiModelProperty(value = "关键字key")
+    String pkeyid;
+    @ApiModelProperty(value = "pdf坐标位置")
+    float[] dataInfo;
+}

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

@@ -284,7 +284,6 @@ public class FileUtils {
                     }
                 }
             }
-
         } catch (Exception e) {
             e.printStackTrace();
         } finally {

+ 13 - 7
blade-service/blade-business/src/main/java/org/springblade/business/utils/PDFUtil.java

@@ -103,9 +103,12 @@ public class PDFUtil {
                 PdfTextFind[] finds = allText.getFinds();
                 for(int k=0;k<finds.length;k++){
                     String textStr = finds[k].getMatchText();
-                    if (textStr.length() >= 15 && Func.isNumeric(textStr)) {
-                        System.out.println(textStr);
-                        eVisaConfigList.add(textStr);
+                    System.out.println(textStr);
+                    String[] textS = Func.toStrArray("\\|\\|",textStr);
+                    for(String txt : textS){
+                        if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                            eVisaConfigList.add(txt);
+                        }
                     }
                 }
             }
@@ -116,10 +119,13 @@ public class PDFUtil {
         return eVisaConfigList;
     }
 
-//    public static void main(String[] args) {
-//        List<String> list = getPdfSignIds("https://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20230921/fdfa82f3254c975c9debd1ad040930c0.pdf");
-//        System.out.println();
-//    }
+/*     public static void main(String[] args) {
+      //  List<String> list = getPdfSignIds("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240620/ebbea951c0b287eb01e907b158799ad6.pdf");
+       String data ="1802969461855092736||1803627246594818048";
+
+         String[] strList = Func.toStrArray("\\|\\|",data);
+         System.out.println(strList.length);
+    }*/
 
 }
 

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

@@ -260,7 +260,7 @@ public class EVisaServiceImpl implements EVisaService {
                     return finalPdfUrl;
                 }
                 //
-                if(reType.equals("2")){
+                if(reType.equals("2")){ //中方中讯
                     if (maps != null && !maps.isEmpty()) {
                         String fileUrl = finalPdfUrl;
                         for (Map<String, Object> dataMap : maps) {

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

@@ -89,8 +89,11 @@ public static void main11(String[] args) {
                     if(textStr.indexOf("*")>=0){
                         textStr = textStr.substring(textStr.lastIndexOf("*")+1,textStr.length());
                     }
-                    if (textStr.length() >= 15 && Func.isNumeric(textStr)) {
-                        eVisaConfigList.add(textStr);
+                    String[] textS = Func.toStrArray("\\|\\|",textStr);
+                    for(String txt : textS){
+                        if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                            eVisaConfigList.add(txt);
+                        }
                     }
                 }
             }

+ 0 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -807,7 +807,6 @@ public class ExcelTabController extends BladeController {
         }
     }
 
-
     /**
      * 后管清表生成html
      */
@@ -830,7 +829,6 @@ public class ExcelTabController extends BladeController {
         }
 
         String fileUrl = wbsTreePrivate.getHtmlUrl();
-//        String fileUrl = "C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1696003315218776064.html";
         File file1 = ResourceUtil.getFile(fileUrl);
         InputStream fileInputStream;
         if (file1.exists()) {
@@ -860,7 +858,6 @@ public class ExcelTabController extends BladeController {
             Elements tds = tr.select("td");
             for (int j = 0; j < tds.size(); j++) {
                 Element data = tds.get(j);
-                int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
                 String style = data.attr("style");
                 if (style.indexOf("font-size") >= 0) {
                     int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt")));
@@ -875,7 +872,6 @@ public class ExcelTabController extends BladeController {
                                 for(Element element:td){
                                     String style2 = element.attr("style");
                                     String sizeinfo = style2.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt"));
-                                    System.out.println(sizeinfo.length());
                                     if(sizeinfo.length()>=2 && sizeinfo.indexOf(".")<0){
                                         int fontsize2 = Func.toInt(sizeinfo);
                                         if(StringUtils.isEmpty(element.text()) && fontsize2>=14){

+ 36 - 13
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java

@@ -20,9 +20,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
 
@@ -66,9 +64,7 @@ import org.springblade.manager.service.ITextdictInfoService;
 import org.springblade.core.boot.ctrl.BladeController;
 
 import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -85,7 +81,6 @@ public class TextdictInfoController extends BladeController {
 
     private final ITextdictInfoService textdictInfoService;
     private final WbsTreePrivateMapper wbsTreePrivateMapper;
-    private final WbsTreePrivateServiceImpl wbsTreePrivateService;
     private final WbsTreeContractServiceImpl wbsTreeContractService;
     private final BladeRedis bladeRedis;
     private final JdbcTemplate jdbcTemplate;
@@ -447,12 +442,16 @@ public class TextdictInfoController extends BladeController {
         String delSql = "delete from m_textdict_info where (tab_id in(SELECT p_key_id from m_wbs_tree_private where project_id='"+wbsTreePrivate.getProjectId()+"' and excel_id='"+wbsTreePrivate.getExcelId()+"' and type=2 and is_deleted=0) or (excel_id="+wbsTreePrivate.getExcelId()+" AND project_id='"+wbsTreePrivate.getProjectId()+"')) and project_id="+wbsTreePrivate.getProjectId()+" and type in(2,6) ";
         jdbcTemplate.execute(delSql);
 
+        // 由于要实现电签 一对多(1个key 对应多个电签Id)
+        Map<String,String> keyMap = new HashMap<>();
+
         // ------- 查询数据库是否存在 该该电签信息 ---------
         for (int i = 0; i < jsonArray.size(); i++) {
             JSONObject jsonObject = jsonArray.getJSONObject(i);
             TextdictInfo textdictInfo = new TextdictInfo();
+            String keky = jsonObject.getString("colKey");
 
-            String[] trtd = jsonObject.getString("colKey").split("__")[1].split("_");
+            String[] trtd = keky.split("__")[1].split("_");
             Element element = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
 
             String id = element.children().get(0).attr("keyname");
@@ -477,15 +476,21 @@ public class TextdictInfoController extends BladeController {
             textdictInfo.setProjectId(wbsTreePrivate.getProjectId());
 
             //由于使用联合主键
-            TextdictInfo one = textdictInfoService.getOne(Wrappers.<TextdictInfo>query().eq("id", textdictInfo.getId()).eq("project_id", textdictInfo.getProjectId()));
+            TextdictInfo one = textdictInfoService.selectTextdictInfoOne(textdictInfo.getId()+"",textdictInfo.getSigRoleId(),textdictInfo.getProjectId());
             if(ObjectUtil.isNotEmpty(one)){
                 textdictInfoService.saveOrUpdate(textdictInfo);
             }else{
                 textdictInfoService.save(textdictInfo);
             }
-
+            String dqId = "";
+            if(keyMap.containsKey(keky)){
+                dqId = keyMap.get(keky)+"||"+textdictInfo.getId();
+            }else{
+                dqId=textdictInfo.getId()+"";
+            }
+            keyMap.put(keky,dqId);
             element.removeAttr("dqId");
-            element.attr("dqId", textdictInfo.getId() + "");
+            element.attr("dqId", keyMap.get(keky));
             if (jsonObject.getInteger("type") == 2) { //个人签字 不能用户输入
                 if (element.html().indexOf("el-tooltip") >= 0) {
                     element.children().get(0).children().get(0).attr(":readonly", "true");
@@ -507,8 +512,6 @@ public class TextdictInfoController extends BladeController {
             jdbcTemplate.execute(updateSqlP);
         }
 
-
-
         //修改对应合同段的htmlUrl,当前项目下对应合同段的节点
         List<Long> cIdsList = wbsTreePrivatesEqual.stream().map(WbsTreePrivate::getId).distinct().collect(Collectors.toList());
 
@@ -776,4 +779,24 @@ public class TextdictInfoController extends BladeController {
         }
     }
 
+
+    /**
+     * 编辑表单 字典
+     */
+    @GetMapping("/getTedtdictInfoById")
+    @ApiOperationSupport(order = 73)
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "id", value = "id", required = true),
+            @ApiImplicitParam(name = "tabId", value = "tabId", required = true)
+    })
+    public R<TextdictInfo> getTedtdictInfoById(String id,String tabId) {
+        WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(Long.parseLong(tabId));
+        TextdictInfo textdictInfo = new TextdictInfo();
+
+        textdictInfo.setId(Func.toLong(Func.toStrList("\\|\\|",id).get(0)));
+        textdictInfo.setProjectId(wbsTreePrivate.getProjectId());
+        TextdictInfoVO detail = textdictInfoService.selectTextdictInfoById(textdictInfo);
+        return R.data(detail);
+    }
+
 }

+ 3 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.java

@@ -47,4 +47,7 @@ public interface TextdictInfoMapper extends EasyBaseMapper<TextdictInfo> {
 
     List<TextdictInfoVO> selectTextdictInfoByExcelId(IPage page, TextdictInfoVO textdictInfo);
     List<TextdictInfoVO> selectTextdictBYIds(@Param("ids") List<String> ids,@Param("projectId") String projectId);
+
+    TextdictInfo selectTextdictInfoOne(@Param("id") String id,@Param("sigRoleId") String sigRoleId,@Param("projectId") String projectId);
+
 }

+ 8 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.xml

@@ -16,7 +16,6 @@
         <result column="sig_role_name" property="sigRoleName"/>
         <result column="pyzbx" property="pyzbx"/>
         <result column="pyzby" property="pyzby"/>
-        <result column="pyzby" property="pyzby"/>
         <result column="excel_id" property="excelId"/>
         <result column="project_id" property="projectId"/>
     </resultMap>
@@ -51,4 +50,12 @@
             #{id}
         </foreach>
     </select>
+
+
+    <select id="selectTextdictInfoOne" resultMap="textdictInfoResultMap">
+        select * from m_textdict_info where is_deleted = 0
+            and id= #{id}
+            and sig_role_id = #{sigRoleId}
+            and project_id= #{projectId}
+    </select>
 </mapper>

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

@@ -45,4 +45,6 @@ public interface ITextdictInfoService extends IService<TextdictInfo> {
     TextdictInfoVO selectTextdictInfoById(TextdictInfo textdictInfo);
 
     void deleDataInfoById(String id);
+
+    TextdictInfo selectTextdictInfoOne(String id,String sigRoleId,String projectId);
 }

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

@@ -2,6 +2,7 @@ package org.springblade.manager.service.impl;
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.StopWatch;
+import org.springblade.core.mp.support.Query;
 import cn.hutool.log.StaticLog;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -48,6 +49,7 @@ import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.common.vo.DataVO;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Condition;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
@@ -97,6 +99,8 @@ import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.stream.Collectors;
 
+import static java.util.stream.Collectors.toMap;
+
 /**
  * 清表基础数据表 服务实现类
  *
@@ -123,7 +127,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     private final IContractInfoService contractInfoService;
     private final IProjectInfoService projectInfoService;
     private final OperationLogClient operationLogClient;
-    private final TrialSelfInspectionRecordClient inspectionRecordClient;
     private final TableInfoServiceImpl tableInfoService;
 
     @Autowired
@@ -358,7 +361,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     /*补充缺失的数据*/
                     List<Long> cp = tableInfoList.stream().map(TableInfo::getPkeyId).map(Long::parseLong).collect(Collectors.toList());
                     List<Long> load = tableAll.stream().map(NodeTable::getPKeyId).filter(pk -> !cp.contains(pk)).collect(Collectors.toList());
-                    Map<Long, String> keyMap = tableAll.stream().collect(Collectors.toMap(NodeTable::getPKeyId, NodeTable::getInitTableName));
+                    Map<Long, String> keyMap = tableAll.stream().collect(toMap(NodeTable::getPKeyId, NodeTable::getInitTableName));
                     Map<String, List<Long>> loadMap = load.stream().collect(Collectors.groupingBy(keyMap::get, Collectors.toList()));
                     loadMap.entrySet().parallelStream().forEach(entry -> {
                         /*init_table_name*/
@@ -1340,7 +1343,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
 
             Elements defText = doc.getElementsByAttribute("defText");
-
             sgtitle.addAll(sgtitle1);
 
             //合同段显示合同编号
@@ -1351,8 +1353,18 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
             Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
 
-            //编号为父节点划分编号
+            //编号为父节点划分编号 “编号:”、“工程编号:”、“编号”、“分项工程编号”、“分部分项编号”
             Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
+            if(wbsTreeContract.getWbsType()==1){
+                Elements bhtitle2 = doc.select("el-input[placeholder~=^工程编号]");
+                Elements bhtitle3 = doc.select("el-input[placeholder~=^分项工程编号]");
+                Elements bhtitle4 = doc.select("el-input[placeholder~=^分部分项编号]");
+                bhtitle.addAll(bhtitle2);
+                bhtitle.addAll(bhtitle3);
+                bhtitle.addAll(bhtitle4);
+            }
+
+
             //合同编号为合同编号
             Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
             bhtitle1.addAll(htdtitle);
@@ -1360,10 +1372,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             bhtitle1.addAll(htdtitle2);
 
 
-            Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
 
 
-            // Elements title = doc.select("el-input[placeholder~=^编号]");
+            Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
+
 
             /**
              * 承包单位 承包单位、施工单位:引用施工单位名称 ,
@@ -1387,7 +1399,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 for (Element element : sgtitle) {
                     int trindex = Integer.parseInt(element.attr("trindex"));
                     String placeholderxx = element.attr("placeholder");
-                    if (trindex < 10 || placeholderxx.equals("施工单位")) {
+                    if ((trindex < 10 || placeholderxx.equals("施工单位")) && placeholderxx.indexOf("自评意见")<0) {
                         reData.put(element.attr("keyName"), contractInfo.getConstructionUnitName());
                     }
                 }
@@ -1408,7 +1420,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     int trindex = Integer.parseInt(element.attr("trindex"));
                     String placeholderxx = element.attr("placeholder");
 
-                    if (trindex < 10 || placeholderxx.equals("监理单位")) {
+                    if ((trindex < 10 || placeholderxx.equals("监理单位")) && placeholderxx.indexOf("自评意见")<0) {
                         reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
                     }
                 }
@@ -1417,7 +1429,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             WbsTreeContract node = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                     .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
                     .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
-            // 编号
+            // 编号 //编号为父节点划分编号 “编号:”、“工程编号:”、“编号”、“分项工程编号”、“分部分项编号”
             if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
                 for (Element element : bhtitle) {
                     int trindex = Integer.parseInt(element.attr("trindex"));
@@ -1452,7 +1464,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             //电签默认值
             if (defText.size() >= 1) {
                 for (Element element : defText) {
-                    reData.put(element.attr("keyName"), element.attr("defText"));
+                    String keys = element.attr("keyName");
+                    String defText2 = element.attr("defText");
+                    if(keys!=null && Func.isNotEmpty(keys)){
+                        reData.put(keys, defText2);
+                    }
                 }
             }
 
@@ -1971,7 +1987,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     .collect(Collectors.toList());
             Long sigSize = table.getElementsByAttribute(":readonly").stream().count();
             int keySize = keyList.size();
-            List<String> fills = DataInfo.keySet().stream().filter(e -> e.contains("__") && e.contains("key")).collect(Collectors.toList());
+            List<String> fills = DataInfo.keySet().stream().filter(e -> e.contains("__") && e.contains("key") && StringUtils.isNotEmpty(e)).collect(Collectors.toList());
             if (fills.size() != 0 && keyList != null && keyList.size() != 0) {
                 if (keySize == sigSize) {
                     realFillRate = 100;
@@ -2704,7 +2720,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         Map<String, WbsFormElement> elementMap = null;
         if (StringUtils.isNotEmpty(wbsTreePrivate.getInitTableId())) {
             String eleSql = "select e_key,e_name from m_wbs_form_element where f_id = " + wbsTreePrivate.getInitTableId();
-            elementMap = jdbcTemplate.query(eleSql, new BeanPropertyRowMapper<>(WbsFormElement.class)).stream().collect(Collectors.toMap(WbsFormElement::getEKey, Function.identity()));
+            elementMap = jdbcTemplate.query(eleSql, new BeanPropertyRowMapper<>(WbsFormElement.class)).stream().collect(toMap(WbsFormElement::getEKey, Function.identity()));
         }
 
         if (dataIn.size() >= 1) {
@@ -3855,12 +3871,31 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             }
         }
 
+        // 获取
+        TextdictInfoVO textdictInfo =new TextdictInfoVO();
+        textdictInfo.setType(2);
+        textdictInfo.setExcelId(wbsTreePrivate.getExcelId()+"");
+        textdictInfo.setTabId(pkeyId+"");
+
+        Query query = new Query();
+        query.setCurrent(0);
+        query.setSize(100);
+        IPage<TextdictInfoVO> pages = textdictInfoService.selectTextdictInfoPage(Condition.getPage(query), textdictInfo);
+        List<TextdictInfoVO> records = pages.getRecords();
+        Map<Long,TextdictInfo> textMap = new HashMap<>();
+        if(records!=null && records.size()>=1) {
+            for (TextdictInfo entity : records) {
+                if (entity.getId() != null) {
+                    textMap.put(entity.getId(), entity);
+                }
+            }
+        }
         //输出流
         FileOutputStream outputStream = new FileOutputStream(excelPath);
         workbook.write(outputStream);
         FileUtils.excelToPdf(excelPath, pdfPath);
-        PdfAddimgUtil.pdfAddImgInfo(pdfPath, String.join(",", sign));
-        return R.data(PdfAddimgUtil.getNetUrl(pdfPath));
+        PdfAddimgUtil.pdfAddImgInfo(pdfPath, String.join(",", sign),textMap);
+        return R.data(FileUtils.getNetUrl(pdfPath));
     }
 
 

+ 9 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java

@@ -69,7 +69,10 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                 Document doc = Jsoup.parse(htmlString);
                 Elements table = doc.getElementsByAttribute("dqid");
                 if(table.size()>=1){
-                    List<String> dqid = table.stream().map(d -> d.attr("dqid")).distinct().collect(Collectors.toList());
+                    List<String> dqid = new ArrayList<>();
+                    for(Element ek:table){
+                        dqid.addAll(Func.toStrList("\\|\\|",ek.attr("dqid")));
+                    }
                     textdict = baseMapper.selectTextdictBYIds(dqid,privateInfo.getProjectId());
                     if(textdict==null || textdict.size()<=0){
                         textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
@@ -83,7 +86,6 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
         }else{
             textdict = baseMapper.selectTextdictInfoPage(page, textdictInfo);
         }
-        System.out.println("+++++++++++++++"+textdict.size());
         return page.setRecords(textdict);
     }
 
@@ -112,6 +114,11 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
         baseMapper.deleteById(id);
     }
 
+    @Override
+    public TextdictInfo selectTextdictInfoOne(String id,String sigRoleId,String projectId) {
+        return baseMapper.selectTextdictInfoOne(id,sigRoleId,projectId);
+    }
+
 
     @Transactional(rollbackFor = Exception.class)
     public boolean insertBatch(Collection<TextdictInfo> entityList, int batchSize) {

+ 4 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

@@ -2705,7 +2705,8 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         if (fileInputStream != null) {
             fileInputStream.close();
         }
-        return R.data(table + "");
+        return R.data(table + "",primaryKeyId);
+
     }
 
     @Override
@@ -2730,8 +2731,8 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         }else{
             return "该合同段没有委托单权限业务";
         }
-
-        return getExcelHtml(pkeyId);
+        Object excelHtml = getExcelHtml(pkeyId);
+        return excelHtml;
     }
 
     private void chart(Element table, WbsTreePrivate wtp) {

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

@@ -49,7 +49,6 @@ public class FileUtils {
         // 循环将文件写入压缩流
         DataOutputStream os = null;
         try {
-
             // 响应头的设置
             response.reset();
             response.setCharacterEncoding("utf-8");
@@ -407,10 +406,26 @@ public class FileUtils {
 
     public static String getSysLocalFileUrl() {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        if (SystemUtils.isMacOs()) {
-            file_path = "/Users/hongchuangyanfa/Desktop/";
-        } else if (SystemUtils.isWindows()) {
-            file_path = "C://upload//";
+        String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+
+        if(sys_isonline.equals("3")){ //正式环境
+            if (SystemUtils.isMacOs()) {
+                file_path = "/Users/hongchuangyanfa/Desktop/";
+            } else if (SystemUtils.isWindows()) {
+                file_path = "C://upload//";
+            }
+        }else if(sys_isonline.equals("2")){ //109测试环境
+            if (SystemUtils.isMacOs()) {
+                file_path = "/Users/hongchuangyanfa/Desktop/";
+            } else if (SystemUtils.isWindows()) {
+                file_path = "C://upload//";
+            }
+        }else{  //本地环境
+            if (SystemUtils.isMacOs()) {
+                file_path = "/Users/hongchuangyanfa/Desktop/";
+            } else if (SystemUtils.isWindows()) {
+                file_path = "C://upload//";
+            }
         }
         return file_path;
     }

+ 39 - 20
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/PdfAddimgUtil.java

@@ -6,6 +6,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -26,11 +27,14 @@ import com.itextpdf.text.pdf.parser.RenderListener;
 import com.itextpdf.text.pdf.parser.TextRenderInfo;
 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.manager.vo.TextdictInfoVO;
 import org.springblade.system.cache.ParamCache;
 
 public class PdfAddimgUtil {
 
-    public static void pdfAddImgInfo(String pdfUrl, String keyword) throws Exception {
+    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";
 
@@ -51,24 +55,31 @@ public class PdfAddimgUtil {
             }
         }
 
-        //String keyword = "1704373937414078464";
 
-        List<float[]> positions = findKeywordPostions(pdfData, keyword);
+        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++) {
-                float[] position = positions.get(i);
-                System.out.print("pageNum: " + (int) position[0]);
-                System.out.print("\tx: " + position[1]);
-                System.out.println("\ty: " + position[2]);
-                gaizhang(pdfFile, new File(pdfUrl), (int) position[0], position[1], position[2], signImg);
+
+                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) throws Exception {
+    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);
@@ -76,8 +87,15 @@ public class PdfAddimgUtil {
         Rectangle pageSize = reader.getPageSize(1);
         float height = pageSize.getHeight();
         float width = pageSize.getWidth();
-        x = width * x ;//- 20;
-        y = height - height * y ;//- 8;
+        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);
 
@@ -148,13 +166,13 @@ public class PdfAddimgUtil {
      * @return List<float [ ]> : float[0]:pageNum float[1]:x float[2]:y
      * @throws IOException
      */
-    public static List<float[]> findKeywordPostions(byte[] pdfData,
+    public static List<PDFIndexInfo> findKeywordPostions(byte[] pdfData,
                                                     String keyword) throws IOException {
-        List<float[]> result = new ArrayList<float[]>();
+        List<PDFIndexInfo> result = new ArrayList<PDFIndexInfo>();
         List<PdfPageContentPositions> pdfPageContentPositions = getPdfContentPostionsList(pdfData);
 
         for (PdfPageContentPositions pdfPageContentPosition : pdfPageContentPositions) {
-            List<float[]> charPositions = findPositions(keyword,
+            List<PDFIndexInfo> charPositions = findPositions(keyword,
                     pdfPageContentPosition);
             if (charPositions == null || charPositions.size() < 1) {
                 continue;
@@ -213,27 +231,28 @@ public class PdfAddimgUtil {
     }
 
 
-    private static List<float[]> findPositions(String keyword,
-                                               PdfPageContentPositions pdfPageContentPositions) {
+    private static List<PDFIndexInfo> findPositions(String keyword,
+                                                    PdfPageContentPositions pdfPageContentPositions) {
 
-        List<float[]> result = new ArrayList<float[]>();
+        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);
-                result.add(postions);
+                data.setDataInfo(postions);
+                data.setPkeyid(text);
+                result.add(data);
                 pos = positionIndex + 1;
             }
         }
-
-
         return result;
     }
 

+ 2 - 4
blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java

@@ -203,7 +203,7 @@ public class DeptController extends BladeController {
     @GetMapping("/tree-userdept-info")
     @ApiOperationSupport(order = 10)
     @ApiOperation(value = "树形结构", notes = "树形结构")
-    public R<List<DeptVO>> getUserDeptTreeInfo(String tenantId, BladeUser bladeUser,String deptType) {
+    public R<List<DeptVO>> getUserDeptTreeInfo(@RequestParam("tenantId") String tenantId, BladeUser bladeUser,@RequestParam("deptType") String deptType) {
         List<DeptVO> tree = deptService.getUserDeptTreeInfo(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()),deptType);
         return R.data(tree);
     }
@@ -221,9 +221,7 @@ public class DeptController extends BladeController {
     @ApiOperationSupport(order = 11)
     @ApiOperation(value = "列表", notes = "传入dept")
     public R<List<DeptVO>> listAllByType(@ApiIgnore @RequestParam Map<String, Object> dept, BladeUser bladeUser) {
-
-        List<DeptVO> list = deptService.listAllByType(bladeUser.getTenantId(),dept.get("deptType")+"" );
-
+        List<DeptVO> list = deptService.listAllByType(bladeUser.getTenantId(),dept.get("deptType")+"" ,dept.get("parentId")+"");
         return R.data(list);
     }
 

+ 1 - 1
blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.java

@@ -75,5 +75,5 @@ public interface DeptMapper extends BaseMapper<Dept> {
     List<DeptVO> getUserDeptTreeInfo(String tenantId,String deptType);
 
     //获取所有部门信息
-    List<DeptVO> listAllByType(String tenantId,String deptType);
+    List<DeptVO> listAllByType(String tenantId,String deptType,String parentId);
 }

+ 5 - 2
blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml

@@ -148,12 +148,15 @@
         and dept_type = #{param2}
         ) AS "minLevel"
         from  blade_view_postuser a where 1=1
-        <if test="param1!=null and param1!=''">
+        <if test="param1!=null and param1!='' and param1!='null'">
             and tenant_id = #{param1}
         </if>
-        <if test="param2!=null and param2!=''">
+        <if test="param2!=null and param2!='' and param2!='null'">
             and dept_type = #{param2}
         </if>
+        <if test="param3!=null and param3!='' and param3!='null' ">
+            and parent_id = #{param3}
+        </if>
         --ORDER BY sort
     </select>
 </mapper>

+ 1 - 1
blade-service/blade-system/src/main/java/org/springblade/system/service/IDeptService.java

@@ -118,7 +118,7 @@ public interface IDeptService extends IService<Dept> {
 
     List<DeptVO> getUserDeptTreeInfo(String tenantId,String deptType);
 
-    List<DeptVO> listAllByType(String tenantId,String deptType);
+    List<DeptVO> listAllByType(String tenantId,String deptType,String parentId);
 
 
 }

+ 3 - 3
blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java

@@ -180,7 +180,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
 
     @Override
     public List<DeptVO> getUserDeptTreeInfo(String tenantId,String deptType) {
-        if(deptType.equals("-1")){
+        if(deptType.equals("-2")){
             deptType="";
             return ForestNodeMerger.merge(baseMapper.getUserDeptTreeInfo(tenantId,deptType));
         }else{
@@ -189,8 +189,8 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
     }
 
     @Override
-    public List<DeptVO> listAllByType(String tenantId, String deptType) {
-        return baseMapper.listAllByType(tenantId,deptType);
+    public List<DeptVO> listAllByType(String tenantId, String deptType,String parentId) {
+        return baseMapper.listAllByType(tenantId,deptType,parentId);
     }
 
 }

+ 1 - 1
blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java

@@ -135,7 +135,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
 
         // 组装配置-后台
         List<RoleMenu> roleMenus = new ArrayList<>();
-        if (menuIds.size() >= 1) {
+        if (menuIds!=null && menuIds.size() >= 1) {
             roleIds.forEach(roleId -> menuIds.forEach(menuId -> {
                 RoleMenu roleMenu = new RoleMenu();
                 roleMenu.setRoleId(roleId);