Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/test-merge' into test-merge

LHB 4 dienas atpakaļ
vecāks
revīzija
c41ce3a768

+ 3 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java

@@ -90,6 +90,9 @@ public interface InformationQueryClient {
     @PostMapping(API_PREFIX + "/getInformationByContractId")
     List<InformationQuery> getInformationByContractId(@RequestParam Long contractId,@RequestParam Integer classify);
 
+    @PostMapping(API_PREFIX + "/getInformationByContractIdAndApprovedStatus")
+    List<InformationQuery> getInformationByContractIdAndApprovedStatus(@RequestParam Long contractId,@RequestParam Integer classify);
+
     @PostMapping(API_PREFIX + "/getInformationByContractId1")
     void getInformationByContractId1(Long contractId);
 

+ 10 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveFileController.java

@@ -508,4 +508,14 @@ public class ArchiveFileController extends BladeController {
         FindAndReplaceDto1 dto1 = new FindAndReplaceDto1(dto, archiveFiles);
         return R.status(archiveFileClient.findAndReplace(dto1));
     }
+    @PostMapping("/sumPageTotal")
+    @ApiOperationSupport(order = 19)
+    @ApiOperation(value = "统计页数")
+    public R sumPageTotal(@RequestBody List<Integer>list){
+        if(!list.isEmpty()){
+            return R.data(list.stream().mapToInt(Integer::intValue).sum());
+        }else {
+            return R.data(0);
+        }
+    }
 }

+ 4 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java

