Browse Source

Merge remote-tracking branch 'origin/master'

liuyc 2 years ago
parent
commit
c5471552fa
21 changed files with 1183 additions and 31 deletions
  1. 33 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/MoistureContentDTO.java
  2. 73 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/MixProportionInfo.java
  3. 44 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/RawMaterialsInfo.java
  4. 3 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractLazyVO.java
  5. 331 9
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  6. 126 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/MixProportionInfoController.java
  7. 117 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/RawMaterialsInfoController.java
  8. 67 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/excel/MixProportionInfoExcel.java
  9. 40 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/excel/RawMaterialsInfoExcel.java
  10. 7 5
      blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/FormulaMileage.java
  11. 44 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/MixProportionInfoMapper.java
  12. 26 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/MixProportionInfoMapper.xml
  13. 30 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/RawMaterialsInfoMapper.java
  14. 6 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/RawMaterialsInfoMapper.xml
  15. 22 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IMixProportionInfoService.java
  16. 16 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IRawMaterialsInfoService.java
  17. 4 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  18. 10 12
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java
  19. 165 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/MixProportionInfoServiceImpl.java
  20. 18 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/RawMaterialsInfoServiceImpl.java
  21. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

+ 33 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/MoistureContentDTO.java

@@ -0,0 +1,33 @@
+package org.springblade.manager.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @Param  含水率
+ * @Author wangwl
+ * @Date 2023/8/22 16:00
+ **/
+@Data
+public class MoistureContentDTO {
+
+    @ApiModelProperty(value = "当前位置")
+    private String key ;
+
+    @ApiModelProperty(value = "配合比id")
+    private Long mixProportionId ;
+
+    @ApiModelProperty(value = "黄砂含水率")
+    private BigDecimal sand ;
+
+    @ApiModelProperty(value = "碎石1含水率")
+    private BigDecimal macadamOne ;
+
+    @ApiModelProperty(value = "碎石2含水率")
+    private BigDecimal macadamTwo ;
+
+    @ApiModelProperty(value = "碎石3含水率")
+    private BigDecimal macadamThree ;
+}

+ 73 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/MixProportionInfo.java

@@ -0,0 +1,73 @@
+package org.springblade.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.math.BigDecimal;
+
+/**
+ * @Param   配合比信息表
+ * @Author wangwl
+ * @Date 2023/8/21 16:21
+ **/
+@Data
+@TableName("m_mix_proportion_info")
+@EqualsAndHashCode(callSuper = true)
+public class MixProportionInfo extends BaseEntity {
+
+
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+
+    @ApiModelProperty(value = "合同id")
+    private Long contractId;
+
+    @ApiModelProperty(value = "配合比报告编号")
+    private String reportNumber;
+
+    @ApiModelProperty(value = "设计强度")
+    private String designStrength;
+
+    @ApiModelProperty(value = "水胶比")
+    private String waterBinderRatio;
+
+    @ApiModelProperty(value = "水泥")
+    private BigDecimal cement ;
+
+    @ApiModelProperty(value = "砂")
+    private BigDecimal sand;
+
+    @ApiModelProperty(value = "碎石1")
+    private BigDecimal macadamOne ;
+
+    @ApiModelProperty(value = "碎石2")
+    private BigDecimal macadamTwo;
+
+    @ApiModelProperty(value = "碎石3")
+    private BigDecimal macadamThree;
+
+    @ApiModelProperty(value = "水")
+    private BigDecimal water;
+
+    @ApiModelProperty(value = "掺加剂")
+    private BigDecimal admixture ;
+
+    @ApiModelProperty(value = "粉煤灰")
+    private BigDecimal coalAsh;
+
+    @ApiModelProperty(value = "矿渣粉")
+    private BigDecimal slagPowder;
+
+    @ApiModelProperty(value = "坍落度")
+    private BigDecimal slumps;
+
+    @ApiModelProperty(value = "单位体积重")
+    private String bulkDensity;
+
+    @ApiModelProperty(value = "抗压强度")
+    private BigDecimal compressiveStrength;
+
+}

+ 44 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/RawMaterialsInfo.java

@@ -0,0 +1,44 @@
+package org.springblade.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * @Param   原材料信息表
+ * @Author wangwl
+ * @Date 2023/8/21 16:21
+ **/
+@Data
+@TableName("m_raw_materials_info")
+@EqualsAndHashCode(callSuper = true)
+public class RawMaterialsInfo extends BaseEntity {
+
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+
+    @ApiModelProperty(value = "合同id")
+    private Long contractId;
+
+    @ApiModelProperty(value = "材料名称")
+    private String name;
+
+    @ApiModelProperty(value = "规格型号")
+    private String specification;
+
+    @ApiModelProperty(value = "生产厂商")
+    private String manufacturers;
+
+    @ApiModelProperty(value = "存放地点或料厂号")
+    private String storageSite;
+
+    @ApiModelProperty(value = "批准文号")
+    private String batchNumber;
+
+    @ApiModelProperty(value = "准备数量")
+    private Integer total;
+
+
+}

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractLazyVO.java

@@ -70,4 +70,7 @@ public class WbsTreeContractLazyVO implements Serializable {
     @ApiModelProperty(value = "工程图纸id")
     private Long drawingsId;
 
+    @ApiModelProperty("是否又混泥土,0否1是")
+    private Integer isConcrete;
+
 }

