Browse Source

Merge remote-tracking branch 'origin/dev' into dev

LHB 2 tháng trước cách đây
mục cha
commit
a1bc4d2271

+ 1 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialNumberRuleServiceImpl.java

@@ -145,6 +145,7 @@ public class TrialNumberRuleServiceImpl extends BaseServiceImpl<TrialNumberRuleM
                     if(!isSaveRedis){
                         trialNumber.append(rule.getData());
                         map.put("autoIncrementNumber",rule.getData());
+                        continue;
                     }
                     if(rule.getIsAutoIncrement()!=null&&rule.getIsAutoIncrement()==1){
                         String autoIncrementNumber="";

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

@@ -3765,7 +3765,7 @@ public class ExcelTabController extends BladeController {
     @ApiImplicitParam(name = "fileId", value = "fileId")
     public void downGongChengExcelFile(HttpServletResponse response) throws Exception {
         String fileName = URLEncoder.encode("工程划分导入模版", Charsets.UTF_8.name());
-        String filePath="https://xinan1.zos.ctyun.cn/blade-oss-chongqing/upload/20250508/bf69e3bd5a3fd3a216099238591948d9.xlsx";
+        String filePath="https://xinan1.zos.ctyun.cn/blade-oss-chongqing/upload/20250717/780f2392e0c15810de10cde98217ad36.xlsx";
         InputStream redio = CommonUtil.getOSSInputStream(filePath);
         byte[] buffer = IoUtil.readToByteArray(redio);
         OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
@@ -4813,34 +4813,55 @@ public class ExcelTabController extends BladeController {
         List<WbsTreeContract>list= wbsTreeContractMapper.selectListForcheckAllNodeDate(projectId,contractId);
         //将表单通过pid分组
         Map<Long, List<WbsTreeContract>> map = list.stream().collect(Collectors.groupingBy(WbsTreeContract::getPId));
+        int i=map.size();
+        System.out.println("当前项目合同段有:"+i+"个节点");
         for (Map.Entry<Long, List<WbsTreeContract>> entry : map.entrySet()) {
             Long pId = entry.getKey();
             WbsTreeContract parent = wbsTreeContractMapper.selectOne(new LambdaQueryWrapper<>(WbsTreeContract.class).eq(WbsTreeContract::getPKeyId, pId));
+            if(parent==null){
+                i--;
+                System.out.println("剩余:"+i+"个节点未检查");
+                continue;
+            }
+            String informationSql="select * from u_information_query where wbs_id="+parent.getPKeyId()+" and contract_id="+contractId+" and is_deleted=0";
+            List<InformationQuery> query = jdbcTemplate.query(informationSql, new BeanPropertyRowMapper<>(InformationQuery.class));
+            if(query.isEmpty()||query.get(0).getStatus()!=0){
+                i--;
+                System.out.println("剩余:"+i+"个节点未检查");
+                continue;
+            }
             List<WbsTreeContract> wbsTreeContractList = entry.getValue();
             for (WbsTreeContract contract : wbsTreeContractList) {
                 Map<String, Object> dataInfo = excelTabService.getBussDataInfo(contract.getPKeyId(), 0, true);
                 if(dataInfo!=null){
-                    InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(contract.getHtmlUrl());
-                    String htmlString = IoUtil.readToString(inputStreamByUrl);
-                    Document doc = Jsoup.parse(htmlString);
-                    Elements dateElements = doc.select("el-date-picker");
-                    if(!dateElements.isEmpty()){
-                        Boolean dateFlag=true;
-                        for (Element element : dateElements) {
-                            String keyname = element.attr("keyname");
-                            if(!dataInfo.containsKey(keyname)||(StringUtils.isEmpty(dataInfo.get(keyname).toString()))){
-                                dateFlag=false;
-                                break;
+                    try {
+                        InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(contract.getHtmlUrl());
+                        String htmlString = IoUtil.readToString(inputStreamByUrl);
+                        Document doc = Jsoup.parse(htmlString);
+                        Elements dateElements = doc.select("el-date-picker");
+                        if(!dateElements.isEmpty()){
+                            Boolean dateFlag=true;
+                            for (Element element : dateElements) {
+                                String keyname = element.attr("keyname");
+                                if(!dataInfo.containsKey(keyname)||(StringUtils.isEmpty(dataInfo.get(keyname).toString()))){
+                                    dateFlag=false;
+                                    break;
+                                }
+                            }
+                            if(!dateFlag){
+                                wbsTreeContractMapper.update(null,new LambdaUpdateWrapper<WbsTreeContract>().eq(WbsTreeContract::getPKeyId,contract.getPKeyId()).set(WbsTreeContract::getDateIsComplete,2));
                             }
                         }
-                        if(!dateFlag){
-                            wbsTreeContractMapper.update(contract,new LambdaUpdateWrapper<WbsTreeContract>().eq(WbsTreeContract::getPKeyId,contract.getPKeyId()).set(WbsTreeContract::getDateIsComplete,2));
-                        }
+                    }catch (Exception e){
+
                     }
                 }
             }
             wbsTreeContractService.checkNodeAllDate(parent);
+            i--;
+            System.out.println("剩余:"+i+"个节点未检查");
         }
+        System.out.println("检查完毕");
         return R.status(true);
     }
 }

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

@@ -982,7 +982,7 @@
           and  contract_id=#{contractId}
         </if>
         and is_deleted=0 and is_buss_show !=2 and init_table_name is not null and html_url is not null and LENGTH(init_table_name) > 10 and LENGTH(html_url) > 10
-        and p_id is not null
+        and p_id is not null and type=2
     </select>
 
 </mapper>

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

@@ -2346,18 +2346,18 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
             Row row = sheet.getRow(i);
             if (row == null) continue;
             // 获取每一列的值
-            String unitName = getCellValue(row.getCell(0)); // A列:单位工程名称
-            String unitCode = getCellValue(row.getCell(1)); // B列:单位工程编号
-            String subUnitName = getCellValue(row.getCell(2)); // C列:子单位工程名称
-            String subUnitCode = getCellValue(row.getCell(3)); // D列:子单位工程编号
-            String divisionName = getCellValue(row.getCell(4)); // E列:分部工程名称
-            String divisionCode = getCellValue(row.getCell(5)); // F列:分部工程编号
-            String subDivisionName = getCellValue(row.getCell(6)); // G列:子分部工程名称
-            String subDivisionCode = getCellValue(row.getCell(7)); // H列:子分部工程编号
-            String itemName = getCellValue(row.getCell(8)); // I列:分项工程名称
-            String itemCode = getCellValue(row.getCell(9)); // J列:分项工程编号
-            String subItemName = getCellValue(row.getCell(10)); // K列:子分项工程名称
-            String subItemCode = getCellValue(row.getCell(11));// L列:子分项工程编号
+            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);
         }