日常巡检、班前会统计
This commit is contained in:
@@ -169,5 +169,22 @@ namespace WebAPI.Controllers
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 按项目和检查日期获取日常巡检
|
||||
public Model.ResponeData getHazardRegisterByProjectIdStates(string projectId, string date)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIHazardRegisterService.getHazardRegisterByProjectIdStates(projectId, date);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
@@ -94,6 +96,25 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据ID删除会议
|
||||
[HttpDelete]
|
||||
public Model.ResponeData DeleteMeeting(string meetingId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
BLL.ClassMeetingService.DeleteClassMeetingById(meetingId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存Meeting
|
||||
/// <summary>
|
||||
/// 保存Meeting
|
||||
@@ -118,6 +139,74 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 班前会参加人数统计
|
||||
public Model.ResponeData getClassMeetingPersonCount(string projectId, string meetingDate)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
|
||||
// 1、获取项目用户(管理人员数量)
|
||||
string projectUserSQL = "SELECT * FROM [dbo].[Project_ProjectUser] as pu LEFT JOIN [dbo].[Sys_User] as u on u.UserId = pu.UserId WHERE pu.ProjectId = @ProjectId;";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", projectId));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable userTb = SQLHelper.GetDataTableRunText(projectUserSQL, parameter);
|
||||
// 2、 获取班前会列表(日期过滤)
|
||||
List<Model.MeetingItem> classMettingList = APIMeetingService.getClassMeetingList(projectId, meetingDate);
|
||||
int personCount = 0;
|
||||
classMettingList.ForEach(item =>
|
||||
{
|
||||
personCount += item.AttentPersonNum;
|
||||
});
|
||||
responeData.data = new
|
||||
{
|
||||
manager = userTb.Rows.Count,
|
||||
personCount = personCount,
|
||||
classMettingList = classMettingList
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 公司级班前会人员统计
|
||||
public Model.ResponeData getCompanyMeetingPersonCounts( string meetingDate)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
|
||||
string sql = "SELECT p.ProjectId as projectId, p.ProjectName as projectName,(SELECT count(*) FROM [dbo].[Project_ProjectUser] as pu LEFT JOIN [dbo].[Sys_User] as u on u.UserId = pu.UserId WHERE pu.ProjectId = p.ProjectId) as manager,(SELECT SUM(AttentPersonNum) as cpunt FROM [dbo].[Meeting_ClassMeeting] as mc WHERE mc.ProjectId = p.ProjectId AND Year(ClassMeetingDate) = @year AND Month(ClassMeetingDate) = @month AND Day(ClassMeetingDate) = @day) as personCount FROM [dbo].[Base_Project] as p;";
|
||||
DateTime mdate = Funs.GetNewDateTimeOrNow(meetingDate);
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@year", mdate.Year));
|
||||
listStr.Add(new SqlParameter("@month", mdate.Month));
|
||||
listStr.Add(new SqlParameter("@day", mdate.Day));
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter);
|
||||
responeData.data = tb;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据时间获取各单位班会情况
|
||||
/// <summary>
|
||||
/// 根据时间获取各单位班会情况
|
||||
|
||||
@@ -6,6 +6,7 @@ using BLL.OfficeCheck.Inspect;
|
||||
using Model;
|
||||
using static BLL.OfficeCheck.Inspect.Inspect_InspectionService;
|
||||
using System.Collections.Generic;
|
||||
using static WebAPI.Controllers.HSSE.ImageRecognitionController;
|
||||
|
||||
namespace WebAPI.Controllers.HSSE
|
||||
{
|
||||
@@ -179,8 +180,33 @@ namespace WebAPI.Controllers.HSSE
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#region 保存专检子项
|
||||
[HttpPost]
|
||||
public Model.ResponeData SaveInspectionChild(Model.Inspect_InspectionItem child)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(child.InspectionItemId))
|
||||
{
|
||||
child.InspectionItemId = Guid.NewGuid().ToString();
|
||||
child.CompileTime = DateTime.Now;
|
||||
Inspect_InspectionService.AddInspectionItem(child);
|
||||
}
|
||||
else
|
||||
{
|
||||
Inspect_InspectionService.UpdateInspectionItem(child);
|
||||
}
|
||||
} catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
//编辑 新增明细
|
||||
[HttpPost]
|
||||
public Model.ResponeData SaveInspectionItem([FromBody] List<Model.Inspect_InspectionItem> InspectionItems)
|
||||
@@ -241,6 +267,8 @@ namespace WebAPI.Controllers.HSSE
|
||||
TimeLimited = x.TimeLimited,
|
||||
RectificationDescription = x.RectificationDescription,
|
||||
RectificationResults = x.RectificationResults,
|
||||
RectificationPhotoUrl = x.RectificationPhotoUrl,
|
||||
RectificationVideoUrl = x.RectificationVideoUrl,
|
||||
States = x.States,
|
||||
CompileMan = subUser1.UserName,
|
||||
CompileTime = x.CompileTime,
|
||||
|
||||
Reference in New Issue
Block a user