+ 331 - 9
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -290,16 +290,21 @@ public class ExcelTabController extends BladeController {
     public R putFileAttach(@RequestParam("file") MultipartFile file, Long nodeId) {
         String file_path = FileUtils.getSysLocalFileUrl();
         ExcelTab detail = excelTabService.getById(nodeId);
-        // 上传excel文件
-        R<BladeFile> bladeFile = iossClient.addFileInfo(file);
-        BladeFile bladeFile1 = bladeFile.getData();
+
         String filecode = SnowFlakeUtil.getId() + "";
         String thmlUrl = file_path + filecode + ".html";
         String thmlUrl2 = file_path + filecode + "123.html";
-        // 解析excel
+        String exceUrl = file_path + filecode + "123.xlsx";
+
+        // 解析原始excel
         Workbook wb = new Workbook();
         wb.loadFromMHtml(file.getInputStream());
-        //
+
+        // 操作
+        Workbook wb2 = new Workbook();
+        wb2.loadFromMHtml(file.getInputStream());
+        Worksheet sheet2 = wb2.getWorksheets().get(0);
+
         HTMLOptions options = new HTMLOptions();
         options.setImageEmbedded(true);
         //获取工作表
@@ -307,13 +312,14 @@ public class ExcelTabController extends BladeController {
         sheet.saveToHtml(thmlUrl, options);
 
         CellRange[] mergedCells = sheet.getMergedCells();
+        CellRange[] mergedCells3 = sheet2.getMergedCells();
         Map<String, Map<String, Integer>> xyList = new HashMap<>();
         int j = 0;
         for (int i = 0; i < mergedCells.length; i++) {
             Map<String, Integer> dataMap = new HashMap<>();
             CellRange mergedCell = mergedCells[i];
             j = j + 1;
-            mergedCell.getComment().getRichText().setText(j + "");
+            mergedCells3[i].getComment().getRichText().setText(j + "");
             mergedCell.setValue(j + "");
             dataMap.put("x1", mergedCell.getRow());
             dataMap.put("x2", mergedCell.getLastRow());
@@ -323,12 +329,13 @@ public class ExcelTabController extends BladeController {
         }
 
         CellRange[] mergedCells2 = sheet.getCells();
+        CellRange[] mergedCells4 = sheet2.getCells();
         for (int i = 0; i < mergedCells2.length; i++) {
             CellRange mergedCell = mergedCells2[i];
             String data = mergedCell.getComment().getRichText().getText();
             if (StringUtils.isEmpty(data)) {
                 j = j + 1;
-                mergedCell.getComment().getRichText().setText(j + "");
+                mergedCells4[i].getComment().getRichText().setText(j + "");
                 mergedCell.setValue(j + "");
                 Map<String, Integer> dataMap = new HashMap<>();
                 dataMap.put("x1", mergedCell.getRow());
@@ -375,11 +382,16 @@ public class ExcelTabController extends BladeController {
             }
         }
 
+        // 上传excel文件
+        wb2.saveToFile(exceUrl,FileFormat.Version2013);
+
+        BladeFile bladeFile = newIOSSClient.uploadFile(file.getOriginalFilename(),exceUrl);
+
         File writeFile = new File(thmlUrl);
         FileUtil.writeToFile(writeFile, doc1.html(), Boolean.parseBoolean("UTF-8"));
 
         detail.setExtension(file.getOriginalFilename());
-        detail.setFileUrl(bladeFile1.getLink());
+        detail.setFileUrl(bladeFile.getLink());
         detail.setFileType(3); // 表示为清表信息  1 表示祖节点  2 表示为节点信息 3 表示清表
         detail.setHtmlUrl(thmlUrl);
         excelTabService.saveOrUpdate(detail);
@@ -917,6 +929,316 @@ public class ExcelTabController extends BladeController {
         File file1 = ResourceUtil.getFile(thmlUrl);
         String htmlString = IoUtil.readToString(new FileInputStream(file1));
 
+        /*
+           解析
+           1 解析样式
+           2 计算坐标
+           3 计算区域位置
+         */
+        // 样式集合
+        Document doc = Jsoup.parse(htmlString);
+        // 解析 style
+        Map<String, String> styleMap = getHtmlStyle(doc);
+        //解析
+        Element table = doc.select("table").first();
+        Elements trs = table.select("tr");
+        // 获取图片信息
+        Elements imgs = doc.select("img");
+        // 获取总行列数
+        int maxCol = doc.select("Col").size();
+        String[] rowData = new String[trs.size() + 5]; //本来加一的 害怕出现特殊情况 故意 加 5
+
+        // 行的状态
+        boolean index_state = false;
+        // 区域划分表示
+        int xy_type = 1;
+
+        // 解析 excel元素集合
+        List<ExctabCell> colTitle = new ArrayList<>();
+
+//      标题集合信息
+        List<Map<String, String>> zikey = new ArrayList<>();
+        for (int i = 0; i <= trs.size() - 1; i++) {
+            Element tr = trs.get(i);
+            Elements tds = tr.select("td");
+            String xyInof = getTrInfo(tds, styleMap, index_state, xy_type, maxCol, i, zikey);
+            xy_type = Integer.parseInt(xyInof.split(",")[0]);
+            tr.attr("xy_type", xyInof);
+            index_state = Boolean.parseBoolean(xyInof.split(",")[1]);
+
+            boolean istrue = Boolean.parseBoolean(xyInof.split(",")[3]);
+
+            // 计算单元格坐标
+            for (int j = 0; j < tds.size(); j++) {
+                {
+                    Element data = tds.get(j);
+                    int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
+                    int rowspan = data.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(data.attr("ROWSPAN"));
+                    String keyId = data.attr("class");
+                    if (StringUtils.isNotEmpty(keyId)) {
+                        data.removeAttr("class");
+                    }
+
+                    // 计算
+                    int x1 = Integer.parseInt(data.attr("x1"));
+                    int x2 = Integer.parseInt(data.attr("x2"));;
+                    int y1 = Integer.parseInt(data.attr("y1"));;
+                    int y2 = Integer.parseInt(data.attr("y2"));;
+
+                    String textInfo = data.text().trim().replaceAll(" ", "");
+                    System.out.println("-------=="+textInfo);
+
+                    data.text(textInfo.replaceAll(" ", ""));
+                    if (textInfo.indexOf("□") < 0 && !textInfo.isEmpty() && !(textInfo.equals("/") && textInfo.length() < 2) && !(textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) && !textInfo.equals("—") && !textInfo.equals("-")) {  // 标题区域
+                        Map<String, String> dataInfo = new HashMap<String, String>();
+                        dataInfo.put("name", textInfo);
+                        dataInfo.put("x1", x1 + "");
+                        dataInfo.put("x2", x2 + "");
+                        dataInfo.put("y1", y1 + "");
+                        dataInfo.put("y2", y2 + "");
+                        dataInfo.put("xytype", xy_type + "");
+                        if (textInfo.indexOf("/") < 0 || (textInfo.indexOf("/") >= 0 && textInfo.length() > 1)) { // 带/为分割数据
+                            zikey.add(dataInfo);
+                        }
+                    } else { //空行
+
+                        List<Map<String, String>> left = new ArrayList<>();
+                        List<Map<String, String>> top = new ArrayList<>();
+                        for (int k = 0; k < zikey.size(); k++) {
+                            String name = zikey.get(k).get("name");
+                            int xx1 = Integer.parseInt(zikey.get(k).get("x1"));
+                            int xx2 = Integer.parseInt(zikey.get(k).get("x2"));
+                            int yy1 = Integer.parseInt(zikey.get(k).get("y1"));
+                            int yy2 = Integer.parseInt(zikey.get(k).get("y2"));
+                            int xytype2 = Integer.parseInt(zikey.get(k).get("xytype"));
+
+                            // 左匹配
+                            if (yy1 <= y1 && yy2 >= y2 && xx2 < x1 && xytype2 == xy_type) {
+                                left.add(zikey.get(k));
+                            }
+
+                            //向 上 匹配
+                            if (index_state) {
+                                if (xx1 <= x1 && xx2 >= x2 && yy2 < y1 && xytype2 == xy_type) {
+                                    top.add(zikey.get(k));
+                                }
+                            }
+                        }
+
+                        String inputText = "";
+                        // 特征值赛选 规则
+                        for (int k = 0; k < left.size(); k++) { // 左计算
+                            String name = left.get(k).get("name");
+                            int xx2 = Integer.parseInt(left.get(k).get("x2"));
+                            int yy2 = Integer.parseInt(left.get(k).get("y2"));
+
+                            if (!StringUtil.isNumeric(name) && name.length() <= 20) { // 数字不匹配
+                                if (index_state) { // 正向规则匹配
+                                    if (istrue) { // 是否空格等于值
+                                        if (x1 - xx2 <= 1 && y1 == yy2) {
+                                            inputText = name;
+                                        } else {
+                                            inputText += name + "_";
+                                        }
+                                    } else {
+                                        inputText += name + "_";
+                                    }
+                                } else {
+                                    if (x1 - xx2 <= 1 && y1 == yy2) {
+                                        inputText = name;
+                                    }
+                                }
+                            }
+                        }
+
+                        // 特征值赛选 规则
+                        if (top != null && top.size() >= 1) {
+                            for (int k = 0; k < top.size(); k++) { // 向上计算
+                                String name = top.get(k).get("name");
+                                if (!StringUtil.isNumeric(name) && name.length() <= 20) {
+                                    inputText += name + "_";
+                                }
+                            }
+                        }
+
+                        if (inputText != null && inputText != "" && inputText.indexOf("_") >= 0) {
+                            inputText = inputText.substring(0, inputText.lastIndexOf("_"));
+                        }
+
+                        // 质检表特殊处理匹配
+                        String parm = i + "," + j + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
+                        // 设置文本信息
+                        ExctabCell exctabCell = new ExctabCell();
+                        if ((textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) || inputText.indexOf("日期") >= 0) {
+                            if (inputText.indexOf("日期") >= 0) {
+                                data.empty().append("<el-date-picker type='date' @keyDowns='dateKeydown()' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='" + inputText + "'> </el-date-picker>");
+                            } else if (textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) {
+                                if (inputText.indexOf("专业监理工程师") >= 0) {
+                                    inputText = "专业监理工程师_年月日";
+                                } else if (inputText.indexOf("质检工程师") >= 0) {
+                                    inputText = "质检工程师_年月日";
+                                } else {
+                                    inputText = "年月日";
+                                }
+                            }
+                            data.empty().append("<el-date-picker @keyDowns='dateKeydown()'  type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
+                            exctabCell.setTextInfo(inputText);
+                            exctabCell.setExctabId(excelId);
+                            exctabCell.setIsDeleted(0);
+                            exctabCell.setXys(i + "_" + j);
+                            colTitle.add(exctabCell);
+                            data.attr("title", inputText);
+
+                        } else if (textInfo.indexOf("□") >= 0) { //多选框
+                            exctabCell.setTextInfo(inputText);
+                            exctabCell.setExctabId(excelId);
+                            exctabCell.setIsDeleted(0);
+                            exctabCell.setXys(i + "_" + j);
+                            colTitle.add(exctabCell);
+                            data.attr("title", inputText);
+                            // 添加多选框
+
+                            String[] cheText = textInfo.split("□");
+                            JSONArray objs = new JSONArray();
+                            if (cheText != null && cheText.length >= 1) {
+                                int key = 1;
+                                for (String keyval : cheText) {
+                                    JSONObject jsonObject = new JSONObject();
+                                    if (StringUtils.isNotEmpty(keyval)) {
+                                        jsonObject.put("key", key);
+                                        jsonObject.put("name", keyval);
+                                        objs.add(jsonObject);
+                                        keyId += 1;
+                                    }
+                                }
+                            } else {
+                                JSONObject jsonObject = new JSONObject();
+                                jsonObject.put("key", "1");
+                                jsonObject.put("name", "");
+                                objs.add(jsonObject);
+                            }
+
+                            String checkbox = "<hc-form-checkbox-group @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' :objs='" + objs + "'  @change='checkboxGroupChange' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " placeholder=''> </hc-form-checkbox-group>";
+                            data.empty().append(checkbox);
+                        } else {
+                            if (index_state) { // 区域内
+                                if (rowspan >= 1) {
+                                    data.empty().append("<el-input type='textarea' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft'  @keydown.shift.right='keyupShiftRight'  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
+                                } else {
+                                    data.empty().append("<el-input type='text' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft'  @keydown.shift.right='keyupShiftRight'  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
+                                }
+                            } else { // 区域外
+                                if (j == 0) {
+                                    if (colspan == maxCol && i >= 1) {
+                                        if (rowspan >= 1) {
+                                            data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='textarea'  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
+                                        } else {
+                                            data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='text' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
+                                        }
+                                    }
+                                } else {
+                                    Element bforData = tds.get(j - 1);
+                                    if (!bforData.text().isEmpty() || bforData.html().indexOf("hc-form-checkbox-group") >= 0) {
+                                        if (rowspan >= 1) {
+                                            data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='textarea' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
+                                        } else {
+                                            data.empty().append("<el-input @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft'  @keydown.shift.right='keyupShiftRight' type='text' @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
+                                        }
+                                    }
+                                }
+                            }
+
+                            if (!inputText.equals("")) {
+                                exctabCell.setExctabId(excelId);
+                                exctabCell.setTextInfo(inputText);
+                                if (inputText.contains("日期") || inputText.contains("年") || inputText.contains("月") || inputText.contains("日")) {
+                                    //日期
+                                    exctabCell.setTextElementType(4);
+                                } else if (inputText.indexOf("签字") >= 0) {
+                                    exctabCell.setTextElementType(6);
+                                } else {
+                                    //字符串
+                                    exctabCell.setTextElementType(1);
+                                }
+                                exctabCell.setIsDeleted(0);
+                                exctabCell.setXys(i + "_" + j);
+                                colTitle.add(exctabCell);
+                            }
+                            data.attr("title", inputText);
+                        }
+                    }
+                }
+            }
+        }
+
+        // 去掉重复的数
+        Map<String, String> groupMap2 = colTitle.stream()
+                .collect(Collectors.groupingBy(ExctabCell::getTextInfo, Collectors.mapping(ExctabCell::getXys, Collectors.joining(","))));
+        exctabCellService.DeletExcelByTableId(excelId + "");
+
+        List<ExctabCell> colTitle2 = new ArrayList<>();
+        for (String title : groupMap2.keySet()) {
+            ExctabCell exctabCell = new ExctabCell();
+            exctabCell.setExctabId(excelId);
+            exctabCell.setIsDeleted(0);
+            exctabCell.setTextInfo(title);
+            exctabCell.setCreateTime(new Date());
+
+            if (title.contains("日期") || title.contains("年") || title.contains("月") || title.contains("日")) {
+                //日期
+                exctabCell.setTextElementType(4);
+            } else {
+                //字符串
+                exctabCell.setTextElementType(1);
+            }
+            exctabCell.setXys(groupMap2.get(title));
+            colTitle2.add(exctabCell);
+        }
+        exctabCellService.saveBatch(colTitle2);
+
+        //对excel 的图片进行操作
+        ExcelTab exceltab = excelTabService.getById(excelId);
+        if(exceltab!=null){
+            // 获取excle 的数据
+            String fileUrl = exceltab.getFileUrl();
+            InputStream ossInputStream = CommonUtil.getOSSInputStream(fileUrl);
+            Workbook wb = new Workbook();
+            wb.loadFromMHtml(ossInputStream);
+            Worksheet sheet = wb.getWorksheets().get(0);
+            PicturesCollection pictures = sheet.getPictures();
+            if(pictures!=null && pictures.size()>=1){
+                for (int i=0 ; i<pictures.size() ; i++){
+                    ExcelPicture pic = pictures.get(i);
+                    int x = pic.getLeftColumn();
+                    int y = pic.getBottomRow();
+                    Elements select = doc.select("el-input[x1=" + x + "][y1=" + y + "]");
+
+                    if(select!=null && select.size()>=1){
+                        Element element = select.get(0);
+                        Element elementP = element.parent();
+                        element.remove();
+                        Element imgele = imgs.get(i);
+                        imgele.removeAttr("class");
+                        elementP.append(imgele.toString());
+                    }
+                }
+            }
+            ossInputStream.close();
+        }
+        // 移除图片
+        imgs.remove();
+        // 保存
+        File writefile = new File(thmlUrl);
+        FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
+    }
+
+    // 上传解析 html
+    public void expailHtmlInfo1111111(String thmlUrl, Long excelId) throws Exception {
+
+        // 读取
+        File file1 = ResourceUtil.getFile(thmlUrl);
+        String htmlString = IoUtil.readToString(new FileInputStream(file1));
+
         /*
            解析
            1 解析样式
@@ -3150,7 +3472,7 @@ public class ExcelTabController extends BladeController {
     @ApiOperation(value = "onlyOffice保存回调", notes = "onlyOffice保存回调")
     @ApiOperationSupport(order = 35)
     @ResponseBody
-    public ExcelEditCallback saveWord(@RequestBody ExcelEditCallback callback) {
+    public ExcelEditCallback callbackSave(@RequestBody ExcelEditCallback callback) {
         return excelTabService.callbackSave(callback);
     }
 

+ 126 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/MixProportionInfoController.java

@@ -0,0 +1,126 @@
+package org.springblade.manager.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.dto.MoistureContentDTO;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.service.IMixProportionInfoService;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/mixProportion")
+@Api(value = "试验数据-配合比", tags = "试验数据-配合比")
+public class MixProportionInfoController extends BladeController {
+
+    private final IMixProportionInfoService mixProportionInfoService;
+
+
+    /**
+     * 计算含水率
+     */
+    @PostMapping("/calculateWater")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "计算含水率", notes = "计算含水率")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "key", value = "当前输入框位置", required = true),
+            @ApiImplicitParam(name = "MixProportionId", value = "配合比id", required = true),
+            @ApiImplicitParam(name = "sand", value = "黄砂含水率", required = true),
+            @ApiImplicitParam(name = "macadamOne", value = "碎石1含水率", required = true),
+            @ApiImplicitParam(name = "macadamTwo", value = "碎石2含水率", required = true),
+            @ApiImplicitParam(name = "macadamThree", value = "碎石3含水率", required = true),
+    })
+    public R calculateWater(@Valid @RequestBody MoistureContentDTO dto) {
+        return mixProportionInfoService.calculateWater(dto);
+    }
+
+
+    /**
+     * 设计强度列表
+     */
+    @GetMapping("/designStrengthList")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "设计强度列表", notes = "模糊搜索")
+    public R<List<MixProportionInfo>> designStrengthList(@RequestParam String searchValue,Long contractId) {
+        List<MixProportionInfo> list = mixProportionInfoService.designStrengthList(searchValue,contractId);
+        return R.data(list);
+    }
+
+    /**
+     * 删除 配合比
+     */
+    @GetMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        return R.status(mixProportionInfoService.deleteLogic(Func.toLongList(ids)));
+    }
+
+    /**
+     * 修改 配合比
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改-配合比", notes = "传入mixProportionInfo")
+    public R update(@Valid @RequestBody MixProportionInfo info) {
+        return R.status(mixProportionInfoService.updateById(info));
+    }
+
+    /**
+     * 新增 配合比
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增-配合比", notes = "传入mixProportionInfo")
+    public R save(@Valid @RequestBody MixProportionInfo info) {
+        return R.status(mixProportionInfoService.save(info));
+    }
+
+
+    /**
+     * 自定义分页 原材
+     */
+    @GetMapping("/page")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页-配合比", notes = "搜索传入报告编号")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "searchValue", value = "搜索值"),
+            @ApiImplicitParam(name = "projectId", value = "项目id"),
+            @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
+    })
+    public R<IPage<MixProportionInfo>> page(String searchValue, Query query,Long contractId) {
+        IPage<MixProportionInfo> page = new Page<>(query.getCurrent(),query.getSize());
+        IPage<MixProportionInfo> iPage = mixProportionInfoService.page(page, new LambdaQueryWrapper<MixProportionInfo>()
+                .eq(MixProportionInfo::getContractId,contractId)
+                .like(StringUtils.isNotBlank(searchValue),MixProportionInfo::getReportNumber, searchValue));
+        return R.data(iPage);
+    }
+
+    /**
+     * 导入配合比
+     */
+    @PostMapping("importMixProportionInfo")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "导入-配合比", notes = "传入excel")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "file", value = "文件源", required = true),
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+            @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
+    })
+    public R importMixProportionInfo(@RequestParam("file") MultipartFile file,Long projectId,Long contractId) {
+         return mixProportionInfoService.importMixProportionInfo(file,projectId,contractId);
+
+    }
+}

