Commit 4efb0fad by lcx

人事科提交出勤率修改

parent 0b80d627
......@@ -126,7 +126,7 @@ public AutoMapperConfigs()
CreateMap<im_accountbasic, PerDataAccountBaisc>()
.ForMember(dest => dest.UnitType, opt => opt.MapFrom(src => src.UnitType))
.ForMember(dest => dest.UnitType, opt => opt.MapFrom(src => ((UnitType)src.UnitType).ToString()))
.ForMember(dest => dest.AccountingUnit, opt => opt.MapFrom(src => src.DoctorAccountingUnit))
.ForMember(dest => dest.Department, opt => opt.MapFrom(src => src.Department))
.ForMember(dest => dest.ManagerNumber, opt => opt.MapFrom(src => src.DoctorDirectorNumber))
......
......@@ -80,5 +80,10 @@ public class per_allot
/// 是否在抽取数据0 否、1 是、2 抽取成功、3 抽取失败
/// </summary>
public Nullable<int> IsExtracting { get; set; }
/// <summary>
/// 1、人事科提交重新生成 2、生成成功
/// </summary>
public Nullable<int> Generate { get; set; }
}
}
......@@ -53,7 +53,6 @@ public int DeleteResData(int allotId)
"res_baiscnorm",
"res_compute",
"res_specialunit",
"log_check",
"log_dbug",
};
string sql = "";
......
......@@ -20,11 +20,14 @@ namespace Performance.Repository
/// </summary>
public partial class PerforPerallotRepository : PerforRepository<per_allot>
{
public bool UpdateAllotStates(int allotId, int states, string remark)
public bool UpdateAllotStates(int allotId, int states, string remark, bool success)
{
var allot = GetEntity(t => t.ID == allotId);
allot.States = states;
allot.Remark = remark;
if (success && allot.Generate == 1)
allot.Generate = 2;
return Update(allot);
}
......
......@@ -243,9 +243,9 @@ public bool Update(per_allot allot)
}
#endregion
public void UpdateAllotStates(int allotId, int states, string remark)
public void UpdateAllotStates(int allotId, int states, string remark, bool success = false)
{
_allotRepository.UpdateAllotStates(allotId, states, remark);
_allotRepository.UpdateAllotStates(allotId, states, remark, success);
}
/// <summary>
......@@ -260,23 +260,27 @@ public void Generate(per_allot allot, string mail)
{
logManageService.WriteMsg("绩效开始执行", $"正在生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效!", 1, allot.ID, "ReceiveMessage", true);
//configService.Clear(allot.ID);
//// 导出数据
//var excel = importDataService.ReadDataAndSave(allot);
var excel = new PerExcel();
if ((allot.Generate ?? 0) == 1)
{
configService.ClearResData(allot.ID);
var excel = queryDataService.QueryDataAndHeader(allot);
excel = queryDataService.QueryDataAndHeader(allot);
}
else
{
configService.Clear(allot.ID);
// 导出数据
excel = importDataService.ReadDataAndSave(allot);
UpdateAllotStates(allot.ID, (int)AllotStates.InCheckData, EnumHelper.GetDescription(AllotStates.InCheckData));
//if (!checkDataService.Check(excel, allot))
//{
// UpdateAllotStates(allot.ID, (int)AllotStates.CheckFail, EnumHelper.GetDescription(AllotStates.CheckFail));
// //SendEmail(allot, mail, 3, time);
// logManageService.WriteMsg("绩效数据校验失败", "详情可至“更多 -- 查看日志”查看", 3, allot.ID, "ReceiveMessage", true);
// return;
//}
if (!checkDataService.Check(excel, allot))
{
UpdateAllotStates(allot.ID, (int)AllotStates.CheckFail, EnumHelper.GetDescription(AllotStates.CheckFail));
//SendEmail(allot, mail, 3, time);
logManageService.WriteMsg("绩效数据校验失败", "详情可至“更多 -- 查看日志”查看", 3, allot.ID, "ReceiveMessage", true);
return;
}
}
UpdateAllotStates(allot.ID, (int)AllotStates.InGenerate, EnumHelper.GetDescription(AllotStates.InGenerate));
//保底绩效计算需分两次进行;
......@@ -337,7 +341,7 @@ public void Generate(per_allot allot, string mail)
logManageService.WriteMsg("正在生成绩效", "保存绩效人均参考标准", 1, allot.ID, "ReceiveMessage", true);
perforResbaiscnormRepository.AddRange(baiscnormList.ToArray());
UpdateAllotStates(allot.ID, (int)AllotStates.GenerateAccomplish, EnumHelper.GetDescription(AllotStates.GenerateAccomplish));
UpdateAllotStates(allot.ID, (int)AllotStates.GenerateAccomplish, EnumHelper.GetDescription(AllotStates.GenerateAccomplish), true);
perforCofdirectorRepository.SupplementaryData(allot.ID);
logManageService.WriteMsg("正在生成报表数据", "正在生成报表数据", 1, allot.ID, "ReceiveMessage", true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment