20240911 WBS分部分项划分

This commit is contained in:
2024-09-11 15:53:15 +08:00
60 changed files with 6477 additions and 1040 deletions
+24
View File
@@ -71,6 +71,30 @@ namespace BLL
}
#endregion
#region
/// <summary>
/// 根据项目名称获取项目信息
/// </summary>
/// <param name="projectName"></param>
/// <returns></returns>
public static Model.BaseInfoItem getProjectByName(string projectName)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Base_Project
where x.ProjectName == projectName
select new Model.BaseInfoItem
{
BaseInfoId = x.ProjectId,
BaseInfoCode = x.ProjectCode,
BaseInfoName = x.ProjectName
}
).FirstOrDefault();
return getDataLists;
}
}
#endregion
#region id获取区域表
/// <summary>
/// 根据项目id获取区域表
+4
View File
@@ -763,6 +763,10 @@ namespace BLL
{
newPerson.TeamGroupId = person.TeamGroupId;
}
if (!string.IsNullOrEmpty(person.WorkPostName))
{
person.WorkPostId = WorkPostService.AddWorkPostByName(person.WorkPostName);
}
if (!string.IsNullOrEmpty(person.WorkPostId))
{
newPerson.WorkPostId = person.WorkPostId;
+31
View File
@@ -167,6 +167,37 @@ namespace BLL
return getSiteInOutList;
}
}
public static List<Model.PageDataPersonInOutItem> getPersonNumByCompany(DateTime dateValue,string[] pids)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
List<Model.PageDataPersonInOutItem> getSiteInOutList = new List<Model.PageDataPersonInOutItem>();
var getDayAll = from x in db.SitePerson_PersonInOutNow
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
join z in db.Base_WorkPost on y.WorkPostId equals z.WorkPostId
where x.ChangeTime.Value.Year == dateValue.Year && x.ChangeTime.Value.Month == dateValue.Month
&& x.ChangeTime.Value.Day == dateValue.Day && pids.Contains(x.ProjectId)
select new { x.PersonId, x.ChangeTime, x.IsIn, z.PostType };
if (getDayAll.Count() > 0)
{
var getInMaxs = from x in getDayAll
group x by x.PersonId into g
select new Model.PageDataPersonInOutItem
{
PersonId = g.First().PersonId,
ChangeTime = g.Max(x => x.ChangeTime),
IsIn = g.First().IsIn,
PostType = g.First().PostType
};
if (getInMaxs.Count() > 0)
{
getSiteInOutList = getInMaxs.Where(x => x.IsIn == true).ToList();
}
}
return getSiteInOutList;
}
}
#endregion
}
}
+12
View File
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public static class AnBangService
{
}
}
+1
View File
@@ -85,6 +85,7 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="AnBang\AnBangService.cs" />
<Compile Include="API\APIBaseInfoService.cs" />
<Compile Include="API\APICommonService.cs" />
<Compile Include="API\APIDoorServerService.cs" />
+29
View File
@@ -45,7 +45,36 @@ namespace BLL
db.Base_WorkPost.InsertOnSubmit(newWorkPost);
db.SubmitChanges();
}
public static string AddWorkPostByName(string workPostName)
{
string workpostid = String.Empty;
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var model = db.Base_WorkPost.FirstOrDefault(e => e.WorkPostName == workPostName);
if (model != null)
{
workpostid = model.WorkPostId;
}
else
{
Model.Base_WorkPost newWorkPost = new Model.Base_WorkPost
{
WorkPostId = SQLHelper.GetNewID(),
WorkPostCode = "",
WorkPostName = workPostName,
IsHsse = false,
IsCQMS = false,
CNCodes = "",
};
db.Base_WorkPost.InsertOnSubmit(newWorkPost);
db.SubmitChanges();
workpostid = newWorkPost.WorkPostId;
}
return workpostid;
}
}
/// <summary>
/// 修改
/// </summary>
@@ -86,6 +86,14 @@ namespace BLL
BLL.CommonService.DeleteAttachFileById(EmergencyTeamAndTrain.FileId);
////删除流程表
BLL.CommonService.DeleteFlowOperateByID(EmergencyTeamAndTrain.FileId);
//删除子表
var list = db.Emergency_EmergencyTeamItem.Where(x => x.FileId == FileId).ToList();
if (list.Count>0)
{
db.Emergency_EmergencyTeamItem.DeleteAllOnSubmit(list);
}
db.Emergency_EmergencyTeamAndTrain.DeleteOnSubmit(EmergencyTeamAndTrain);
db.SubmitChanges();
}
@@ -36,9 +36,11 @@ namespace BLL
FirstAidDressing = injuryAccident.FirstAidDressing,
MedicalTreatment = injuryAccident.MedicalTreatment,
WorkLimitation = injuryAccident.WorkLimitation,
LossCount = injuryAccident.LossCount,
LossPerson = injuryAccident.LossPerson,
LossWorkTime = injuryAccident.LossWorkTime,
LossEconomy = injuryAccident.LossEconomy,
DeathCount=injuryAccident.DeathCount,
DeathPerson = injuryAccident.DeathPerson,
DeathWorkTime = injuryAccident.DeathWorkTime,
DeathEconomy = injuryAccident.DeathEconomy
@@ -369,5 +369,6 @@ namespace BLL
db.SubmitChanges();
}
#endregion
}
}
+38 -5
View File
@@ -251,12 +251,23 @@
/// 获取项目下拉选项
/// </summary>
/// <returns></returns>
public static List<Model.Base_Project> GetAllProjectDropDownList()
public static List<Model.Base_Project> GetAllProjectDropDownList(string[] pids = null)
{
var list = (from x in Funs.DB.Base_Project
orderby x.ProjectCode descending
select x).ToList();
return list;
if (pids == null)
{
var list = (from x in Funs.DB.Base_Project
orderby x.ProjectCode descending
select x).ToList();
return list;
}
else {
var list = (from x in Funs.DB.Base_Project
where pids.Contains(x.ProjectId)
orderby x.ProjectCode descending
select x).ToList();
return list;
}
}
@@ -669,5 +680,27 @@
return list;
}
#region
public static List<Model.Base_Project> GetUnEndProjectByUserIdDropDownList(string projectState,
string projectName = null, string projectCode = null) {
IQueryable<Model.Base_Project> projects = (from x in Funs.DB.Base_Project
where x.ProjectState == projectState
orderby x.ProjectCode descending
select x);
if (!string.IsNullOrEmpty(projectName))
{
projects = from x in projects where x.ProjectName.Contains(projectName) select x;
}
if (!string.IsNullOrEmpty(projectCode))
{
projects = from x in projects where x.ProjectCode.Contains(projectCode) select x;
}
return (from x in projects
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
select x).Distinct().ToList();
}
#endregion
}
}
+39
View File
@@ -972,5 +972,44 @@ namespace BLL
maxId = GetIntValue(str);
return maxId;
}
/// <summary>
/// 通过存储过程获取数据
/// </summary>
/// <param name="storedProcName"></param>
/// <returns></returns>
public static int RunProcGetHsseKq(string ProjectId,DateTime startTime,DateTime endTime,string UnitId)
{
string str = "";
using (SqlConnection Connection = new SqlConnection(connectionString))
{
try
{
Connection.Open();
SqlCommand command = new SqlCommand("SpGetHsseKq", Connection)
{
CommandTimeout = 0,
CommandType = CommandType.StoredProcedure
};
SqlParameter[] values = new SqlParameter[]
{
new SqlParameter("@ProjectId", ProjectId),
new SqlParameter("@startTime", startTime.ToString()),
new SqlParameter("@endTime", endTime.ToString()),
new SqlParameter("@UnitId", UnitId),
new SqlParameter("@returnVal", SqlDbType.Int)
};
command.Parameters.AddRange(values);
command.Parameters["@returnVal"].Direction = ParameterDirection.Output;
command.ExecuteNonQuery();
str = command.Parameters["@returnVal"].Value.ToString();
}
finally
{
Connection.Close();
}
return Convert.ToInt32(str);
}
}
}
}
+46 -15
View File
@@ -686,36 +686,67 @@ namespace BLL
/// 获取企业负责人带班检查次数
/// </summary>
/// <returns></returns>
public static int GetCompanyLeadShiftCheckNum()
public static int GetCompanyLeadShiftCheckNum(string[] pids=null)
{
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
where x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
select x).Count();
return result;
if (pids == null)
{
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
where x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
select x).Count();
return result;
}
else {
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
where x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
&& pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 获取企业综合检查次数
/// </summary>
/// <returns></returns>
public static int GetCompanyComprehensiveCheckNum()
public static int GetCompanyComprehensiveCheckNum(string[] pids = null)
{
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
where x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
select x).Count();
return result;
if (pids == null) {
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
where x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
select x).Count();
return result;
}
else {
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
where x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
&& pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 获取企业专项检查次数
/// </summary>
/// <returns></returns>
public static int GetCompanySpecialCheckNum()
public static int GetCompanySpecialCheckNum(string[] pids = null)
{
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
where x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
select x).Count();
return result;
if (pids == null)
{
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
where x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
select x).Count();
return result;
}
else {
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
where x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
&& pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>