Commit bfbab080 by lcx

原始数据返回

parent 81ded827
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Performance.DtoModels;
namespace Performance.Api.Controllers
{
/// <summary>
/// 原始数据修改
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class OriginalController : Controller
{
/// <summary>
/// 修改数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("")]
[HttpPost]
public ApiResponse EmployeeEdit([FromBody] OriginalRequest request)
{
return new ApiResponse(ResponseType.OK);
}
[Route("")]
[HttpPost]
public ApiResponse ClinicEdit()
{
return new ApiResponse(ResponseType.OK);
}
[Route("")]
[HttpPost]
public ApiResponse ImDataEdit()
{
return new ApiResponse(ResponseType.OK);
}
[Route("")]
[HttpPost]
public ApiResponse AccontEdit()
{
return new ApiResponse(ResponseType.OK);
}
[Route("")]
[HttpPost]
public ApiResponse SpecialEdit()
{
return new ApiResponse(ResponseType.OK);
}
[Route("")]
[HttpPost]
public ApiResponse HeaderEdit()
{
return new ApiResponse(ResponseType.OK);
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class OriginalRequest
{
public int SheetId { get; set; }
public List<Cell> Cells { get; set; }
}
}
......@@ -93,8 +93,10 @@ public object CellValue
/// </summary>
public string Annotation { get; set; }
public int Id { get; set; }
public Cell() { }
public Cell(int pointCell, object cellValue, int mergeRow, int mergeCell, bool isTotal, bool isNumValue, string annotation = "")
public Cell(int pointCell, object cellValue, int mergeRow, int mergeCell, bool isTotal, bool isNumValue, string annotation = "", int id = 0)
{
PointCell = pointCell;
CellValue = cellValue;
......@@ -103,6 +105,7 @@ public Cell(int pointCell, object cellValue, int mergeRow, int mergeCell, bool i
IsTotal = isTotal;
IsNumValue = isNumValue;
Annotation = annotation;
Id = id;
}
}
}
......@@ -109,6 +109,9 @@ public SheetExportResponse SheetExport(int sheetID)
CommonExport(sheetID, response);
}
if (response.Header != null && response.Header.Any())
response.Header = response.Header.OrderBy(t => t.Rownumber).ToList();
return response;
}
......@@ -491,22 +494,22 @@ private void EmployeeExport(int sheetID, SheetExportResponse response)
var item = employeeList.ElementAt(i);
var workTime = item.WorkTime != null ? ((DateTime)item.WorkTime).ToString("yyyy-MM-dd") : "";
var rowbody = new Row(i);
rowbody.Data.Add(new Cell(1, item.AccountType, 1, 1, false, false));
rowbody.Data.Add(new Cell(2, item.AccountingUnit, 1, 1, false, false));
rowbody.Data.Add(new Cell(3, item.PersonnelNumber, 1, 1, false, false));
rowbody.Data.Add(new Cell(4, item.DoctorName, 1, 1, false, true));
rowbody.Data.Add(new Cell(5, item.JobTitle, 1, 1, false, true));
rowbody.Data.Add(new Cell(6, item.FitPeople, 1, 1, false, true));
rowbody.Data.Add(new Cell(7, item.PostCoefficient, 1, 1, false, true));
rowbody.Data.Add(new Cell(8, workTime, 1, 1, false, true));
rowbody.Data.Add(new Cell(9, Math.Round(item.ScoreAverageRate.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(10, Math.Round(item.Attendance.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(11, item.PeopleNumber, 1, 1, false, true));
rowbody.Data.Add(new Cell(12, item.Workload, 1, 1, false, true));
rowbody.Data.Add(new Cell(13, item.OtherPerfor, 1, 1, false, true));
rowbody.Data.Add(new Cell(14, item.Punishment, 1, 1, false, true));
rowbody.Data.Add(new Cell(15, Math.Round(item.Adjust.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(16, item.Grant, 1, 1, false, true));
rowbody.Data.Add(new Cell(1, item.AccountType, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(2, item.AccountingUnit, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(3, item.PersonnelNumber, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(4, item.DoctorName, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(5, item.JobTitle, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(6, item.FitPeople, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(7, item.PostCoefficient, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(8, workTime, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(9, Math.Round(item.ScoreAverageRate.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(10, Math.Round(item.Attendance.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(11, item.PeopleNumber, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(12, item.Workload, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(13, item.OtherPerfor, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(14, item.Punishment, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(15, Math.Round(item.Adjust.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(16, item.Grant, 1, 1, false, true, id: item.ID));
response.Row.Add(rowbody);
}
}
......@@ -520,6 +523,11 @@ private void ClinicEmployeeExport(int sheetID, SheetExportResponse response)
if (clinicemployeeList != null && clinicemployeeList.Count() > 0)
{
List<(string, Func<im_employee_clinic>, int, int, bool, bool)> pairs = new List<(string, Func<im_employee_clinic>, int, int, bool, bool)>
{
};
var row = new Row(0);
row.Data.Add(new Cell(1, "核算单元分类", 1, 1, false, false));
row.Data.Add(new Cell(2, "核算单元", 1, 1, false, false));
......@@ -546,21 +554,21 @@ private void ClinicEmployeeExport(int sheetID, SheetExportResponse response)
var item = clinicemployeeList.ElementAt(i);
//var workTime = item.WorkTime != null ? ((DateTime)item.WorkTime).ToString("yyyy-MM-dd") : "";
var rowbody = new Row(i);
rowbody.Data.Add(new Cell(1, item.UnitType, 1, 1, false, false));
rowbody.Data.Add(new Cell(2, item.AccountingUnit, 1, 1, false, false));
rowbody.Data.Add(new Cell(3, item.PersonnelNumber, 1, 1, false, false));
rowbody.Data.Add(new Cell(4, item.DoctorName, 1, 1, false, true));
rowbody.Data.Add(new Cell(5, item.JobTitle, 1, 1, false, true));
rowbody.Data.Add(new Cell(1, item.UnitType, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(2, item.AccountingUnit, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(3, item.PersonnelNumber, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(4, item.DoctorName, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(5, item.JobTitle, 1, 1, false, true, id: item.ID));
//rowbody.Data.Add(new Cell(6, item.FitPeople, 1, 1, false, true));
rowbody.Data.Add(new Cell(6, item.PostCoefficient, 1, 1, false, true));
rowbody.Data.Add(new Cell(7, Math.Round(item.Efficiency.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(8, Math.Round(item.Scale.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(9, Math.Round(item.Management.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(10, Math.Round(item.ScoreAverageRate.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(11, Math.Round(item.Attendance.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(12, item.OtherPerfor, 1, 1, false, true));
rowbody.Data.Add(new Cell(13, item.Punishment, 1, 1, false, true));
rowbody.Data.Add(new Cell(14, Math.Round(item.Adjust.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(6, item.PostCoefficient, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(7, Math.Round(item.Efficiency.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(8, Math.Round(item.Scale.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(9, Math.Round(item.Management.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(10, Math.Round(item.ScoreAverageRate.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(11, Math.Round(item.Attendance.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(12, item.OtherPerfor, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(13, item.Punishment, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(14, Math.Round(item.Adjust.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
//rowbody.Data.Add(new Cell(16, item.Grant, 1, 1, false, true));
response.Row.Add(rowbody);
}
......
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