ソースを参照

Merge remote-tracking branch 'origin/master'

liuyc 2 年 前
コミット
0f8ff687e2
14 ファイル変更621 行追加302 行削除
  1. 7 5
      blade-common/src/main/java/org/springblade/common/utils/BaseUtils.java
  2. 8 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/AppVersion.java
  3. 4 2
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java
  4. 5 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/AppVersionController.java
  5. 3 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/AppVersionDetailController.java
  6. 3 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  7. 255 109
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java
  8. 12 11
      blade-service/blade-manager/src/main/java/org/springblade/manager/excel/MixProportionInfoExcel.java
  9. 88 144
      blade-service/blade-manager/src/main/java/org/springblade/manager/formula/ITurnPointCalculator.java
  10. 14 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/formula/LevelInfo.java
  11. 21 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/formula/TurnPoint.java
  12. 2 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/MixProportionInfoMapper.xml
  13. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  14. 198 20
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java

+ 7 - 5
blade-common/src/main/java/org/springblade/common/utils/BaseUtils.java

@@ -88,17 +88,19 @@ public class BaseUtils {
      * @Author yangyj
      * @Date 2023.01.17 13:48
      **/
+    static final String NUM_REG = "^[+-]?\\d+(\\.\\d+)?$";
     public static boolean isNumber(Object value) {
-        if ((value == null) || value.toString().trim().length() == 0) {
+        if ((value == null) ) {
+            return false;
+        }
+        String stringValue = value.toString().trim();
+        if (stringValue.isEmpty()) {
             return false;
         }
         if (value instanceof Number) {
             return true;
         }
-        String pattern = "^[+-]?\\d+(\\.\\d+)?$";
-        Pattern r = Pattern.compile(pattern);
-        Matcher m = r.matcher(String.valueOf(value));
-        return m.matches();
+      return Pattern.matches(NUM_REG,stringValue);
     }
 
     /**

+ 8 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/AppVersion.java

@@ -6,6 +6,8 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.core.mp.base.BaseEntity;
 
+import java.time.LocalDateTime;
+
 /**
  * @Param   APP版本
  * @Author wangwl
@@ -24,4 +26,10 @@ public class AppVersion extends BaseEntity {
 
     @ApiModelProperty("当前版本")
     private String currentVersion;
+
+    @ApiModelProperty("应用说明")
+    private String appExplain;
+
+    @ApiModelProperty("更新时间")
+    private LocalDateTime updateDate;
 }

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

@@ -98,7 +98,9 @@ public class TaskController extends BladeController {
     @ApiOperation(value = "记录短信验证码超时时间")
     public void saveSmsTimeout(@RequestParam String code) {
         //获取账户记录
-        DefaultConfig config = this.defaultConfigService.getOne(Wrappers.<DefaultConfig>lambdaQuery().eq(DefaultConfig::getCreateUser, AuthUtil.getUserId()));
+        DefaultConfig config = this.defaultConfigService.getOne(Wrappers.<DefaultConfig>lambdaQuery()
+                .eq(DefaultConfig::getCreateUser, AuthUtil.getUserId())
+                .isNotNull(DefaultConfig::getSmsCode));
         if (config != null) {
             //获取当前时间
             Date now = DateUtil.now();
@@ -111,7 +113,7 @@ public class TaskController extends BladeController {
                 wrapper.set(DefaultConfig::getSmsCode, code);
             }
             //生成超时时间
-            this.defaultConfigService.update(wrapper.eq(DefaultConfig::getCreateUser, AuthUtil.getUserId()));
+            this.defaultConfigService.update(wrapper.eq(DefaultConfig::getCreateUser, AuthUtil.getUserId()).isNotNull(DefaultConfig::getSmsCode));
         }
     }
 

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

@@ -1,6 +1,7 @@
 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;
@@ -15,6 +16,8 @@ import org.springblade.manager.entity.MixProportionInfo;
 import org.springblade.manager.service.IAppVersionService;
 import org.springframework.web.bind.annotation.*;
 
+import java.time.LocalDateTime;
+
 
 @RestController
 @AllArgsConstructor
@@ -31,6 +34,7 @@ public class AppVersionController extends BladeController {
     @ApiOperationSupport(order = 1)
     @ApiOperation(value = "新增", notes = "传入版本信息")
     public R add(@RequestBody AppVersion appVersion){
+        appVersion.setUpdateDate(LocalDateTime.now());
         versionService.save(appVersion);
         return R.data("新增成功");
     }
@@ -43,7 +47,7 @@ public class AppVersionController extends BladeController {
     @ApiOperation(value = "分页", notes = "传入分页信息")
     public R<IPage<AppVersion>> page(Query query){
         IPage<AppVersion> page = new Page<>(query.getCurrent(),query.getSize());
-        IPage<AppVersion> iPage = versionService.page(page);
+        IPage<AppVersion> iPage = versionService.page(page,new LambdaQueryWrapper<AppVersion>().orderByDesc(AppVersion::getCreateTime));
         return R.data(iPage);
     }
 

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

@@ -9,6 +9,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.base.BaseEntity;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.manager.entity.AppVersion;
@@ -42,6 +43,7 @@ public class AppVersionDetailController extends BladeController {
         AppVersion appVersion = new AppVersion();
         appVersion.setId(detail.getVersionId());
         appVersion.setCurrentVersion(detail.getVersionNumber());
+        appVersion.setUpdateDate(LocalDateTime.now());
         versionService.updateById(appVersion);
         return R.data("新增成功");
     }
@@ -55,7 +57,7 @@ public class AppVersionDetailController extends BladeController {
     public R<IPage<AppVersionDetail>> page(Long versionId,Query query){
         IPage<AppVersionDetail> page = new Page<>(query.getCurrent(),query.getSize());
         IPage<AppVersionDetail> iPage = versionDetailService.page(page,
-                new LambdaQueryWrapper<AppVersionDetail>().eq(AppVersionDetail::getVersionId,versionId));
+                new LambdaQueryWrapper<AppVersionDetail>().eq(AppVersionDetail::getVersionId,versionId).orderByDesc(BaseEntity::getCreateTime));
         return R.data(iPage);
     }
 

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

@@ -294,7 +294,9 @@ public class ExcelTabController extends BladeController {
         String filecode = SnowFlakeUtil.getId() + "";
         String thmlUrl = file_path + filecode + ".html";
         String exceUrl = file_path + filecode + "123.xlsx";
-        FileUtils.excelInfo(file.getInputStream(),exceUrl,thmlUrl,"1");
+
+
+       // FileUtils.excelInfo(file.getInputStream(),exceUrl,thmlUrl,"1");
         // 上传excel文件
         BladeFile bladeFile = newIOSSClient.uploadFile(file.getOriginalFilename(),exceUrl);
         detail.setExtension(file.getOriginalFilename());

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

@@ -228,93 +228,236 @@ public class TextdictInfoController extends BladeController {
     }
 
 
+//    /**
+//     * 保存字段信息
+//     */
+//    @PostMapping("/saveTextInfo")
+//    @ApiOperationSupport(order = 9)
+//    @ApiOperation(value = "新增或修改", notes = "传入textdictInfo")
+//    public R saveTextInfo(@Valid @RequestBody TextdictDataInfoVO textdictInfo) throws Exception {
+//
+//        // 获取 节点信息
+//        WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(textdictInfo.getTableId());
+//
+//        // 读取html页面信息
+//        String path = "";
+//        String fileUrl = wbsTreePrivate.getHtmlUrl();
+//
+//        InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
+//
+//        String htmlString = IoUtil.readToString(fileInputStream);
+//        // 样式集合
+//        Document doc = Jsoup.parse(htmlString);
+//
+//        //解析
+//        Element table = doc.select("table").first();
+//        Elements trs = table.select("tr");
+//        Element element = trs.get(textdictInfo.getTrIndex()).select("td").get(textdictInfo.getTdIndex());
+//        if (element.html().indexOf("el-tooltip") >= 0) {
+//            element = element.children().get(0);
+//        }
+//        String trindex = element.children().get(0).attr("trindex");
+//        String tdindex = element.children().get(0).attr("tdindex");
+//        String x1 = element.children().get(0).attr("x1");
+//        String x2 = element.children().get(0).attr("x2");
+//        String y1 = element.children().get(0).attr("y1");
+//        String y2 = element.children().get(0).attr("y2");
+//        String placeholder = element.children().get(0).attr("placeholder").replaceAll("[^(\u4E00-\u9FA5_)]", "");
+//        String keyname = element.children().get(0).attr("keyname");
+//        String weighing = element.children().get(0).attr("weighing");
+//        String parm = trindex + "," + tdindex + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
+//        String oncklickText = "'" + placeholder + "'," + trindex + "," + tdindex;
+//
+//        String vmode = "formData." + keyname;
+//        String leftCli = "inputLeftClick($event,'" + keyname + "')";
+//        if (textdictInfo.getTextId().equals("input")) { // 文本框
+//            element.empty().append("<el-input  @mouseup.left=" + leftCli + " type='text' id=" + keyname + " @keydown.shift.up='keyupShiftUp'  @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
+//
+//        } else if (textdictInfo.getTextId().equals("textarea")) { // 文本域
+//            int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
+//
+//            element.empty().append("<el-input  :rows=" + rowspan * 2 + "  id=" + keyname + "  @mouseup.left=" + leftCli + "  @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight'  type='textarea' placeholder=" + placeholder + " v-model=" + vmode + "    keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'  > </el-input>");
+//
+//        } else if (textdictInfo.getTextId().equals("select")) { // 下拉框
+//            String selectText = " <el-select id=" + keyname + " v-model=" + vmode + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
+//            List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
+//            if (optionList != null && optionList.size() >= 1) {
+//                for (int i = 0; i < optionList.size(); i++)
+//                    selectText += "<el-option  key='" + optionList.get(i).getDictValue() + "' label='" + optionList.get(i).getDictValue() + "'   value='" + optionList.get(i).getDictValue() + "' > </el-option>";
+//            }
+//            selectText += "</el-select>";
+//            element.empty().append(selectText);
+//
+//        } else if (textdictInfo.getTextId().equals("radio")) { // 单选按钮
+//
+//            String radioText = "<el-radio-group id=" + keyname + " @keyDowns='dateKeydown()' v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
+//            List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
+//            if (optionList != null && optionList.size() >= 1) {
+//                for (int i = 0; i < optionList.size(); i++)
+//                    radioText += " <el-radio label=" + optionList.get(i).getDictValue() + ">" + optionList.get(i).getDictValue() + "</el-radio>";
+//            }
+//            radioText += "</el-radio-group >";
+//            element.empty().append(radioText);
+//        } else if (textdictInfo.getTextId().equals("checkbox")) { // 多选框
+//            List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
+//            if (optionList != null && optionList.size() >= 1) {
+//                JSONArray objs = new JSONArray();
+//                for (int i = 0; i < optionList.size(); i++) {
+//                    JSONObject jsonObject = new JSONObject();
+//                    jsonObject.put("key", i + 1);
+//                    jsonObject.put("name", optionList.get(i).getDictValue());
+//                    objs.add(jsonObject);
+//                }
+//                String checkbox = "<hc-form-checkbox-group   @keyDowns='dateKeydown()' :objs='" + objs + "'  @change='checkboxGroupChange' :val=" + vmode + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "> </hc-form-checkbox-group>";
+//                element.empty().append(checkbox);
+//            }
+//        } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
+//
+//            element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='YYYY年MM月DD日 HH:mm:ss' value-format='YYYY年MM月DD日 HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
+//        }
+//
+//        /*else if (textdictInfo.getTextId().equals("dateYMD")) { // 日期--年月日
+//            element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
+//        } else if (textdictInfo.getTextId().equals("dateHMS")) { // 日期--时分秒
+//            element.empty().append("<el-time-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='HH:mm:ss' value-format='HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+//        } else if (textdictInfo.getTextId().equals("dateSM")) { // 日期--时分
+//            element.empty().append("<el-time-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='HH:mm' value-format='HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+//        } else if (textdictInfo.getTextId().equals("dateMDHM")) { // 日期--月日时分
+//            element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='MM月DD日 HH:mm' value-format='MM月DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+//        } else if (textdictInfo.getTextId().equals("dateDHM")) { // 日期--日时分
+//            element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='DD日 HH:mm' value-format='DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+//        }*/
+//
+//        else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
+//            element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
+//            element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
+//        } else if (textdictInfo.getTextId().equals("daterangeYMD")) { // 时间段 /
+//            element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' range-separator='/' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
+//            element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
+//
+//        } else if (textdictInfo.getTextId().equals("img")) { //图片
+//            element.empty().append("<hc-table-form-upload @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight'  :src='" + vmode + "' placeholder=" + placeholder + " v-model=" + vmode + "  keyName=" + keyname + " weighing=" + weighing + "  @success='formUploadSuccess' @del='delTableFormFile' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "></hc-table-form-upload> ");
+//            element.removeAttr("style");
+//        } else if (textdictInfo.getTextId().equals("searchSelect")) { //搜索框
+//            element.empty().append("<hc-form-select-search id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='dap_site_data' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
+//        } else if (textdictInfo.getTextId().equals("strengthSearch")){ //强度搜索框
+//            element.empty().append("<hc-form-select-search2 id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='strength_search' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search2>");
+//        }
+//        element.attr("@click", "getInformation(" + oncklickText + ")");
+//
+//        File writeFile = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
+//        if (!writeFile.exists()) {
+//            if (StringUtils.isNotEmpty(path)) {
+//                File file = new File(path);
+//                if (!file.exists()) {
+//                    file.mkdirs();
+//                }
+//                FileUtil.writeToFile(file, doc.html(), Boolean.parseBoolean("UTF-8"));
+//            }
+//        } else {
+//            FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
+//        }
+//        Thread.sleep(300);
+//        // 清空相关的保存数据
+//        String tabName = wbsTreePrivate.getInitTableName();
+//        String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
+//        List<Map<String, Object>> tablist = jdbcTemplate.queryForList(isExitSql);
+//        if (tablist != null && tablist.size() > 0 && wbsTreePrivate.getType() != 10) {
+//            String clarSql = "update  " + tabName + " set " + keyname.split("__")[0] + "=null where p_key_id in(SELECT p_key_id FROM m_wbs_tree_contract WHERE id ='" + wbsTreePrivate.getId() + "' and project_id='" + wbsTreePrivate.getProjectId() + "' )";
+//            jdbcTemplate.execute(clarSql);
+//        }
+//        fileInputStream.close();
+//        return R.success("操作成功");
+//    }
+
     /**
      * 保存字段信息
      */
     @PostMapping("/saveTextInfo")
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "新增或修改", notes = "传入textdictInfo")
-    public R saveTextInfo(@Valid @RequestBody TextdictDataInfoVO textdictInfo) throws Exception {
+    public R saveTextInfo(@Valid @RequestBody List<TextdictDataInfoVO> list) throws Exception {
+        if (list != null && list.size() > 0) {
+            // 获取 节点信息
+            WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(list.get(0).getTableId());
 
-        // 获取 节点信息
-        WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(textdictInfo.getTableId());
+            // 读取html页面信息
+            String path = "";
+            String fileUrl = wbsTreePrivate.getHtmlUrl();
 
-        // 读取html页面信息
-        String path = "";
-        String fileUrl = wbsTreePrivate.getHtmlUrl();
+            InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
 
-        InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
+            String htmlString = IoUtil.readToString(fileInputStream);
+            // 样式集合
+            Document doc = Jsoup.parse(htmlString);
 
-        String htmlString = IoUtil.readToString(fileInputStream);
-        // 样式集合
-        Document doc = Jsoup.parse(htmlString);
+            //解析
+            Element table = doc.select("table").first();
+            Elements trs = table.select("tr");
+            for (TextdictDataInfoVO textdictInfo : list) {
+                Element element = trs.get(textdictInfo.getTrIndex()).select("td").get(textdictInfo.getTdIndex());
+                if (element.html().indexOf("el-tooltip") >= 0) {
+                    element = element.children().get(0);
+                }
+                String trindex = element.children().get(0).attr("trindex");
+                String tdindex = element.children().get(0).attr("tdindex");
+                String x1 = element.children().get(0).attr("x1");
+                String x2 = element.children().get(0).attr("x2");
+                String y1 = element.children().get(0).attr("y1");
+                String y2 = element.children().get(0).attr("y2");
+                String placeholder = element.children().get(0).attr("placeholder").replaceAll("[^(\u4E00-\u9FA5_)]", "");
+                String keyname = element.children().get(0).attr("keyname");
+                String weighing = element.children().get(0).attr("weighing");
+                String parm = trindex + "," + tdindex + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
+                String oncklickText = "'" + placeholder + "'," + trindex + "," + tdindex;
+
+                String vmode = "formData." + keyname;
+                String leftCli = "inputLeftClick($event,'" + keyname + "')";
+                if (textdictInfo.getTextId().equals("input")) { // 文本框
+                    element.empty().append("<el-input  @mouseup.left=" + leftCli + " type='text' id=" + keyname + " @keydown.shift.up='keyupShiftUp'  @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
+
+                } else if (textdictInfo.getTextId().equals("textarea")) { // 文本域
+                    int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
+
+                    element.empty().append("<el-input  :rows=" + rowspan * 2 + "  id=" + keyname + "  @mouseup.left=" + leftCli + "  @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight'  type='textarea' placeholder=" + placeholder + " v-model=" + vmode + "    keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'  > </el-input>");
+
+                } else if (textdictInfo.getTextId().equals("select")) { // 下拉框
+                    String selectText = " <el-select id=" + keyname + " v-model=" + vmode + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
+                    List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
+                    if (optionList != null && optionList.size() >= 1) {
+                        for (int i = 0; i < optionList.size(); i++)
+                            selectText += "<el-option  key='" + optionList.get(i).getDictValue() + "' label='" + optionList.get(i).getDictValue() + "'   value='" + optionList.get(i).getDictValue() + "' > </el-option>";
+                    }
+                    selectText += "</el-select>";
+                    element.empty().append(selectText);
 
-        //解析
-        Element table = doc.select("table").first();
-        Elements trs = table.select("tr");
-        Element element = trs.get(textdictInfo.getTrIndex()).select("td").get(textdictInfo.getTdIndex());
-        if (element.html().indexOf("el-tooltip") >= 0) {
-            element = element.children().get(0);
-        }
-        String trindex = element.children().get(0).attr("trindex");
-        String tdindex = element.children().get(0).attr("tdindex");
-        String x1 = element.children().get(0).attr("x1");
-        String x2 = element.children().get(0).attr("x2");
-        String y1 = element.children().get(0).attr("y1");
-        String y2 = element.children().get(0).attr("y2");
-        String placeholder = element.children().get(0).attr("placeholder").replaceAll("[^(\u4E00-\u9FA5_)]", "");
-        String keyname = element.children().get(0).attr("keyname");
-        String weighing = element.children().get(0).attr("weighing");
-        String parm = trindex + "," + tdindex + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
-        String oncklickText = "'" + placeholder + "'," + trindex + "," + tdindex;
-
-        String vmode = "formData." + keyname;
-        String leftCli = "inputLeftClick($event,'" + keyname + "')";
-        if (textdictInfo.getTextId().equals("input")) { // 文本框
-            element.empty().append("<el-input  @mouseup.left=" + leftCli + " type='text' id=" + keyname + " @keydown.shift.up='keyupShiftUp'  @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
-
-        } else if (textdictInfo.getTextId().equals("textarea")) { // 文本域
-            int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
-
-            element.empty().append("<el-input  :rows=" + rowspan * 2 + "  id=" + keyname + "  @mouseup.left=" + leftCli + "  @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight'  type='textarea' placeholder=" + placeholder + " v-model=" + vmode + "    keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'  > </el-input>");
-
-        } else if (textdictInfo.getTextId().equals("select")) { // 下拉框
-            String selectText = " <el-select id=" + keyname + " v-model=" + vmode + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
-            List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
-            if (optionList != null && optionList.size() >= 1) {
-                for (int i = 0; i < optionList.size(); i++)
-                    selectText += "<el-option  key='" + optionList.get(i).getDictValue() + "' label='" + optionList.get(i).getDictValue() + "'   value='" + optionList.get(i).getDictValue() + "' > </el-option>";
-            }
-            selectText += "</el-select>";
-            element.empty().append(selectText);
+                } else if (textdictInfo.getTextId().equals("radio")) { // 单选按钮
 
-        } else if (textdictInfo.getTextId().equals("radio")) { // 单选按钮
+                    String radioText = "<el-radio-group id=" + keyname + " @keyDowns='dateKeydown()' v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
+                    List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
+                    if (optionList != null && optionList.size() >= 1) {
+                        for (int i = 0; i < optionList.size(); i++)
+                            radioText += " <el-radio label=" + optionList.get(i).getDictValue() + ">" + optionList.get(i).getDictValue() + "</el-radio>";
+                    }
+                    radioText += "</el-radio-group >";
+                    element.empty().append(radioText);
+                } else if (textdictInfo.getTextId().equals("checkbox")) { // 多选框
+                    List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
+                    if (optionList != null && optionList.size() >= 1) {
+                        JSONArray objs = new JSONArray();
+                        for (int i = 0; i < optionList.size(); i++) {
+                            JSONObject jsonObject = new JSONObject();
+                            jsonObject.put("key", i + 1);
+                            jsonObject.put("name", optionList.get(i).getDictValue());
+                            objs.add(jsonObject);
+                        }
+                        String checkbox = "<hc-form-checkbox-group   @keyDowns='dateKeydown()' :objs='" + objs + "'  @change='checkboxGroupChange' :val=" + vmode + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "> </hc-form-checkbox-group>";
+                        element.empty().append(checkbox);
+                    }
+                } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
 
-            String radioText = "<el-radio-group id=" + keyname + " @keyDowns='dateKeydown()' v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
-            List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
-            if (optionList != null && optionList.size() >= 1) {
-                for (int i = 0; i < optionList.size(); i++)
-                    radioText += " <el-radio label=" + optionList.get(i).getDictValue() + ">" + optionList.get(i).getDictValue() + "</el-radio>";
-            }
-            radioText += "</el-radio-group >";
-            element.empty().append(radioText);
-        } else if (textdictInfo.getTextId().equals("checkbox")) { // 多选框
-            List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
-            if (optionList != null && optionList.size() >= 1) {
-                JSONArray objs = new JSONArray();
-                for (int i = 0; i < optionList.size(); i++) {
-                    JSONObject jsonObject = new JSONObject();
-                    jsonObject.put("key", i + 1);
-                    jsonObject.put("name", optionList.get(i).getDictValue());
-                    objs.add(jsonObject);
+                    element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='YYYY年MM月DD日 HH:mm:ss' value-format='YYYY年MM月DD日 HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
                 }
-                String checkbox = "<hc-form-checkbox-group   @keyDowns='dateKeydown()' :objs='" + objs + "'  @change='checkboxGroupChange' :val=" + vmode + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "> </hc-form-checkbox-group>";
-                element.empty().append(checkbox);
-            }
-        } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
-
-            element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='YYYY年MM月DD日 HH:mm:ss' value-format='YYYY年MM月DD日 HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
-        }
 
         /*else if (textdictInfo.getTextId().equals("dateYMD")) { // 日期--年月日
             element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
@@ -328,45 +471,48 @@ public class TextdictInfoController extends BladeController {
             element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='DD日 HH:mm' value-format='DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
         }*/
 
-        else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
-            element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
-            element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
-        } else if (textdictInfo.getTextId().equals("daterangeYMD")) { // 时间段 /
-            element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' range-separator='/' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
-            element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
-
-        } else if (textdictInfo.getTextId().equals("img")) { //图片
-            element.empty().append("<hc-table-form-upload @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight'  :src='" + vmode + "' placeholder=" + placeholder + " v-model=" + vmode + "  keyName=" + keyname + " weighing=" + weighing + "  @success='formUploadSuccess' @del='delTableFormFile' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "></hc-table-form-upload> ");
-            element.removeAttr("style");
-        } else if (textdictInfo.getTextId().equals("searchSelect")) { //搜索框
-            element.empty().append("<hc-form-select-search id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='dap_site_data' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
-        } else if (textdictInfo.getTextId().equals("strengthSearch")){ //强度搜索框
-            element.empty().append("<hc-form-select-search2 id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='strength_search' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search2>");
-        }
-        element.attr("@click", "getInformation(" + oncklickText + ")");
-
-        File writeFile = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
-        if (!writeFile.exists()) {
-            if (StringUtils.isNotEmpty(path)) {
-                File file = new File(path);
-                if (!file.exists()) {
-                    file.mkdirs();
+                else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
+                    element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
+                    element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
+                } else if (textdictInfo.getTextId().equals("daterangeYMD")) { // 时间段 /
+                    element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' range-separator='/' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
+                    element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
+
+                } else if (textdictInfo.getTextId().equals("img")) { //图片
+                    element.empty().append("<hc-table-form-upload @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight'  :src='" + vmode + "' placeholder=" + placeholder + " v-model=" + vmode + "  keyName=" + keyname + " weighing=" + weighing + "  @success='formUploadSuccess' @del='delTableFormFile' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "></hc-table-form-upload> ");
+                    element.removeAttr("style");
+                } else if (textdictInfo.getTextId().equals("searchSelect")) { //搜索框
+                    element.empty().append("<hc-form-select-search id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='dap_site_data' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
+                } else if (textdictInfo.getTextId().equals("strengthSearch")) { //强度搜索框
+                    element.empty().append("<hc-form-select-search2 id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='strength_search' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search2>");
+                }
+                element.attr("@click", "getInformation(" + oncklickText + ")");
+
+                Thread.sleep(300);
+                // 清空相关的保存数据
+                String tabName = wbsTreePrivate.getInitTableName();
+                String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
+                List<Map<String, Object>> tablist = jdbcTemplate.queryForList(isExitSql);
+                if (tablist != null && tablist.size() > 0 && wbsTreePrivate.getType() != 10) {
+                    String clarSql = "update  " + tabName + " set " + keyname.split("__")[0] + "=null where p_key_id in(SELECT p_key_id FROM m_wbs_tree_contract WHERE id ='" + wbsTreePrivate.getId() + "' and project_id='" + wbsTreePrivate.getProjectId() + "' )";
+                    jdbcTemplate.execute(clarSql);
                 }
-                FileUtil.writeToFile(file, doc.html(), Boolean.parseBoolean("UTF-8"));
             }
-        } else {
-            FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
-        }
-        Thread.sleep(300);
-        // 清空相关的保存数据
-        String tabName = wbsTreePrivate.getInitTableName();
-        String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
-        List<Map<String, Object>> tablist = jdbcTemplate.queryForList(isExitSql);
-        if (tablist != null && tablist.size() > 0 && wbsTreePrivate.getType() != 10) {
-            String clarSql = "update  " + tabName + " set " + keyname.split("__")[0] + "=null where p_key_id in(SELECT p_key_id FROM m_wbs_tree_contract WHERE id ='" + wbsTreePrivate.getId() + "' and project_id='" + wbsTreePrivate.getProjectId() + "' )";
-            jdbcTemplate.execute(clarSql);
+            File writeFile = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
+            if (!writeFile.exists()) {
+                if (StringUtils.isNotEmpty(path)) {
+                    File file = new File(path);
+                    if (!file.exists()) {
+                        file.mkdirs();
+                    }
+                    FileUtil.writeToFile(file, doc.html(), Boolean.parseBoolean("UTF-8"));
+                }
+            } else {
+                FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
+            }
+            fileInputStream.close();
+            return R.success("操作成功");
         }
-        fileInputStream.close();
         return R.success("操作成功");
     }
 

+ 12 - 11
blade-service/blade-manager/src/main/java/org/springblade/manager/excel/MixProportionInfoExcel.java

@@ -7,6 +7,7 @@ import com.alibaba.excel.annotation.write.style.HeadRowHeight;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 
 /**
  *
@@ -28,40 +29,40 @@ public class MixProportionInfoExcel implements Serializable {
     private String waterBinderRatio;
 
     @ExcelProperty(value = "水泥")
-    private Double cement ;
+    private BigDecimal cement ;
 
     @ExcelProperty(value = "砂")
-    private Double sand;
+    private BigDecimal sand;
 
     @ExcelProperty(value = "碎石1")
-    private Double macadamOne ;
+    private BigDecimal macadamOne ;
 
     @ExcelProperty(value = "碎石2")
-    private Double macadamTwo;
+    private BigDecimal macadamTwo;
 
     @ExcelProperty(value = "碎石3")
-    private Double macadamThree;
+    private BigDecimal macadamThree;
 
     @ExcelProperty(value = "水")
-    private Double water;
+    private BigDecimal water;
 
     @ExcelProperty(value = "掺加剂")
-    private Double admixture;
+    private BigDecimal admixture;
 
     @ExcelProperty(value = "粉煤灰")
-    private Double coalAsh;
+    private BigDecimal coalAsh;
 
     @ExcelProperty(value = "矿渣粉")
-    private Double slagPowder;
+    private BigDecimal slagPowder;
 
     @ExcelProperty(value = "坍落度")
-    private Double slumps;
+    private BigDecimal slumps;
 
     @ExcelProperty(value = "单位体积重")
     private String bulkDensity;
 
     @ExcelProperty(value = "28天抗压强度")
-    private Double compressiveStrength;
+    private BigDecimal compressiveStrength;
 
 
 }

+ 88 - 144
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/ITurnPointCalculator.java

@@ -1,15 +1,13 @@
 package org.springblade.manager.formula;
 
-import com.mixsmart.utils.CustomFunction;
 import com.mixsmart.utils.ListUtils;
 import com.mixsmart.utils.StringUtils;
+import org.springblade.common.utils.BaseUtils;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.manager.formula.impl.TableElementConverter;
 
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.concurrent.ThreadLocalRandom;
-import java.util.stream.Collectors;
 
 import static com.mixsmart.utils.CustomFunction.rangeList;
 import static java.math.BigDecimal.ROUND_HALF_UP;
@@ -22,9 +20,9 @@ public interface ITurnPointCalculator {
 
      String ZD_REG="(?i)zd\\d+";
     static List<TurnPoint> create(List<Map<String, Object>> data, LinkedHashMap<String, String> configMap,String g8pcfw) {
-        /*1.验证数据的合理性,如果已经合理则不需要计算,直接返回
+        /*1.验证数据的合理性,如果已经合理则不需要计算
         * 2.尝试补充数据,如果不合理则重新生成转点,并用正尺方式生成
-        * 3.合理性定义(测点前视不存在或者非负数则视线高-测点实测高程在【0.5~4.8】范围,如果前视为负数则视线高-实际高程在【-0.5~-4.8】范围)*/
+        * 3.合理性定义:(测点前视不存在或者非负数则视线高-测点实测高程在【0.5~4.8】范围,如果前视为负数则视线高-实际高程在【-0.5~-4.8】范围)*/
         if (Func.isNotEmpty(data) && configMap != null) {
             LevelInfo levelInfo = new LevelInfo();
             levelInfo.setDx(g8pcfw);
@@ -45,63 +43,24 @@ public interface ITurnPointCalculator {
                     /*检验水准点数据合法性&节点定性&补充缺失闭合点*/
                     ckecked = identifying(levelInfo, tmp, tp, isHead, isTail);
                     if(!ckecked){
-                        /*ckecked失败需要主动加入tmp,后续不执行identifying直接add*/
+                        /*checked失败需要主动加入tmp,后续不执行identifying直接add*/
                         tmp.add(tp);
                     }
                 }else{
                     tmp.add(tp);
                 }
-/*                if (i == 0) {
-                    if (tp.checkBmd()) {
-                        tp.setType(TurnPoint.BMD);
-                        tp.setBmd(tp.getSj0L() + tp.getH0L());
-                        levelInfo.setBmdName(tp.getName());
-                        levelInfo.setBmdSj(tp.getSj0L());
-                        levelInfo.setSightHeight(tp.getBmd0L());
-                    } else {
-                        return Collections.emptyList();
-                    }
-                } else if (tp.getName().matches("(?i)zd\\d+")) {
-                    tp.setType(TurnPoint.ZD);
-                } else if (i == data.size() - 1) {
-                    if (StringUtils.isEquals(tp.getName(), levelInfo.getBmdName())) {
-                        if (tp.getSj() == null) {
-                            tp.setSj(levelInfo.getBmdSj());
-                        }
-                        if (tp.getSc() == null && tp.getQ() == null) {
-                            double ldx = Double.parseDouble(rangeList(1, 0, levelInfo.getDx(), 0.001, 3, 1).get(0).toString());
-                            tp.setSc(tp.getSj0L() + ldx);
-                            tp.setDx(ldx);
-                        }
-                        tp.setType(TurnPoint.CLOSE);
-                    } else {
-                        tp.setType(TurnPoint.CE);
-                        tmp.add(tp);
-                        TurnPoint close = new TurnPoint(levelInfo, new HashMap<>());
-                        close.setName(levelInfo.getBmdName());
-                        close.setSj(levelInfo.getBmdSj());
-                        *//*闭合点的偏差范围是±3mm*//*
-                        double ldx=Arrays.asList(-0.003,-0.002,-0.001,0.001,0.002,0.003).get(ThreadLocalRandom.current().nextInt(6));
-                        close.setSc(close.getSj0L() + ldx);
-                        close.setDx(ldx);
-                        close.setType(TurnPoint.CLOSE);
-                        close.getDataMap().put(CD, close.getName());
-                        close.getDataMap().put(YG, close.getBmd());
-                        close.getDataMap().put(QS, close.getQ());
-                        close.getDataMap().put(HS, close.getH());
-                        tmp.add(close);
-                        break;
-                    }
-                } else {
-                    tp.setType(TurnPoint.CE);
-                }*/
             }
             if(!ckecked){
+                /*直接写入输出缓存,不作任何计算*/
                 tmp.forEach(ITurnPointCalculator::putCache);
                 return tmp;
             }
-            /*根据黄飞扬反馈情况,暂时去掉手填转点的可能性,每次重新生成20230803*/
-            //tmp.removeIf(e-> ZD.equals(e.getType()));
+            /*判断是否可推导*/
+            levelInfo.setPersist(persist(tmp));
+            if(levelInfo.isNotPersist()) {
+                /*不可推导的情况移除转点,fill阶段自动生成*/
+                tmp.removeIf(e-> ZD.equals(e.getType()));
+            }
             List<TurnPoint> result = fill(tmp);
             if (ListUtils.isNotEmpty(result)) {
                 return  result;
@@ -110,6 +69,69 @@ public interface ITurnPointCalculator {
         return Collections.emptyList();
     }
 
+
+    static boolean persist(List<TurnPoint> list){
+        /*在补充计算之前进行完整性校验,如果成功怎不会再生成任何新转点*/
+        if(list.stream().anyMatch(e->ZD.equals(e.getType()))){
+              LevelInfo tmp = new LevelInfo();
+              LevelInfo info = list.get(0).getLevelInfo();
+              tmp.setSightHeight(info.getSightHeight());
+              for(TurnPoint tp:list){
+                  if(CE.equals(tp.getType())||CLOSE.equals(tp.getType())){
+                     boolean pass=Func.isNotBlank(tp.getSc())&&Func.isNotBlank(tp.getQ());
+                     if(BaseUtils.isNumber(tp.getSc())&&BaseUtils.isNumber(tp.getQ())){
+                         pass=tmp.getSightHeight()-tp.getQ0L()==tp.getSc0L();
+                     }else {
+                         /*是否是负前视*/
+                         boolean nagetive =false;
+                         if(BaseUtils.isNumber(tp.getSc())){
+                             tp.setQ(tmp.getSightHeight()-tp.getSc0L());
+                         }else if(BaseUtils.isNumber(tp.getQ())){
+                               nagetive=tp.getQ0L()<0;
+                         }else if(BaseUtils.isNumber(tp.getSj())&&BaseUtils.isNumber(tp.getDx())){
+                             tp.setSc(tp.getSj0L()+tp.getDx0L());
+                             tp.setQ(tmp.getSightHeight()-tp.getSc0L());
+                         }
+                         double q=tp.getQ0L();
+                         if(nagetive){
+                             /*负前视是倒尺计算,要取绝对值比较*/
+                             q=Math.abs(q);
+                         }
+                         /*判断前视是否在合理范围*/
+                         pass= q>=info.getMin()&&q<=info.getStep();
+                     }
+                     if(!pass){
+                         return false;
+                     }
+                  }else if(ZD.equals(tp.getType())){
+                      boolean pass;
+                      if(BaseUtils.isNumber(tp.getBmd())&&BaseUtils.isNumber(tp.getQ())&&BaseUtils.isNumber(tp.getH())){
+                          /*视线高、前后视都存在*/
+                          pass=tp.isWithinRangeValueZd(tp.getQ())&&tp.isWithinRangeValueZd(tp.getH())&&tmp.getSightHeight()-tp.getQ0L()==tp.getBmd0L();
+                      } else{
+                          if(!BaseUtils.isNumber(tp.getBmd())&&BaseUtils.isNumber(tp.getQ())&&BaseUtils.isNumber(tp.getH())){
+                              /*视线高不存在、前后视都存在*/
+                              tp.setBmd(tmp.getSightHeight()+tp.getH0L()-tp.getQ0L());
+                          }else if(BaseUtils.isNumber(tp.getSc())&&!BaseUtils.isNumber(tp.getQ())&&BaseUtils.isNumber(tp.getH())){
+                              /*前视不存在、视线高后视都存在*/
+                              tp.setQ(tmp.getSightHeight()+tp.getH0L()-tp.getBmd0L());
+                          }else if(BaseUtils.isNumber(tp.getSc())&&BaseUtils.isNumber(tp.getQ())&&!BaseUtils.isNumber(tp.getH())){
+                              /*前视不存在、视线高后视都存在*/
+                              tp.setH(tmp.getSightHeight()-tp.getQ0L()-tp.getBmd0L());
+                          }
+                          pass=tp.isWithinRangeValueZd(tp.getQ())&&tp.isWithinRangeValueZd(tp.getH());
+                      }
+                      if(!pass){
+                          return false;
+                      }
+                      tmp.setSightHeight(tp.getBmd0L());
+                  }
+
+              }
+        }
+        return true;
+    }
+
     static boolean identifying(LevelInfo levelInfo, List<TurnPoint> tmp,TurnPoint tp,boolean isHead,boolean isTail ){
         if (isHead) {
             if (tp.checkBmd()) {
@@ -206,91 +228,20 @@ public interface ITurnPointCalculator {
                         /*已经是最后一个测点*/
                         tp.getLevelInfo().setHasCe(Boolean.FALSE);
                     }
-                    if(checked) {
-                        /*先判断是不是转点*/
-                        if (tp.getType().equals(TurnPoint.ZD)) {
-                       /* if (Func.isBlank(tp.getQ()) && Func.isBlank(tp.getH()) && Func.isNotBlank(tp.getBmd())) {
-                            double dh = Math.abs(tp.getLevelInfo().getSightHeight() - tp.getBmd0L());
-                            double big = BigDecimal.valueOf(rd.nextDouble() * (info.getStep() - dh) + dh).setScale(info.getScale(), ROUND_HALF_UP).doubleValue();
-                            double small = big - dh;
-                            if (tp.isHigher()) {
-                                tp.setH(big);
-                                tp.setQ(small);
-                            } else {
-                                tp.setH(small);
-                                tp.setQ(big);
-                            }
-                            *//* 更新仪器高*//*
-                            info.setSightHeight(tp.getBmd0L());
-                        } else if (Func.isBlank(tp.getQ()) && Func.isNotBlank(tp.getH()) && Func.isNotBlank(tp.getBmd())) {
-                            tp.setQ(info.getSightHeight() + tp.getH0L() - tp.getBmd0L());
-                            info.setSightHeight(tp.getBmd0L());
-                        } else if (Func.isNotBlank(tp.getQ()) && Func.isBlank(tp.getH()) && Func.isNotBlank(tp.getBmd())) {
-                            tp.setH(info.getSightHeight() - tp.getQ0L() - tp.getBmd0L());
-                            info.setSightHeight(tp.getBmd0L());
-                        } else if (Func.isNotBlank(tp.getQ()) && Func.isNotBlank(tp.getH()) && Func.isBlank(tp.getBmd())) {
-                            tp.setBmd(info.getSightHeight() + tp.getH0L() - tp.getQ0L());
-                            info.setSightHeight(tp.getBmd0L());
-                        } else if (Func.isNotBlank(tp.getQ()) && Func.isNotBlank(tp.getH()) && Func.isNotBlank(tp.getBmd())) {
-                            info.setSightHeight(tp.getBmd0L());
-                        } else {
-                            return Collections.emptyList();
-                        }
-                        *//*可能存在自动插入转点情况,所以每个转点的序号需要实时计算*//*
-                        if (tp.getLevelInfo().getHasCe()) {
-                            tp.setName("ZD" + info.getCloseZd().size());
-                            tp.getLevelInfo().getCloseZd().add(tp.clone());
-                        } else {
-                            tp.getLevelInfo().getCloseZd().remove(tp.getLevelInfo().getCloseZd().size() - 1);
-                        }*/
-                            /*转点处理,失败则直接返回空集合*/
-                            checked = tpHandlerZd(info, tp);
-                        } else if (tp.getType().equals(TurnPoint.CLOSE)) {
-                            /*闭合转点*/
-                       /* tp.setQ(info.getSightHeight() - tp.getSc0L());
-                        if (tp.needClose()) {
-                            result.addAll(tp.close());
-                        }*/
-                            /*闭合点处理*/
-                            tpHandlerClose(result, info, tp);
-                        } else if (tp.getType().equals(TurnPoint.CE)) {
-                        /*if (StringUtils.isNotEmpty(tp.getSc())) {
-                            if (StringUtils.isNotEmpty(tp.getSj())) {
-                                tp.setDx(tp.getSc0L() - tp.getSj0L());
-                            }
-                            tp.setQ(info.getSightHeight() - tp.getSc0L());
-                        } else if (StringUtils.isNotEmpty(tp.getSj())) {
-                            String dx = rangeList(1, 0, info.getDx(), 1, 0, 1).get(0).toString();
-                            tp.setDx(dx);
-                            tp.setSc(tp.getSj0L() + tp.getDx0L());
-                            tp.setQ(info.getSightHeight() - tp.getSc0L());
-                        } else if (StringUtils.isNotEmpty(tp.getQ())) {
-                            tp.setSc(info.getSightHeight() - tp.getQ0L());
-                            if (tp.getSj() != null) {
-                                tp.setDx(tp.getSj0L() - tp.getSj0L());
-                            }
-                        }
-                        if (!tp.isVisible()) {
-                            result.addAll(tp.limit());
-                        }*/
-                            /*测点处理*/
-                            tpHandlerCe(result, info, tp);
-                        } else if (tp.getType().equals(TurnPoint.BMD)) {
-                      /*  TurnPoint st = new TurnPoint(tp.getLevelInfo(), new HashMap<>());
-                        st.setBmd(tp.getBmd());
-                        st.setType(TurnPoint.ZD);
-                        tp.getLevelInfo().getCloseZd().add(st);*/
-                            /*水准点处理*/
-                            tpHandlerBmd(tp);
-                        }
+                    /*先判断是不是转点*/
+                    if (tp.getType().equals(TurnPoint.ZD)) {
+                        /*转点处理,失败则直接返回空集合*/
+                         tpHandlerZd(info, tp);
+                    } else if (tp.getType().equals(TurnPoint.CLOSE)) {
+                        /*闭合点处理*/
+                        tpHandlerClose(result, info, tp);
+                    } else if (tp.getType().equals(TurnPoint.CE)) {
+                        /*测点处理*/
+                        tpHandlerCe(result, info, tp);
+                    } else if (tp.getType().equals(TurnPoint.BMD)) {
+                        /*水准点处理*/
+                        tpHandlerBmd(tp);
                     }
-                   /* tp.getDataMap().put(CD, tp.getName());
-                    tp.getDataMap().put(YG, tp.getBmd());
-                    tp.getDataMap().put(QS, tp.getQ());
-                    tp.getDataMap().put(HS, tp.getH());
-                    tp.getDataMap().put(SC, tp.getSc());
-                    tp.getDataMap().put(SJ, tp.getSj());
-                    tp.getDataMap().put(GC, StringUtils.number2StringZero(StringUtils.isNotEmpty(tp.getDx()) ? tp.getDx0L() * 1000 : "", 0));*/
                     /*把数据放到输出缓存*/
                     putCache(tp);
                     result.add(tp);
@@ -314,7 +265,7 @@ public interface ITurnPointCalculator {
         st.setType(TurnPoint.ZD);
         tp.getLevelInfo().getCloseZd().add(st);
     }
-    static boolean tpHandlerZd(LevelInfo info ,TurnPoint tp){
+    static void tpHandlerZd(LevelInfo info ,TurnPoint tp){
         if(!finalizeZd(tp)) {
             if (Func.isBlank(tp.getQ()) && Func.isBlank(tp.getH()) && Func.isNotBlank(tp.getBmd())) {
                 double dh = Math.abs(tp.getLevelInfo().getSightHeight() - tp.getBmd0L());
@@ -328,18 +279,12 @@ public interface ITurnPointCalculator {
                     tp.setQ(big);
                 }
                 /* 更新仪器高*/
-                /*info.setSightHeight(tp.getBmd0L());*/
             } else if (Func.isBlank(tp.getQ()) && Func.isNotBlank(tp.getH()) && Func.isNotBlank(tp.getBmd())) {
                 tp.setQ(info.getSightHeight() + tp.getH0L() - tp.getBmd0L());
-                /*info.setSightHeight(tp.getBmd0L());*/
             } else if (Func.isNotBlank(tp.getQ()) && Func.isBlank(tp.getH()) && Func.isNotBlank(tp.getBmd())) {
                 tp.setH(info.getSightHeight() - tp.getQ0L() - tp.getBmd0L());
-               /* info.setSightHeight(tp.getBmd0L());*/
             } else if (Func.isNotBlank(tp.getQ()) && Func.isNotBlank(tp.getH()) && Func.isBlank(tp.getBmd())) {
                 tp.setBmd(info.getSightHeight() + tp.getH0L() - tp.getQ0L());
-                /*info.setSightHeight(tp.getBmd0L());*/
-            }  else {
-                return false;
             }
         }
         /*更新当前视线高*/
@@ -351,7 +296,6 @@ public interface ITurnPointCalculator {
         } else {
             tp.getLevelInfo().getCloseZd().remove(tp.getLevelInfo().getCloseZd().size() - 1);
         }
-        return true;
     }
     static void tpHandlerCe(List<TurnPoint> result,LevelInfo info ,TurnPoint tp){
         if(!finalizeCe(tp)) {

+ 14 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/LevelInfo.java

@@ -1,16 +1,14 @@
 package org.springblade.manager.formula;
 
-import lombok.Data;
-
 import java.util.ArrayList;
 import java.util.List;
 
 /**
  * @author yangyj
  * @Date 2022/9/6 10:04
- * @description TODO
+ * @description 当前测量状态
  */
-public class LevelInfo {
+public class LevelInfo implements  Cloneable {
     /**
      * 默认值
      */
@@ -55,6 +53,9 @@ public class LevelInfo {
      */
     private List<TurnPoint> closeZd = new ArrayList<>();
 
+    /**测量数据是否可推导*/
+    private boolean persist=false;
+
     public Double getBmdSj() {
         return bmdSj;
     }
@@ -149,4 +150,13 @@ public class LevelInfo {
     public void setHasCe(Boolean hasCe) {
         this.hasCe = hasCe;
     }
+
+    public boolean isNotPersist() {
+        return !persist;
+    }
+
+    public void setPersist(boolean persist) {
+        this.persist = persist;
+    }
+
 }

+ 21 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/TurnPoint.java

@@ -1,8 +1,8 @@
 package org.springblade.manager.formula;
 
-import com.alibaba.fastjson.JSON;
 import com.mixsmart.utils.CustomFunction;
 import com.mixsmart.utils.StringUtils;
+import org.springblade.common.utils.BaseUtils;
 import org.springframework.beans.BeanUtils;
 
 import java.math.BigDecimal;
@@ -83,6 +83,9 @@ public class TurnPoint {
      */
     private Boolean vertical;
 
+    /**是否有效*/
+    private int isDeleted=0;
+
 
     public TurnPoint(LevelInfo levelInfo, Map<String, Object> dataMap) {
         this.levelInfo = levelInfo;
@@ -240,9 +243,17 @@ public class TurnPoint {
         }
         return d >= levelInfo.getMin() && d <= levelInfo.getStep()&&levelInfo.getSightHeight()-getQ0L()==getSc0L();
     }
+    /**判断转点前后视是否在范围*/
+    public boolean isWithinRangeValueZd(String any){
+           if(BaseUtils.isNumber(any)){
+               double d=Double.parseDouble(any);
+               return d >= levelInfo.getMin() && d <= levelInfo.getStep();
+           }
+           return false;
+    }
 
     public Boolean needClose() {
-        return this.levelInfo.getCloseZd().size() > 1;
+        return this.levelInfo.getCloseZd().size() > 1&& levelInfo.isNotPersist();
     }
 
     public static void test() {
@@ -409,4 +420,12 @@ public class TurnPoint {
     public void setVertical(Boolean vertical) {
         this.vertical = vertical;
     }
+
+    public int getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(int isDeleted) {
+        this.isDeleted = isDeleted;
+    }
 }

+ 2 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/MixProportionInfoMapper.xml

@@ -7,7 +7,7 @@
     <select id="compareInfo" resultType="java.lang.Integer">
         select count(1)
         from m_mix_proportion_info
-        WHERE is_deleted = 0 and report_number in
+        WHERE is_deleted = 0 and contract_id = #{contractId} and ( report_number in
         <foreach collection="number" item="n" open="(" separator="," close=")">
             #{n}
         </foreach>
@@ -15,6 +15,7 @@
         <foreach collection="strength" item="s" open="(" separator="," close=")">
             #{s}
         </foreach>
+        )
     </select>
     <select id="designStrengthList" resultType="java.lang.String">
         select design_strength

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

@@ -619,7 +619,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 //上传新文件到文件服务器
                 //excel修改 同步修改html 对象
                 String thmlUrl = file_path + filecode + ".html";
-                FileUtils.excelInfo(inputStream,dataUrl,thmlUrl,"2");
+              //  FileUtils.excelInfo(inputStream,dataUrl,thmlUrl,"2");
                 BladeFile bladeFile = newIOSSClient.uploadFile(excelTab.getExtension(), dataUrl);
                 //获取文件大小
                int size = connection.getContentLength() / 1024 / 1024; //单位M

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

@@ -415,15 +415,22 @@ public class FileUtils {
     }
 
 
-    public static void main123(String[] args) throws Exception {
-       String excelUrl = "/Users/hongchuangyanfa/Downloads/C10.28隧道注浆施工记录表.xlsx";
+    public static void main(String[] args) throws Exception {
+       String excelUrl = "/Users/hongchuangyanfa/Downloads/D10.1表-隧道总体质量检验单 (1).xlsx";
         String old_html = "/Users/hongchuangyanfa/Desktop/pdf/old_html.html";
         String old_xlsx = "/Users/hongchuangyanfa/Desktop/pdf/old_html.xlsx";
 
-        File data = new File(excelUrl);
-        InputStream inputStream = new FileInputStream(data);
-        excelInfo(inputStream,old_xlsx,old_html,"1");
-
+   //     excelInfo2(excelUrl,old_xlsx,old_html);
+        com.spire.xls.Workbook wb = new com.spire.xls.Workbook();
+        wb.loadFromMHtml(old_xlsx);
+        Worksheet sheet = wb.getWorksheets().get(0);
+        CellRange[] cells = sheet.getCells();
+        for (int i = 0; i < cells.length; i++) {
+            CellRange oldcell = cells[i];
+            CellRange mergedCell = sheet.getCellRange(oldcell.getRow(), oldcell.getColumn());
+            String data = mergedCell.getDataValidation().getErrorMessage();
+            System.out.println(oldcell.getRow()+"--=--"+oldcell.getColumn()+"--=--"+data);
+        }
 
 /*        String new_html = "/Users/hongchuangyanfa/Desktop/pdf/new_html.html";
         String new_xlsx = "/Users/hongchuangyanfa/Desktop/pdf/new_html.xlsx";
@@ -434,6 +441,177 @@ public class FileUtils {
     }
 
 
+    /**
+     * 在线编辑excel 操作
+     *
+     * @param inExcelUrl
+     * @param excelURL
+     * @param htmlUrl
+     * @throws Exception
+     */
+    public static void excelInfo2(String inExcelUrl, String excelURL, String htmlUrl) {
+        try {
+            String file_path = FileUtils.getSysLocalFileUrl() + "/pdf/";
+            String filecode = SnowFlakeUtil.getId() + "";
+            String thmlUrl2 = file_path + filecode + "123.html";
+
+            // 解析原始excel
+            com.spire.xls.Workbook wb = new com.spire.xls.Workbook();
+            wb.loadFromMHtml(inExcelUrl);
+            // 操作
+            com.spire.xls.Workbook wb2 = new com.spire.xls.Workbook();
+            wb2.loadFromMHtml(inExcelUrl);
+
+            //获取工作表
+            Worksheet sheet = wb.getWorksheets().get(0);
+            Worksheet sheet2 = wb2.getWorksheets().get(0);
+            HTMLOptions options = new HTMLOptions();
+            options.setImageEmbedded(true);
+
+            sheet.saveToHtml(htmlUrl, options);
+            wb.saveToFile(excelURL, FileFormat.Version2013);
+
+
+            CellRange[] mergedCells = sheet.getMergedCells();
+            Map<String, Map<String, Integer>> xyList = new HashMap<>();
+
+            CellRange[] cellRanges = sheet.getCells();
+
+            int j = 0;
+            int maxVal = 0;
+
+            for (int i = 0; i < cellRanges.length; i++) {
+                CellRange oldcell = cellRanges[i];
+                CellRange mergedCell = sheet.getCellRange(oldcell.getRow(), oldcell.getColumn());
+                String data = mergedCell.getDataValidation().getErrorMessage();
+                int k = 0;
+                if(Func.isNumeric(data)){
+                    k = Func.toInt(data);
+                }
+                if (maxVal < k) {
+                        maxVal = k;
+                }
+            }
+
+            for (int i = 0; i < mergedCells.length; i++) {
+                Map<String, Integer> dataMap = new HashMap<>();
+                CellRange oldcell = mergedCells[i];
+                CellRange mergedCell = sheet.getCellRange(oldcell.getRow(), oldcell.getColumn());
+                String data = mergedCell.getDataValidation().getErrorMessage();
+                if (StringUtils.isEmpty(data)) {
+                    if(maxVal<=0){
+                        j = j + 1;
+                    }else{
+                        maxVal = maxVal+1;
+                        j=maxVal;
+                    }
+                } else {
+                    if(Func.isNumeric(data)){
+                        j = Func.toInt(data);
+                    }else {
+                        j = Func.toInt((data.trim().replaceAll("\r|\n", "")).split(":")[1] + "");
+                    }
+                }
+                // 目标表添加备注信息
+                sheet2.getCellRange(oldcell.getRow(), oldcell.getColumn()).getDataValidation().setErrorMessage(j+"");
+                mergedCell.getDataValidation().setErrorMessage(j+"");
+                oldcell.getDataValidation().setErrorMessage(j+"");
+                mergedCell.setText(j + "");
+                dataMap.put("y1", oldcell.getRow());
+                dataMap.put("y2", oldcell.getLastRow());
+                dataMap.put("x1", oldcell.getColumn());
+                dataMap.put("x2", oldcell.getLastColumn());
+                xyList.put(j + "", dataMap);
+            }
+
+
+            CellRange[] onCell = sheet.getCells();
+            // 单个cell
+           /* for (int i = 0; i < onCell.length; i++) {
+                CellRange oldcell = onCell[i];
+                CellRange mergedCell = sheet.getCellRange(oldcell.getRow(), oldcell.getColumn());
+                String data = mergedCell.getDataValidation().getErrorMessage();
+                Map<String, Integer> dataMap = new HashMap<>();
+                if (StringUtils.isEmpty(data)) {
+                    if(maxVal<=0){
+                        j = j + 1;
+                    }else{
+                        maxVal = maxVal+1;
+                        j=maxVal;
+                    }
+                    // null 需要添加坐标
+                    dataMap.put("y1", oldcell.getRow());
+                    dataMap.put("y2", oldcell.getLastRow());
+                    dataMap.put("x1", oldcell.getColumn());
+                    dataMap.put("x2", oldcell.getLastColumn());
+                    xyList.put(j + "", dataMap);
+                } else {
+                    if(Func.isNumeric(data)){
+                        j = Func.toInt(data);
+                    }else {
+                        j = Func.toInt((data.trim().replaceAll("\r|\n", "")).split(":")[1] + "");
+                    }
+                }
+                sheet2.getCellRange(oldcell.getRow(), oldcell.getColumn()).getDataValidation().setErrorMessage(j+"");
+                mergedCell.setText(j + "");
+            }*/
+            sheet.saveToHtml(thmlUrl2, options);
+
+            // 上传excel文件
+            wb2.saveToFile(excelURL, FileFormat.Version2013);
+
+            // 组装坐标
+            File html1 = new File(htmlUrl);  // 原始html
+            File html2 = new File(thmlUrl2); // 坐标html
+            InputStream inputStream1 = new FileInputStream(html1);
+            InputStream inputStream2 = new FileInputStream(html2);
+            String htmlString1 = IoUtil.readToString(inputStream1);
+            String htmlString2 = IoUtil.readToString(inputStream2);
+
+            org.jsoup.nodes.Document doc1 = Jsoup.parse(htmlString1);
+            Element table1 = doc1.select("table").first();
+            Elements trs1 = table1.select("tr");
+            org.jsoup.nodes.Document doc2 = Jsoup.parse(htmlString2);
+            Element table2 = doc2.select("table").first();
+            Elements trs2 = table2.select("tr");
+
+            for (int i = 0; i < trs1.size(); i++) {
+                Elements td1 = trs1.get(i).select("td");
+                Elements td2 = trs2.get(i).select("td");
+                for (int x = 0; x < td1.size(); x++) {
+                    Element cell1 = td1.get(x);
+                    /*if (cell1.children().size() >= 1) {
+                        String data = cell1.text();
+                        cell1.empty();
+                        cell1.text(data);
+                    }*/
+                    Element cell2 = td2.get(x);
+                    String html = cell2.text();
+                    Map<String, Integer> xyMap = xyList.get(html);
+                    if (xyMap != null) {
+                        cell1.attr("x1", xyMap.get("x1") + "");
+                        cell1.attr("x2", xyMap.get("x2") + "");
+                        cell1.attr("y1", xyMap.get("y1") + "");
+                        cell1.attr("y2", xyMap.get("y2") + "");
+                        cell1.attr("exceVal",html);
+                    }
+                }
+            }
+
+            File writeFile = new File(htmlUrl);
+            FileUtil.writeToFile(writeFile, doc1.html(), Boolean.parseBoolean("UTF-8"));
+            if (html2.exists()) {
+             //   html2.delete();
+            }
+            wb2.dispose();
+            wb.dispose();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+
     /**
      * 在线编辑excel 操作
      *
@@ -442,7 +620,7 @@ public class FileUtils {
      * @param htmlUrl
      * @throws Exception
      */
-    public static void excelInfo(InputStream fileInputStream, String excelURL, String htmlUrl, String type) {
+    public static void excelInfo22222(InputStream fileInputStream, String excelURL, String htmlUrl, String type) {
         try {
             String file_path = FileUtils.getSysLocalFileUrl() + "/pdf/";
             String filecode = SnowFlakeUtil.getId() + "";
@@ -481,7 +659,7 @@ public class FileUtils {
                     k = Func.toInt(data);
                 }
                 if (maxVal < k) {
-                        maxVal = k;
+                    maxVal = k;
                 }
             }
 
@@ -508,10 +686,10 @@ public class FileUtils {
                 sheet2.getCellRange(oldcell.getRow(), oldcell.getColumn()).getDataValidation().setErrorMessage(j+"");
                 mergedCell.getDataValidation().setErrorMessage(j+"");
                 mergedCell.setText(j + "");
-                dataMap.put("x1", mergedCell.getRow());
-                dataMap.put("x2", mergedCell.getLastRow());
-                dataMap.put("y1", mergedCell.getColumn());
-                dataMap.put("y2", mergedCell.getLastColumn());
+                dataMap.put("y1", oldcell.getRow());
+                dataMap.put("y2", oldcell.getLastRow());
+                dataMap.put("x1", oldcell.getColumn());
+                dataMap.put("x2", oldcell.getLastColumn());
                 xyList.put(j + "", dataMap);
             }
 
@@ -528,6 +706,12 @@ public class FileUtils {
                         maxVal = maxVal+1;
                         j=maxVal;
                     }
+                    // null 需要添加坐标
+                    dataMap.put("y1", oldcell.getRow());
+                    dataMap.put("y2", oldcell.getLastRow());
+                    dataMap.put("x1", oldcell.getColumn());
+                    dataMap.put("x2", oldcell.getLastColumn());
+                    xyList.put(j + "", dataMap);
                 } else {
                     if(Func.isNumeric(data)){
                         j = Func.toInt(data);
@@ -536,13 +720,8 @@ public class FileUtils {
                     }
                 }
                 sheet2.getCellRange(oldcell.getRow(), oldcell.getColumn()).getDataValidation().setErrorMessage(j+"");
-                oldcell.getComment().getRichText().setText(j + "");
                 mergedCell.setText(j + "");
-                dataMap.put("x1", mergedCell.getRow());
-                dataMap.put("x2", mergedCell.getLastRow());
-                dataMap.put("y1", mergedCell.getColumn());
-                dataMap.put("y2", mergedCell.getLastColumn());
-                xyList.put(j + "", dataMap);
+
             }
             sheet.saveToHtml(thmlUrl2, options);
 
@@ -590,7 +769,7 @@ public class FileUtils {
             File writeFile = new File(htmlUrl);
             FileUtil.writeToFile(writeFile, doc1.html(), Boolean.parseBoolean("UTF-8"));
             if (html2.exists()) {
-               // html2.delete();
+                html2.delete();
             }
             fileInputStream.close();
             wb2.dispose();
@@ -600,5 +779,4 @@ public class FileUtils {
         }
     }
 
-
 }