This commit is contained in:
2026-03-24 17:43:52 +08:00
parent d36cec32ea
commit 2b9435744a
8 changed files with 126 additions and 21 deletions
+26 -1
View File
@@ -120,7 +120,32 @@ namespace BLL
db.SubmitChanges();
}
}
/// <summary>
/// 获取最大编号
/// </summary>
/// <param name="SysTemType"></param>
/// <param name="type"></param>
/// <returns></returns>
public static string getCode(string SysTemType, string type)
{
var maxCode = Funs.DB.Check_RewardAndPunish
.Where(x => x.SysTemType == SysTemType && x.RewardAndPunishCode.Contains(type))
.Max(x => x.RewardAndPunishCode);
if (maxCode != null)
{
//取最后5 位
var code = maxCode.Substring(maxCode.Length - 5);
var codeNum = int.Parse(code);
codeNum++;
return $"{type}{codeNum:D5}";
}
else
{
return $"{type}00001";
}
}
}
}