hongchuangyanfa %!s(int64=2) %!d(string=hai) anos
pai
achega
e731e0cffe

+ 1 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1727,6 +1727,7 @@ public class InformationWriteQueryController extends BladeController {
         if (queryProcess != null && queryProcess.size() > 0) {
             //检查这些填报节点是否存在已经审批或已经上报的节点,如果存在则不允许删除
             List<QueryProcessDataVO> approvalList = queryProcess.stream().filter(vo -> new Integer("2").equals(vo.getStatus())).collect(Collectors.toList());
+            //
             List<QueryProcessDataVO> runTaskList = queryProcess.stream().filter(vo -> new Integer("1").equals(vo.getStatus())).collect(Collectors.toList());
             if (approvalList.size() > 0 || runTaskList.size() > 0) {
                 //说明存在已经审批或已经上报的节点,不允许删除

+ 2 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -1076,7 +1076,7 @@ public class ExcelTabController extends BladeController {
                         ExctabCell exctabCell = new ExctabCell();
                         if ((textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) || inputText.indexOf("日期") >= 0) {
                             if (inputText.indexOf("日期") >= 0) {
-                                data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='" + inputText + "'> </el-date-picker>");
+                                data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='" + inputText + "'> </el-date-picker>");
                             } else if (textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) {
                                 if (inputText.indexOf("专业监理工程师") >= 0) {
                                     inputText = "专业监理工程师_年月日";
@@ -1086,7 +1086,7 @@ public class ExcelTabController extends BladeController {
                                     inputText = "年月日";
                                 }
                             }
-                            data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
+                            data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
                             exctabCell.setTextInfo(inputText);
                             exctabCell.setExctabId(excelId);
                             exctabCell.setIsDeleted(0);
@@ -1326,8 +1326,6 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "id", value = "id", required = true)
     })
     public R getExcelHtmlByCol(Long id) throws IOException, InterruptedException {
-
-        Thread.sleep(200);
         ExcelTab detail = excelTabService.getById(id);
         if (detail == null) {
             return R.fail("该数据下无此节点!");

+ 5 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsFormElementMapper.xml

@@ -125,12 +125,12 @@
     </select>
 
     <select id="selectDetailById" resultType="org.springblade.manager.vo.WbsFormElementVO">
-        SELECT *,
-               (SELECT concat(init_table_name, "_", t.e_key) FROM m_wbs_tree WHERE id = t.f_id) AS "tableElementKey"
-        FROM m_wbs_form_element t
+        SELECT t.*,
+               concat(c.tab_en_name, "_", t.e_key)  AS "tableElementKey",c.tab_ch_name as "initTableName"
+        FROM m_wbs_form_element t LEFT JOIN m_table_info c on t.f_id=c.id
         WHERE t.id = #{id}
-          AND status = 1
-          AND is_deleted = 0
+          AND t.status = 1
+          AND t.is_deleted = 0
     </select>
 
     <select id="selectElementInTableByFid" resultType="org.springblade.manager.entity.WbsTree">

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

@@ -552,6 +552,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 excelTab.setStatus(3);
                 baseMapper.updateById(excelTab);
                 connection.disconnect();
+                System.out.println("123456");
             } catch (Exception e) {
                 editCallback.setError(1);
                 e.printStackTrace();
@@ -1048,7 +1049,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     public R getBussPdfInfo(Long pkeyId) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        //String file_path = "C:\\Users\\泓创开发\\Desktop";
+       // String file_path = "/Users/hongchuangyanfa/Desktop/";
 
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
@@ -1089,7 +1090,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
         int all = sheet.getRow(0).getLastCellNum();
         int mergedCellCnt = sheet.getNumMergedRegions();
-        List<Map<String, Integer>> titleList = new ArrayList<>();
         for (int i = 0; i < mergedCellCnt - 1; i++) {
             CellRangeAddress mergedCell = sheet.getMergedRegion(i);
             int xx = mergedCell.getNumberOfCells();
@@ -1100,39 +1100,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 short fontIndex = cell.getCellStyle().getFontIndex();
                 Font fontAt = workbook.getFontAt(fontIndex);
                 short fontHeightInPoints = fontAt.getFontHeightInPoints();
-                if (fontHeightInPoints >= 14) {
-                    Map<String, Integer> titleMap = new HashMap<>();
-                    titleMap.put("index", i);
-                    titleMap.put("x", firsrCol);
-                    titleMap.put("y", fisRow);
-                    String data = cell.getStringCellValue();
-                    if (StringUtils.isNotEmpty(data)) {
-                        titleMap.put("val", 2);
-                    } else {
-                        titleMap.put("val", 1);
-                    }
-                    titleList.add(titleMap);
-                }
-            }
-        }
-
-        //添加标题
-        System.out.println(titleList.size());
-        if (titleList != null) {
-            if (titleList.size() == 1) {
-                Map<String, Integer> titData = titleList.get(0);
-                if (titData.get("val") == 1) {
-                    Cell cell = sheet.getRow(titData.get("y")).getCell(titData.get("x"));
+                if (fontHeightInPoints >= 14 && StringUtils.isEmpty(cell.getStringCellValue()) && fisRow<=8) {
                     cell.setCellValue(projectInfo.getProjectName());
-                }
-            } else if (titleList.size() >= 2) {
-                for (int i = 0; i < titleList.size(); i++) {
-                    Map<String, Integer> titData = titleList.get(i);
-                    if (titData.get("val") == 2) {
-                        Map<String, Integer> titData2 = titleList.get(i - 1);
-                        Cell cell = sheet.getRow(titData2.get("y")).getCell(titData2.get("x"));
-                        cell.setCellValue(projectInfo.getProjectName());
-                    }
+                    break;
                 }
             }
         }
@@ -1219,17 +1189,25 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     FileUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
 
                                 } else if (myData.equals("1") && data.html().indexOf("hc-form-checkbox-group") >= 0) {
-                                    Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
-                                    String exceVal = cell.getStringCellValue().replaceAll(" ", "");
-                                    short fontIndex = cell.getCellStyle().getFontIndex();
-                                    Font fontAt = workbook.getFontAt(fontIndex);
-                                    fontAt.setFontName("EUDC");
-                                    cell.setCellValue(exceVal.replace("□", "\u2611"));
+                                    Row row = sheet.getRow(y1 - 1);
+                                    if(row!=null){
+                                        Cell cell = row.getCell(x1 - 1);
+                                        if(cell!=null || ObjectUtils.isNotEmpty(cell)) {
+                                            String exceVal = cell.getStringCellValue().replaceAll(" ", "");
+                                            short fontIndex = cell.getCellStyle().getFontIndex();
+                                            Font fontAt = workbook.getFontAt(fontIndex);
+                                            fontAt.setFontName("EUDC");
+                                            cell.setCellValue(exceVal.replace("□", "\u2611"));
+                                        }
+                                    }
                                 } else {
-                                    Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
-                                    cell.setCellValue(myData);
-
-
+                                    Row row = sheet.getRow(y1 - 1);
+                                    if(row!=null){
+                                        Cell cell = row.getCell(x1 - 1);
+                                        if(cell!=null || ObjectUtils.isNotEmpty(cell)){
+                                            cell.setCellValue(myData);
+                                        }
+                                    }
                                 }
                             }
                         }
@@ -1254,18 +1232,26 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         }
                         int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
 
-                        Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
-                        cell.setCellValue(e.getId() + "");
-                        short fontIndex = cell.getCellStyle().getFontIndex();
-                        Font oldfontAt = workbook.getFontAt(fontIndex);
-
-                        Font redFont = workbook.createFont();
-                        redFont.setColor(IndexedColors.WHITE.getIndex());
-                        redFont.setFontHeightInPoints(oldfontAt.getFontHeightInPoints());
-                        redFont.setFontName(oldfontAt.getFontName());
-                        CellStyle cellStyle = workbook.createCellStyle();
-                        cellStyle.setFont(redFont);
-                        cell.setCellStyle(cellStyle);
+                        Row row = sheet.getRow(y1 - 1);
+                        if(row!=null){
+                            Cell cell = sheet.getRow(y1-1).getCell(x1-1);
+                            if(cell!=null || ObjectUtils.isNotEmpty(cell)){
+                                short fontIndex = cell.getCellStyle().getFontIndex();
+                                Font oldfontAt = workbook.getFontAt(fontIndex);
+
+                                Font redFont = workbook.createFont();
+                                redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
+                                redFont.setFontHeightInPoints(oldfontAt.getFontHeightInPoints());//设置字体大小
+                                redFont.setFontName(oldfontAt.getFontName());//设置字体
+
+                                CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
+                                newStyle.cloneStyleFrom(cell.getCellStyle());
+                                newStyle.setFont(redFont);
+                                cell.setCellStyle(newStyle);
+                                cell.setCellValue(e.getId() + "");
+                            }
+
+                        }
                     }
                 }
             }
@@ -1330,7 +1316,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        //String file_path = "/Users/hongchuangyanfa/Desktop/";
+       // String file_path = "/Users/hongchuangyanfa/Desktop/";
         // 获取有权限的节点信息
         List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
         List<String> data = new ArrayList<>();
@@ -1361,8 +1347,14 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         //获取当前填报节点sort
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
 
-        // 合并pdf集合
-        String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = " + (ObjectUtil.isNotEmpty(wbsTreeContract) ? wbsTreeContract.getSort() : 0) + " where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
+        // 获取顺序
+        int sort =0;
+        if(ObjectUtil.isNotEmpty(wbsTreeContract)){
+            if(wbsTreeContract.getSort()!=null){
+                sort = wbsTreeContract.getSort();
+            }
+        }
+        String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = "+ sort +" where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
         jdbcTemplate.execute(sql);
     }