小程序,本人记分流水日志
This commit is contained in:
@@ -73,6 +73,17 @@ namespace BLL
|
||||
return (from x in Funs.DB.ScoreFlowLog where x.IdentityCard == IdentityCard && x.Year == year && x.CompileDate > compliedate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据年份、身份证号码获取人员流水日志记录
|
||||
/// </summary>
|
||||
/// <param name="IdentityCard"></param>
|
||||
/// <param name="year"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ScoreFlowLog> GetScoreLogByIdentityCard(int year, string IdentityCard)
|
||||
{
|
||||
return (from x in Funs.DB.ScoreFlowLog where x.IdentityCard == IdentityCard && x.Year == year orderby x.CompileDate descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加人员记分流水
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
public class ScoreFlowLogItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public int Type { get; set; }
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string TypeName { get; set; }
|
||||
/// <summary>
|
||||
/// 加分/扣分值
|
||||
/// </summary>
|
||||
public int Score { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 记分后分值
|
||||
/// </summary>
|
||||
public int CurrentScore { get; set; }
|
||||
/// <summary>
|
||||
/// 记分事项
|
||||
/// </summary>
|
||||
public string Item { get; set; }
|
||||
/// <summary>
|
||||
/// 记分内容
|
||||
/// </summary>
|
||||
public string LogContent { get; set; }
|
||||
/// <summary>
|
||||
/// 记分时间
|
||||
/// </summary>
|
||||
public DateTime CompileDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -124,6 +124,7 @@
|
||||
<Compile Include="APIItem\HSSE\NextFlowOperateItem.cs" />
|
||||
<Compile Include="APIItem\HSSE\NoticeItem.cs" />
|
||||
<Compile Include="APIItem\HSSE\PauseNoticeItem.cs" />
|
||||
<Compile Include="APIItem\HSSE\ScoreFlowLogItem.cs" />
|
||||
<Compile Include="APIItem\HSSE\PersonInOutItem.cs" />
|
||||
<Compile Include="APIItem\HSSE\PersonInfoItem.cs" />
|
||||
<Compile Include="APIItem\HSSE\PersonItem.cs" />
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using BLL;
|
||||
using Aspose.Words.Lists;
|
||||
using BLL;
|
||||
using Microsoft.SqlServer.Server;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
|
||||
@@ -51,6 +54,67 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据personid获取人员HSE积分流水记录
|
||||
/// </summary>
|
||||
/// <param name="year">年份</param>
|
||||
/// <param name="personId">人员id</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getScoreLogByPersonId(int year, string personId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var personData = APIPersonService.getPersonByPersonId(personId);
|
||||
List<ScoreFlowLogItem> lstLog = new List<ScoreFlowLogItem>();
|
||||
if (personData != null && !string.IsNullOrWhiteSpace(personData.IdentityCard))
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(personData.IdentityCard))
|
||||
{
|
||||
string identityCard = personData.IdentityCard;
|
||||
if (year < 2025 || year == null)
|
||||
{
|
||||
year = DateTime.Now.Year;
|
||||
}
|
||||
var logs = ScoreFlowLogService.GetScoreLogByIdentityCard(year, personData.IdentityCard);
|
||||
foreach (var obj in logs)
|
||||
{
|
||||
var data = new ScoreFlowLogItem();
|
||||
data.Type = obj.Type;
|
||||
data.TypeName = obj.Type == 1 ? "加分" : "扣分";
|
||||
data.Score = obj.Score;
|
||||
data.CurrentScore = obj.CurrentScore;
|
||||
data.Item = obj.Item;
|
||||
data.LogContent = obj.LogContent;
|
||||
data.CompileDate = obj.CompileDate;
|
||||
data.Remark = !string.IsNullOrWhiteSpace(obj.Remark) ? obj.Remark : string.Empty;
|
||||
lstLog.Add(data);
|
||||
}
|
||||
//responeData.data = logs;
|
||||
responeData.data = lstLog;
|
||||
}
|
||||
else
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "身份证件号码为空!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "请确定人员是否存在!";
|
||||
}
|
||||
//responeData.data = lstLog;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据personid获取人员信息
|
||||
|
||||
Reference in New Issue
Block a user