冗余代码清理
This commit is contained in:
@@ -172,7 +172,7 @@ namespace BLL
|
||||
return getDataLists.ToList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 保存RectifyNotices
|
||||
/// <summary>
|
||||
/// 保存RectifyNotices
|
||||
@@ -193,7 +193,7 @@ namespace BLL
|
||||
CheckManNames = rectifyNotices.CheckManNames,
|
||||
CheckManIds = rectifyNotices.CheckManIds,
|
||||
CheckedDate = Funs.GetNewDateTime(rectifyNotices.CheckedDate),
|
||||
HiddenHazardType = rectifyNotices.HiddenHazardType,
|
||||
HiddenHazardType = rectifyNotices.HiddenHazardType,
|
||||
States = rectifyNotices.States,
|
||||
};
|
||||
if (!string.IsNullOrEmpty(rectifyNotices.WorkAreaId))
|
||||
@@ -376,7 +376,7 @@ namespace BLL
|
||||
{
|
||||
isUpdate.UnitHeadManId = rectifyNotices.UnitHeadManId;
|
||||
isUpdate.CompleteDate = DateTime.Now;
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,10 +30,10 @@ namespace BLL
|
||||
newTestRecord.TestPlanName = getTestPlan.PlanName;
|
||||
newTestRecord.TestPlanId = testPlanId;
|
||||
newTestRecord.TestPlanStartTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", getTestPlan.TestStartTime);
|
||||
newTestRecord.TestPlanEndTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", getTestPlan.TestEndTime);
|
||||
newTestRecord.TestManId = testManId;
|
||||
newTestRecord.TestPlanEndTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", getTestPlan.TestEndTime);
|
||||
newTestRecord.TestManId = testManId;
|
||||
newTestRecord.UserType = userType;
|
||||
var getUpdateTestRecord = db.Test_TestRecord.FirstOrDefault(x => x.TestPlanId == testPlanId && x.IdentityCard == identityCard);
|
||||
var getUpdateTestRecord = db.Test_TestRecord.FirstOrDefault(x => x.TestPlanId == testPlanId && x.IdentityCard == identityCard);
|
||||
if (getUpdateTestRecord == null && userType != "2")
|
||||
{
|
||||
getUpdateTestRecord = db.Test_TestRecord.FirstOrDefault(x => x.TestPlanId == testPlanId && x.TestManId == testManId);
|
||||
@@ -41,9 +41,9 @@ namespace BLL
|
||||
if (getUpdateTestRecord != null)
|
||||
{
|
||||
newTestRecord.TestRecordId = getUpdateTestRecord.TestRecordId;
|
||||
newTestRecord.DepartId = getUpdateTestRecord.DepartId;
|
||||
newTestRecord.UnitId = getUpdateTestRecord.UnitId;
|
||||
newTestRecord.ProjectId = getUpdateTestRecord.ProjectId;
|
||||
newTestRecord.DepartId = getUpdateTestRecord.DepartId;
|
||||
newTestRecord.UnitId = getUpdateTestRecord.UnitId;
|
||||
newTestRecord.ProjectId = getUpdateTestRecord.ProjectId;
|
||||
newTestRecord.TestManName = getUpdateTestRecord.TestManName;
|
||||
newTestRecord.Telephone = getUpdateTestRecord.Telephone;
|
||||
newTestRecord.IdentityCard = getUpdateTestRecord.IdentityCard;
|
||||
@@ -91,7 +91,7 @@ namespace BLL
|
||||
else
|
||||
{
|
||||
newTestRecord.IsThiUnit = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return newTestRecord;
|
||||
}
|
||||
@@ -142,11 +142,7 @@ namespace BLL
|
||||
|
||||
if (string.IsNullOrEmpty(newTestRecord.ManType))
|
||||
{
|
||||
if (testRecord.TestManId == Const.sedinId)
|
||||
{
|
||||
newTestRecord.ManType = "2";
|
||||
}
|
||||
else if (UserService.GetUserByUserId(testRecord.TestManId) != null)
|
||||
if (UserService.GetUserByUserId(testRecord.TestManId) != null)
|
||||
{
|
||||
newTestRecord.ManType = "1";
|
||||
}
|
||||
@@ -157,7 +153,7 @@ namespace BLL
|
||||
}
|
||||
|
||||
Model.Test_TestRecord getUpdateTestRecord = new Model.Test_TestRecord();
|
||||
; getUpdateTestRecord = db.Test_TestRecord.FirstOrDefault(x => x.TestRecordId == testRecord.TestRecordId);
|
||||
; getUpdateTestRecord = db.Test_TestRecord.FirstOrDefault(x => x.TestRecordId == testRecord.TestRecordId);
|
||||
if (getUpdateTestRecord == null)
|
||||
{
|
||||
getUpdateTestRecord = db.Test_TestRecord.FirstOrDefault(x => x.TestPlanId == testRecord.TestPlanId && x.IdentityCard == testRecord.IdentityCard);
|
||||
@@ -186,7 +182,7 @@ namespace BLL
|
||||
{
|
||||
if (getTestPlan.TestEndTime > DateTime.Now)
|
||||
{
|
||||
var getTestPlanTraining = db.Test_TestPlanTraining.Where(x => x.TestPlanId == getTestPlan.TestPlanId && x.UserType == testRecord.UserType );
|
||||
var getTestPlanTraining = db.Test_TestPlanTraining.Where(x => x.TestPlanId == getTestPlan.TestPlanId && x.UserType == testRecord.UserType);
|
||||
if (getTestPlanTraining.Count() > 0)
|
||||
{
|
||||
int cout1 = getTestPlanTraining.Sum(x => x.TestType1Count ?? 0);
|
||||
@@ -311,8 +307,8 @@ namespace BLL
|
||||
{
|
||||
var getTestPlan = db.Test_TestPlan.FirstOrDefault(x => x.TestPlanId == testPlanId);
|
||||
var getTestRecord = db.Test_TestRecord.FirstOrDefault(x => x.TestRecordId == testRecordId);
|
||||
if(getTestPlan != null && getTestRecord != null)
|
||||
{
|
||||
if (getTestPlan != null && getTestRecord != null)
|
||||
{
|
||||
////是否已经存在试卷
|
||||
var item = db.Test_TestRecordItem.FirstOrDefault(x => x.TestRecordId == testRecordId);
|
||||
if (item == null)
|
||||
@@ -419,7 +415,7 @@ namespace BLL
|
||||
Score = x.TestType == "1" ? getTestPlan.SValue : (x.TestType == "2" ? getTestPlan.MValue : getTestPlan.JValue),
|
||||
};
|
||||
|
||||
db.Test_TestRecordItem.InsertAllOnSubmit(getItems);
|
||||
db.Test_TestRecordItem.InsertAllOnSubmit(getItems);
|
||||
getTestRecord.TestStartTime = DateTime.Now;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -241,7 +241,6 @@
|
||||
<Compile Include="API\HSSE\APIReceiveFileManagerService.cs" />
|
||||
<Compile Include="API\HSSE\APIRectifyNoticesService.cs" />
|
||||
<Compile Include="API\HSSE\APIResourcesService.cs" />
|
||||
<Compile Include="API\HSSE\APISeDinMonthReportService.cs" />
|
||||
<Compile Include="API\HSSE\APIServerTestPlanService.cs" />
|
||||
<Compile Include="API\HSSE\APIServerTestRecordService.cs" />
|
||||
<Compile Include="API\HSSE\APITestPlanService.cs" />
|
||||
@@ -713,7 +712,6 @@
|
||||
<Compile Include="HSSE\Manager\ManagerMonthC\TrainActivitySortCService.cs" />
|
||||
<Compile Include="HSSE\Manager\ManagerMonthC\TrainCService.cs" />
|
||||
<Compile Include="HSSE\Manager\ManagerMonthC\TrainSortCService.cs" />
|
||||
<Compile Include="HSSE\Manager\ManagerMonth_SeDinService.cs" />
|
||||
<Compile Include="HSSE\Manager\ManagerWeekService.cs" />
|
||||
<Compile Include="HSSE\Manager\MonthReportBService.cs" />
|
||||
<Compile Include="HSSE\Manager\MonthReportDService.cs" />
|
||||
|
||||
@@ -26,10 +26,6 @@ namespace BLL
|
||||
{
|
||||
return new List<string>() { Const.Menu_Server, Const.Menu_HSSE, Const.Menu_CQMS, Const.Menu_HJGL };
|
||||
}
|
||||
else if (userId == Const.sedinId)
|
||||
{
|
||||
return new List<string>() { Const.Menu_CQMS };
|
||||
}
|
||||
else
|
||||
{
|
||||
List<string> returnList = new List<string>();
|
||||
@@ -110,7 +106,7 @@ namespace BLL
|
||||
|| x.MenuType == Const.Menu_PZHGL)
|
||||
select x;
|
||||
List<Model.Sys_Menu> menus = new List<Model.Sys_Menu>();
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId)
|
||||
{
|
||||
menus = getMenus.ToList();
|
||||
}
|
||||
@@ -173,15 +169,7 @@ namespace BLL
|
||||
{
|
||||
///1、当前用户是管理员
|
||||
///2、当前菜单是个人设置
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
|
||||
{
|
||||
returnValue = true;
|
||||
}
|
||||
else if (userId == Const.sedinId)
|
||||
{
|
||||
returnValue = true;
|
||||
}
|
||||
else if (menu.MenuType == Const.Menu_Personal)
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId)
|
||||
{
|
||||
returnValue = true;
|
||||
}
|
||||
@@ -225,10 +213,6 @@ namespace BLL
|
||||
try
|
||||
{
|
||||
List<Model.Sys_ButtonToMenu> buttons = new List<Model.Sys_ButtonToMenu>();
|
||||
if (userId == Const.sedinId)
|
||||
{
|
||||
return buttonList;
|
||||
}
|
||||
|
||||
var getMenu = Funs.DB.Sys_Menu.FirstOrDefault(x => x.MenuId == menuId);
|
||||
var user = BLL.UserService.GetUserByUserId(userId); ////用户
|
||||
@@ -289,11 +273,7 @@ namespace BLL
|
||||
public static bool GetAllButtonPowerList(string projectId, string userId, string menuId, string buttonName)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
bool isPower = false; ////定义是否具备按钮权限
|
||||
if (userId == Const.sedinId)
|
||||
{
|
||||
return isPower;
|
||||
}
|
||||
bool isPower = false; ////定义是否具备按钮权限
|
||||
if (!isPower && (userId == Const.sysglyId || userId == Const.hfnbdId))
|
||||
{
|
||||
isPower = true;
|
||||
@@ -382,7 +362,7 @@ namespace BLL
|
||||
public static bool IsThisUnitLeaderOfficeOrManage(string userId)
|
||||
{
|
||||
bool result = false;
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId )
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
@@ -414,7 +394,7 @@ namespace BLL
|
||||
var getUser = db.Sys_User.FirstOrDefault(x => x.UserId == userId);
|
||||
if (getUser != null)
|
||||
{
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId )
|
||||
{
|
||||
isHave = true;
|
||||
}
|
||||
|
||||
@@ -3243,10 +3243,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string ProjectManagerWeekMenuId = "AE118E9C-C309-43B7-A198-8CA90A8D98EB";
|
||||
|
||||
/// <summary>
|
||||
/// 月报(赛鼎)
|
||||
/// </summary>
|
||||
public const string ProjectManagerMonth_SeDinMenuId = "D0EC3002-E1FA-457D-AC3B-4C7B2D71DD82";
|
||||
/// <summary>
|
||||
/// HSSE管理月报
|
||||
/// </summary>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -64,8 +64,8 @@ namespace BLL
|
||||
};
|
||||
db.Check_RectifyNotices.InsertOnSubmit(newRectifyNotices);
|
||||
db.SubmitChanges();
|
||||
////增加一条编码记录
|
||||
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectRectifyNoticesMenuId, rectifyNotice.ProjectId, rectifyNotice.UnitId, rectifyNotice.RectifyNoticesId, rectifyNotice.CheckedDate);
|
||||
//////增加一条编码记录
|
||||
//CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectRectifyNoticesMenuId, rectifyNotice.ProjectId, rectifyNotice.UnitId, rectifyNotice.RectifyNoticesId, rectifyNotice.CheckedDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_Project> GetProjectByUserIdDropDownList(string userId)
|
||||
{
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId )
|
||||
{
|
||||
return (from x in Funs.DB.Base_Project
|
||||
orderby x.ProjectCode descending
|
||||
@@ -308,7 +308,7 @@
|
||||
}
|
||||
public static List<Model.Base_Project> GetUnEndProjectByUserIdDropDownList(string userId, string needProjectId)
|
||||
{
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId )
|
||||
{
|
||||
return (from x in Funs.DB.Base_Project
|
||||
orderby x.ProjectCode descending
|
||||
@@ -349,7 +349,7 @@
|
||||
}
|
||||
public static List<Model.Base_Project> GetShiYeProjectByUserIdDropDownList(string userId, string needProjectId)
|
||||
{
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId )
|
||||
{
|
||||
return (from x in Funs.DB.Base_Project
|
||||
where x.ProjectAttribute == "SHIYE"
|
||||
@@ -385,7 +385,7 @@
|
||||
public static List<Model.Base_Project> GetUnEndProjectByUserIdDropDownList(string userId, string needProjectId, string ProjectAttribute, string projectState, string projectName = null)
|
||||
{
|
||||
IQueryable<Model.Base_Project> projects = null;
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId )
|
||||
{
|
||||
projects = from x in Funs.DB.Base_Project
|
||||
where x.ProjectAttribute.Contains(ProjectAttribute) && (x.IsDelete == null || x.IsDelete == false)
|
||||
|
||||
@@ -505,7 +505,7 @@ namespace BLL
|
||||
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
|
||||
{
|
||||
var users = (from x in db.Sys_User
|
||||
where x.IsPost == true && x.UserId != Const.hfnbdId && x.UserId != Const.sedinId
|
||||
where x.IsPost == true && x.UserId != Const.hfnbdId
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
@@ -530,7 +530,7 @@ namespace BLL
|
||||
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
|
||||
{
|
||||
var users = (from x in db.Sys_User
|
||||
where x.IsPost == true && x.UserId != Const.hfnbdId && x.UserId != Const.sedinId
|
||||
where x.IsPost == true && x.UserId != Const.hfnbdId
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
@@ -584,7 +584,7 @@ namespace BLL
|
||||
else
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
where x.UserId != BLL.Const.hfnbdId && x.UserId != Const.sedinId
|
||||
where x.UserId != BLL.Const.hfnbdId
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
|
||||
@@ -632,7 +632,7 @@ namespace BLL
|
||||
else
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
where x.UnitId == unitId && x.UserId != BLL.Const.hfnbdId && x.UserId != Const.sedinId
|
||||
where x.UnitId == unitId && x.UserId != BLL.Const.hfnbdId
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user