+ 117 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/RawMaterialsInfoController.java

@@ -0,0 +1,117 @@
+package org.springblade.manager.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.entity.RawMaterialsInfo;
+import org.springblade.manager.excel.RawMaterialsInfoExcel;
+import org.springblade.manager.service.IRawMaterialsInfoService;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.Valid;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/rawMaterials")
+@Api(value = "试验数据-原材", tags = "试验数据-原材")
+public class RawMaterialsInfoController extends BladeController {
+
+    private final IRawMaterialsInfoService rawMaterialsInfoService;
+
+
+    /**
+     * 删除 原材
+     */
+    @GetMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        return R.status(rawMaterialsInfoService.deleteLogic(Func.toLongList(ids)));
+    }
+
+
+    /**
+     * 修改 原材
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改-原材", notes = "传入rawMaterialsInfo")
+    public R update(@Valid @RequestBody RawMaterialsInfo info) {
+        return R.status(rawMaterialsInfoService.updateById(info));
+    }
+
+
+    /**
+     * 新增 原材
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增-原材", notes = "传入rawMaterialsInfo")
+    public R save(@Valid @RequestBody RawMaterialsInfo info) {
+        return R.status(rawMaterialsInfoService.save(info));
+    }
+
+    /**
+     * 自定义分页 原材
+     */
+    @GetMapping("/page")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页-原材", notes = "搜索传入批准文号")
+    public R<IPage<RawMaterialsInfo>> page(String searchValue, Query query,Long contractId) {
+        IPage<RawMaterialsInfo> page = new Page<>(query.getCurrent(),query.getSize());
+        IPage<RawMaterialsInfo> iPage = rawMaterialsInfoService.page(page, new LambdaQueryWrapper<RawMaterialsInfo>()
+                .eq(RawMaterialsInfo::getContractId,contractId)
+                .like(StringUtils.isNotBlank(searchValue),RawMaterialsInfo::getBatchNumber, searchValue));
+        return R.data(iPage);
+    }
+
+
+    /**
+     * 导入原材信息
+     */
+    @PostMapping("/importRawMaterialsInfo")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "导入-原材信息", notes = "传入excel")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "file", value = "文件源", required = true),
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+            @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
+    })
+    public R importRawMaterialsInfo(@RequestParam("file") MultipartFile file,Long projectId,Long contractId) {
+        List<RawMaterialsInfoExcel> list = ExcelUtil.read(file, RawMaterialsInfoExcel.class);
+        if(list!=null && list.size()>=1){
+            List<RawMaterialsInfo> vos = list.stream().map(f -> {
+                RawMaterialsInfo tag = new RawMaterialsInfo();
+                BeanUtil.copy(f,tag);
+                tag.setProjectId(projectId);
+                tag.setContractId(contractId);
+                return tag;
+            }).collect(Collectors.toList());
+            rawMaterialsInfoService.saveBatch(vos);
+            return R.success("导入成功");
+        }else {
+            return R.fail("没有一条数据");
+        }
+    }
+}

