首页报表处理

存储过程 没参数调用方法处理
This commit is contained in:
wyw 2026-04-23 16:34:15 +08:00
parent ddabeb763a
commit cb75413ecd
7 changed files with 139780 additions and 7 deletions

View File

@ -44,7 +44,7 @@ namespace APT.BaseData.Domain.Entities
[Description("结束日期")]
[FormFieldEdit]
[FormFieldTable]
public DateTime END { get; set; }
public DateTime? END { get; set; }
/// <summary>
/// 正文

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace APT.Data.Migrations.Migrations
{
public partial class wyw2026042303 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "END",
table: "T_PF_ANNOURCEMENT",
type: "datetime2",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime2");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "END",
table: "T_PF_ANNOURCEMENT",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "datetime2",
oldNullable: true);
}
}
}

View File

@ -11521,7 +11521,7 @@ namespace APT.Data.Migrations.Migrations
b.Property<int>("ENABLE_STATUS")
.HasColumnType("int");
b.Property<DateTime>("END")
b.Property<DateTime?>("END")
.HasColumnType("datetime2");
b.Property<int>("ENTITY_ORG_TPYE")

View File

@ -55,12 +55,15 @@ namespace APT.PF.WebApiControllers.Api.PF
entity.Nav_Files = null;
var Nav_Orgs = entity.Nav_Orgs;
entity.Nav_Orgs = null;
if (entity.END < entity.START)
if (entity.END.HasValue && entity.END.Value < entity.START)
{
throw new Exception("结束日期不能小于开始日期!");
}
entity.START = entity.START.Date;
entity.END = entity.END.Date.AddDays(1).AddSeconds(-1);
if (entity.END.HasValue)
{
entity.END = entity.END.Value.Date.AddDays(1).AddSeconds(-1);
}
foreach (var item in Nav_Orgs)
{
item.Nav_OrgSub = null;

View File

@ -2,6 +2,7 @@
using APT.BaseData.Domain.Entities.FM;
using APT.BaseData.Domain.Entities.OP;
using APT.BaseData.Domain.Enums;
using APT.BaseData.Domain.Enums.PF;
using APT.BaseData.Domain.IServices.FM;
using APT.BaseData.Domain.IServices.OP;
using APT.BaseData.Services.Services.FM;
@ -63,7 +64,6 @@ namespace APT.SC.WebApi.Controllers.Api.BI
List<int> MonthRecordCount = new List<int>();
List<int> MonthPersonCount = new List<int>();
Dictionary<string, object> dic = new Dictionary<string, object>();
DateTime dtSecrch = DateTime.Now;
if (!string.IsNullOrEmpty(filter.Keyword))
@ -168,6 +168,95 @@ namespace APT.SC.WebApi.Controllers.Api.BI
result.MonthRecordCount = MonthRecordCount;
result.MonthPersonCount = MonthPersonCount;
result.Msg = "培训类型listNAME 与 各数量对应 年度数量YearCount灰色 培训场次MonthRecordCount黄色 培训人次MonthPersonCount蓝色";
//首页中间显示信息
DataSet dsHead = DBHelper.ExecProcedure(strConn, "proc_HomeHeadShowInfo", null, HttpContext.Request.Path);
if (dsHead != null && dsHead.Tables.Count > 0)
{
DataTable dtTitle = dsHead.Tables[0];
if (dtTitle != null && dtTitle.Rows.Count > 0)
{
result.TITLE = dtTitle.Rows[0][0].ToString();
}
DataTable dtAnn = dsHead.Tables[1];
if (dtAnn != null && dtAnn.Rows.Count > 0)
{
result.listAnnourcement = new List<T_PF_ANNOURCEMENT>();
foreach (DataRow item in dtAnn.Rows)
{
try
{
result.listAnnourcement.Add(new T_PF_ANNOURCEMENT()
{
ID = new Guid(item[0].ToString()),
TITLE = item[1].ToString(),
CREATE_TIME = Convert.ToDateTime(item[2].ToString())
}); ;
}
catch { }
}
}
DataTable dtVMSet = dsHead.Tables[2];
if (dtVMSet != null && dtVMSet.Rows.Count > 0)
{
result.playSet = new T_PF_BIPLAY_SET();
string colVal = string.Empty;
try
{
colVal = dtVMSet.Rows[0][0].ToString().Trim();
result.playSet.V_ISAUTO = string.IsNullOrEmpty(colVal) ? true : Convert.ToBoolean(colVal);
colVal = dtVMSet.Rows[0][1].ToString().Trim();
result.playSet.V_ISRE = string.IsNullOrEmpty(colVal) ? true : Convert.ToBoolean(colVal);
colVal = dtVMSet.Rows[0][2].ToString().Trim();
result.playSet.V_ISSILENT = string.IsNullOrEmpty(colVal) ? true : Convert.ToBoolean(colVal);
colVal = dtVMSet.Rows[0][3].ToString().Trim();
result.playSet.V_ISSHOWCONTROL = string.IsNullOrEmpty(colVal) ? true : Convert.ToBoolean(colVal);
colVal = dtVMSet.Rows[0][4].ToString().Trim();
result.playSet.IMG_TIMESPAN = string.IsNullOrEmpty(colVal) ? 2 : Convert.ToDecimal(colVal);
colVal = dtVMSet.Rows[0][5].ToString().Trim();
result.playSet.IMG_ISRE = string.IsNullOrEmpty(colVal) ? true : Convert.ToBoolean(colVal);
colVal = dtVMSet.Rows[0][6].ToString().Trim();
if (string.IsNullOrEmpty(colVal))
{
colVal = "0";
}
result.playSet.IMG_EFFECT = (BaseData.Domain.Enums.PF.EFFECTEnum)int.Parse(colVal);
}
catch { }
}
//播放信息
DataTable dtVM = dsHead.Tables[3];
if (dtVM != null && dtVM.Rows.Count > 0)
{
result.listVideoImg = new List<dynamic>();
FILETYPEEnum TYPE = (FILETYPEEnum)int.Parse(dtVM.Rows[0][0].ToString());
string TITLE = dtVM.Rows[0][1].ToString();
foreach (DataRow item in dtVM.Rows)
{
try
{
result.listVideoImg.Add(new
{
TYPE = TYPE,
TITLE = TITLE,
FILE_PATH = item[2].ToString(),
VIDEOIMG_ID = new Guid(item[3].ToString().Trim())
});
}
catch { }
}
}
}
return result;
});
}
@ -642,6 +731,16 @@ namespace APT.SC.WebApi.Controllers.Api.BI
public List<int> MonthPersonCount { get; set; }
public string Msg { get; set; }
public string TITLE { get; set; }
public List<T_PF_ANNOURCEMENT> listAnnourcement { get; set; }
public T_PF_BIPLAY_SET playSet { get; set; }
public List<dynamic> listVideoImg { get; set; }
}
/// <summary>

View File

@ -37,9 +37,12 @@ namespace APT.Utility
using (SqlCommand Com = new SqlCommand(sql, connection))
{
Com.CommandType = CommandType.StoredProcedure;
foreach (var item in dicParms)
if (dicParms != null)
{
Com.Parameters.Add(new SqlParameter(item.Key, item.Value));
foreach (var item in dicParms)
{
Com.Parameters.Add(new SqlParameter(item.Key, item.Value));
}
}
using (var adapter = new SqlDataAdapter(Com))
{