危险源管理模块接入真实数据库:新增危大/超危工程、风险控制清单、安全验收、安全巡检、临时用电管理(含前端页面、BLL/API服务、WebAPI控制器、Model项、SQL脚本与接口文档)
排除 CreateModel.bat(含明文sa密码与本地服务器名,未入库)
This commit is contained in:
@@ -47,42 +47,61 @@ namespace WebAPI.Controllers
|
||||
/// <param name="meetingType">会议类型(C-班前会;W-周例会;M-例会;S-专题例会;A-其他会议)</param>
|
||||
/// <param name="states">状态(0-待提交;1-已提交)</param>
|
||||
/// <param name="pageIndex">页码</param>
|
||||
/// <param name="startDate">编制日期开始日期(yyyy-MM-dd,为空不限制)</param>
|
||||
/// <param name="endDate">编制日期结束日期(yyyy-MM-dd,包含当天,为空不限制)</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getMeetingByProjectIdStates(string projectId, string meetingType, string states, int pageIndex)
|
||||
public Model.ResponeData getMeetingByProjectIdStates(string projectId, string meetingType, string states, int pageIndex, string startDate, string endDate)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
List<Model.MeetingItem> getDataList = new List<Model.MeetingItem>();
|
||||
int pageCount = 0;
|
||||
// 编制日期(CompileDate)范围过滤:startDate/endDate为空时不限制;endDate取整天(包含endDate当天)
|
||||
DateTime? dStart = Funs.GetNewDateTime(startDate);
|
||||
DateTime? dEnd = Funs.GetNewDateTime(endDate);
|
||||
if (dEnd.HasValue)
|
||||
{
|
||||
dEnd = dEnd.Value.Date.AddDays(1);
|
||||
}
|
||||
if (meetingType == "C")
|
||||
{
|
||||
pageCount = Funs.DB.Meeting_ClassMeeting.Count(x => x.ProjectId == projectId
|
||||
&& (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2"))));
|
||||
&& (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2")))
|
||||
&& (!dStart.HasValue || (x.CompileDate.HasValue && x.CompileDate.Value >= dStart))
|
||||
&& (!dEnd.HasValue || (x.CompileDate.HasValue && x.CompileDate.Value < dEnd)));
|
||||
}
|
||||
else if (meetingType == "W")
|
||||
{
|
||||
pageCount = Funs.DB.Meeting_WeekMeeting.Count(x => x.ProjectId == projectId
|
||||
&& (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2"))));
|
||||
&& (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2")))
|
||||
&& (!dStart.HasValue || (x.CompileDate.HasValue && x.CompileDate.Value >= dStart))
|
||||
&& (!dEnd.HasValue || (x.CompileDate.HasValue && x.CompileDate.Value < dEnd)));
|
||||
}
|
||||
else if (meetingType == "M")
|
||||
{
|
||||
pageCount = Funs.DB.Meeting_MonthMeeting.Count(x => x.ProjectId == projectId
|
||||
&& (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2"))));
|
||||
&& (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2")))
|
||||
&& (!dStart.HasValue || (x.CompileDate.HasValue && x.CompileDate.Value >= dStart))
|
||||
&& (!dEnd.HasValue || (x.CompileDate.HasValue && x.CompileDate.Value < dEnd)));
|
||||
}
|
||||
else if (meetingType == "S")
|
||||
{
|
||||
pageCount = Funs.DB.Meeting_SpecialMeeting.Count(x => x.ProjectId == projectId
|
||||
&& (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2"))));
|
||||
&& (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2")))
|
||||
&& (!dStart.HasValue || (x.CompileDate.HasValue && x.CompileDate.Value >= dStart))
|
||||
&& (!dEnd.HasValue || (x.CompileDate.HasValue && x.CompileDate.Value < dEnd)));
|
||||
}
|
||||
else
|
||||
{
|
||||
pageCount = Funs.DB.Meeting_AttendMeeting.Count(x => x.ProjectId == projectId
|
||||
&& (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2"))));
|
||||
&& (states == null || (states == "0" && (x.States == "0" || x.States == null)) || (states == "1" && (x.States == "1" || x.States == "2")))
|
||||
&& (!dStart.HasValue || (x.CompileDate.HasValue && x.CompileDate.Value >= dStart))
|
||||
&& (!dEnd.HasValue || (x.CompileDate.HasValue && x.CompileDate.Value < dEnd)));
|
||||
}
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
getDataList = APIMeetingService.getMeetingByProjectIdStates(projectId, meetingType, states, pageIndex);
|
||||
getDataList = APIMeetingService.getMeetingByProjectIdStates(projectId, meetingType, states, pageIndex, startDate, endDate);
|
||||
}
|
||||
responeData.data = new { pageCount, getDataList };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user