Bläddra i källkod

保存html上input对象的dqid无法删除
委托单pdf上一个空配置2个电签的问题
附件表

zhuwei 1 dag sedan
förälder
incheckning
1be35711fd

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

@@ -506,7 +506,7 @@ public class TextdictInfoController extends BladeController {
                 element.removeAttr(":readonly");
             }
         }
-        Elements tryInfo = doc.select("td[dqid]");
+        Elements tryInfo = doc.getElementsByAttribute("dqid");// doc.select("td[dqid]");
         if (tryInfo != null && !tryInfo.isEmpty()) {
             for (Element element : tryInfo) {
                 element.removeAttr("dqid");

+ 30 - 46
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/SubTable.java

@@ -2,6 +2,7 @@ package org.springblade.manager.formula.impl;
 
 import com.mixsmart.utils.FormulaUtils;
 import com.mixsmart.utils.StringUtils;
+import io.swagger.models.auth.In;
 import lombok.Data;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringPool;
@@ -34,6 +35,7 @@ public class SubTable {
     private LinkedHashMap<String, Item> original = new LinkedHashMap<>();
     /**检验单检查项目元素,用来排序*/
     private List<FormData> mainList = new ArrayList<>();
+    private List<FormData> inspectionListInfo = new ArrayList<>();
     /**项目名称*/
     private FormData itemName;
     /**设计值*/
@@ -42,7 +44,7 @@ public class SubTable {
     private FormData data;
 
     private TableElementConverter tec;
-
+    private List<Long> delTabList = new ArrayList<>();
 
     public SubTable() {
     }
@@ -93,8 +95,10 @@ public class SubTable {
 
     /*解析项目信息*/
     public void put(List<FormData> inspectionList) {
+
         /*根据行号排序*/
         inspectionList.sort(Comparator.comparingInt(e->e.getCoordsList().get(0).getY()));
+        inspectionListInfo = inspectionList;
         /*检验单、评定表不能超过一页,多余的需要删除并把检测项数据写人附表*/
         /*检验单或者评定表存的超页数据汇总到附表对象*/
           for(FormData fd:inspectionList) {
@@ -107,20 +111,22 @@ public class SubTable {
                   Optional<FormData> designFdOp = tec.formDataMap.values().stream().filter(o -> o.getTableName().equals(fd.getTableName()) && !o.equals(fd) && fd.getMaxRow().equals(o.getMaxRow()) && o.getEName().contains("设计")).findAny();
                   designFdOp.ifPresent(formData -> item.setDesign(formData.getValues().stream().map(ElementData::stringValue).filter(StringUtils::isNotEmpty).collect(Collectors.toList())));
                   item.setData(FormulaUtils.setScale(null, overList).stream().map(ElementData::getValue).filter(StringUtils::isNotEmpty).collect(Collectors.toList()));
+                  item.setColFullName(fd.getEName());
                   group.put(item.getName(), item);
+
              }
           }
     }
 
 
     /**将项目信息写入附表元素*/
-    public void flush(boolean isUpdate) {
+    public void flush() {
         if(!checked()){
             return;
         }
 
         /*获取项目数据*/
-        List<Item> itemList =getPutOutList(isUpdate);
+        List<Item> itemList =getPutOutList();
         if (itemList.size() > 0) {
             /*行号,起始为0,当前行号整除列大小余0就是每页首行*/
             AtomicInteger index=new AtomicInteger(0);
@@ -175,13 +181,16 @@ public class SubTable {
             FormulaUtils.write(data, dataList, true);
             itemName.setUpdate(1);
             data.setUpdate(1);
+        }else{
+            List<NodeTable> mainFBTable = tec.getTableAll().stream().filter(e -> (e.getTableType().equals(1) || e.getTableType().equals(5)) && e.getNodeName().contains("附表") && tec.getCurrentNode().getNodeType() > 3).collect(Collectors.toList());
+            delTabList = mainFBTable.stream().map(e -> e.getPKeyId()).collect(Collectors.toList());
         }
     }
 
     /*获取最终输出的项目信息*/
-    public List<Item> getPutOutList(boolean isUpdate){
+    public List<Item> getPutOutList(){
         /*初始化group,保留原先内容,只做同KEY覆盖*/
-        initOriginal(isUpdate);
+        initOriginal();
         List<Item> itemList = new ArrayList<>(group.values());
         if(this.mainList!=null){
             List<String> itemNameIndex = this.mainList.stream().map(e->FormulaUtils.parseItemName(e.getEName()).trim()).collect(Collectors.toList());
@@ -195,51 +204,21 @@ public class SubTable {
         return itemList;
     }
     /*用原有数据初始化*/
-    private void initOriginal(boolean isUpdate){
-        List<String> itemName = new ArrayList<>();
-
-        if(isUpdate){
-            List<String>  itemName2= this.itemName.getValues().stream().map(ElementData::stringValue).collect(Collectors.toList());
-            for(String name : itemName2){
-                if(StringUtils.isEmpty(name)){
-                    itemName.add(name);
-                    continue;
-                }
-                String lastName = "";
-                int count = 0;
-                for(FormData df :this.mainList){
-                    //箍筋、构造钢筋、螺旋筋间距(mm)
-                    String test = df.getEName().replaceAll("、","").trim();
-                    if(test.indexOf(name)>=0){
-                        lastName = null;
-                        count = 11;
-                        break;
-                    }
-                }
-                if(count==11){
-                    itemName.add(lastName);
-                }else{
-                    itemName.add(name);
-                }
-
-            }
-        }else{
-            itemName = this.itemName.getValues().stream().map(ElementData::stringValue).collect(Collectors.toList());
-        }
-
+    private void initOriginal(){
+        Map<String, String> keyMap = new HashMap<>();
+        List<String> itemName = this.itemName.getValues().stream().map(ElementData::stringValue).collect(Collectors.toList());
         List<String> designs=null;
         if(this.design!=null) {
              designs = this.design.getValues().stream().map(ElementData::stringValue).collect(Collectors.toList());
         }
-        List<Object> data = this.data.getRawValue();
-        String name = "";
-        for (int i = 0; i < itemName.size(); i++) {
-            name = itemName.get(i);
-            if (StringUtils.isNotEmpty( name)) {
-                break;
-            }
+        for(FormData item:this.mainList){
+            String key = FormulaUtils.parseItemName(item.getEName()).trim();
+            keyMap.put(key, "1");
         }
 
+        // 计算元素是否需要覆盖
+        List<Object> data = this.data.getRawValue();
+        String name = itemName.get(0);
         if(StringUtils.isNotEmpty(name)) {
             int head = 0;
             //计算 最后一行之前的数据
@@ -253,13 +232,17 @@ public class SubTable {
                             item.setDesign(designs.subList(head, i).stream().filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList()));
                         }
                         item.setData(new ArrayList<>(data.subList(head*15,  i*ROW_SIZE)));
-                        original.put(name,item);
+                        if(!(inspectionListInfo.size()==0 && keyMap.containsKey(name)) ){
+                            original.put(name,item);
+                        }
                         head = i;
                         name = x;
                     }else{
                         Item item = original.get(name);
                         item.getData().addAll(new ArrayList<>(data.subList(head*15,  i*ROW_SIZE)));
-                        original.put(name,item);
+                        if(!(inspectionListInfo.size()==0 && keyMap.containsKey(name)) ){
+                            original.put(name,item);
+                        }
                         head = i;
                         name = x;
                     }
@@ -298,6 +281,7 @@ public class SubTable {
     public static class Item{
         /*项目的顺序要根据检验单上的自上到下的顺序,相同项目名需要合并,如果存在不同设计值则连续显示;空白行要去除*/
         private String name;
+        private String colFullName; //列全名
         private List<String>design;
         private List<Object> data;
         public Item(String name) {

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

@@ -5262,55 +5262,33 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 }
 
                 // 组装电签设置
-                QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
-                queryWrapper.select("col_key", "id");
-                queryWrapper.in("type", 2, 6);
-                queryWrapper.eq("tab_id", wbsTreePrivate.getPKeyId());
-
-                List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
-                if (textdictInfos != null && !textdictInfos.isEmpty()) {
-                    for (TextdictInfo e : textdictInfos) {
-                        String key = e.getColKey();
-                        String[] keys = key.split("__");
-                        String[] trtd = keys[1].split("_");
-                        if (Integer.parseInt(trtd[0]) < trs.size()) {
-                            Element ytzData = trs.get(Integer.parseInt(trtd[0]));
-                            if (ytzData != null) {
-                                Elements tdsx = ytzData.select("td");
-                                if (Integer.parseInt(trtd[1]) < tdsx.size()) {
-                                    Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
-                                    if (data.html().contains("el-tooltip")) {
-                                        data = data.children().get(0);
-                                    }
+                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"));
 
-                                    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"));
+                        Row row = sheet.getRow(y1 - 1);
+                        if (row != null) {
+                            Cell cell = row.getCell(x1 - 1);
+                            if (cell != null || ObjectUtils.isNotEmpty(cell)) {
+                                short fontIndex = cell.getCellStyle().getFontIndex();
+                                Font oldfontAt = workbook.getFontAt(fontIndex);
+                                Font redFont = workbook.createFont();
+                                redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
+                                redFont.setFontHeightInPoints(Short.valueOf("1"));//设置字体大小
+                                redFont.setFontName(oldfontAt.getFontName());//设置字体
+                                String CellValue = cell.getStringCellValue().trim();
 
-                                    Row row = sheet.getRow(y1 - 1);
-                                    if (row != null) {
-                                        Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
-                                        if (cell != null) {
-                                            short fontIndex = cell.getCellStyle().getFontIndex();
-                                            Font oldfontAt = workbook.getFontAt(fontIndex);
-
-                                            Font redFont = workbook.createFont();
-                                            redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
-                                            redFont.setFontHeightInPoints(Short.valueOf("1"));//设置字体大小
-                                            redFont.setFontName(oldfontAt.getFontName());//设置字体
-
-                                            CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
-                                            newStyle.cloneStyleFrom(cell.getCellStyle());
-                                            newStyle.setFont(redFont);
-                                            cell.setCellStyle(newStyle);
-                                            cell.setCellValue(e.getId() + "");
-                                        } else {
-                                            ObjectUtils.isNotEmpty(cell);
-                                        }
-                                    }
-                                }
+                                CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
+                                newStyle.cloneStyleFrom(cell.getCellStyle());
+                                newStyle.setFont(redFont);
+                                newStyle.setShrinkToFit(true);
+                                cell.setCellStyle(newStyle);
+                                cell.setCellValue(dqid);
                             }
                         }
                     }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 218 - 215
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java


Vissa filer visades inte eftersom för många filer har ändrats