20210830
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class OnPostService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.SitePerson_Person> getDataLists = from x in db.SitePerson_Person
|
||||
where x.IsUsed == true
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="personName"></param>
|
||||
/// <param name="identityCard"></param>
|
||||
/// <param name="Grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string projectId, string personName, string identityCard, string rblStates, string rbInfo, string rbIDCardNo, string rbRealName,
|
||||
Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.SitePerson_Person> getDataList = getDataLists;
|
||||
if (projectId != Const._Null && !string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.ProjectId == projectId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(personName))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.PersonName.Contains(personName));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(identityCard))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.IdentityCard.Contains(identityCard));
|
||||
}
|
||||
if (rblStates == "1")
|
||||
{
|
||||
getDataList = getDataList.Where(x => !x.OutTime.HasValue);
|
||||
}
|
||||
if (rblStates == "0")
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.OutTime.HasValue);
|
||||
}
|
||||
if (rbInfo == "1")
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.HeadImage != null && x.IsCardNoOK ==true);
|
||||
}
|
||||
if (rbInfo == "0")
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.HeadImage == null || x.IsCardNoOK ==false);
|
||||
}
|
||||
if (rbInfo == "1")
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.IsCardNoOK == true);
|
||||
}
|
||||
if (rbInfo == "0")
|
||||
{
|
||||
getDataList = getDataList.Where(x =>x.IsCardNoOK == false);
|
||||
}
|
||||
if (rbRealName == "1")
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.RealNameAddTime.HasValue);
|
||||
}
|
||||
if (rbRealName == "0")
|
||||
{
|
||||
getDataList = getDataList.Where(x => !x.RealNameAddTime.HasValue);
|
||||
}
|
||||
count = getDataList.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in getDataList
|
||||
select new
|
||||
{
|
||||
x.PersonId,
|
||||
x.IdentityCard,
|
||||
x.PersonName,
|
||||
x.ProjectId,
|
||||
//db.Base_Project.First(y => x.ProjectId == y.ProjectId).ShortName,
|
||||
SexName = x.Sex == "1" ? "男" : "女",
|
||||
x.InTime,
|
||||
x.OutTime,
|
||||
x.Birthday,
|
||||
x.CountryCode,
|
||||
x.ProvinceCode,
|
||||
db.ProjectData_TeamGroup.First(z => x.TeamGroupId == z.TeamGroupId).TeamGroupName,
|
||||
db.Base_WorkPost.First(z => x.WorkPostId == z.WorkPostId).WorkPostName,
|
||||
IsPostName = x.OutTime.HasValue ? "是" : "否",
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class RealName_ProjectService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.RealName_Project> GetRealName_ProjectList()
|
||||
{
|
||||
return (from x in Funs.DB.RealName_Project orderby x.ProCode select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="proCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string GeJTproCodeByproCode(string proCode)
|
||||
{
|
||||
string code = string.Empty;
|
||||
var project = Funs.DB.RealName_Project.FirstOrDefault(e => e.ProCode == proCode);
|
||||
if (project != null)
|
||||
{
|
||||
code = project.JTproCode;
|
||||
if (string.IsNullOrEmpty(code))
|
||||
{
|
||||
code = project.ProCode;
|
||||
}
|
||||
}
|
||||
return code;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -502,7 +502,7 @@ namespace BLL
|
||||
JArray arr = JArray.Parse(obj["data"].ToString());
|
||||
foreach (var item in arr)
|
||||
{
|
||||
proCode = item["proCode"].ToString();
|
||||
string JTproCode = item["proCode"].ToString();
|
||||
string proName = item["proName"].ToString();
|
||||
string proShortName = item["proShortName"].ToString();
|
||||
if (!string.IsNullOrEmpty(proCode))
|
||||
@@ -512,6 +512,7 @@ namespace BLL
|
||||
{
|
||||
getProject.ProName = proName;
|
||||
getProject.ProShortName = proShortName;
|
||||
getProject.JTproCode = JTproCode;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
else
|
||||
@@ -520,6 +521,7 @@ namespace BLL
|
||||
{
|
||||
ID = SQLHelper.GetNewID(),
|
||||
ProCode = proCode,
|
||||
JTproCode=JTproCode,
|
||||
ProName = proName,
|
||||
ProShortName = proShortName
|
||||
};
|
||||
@@ -719,7 +721,7 @@ namespace BLL
|
||||
select new
|
||||
{
|
||||
unitId=x.UnitId,
|
||||
proCode = y.JTProjectCode,
|
||||
proCode = z.JTproCode,
|
||||
collCropCode = u.CollCropCode,
|
||||
collCropType = db.Sys_Const.First(t => t.GroupId == ConstValue.Group_ProjectUnitType && t.ConstValue == x.UnitType).Remark,
|
||||
entryTime = string.Format("{0:yyyy-MM-dd}", x.InTime),
|
||||
@@ -840,7 +842,7 @@ namespace BLL
|
||||
&& u.CollCropCode != null && u.CollCropCode != ""
|
||||
select new
|
||||
{
|
||||
proCode = y.JTProjectCode,
|
||||
proCode = z.JTproCode,
|
||||
collCropCode = u.CollCropCode,
|
||||
teamType = x.TeamTypeId,
|
||||
teamName = x.TeamGroupName,
|
||||
@@ -913,13 +915,14 @@ namespace BLL
|
||||
string contenttype = "application/json;charset=unicode";
|
||||
var getData = (from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
join z in Funs.DB.RealName_Project on y.JTProjectCode equals z.ProCode
|
||||
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId
|
||||
join v in Funs.DB.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId
|
||||
join w in Funs.DB.Base_WorkPost on x.WorkPostId equals w.WorkPostId
|
||||
where ((x.IdentityCard != null && x.IdentityCard != "" && identityCard == null) || (identityCard != null && x.IdentityCard == identityCard))
|
||||
&& y.JTProjectCode == proCode
|
||||
&& y.JTProjectCode == proCode && z.JTproCode != null
|
||||
&& v.TeamId.HasValue && x.HeadImage != null && x.HeadImage.Length > 0
|
||||
&& ((type == Const.BtnModify && !x.RealNameUpdateTime.HasValue) || (type != Const.BtnModify && !x.RealNameAddTime.HasValue && x.IsUsed && !x.OutTime.HasValue))
|
||||
&& ((type == Const.BtnModify && !x.RealNameUpdateTime.HasValue && x.RealNameAddTime.HasValue) || (type != Const.BtnModify && !x.RealNameAddTime.HasValue && x.IsUsed && !x.OutTime.HasValue))
|
||||
&& (x.IdentityCard.Length == 15 || x.IdentityCard.Length == 18)
|
||||
select new
|
||||
{
|
||||
@@ -942,7 +945,7 @@ namespace BLL
|
||||
//positiveIdcardImage = db.AttachFile.First(t => (x.PersonId + "#1") == t.ToKeyId).ImageByte,
|
||||
//negativeIdcardImage = db.AttachFile.First(t => (x.PersonId + "#5") == t.ToKeyId).ImageByte,
|
||||
headImage = x.HeadImage,
|
||||
proCode = y.JTProjectCode,
|
||||
proCode = z.JTproCode,
|
||||
teamId = v.TeamId,
|
||||
mobile = x.Telephone,
|
||||
teamLeaderFlag = (v.GroupLeaderId == x.PersonId ? "Y" : "N"),
|
||||
@@ -1036,12 +1039,14 @@ namespace BLL
|
||||
string contenttype = "application/json;charset=unicode";
|
||||
var getData = (from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
join z in Funs.DB.RealName_Project on y.JTProjectCode equals z.ProCode
|
||||
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId
|
||||
join v in Funs.DB.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId
|
||||
join w in Funs.DB.Base_WorkPost on x.WorkPostId equals w.WorkPostId
|
||||
where x.IdentityCard == identityCard && y.JTProjectCode == proCode
|
||||
&& v.TeamId.HasValue && x.HeadImage != null && x.HeadImage.Length > 0
|
||||
&& (x.IdentityCard.Length == 15 || x.IdentityCard.Length == 18)
|
||||
&& (x.IdentityCard.Length == 15 || x.IdentityCard.Length == 18)
|
||||
&& z.JTproCode != null
|
||||
select new
|
||||
{
|
||||
name = x.PersonName,
|
||||
@@ -1061,7 +1066,7 @@ namespace BLL
|
||||
countryCode = x.CountryCode,
|
||||
provinceCode = x.ProvinceCode,
|
||||
headImage = x.HeadImage,
|
||||
proCode = y.JTProjectCode,
|
||||
proCode = z.JTproCode,
|
||||
teamId = v.TeamId,
|
||||
mobile = x.Telephone,
|
||||
teamLeaderFlag = (v.GroupLeaderId == x.PersonId ? "Y" : "N"),
|
||||
@@ -1160,15 +1165,17 @@ namespace BLL
|
||||
join p in Funs.DB.SitePerson_Person on x.PersonId equals p.PersonId
|
||||
join v in Funs.DB.ProjectData_TeamGroup on p.TeamGroupId equals v.TeamGroupId
|
||||
join r in Funs.DB.RealName_CollTeam on v.TeamId equals r.TeamId
|
||||
join z in Funs.DB.RealName_Project on x.ProCode equals z.ProCode
|
||||
where x.IdcardNumber != null && x.IdcardType != null && x.ChangeTime.HasValue
|
||||
&& (proCode == null || x.ProCode == proCode) && p.HeadImage != null && p.HeadImage.Length > 0
|
||||
&& v.TeamId.HasValue && p.HeadImage != null && r.TeamId.HasValue
|
||||
&& (p.IdentityCard.Length == 15 || p.IdentityCard.Length == 18)
|
||||
&& (p.IdentityCard.Length == 15 || p.IdentityCard.Length == 18) && p.RealNameAddTime.HasValue
|
||||
&& z.JTproCode != null
|
||||
orderby x.ChangeTime descending
|
||||
select new
|
||||
{
|
||||
p.PersonId,
|
||||
proCode = x.ProCode,
|
||||
proCode = z.JTproCode,
|
||||
name = x.Name,
|
||||
idcardType = x.IdcardType,
|
||||
idcardNumber = x.IdcardNumber,
|
||||
@@ -1247,7 +1254,7 @@ namespace BLL
|
||||
{
|
||||
var getProject = new
|
||||
{
|
||||
proCode
|
||||
proCode = RealName_ProjectService.GeJTproCodeByproCode(proCode),
|
||||
};
|
||||
var returndata = BLL.APIGetHttpService.OutsideHttp(Funs.RealNameApiUrl + "/foreignApi/baseData/getCollTeam", "POST", null, newToken, JsonConvert.SerializeObject(getProject));
|
||||
if (!string.IsNullOrEmpty(returndata))
|
||||
@@ -1304,13 +1311,14 @@ namespace BLL
|
||||
{
|
||||
var getCollTeam = (from x in Funs.DB.ProjectData_TeamGroup
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
join z in Funs.DB.RealName_Project on y.JTProjectCode equals z.ProCode
|
||||
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId
|
||||
join s in Funs.DB.SitePerson_Person on x.GroupLeaderId equals s.PersonId into jonPerson
|
||||
from s in jonPerson.DefaultIfEmpty()
|
||||
where teamGroupIds.Contains(x.TeamGroupId)
|
||||
where teamGroupIds.Contains(x.TeamGroupId) && z.JTproCode != null
|
||||
select new
|
||||
{
|
||||
proCode = y.JTProjectCode,
|
||||
proCode = z.JTproCode,
|
||||
collCropCode = u.CollCropCode,
|
||||
teamType = x.TeamTypeId,
|
||||
teamName = x.TeamGroupName,
|
||||
@@ -1344,9 +1352,10 @@ namespace BLL
|
||||
{
|
||||
var getData = (from x in db.SitePerson_Person
|
||||
join y in db.Base_Project on x.ProjectId equals y.ProjectId
|
||||
join z in Funs.DB.RealName_Project on y.JTProjectCode equals z.ProCode
|
||||
join v in db.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId
|
||||
join w in db.Base_WorkPost on x.WorkPostId equals w.WorkPostId
|
||||
where personList.Contains(x.PersonId)
|
||||
where personList.Contains(x.PersonId) && z.JTproCode != null
|
||||
select new
|
||||
{
|
||||
name = x.PersonName,
|
||||
@@ -1368,7 +1377,7 @@ namespace BLL
|
||||
//positiveIdcardImage = db.AttachFile.First(t => (x.PersonId + "#1") == t.ToKeyId).ImageByte,
|
||||
//negativeIdcardImage = db.AttachFile.First(t => (x.PersonId + "#5") == t.ToKeyId).ImageByte,
|
||||
headImage = x.HeadImage,
|
||||
proCode = y.JTProjectCode,
|
||||
proCode = z.JTproCode,
|
||||
teamId = v.TeamId,
|
||||
mobile = x.Telephone,
|
||||
teamLeaderFlag = (v.GroupLeaderId == x.PersonId ? "Y" : "N"),
|
||||
|
||||
Reference in New Issue
Block a user