20210520
This commit is contained in:
@@ -19,32 +19,44 @@ namespace WebAPI.Controllers
|
||||
/// 获取部门、人员、出入记录最大ID
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="queryValue">查询条件</param>
|
||||
/// <returns></returns>
|
||||
public string getMaxID(string projectId)
|
||||
public string getMaxID(string projectId, string queryValue = null)
|
||||
{
|
||||
int DepartmentID = 0, ID=0;
|
||||
long EmployID = 0, ValidEventID=0;
|
||||
var getD = Funs.DB.T_d_department.Where(x=> x.ProjectId == projectId).Select(x => x.DepartmentID);
|
||||
if (getD.Count()>0)
|
||||
int DepartmentID = 0, ID = 0;
|
||||
long EmployID = 0, ValidEventID = 0;
|
||||
var getD = Funs.DB.T_d_department.Where(x => x.ProjectId == projectId).Select(x => x.DepartmentID);
|
||||
if (getD.Count() > 0)
|
||||
{
|
||||
DepartmentID = getD.Max();
|
||||
}
|
||||
var getE= Funs.DB.T_d_employinfo.Where(x => x.ProjectId == projectId).Select(x => x.EmployID);
|
||||
var getE = Funs.DB.T_d_employinfo.Where(x => x.ProjectId == projectId).Select(x => x.EmployID);
|
||||
if (getE.Count() > 0)
|
||||
{
|
||||
EmployID = getE.Max();
|
||||
}
|
||||
var getI = Funs.DB.T_d_facerecord.Where(x => x.ProjectId == projectId).Select(x => x.ID);
|
||||
if (getI.Count() > 0)
|
||||
if (!string.IsNullOrEmpty(queryValue))
|
||||
{
|
||||
ID = getI.Max();
|
||||
var getI = Funs.DB.T_d_facerecord.Where(x => x.ProjectId == projectId && x.RoleID == queryValue).Select(x => x.ID);
|
||||
if (getI.Count() > 0)
|
||||
{
|
||||
ID = getI.Max();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var getI = Funs.DB.T_d_facerecord.Where(x => x.ProjectId == projectId).Select(x => x.ID);
|
||||
if (getI.Count() > 0)
|
||||
{
|
||||
ID = getI.Max();
|
||||
}
|
||||
}
|
||||
var getV = Funs.DB.T_d_validcardevent.Where(x => x.ProjectId == projectId).Select(x => x.ValidEventID);
|
||||
if (getV.Count() > 0)
|
||||
{
|
||||
ValidEventID = getV.Max();
|
||||
}
|
||||
return ("$" + DepartmentID.ToString()+"$"+ EmployID.ToString()+"$"+ID.ToString() + "$" + ValidEventID.ToString() + "$");
|
||||
return ("$" + DepartmentID.ToString() + "$" + EmployID.ToString() + "$" + ID.ToString() + "$" + ValidEventID.ToString() + "$");
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user