小程序接口、培训计划界面调优
This commit is contained in:
@@ -71,7 +71,7 @@ namespace BLL
|
||||
{
|
||||
var getPerson = from x in db.View_SitePerson_Person
|
||||
where x.PersonId == personId || x.IdentityCard == personId
|
||||
where x.BlackList==null || x.BlackList==false
|
||||
where x.BlackList == null || x.BlackList == false
|
||||
select new Model.PersonItem
|
||||
{
|
||||
PersonId = x.PersonId,
|
||||
@@ -474,6 +474,7 @@ namespace BLL
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="unitIds">培训单位ID</param>
|
||||
/// <param name="workPostIds">培训岗位ID</param>
|
||||
/// <param name="departIds">培训岗位ID</param>
|
||||
/// <param name="trainTypeId">培训类型ID</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId, string InTime, string strParam)
|
||||
@@ -754,7 +755,7 @@ namespace BLL
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(person.TeamGroupName))
|
||||
{
|
||||
var group = db.ProjectData_TeamGroup.FirstOrDefault(x =>x.ProjectId == person.ProjectId && x.TeamGroupName == person.TeamGroupName);
|
||||
var group = db.ProjectData_TeamGroup.FirstOrDefault(x => x.ProjectId == person.ProjectId && x.TeamGroupName == person.TeamGroupName);
|
||||
if (group != null)
|
||||
{
|
||||
newPerson.TeamGroupId = group.TeamGroupId;
|
||||
@@ -781,7 +782,7 @@ namespace BLL
|
||||
var post = db.Base_WorkPost.FirstOrDefault(x => x.WorkPostName == person.WorkPostName);
|
||||
if (post != null)
|
||||
{
|
||||
newPerson.WorkPostId = post.WorkPostId;
|
||||
newPerson.WorkPostId = post.WorkPostId;
|
||||
}
|
||||
}
|
||||
//if (!string.IsNullOrEmpty(person.IdcardType))
|
||||
@@ -828,7 +829,7 @@ namespace BLL
|
||||
{
|
||||
newPerson.IsUsed = false;
|
||||
}
|
||||
newPerson.Password = UserService.getInitialPassword(newPerson.UnitId, newPerson.IdentityCard);
|
||||
newPerson.Password = UserService.getInitialPassword(newPerson.UnitId, newPerson.IdentityCard);
|
||||
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
|
||||
if (!string.IsNullOrEmpty(rootUrl) && !string.IsNullOrEmpty(person.PhotoUrl))
|
||||
{
|
||||
@@ -1277,11 +1278,11 @@ namespace BLL
|
||||
#endregion
|
||||
|
||||
#region 获取项目当日在场人员数据
|
||||
public static IEnumerable getPersonPresenceData(string projectId,DateTime dateTime)
|
||||
public static IEnumerable getPersonPresenceData(string projectId, DateTime dateTime)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string url= ConfigurationManager.AppSettings["CEMS_IMG_URL"];
|
||||
string url = ConfigurationManager.AppSettings["CEMS_IMG_URL"];
|
||||
|
||||
|
||||
DateTime start = Convert.ToDateTime(dateTime.Date.ToString("D").ToString());
|
||||
@@ -1290,33 +1291,33 @@ namespace BLL
|
||||
&& x.ChangeTime >= start && x.ChangeTime <= end); //获取当前全部数据
|
||||
|
||||
getDataList = from x in getDataList
|
||||
group x by x.PersonId into g
|
||||
select g.OrderByDescending(t => t.ChangeTime).FirstOrDefault(); //获取每个人最后一条数据
|
||||
group x by x.PersonId into g
|
||||
select g.OrderByDescending(t => t.ChangeTime).FirstOrDefault(); //获取每个人最后一条数据
|
||||
|
||||
getDataList = getDataList.Where(x => x.IsIn == true); //取类型是进门的数据来获取当前在场人员
|
||||
var data = getDataList.ToList();
|
||||
var attachfile = db.AttachFile.Where(x => data.Select(y => y.PersonId+"#4").Distinct().ToList().Contains(x.ToKeyId)).ToList();
|
||||
var attachfile = db.AttachFile.Where(x => data.Select(y => y.PersonId + "#4").Distinct().ToList().Contains(x.ToKeyId)).ToList();
|
||||
var result = (from x in data
|
||||
join y in attachfile on (x.PersonId+"#4") equals y.ToKeyId into temp
|
||||
from y in temp.DefaultIfEmpty()
|
||||
select new
|
||||
{
|
||||
x.PostType,
|
||||
x.PersonId,
|
||||
x.IsIn,
|
||||
IsInName = (x.IsIn == true ? "进门" : "出门"),
|
||||
x.ChangeTime,
|
||||
x.UnitName,
|
||||
x.WorkPostName,
|
||||
x.WorkAreaName,
|
||||
x.PersonName,
|
||||
x.IdentityCard,
|
||||
x.InOutWay,
|
||||
x.Address,
|
||||
x.Remark,
|
||||
AttachUrl = (y != null) ? y.AttachUrl.Split(',').Select(item => url + item).ToArray() : null
|
||||
}).ToList();
|
||||
return result;
|
||||
join y in attachfile on (x.PersonId + "#4") equals y.ToKeyId into temp
|
||||
from y in temp.DefaultIfEmpty()
|
||||
select new
|
||||
{
|
||||
x.PostType,
|
||||
x.PersonId,
|
||||
x.IsIn,
|
||||
IsInName = (x.IsIn == true ? "进门" : "出门"),
|
||||
x.ChangeTime,
|
||||
x.UnitName,
|
||||
x.WorkPostName,
|
||||
x.WorkAreaName,
|
||||
x.PersonName,
|
||||
x.IdentityCard,
|
||||
x.InOutWay,
|
||||
x.Address,
|
||||
x.Remark,
|
||||
AttachUrl = (y != null) ? y.AttachUrl.Split(',').Select(item => url + item).ToArray() : null
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -1726,7 +1727,7 @@ namespace BLL
|
||||
if (isOK)
|
||||
{
|
||||
var faceResult = FaceClass.add(person.PersonId, person.IdentityCard, System.Configuration.ConfigurationManager.AppSettings["CEMS_IMG_URL"].ToString() + person.PhotoUrl, AccessToken.getAccessToken());
|
||||
var face = JsonConvert.DeserializeObject<dynamic>(faceResult);
|
||||
var face = JsonConvert.DeserializeObject<dynamic>(faceResult);
|
||||
// JsonConvert.DeserializeObject<dynamic>(myPunishItem);
|
||||
if (face.error_code == 0 || face.error_code == 223105)
|
||||
{
|
||||
@@ -1739,8 +1740,8 @@ namespace BLL
|
||||
else
|
||||
{
|
||||
message = "注册人脸库失败" + face.error_code + face.error_msg;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1762,8 +1763,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 人员出入场
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>w
|
||||
/// <param name="idCard"></param>
|
||||
/// <param name="getPerson"></param>
|
||||
/// <param name="isIn"></param>
|
||||
/// <param name="changeTime"></param>
|
||||
public static void getPersonInOut(Model.SitePerson_Person getPerson, int isIn, DateTime changeTime)
|
||||
|
||||
Reference in New Issue
Block a user