Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

liuyc 1 жил өмнө
parent
commit
4223b3fc42

+ 2 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/OperationLogVO.java

@@ -47,4 +47,6 @@ public class OperationLogVO extends OperationLog {
     @ApiModelProperty("结束时间")
     private String endTime;
 
+    private Long contractId;
+
 }

+ 7 - 8
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/FB02.java

@@ -28,7 +28,7 @@ public class FB02 {
     private Integer  rowSize=20;
     private List<FormData> fds = new ArrayList<>();
     private List<Item> datas = new ArrayList<>();
-    private Map<FormData, BiFunction<List<Item>,Integer,List<Object>>> fm = new HashMap<>();
+    private Map<String, BiFunction<List<Item>,Integer,List<Object>>> fm = new HashMap<>();
     private List<String> sqlList = new ArrayList<>();
 
 
@@ -70,19 +70,19 @@ public class FB02 {
          for(FormData fd:processFds){
               if(fd.getEName().contains("分项工程名称")){
                   this.subItem=fd;
-                  this.fm.put(fd,(List<Item> l,Integer pn)->l.stream().map(Item::getSubItem).collect(Collectors.toList()));
+                  this.fm.put(fd.getCode(),(List<Item> l,Integer pn)->l.stream().map(Item::getSubItem).collect(Collectors.toList()));
               }else if(fd.getEName().contains("序号")){
                   this.sn=fd;
-                  this.fm.put(fd,(List<Item> l,Integer pn)->IntStream.range(0, l.size()).boxed().map(i->i+pn*l.size()).collect(Collectors.toList()));
+                  this.fm.put(fd.getCode(),(List<Item> l,Integer pn)->IntStream.range(0, l.size()).boxed().map(i->i+pn*l.size()).collect(Collectors.toList()));
               }else if(fd.getEName().contains("实测项目")){
                   this.name=fd;
-                  this.fm.put(fd,(List<Item> l,Integer pn)->l.stream().map(Item::getName).collect(Collectors.toList()));
+                  this.fm.put(fd.getCode(),(List<Item> l,Integer pn)->l.stream().map(Item::getName).collect(Collectors.toList()));
               }else if(fd.getEName().contains("实测合格率")){
                   this.passRate=fd;
-                  this.fm.put(fd,(List<Item> l,Integer pn)->l.stream().map(Item::getPassRate).collect(Collectors.toList()));
+                  this.fm.put(fd.getCode(),(List<Item> l,Integer pn)->l.stream().map(Item::getPassRate).collect(Collectors.toList()));
               }else if(fd.getEName().trim().equals("权值")){
                   this.weight=fd;
-                  this.fm.put(fd,(List<Item> l,Integer pn)->l.stream().map(Item::getWeight).collect(Collectors.toList()));
+                  this.fm.put(fd.getCode(),(List<Item> l,Integer pn)->l.stream().map(Item::getWeight).collect(Collectors.toList()));
               }
               if(this.subItem!=null&&this.name!=null&&this.passRate!=null&&this.weight!=null&&this.sn!=null){
                   /*匹配完成*/
@@ -131,7 +131,6 @@ public class FB02 {
                     sb.append(putEd(k,v,fd,w)).append(StringPool.COMMA);
                 });
                 String template="update "+w.getInitTableName()+" set "+sb.deleteCharAt(sb.length()-1)+" where id ="+w.getPKeyId();
-                System.out.println("EUV:"+template);
                 sqlList.add(template);
             }
 
@@ -142,7 +141,7 @@ public class FB02 {
 
    /**把数据放到对应元素*/
     private String putEd(int pn,List<Item> items, FormData fd,WbsTreeContract w){
-        BiFunction<List<Item>,Integer,List<Object>> fc = this.fm.get(fd);
+        BiFunction<List<Item>,Integer,List<Object>> fc = this.fm.get(fd.getCode());
         if(fc!=null) {
             List<Object> data = fc.apply(items,pn);
             List<ElementData> list = new ArrayList<>();

+ 7 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/OperationLogController.java

@@ -17,6 +17,7 @@
 package org.springblade.business.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@@ -25,6 +26,7 @@ import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateUtils;
 import org.jetbrains.annotations.NotNull;
+import org.springblade.business.mapper.OperationLogMapper;
 import org.springblade.business.wrapper.OperationLogWrapper;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -60,6 +62,8 @@ public class OperationLogController extends BladeController {
 
     private final IDictBizClient dictBizClient;
 
+    private final OperationLogMapper logMapper;
+
 
 
     /**
@@ -156,8 +160,9 @@ public class OperationLogController extends BladeController {
         }
 
 
-
-        IPage<OperationLog> pages = operationLogService.page(Condition.getPage(query), wrapper.lambda().orderBy(true, false, OperationLog::getCreateTime));
+        IPage<OperationLog> pages = new Page<>(query.getCurrent(),query.getSize());
+//        IPage<OperationLog> pages = operationLogService.page(Condition.getPage(query), wrapper.lambda().orderBy(true, false, OperationLog::getCreateTime));
+        pages = logMapper.getPage(pages,operationLog);
 
         //获取业务字典
         List<DictBiz> dictBizList = this.dictBizClient.getList("operation_type", "notRoot").getData();

+ 4 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/OperationLogMapper.java

@@ -16,9 +16,11 @@
  */
 package org.springblade.business.mapper;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
 import org.springblade.business.entity.OperationLog;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.business.vo.OperationLogVO;
 
 import java.util.List;
 
@@ -37,4 +39,6 @@ public interface OperationLogMapper extends BaseMapper<OperationLog> {
     List<String> queryBusinessModule(@Param("userId") Long userId);
 
     Long getAdminId();
+
+    IPage<OperationLog> getPage(IPage<OperationLog> pages,@Param("vo") OperationLogVO operationLog);
 }

+ 6 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/OperationLogMapper.xml

@@ -52,5 +52,11 @@
     <select id="getAdminId" resultType="java.lang.Long">
         select id from blade_role WHERE role_name = '超级管理员'
     </select>
+    <select id="getPage" resultType="org.springblade.business.entity.OperationLog">
+        select *
+        from u_operation_log uol where is_deleted = 0
+        and (SELECT contract_id from m_wbs_tree_contract WHERE p_key_id = SUBSTRING_INDEX(uol.business_id,",",1)) = #{vo.contractId}
+        order by uol.create_time desc
+    </select>
 
 </mapper>

+ 116 - 109
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -624,7 +624,7 @@ public class ExcelTabController extends BladeController {
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
     })
-    public R getExcelHtmlByBuss(Long pkeyId) throws Exception {
+    public R getExcelHtmlByBuss(Long pkeyId){
 
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
@@ -635,74 +635,75 @@ public class ExcelTabController extends BladeController {
             return R.fail("暂无表单!");
         }
 
-        String fileUrl = wbsTreeContract.getHtmlUrl();
-        InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
-
-        String htmlString = IoUtil.readToString(fileInputStream);
-        htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
-        htmlString = htmlString.replaceAll("title", "titlexx");
-
-        // 远程搜索配置
-        Document doc = Jsoup.parse(htmlString);
-        int maxCol = doc.select("Col").size();
-        Element table = doc.select("table").first();
-        Elements hc = doc.select("hc-form-select-search");
-        if (hc.size() >= 1) {
-            for (int i = 0; i < hc.size(); i++) {
-                Element datax = hc.get(i);
-                datax.removeAttr("pkeyId");
-                datax.removeAttr("contractId");
-                datax.attr("pkeyId", pkeyId + "");
-                datax.attr("contractId", wbsTreeContract.getContractId());
+        try {
+            String fileUrl = wbsTreeContract.getHtmlUrl();
+            InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
+
+            String htmlString = IoUtil.readToString(fileInputStream);
+            htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
+            htmlString = htmlString.replaceAll("title", "titlexx");
+
+            // 远程搜索配置
+            Document doc = Jsoup.parse(htmlString);
+            int maxCol = doc.select("Col").size();
+            Element table = doc.select("table").first();
+            Elements hc = doc.select("hc-form-select-search");
+            if (hc.size() >= 1) {
+                for (int i = 0; i < hc.size(); i++) {
+                    Element datax = hc.get(i);
+                    datax.removeAttr("pkeyId");
+                    datax.removeAttr("contractId");
+                    datax.attr("pkeyId", pkeyId + "");
+                    datax.attr("contractId", wbsTreeContract.getContractId());
+                }
             }
-        }
 
-        // 远程搜索配置2-设计强度搜索
-        Elements hc2 = doc.select("hc-form-select-search2");
-        if (hc2.size() >= 1) {
-            for (int i = 0; i < hc2.size(); i++) {
-                Element datax = hc2.get(i);
-                datax.removeAttr("contractId");
-                datax.attr("contractId", wbsTreeContract.getContractId());
+            // 远程搜索配置2-设计强度搜索
+            Elements hc2 = doc.select("hc-form-select-search2");
+            if (hc2.size() >= 1) {
+                for (int i = 0; i < hc2.size(); i++) {
+                    Element datax = hc2.get(i);
+                    datax.removeAttr("contractId");
+                    datax.attr("contractId", wbsTreeContract.getContractId());
+                }
             }
-        }
 
-        // 标题解决
-        ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
-        //判断是否是水利水电表,水利水电项目名14,表名12 。   其他表都是18
-        Boolean isWater = false;
-        ExcelTab tab = excelTabMapper.getWaterByTableId(wbsTreeContract.getExcelId());
-        if (tab != null) {
-            isWater = true;
-        }
+            // 标题解决
+            ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
+            //判断是否是水利水电表,水利水电项目名14,表名12 。   其他表都是18
+            Boolean isWater = false;
+            ExcelTab tab = excelTabMapper.getWaterByTableId(wbsTreeContract.getExcelId());
+            if (tab != null) {
+                isWater = true;
+            }
 
-        // 添加标题显示
-        Elements trs = table.select("tr");
-        for (int i = 1; i < 6; i++) {
-            Element tr = trs.get(i);
-            Elements tds = tr.select("td");
-            for (int j = 0; j < tds.size(); j++) {
-                Element data = tds.get(j);
-                int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
-                String style = data.attr("style");
-                if (style.indexOf("font-size") >= 0) {
-                    int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt")));
-                    if (isWater) {
-                        if (StringUtils.isNotEmpty(data.text()) && fontsize >= 12) {
-                            trs.get(i - 1).select("td").get(0).text(projectInfo.getProjectName());
-                        }
-                    } else {
-                        if (StringUtils.isNotEmpty(data.text()) && fontsize >= 14) {
-                            trs.get(i - 1).select("td").get(0).text(projectInfo.getProjectName());
+            // 添加标题显示
+            Elements trs = table.select("tr");
+            for (int i = 1; i < 6; i++) {
+                Element tr = trs.get(i);
+                Elements tds = tr.select("td");
+                for (int j = 0; j < tds.size(); j++) {
+                    Element data = tds.get(j);
+                    int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
+                    String style = data.attr("style");
+                    if (style.indexOf("font-size") >= 0) {
+                        int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt")));
+                        if (isWater) {
+                            if (StringUtils.isNotEmpty(data.text()) && fontsize >= 12) {
+                                trs.get(i - 1).select("td").get(0).text(projectInfo.getProjectName());
+                            }
+                        } else {
+                            if (StringUtils.isNotEmpty(data.text()) && fontsize >= 14) {
+                                trs.get(i - 1).select("td").get(0).text(projectInfo.getProjectName());
+                            }
                         }
                     }
                 }
             }
-        }
 
-        // 获取公式颜色
-        String tabName = wbsTreeContract.getInitTableName();
-        // 字段查询 获取公式字段
+            // 获取公式颜色
+            String tabName = wbsTreeContract.getInitTableName();
+            // 字段查询 获取公式字段
 //        String colkeys = "SELECT e_key from m_table_info a ,m_wbs_form_element b WHERE a.tab_en_name = '" + tabName + "' and a.id=b.f_id and b.id  in(SELECT element_id from m_element_formula_mapping c where c.is_deleted=0) ";
 //
 //        List<Map<String, Object>> maps = jdbcTemplate.queryForList(colkeys);
@@ -723,16 +724,19 @@ public class ExcelTabController extends BladeController {
 //                }
 //            }
 //        }
-        WbsTreeContract process = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery()
-                .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
-                .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId())
-                .eq(WbsTreeContract::getWbsId, wbsTreeContract.getWbsId()).last("limit 1"));
-        if (process != null) {
-            this.excelTabService.gsColor(pkeyId, process.getPKeyId().toString(), wbsTreeContract.getProjectId(), doc);
+            WbsTreeContract process = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery()
+                    .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
+                    .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId())
+                    .eq(WbsTreeContract::getWbsId, wbsTreeContract.getWbsId()).last("limit 1"));
+            if (process != null) {
+                this.excelTabService.gsColor(pkeyId, process.getPKeyId().toString(), wbsTreeContract.getProjectId(), doc);
+            }
+            doc.select("Col").remove();
+            fileInputStream.close();
+            return R.data(table + "");
+        }catch (Exception e){
+            return R.fail("暂无表单!");
         }
-        doc.select("Col").remove();
-        fileInputStream.close();
-        return R.data(table + "");
     }
 
 
@@ -2106,7 +2110,7 @@ public class ExcelTabController extends BladeController {
     }
 
 
-    @PostMapping("/save_buss_data")
+    @PostMapping("/save_buss_data2")
     @ApiOperationSupport(order = 13)
     @ApiOperation(value = "填报页面数据保存", notes = "填报页面数据保存")
     public R saveBussData2(@Valid @RequestBody JSONObject dataInfo) throws Exception {
@@ -3541,7 +3545,7 @@ public class ExcelTabController extends BladeController {
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
     })
-    public R getHtmlBussCols(Long pkeyId) throws Exception {
+    public R getHtmlBussCols(Long pkeyId)  {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
@@ -3552,51 +3556,54 @@ public class ExcelTabController extends BladeController {
         if (wbsTreeContract.getHtmlUrl() == null) {
             return R.fail("暂无表单!");
         }
+        try {
+            String fileUrl = wbsTreeContract.getHtmlUrl();
+            File file1 = ResourceUtil.getFile(fileUrl);
+            InputStream fileInputStream = null;
+            if (file1.exists()) {
+                fileInputStream = new FileInputStream(file1);
+            } else {
+                String path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path, "");
+                fileInputStream = CommonUtil.getOSSInputStream(path);
+            }
 
-        String fileUrl = wbsTreeContract.getHtmlUrl();
-        File file1 = ResourceUtil.getFile(fileUrl);
-        InputStream fileInputStream = null;
-        if (file1.exists()) {
-            fileInputStream = new FileInputStream(file1);
-        } else {
-            String path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path, "");
-            fileInputStream = CommonUtil.getOSSInputStream(path);
-        }
-
-
-        String htmlString = IoUtil.readToString(fileInputStream);
-        // 解析 style
-        Document doc = Jsoup.parse(htmlString);
-        Element table = doc.select("table").first();
-        Elements trs = table.select("tr");
 
-        List<List<String>> redata = new ArrayList<>();
-        for (int i = 0; i < trs.size(); i++) {
-            Element tr = trs.get(i);
-            Elements tds = tr.select("td");
-            List<String> tdList = new ArrayList<>();
-            for (int j = 0; j < tds.size(); j++) {
-                Element element = tds.get(j);
-                if (element.html().indexOf("el-tooltip") >= 0) {
-                    element = element.children().get(0);
-                }
-                if (element.children().size() >= 1) {
-                    String keyname = element.children().get(0).attr("keyname");
-                    if (StringUtils.isNotEmpty(keyname)) {
-                        tdList.add(keyname);
+            String htmlString = IoUtil.readToString(fileInputStream);
+            // 解析 style
+            Document doc = Jsoup.parse(htmlString);
+            Element table = doc.select("table").first();
+            Elements trs = table.select("tr");
+
+            List<List<String>> redata = new ArrayList<>();
+            for (int i = 0; i < trs.size(); i++) {
+                Element tr = trs.get(i);
+                Elements tds = tr.select("td");
+                List<String> tdList = new ArrayList<>();
+                for (int j = 0; j < tds.size(); j++) {
+                    Element element = tds.get(j);
+                    if (element.html().indexOf("el-tooltip") >= 0) {
+                        element = element.children().get(0);
+                    }
+                    if (element.children().size() >= 1) {
+                        String keyname = element.children().get(0).attr("keyname");
+                        if (StringUtils.isNotEmpty(keyname)) {
+                            tdList.add(keyname);
+                        }
                     }
                 }
+                if (tdList != null && tdList.size() >= 1) {
+                    redata.add(tdList);
+                }
             }
-            if (tdList != null && tdList.size() >= 1) {
-                redata.add(tdList);
-            }
-        }
 
-        String[][] res = new String[redata.size()][]; // 存放转换结果的 二维数组
-        for (int i = 0; i < res.length; i++) { // 转换方法
-            res[i] = redata.get(i).toArray(new String[redata.get(i).size()]);
+            String[][] res = new String[redata.size()][]; // 存放转换结果的 二维数组
+            for (int i = 0; i < res.length; i++) { // 转换方法
+                res[i] = redata.get(i).toArray(new String[redata.get(i).size()]);
+            }
+            return R.data(res);
+        }catch (Exception e){
+            return R.fail("暂无表单!");
         }
-        return R.data(res);
     }
 
 
@@ -3843,7 +3850,7 @@ public class ExcelTabController extends BladeController {
      * @return
      * @throws Exception
      */
-    @PostMapping("/save_buss_data2")
+    @PostMapping("/save_buss_data")
     @ApiOperationSupport(order = 13)
     @ApiOperation(value = "填报页面数据保存", notes = "填报页面数据保存")
     public R saveBussData(@Valid @RequestBody JSONObject dataInfo) throws Exception {

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

@@ -70,6 +70,7 @@ import org.springblade.manager.vo.*;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.system.cache.ParamCache;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.DataIntegrityViolationException;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -515,10 +516,14 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
     private void updateFormulaLog(String log, Long pKeyId) {
         try {
-            String deleteSql = "DELETE FROM m_formula_log WHERE id = ?";
-            String insertSql = "INSERT INTO m_formula_log (id, content,update_time) VALUES (?, ?,?)";
-            jdbcTemplate.update(deleteSql, pKeyId);
-            jdbcTemplate.update(insertSql, pKeyId, log, DateTime.now());
+            if(log.length()<=2000) {
+                String deleteSql = "DELETE FROM m_formula_log WHERE id = ?";
+                String insertSql = "INSERT INTO m_formula_log (id, content,update_time) VALUES (?, ?,?)";
+                jdbcTemplate.update(deleteSql, pKeyId);
+                jdbcTemplate.update(insertSql, pKeyId, log, DateTime.now());
+            }else{
+                StaticLog.error(log);
+            }
         } catch (Exception e) {
             e.printStackTrace();
         }

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

@@ -676,18 +676,20 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             constantMap.put(e,e);
         });
     }
-
+    public Map<String,Object> getWpMap(CurrentNode currentNode){
+        return this.getWpMap(currentNode.getWbsNodeId(),currentNode.getWtpPkeyId());
+    }
     /**
      * @Description 获取节点参数
      **/
-    public Map<String,Object> getWpMap(CurrentNode currentNode){
+    public Map<String,Object> getWpMap(Long wbsNodeId,Long wtpPkeyId){
         Map<String,Object> result = new HashMap<>(100);
         List<WbsParam> total = new ArrayList<>();
-        List<WbsParam> wpsPublic = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,currentNode.getWbsNodeId()).eq(WbsParam::getType,1));
+        List<WbsParam> wpsPublic = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,wbsNodeId).eq(WbsParam::getType,1));
         if(Func.isNotEmpty(wpsPublic)){
             total.addAll(wpsPublic);
         }
-        List<WbsParam> wpsPrivate = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,currentNode.getWtpPkeyId()).eq(WbsParam::getType,1));
+        List<WbsParam> wpsPrivate = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,wtpPkeyId).eq(WbsParam::getType,1));
         if(Func.isNotEmpty(wpsPrivate)){
             total.addAll(wpsPrivate);
         }
@@ -1535,7 +1537,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                            WbsTreeContract target = FormulaUtils.copyPage(origin);
                            saveList.add(target);
                        }
-                       this.wbsTreeContractService.saveOrUpdateBatch(saveList);
+                       this.wbsTreeContractService.saveBatch(saveList);
                        list.addAll(saveList);
                        String sql="select * from "+origin.getInitTableName()+" where p_key_id ="+origin.getPKeyId();
                        @SuppressWarnings("unchecked")
@@ -2433,6 +2435,11 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 LinkedList<String> treeCode = new LinkedList<>(FormulaUtils.treeCodeSplit(wtcEva.getTreeCode()));
                 List<FormulaDataBlock> formulaDataBlocks = this.getSqlList("select a.* from m_formula_data_block a join (select parent_id from m_wbs_tree_contract where tree_code like '" + treeCode.getLast() + "%' and contract_id =" + wtcEva.getContractId() + " and major_data_type=2 and is_deleted=0 ORDER BY tree_code)b on a.sw_id=b.parent_id ", FormulaDataBlock.class);
                 if (formulaDataBlocks!=null&&formulaDataBlocks.size() > 0) {
+                    /*获取分部工程名称*/
+                    WbsTreeContract node = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getId, wtcEva.getParentId()).eq(WbsTreeContract::getContractId,wtcEva.getContractId()));
+                    WbsTreePrivate wtp = this.wtpId(node.getPKeyId());
+                    WbsTreePrivate publicWtp = this.getOriginWtp(wtp.getPKeyId());
+                    this.getWpMap(publicWtp.getId(),wtp.getPKeyId());
                     formulaDataBlocks.forEach(fdb -> {
                         List<ElementBlock> elementBlockList = JSON.parseArray(fdb.getVal(), ElementBlock.class);
                         elementBlockList.forEach(eb -> {