Commit 4efb0fad by lcx

人事科提交出勤率修改

parent 0b80d627
...@@ -126,7 +126,7 @@ public AutoMapperConfigs() ...@@ -126,7 +126,7 @@ public AutoMapperConfigs()
CreateMap<im_accountbasic, PerDataAccountBaisc>() 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.AccountingUnit, opt => opt.MapFrom(src => src.DoctorAccountingUnit))
.ForMember(dest => dest.Department, opt => opt.MapFrom(src => src.Department)) .ForMember(dest => dest.Department, opt => opt.MapFrom(src => src.Department))
.ForMember(dest => dest.ManagerNumber, opt => opt.MapFrom(src => src.DoctorDirectorNumber)) .ForMember(dest => dest.ManagerNumber, opt => opt.MapFrom(src => src.DoctorDirectorNumber))
......
...@@ -80,5 +80,10 @@ public class per_allot ...@@ -80,5 +80,10 @@ public class per_allot
/// 是否在抽取数据0 否、1 是、2 抽取成功、3 抽取失败 /// 是否在抽取数据0 否、1 是、2 抽取成功、3 抽取失败
/// </summary> /// </summary>
public Nullable<int> IsExtracting { get; set; } 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) ...@@ -53,7 +53,6 @@ public int DeleteResData(int allotId)
"res_baiscnorm", "res_baiscnorm",
"res_compute", "res_compute",
"res_specialunit", "res_specialunit",
"log_check",
"log_dbug", "log_dbug",
}; };
string sql = ""; string sql = "";
......
...@@ -20,11 +20,14 @@ namespace Performance.Repository ...@@ -20,11 +20,14 @@ namespace Performance.Repository
/// </summary> /// </summary>
public partial class PerforPerallotRepository : PerforRepository<per_allot> 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); var allot = GetEntity(t => t.ID == allotId);
allot.States = states; allot.States = states;
allot.Remark = remark; allot.Remark = remark;
if (success && allot.Generate == 1)
allot.Generate = 2;
return Update(allot); return Update(allot);
} }
......
...@@ -243,9 +243,9 @@ public bool Update(per_allot allot) ...@@ -243,9 +243,9 @@ public bool Update(per_allot allot)
} }
#endregion #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> /// <summary>
...@@ -260,23 +260,27 @@ public void Generate(per_allot allot, string mail) ...@@ -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); logManageService.WriteMsg("绩效开始执行", $"正在生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效!", 1, allot.ID, "ReceiveMessage", true);
//configService.Clear(allot.ID); var excel = new PerExcel();
//// 导出数据 if ((allot.Generate ?? 0) == 1)
//var excel = importDataService.ReadDataAndSave(allot); {
configService.ClearResData(allot.ID);
excel = queryDataService.QueryDataAndHeader(allot);
configService.ClearResData(allot.ID); }
var excel = queryDataService.QueryDataAndHeader(allot); else
{
UpdateAllotStates(allot.ID, (int)AllotStates.InCheckData, EnumHelper.GetDescription(AllotStates.InCheckData)); configService.Clear(allot.ID);
//if (!checkDataService.Check(excel, allot)) // 导出数据
//{ excel = importDataService.ReadDataAndSave(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.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;
}
}
UpdateAllotStates(allot.ID, (int)AllotStates.InGenerate, EnumHelper.GetDescription(AllotStates.InGenerate)); UpdateAllotStates(allot.ID, (int)AllotStates.InGenerate, EnumHelper.GetDescription(AllotStates.InGenerate));
//保底绩效计算需分两次进行; //保底绩效计算需分两次进行;
...@@ -337,7 +341,7 @@ public void Generate(per_allot allot, string mail) ...@@ -337,7 +341,7 @@ public void Generate(per_allot allot, string mail)
logManageService.WriteMsg("正在生成绩效", "保存绩效人均参考标准", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "保存绩效人均参考标准", 1, allot.ID, "ReceiveMessage", true);
perforResbaiscnormRepository.AddRange(baiscnormList.ToArray()); 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); perforCofdirectorRepository.SupplementaryData(allot.ID);
logManageService.WriteMsg("正在生成报表数据", "正在生成报表数据", 1, allot.ID, "ReceiveMessage", true); 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