liuyc 2 年之前
父节点
当前提交
208d33e64a

+ 36 - 21
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -455,7 +455,7 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "tabId", value = "表Id", required = true),
     })
     public R<List<ExceTabTreVO>> saveLinkeTab(Long exceTabId, Long tabId) throws IOException {
-        String file_path =ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         //String file_path = "C:\\Users\\泓创开发\\Desktop";
 
         // 关联 私有项目 wbs 数据信息
@@ -492,11 +492,11 @@ public class ExcelTabController extends BladeController {
         //解析
         Element table = doc.select("table").first();
         Elements trs = table.select("tr");
-        if (aPrivate.getInitTableId() == null){
+        if (aPrivate.getInitTableId() == null) {
             org.springblade.manager.entity.TableInfo tableInfo = tableInfoService.getOne(new LambdaQueryWrapper<org.springblade.manager.entity.TableInfo>()
                     .eq(org.springblade.manager.entity.TableInfo::getTabEnName, aPrivate.getInitTableName()));
-            aPrivate.setInitTableId(tableInfo.getId()+"");
-            updateWrapper.set("init_table_id", tableInfo.getId()+"");
+            aPrivate.setInitTableId(tableInfo.getId() + "");
+            updateWrapper.set("init_table_id", tableInfo.getId() + "");
         }
 
         List<WbsFormElement> elementList = wbsFormElementService.selectElementListByFid(aPrivate.getInitTableId() + "");
@@ -1144,7 +1144,7 @@ public class ExcelTabController extends BladeController {
                                     }
                                 } else {
                                     Element bforData = tds.get(j - 1);
-                                    if (!bforData.text().isEmpty() || bforData.html().indexOf("hc-form-checkbox-group")>=0) {
+                                    if (!bforData.text().isEmpty() || bforData.html().indexOf("hc-form-checkbox-group") >= 0) {
                                         if (rowspan >= 1) {
                                             data.empty().append("<el-input @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='textarea' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
                                         } else {
@@ -1408,13 +1408,13 @@ public class ExcelTabController extends BladeController {
         String tabName = wbsTreeContract.getInitTableName();
         // 字段查询 并去掉公式字段
 
-        String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_table_info a ,m_wbs_form_element b WHERE a.tab_en_name = '"+tabName+"' and a.id=b.f_id ";
+        String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_table_info a ,m_wbs_form_element b WHERE a.tab_en_name = '" + tabName + "' and a.id=b.f_id ";
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
         colkeys = stringObjectMap.get("colkeys") + "";
 
         // 复制表数据
 
-        String querySql = "insert into "+tabName+" (id,p_key_id,"+colkeys+") select '"+newPkId+"','"+newPkId+"'," + colkeys + " from " + tabName + " where p_key_id=" + pkeyId;
+        String querySql = "insert into " + tabName + " (id,p_key_id," + colkeys + ") select '" + newPkId + "','" + newPkId + "'," + colkeys + " from " + tabName + " where p_key_id=" + pkeyId;
         jdbcTemplate.execute(querySql);
 
         wbsTreeContractService.save(wbsTreeContract);
@@ -1529,14 +1529,14 @@ public class ExcelTabController extends BladeController {
                 pdfUrl = stringObjectMap.get("e_visa_pdf_url");
             }
 
-            if (stringObjectMap.get("pdf_trial_url") != null){
+            if (stringObjectMap.get("pdf_trial_url") != null) {
                 //优先使用试验合并的PDF
                 pdfUrl = stringObjectMap.get("pdf_trial_url");
             }
 
-            if(StringUtils.isEmpty(pdfUrl+"")){
-                return R.fail(300,"无数据");
-            }else{
+            if (StringUtils.isEmpty(pdfUrl + "")) {
+                return R.fail(300, "无数据");
+            } else {
                 return R.data(pdfUrl);
             }
         } else {
@@ -1650,7 +1650,7 @@ public class ExcelTabController extends BladeController {
     })
     public R<String> getTheLogPdInfo(String theLogId, String nodePrimaryKeyId, String recordTime, String contractId) throws Exception {
         //获取配置的路径
-        String file_path =ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
 
         //获取对应的日志
         JSONObject theLogJson;
@@ -1802,7 +1802,7 @@ public class ExcelTabController extends BladeController {
                                 String key = e.getColKey();
                                 String[] keys = key.split("__");
                                 String[] trtd = keys[1].split("_");
-                                if ( trs.size() > (Integer.parseInt(trtd[0]))) {
+                                if (trs.size() > (Integer.parseInt(trtd[0]))) {
                                     Element trData = trs.get(Integer.parseInt(trtd[0]));
                                     Elements tdDatas = trData.select("td");
                                     if (tdDatas.size() > Integer.parseInt(trtd[1])) {
@@ -1821,7 +1821,8 @@ public class ExcelTabController extends BladeController {
                                         cellRange.getCellStyle().getFont().setColor(Color.white);
                                     }
 
-                            }});
+                                }
+                            });
                         }
                     }
                 }
@@ -1981,10 +1982,10 @@ public class ExcelTabController extends BladeController {
                     resultMapList.add(reData);
                 }
             }
-        }else {
+        } else {
             WbsTreePrivate node = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, nodePrimaryKeyId));
             WbsTreePrivate tableNode = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery()
-                    .eq(WbsTreePrivate::getParentId, node.getId()).eq(WbsTreePrivate::getProjectId,node.getProjectId()));
+                    .eq(WbsTreePrivate::getParentId, node.getId()).eq(WbsTreePrivate::getProjectId, node.getProjectId()));
             Map<String, Object> reData = new HashMap<>();
             // 获取默认值
             QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
@@ -2000,7 +2001,6 @@ public class ExcelTabController extends BladeController {
         }
 
 
-
         return R.data(resultMapList);
     }
 
@@ -2740,12 +2740,27 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "id", value = "记录id-当做groupId", required = true)
     })
     public R<List<Map<String, Object>>> getBussDataInfoTrial(Long id, Long pkeyId) {
-        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, pkeyId );
+        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, pkeyId);
         return R.data(bussDataInfoTrial);
     }
 
+    @GetMapping("/get-buss-dataInfo-list-trial")
+    @ApiOperationSupport(order = 34)
+    @ApiOperation(value = "获取试验用户保存数据-施工关联试验数据", notes = "获取试验用户保存数据-施工关联试验数据")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "pkeyId", value = "表id", required = true),
+            @ApiImplicitParam(name = "id", value = "记录id-当做groupId", required = true)
+    })
+    public R<Map<String, Object>> getBussDataInfoListTrial(Long id, Long pkeyId) {
+        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, pkeyId);
+        Map<String, Object> map = bussDataInfoTrial.get(0);
+        map.remove("group_id");
+        return R.data(map);
+    }
+
     /**
      * 在线excel 修改回调
+     *
      * @throws IOException
      */
     @PostMapping(value = "/callbackSave")
@@ -2801,13 +2816,13 @@ public class ExcelTabController extends BladeController {
                     }
                 }
             }
-            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++){ // 转换方法
+        for (int i = 0; i < res.length; i++) { // 转换方法
             res[i] = redata.get(i).toArray(new String[redata.get(i).size()]);
         }
         return R.data(res);