Commit f2dade06 by 钟博

新增划拨报表

parent cc2b2d1f
...@@ -144,5 +144,24 @@ public ApiResponse UpdateApplicat([FromBody] CostTransferUpdateRequest request) ...@@ -144,5 +144,24 @@ public ApiResponse UpdateApplicat([FromBody] CostTransferUpdateRequest request)
costTransferService.UpdateApplicat(request); costTransferService.UpdateApplicat(request);
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
/// <summary>
/// 划拨报表
/// </summary>
/// <param name="allotId"></param>
/// <param name="auditType"></param>
/// <param name="detail"></param>
/// <returns></returns>
[Route("transfercontent/{allotId}/auditType/{auditType}")]
[HttpPost]
public ApiResponse TransferContent(int allotId,int auditType ,[FromBody] DepartmentDetail detail)
{
if (allotId <= 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var result=costTransferService.TransferContent(allotId,auditType,detail);
return new ApiResponse(ResponseType.OK,result);
}
} }
} }
...@@ -738,6 +738,15 @@ ...@@ -738,6 +738,15 @@
<param name="request"></param> <param name="request"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.CostTransferController.TransferContent(System.Int32,System.Int32,Performance.DtoModels.DepartmentDetail)">
<summary>
划拨报表
</summary>
<param name="allotId"></param>
<param name="auditType"></param>
<param name="detail"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.EmployeeController.GetEmployeeList(Performance.DtoModels.EmployeeRequest)"> <member name="M:Performance.Api.Controllers.EmployeeController.GetEmployeeList(Performance.DtoModels.EmployeeRequest)">
<summary> <summary>
获取人员列表 获取人员列表
......
...@@ -163,9 +163,6 @@ ...@@ -163,9 +163,6 @@
<member name="F:Performance.DtoModels.AllotStates.GenerateAccomplish"> <member name="F:Performance.DtoModels.AllotStates.GenerateAccomplish">
<summary> 绩效结果解析成功 </summary> <summary> 绩效结果解析成功 </summary>
</member> </member>
<member name="F:Performance.DtoModels.AllotStates.Issue">
<summary> 下发 </summary>
</member>
<member name="F:Performance.DtoModels.AgWorkloadType.SingleAwards"> <member name="F:Performance.DtoModels.AgWorkloadType.SingleAwards">
<summary> <summary>
单项奖励 单项奖励
......
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class TransferReportResponse
{
public int Id { get; set; }
public string ApplicantUnitType { get; set; }
public string ApplicantDepartment { get; set; }
public decimal? AmountSum { get; set; }
public string AdoptedUnitType { get; set; }
public string AdoptedDepartment { get; set; }
public decimal? PassAmountSum { get; set; }
public List<TransferItem> Items { get; set; }
}
public class TransferItem : cost_transfer_item
{
public string ApplicantUnitType { get; set; }
public string ApplicantDepartment { get; set; }
public string AdoptedUnitType { get; set; }
public string AdoptedDepartment { get; set; }
}
}
...@@ -129,7 +129,7 @@ public List<CostTransferResponse> GetAuditList(int allotId, int menuType, int ro ...@@ -129,7 +129,7 @@ public List<CostTransferResponse> GetAuditList(int allotId, int menuType, int ro
ApplicantDepartment = result.ApplicantDepartment, ApplicantDepartment = result.ApplicantDepartment,
AdoptedDepartment = result.AdoptedDepartment AdoptedDepartment = result.AdoptedDepartment
}).OrderBy(t=>t.Status).ThenBy(t=>t.AdminStatus).ToList(); }).OrderBy(t => t.Status).ThenBy(t => t.AdminStatus).ToList();
response.Add(result); response.Add(result);
} }
...@@ -648,17 +648,54 @@ public void UpdateCostTransferStatus(int transferId) ...@@ -648,17 +648,54 @@ public void UpdateCostTransferStatus(int transferId)
#region 划拨报表 #region 划拨报表
public void ApplicationContent(int allotId, int auditType) public List<TransferReportResponse> TransferContent(int allotId,int auditType,DepartmentDetail detail)
{ {
var transfers = costtransferRepository.GetEntities(t => t.AllotId == allotId && t.Status != 3 && t.AdminStatus != 3); var transfers = costtransferRepository.GetEntities(t => t.AllotId == allotId && t.Status != 3 && t.AdminStatus != 3);
if (transfers == null || !transfers.Any()) return; if (transfers == null || !transfers.Any()) return new List<TransferReportResponse>();
var transferItems = costtransferitemRepository.GetEntities(t => transfers.Select(w => w.Id).Contains(t.TransferId) var transferItems = costtransferitemRepository.GetEntities(t => transfers.Select(w => w.Id).Contains(t.TransferId));
&& t.Status == 1 && t.AdminStatus == 1);
if (transferItems == null || !transferItems.Any()) return;
if (transferItems == null || !transferItems.Any()) return new List<TransferReportResponse>();
var allItems = transferItems.Where(t => t.Status == 1 && t.AdminStatus == 1);
var finalTransfer = transfers.Where(t => allItems.Select(w => w.TransferId).Distinct().Contains(t.Id));
var transferContent = finalTransfer.Select(t => new TransferReportResponse
{
ApplicantDepartment = t.ApplicantDepartment,
ApplicantUnitType = t.ApplicantUnitType,
AmountSum =transferItems.Where(w => w.TransferId == t.Id)?.Sum(w => w.CalculationAmount.Value),
AdoptedDepartment = t.AdoptedDepartment,
AdoptedUnitType = t.AdoptedUnitType,
PassAmountSum = allItems.Where(w => w.TransferId == t.Id)?.Sum(w => w.CalculationAmount.Value),
Items = allItems.Where(c => c.TransferId == t.Id).Select(c => new TransferItem
{
ApplicantDepartment = t.ApplicantDepartment,
ApplicantUnitType = t.ApplicantUnitType,
AdoptedDepartment = t.AdoptedDepartment,
AdoptedUnitType = t.AdoptedUnitType,
IsUseRatio = c.IsUseRatio,
Source = c.Source,
Category = c.Category,
Ratio = c.Ratio,
CalculationAmount = c.CalculationAmount
}).OrderBy(c => c.TransferId).ToList()
}).ToList();
switch (auditType)
{
case 1:
transferContent = transferContent.Where(t => t.AdoptedDepartment == detail.Department && t.AdoptedUnitType == detail?.UnitType).ToList();
break;
case 2:
transferContent = transferContent.Where(t => t.ApplicantDepartment == detail.Department && t.ApplicantUnitType == detail?.UnitType).ToList();
break;
default:
break;
}
return transferContent;
} }
#endregion #endregion
......
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