+ 67 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/excel/MixProportionInfoExcel.java

@@ -0,0 +1,67 @@
+package org.springblade.manager.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *
+ */
+@Data
+@ColumnWidth(16)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class MixProportionInfoExcel implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ExcelProperty(value = "配合比报告编号")
+    private String reportNumber;
+
+    @ExcelProperty(value = "设计强度")
+    private String designStrength;
+
+    @ExcelProperty(value = "水胶比")
+    private String waterBinderRatio;
+
+    @ExcelProperty(value = "水泥")
+    private Double cement ;
+
+    @ExcelProperty(value = "砂")
+    private Double sand;
+
+    @ExcelProperty(value = "碎石1")
+    private Double macadamOne ;
+
+    @ExcelProperty(value = "碎石2")
+    private Double macadamTwo;
+
+    @ExcelProperty(value = "碎石3")
+    private Double macadamThree;
+
+    @ExcelProperty(value = "水")
+    private Double water;
+
+    @ExcelProperty(value = "掺加剂")
+    private Double admixture;
+
+    @ExcelProperty(value = "粉煤灰")
+    private Double coalAsh;
+
+    @ExcelProperty(value = "矿渣粉")
+    private Double slagPowder;
+
+    @ExcelProperty(value = "坍落度")
+    private Double slumps;
+
+    @ExcelProperty(value = "单位体积重")
+    private String bulkDensity;
+
+    @ExcelProperty(value = "28天抗压强度")
+    private Double compressiveStrength;
+
+
+}

