Commit 4e0021ca by lcx

二次绩效其他模板返回数据格式调整

parent ca52c063
......@@ -403,12 +403,12 @@ public ApiResponse OtherList([FromBody] AgOtherRequest request)
{
//var result = secondAllotService.OtherList(request.SecondId, claimService.GetUserId());
var result = secondAllotDetails.GetOtherTempData(claimService.GetUserId(), request.SecondId, request.IsArchive, request.EmployeeSource, out decimal? realAmount);
//var obj = new
//{
// header = secondAllotService.OtherListHeader(request.SecondId, realAmount ?? 0),
// body = result,
//};
return new ApiResponse(ResponseType.OK, result);
var obj = new
{
header = secondAllotService.OtherListHeader(request.SecondId, realAmount ?? 0),
body = result,
};
return new ApiResponse(ResponseType.OK, obj);
}
/// <summary>
......@@ -448,7 +448,7 @@ public ApiResponse DeptComputeDetail(int allotId)
var userId = claimService.GetUserId();
//var data = secondAllotService.DeptComputeDetail(userId, allotId, out int isShowManage);
var data = secondAllotService.DeptComputeDetailList(userId, allotId, out int isShowManage);
return new ApiResponse(ResponseType.OK, new { isShowManage, data });
}
}
......
......@@ -10,12 +10,12 @@ public class HandsonTable
{
private IEnumerable<collect_permission> _permissions;
private List<Dictionary<string, string>> _data;
public HandsonTable(int sheetType, string[] cols, List<collect_permission> permissions)
{
_permissions = permissions;
_data = new List<Dictionary<string, string>>();
InitColHeaders(sheetType, cols);
InitColumns(permissions);
}
......@@ -25,7 +25,7 @@ public HandsonTable(int sheetType, string[] cols, List<collect_permission> permi
public HandsonColumn[] Columns { get; private set; }
/// <summary>
///
///
/// </summary>
/// <param name="datas"></param>
/// <param name="isTypein">是否是用户录入的 是:true 不是:false</param>
......@@ -107,20 +107,25 @@ public HandsonColumn(string data, bool readOnly = false, DataFormat format = Dat
case DataFormat.普通格式:
Type = "text";
break;
case DataFormat.小数:
Type = "numeric";
NumericFormat = new NumericFormat { Pattern = "0,00.00" };
break;
case DataFormat.百分比:
Type = "numeric";
NumericFormat = new NumericFormat { Pattern = "0,00.00%" };
break;
}
}
public string Data { get; set; }
public bool ReadOnly { get; set; }
public string Type { get; set; }
public string[] Source { get; set; }
public bool Strict { get; set; } = false;
public NumericFormat NumericFormat { get; set; }
}
......
......@@ -574,7 +574,21 @@ public HandsonTable GetOtherTempData(int userId, int secondId, int isArchive, in
Readnoly = new string[] { "可分配绩效", "医院其他绩效", "预留比例", "预留金额", "实发绩效工资金额" }.Contains(t.Value) ? 1 : 0
}).ToList());
var details = GetOtherTempDetails(userId, secondId, isArchive, employeeSource);
string[] workNumbers = new string[] { };
var details = GetOtherTempDetails(userId, secondId, isArchive, employeeSource, ref workNumbers);
if (result.Columns != null && result.Columns.Any())
{
foreach (var column in result.Columns)
{
if (column.Data == "工号")
{
column.Type = "autocomplete";
column.Source = workNumbers;
column.Strict = true;
}
}
}
realAmount = details?.Sum(t => t.RealAmount);
if (details == null || !details.Any()) return result;
......@@ -597,7 +611,7 @@ public HandsonTable GetOtherTempData(int userId, int secondId, int isArchive, in
return result;
}
public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int isArchive, int employeeSource)
public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int isArchive, int employeeSource, ref string[] workNumbers)
{
var secondAllot = agsecondallotRepository.GetEntity(t => t.Id == secondId);
if (secondAllot == null) throw new PerformanceException("二次绩效信息无效!");
......@@ -688,6 +702,7 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is
}
}
var originalEmployees = personService.GetPerEmployee(secondAllot.AllotId.Value);
workNumbers = originalEmployees?.Select(t => t.PersonnelNumber).Distinct().ToArray();
SupplementSecondDetail(secondAllot, originalEmployees, result, isSupplementTitlePerformance);
return result;
......
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