cr 2 giorni fa
parent
commit
2e2464556f

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

@@ -3212,8 +3212,10 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                 String sqlList1 = "Select parent_id,node_name,p_id from m_wbs_tree_contract where contract_id=" + wbsTreeContractRoot.getContractId() + " and wbs_id=" + wbsTreeContractRoot.getWbsId() + " and is_deleted=0";
                 List<WbsTreeContract> WbsTreeContractList = jdbcTemplate.query(sqlList1, new BeanPropertyRowMapper<>(WbsTreeContract.class));
                 for (ImportTreeDto dto : list) {
-                    String progressStr = String.format("%.2f", ((double) i/ size)*100);
-                    bladeRedis.set("import:projectId:"+wbsTreeContractRoot.getProjectId()+"contractId:"+wbsTreeContractRoot.getContractId(), progressStr);
+                    if(size-i>=1){
+                        String progressStr = String.format("%.2f", ((double) i/ size)*100);
+                        bladeRedis.set("import:projectId:"+wbsTreeContractRoot.getProjectId()+"contractId:"+wbsTreeContractRoot.getContractId(), progressStr);
+                    }
                     i++;
                     //单位工程:如果没有被处理过,说明需要新增
                     if (!dto.getIsUnit()) {
@@ -3537,9 +3539,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
 //        catch (InterruptedException e) {
 //            throw new RuntimeException(e);
 //        }
-        finally {
-            bladeRedis.del("import:projectId:"+wbsTreeContractRoot.getProjectId()+"contractId:"+wbsTreeContractRoot.getContractId());
-        }
     }
 
     @Override