提交当前本机整理版本

This commit is contained in:
cyf
2026-07-02 10:11:39 +00:00
parent c10a5d64c7
commit aacefa24f8
822 changed files with 196665 additions and 14263 deletions
+28 -1
View File
@@ -87,4 +87,31 @@ namespace Lskj.Business.Impl
return maxNum;
// 取未使用的编号
sqlValue = string.Format("select cast({1} as bigint) as SpeciesNo from {0} where {1} like '{2}{
sqlValue = string.Format("select cast({1} as bigint) as SpeciesNo from {0} where {1} like '{2}{3}' order by {1}", tableName, parentKey, parentValue,maxdivision);
DataTable table = GetDataTableResult(sqlValue);
Int64 speciesNo = table.Rows.Count > 0 ? Convert.ToInt64(table.Rows[0]["SpeciesNo"] + "") : 0;
if (speciesNo != Int64.Parse(parentValue + PrefixNum+"1"))
return parentValue +PrefixNum+"1";;
foreach (DataRow item in table.Rows)
{
Int64 rowSpeciesNo = Convert.ToInt64(item["SpeciesNo"] + "");
if (speciesNo == rowSpeciesNo) continue;
if (rowSpeciesNo != speciesNo + 1)
{
maxNo = (speciesNo + 1).ToString();
maxNo = maxNo.PadLeft(parentValue.Length + firstNode.Length, '0');
break;
}
speciesNo = rowSpeciesNo;
}
}
return maxNo;
}
}
}