积分优化

This commit is contained in:
2026-10-17 10:34:45 +08:00
parent 29b15d4b54
commit bbd0e6d392
27 changed files with 1054 additions and 335 deletions
+21 -13
View File
@@ -1,5 +1,4 @@
using Model;
using NPOI.SS.UserModel;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -20,7 +19,6 @@ namespace BLL
{
return Funs.DB.ScoreUser.FirstOrDefault(e => e.Id == Id);
}
/// <summary>
/// 根据证件号码获取人员今年上一条得分记录
/// </summary>
@@ -55,17 +53,27 @@ namespace BLL
/// <param name="model">人员得分实体</param>
public static void AddScoreUser(Model.ScoreUser model)
{
Model.ScoreUser newModel = new Model.ScoreUser();
newModel.Id = model.Id;
newModel.Year = model.Year;
newModel.IdentityCard = model.IdentityCard;
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();
var su = Funs.DB.ScoreUser.FirstOrDefault(e => e.IdentityCard == model.IdentityCard && e.Year == model.Year);
if (su != null)
{//已存在,修改人员今年得分值
su.Score = model.Score;
su.CompileDate = model.CompileDate;
Funs.DB.SubmitChanges();
}
else
{
Model.ScoreUser newModel = new Model.ScoreUser();
newModel.Id = model.Id;
newModel.Year = model.Year;
newModel.IdentityCard = model.IdentityCard;
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();
}
}
/// <summary>