+ 40 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/excel/RawMaterialsInfoExcel.java

@@ -0,0 +1,40 @@
+package org.springblade.manager.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *
+ */
+@Data
+@ColumnWidth(16)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class RawMaterialsInfoExcel implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ExcelProperty(value = "材料名称")
+    private String name;
+
+    @ExcelProperty(value = "规格型号")
+    private String specification;
+
+    @ExcelProperty(value = "生产厂商")
+    private String manufacturers;
+
+    @ExcelProperty(value = "存放地点或料厂号")
+    private String storageSite;
+
+    @ExcelProperty(value = "试验批准文号")
+    private String batchNumber;
+
+    @ExcelProperty(value = "准备数量")
+    private Integer total;
+
+
+}

+ 7 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/FormulaMileage.java

@@ -44,6 +44,7 @@ public class FormulaMileage implements FormulaStrategy {
     public static final String DX = "dx";
     public static final String DY = "dy";
     public static final String DS = "ds";
+    public static final String F_DEV="WP['G10pcfw']";
     public static final List<String> KEYS = new ArrayList<>(Arrays.asList(ZH, PW, SJX, SJY, SCX, SCY, DX, DY, DS));
     private List<String> relyList;
 
@@ -97,17 +98,18 @@ public class FormulaMileage implements FormulaStrategy {
             Map<String, String[]> coordinateMap = mileageClient.mileage2Coordinate(zhpw, Func.toLong(tec.getContractId()));
             /*G10缓存对象*/
             if (coordinateMap.size() > 0) {
+                String dev= Optional.ofNullable(Expression.parse(F_DEV).calculate(tec.getConstantMap())).map(Object::toString).orElse(cur.getFormula().getDev());
+                if (StringUtils.isEmpty(dev)) {
+                    dev = Mileage.DEV;
+                }
+                String finalDev = dev;
                 mileageList.forEach(m -> {
                     String[] coordinate = coordinateMap.get(m.getZhPw());
                     if (coordinate != null) {
                         m.setSjx(coordinate[0]);
                         m.setSjy(coordinate[1]);
                         if (m.isEmptyDev()) {
-                            String dev = cur.getFormula().getDev();
-                            if (StringUtils.isEmpty(dev)) {
-                                dev = Mileage.DEV;
-                            }
-                            Map<String, Object> xyz = FormulaUtils.triangleSquare(dev);
+                            Map<String, Object> xyz = FormulaUtils.triangleSquare(finalDev);
                             m.setDx(xyz.get("X").toString());
                             m.setDy(xyz.get("Y").toString());
                             m.setDs(xyz.get("Z").toString());

+ 44 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/MixProportionInfoMapper.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.MapKey;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.ArchiveFile;
+import org.springblade.manager.entity.ArchiveTreeContract;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.vo.ArchiveTreeContractVO;
+import org.springblade.manager.vo.ArchiveTreeContractVO2;
+import org.springblade.manager.vo.ArchiveTreeContractVO3;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author 00
+ * @since 2023-02-18
+ */
+public interface MixProportionInfoMapper extends BaseMapper<MixProportionInfo> {
+
+    List<MixProportionInfo> designStrengthList(@Param("searchValue") String searchValue,@Param("contractId") Long contractId);
+
+    Integer compareInfo(@Param("number") Set<String> number,@Param("strength") Set<String> strength,@Param("contractId") Long contractId);
+}

+ 26 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/MixProportionInfoMapper.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.manager.mapper.MixProportionInfoMapper">
+
+
+    <select id="designStrengthList" resultType="org.springblade.manager.entity.MixProportionInfo">
+        select id,design_strength
+        from m_mix_proportion_info
+        WHERE is_deleted = 0 and contract_id = #{contractId}
+        <if test="searchValue!=null and searchValue !=''">
+            and design_strength like concat(concat('%', #{searchValue}),'%')
+        </if>
+    </select>
+    <select id="compareInfo" resultType="java.lang.Integer">
+        select count(1)
+        from m_mix_proportion_info
+        WHERE is_deleted = 0 and report_number in
+        <foreach collection="number" item="n" open="(" separator="," close=")">
+            #{n}
+        </foreach>
+        or
+        <foreach collection="strength" item="s" open="(" separator="," close=")">
+            #{s}
+        </foreach>
+    </select>
+</mapper>

+ 30 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/RawMaterialsInfoMapper.java

@@ -0,0 +1,30 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.entity.RawMaterialsInfo;
+
+/**
+ * @author 00
+ * @since 2023-02-18
+ */
+public interface RawMaterialsInfoMapper extends BaseMapper<RawMaterialsInfo> {
+
+}

+ 6 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/RawMaterialsInfoMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.manager.mapper.RawMaterialsInfoMapper">
+
+
+</mapper>

+ 22 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IMixProportionInfoService.java

@@ -0,0 +1,22 @@
+package org.springblade.manager.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.core.tool.api.R;
+import org.springblade.manager.dto.MoistureContentDTO;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.entity.RawMaterialsInfo;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+import java.util.Set;
+
+public interface IMixProportionInfoService extends BaseService<MixProportionInfo> {
+
+    List<MixProportionInfo> designStrengthList(String searchValue,Long contractId);
+
+    Integer compareInfo(Set<String> number, Set<String> strength, Long contractId);
+
+    R importMixProportionInfo(MultipartFile file, Long projectId, Long contractId);
+
+    R calculateWater(MoistureContentDTO dto);
+}

+ 16 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IRawMaterialsInfoService.java

@@ -0,0 +1,16 @@
+package org.springblade.manager.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.manager.dto.ArchiveTreeContractAutoRuleMapDTO;
+import org.springblade.manager.dto.ArchiveTreeDTO;
+import org.springblade.manager.dto.ArchiveTreeSortDTO;
+import org.springblade.manager.entity.ArchiveTree;
+import org.springblade.manager.entity.RawMaterialsInfo;
+import org.springblade.manager.vo.ArchiveTreeVO2;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IRawMaterialsInfoService extends BaseService<RawMaterialsInfo> {
+
+}

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

@@ -595,9 +595,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             try {
                 //获取onlyOffice缓存中的文件流
                 URL url = new URL(downloadUri);
-                String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+                String file_path = FileUtils.getSysLocalFileUrl();
                 String filecode = SnowFlakeUtil.getId() + "";
-                String dataUrl = file_path + "/excel/" + filecode + ".pdf";
+                String dataUrl = file_path + "/excel/" + filecode + ".xlsx";
                 java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
                 connection.setRequestMethod("GET");
                 connection.setConnectTimeout(5 * 1000);
@@ -627,9 +627,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 excelTab.setFileUrl(bladeFile.getLink());
                 baseMapper.updateById(excelTab);
                 File file = new File(dataUrl);
-                if (file.exists()) {
+               /* if (file.exists()) {
                     file.delete();
-                }
+                }*/
                 System.out.println("123456");
             } catch (Exception e) {
                 editCallback.setError(1);

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

@@ -152,14 +152,10 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         CurrentNode one=this.tec.getCurrentNode();
         tec.formDataList=list;
         keyWord(tec.constantMap);
-     /*   ContractInfo info =this.contractInfoService.getById(tec.getContractId());
-        ProjectInfo pji=this.projectInfoService.getById(tec.getProjectId());*/
+
         /*wbs节点链*/
         if(ExecuteType.INSPECTION.equals(tec.getExecuteType())) {
-          /*  List<WbsTreeContract> nodes = wpService.chain(tec.getContractId(), one.getId(), one.getPkId(), null);
-            if (Func.isEmpty(nodes)) {
-                nodes = wpService.chain(tec.getContractId(), one.getRelateId(), one.getPkId(), null);
-            }*/
+
             List<WbsTreeContract> nodes = wpService.tracing(one.getPkId());
             if (Func.isEmpty(nodes)) {
                 this.tec.getLog().append("【WBS信息缺失】");
@@ -171,7 +167,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             List<AppWbsTreeContractVO> tableList =wbsTreeContractService.searchNodeAllTable(one.getPkId().toString(), "1", tec.getContractId().toString(),tec.getProjectId().toString());
             tec.constantMap.put(TABLE_LIST,tableList);
             /*监表质量附件,过滤掉隐藏表格*/
-            tec.constantMap.put("tableNames",tableList.stream().filter(e->StringUtils.isEquals(e.getIsBussShow(),1)).map(WbsTreeContract::getNodeName).collect(Collectors.toList()));
+            tec.constantMap.put("tableNames",tableList.stream().filter(e->StringUtils.isEquals(e.getIsBussShow(),1)&&StringUtils.isNotEquals(e.getTableType(),4)).map(WbsTreeContract::getNodeName).collect(Collectors.toList()));
 /*
             tec.constantMap.put("tableNames",tableList.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList()));
 */
@@ -1511,10 +1507,10 @@ public  List<ElementData> setScale(Integer scale,List<ElementData> data){
                  }
                  if(f.contains(".option")){
                      /*FC.optionC?是无法嵌套的函数*/
-                     Matcher m = RegexUtils.matcher(FC_REG+"(optionC?)\\(([^)]+)\\)",f);
+                     Matcher m = RegexUtils.matcher(FC_REG+"optionC?\\(([^)(]+),",f);
                      while (m.find()){
-                       String[] args= m.group(2).split(",");
-                       String flag=args[0];
+                     /*  String[] args= m.group(2).split(",");*/
+                       String flag=m.group(1);
                        /*radio控件,结果只有两个0,1 ,结果作为标识位,且为1才会执第二个参数的回调方法*/
                        if("OPTION".equals(flag)){
                            Optional<KeyMapper> kOp=tec.getKeyMappers().stream().filter(e->StringUtils.isEquals(e.getCode(),fd.getCode())).findFirst();
@@ -1533,10 +1529,12 @@ public  List<ElementData> setScale(Integer scale,List<ElementData> data){
                            /*默认0*/
                            flag="0";
                        }
+                         String methodName = new Object(){}.getClass().getEnclosingMethod().getName();
                        if(StringUtils.isEquals(flag,1)){
-                           f=f.replace(m.group(),args[1]);
+                           f=f.replace(m.group(),"").replaceAll("\\)$","");
                        }else{
-                           f=f.replace(m.group(),"''");
+                           fd.setFinished(Boolean.TRUE);
+                           f="''";
                        }
                      }
                  }

+ 165 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/MixProportionInfoServiceImpl.java

@@ -0,0 +1,165 @@
+package org.springblade.manager.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import javassist.runtime.DotClass;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.common.utils.ForestNodeMergerEx;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.constant.BladeConstant;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.dto.ArchiveTreeContractAutoRuleMapDTO;
+import org.springblade.manager.dto.ArchiveTreeDTO;
+import org.springblade.manager.dto.ArchiveTreeSortDTO;
+import org.springblade.manager.dto.MoistureContentDTO;
+import org.springblade.manager.entity.ArchiveAutoRuleWbs;
+import org.springblade.manager.entity.ArchiveTree;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.entity.ProjectInfo;
+import org.springblade.manager.excel.MixProportionInfoExcel;
+import org.springblade.manager.mapper.ArchiveAutoRuleWbsMapper;
+import org.springblade.manager.mapper.ArchiveTreeMapper;
+import org.springblade.manager.mapper.MixProportionInfoMapper;
+import org.springblade.manager.service.*;
+import org.springblade.manager.utils.DiffListUtil;
+import org.springblade.manager.utils.ForestNodeMerger;
+import org.springblade.manager.vo.ArchiveTreeAutoRuleVO;
+import org.springblade.manager.vo.ArchiveTreeVO2;
+import org.springblade.manager.vo.WbsTreeVO2;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+@AllArgsConstructor
+public class MixProportionInfoServiceImpl extends BaseServiceImpl<MixProportionInfoMapper, MixProportionInfo> implements IMixProportionInfoService {
+
+
+    @Override
+    public List<MixProportionInfo> designStrengthList(String searchValue,Long contractId) {
+        return baseMapper.designStrengthList(searchValue,contractId);
+    }
+
+    @Override
+    public Integer compareInfo(Set<String> number, Set<String> strength, Long contractId) {
+        return baseMapper.compareInfo(number,strength,contractId);
+    }
+
+    @Override
+    public R importMixProportionInfo(MultipartFile file, Long projectId, Long contractId) {
+        List<MixProportionInfoExcel> list = ExcelUtil.read(file, MixProportionInfoExcel.class);
+        if(list!=null && list.size()>=1){
+            Set<String> number = new HashSet<>();
+            Set<String> strength = new HashSet<>();
+            //校验数据
+            for (MixProportionInfoExcel excel : list) {
+                if (org.apache.commons.lang.StringUtils.isNotBlank(excel.getReportNumber())){
+                    number.add(excel.getReportNumber());
+                }else {
+                    throw new ServiceException("文件中缺少配合比报告编号,请修改后重新导入");
+                }
+
+                if (StringUtils.isNotBlank(excel.getDesignStrength())){
+                    strength.add(excel.getDesignStrength());
+                }else {
+                    throw new ServiceException("文件中缺少设计强度,请修改后重新导入");
+                }
+            }
+            if (number.size() != list.size()){
+                throw new ServiceException("文件中配合比报告编号重复,请修改后重新导入");
+            }
+            if (strength.size() != list.size()){
+                throw new ServiceException("文件中设计强度重复,请修改后重新导入");
+            }
+            //判断是否存在相同的配合比编号,和设计强度
+            Integer infos = this.compareInfo(number,strength,contractId);
+            if (infos != 0){
+                throw new ServiceException("文件数据与现有数据重复,请修改后重新导入");
+            }
+
+            List<MixProportionInfo> vos = list.stream().map(f -> {
+                MixProportionInfo tag = new MixProportionInfo();
+                BeanUtil.copy(f,tag);
+                tag.setProjectId(projectId);
+                tag.setContractId(contractId);
+                return tag;
+            }).collect(Collectors.toList());
+            this.saveBatch(vos);
+            return R.success("导入成功");
+        }else {
+            return R.fail("没有一条数据");
+        }
+    }
+
+    /**
+     * 计算含水率
+     * @param dto
+     * @return
+     */
+    @Override
+    public R calculateWater(MoistureContentDTO dto) {
+        //获取位置前缀后缀
+        String prefix= dto.getKey().replaceAll("__[\\d_]+", "");
+        String suffix = dto.getKey().replaceAll("key_\\d+__", "");
+        String[] split = suffix.split("_");
+        String s1 = split[0];
+        Integer s2 = Integer.parseInt(split[1]);
+        //结果集
+        Map<String,BigDecimal> map = new HashMap<>();
+        //获取配合比信息
+        MixProportionInfo info = this.getById(dto.getMixProportionId());
+        if (info == null){
+            throw new ServiceException("获取配合比信息失败");
+        }
+        //含水量计算
+        //黄砂
+        BigDecimal sand = dto.getSand().divide(new BigDecimal(100)).multiply(info.getSand());
+        //碎石1
+        BigDecimal macadamOne = dto.getMacadamOne().divide(new BigDecimal(100)).multiply(info.getMacadamOne());
+        //碎石2
+        BigDecimal macadamTwo = dto.getMacadamTwo().divide(new BigDecimal(100)).multiply(info.getMacadamTwo());
+        //碎石3
+        BigDecimal macadamThree = dto.getMacadamThree().divide(new BigDecimal(100)).multiply(info.getMacadamThree());
+
+        //施工配合比计算
+        //水泥
+        BigDecimal cement = info.getCement();
+        map.put(prefix + "__" +s1 + "_" +(s2),cement);
+        //黄砂
+        BigDecimal sand2 = info.getSand().add(sand);
+        map.put(prefix + "__" +s1 + "_" +(s2+1),sand2);
+        //碎石1
+        BigDecimal macadamOne2 = info.getMacadamOne().add(macadamOne);
+        map.put(prefix + "__" +s1 + "_" +(s2+2),macadamOne2);
+        //碎石2
+        BigDecimal macadamTwo2 = info.getMacadamTwo().add(macadamTwo);
+        map.put(prefix + "__" +s1 + "_" +(s2+3),macadamTwo2);
+        //碎石3
+        BigDecimal macadamThree2 = info.getMacadamThree().add(macadamThree);
+        map.put(prefix + "__" +s1 + "_" +(s2+4),macadamThree2);
+        //水
+        BigDecimal water = info.getWater().subtract(sand).subtract(macadamOne).subtract(macadamTwo).subtract(macadamThree);
+        map.put(prefix + "__" +s1 + "_" +(s2+5),water);
+        //掺加剂
+        BigDecimal admixture = info.getAdmixture();
+        map.put(prefix + "__" +s1 + "_" +(s2+6),admixture);
+        //粉煤灰
+        BigDecimal coalAsh = info.getCoalAsh();
+        map.put(prefix + "__" +s1 + "_" +(s2+7),coalAsh);
+        //矿渣粉
+        BigDecimal slagPowder = info.getSlagPowder();
+        map.put(prefix + "__" +s1 + "_" +(s2+8),slagPowder);
+        return R.data(map);
+    }
+}

+ 18 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/RawMaterialsInfoServiceImpl.java

@@ -0,0 +1,18 @@
+package org.springblade.manager.service.impl;
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.entity.RawMaterialsInfo;
+import org.springblade.manager.mapper.MixProportionInfoMapper;
+import org.springblade.manager.mapper.RawMaterialsInfoMapper;
+import org.springblade.manager.service.IMixProportionInfoService;
+import org.springblade.manager.service.IRawMaterialsInfoService;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class RawMaterialsInfoServiceImpl extends BaseServiceImpl<RawMaterialsInfoMapper, RawMaterialsInfo> implements IRawMaterialsInfoService {
+
+
+}

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

@@ -667,7 +667,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                         }
                     }
                     //获取当前层懒加载节点
-                    List<WbsTreeContractLazyVO> lazyNodes = jdbcTemplate.query("select p_key_id,(SELECT id FROM u_contract_tree_drawings where process_id = p_key_id) AS drawingsId,id,parent_id,node_type,type,wbs_type,major_data_type,partition_code,old_id,contract_id_relation,is_concealed_works_node,CASE (SELECT count(1) FROM u_tree_contract_first AS tcf WHERE tcf.is_deleted = 0 AND tcf.wbs_node_id = a.p_key_id) WHEN 0 THEN 'false' ELSE 'true' END AS isFirst,IFNULL(if(length(trim(full_name))>0,full_name,node_name),node_name) AS title,(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id AND b.type = 1 and b.status = 1 AND b.contract_id = " + contractId + " AND b.is_deleted = 0 ) AS hasChildren from m_wbs_tree_contract a where a.node_type != 111 and a.type = 1 and a.status = 1 and a.is_deleted = 0 and parent_id = " + (StringUtils.isNotEmpty(id) ? id : 0) + " and contract_id = " + contractId + " ORDER BY a.sort,title,a.create_time", new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
+                    List<WbsTreeContractLazyVO> lazyNodes = jdbcTemplate.query("select p_key_id,(SELECT id FROM u_contract_tree_drawings where process_id = p_key_id) AS drawingsId,id,parent_id,node_type,type,wbs_type,is_concrete,major_data_type,partition_code,old_id,contract_id_relation,is_concealed_works_node,CASE (SELECT count(1) FROM u_tree_contract_first AS tcf WHERE tcf.is_deleted = 0 AND tcf.wbs_node_id = a.p_key_id) WHEN 0 THEN 'false' ELSE 'true' END AS isFirst,IFNULL(if(length(trim(full_name))>0,full_name,node_name),node_name) AS title,(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id AND b.type = 1 and b.status = 1 AND b.contract_id = " + contractId + " AND b.is_deleted = 0 ) AS hasChildren from m_wbs_tree_contract a where a.node_type != 111 and a.type = 1 and a.status = 1 and a.is_deleted = 0 and parent_id = " + (StringUtils.isNotEmpty(id) ? id : 0) + " and contract_id = " + contractId + " ORDER BY a.sort,title,a.create_time", new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
                     if (lazyNodes.size() > 0 && nodesAll.size() > 0) {
                         //所有节点
                         List<WbsTreeContractLazyVO> distinctNodesAll = nodesAll.stream()