Commit 009d3a92 by lcx

修改字段名称

parent 673ca699
......@@ -9,18 +9,18 @@ public class CostTransferRequest
{
public int AllotId { get; set; }
public Department Applicant { get; set; }
public DepartmentDetail Applicant { get; set; }
public Department Adopted { get; set; }
public DepartmentDetail Adopted { get; set; }
public List<CostTransferItemRequest> Items { get; set; }
}
public class Department
public class DepartmentDetail
{
public string UnitType { get; set; }
public string AccountingUnit { get; set; }
public string Department { get; set; }
}
public class CostTransferUpdateRequest : CostTransferRequest
......
......@@ -31,9 +31,9 @@ public class cost_transfer
public string ApplicantUnitType { get; set; }
/// <summary>
/// 申请者核算单元
/// 申请者科室
/// </summary>
public string ApplicantAccountingUnit { get; set; }
public string ApplicantDepartment { get; set; }
/// <summary>
/// 审核者核算单元类型
......@@ -41,9 +41,9 @@ public class cost_transfer
public string AdoptedUnitType { get; set; }
/// <summary>
/// 审核者核算单元
/// 审核者科室
/// </summary>
public string AdoptedAccountingUnit { get; set; }
public string AdoptedDepartment { get; set; }
/// <summary>
/// 0 未审核 1 部分审核 2 全部审核 3 未含有划拨明细
......
......@@ -37,18 +37,18 @@ public bool Applicat(CostTransferRequest request)
if (request.Applicant == null || request.Adopted == null)
throw new PerformanceException("参数错误,申请/被划拨科室信息缺失");
if (string.IsNullOrEmpty(request.Applicant.UnitType) || string.IsNullOrEmpty(request.Applicant.AccountingUnit))
if (string.IsNullOrEmpty(request.Applicant.UnitType) || string.IsNullOrEmpty(request.Applicant.Department))
throw new PerformanceException("参数错误,申请科室信息缺失");
if (string.IsNullOrEmpty(request.Adopted.UnitType) || string.IsNullOrEmpty(request.Adopted.AccountingUnit))
if (string.IsNullOrEmpty(request.Adopted.UnitType) || string.IsNullOrEmpty(request.Adopted.Department))
throw new PerformanceException("参数错误,被划拨科室信息缺失");
var transfer = new cost_transfer
{
AllotId = request.AllotId,
ApplicantAccountingUnit = request.Applicant.AccountingUnit,
ApplicantDepartment = request.Applicant.Department,
ApplicantUnitType = request.Applicant.UnitType,
AdoptedAccountingUnit = request.Adopted.AccountingUnit,
AdoptedDepartment = request.Adopted.Department,
AdoptedUnitType = request.Adopted.UnitType,
Status = (request.Items != null && request.Items.Any()) ? 0 : 3
};
......@@ -90,9 +90,9 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
throw new PerformanceException("划拨申请记录不存在");
transfer.AllotId = request.AllotId;
transfer.ApplicantAccountingUnit = request.Applicant.AccountingUnit;
transfer.ApplicantDepartment = request.Applicant.Department;
transfer.ApplicantUnitType = request.Applicant.UnitType;
transfer.AdoptedAccountingUnit = request.Adopted.AccountingUnit;
transfer.AdoptedDepartment = request.Adopted.Department;
transfer.AdoptedUnitType = request.Adopted.UnitType;
var result = costtransferRepository.Update(transfer);
......
......@@ -23,7 +23,7 @@ public class CostTransferDataWrite
this.costtransferitemRepository = costtransferitemRepository;
}
public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, int allotId)
public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style, int allotId)
{
try
{
......@@ -33,8 +33,23 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp
var costTransferItems = costtransferitemRepository.GetEntities(t => costTransfers.Select(c => c.Id).Contains(t.TransferId));
if (costTransferItems == null || !costTransferItems.Any()) return;
var columns = SupplySheetHeader(sheet, point);
if (columns == null || !columns.Any()) return;
var departments = costTransfers.Select(t => t.AdoptedDepartment ?? "").Union(costTransfers.Select(t => t.ApplicantDepartment ?? "")).Distinct();
}
catch (Exception ex)
{
logger.LogError("写入划拨数据异常:" + ex);
}
}
private Dictionary<string, int> SupplySheetHeader(ISheet sheet, PerSheetPoint point)
{
Dictionary<string, int> pairs = new Dictionary<string, int>();
var header = sheet.GetRow(point.HeaderFirstRowNum.Value);
if (header == null) return;
if (header == null) return pairs;
List<string> fixedColumns = new List<string> { "划拨(出)收入", "划拨(入)收入", "划拨收入(医技)", "划拨收入(医生)", "划拨收入(护理)" };
......@@ -43,27 +58,28 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp
var column = header.GetCell(i)?.GetDecodeEscapes().Replace("(", "(").Replace(")", ")");
if (!string.IsNullOrEmpty(column) && fixedColumns.Any(t => t == column))
{
if (pairs.ContainsKey(column))
pairs.Add(column, i);
fixedColumns.Remove(column);
}
}
if (fixedColumns != null && fixedColumns.Any())
{
var index = point.HeaderFirstCellNum.Value + 1;
var index = header.LastCellNum + 1;
foreach (var column in fixedColumns)
{
var cell = header.CreateCell(index);
cell.SetCellValue(column);
}
}
var columns = header.GetCellValues();
if (pairs.ContainsKey(column)) pairs.Add(column, index);
index++;
}
catch (Exception ex)
{
logger.LogError("写入划拨数据异常:" + ex);
}
return pairs;
}
}
}
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