小程序,本人记分流水日志
This commit is contained in:
@@ -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