Commit 5f9204fa by lcx

二次绩效提交审核,后端进行金额校验

parent e7d020d7
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
此文件由 Web 项目的发布/打包过程使用。可以通过编辑此 MSBuild 文件
自定义此过程的行为。为了解与此相关的更多内容,请访问 https://go.microsoft.com/fwlink/?LinkID=208121。
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<DeleteExistingFiles>True</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\netcoreapp2.2\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<TargetFramework>netcoreapp2.2</TargetFramework>
<ProjectGuid>3ae00ff5-f0ba-4d72-a23b-770186309327</ProjectGuid>
<SelfContained>false</SelfContained>
<_IsPortable>true</_IsPortable>
<publishUrl>D:\publish\jx.suvalue.com2</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
</Project>
\ No newline at end of file
......@@ -1829,6 +1829,11 @@
绩效Id
</summary>
</member>
<member name="P:Performance.DtoModels.AccoungingRequest.HospitalId">
<summary>
绩效Id
</summary>
</member>
<member name="P:Performance.DtoModels.AccoungingRequest.Type">
<summary>
1 返回accounting列表 2 返回核算单元类型 3 返回核算单元
......
......@@ -4306,6 +4306,11 @@
是否在抽取数据0 否、1 是、2 抽取成功、3 抽取失败
</summary>
</member>
<member name="P:Performance.EntityModels.per_allot.ExtractTime">
<summary>
数据抽取起始时间
</summary>
</member>
<member name="P:Performance.EntityModels.per_allot.Generate">
<summary>
1、人事科提交重新生成 2、生成成功 3、原始数据修改
......
......@@ -8,6 +8,11 @@ public class AccoungingRequest
public int AllotId { get; set; }
/// <summary>
/// 绩效Id
/// </summary>
public int HospitalId { get; set; }
/// <summary>
/// 1 返回accounting列表 2 返回核算单元类型 3 返回核算单元
/// </summary>
public int Type { get; set; }
......
......@@ -55,6 +55,8 @@ public SecondAllotResponse GetSecondSavedData(int userId, int secondId, int empl
Workload_Ratio_Default = 0.8m,
DaysFullAttendance = DateTime.DaysInMonth(allot.Year, allot.Month)
};
head.TotalDistPerformance = second.RealGiveFee;
head.PaymentOfTheMonth = $"{allot.Year}{allot.Month.ToString().PadLeft(2, '0')}月";
JObject jObject = JObject.Parse(JsonConvert.SerializeObject(head));
var headDynamic = agworktypesourceRepository.GetEntities(t => t.SecondId == secondId);
if (headDynamic != null && headDynamic.Any())
......
......@@ -1572,14 +1572,14 @@ public bool AuditSubmit(ag_secondallot second, int userId)
if (temp == null)
throw new PerformanceException("选择模板不可用,请确定模板及数据是否存在!");
//bool method(decimal? submitDataAmount, decimal? realGiveFee)
//{
// if (!submitDataAmount.HasValue || !realGiveFee.HasValue)
// return false;
bool VerifySubmissioAmount(decimal? submitDataAmount, decimal? realGiveFee)
{
if (!submitDataAmount.HasValue || !realGiveFee.HasValue)
return false;
// decimal floatValue = 0.5m;
// return submitDataAmount >= (realGiveFee - floatValue) && submitDataAmount <= (realGiveFee + floatValue);
//}
decimal floatValue = 0.1m;
return submitDataAmount >= (realGiveFee - floatValue) && submitDataAmount <= (realGiveFee + floatValue);
}
if (temp.UseTempId == 6)
{
......@@ -1587,9 +1587,9 @@ public bool AuditSubmit(ag_secondallot second, int userId)
if (data == null || !data.Any())
throw new PerformanceException("提交时未检测到数据!");
//var total = data.Sum(t => t.RealAmount);
//if (!method(total, second.RealGiveFee))
// throw new PerformanceException("总金额与考核后金额不一致!");
var total = data.Sum(t => t.DistPerformance + t.NightWorkPerformance); // 其他模板 = 可分配绩效 + 夜班绩效
if (!VerifySubmissioAmount(total, second.RealGiveFee))
throw new PerformanceException($"总金额与考核后金额不一致!可分配金额:{second.RealGiveFee},提交金额:{total}");
}
else if (new int[] { 7, 8 }.Contains(temp.UseTempId.Value))
{
......@@ -1597,16 +1597,20 @@ public bool AuditSubmit(ag_secondallot second, int userId)
if (data == null || !data.Any())
throw new PerformanceException("提交时未检测到数据!");
//var total = data.Where(t => t.ItemName == "实发绩效工资金额" && t.RowNumber > -1).GroupBy(t => t.RowNumber)
// .Sum(t => ConvertHelper.To<decimal>(t.OrderByDescending(o => o.ID).FirstOrDefault().ItemValue));
//if (!method(total, second.RealGiveFee))
// throw new PerformanceException("总金额与考核后金额不一致!");
var total = data.Where(t => new string[] { "可分配绩效", "夜班工作量绩效" }.Contains(t.ItemName) && t.RowNumber > -1).GroupBy(t => t.RowNumber)
.Sum(t => ConvertHelper.To<decimal>(t.OrderByDescending(o => o.ID).FirstOrDefault().ItemValue));
if (!VerifySubmissioAmount(total, second.RealGiveFee))
throw new PerformanceException($"总金额与考核后金额不一致!可分配金额:{second.RealGiveFee},提交金额:{total}");
}
else if (new int[] { 9, 10 }.Contains(temp.UseTempId.Value))
{
var data = agbodysourceRepository.GetEntities(t => t.SecondId == second.Id);
if (data == null || !data.Any())
throw new PerformanceException("提交时未检测到数据!");
var total = data.Sum(t => t.DistPerformance + t.NightWorkPerformance);
if (!VerifySubmissioAmount(total, second.RealGiveFee))
throw new PerformanceException($"总金额与考核后金额不一致!可分配金额:{second.RealGiveFee},提交金额:{total}");
}
second.UseTempId = temp.UseTempId;
second.Status = 2;
......
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