Merge branch 'master' of https://gitee.com/frane-yang/SGGL_SeDin_New
This commit is contained in:
@@ -844,15 +844,6 @@
|
||||
<WCFMetadataStorage Include="Service References\OAWebService\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="Microsoft.Office.Core">
|
||||
<Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<VersionMinor>4</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
<COMReference Include="Microsoft.Office.Interop.Word">
|
||||
<Guid>{00020905-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>8</VersionMajor>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using NPOI.SS.Formula;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
@@ -58,6 +59,7 @@ namespace BLL
|
||||
newCheckTeam.UserName = newCheckNotice.CheckTeamLeaderName;
|
||||
newCheckTeam.UnitId = newCheckNotice.UnitId;
|
||||
newCheckTeam.SexName = newCheckNotice.SexName;
|
||||
newCheckTeam.DepartId = newCheckNotice.DepartId;
|
||||
BLL.CheckTeamService.AddCheckTeam(newCheckTeam);
|
||||
}
|
||||
}
|
||||
@@ -96,19 +98,34 @@ namespace BLL
|
||||
/// <param name="checkNoticeId"></param>
|
||||
public static void DeleteCheckNoticeByCheckNoticeId(string checkNoticeId)
|
||||
{
|
||||
Model.ProjectSupervision_CheckNotice checkNotice = Funs.DB.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
if (checkNotice != null)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var checkTeams = from x in Funs.DB.ProjectSupervision_CheckTeam where x.CheckNoticeId == checkNoticeId select x;
|
||||
if (checkTeams.Count() > 0)
|
||||
var checkNotice = db.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
if (checkNotice != null)
|
||||
{
|
||||
foreach (var item in checkTeams)
|
||||
var checkTeams = from x in db.ProjectSupervision_CheckTeam where x.CheckNoticeId == checkNoticeId select x;
|
||||
if (checkTeams.Count() > 0)
|
||||
{
|
||||
BLL.CheckTeamService.DeleteCheckTeamByCheckTeamId(item.CheckTeamId);
|
||||
db.ProjectSupervision_CheckTeam.DeleteAllOnSubmit(checkTeams);
|
||||
}
|
||||
|
||||
var getCheck1 = from x in db.ProjectSupervision_Check1 where x.CheckNoticeId == checkNoticeId select x;
|
||||
if (getCheck1.Count() > 0)
|
||||
{
|
||||
db.ProjectSupervision_Check1.DeleteAllOnSubmit(getCheck1);
|
||||
}
|
||||
|
||||
var getCheckTable1 = from x in db.ProjectSupervision_CheckTable1 where x.CheckNoticeId == checkNoticeId select x;
|
||||
if (getCheckTable1.Count() > 0)
|
||||
{
|
||||
db.ProjectSupervision_CheckTable1.DeleteAllOnSubmit(getCheckTable1);
|
||||
}
|
||||
|
||||
CheckReportService.DeleteCheckReportByCheckNoticeId(checkNoticeId);
|
||||
ProjectSupervision_RectifyService.DeleteRectifyByCheckNoticeId(checkNoticeId);
|
||||
db.ProjectSupervision_CheckNotice.DeleteOnSubmit(checkNotice);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
Funs.DB.ProjectSupervision_CheckNotice.DeleteOnSubmit(checkNotice);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,44 +136,47 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.ProjectSupervision_CheckNotice> GetCheckInfoList(string unitId, string userId, string roleId)
|
||||
{
|
||||
List<Model.ProjectSupervision_CheckNotice> checkInfoLists = new List<Model.ProjectSupervision_CheckNotice>();
|
||||
var role = BLL.RoleService.GetRoleByRoleId(roleId);
|
||||
if (userId == BLL.Const.sysglyId || (BLL.CommonService.IsMainUnitOrAdmin(unitId) && role != null))
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
checkInfoLists = (from x in Funs.DB.ProjectSupervision_CheckNotice orderby x.CheckStartTime select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
var checkInfoIdList = (from x in Funs.DB.ProjectSupervision_CheckTeam
|
||||
where x.UserId == userId && x.UnitId == unitId
|
||||
select x.CheckNoticeId).Distinct().ToList();
|
||||
if (checkInfoIdList.Count() > 0)
|
||||
List<Model.ProjectSupervision_CheckNotice> checkInfoLists = new List<Model.ProjectSupervision_CheckNotice>();
|
||||
var role = BLL.RoleService.GetRoleByRoleId(roleId);
|
||||
if (userId == BLL.Const.sysglyId || (BLL.CommonService.IsMainUnitOrAdmin(unitId) && role != null))
|
||||
{
|
||||
checkInfoLists = (from x in Funs.DB.ProjectSupervision_CheckNotice
|
||||
where checkInfoIdList.Contains(x.CheckNoticeId)
|
||||
orderby x.CheckStartTime
|
||||
select x).ToList();
|
||||
checkInfoLists = (from x in db.ProjectSupervision_CheckNotice orderby x.CheckStartTime select x).ToList();
|
||||
}
|
||||
|
||||
var checkInfoIdList1 = (from x in Funs.DB.ProjectSupervision_CheckNotice
|
||||
where x.CompileMan == userId
|
||||
orderby x.CheckStartTime
|
||||
select x).ToList();
|
||||
if (checkInfoIdList1.Count() > 0)
|
||||
else
|
||||
{
|
||||
if (checkInfoLists.Count() > 0)
|
||||
var checkInfoIdList = (from x in db.ProjectSupervision_CheckTeam
|
||||
where x.UserId == userId && x.UnitId == unitId
|
||||
select x.CheckNoticeId).Distinct().ToList();
|
||||
if (checkInfoIdList.Count() > 0)
|
||||
{
|
||||
checkInfoLists.AddRange(checkInfoIdList1);
|
||||
checkInfoLists = (from x in db.ProjectSupervision_CheckNotice
|
||||
where checkInfoIdList.Contains(x.CheckNoticeId)
|
||||
orderby x.CheckStartTime
|
||||
select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
checkInfoLists = checkInfoIdList1;
|
||||
}
|
||||
}
|
||||
|
||||
checkInfoLists = checkInfoLists.Distinct().ToList();
|
||||
var checkInfoIdList1 = (from x in db.ProjectSupervision_CheckNotice
|
||||
where x.CompileMan == userId
|
||||
orderby x.CheckStartTime
|
||||
select x).ToList();
|
||||
if (checkInfoIdList1.Count() > 0)
|
||||
{
|
||||
if (checkInfoLists.Count() > 0)
|
||||
{
|
||||
checkInfoLists.AddRange(checkInfoIdList1);
|
||||
}
|
||||
else
|
||||
{
|
||||
checkInfoLists = checkInfoIdList1;
|
||||
}
|
||||
}
|
||||
|
||||
checkInfoLists = checkInfoLists.Distinct().ToList();
|
||||
}
|
||||
return checkInfoLists;
|
||||
}
|
||||
return checkInfoLists;
|
||||
}
|
||||
|
||||
#region 根据检查ID得到检查内容项
|
||||
|
||||
@@ -28,11 +28,14 @@ namespace BLL
|
||||
/// <param name="checkReportId"></param>
|
||||
public static void DeleteCheckReportItemByCheckReportId(string checkReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.ProjectSupervision_CheckReportItem where x.CheckReportId == checkReportId select x).ToList();
|
||||
if (q != null)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Funs.DB.ProjectSupervision_CheckReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
var q = (from x in db.ProjectSupervision_CheckReportItem where x.CheckReportId == checkReportId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
db.ProjectSupervision_CheckReportItem.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,11 +61,15 @@ namespace BLL
|
||||
/// <param name="checkNoticeId"></param>
|
||||
public static void DeleteCheckReportByCheckNoticeId(string checkNoticeId)
|
||||
{
|
||||
Model.ProjectSupervision_CheckReport checkReport = Funs.DB.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
if (checkReport != null)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Funs.DB.ProjectSupervision_CheckReport.DeleteOnSubmit(checkReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
Model.ProjectSupervision_CheckReport checkReport = db.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
if (checkReport != null)
|
||||
{
|
||||
CheckReportItemService.DeleteCheckReportItemByCheckReportId(checkReport.CheckReportId);
|
||||
db.ProjectSupervision_CheckReport.DeleteOnSubmit(checkReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace BLL
|
||||
UserName = CheckTeam.UserName,
|
||||
UnitId = CheckTeam.UnitId,
|
||||
SexName = CheckTeam.SexName,
|
||||
DepartId=CheckTeam.DepartId,
|
||||
};
|
||||
Funs.DB.ProjectSupervision_CheckTeam.InsertOnSubmit(newCheckTeam);
|
||||
Funs.DB.SubmitChanges();
|
||||
@@ -71,6 +72,7 @@ namespace BLL
|
||||
newCheckTeam.UserName = CheckTeam.UserName;
|
||||
newCheckTeam.UnitId = CheckTeam.UnitId;
|
||||
newCheckTeam.SexName = CheckTeam.SexName;
|
||||
newCheckTeam.DepartId = CheckTeam.DepartId;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,11 +36,14 @@ namespace BLL
|
||||
|
||||
public static void DeleteRectifyItemByRectifyId(string rectifyId)
|
||||
{
|
||||
var q = (from x in Funs.DB.ProjectSupervision_RectifyItem where x.RectifyId == rectifyId select x).ToList();
|
||||
if (q != null)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Funs.DB.ProjectSupervision_RectifyItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
var q = (from x in db.ProjectSupervision_RectifyItem where x.RectifyId == rectifyId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
db.ProjectSupervision_RectifyItem.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,13 +75,16 @@ namespace BLL
|
||||
/// <param name="checkNoticeId"></param>
|
||||
public static void DeleteRectifyByCheckNoticeId(string checkNoticeId)
|
||||
{
|
||||
Model.ProjectSupervision_Rectify newRectify = Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
if (newRectify != null)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Funs.DB.ProjectSupervision_Rectify.DeleteOnSubmit(newRectify);
|
||||
Funs.DB.SubmitChanges();
|
||||
var newRectify = db.ProjectSupervision_Rectify.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
if (newRectify != null)
|
||||
{
|
||||
ProjectSupervision_RectifyItemService.DeleteRectifyItemByRectifyId(newRectify.RectifyId);
|
||||
db.ProjectSupervision_Rectify.DeleteOnSubmit(newRectify);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,25 +29,25 @@ namespace BLL
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.InterFaceLog> GetInterFaceLogByModle(Model.InterFaceLog table)
|
||||
{
|
||||
var q= from x in db.InterFaceLog
|
||||
where
|
||||
( string.IsNullOrEmpty(table.InterFaceLogId)||x.InterFaceLogId.Contains(table.InterFaceLogId)) &&
|
||||
( string.IsNullOrEmpty(table.UserId)||x.UserId.Contains(table.UserId)) &&
|
||||
( string.IsNullOrEmpty(table.UnitId)||x.UnitId.Contains(table.UnitId)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceName)||x.InterFaceName.Contains(table.InterFaceName)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceUrl)||x.InterFaceUrl.Contains(table.InterFaceUrl)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceMehtod)||x.InterFaceMehtod.Contains(table.InterFaceMehtod)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceBody)||x.InterFaceBody.Contains(table.InterFaceBody)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceReturnData)||x.InterFaceReturnData.Contains(table.InterFaceReturnData)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceType)||x.InterFaceType.Contains(table.InterFaceType)) &&
|
||||
( string.IsNullOrEmpty(table.IP)||x.IP.Contains(table.IP))
|
||||
orderby x.InterFaceLogDate descending
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
public static List<Model.InterFaceLog> GetInterFaceLogByModle(Model.InterFaceLog table)
|
||||
{
|
||||
var q = from x in db.InterFaceLog
|
||||
where
|
||||
(string.IsNullOrEmpty(table.InterFaceLogId) || x.InterFaceLogId.Contains(table.InterFaceLogId)) &&
|
||||
(string.IsNullOrEmpty(table.UserId) || x.UserId.Contains(table.UserId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceName) || x.InterFaceName.Contains(table.InterFaceName)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceUrl) || x.InterFaceUrl.Contains(table.InterFaceUrl)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceMehtod) || x.InterFaceMehtod.Contains(table.InterFaceMehtod)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceBody) || x.InterFaceBody.Contains(table.InterFaceBody)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceReturnData) || x.InterFaceReturnData.Contains(table.InterFaceReturnData)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceType) || x.InterFaceType.Contains(table.InterFaceType)) &&
|
||||
(string.IsNullOrEmpty(table.IP) || x.IP.Contains(table.IP))
|
||||
orderby x.InterFaceLogDate descending
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
|
||||
@@ -1355,7 +1355,8 @@ namespace BLL
|
||||
{
|
||||
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 2
|
||||
join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId
|
||||
where z.ProjectId == projectid && y.RiskLevel == 2 && z.CompileDate.Value.Year >= 2023
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -1368,7 +1369,8 @@ namespace BLL
|
||||
{
|
||||
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 1
|
||||
join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId
|
||||
where z.ProjectId == projectid && y.RiskLevel == 1 && z.CompileDate.Value.Year >= 2023
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -1381,7 +1383,8 @@ namespace BLL
|
||||
{
|
||||
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 3
|
||||
join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId
|
||||
where z.ProjectId == projectid && y.RiskLevel == 3 && z.CompileDate.Value.Year >= 2023
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -1394,7 +1397,8 @@ namespace BLL
|
||||
{
|
||||
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 4
|
||||
join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId
|
||||
where z.ProjectId == projectid && y.RiskLevel == 4 && z.CompileDate.Value.Year >= 2023
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user