20260817 积分、扣分

This commit is contained in:
2026-08-17 10:43:21 +08:00
parent 9630b5c123
commit 11e9ff62b1
37 changed files with 7022 additions and 26 deletions
+45 -4
View File
@@ -1,4 +1,7 @@
using Model;
using NPOI.SS.UserModel;
using System;
using System.Collections.Generic;
using System.Linq;
namespace BLL
@@ -29,6 +32,23 @@ namespace BLL
return Funs.DB.ScoreUser.Where(e => e.IdentityCard == IdentityCard && e.Year == year).OrderByDescending(x => x.CompileDate).FirstOrDefault();
}
/// <summary>
/// 根据数据来源id获取人员计分记录
/// </summary>
/// <param name="IdentityCard"></param>
/// <param name="year"></param>
/// <param name="dataSourceId"></param>
/// <returns></returns>
public static Model.ScoreUser GetScoreUserByDataSourceId(string IdentityCard, int year, string dataSourceId)
{
return Funs.DB.ScoreUser.FirstOrDefault(e => e.IdentityCard == IdentityCard && e.Year == year && e.DataSourceId == dataSourceId);
}
public static List<Model.ScoreUser> GetScoreUserByCompileDate(string IdentityCard, int year, DateTime compliedate)
{
return (from x in Funs.DB.ScoreUser where x.IdentityCard == IdentityCard && x.Year == year && x.CompileDate > compliedate select x).ToList();
}
/// <summary>
/// 增加人员得分
/// </summary>
@@ -42,6 +62,8 @@ namespace BLL
newModel.UserName = model.UserName;
newModel.Score = model.Score;
newModel.CompileDate = model.CompileDate;
newModel.DataSourceId = model.DataSourceId;
newModel.CheckDate = model.CheckDate;
Funs.DB.ScoreUser.InsertOnSubmit(newModel);
Funs.DB.SubmitChanges();
}
@@ -56,11 +78,13 @@ namespace BLL
if (newModel != null)
{
//newModel.Id = model.Id;
//newModel.Year = model.Year;
//newModel.IdentityCard = model.IdentityCard;
//newModel.UserName = model.UserName;
newModel.Year = model.Year;
newModel.IdentityCard = model.IdentityCard;
newModel.UserName = model.UserName;
newModel.Score = model.Score;
newModel.CompileDate = model.CompileDate;
//newModel.CompileDate = model.CompileDate;
newModel.DataSourceId = model.DataSourceId;
newModel.CheckDate = model.CheckDate;
Funs.DB.SubmitChanges();
}
}
@@ -80,5 +104,22 @@ namespace BLL
db.SubmitChanges();
}
}
/// <summary>
/// 根据数据来源Id删除人员得分记录
/// </summary>
/// <param name="IdentityCard"></param>
/// <param name="year"></param>
/// <param name="dataSourceId"></param>
public static void DeleteScoreUserByDataSourceId(string IdentityCard, int year, string dataSourceId)
{
var db = Funs.DB;
Model.ScoreUser model = db.ScoreUser.FirstOrDefault(e => e.IdentityCard == IdentityCard && e.Year == year && e.DataSourceId == dataSourceId);
if (model != null)
{
db.ScoreUser.DeleteOnSubmit(model);
db.SubmitChanges();
}
}
}
}