Merge branch 'master' of https://gitee.com/frane-yang/SGGL_CWCEC
This commit is contained in:
@@ -102,7 +102,7 @@ namespace BLL
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Manager_HSSELog newHSSELog =db.Manager_HSSELog.FirstOrDefault(e => e.HSSELogId == updateHSSELog.HSSELogId);
|
||||
Model.Manager_HSSELog newHSSELog = db.Manager_HSSELog.FirstOrDefault(e => e.HSSELogId == updateHSSELog.HSSELogId);
|
||||
if (newHSSELog != null)
|
||||
{
|
||||
newHSSELog.CompileDate = updateHSSELog.CompileDate;
|
||||
@@ -980,5 +980,189 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 小程序接口
|
||||
/// <summary>
|
||||
/// 返回列表
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.HSSELogItem> getHSSELogDataList(string projectId, string userId,string CompileMan,string CompileDate)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<Model.HSSELogItem> getInfoList = new List<Model.HSSELogItem>();
|
||||
getInfoList = (from x in db.Manager_HSSELog
|
||||
join y in db.Sys_User on x.CompileMan equals y.UserId
|
||||
join z in db.Sys_Const on x.Weather equals z.ConstValue
|
||||
orderby x.CompileDate
|
||||
where x.IsVisible != false && z.GroupId == BLL.ConstValue.Group_Weather && x.ProjectId == projectId
|
||||
select new Model.HSSELogItem
|
||||
{
|
||||
HSSELogId = x.HSSELogId,
|
||||
ProjectId = x.ProjectId,
|
||||
CompileDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompileDate),
|
||||
CompileMan = x.CompileMan,
|
||||
Weather = x.Weather,
|
||||
IsVisible = x.IsVisible,
|
||||
CompileManName = y.UserName,
|
||||
WeatherName = z.ConstText
|
||||
}).ToList();
|
||||
Model.Project_ProjectUser projectUser = BLL.ProjectUserService.GetProjectUserByUserIdProjectId(projectId, userId);
|
||||
if (projectUser != null)
|
||||
{
|
||||
if (projectUser.RoleId.Contains(BLL.Const.HSSEEngineer)) //项目安全工程师只能看到自己的日志内容
|
||||
{
|
||||
getInfoList = getInfoList.Where(x => x.CompileMan == userId).ToList();
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(CompileMan))
|
||||
{
|
||||
getInfoList = getInfoList.Where(x => x.CompileMan == CompileMan).ToList();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(CompileDate))
|
||||
{
|
||||
getInfoList = getInfoList.Where(x => x.CompileDate == CompileDate).ToList();
|
||||
}
|
||||
|
||||
return getInfoList;
|
||||
}
|
||||
}
|
||||
|
||||
public static Model.HSSELogItem getHSSELogData(string HSSELogId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.HSSELogItem model = new Model.HSSELogItem();
|
||||
model = (from x in db.Manager_HSSELog
|
||||
join y in db.Sys_User on x.CompileMan equals y.UserId
|
||||
join z in db.Sys_Const on x.Weather equals z.ConstValue
|
||||
orderby x.CompileDate
|
||||
where x.IsVisible != false && z.GroupId == BLL.ConstValue.Group_Weather && x.HSSELogId == HSSELogId
|
||||
select new Model.HSSELogItem
|
||||
{
|
||||
HSSELogId = x.HSSELogId,
|
||||
ProjectId = x.ProjectId,
|
||||
CompileDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompileDate),
|
||||
CompileMan = x.CompileMan,
|
||||
Weather = x.Weather,
|
||||
IsVisible = x.IsVisible,
|
||||
CompileManName = y.UserName,
|
||||
WeatherName = z.ConstText,
|
||||
|
||||
|
||||
Content1 = x.Num11.ToString(),
|
||||
Content2= x.Contents12,
|
||||
Content3= x.Contents13,
|
||||
Content4= x.Contents21,
|
||||
Content5= x.Num21.ToString(),
|
||||
Content6= x.Contents22,
|
||||
Content7 = x.Num22.ToString(),
|
||||
Content8 = x.Contents23,
|
||||
Content9 = x.Num23.ToString(),
|
||||
Content10 = x.Contents24,
|
||||
Content11 = x.Num24.ToString(),
|
||||
Content12 = x.Contents210,
|
||||
Content13 = x.Num210.ToString(),
|
||||
Content14 = x.Num211.ToString(),
|
||||
Content15 = x.Contents31,
|
||||
Content16 = x.Num31.ToString(),
|
||||
Content17 = x.Contents32,
|
||||
Content18 = x.Num32.ToString(),
|
||||
Content19 = x.Contents41,
|
||||
Content20 = x.Contents42
|
||||
}).FirstOrDefault();
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加HSSE日志暨管理数据收集
|
||||
/// </summary>
|
||||
/// <param name="HSSELog">HSSE日志暨管理数据收集实体</param>
|
||||
public static void AddHSSELogApi(Model.HSSELogItem HSSELog)
|
||||
{
|
||||
Model.Manager_HSSELog newHSSELog = new Model.Manager_HSSELog
|
||||
{
|
||||
HSSELogId = HSSELog.HSSELogId,
|
||||
ProjectId = HSSELog.ProjectId,
|
||||
CompileDate = Convert.ToDateTime(HSSELog.CompileDate),
|
||||
CompileMan = HSSELog.CompileMan,
|
||||
Weather = HSSELog.Weather,
|
||||
IsVisible = HSSELog.IsVisible,
|
||||
Num11 = Convert.ToInt32(HSSELog.Content1),
|
||||
Contents12 = HSSELog.Content2,
|
||||
Contents13 = HSSELog.Content3,
|
||||
Contents21 = HSSELog.Content4,
|
||||
Num21 = Convert.ToInt32(HSSELog.Content5),
|
||||
Contents22 = HSSELog.Content6,
|
||||
Num22 = Convert.ToInt32(HSSELog.Content7),
|
||||
Contents23 = HSSELog.Content8,
|
||||
Num23 = Convert.ToInt32(HSSELog.Content9),
|
||||
Contents24 = HSSELog.Content10,
|
||||
Num24 = Convert.ToInt32(HSSELog.Content11),
|
||||
|
||||
Contents210 = HSSELog.Content12,
|
||||
Num210 = Convert.ToInt32(HSSELog.Content13),
|
||||
Num211 = Convert.ToInt32(HSSELog.Content14),
|
||||
Contents31 = HSSELog.Content15,
|
||||
Num31 = Convert.ToInt32(HSSELog.Content16),
|
||||
Contents32 = HSSELog.Content17,
|
||||
Num32 = Convert.ToInt32(HSSELog.Content18),
|
||||
|
||||
Contents41 = HSSELog.Content19,
|
||||
Contents42 = HSSELog.Content20
|
||||
};
|
||||
Funs.DB.Manager_HSSELog.InsertOnSubmit(newHSSELog);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改HSSE日志暨管理数据收集
|
||||
/// </summary>
|
||||
/// <param name="updateHSSELog"></param>
|
||||
public static void UpdateHSSELogApi(Model.HSSELogItem updateHSSELog)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Manager_HSSELog newHSSELog = db.Manager_HSSELog.FirstOrDefault(e => e.HSSELogId == updateHSSELog.HSSELogId);
|
||||
if (newHSSELog != null)
|
||||
{
|
||||
newHSSELog.CompileDate = Convert.ToDateTime(updateHSSELog.CompileDate);
|
||||
newHSSELog.CompileMan = updateHSSELog.CompileMan;
|
||||
newHSSELog.Weather = updateHSSELog.Weather;
|
||||
newHSSELog.IsVisible = updateHSSELog.IsVisible;
|
||||
|
||||
newHSSELog.Num11 = Convert.ToInt32(updateHSSELog.Content1);
|
||||
newHSSELog.Contents12 = updateHSSELog.Content2;
|
||||
newHSSELog.Contents13 = updateHSSELog.Content3;
|
||||
newHSSELog.Contents21 = updateHSSELog.Content4;
|
||||
newHSSELog.Num21 = Convert.ToInt32(updateHSSELog.Content5);
|
||||
newHSSELog.Contents22 = updateHSSELog.Content6;
|
||||
newHSSELog.Num22 = Convert.ToInt32(updateHSSELog.Content7);
|
||||
newHSSELog.Contents23 = updateHSSELog.Content8;
|
||||
newHSSELog.Num23 = Convert.ToInt32(updateHSSELog.Content9);
|
||||
newHSSELog.Contents24 = updateHSSELog.Content10;
|
||||
newHSSELog.Num24 = Convert.ToInt32(updateHSSELog.Content11);
|
||||
|
||||
newHSSELog.Contents210 = updateHSSELog.Content12;
|
||||
newHSSELog.Num210 = Convert.ToInt32(updateHSSELog.Content13);
|
||||
newHSSELog.Num211 = Convert.ToInt32(updateHSSELog.Content14);
|
||||
newHSSELog.Contents31 = updateHSSELog.Content15;
|
||||
newHSSELog.Num31 = Convert.ToInt32(updateHSSELog.Content16);
|
||||
newHSSELog.Contents32 = updateHSSELog.Content17;
|
||||
newHSSELog.Num32 = Convert.ToInt32(updateHSSELog.Content18);
|
||||
|
||||
newHSSELog.Contents41 = updateHSSELog.Content19;
|
||||
newHSSELog.Contents42 = updateHSSELog.Content20;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user