提交代码

This commit is contained in:
2024-11-12 15:33:53 +08:00
parent 2ebb6b5c24
commit 87e1403783
15 changed files with 725 additions and 170 deletions
@@ -48,6 +48,9 @@ namespace BLL
UnitId = constructionRisk.UnitId,
RiskLevel = constructionRisk.RiskLevel,
Coordinate = constructionRisk.Coordinate,
SubUnitDutyPerson = constructionRisk.SubUnitDutyPerson,
MainUnitDutyPerson = constructionRisk.MainUnitDutyPerson,
MainUnitCheckPerson = constructionRisk.MainUnitCheckPerson,
};
Funs.DB.HSSE_ConstructionRisk.InsertOnSubmit(newconstructionRisk);
Funs.DB.SubmitChanges();
@@ -139,6 +142,9 @@ namespace BLL
newHazardList.UnitId = hazardList.UnitId;
newHazardList.RiskLevel = hazardList.RiskLevel;
newHazardList.Coordinate = hazardList.Coordinate;
newHazardList.SubUnitDutyPerson = hazardList.SubUnitDutyPerson;
newHazardList.MainUnitDutyPerson = hazardList.MainUnitDutyPerson;
newHazardList.MainUnitCheckPerson = hazardList.MainUnitCheckPerson;
db.SubmitChanges();
}
else
+20 -20
View File
@@ -46,7 +46,7 @@ namespace BLL
/// <param name="personType">人员类型</param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getListData(string unitId, string departId, string projetcId, string name, string idCard, string isPost, string personType, string account,string[] workPostIds, Grid Grid1)
public static IEnumerable getListData(string unitId, string departId, string projetcId, string name, string idCard, string isPost, string personType, string account, string[] workPostIds, Grid Grid1)
{
IQueryable<Model.Person_Persons> getDataList = getDataLists.OrderBy(x => x.UnitId).ThenBy(x => x.DepartId);
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
@@ -94,7 +94,7 @@ namespace BLL
}
}
if (workPostIds != null && workPostIds.Count() > 0)
if (workPostIds != null && workPostIds.Count() > 0)
{
getDataList = getDataList.Where(e => workPostIds.Contains(e.WorkPostId));
}
@@ -170,7 +170,7 @@ namespace BLL
{
foreach (var item in getItem)
{
string pname= ProjectService.GetShortNameByProjectId(item.ProjectId);
string pname = ProjectService.GetShortNameByProjectId(item.ProjectId);
if (string.IsNullOrEmpty(name))
{
name = pname;
@@ -237,11 +237,11 @@ namespace BLL
/// <param name="PersonId"></param>
/// <param name="ProjectId"></param>
/// <returns></returns>
public static bool IsGeneralUnitByPersonId(string PersonId,string ProjectId)
public static bool IsGeneralUnitByPersonId(string PersonId, string ProjectId)
{
bool result = false;
var PersonEntity = GetPerson_PersonsById(PersonId);
if (PersonEntity!=null)
if (PersonEntity != null)
{
var pUnit = Funs.DB.Project_ProjectUnit.FirstOrDefault(e => e.ProjectId == ProjectId && e.UnitId == PersonEntity.UnitId);
if (pUnit != null)
@@ -253,7 +253,7 @@ namespace BLL
}
}
return result;
}
@@ -466,8 +466,8 @@ namespace BLL
Url = getUser.PersonName;
if (!string.IsNullOrEmpty(getUser.SignatureUrl))
{
Url = Funs.RootPath + getUser.SignatureUrl;
Url = Funs.RootPath + getUser.SignatureUrl;
}
}
return Url;
@@ -526,7 +526,7 @@ namespace BLL
return returUsers;
}
else
{
{
if (!string.IsNullOrEmpty(unitId))
{
users = (from x in db.Person_Persons
@@ -571,11 +571,11 @@ namespace BLL
if (!string.IsNullOrEmpty(projectId))
{
var getProjectPersons = from x in db.SitePerson_Person
where x.ProjectId == projectId && x.States == Const.State_1 && x.RoleIds != null
where x.ProjectId == projectId && x.States == Const.State_1 && x.RoleIds != null && x.RoleIds != ""
select x;
if (listUnitIds.Count() > 0)
{
getProjectPersons = getProjectPersons.Where(x => listUnitIds.Contains(x.UnitId)).OrderBy(x => x.PersonName);
getProjectPersons = getProjectPersons.Where(x => listUnitIds.Contains(x.UnitId)).OrderBy(x => x.PersonName);
}
if (listRoles.Count() > 0)
{
@@ -602,11 +602,11 @@ namespace BLL
{
var getPersons = from x in db.Person_Persons
where x.PersonId != Const.hfnbdId && x.PersonId != Const.sedinId
&& (x.IsPost == true || !x.IsPost.HasValue) && x.Account != null
&& (x.IsPost == true || !x.IsPost.HasValue) && x.Account != null
select x;
if (listUnitIds.Count() > 0)
{
getPersons = getPersons.Where(x => listUnitIds.Contains(x.UnitId)).OrderBy(x=>x.PersonName);
getPersons = getPersons.Where(x => listUnitIds.Contains(x.UnitId)).OrderBy(x => x.PersonName);
}
if (listRoles.Count() > 0)
{
@@ -699,7 +699,7 @@ namespace BLL
PersonName = person.PersonName,
Account = person.Account,
RawPassword = password,
Password =Funs.EncryptionPassword(password),
Password = Funs.EncryptionPassword(password),
IsOffice = person.IsOffice,
RoleIds = person.RoleIds,
IdentityCard = person.IdentityCard,
@@ -759,7 +759,7 @@ namespace BLL
}
if (!string.IsNullOrEmpty(person.SignatureUrl))
{
newPerson. SignatureUrl = person.SignatureUrl;
newPerson.SignatureUrl = person.SignatureUrl;
}
@@ -783,9 +783,9 @@ namespace BLL
if (newPerson.UnitId != person.UnitId)
{
newPerson.UnitId = person.UnitId;
isChange=true;
isChange = true;
}
newPerson.DepartId = person.DepartId;
newPerson.WorkPostId = person.WorkPostId;
newPerson.JobNum = person.JobNum;
@@ -970,7 +970,7 @@ namespace BLL
}
}
}
public static void DeletePerson_PersonsById(string PersonId)
@@ -993,7 +993,7 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getSitepersons = from x in db.SitePerson_Person
var getSitepersons = from x in db.SitePerson_Person
where x.PersonId == person.PersonId
select x;
if (getSitepersons.Count() > 0)
@@ -1140,7 +1140,7 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var m = db.Person_Persons.FirstOrDefault(e => e.PersonId == personId);
var m = db.Person_Persons.FirstOrDefault(e => e.PersonId == personId);
if (m != null)
{
m.RawPassword = password;
@@ -1840,6 +1840,92 @@
}
#endregion
#region
/// <summary>
/// 推送项目到集团
/// </summary>
/// <returns></returns>
public static string PushProject()
{
string code = "0";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
//查询所有在建项目
var upReport = (from x in db.Base_Project
where (x.ProjectState == "1" || x.ProjectState == null)
select new Model.BaseProjectItem
{
ProjectId = x.ProjectId,
UnitId = BLL.Const.UnitId_SEDIN,
ProjectCode = x.ProjectCode,
ProjectName = x.ProjectName,
StartDate = x.StartDate,
EndDate = x.EndDate,
ProjectAddress = x.ProjectAddress,
ShortName = x.ShortName,
ProjectType = x.ProjectType,
PostCode = x.PostCode,
Remark = x.Remark,
ProjectState = x.ProjectState,
ContractNo = x.ContractNo,
WorkRange = x.WorkRange,
Duration = x.Duration,
IsUpTotalMonth = x.IsUpTotalMonth,
ProjectMainPerson = x.ProjectMainPerson,
ProjectLiaisonPerson = x.ProjectLiaisonPerson,
IsForeign = x.IsForeign,
FromProjectId = x.FromProjectId,
MapCoordinates = x.MapCoordinates,
ProjectMoney = x.ProjectMoney,
ConstructionMoney = x.ConstructionMoney,
Country = x.Country,
Province = x.Province,
City = x.City,
Telephone = x.Telephone,
EnglishRemark = x.EnglishRemark,
//IsFace = x.IsFace,
//ProjectState2 = x.ProjectState2,
//Progress = x.Progress,
//MonitorPW = x.MonitorPW,
//MonitorId = x.MonitorId,
//ProjectAttribute = x.ProjectAttribute,
SourceUnitId = BLL.Const.UnitId_SEDIN,
}
);
code = PushApiProject(upReport).ToString();
if (code == "1")
{
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("【在建项目】上传到服务器", ex);
}
return code;
}
}
/// <summary>
/// 推送项目
/// </summary>
/// <param name="upReport"></param>
/// <returns></returns>
private static int PushApiProject(IQueryable<Model.BaseProjectItem> upReport)
{
string baseurl = "/api/InspectionBrigade/SaveBaseProjectData";
var resultJsonReport = JsonConvert.SerializeObject(upReport);
resultJsonReport = "{\"BaseProjectItems\":" + resultJsonReport.Replace("}{", ",") + "}";
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
return responeData.code;
}
#endregion
#endregion