This commit is contained in:
geh 2025-12-26 14:50:58 +08:00
parent 24edddf932
commit 3935d557ef
7 changed files with 124 additions and 80 deletions

View File

@ -1,5 +1,4 @@
using FineUIPro;
using Microsoft.SqlServer.Dts.Runtime;
using Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

View File

@ -7,7 +7,6 @@ using System.Linq;
using System.Text;
using Model;
using Newtonsoft.Json;
using Microsoft.SqlServer.Dts.Runtime;
namespace BLL
{

View File

@ -3,7 +3,6 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using FineUIPro;
using Microsoft.SqlServer.Dts.Runtime;
using Model;
using Newtonsoft.Json;

View File

@ -6,6 +6,18 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Title</title>
<style>
.f-grid-row-summary .f-grid-cell-inner
{
font-weight: bold;
color: red;
}
.f-grid-row.yellow
{
background-color: Yellow;
}
</style>
</head>
<body>
<form id="form1" runat="server">
@ -66,9 +78,12 @@
<f:RenderField Width="100px" ColumnID="num" DataField="num"
HeaderText="实际考勤" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Bias" DataField="Bias"
HeaderText="偏差" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:TemplateField Width="100px" HeaderText="偏差" HeaderTextAlign="Center" TextAlign="Left" ColumnID="Bias">
<ItemTemplate>
<asp:Label ID="lbBias" runat="server" Text='<%#ConvertBiasPercent(Eval("Bias")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu"/>

View File

@ -188,6 +188,21 @@ namespace FineUIPro.Web.JDGL.SGManPower
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
// for (int i = 0; i < Grid1.Rows.Count; i++)
// {
// DataRowView dataRow = (DataRowView)Grid1.Rows[i].DataItem;
// if (dataRow != null && dataRow["Bias"] != null)
// {
// if (decimal.TryParse(dataRow["Bias"].ToString(), out decimal bias))
// {
// if (bias > 0.1m)
// {
// Grid1.Rows[i].RowCssClass = "yellow";
// }
// }
// }
// }
}
#endregion
@ -310,6 +325,14 @@ namespace FineUIPro.Web.JDGL.SGManPower
#endregion
// 在页面中添加格式化方法
protected string ConvertBiasPercent(object biasValue)
{
if (biasValue != null && decimal.TryParse(biasValue.ToString(), out decimal value))
{
return (value * 100).ToString("F2") + "%";
}
return "0.00%";
}
}
}

View File

@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// <自动生成>
// 此代码由工具生成。
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.JDGL.SGManPower
@ -15,173 +15,182 @@ namespace FineUIPro.Web.JDGL.SGManPower
{
/// <summary>
/// form1 control.
/// form1 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 control.
/// Panel1 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 control.
/// Grid1 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 control.
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// drpUnit control.
/// drpUnit 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnit;
/// <summary>
/// txtStartTime control.
/// txtStartTime 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStartTime;
/// <summary>
/// txtEndTime control.
/// txtEndTime 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// drpUnitWork control.
/// drpUnitWork 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnitWork;
/// <summary>
/// drpWorkPost control.
/// drpWorkPost 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWorkPost;
/// <summary>
/// ToolbarFill1 control.
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnQuery control.
/// btnQuery 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// lbUnitName control.
/// lbUnitName 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbUnitName;
/// <summary>
/// lbUnitWorkName control.
/// lbUnitWorkName 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbUnitWorkName;
/// <summary>
/// lbtfWorkPostName control.
/// lbtfWorkPostName 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbtfWorkPostName;
/// <summary>
/// ToolbarSeparator1 control.
/// lbBias 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbBias;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 control.
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize control.
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Menu1 control.
/// Menu1 控件。
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
}

View File

@ -144,17 +144,17 @@ namespace FineUIPro.Web
string returnDbHtml = "";
var getDataList = Funs.DB.Sp_WorkBench_GetToDoItems(userId, sType).ToList();
//调人力预警接口
// if (sType != "2")
// {
// var sgList = SGManPowerService.CheckAndSendPersonWarning(userId);
// if (sgList != null)
// {
// foreach (var item in sgList)
// {
// getDataList.Add(item);
// }
// }
// }
if (sType != "2")
{
var sgList = SGManPowerService.CheckAndSendPersonWarning(userId);
if (sgList != null)
{
foreach (var item in sgList)
{
getDataList.Add(item);
}
}
}
//把getDataList和sgList的数据合并
foreach (var item in getDataList)
{