获取子页 隐患治理
This commit is contained in:
parent
385b7c9cf1
commit
030716e9ad
@ -728,7 +728,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
||||
try
|
||||
{
|
||||
string strConn = OPTenantDBConnService.GetConnByORGID(filter.OrgId.Value);
|
||||
DataSet ds = DBHelper.ExecProcedure(strConn, "proc_HomeTeamMeetingRecord", dic, HttpContext.Request.Path);
|
||||
DataSet ds = DBHelper.ExecProcedure(strConn, "proc_HomeSubTeamMeetingRecord", dic, HttpContext.Request.Path);
|
||||
double percent = 0;
|
||||
if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
|
||||
{
|
||||
@ -747,5 +747,147 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
||||
return listResult;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取子页 隐患治理
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
[HttpPost, Route("HiddenManage")]
|
||||
public JsonActionResult<HiddenManage> HiddenManage([FromBody] KeywordFilter filter)
|
||||
{
|
||||
return SafeExecute(() =>
|
||||
{
|
||||
//Parameter1 传入 年份(搜索年份对应任意时间) 不传取 对应月份的时间
|
||||
//Parameter2 传入 月份(搜索月份对应任意时间) 不传 取当前时间
|
||||
//Parameter3 传入 ORGID 如果有
|
||||
Dictionary<string, object> dic = new Dictionary<string, object>();
|
||||
DateTime dtSecrch = DateTime.Now;
|
||||
string ORGID = "";
|
||||
if (!string.IsNullOrEmpty(filter.Parameter2))
|
||||
{
|
||||
try
|
||||
{
|
||||
dtSecrch = Convert.ToDateTime(Convert.ToDateTime(filter.Parameter2).ToString("yyyy-MM-01 00:00:00"));
|
||||
}
|
||||
catch
|
||||
{
|
||||
dtSecrch = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-01 00:00:00"));
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Parameter3))
|
||||
{
|
||||
try
|
||||
{
|
||||
ORGID = (new Guid(filter.Parameter3)).ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
ORGID = "";
|
||||
}
|
||||
}
|
||||
|
||||
dic.Add("@dtMonthMin", dtSecrch.ToString("yyyy-MM-dd 00:00:00"));
|
||||
dic.Add("@dtMonthMax", dtSecrch.AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
dic.Add("@OrgId", ORGID.ToString());
|
||||
|
||||
if (!string.IsNullOrEmpty(filter.Parameter1))
|
||||
{
|
||||
try
|
||||
{
|
||||
dtSecrch = Convert.ToDateTime(filter.Parameter1);
|
||||
}
|
||||
catch
|
||||
{
|
||||
dtSecrch = DateTime.Now;
|
||||
}
|
||||
}
|
||||
dic.Add("@dtMin", dtSecrch.ToString("yyyy-01-01 00:00:00"));
|
||||
if (dtSecrch.Year == DateTime.Now.Year)
|
||||
{
|
||||
dic.Add("@dtMax", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
dic.Add("@dtMax", dtSecrch.ToString("yyyy-12-31 23:59:59"));
|
||||
}
|
||||
|
||||
HiddenManage listResult = new HiddenManage();
|
||||
try
|
||||
{
|
||||
string strConn = OPTenantDBConnService.GetConnByORGID(filter.OrgId.Value);
|
||||
DataSet ds = DBHelper.ExecProcedure(strConn, "proc_HomeSubHiddenManage", dic, HttpContext.Request.Path);
|
||||
double percent = 0;
|
||||
if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
|
||||
{
|
||||
List<dynamic> listHiddenOrder = new List<dynamic>();
|
||||
int NUM = 1;
|
||||
foreach (DataRow item in ds.Tables[0].Rows)
|
||||
{
|
||||
listHiddenOrder.Add(new
|
||||
{
|
||||
NUM = NUM,
|
||||
hiddenName = item[0],
|
||||
qty = item[1],
|
||||
});
|
||||
NUM++;
|
||||
}
|
||||
listResult.listHiddenOrder = listHiddenOrder;
|
||||
if (string.IsNullOrEmpty(ORGID))
|
||||
{
|
||||
//全部搜索 3张表
|
||||
List<dynamic> listHidden = new List<dynamic>();
|
||||
DataTable dt = ds.Tables[1];
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
listHidden.Add(new
|
||||
{
|
||||
companyName = item["companyName"],
|
||||
generalCount = item["generalCount"],
|
||||
majorCount = item["majorCount"],
|
||||
});
|
||||
}
|
||||
listResult.listHidden = listHidden;
|
||||
|
||||
List<dynamic> listHiddenDoneMonth = new List<dynamic>();
|
||||
dt = ds.Tables[2];
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
listHiddenDoneMonth.Add(new
|
||||
{
|
||||
companyName = item["companyName"],
|
||||
generalCount = item["generalCount"],
|
||||
majorCount = item["majorCount"],
|
||||
majorCountNo = item["majorCountNo"],
|
||||
generalCountNo = item["generalCountNo"],
|
||||
});
|
||||
}
|
||||
listResult.listHiddenDoneMonth = listHiddenDoneMonth;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return listResult;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐患治理 返参
|
||||
/// </summary>
|
||||
public class HiddenManage
|
||||
{
|
||||
/// <summary>
|
||||
/// 隐患数量统计
|
||||
/// </summary>
|
||||
public List<dynamic> listHidden { get; set; }
|
||||
/// <summary>
|
||||
/// 月度隐患处理统计
|
||||
/// </summary>
|
||||
public List<dynamic> listHiddenDoneMonth { get; set; }
|
||||
/// <summary>
|
||||
/// 隐患排序
|
||||
/// </summary>
|
||||
public List<dynamic> listHiddenOrder { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user