@@ -116,6 +116,10 @@ public class InformationQueryClientImpl implements InformationQueryClient {
     public List<InformationQuery> getInformationByContractId(Long contractId, Integer classify) {
         return informationQueryMapper.getInformationByContractId(contractId,classify);
     }
+    @Override
+    public List<InformationQuery> getInformationByContractIdAndApprovedStatus(Long contractId, Integer classify) {
+        return informationQueryMapper.getInformationByContractIdAndApprovedStatus(contractId,classify);
+    }
 
     @Override
     public void getInformationByContractId1(Long contractId) {

+ 1 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.java

@@ -142,6 +142,7 @@ public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
     List<InformationQuery> selectChildrenNodeInfo(@Param("ids") List<Long> removeList);
 
     List<InformationQuery> getInformationByContractId(@Param("contractId") Long contractId, @Param("classify")Integer classify);
+    List<InformationQuery> getInformationByContractIdAndApprovedStatus(@Param("contractId") Long contractId, @Param("classify")Integer classify);
 
     List<TabBusstimeInfo> getTabussTimeInfo(@Param("tables") List<String> tables);
 

+ 12 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -990,6 +990,18 @@
         where is_deleted = 0
           and contract_id = #{contractId} and classify = #{classify} and status in(0,1,2) and is_deleted = 0;
     </select>
+    <select id="getInformationByContractIdAndApprovedStatus" resultMap="informationQueryResultMap">
+        select id,
+               wbs_id,
+               name,
+               e_visa_pdf_url,
+               business_time,
+               classify,
+               e_visa_pdf_page,
+               e_visa_pdf_size,
+               node_pdf_url
+        from u_information_query where is_deleted = 0 and contract_id = #{contractId} and classify = #{classify} and status = 2 and is_deleted = 0;
+    </select>
 
     <select id="getTabussTimeInfo" resultMap="tabBusstimeInfoResultMap">
         select * from m_tab_busstime_info where is_deleted = 0

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/LinkdataInfoController.java

@@ -320,6 +320,10 @@ public class LinkdataInfoController extends BladeController {
                     element1.attr("placeholder", enName).attr("keyName", dataInfo2).attr("id", dataInfo2);
                     element1.attr("weighing", "100");
                     element1.attr("v-model", "formData." + dataInfo2);
+                    // 修正鼠标左键点击事件
+                    if ("el-input".equals(element1.tagName())) {
+                        element1.removeAttr("@mouseup.left").attr("@mouseup.left", "inputLeftClick($event,'" + dataInfo2 + "')");
+                    }
                     element.attr("@click", "getInformation('" + enName + "'," + linkdataInfo.getTrIndex() + "," + linkdataInfo.getTdIndex() + ")");
                 }
 

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractSyncImpl.java

@@ -740,7 +740,7 @@ public class ArchiveTreeContractSyncImpl {
         //获取某个合同段所有的电签完成的文件题名,取 id wbsid name,eVisaPdfUrl
 //        List<InformationQuery> informationQueryList = new ArrayList<>();
       //  informationQueryClient.getInformationByContractId1(contractId);
-        List<InformationQuery> informationQueryList = informationQueryClient.getInformationByContractId(contractId,classify);
+        List<InformationQuery> informationQueryList = informationQueryClient.getInformationByContractIdAndApprovedStatus(contractId,classify);
         return informationQueryList;
 
         //互殴去
@@ -860,7 +860,7 @@ public class ArchiveTreeContractSyncImpl {
                 pdfSize = CommonUtil.getResourceLength(archiveFile.getPdfFileUrl());
                 archiveFile.setFileSize(pdfSize);
                 archiveFile.setFilePage(Integer.valueOf(pdfPage));
-            } catch (IOException e) {
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }

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

@@ -1200,7 +1200,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             map.put(pKeyId, nodeName);
             RandomNumberHolder.setRandomNumber(map);
         } catch (NumberFormatException e) {
-            throw new RuntimeException(e);
+            e.printStackTrace();
         }
 
         List<NodeTable> tableAll = createNodeTables(wbsTreeTable.getPId(), tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId(), ExecuteType.INSPECTION, tableInfoList.get(0).getClassify(), null);
@@ -1306,7 +1306,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     tableGroup.forEach((tableName, contracts) -> {
                         WbsTreeContract temp = null;
                         for (WbsTreeContract contract : contracts) {
-                            if (Objects.equals(contract.getPKeyId(), wbsTreeTable.getPId())) {
+                            if (Objects.equals(contract.getPKeyId(), wbsTreeTable.getPKeyId())) {
                                 temp = contract;
                                 break;
                             }
@@ -1378,7 +1378,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 if (dataMap != null && keys != null) {
                     for (String key : keys) {
                         String value = dataMap.get(key);
-                        if (value != null) {
+                        if (StringUtil.hasText(value)) {
                             data.append(value).append(",");
                         }
                     }
@@ -1430,6 +1430,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             if (split1.length > 1) {
                 String index = split1[1];
                 String[] split = resultData.split("☆");
+                if (split.length > 1) {
+                    resultData = "";
+                }
                 for (int i = 0; i < split.length; i++) {
                     String string = split[i];
                     if (string.contains(index)) {

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

@@ -6651,7 +6651,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             }
 
         }
-        return null;
+        return new HashMap<>();
     }
 
     @Override

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

@@ -2987,37 +2987,39 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
         try (InputStream inputStream = file.getInputStream()) {
             // 立即处理文件流
             Workbook workbook = new XSSFWorkbook(inputStream);
-            Sheet sheet = workbook.getSheetAt(0);
-            // 处理Excel数据...
-            unmergeCells(sheet);
             List<ImportTreeDto> list = new ArrayList<>();
-            for (int i = 2; i <= sheet.getLastRowNum(); i++) {
-                Row row = sheet.getRow(i);
-                if (row == null) continue;
-//                if(StringUtils.isEmpty(getCellValue(row.getCell(1)))){
-//                    throw new ServerException("单位工程类型名称不能为空");
-//                }
-//                if(StringUtils.isEmpty(getCellValue(row.getCell(3)))){
-//                    throw new ServerException("单位工程名称不能为空");
-//                }
-//                if(StringUtils.isEmpty(getCellValue(row.getCell(5)))){
-//                    throw new ServerException("分部工程名称不能为空");
-//                }
-                // 获取每一列的值
-                String unitCode = getCellValue(row.getCell(0)); // A列:单位工程编号
-                String unitName = getCellValue(row.getCell(1)); // B列:单位工程名称
-                String subUnitCode = getCellValue(row.getCell(2)); // C列:子单位工程编号
-                String subUnitName = getCellValue(row.getCell(3)); // D列:子单位工程名称
-                String divisionCode = getCellValue(row.getCell(4)); // E列:分部工程编号
-                String divisionName = getCellValue(row.getCell(5)); // F列:分部工程名称
-                String subDivisionCode = getCellValue(row.getCell(6)); // G列:子分部工程编号
-                String subDivisionName = getCellValue(row.getCell(7)); // H列:子分部工程名称
-                String itemCode = getCellValue(row.getCell(8)); // I列:分项工程编号
-                String itemName = getCellValue(row.getCell(9)); // J列:分项工程名称
-                String subItemCode = getCellValue(row.getCell(10));// K列:子分项工程编号
-                String subItemName = getCellValue(row.getCell(11)); // L列:子分项工程名称
-                ImportTreeDto dto = new ImportTreeDto(unitName, unitCode, 1, StringUtils.isEmpty(unitName), subUnitName, subUnitCode, 18, StringUtils.isEmpty(subUnitName), divisionName, divisionCode, 2, StringUtils.isEmpty(divisionName), subDivisionName, subDivisionCode, 3, StringUtils.isEmpty(subDivisionName), itemName, itemCode, 4, StringUtils.isEmpty(itemName), subItemName, subItemCode, 5, StringUtils.isEmpty(subItemName));
-                list.add(dto);
+            // 遍历所有工作表
+            for (int sheetIndex = 0; sheetIndex < workbook.getNumberOfSheets(); sheetIndex++) {
+                Sheet sheet = workbook.getSheetAt(sheetIndex);
+                // 处理Excel数据...
+                unmergeCells(sheet);
+                for (int i = 2; i <= sheet.getLastRowNum(); i++) {
+                    Row row = sheet.getRow(i);
+                    if (row == null) continue;
+                    // 获取每一列的值
+                    String unitCode = getCellValue(row.getCell(0)); // A列:单位工程编号
+                    String unitName = getCellValue(row.getCell(1)); // B列:单位工程名称
+                    String subUnitCode = getCellValue(row.getCell(2)); // C列:子单位工程编号
+                    String subUnitName = getCellValue(row.getCell(3)); // D列:子单位工程名称
+                    String divisionCode = getCellValue(row.getCell(4)); // E列:分部工程编号
+                    String divisionName = getCellValue(row.getCell(5)); // F列:分部工程名称
+                    String subDivisionCode = getCellValue(row.getCell(6)); // G列:子分部工程编号
+                    String subDivisionName = getCellValue(row.getCell(7)); // H列:子分部工程名称
+                    String itemCode = getCellValue(row.getCell(8)); // I列:分项工程编号
+                    String itemName = getCellValue(row.getCell(9)); // J列:分项工程名称
+                    String subItemCode = getCellValue(row.getCell(10));// K列:子分项工程编号
+                    String subItemName = getCellValue(row.getCell(11)); // L列:子分项工程名称
+
+                    ImportTreeDto dto = new ImportTreeDto(
+                            unitName, unitCode, 1, StringUtils.isEmpty(unitName),
+                            subUnitName, subUnitCode, 18, StringUtils.isEmpty(subUnitName),
+                            divisionName, divisionCode, 2, StringUtils.isEmpty(divisionName),
+                            subDivisionName, subDivisionCode, 3, StringUtils.isEmpty(subDivisionName),
+                            itemName, itemCode, 4, StringUtils.isEmpty(itemName),
+                            subItemName, subItemCode, 5, StringUtils.isEmpty(subItemName)
+                    );
+                    list.add(dto);
+                }
             }
             if (list.isEmpty()) {
                 throw new ServiceException("导入模版为空,请先填写数据");