This commit is contained in:
李鹏飞 2023-06-27 22:55:49 +08:00
commit c9f7be6f21
9 changed files with 76 additions and 70 deletions

View File

@ -1,4 +1,6 @@
--ADD BY YangHongwei 2023-06-27
1、修改本部检查通知页面。
2、修改赛鼎现场人员更换单位新项目入场单位下拉框处理。
3、优化选择用户接口 角色不空 账号不空。
4、优化生成卡号方法。
--END

View File

@ -18,7 +18,7 @@ namespace BLL
{
var getUser = db.Person_Persons.FirstOrDefault(x =>( x.Account == userInfo.Account || x.Telephone == userInfo.Telephone || x.PersonName == userInfo.Account)
&& x.Password == Funs.EncryptionPassword(userInfo.Password) && (!x.IsPost.HasValue || x.IsPost == true)
&& (x.Account != null || x.PersonId == Const.hfnbdId || x.PersonId == Const.sysglyId));
&& (x.Account.Length > 1 || x.PersonId == Const.hfnbdId || x.PersonId == Const.sysglyId));
if (getUser != null)
{
Model.UserItem newItem = new Model.UserItem();
@ -107,7 +107,8 @@ namespace BLL
{
var getUser = (from x in db.Person_Persons
join y in db.Sys_Role on x.RoleIds equals y.RoleId
where x.UnitId == unitId && x.IsPost == true && (strParam == null || x.PersonName.Contains(strParam)) && x.RoleIds != null
where x.UnitId == unitId && x.IsPost == true && (strParam == null || x.PersonName.Contains(strParam))
&& x.RoleIds .Length > 1 && x.Account.Length > 1
orderby x.PersonName
select new Model.BaseInfoItem { BaseInfoId = x.PersonId, BaseInfoName = x.PersonName, BaseInfoCode = x.Telephone }).ToList();
@ -132,7 +133,7 @@ namespace BLL
{
var getDatas = from x in db.Person_Persons
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where y.ProjectId == projectId && y.States == Const.State_1 && y.RoleIds != null
where y.ProjectId == projectId && y.States == Const.State_1 && y.RoleIds.Length>1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,
@ -173,8 +174,8 @@ namespace BLL
else
{
var getPersons =from x in db.Person_Persons
where x.IsPost == true && x.RoleIds != null
select new Model.UserItem
where x.IsPost == true && x.RoleIds.Length>1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,
Account = x.Account,
@ -235,7 +236,7 @@ namespace BLL
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
where y.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == unitType && y.States == Const.State_1
&& (strParam == null || x.PersonName.Contains(strParam)) && y.RoleIds != null
&& (strParam == null || x.PersonName.Contains(strParam)) && y.RoleIds.Length>1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,
@ -267,7 +268,7 @@ namespace BLL
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
where y.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == unitType && y.States == Const.State_1
&& (strParam == null || x.PersonName.Contains(strParam)) && y.RoleIds.Contains(item) && y.RoleIds != null
&& (strParam == null || x.PersonName.Contains(strParam)) && y.RoleIds.Contains(item) && y.RoleIds.Length>1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,
@ -313,7 +314,7 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var user = from x in db.Person_Persons
where x.IsPost == true && x.RoleIds != null
where x.IsPost == true && x.RoleIds.Length > 1 && x.Account.Length > 1
select x;
return ObjectMapperManager.DefaultInstance.GetMapper<List<Model.Person_Persons>, List<Model.UserItem>>().Map(user.ToList());
}
@ -444,7 +445,7 @@ namespace BLL
{
var getDatas = (from x in db.Person_Persons
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where y.ProjectId == projectId && y.States == Const.State_1 && y.RoleIds != null
where y.ProjectId == projectId && y.States == Const.State_1 && y.RoleIds.Length>1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,

View File

@ -325,7 +325,7 @@ namespace BLL
public static List<Model.SitePerson_Person> GetSitePersonsByProjectIds(List<string> ProjectIds)
{
return (from x in Funs.DB.SitePerson_Person
where ProjectIds.Contains(x.ProjectId) && x.RoleIds != null
where ProjectIds.Contains(x.ProjectId) && x.RoleIds.Length > 1
select x).ToList();
}
#endregion
@ -342,7 +342,7 @@ namespace BLL
List<Model.SitePerson_Person> returnLists = new List<Model.SitePerson_Person>();
var getSitePerson = db.SitePerson_Person.Where(x => x.ProjectId == projectId
&& x.States == Const.ProjectPersonStates_1
&& x.RoleIds != null);
&& x.RoleIds.Length > 1);
var uList = Funs.GetStrListByStr(unitTypes, ',');
if (!string.IsNullOrEmpty(unitTypes))
{
@ -385,7 +385,7 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
List<Model.SitePerson_Person> returnLists = new List<Model.SitePerson_Person>();
var getgetSitePerson = db.SitePerson_Person.Where(x => x.ProjectId == projectId && x.States == Const.ProjectPersonStates_1 && x.RoleIds != null);
var getgetSitePerson = db.SitePerson_Person.Where(x => x.ProjectId == projectId && x.States == Const.ProjectPersonStates_1 && x.RoleIds.Length > 1);
if (!string.IsNullOrEmpty(unitIds))
{
var getUnitIdsList = Funs.GetStrListByStr(unitIds, ',');
@ -638,35 +638,49 @@ namespace BLL
var getSitePerson = GetSitePersonByProjectIdPersonId(projectId, personId);
if (getSitePerson != null && string.IsNullOrEmpty(getSitePerson.CardNo))
{
string prefix = UnitService.GetUnitCodeByUnitId(getSitePerson.UnitId) + "-";
var getMaxCarNo = Funs.DB.SitePerson_Person.Where(x => x.ProjectId == projectId && x.CardNo.Contains(prefix)).Max(x => x.CardNo);
if (!string.IsNullOrEmpty(getMaxCarNo) && getMaxCarNo.Length > 5)
{
var getInt = Funs.GetNewInt(getMaxCarNo.Substring(getMaxCarNo.Length-5));
if (getInt.HasValue)
{
cardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", getSitePerson.ProjectId, prefix);
getSitePerson.CardNo = cardNo;
Funs.DB.SubmitChanges();
}
}
cardNo= SendCarNobySiteperson(getSitePerson);
}
return cardNo;
}
public static string SendCardNo(string sitepersinId)
/// <summary>
/// 发卡
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public static string SendCarNobySiteperson(Model.SitePerson_Person item)
{
string cardNo = string.Empty;
var getSitePerson = GetSitePersonById(sitepersinId);
if (getSitePerson != null && string.IsNullOrEmpty(getSitePerson.CardNo))
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
cardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", getSitePerson.ProjectId, UnitService.GetUnitCodeByUnitId(getSitePerson.UnitId) +"-");
getSitePerson.CardNo = cardNo;
Funs.DB.SubmitChanges();
}
string carNo = string.Empty;
var isNull = db.EduTrain_TrainRecordDetail.FirstOrDefault(x => x.PersonId == item.PersonId && x.CheckResult == true);
if (isNull != null) ////参加过培训的人员
{
string prefix = UnitService.GetUnitCodeByUnitId(item.UnitId) + "-";
var getCarPerson = db.SitePerson_Person.Where(x => x.ProjectId == item.ProjectId && x.CardNo.Contains(prefix) && x.CardNo.Length > 5);
if (getCarPerson.Count() > 0)
{
var getMaxCarNo = getCarPerson.Max(x => x.CardNo);
if (!string.IsNullOrEmpty(getMaxCarNo) && getMaxCarNo.Length > 5)
{
var getInt = Funs.GetNewInt(getMaxCarNo.Substring(getMaxCarNo.Length - 5));
if (getInt.HasValue)
{
carNo= item.CardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", item.ProjectId, prefix);
db.SubmitChanges();
}
}
}
else
{
carNo = item.CardNo = prefix + "00001";
db.SubmitChanges();
}
}
return cardNo;
return carNo;
}
}
#endregion

View File

@ -1,7 +1,9 @@
using System;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using WIA;
namespace BLL
{
@ -520,21 +522,9 @@ namespace BLL
select x;
foreach (var item in getPersons)
{
var isNull = db.EduTrain_TrainRecordDetail.FirstOrDefault(x => x.PersonId == item.PersonId && x.CheckResult ==true);
if (isNull != null) ////参加过培训的人员
if (!string.IsNullOrEmpty(SitePerson_PersonService.SendCarNobySiteperson(item)))
{
string prefix = UnitService.GetUnitCodeByUnitId(item.UnitId) + "-";
var getMaxCarNo = db.SitePerson_Person.Where(x => x.ProjectId == item.ProjectId && x.CardNo.Contains(prefix)).Max(x => x.CardNo);
if (!string.IsNullOrEmpty(getMaxCarNo) && getMaxCarNo.Length > 5)
{
var getInt = Funs.GetNewInt(getMaxCarNo.Substring(getMaxCarNo.Length - 5));
if (getInt.HasValue)
{
item.CardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", item.ProjectId, prefix);
db.SubmitChanges();
count++;
}
}
count++;
}
}
return count;

View File

@ -57,8 +57,17 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
try
{
SitePerson_PersonService.SendCardNo(this.StiePersonId);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
var getSitePerson = SitePerson_PersonService.GetSitePersonById(this.StiePersonId);
if (getSitePerson != null)
{
SitePerson_PersonService.SendCarNobySiteperson(getSitePerson);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
ShowNotify("发卡未成功!", MessageBoxIcon.Warning);
return;
}
}
catch
{

View File

@ -319,21 +319,7 @@ namespace FineUIPro.Web.Person
if (projectId != Const._Null)
{
int count = 0;
var getSitePersons = from x in Funs.DB.SitePerson_Person
join y in Funs.DB.EduTrain_TrainRecordDetail on x.PersonId equals y.PersonId
join z in Funs.DB.EduTrain_TrainRecord on y.TrainingId equals z.TrainingId
where x.ProjectId == projectId && z.ProjectId == projectId && (x.CardNo == null || x.CardNo == "")
&& y.CheckResult == true
select x;
if (getSitePersons.Count() > 0)
{
foreach (var person in getSitePersons)
{
SitePerson_PersonService.SendCardNo(person.SitePersonId);
count++;
}
}
int count = GetDataService.SendCarNo(projectId);
Alert.ShowInParent("操作完成!共补卡号" + count.ToString() + "个。", MessageBoxIcon.Information);
BindGrid();
}

View File

@ -342,10 +342,14 @@ namespace WebAPI.Controllers
}
}
else
{
SitePerson_PersonService.SendCardNo(getTestRecord.ProjectId, getTestRecord.TestManId);
APITestRecordService.updateAll(getTestRecord.TestPlanId);
{
APITestRecordService.updateAll(getTestRecord.TestPlanId);
responeData.message = "恭喜考试通过!您的成绩为:【" + getTestScores.ToString() + "】。";
var getSitePerson = SitePerson_PersonService. GetSitePersonByProjectIdPersonId(getTestRecord.ProjectId, getTestRecord.TestManId);
if (getSitePerson != null && string.IsNullOrEmpty(getSitePerson.CardNo))
{
string CarNo = SitePerson_PersonService.SendCardNo(getTestRecord.ProjectId, getTestRecord.TestManId);
}
}
responeData.data = new { getTestScores, getPassScores, returnTestRecordId };

View File

@ -697,7 +697,7 @@ namespace WebAPI.Controllers
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
join persons in Funs.DB.Person_Persons on x.IdentityCard equals persons.IdentityCard
where x.ProjectId == projectId && !x.ExchangeTime.HasValue
&& x.States == Const.ProjectPersonStates_1 && x.CardNo != null && persons.PhotoUrl != null
&& x.States == Const.ProjectPersonStates_1 && x.CardNo.Length> 5 && persons.PhotoUrl != null
select new
{
x.PersonId,

View File

@ -362,7 +362,7 @@
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:3528/</IISUrl>
<IISUrl>http://localhost:9192/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>