Commit 5c9ea246 by wyc

科室详情 下载\继承上月

parent d7397aba
......@@ -212,7 +212,11 @@ public ApiResponse UniteDeptDetail([FromBody] UniteDeptDetailRequest request)
return new ApiResponse(ResponseType.OK, response);
}
/// <summary>
/// 科室绩效详情下载
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("download/unite/deptdetail")]
[HttpPost]
public IActionResult DownloadUniteDeptdetail([FromBody] UniteDeptDetailRequest request)
......
......@@ -905,6 +905,7 @@ public ApiResponse CopyDropDown()
new CopyDrop{Label="绩效考核",Value="assessType"},
//new CopyDrop{Label="科室类型",Value="deptTypes"},
new CopyDrop{Label="二次绩效配置",Value="agains"},
new CopyDrop{Label="科室详情设置",Value="deptdetail"},
};
return new ApiResponse(ResponseType.OK, result);
}
......
......@@ -179,6 +179,11 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
var items = new List<Dictionary<string, object>>();
var postDatas = basicData.Where(t => t.SheetID == sheet.ID && t.IsTotal != 1 && t.UnitType == (int)type);
if (postDatas?.Any() != true) continue;
var headersDatas = headers.Where(t => t.SheetID == sheet.ID && t.IsTotal != 1).ToList();
postDatas = from temp1 in postDatas
join temp2 in headersDatas on temp1.TypeName equals temp2.CellValue
orderby temp2.PointCell ascending
select temp1;
foreach (var post in postDatas.GroupBy(t => new { t.TypeName }))
{
......@@ -240,7 +245,11 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
? basicData.Where(t => t.SheetID == sheet.ID && t.IsTotal != 1 && unitTypes.Contains(t.UnitType.Value))
: basicData.Where(t => t.SheetID == sheet.ID && t.IsTotal != 1 && t.UnitType == (int)type);
if (postDatas?.Any() != true) continue;
var headersDatas = headers.Where(t => t.SheetID == sheet.ID && t.IsTotal != 1).ToList();
postDatas = from temp1 in postDatas
join temp2 in headersDatas on temp1.TypeName equals temp2.CellValue
orderby temp2.PointCell ascending
select temp1;
foreach (var post in postDatas.GroupBy(t => new { t.TypeName }))
{
if (ignore.Contains(post.Key.TypeName)) continue;
......@@ -333,6 +342,12 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
var items = new List<Dictionary<string, object>>();
var postDatas = basicData.Where(t => t.SheetID == sheet.ID && t.IsTotal != 1 && t.UnitType == (int)type);
var headersDatas = headers.Where(t => t.SheetID == sheet.ID && t.IsTotal != 1).ToList();
postDatas = from temp1 in postDatas
join temp2 in headersDatas on temp1.TypeName equals temp2.CellValue
orderby temp2.PointCell ascending
select temp1;
foreach (var post in postDatas.GroupBy(t => new { t.TypeName }))
{
if (ignore.Contains(post.Key.TypeName)) continue;
......@@ -704,7 +719,7 @@ int WriteSheetCells(ExcelWorksheet worksheet, int maxColIndex, int rowIndex, Lis
worksheet.SetValue(rowIndex, colIndex + 1, numericValue / 100);
worksheet.Cells[rowIndex, colIndex + 1].Style.Numberformat.Format = "0.00%";
}
else if (double.TryParse(cellValue, out numericValue))
else if (double.TryParse(cellValue, out numericValue) && cellValue.Length != 18)
{
worksheet.SetValue(rowIndex, colIndex + 1, numericValue);
worksheet.Cells[rowIndex, colIndex + 1].Style.Numberformat.Format = "0.00";
......
......@@ -741,7 +741,7 @@ public void Copy(per_allot allot)
NewCopy(new CopyRequest()
{
AllotId = allot.ID,
Type = new[] { "personnels", "workItems", "drugTypeDisburses", "drugTypeFactors", "deptTypes", "agains", "accountings", "department", "attendanceType", "assessType" }
Type = new[] { "personnels", "workItems", "drugTypeDisburses", "drugTypeFactors", "deptTypes", "agains", "accountings", "department", "attendanceType", "assessType", "deptdetail" }
});
}
......@@ -771,6 +771,7 @@ public void NewCopy(CopyRequest request)
{ "attendanceType", (allot, prevAllotId) =>_copyService.Copy_AttendanceType(allot, prevAllotId, delHistotyData:true) },
{ "assessType", (allot, prevAllotId) =>_copyService.Copy_AssessType(allot, prevAllotId, delHistotyData:true) },
{ "department", (allot, prevAllotId) =>_copyService.Copy_DeptDic(allot, prevAllotId, delHistotyData:true) },
{ "deptdetail", (allot, prevAllotId) =>_copyService.Copy_Deptdetail(allot, prevAllotId, delHistotyData:true) },
};
foreach (var item in request.Type)
......
......@@ -28,6 +28,7 @@ public class CopyService : IAutoInjection
private readonly PerforPerAssessSchemeTargetRepository _perforPerAssessSchemeTargetRepository;
private readonly PerforPerAssessIssueSchemeRepository _perforPerAssessIssueSchemeRepository;
private readonly PerforPerAttendanceDeptRepository _perforPerAttendanceDeptRepository;
private readonly PerforCofDeptDetailRepository _perforCofDeptDetailRepository;
public CopyService(
ILogger<ConfigService> logger,
......@@ -45,7 +46,8 @@ public class CopyService : IAutoInjection
PerforPerAssessSchemeItemsRepository perforPerAssessSchemeItemsRepository,
PerforPerAssessSchemeTargetRepository perforPerAssessSchemeTargetRepository,
PerforPerAssessIssueSchemeRepository perforPerAssessIssueSchemeRepository,
PerforPerAttendanceDeptRepository perforPerAttendanceDeptRepository
PerforPerAttendanceDeptRepository perforPerAttendanceDeptRepository,
PerforCofDeptDetailRepository perforCofDeptDetailRepository
)
{
_logger = logger;
......@@ -64,6 +66,7 @@ PerforPerAttendanceDeptRepository perforPerAttendanceDeptRepository
_perforPerAssessSchemeTargetRepository = perforPerAssessSchemeTargetRepository;
_perforPerAssessIssueSchemeRepository = perforPerAssessIssueSchemeRepository;
_perforPerAttendanceDeptRepository = perforPerAttendanceDeptRepository;
_perforCofDeptDetailRepository = perforCofDeptDetailRepository;
}
......@@ -259,7 +262,28 @@ public void Copy_DeptDic(per_allot allot, int prevAllotId, bool delHistotyData =
}
}
}
public void Copy_Deptdetail(per_allot allot, int prevAllotId, bool delHistotyData = false)
{
var flag = delHistotyData;
_logger.LogInformation($"copy cof_dept_detail");
var cofDeptDetail = _perforCofDeptDetailRepository.GetEntities(t => t.AllotId == allot.ID);
if (delHistotyData && cofDeptDetail != null && cofDeptDetail.Any())
flag = _perforCofDeptDetailRepository.RemoveRange(cofDeptDetail.ToArray());
if (flag || cofDeptDetail == null || !cofDeptDetail.Any())
{
cofDeptDetail = _perforCofDeptDetailRepository.GetEntities(t => t.AllotId == prevAllotId) ?? _perforCofDeptDetailRepository.GetEntities(t => t.AllotId == -1);
if (cofDeptDetail != null && cofDeptDetail.Any())
{
var newCofDeptDetail = cofDeptDetail.Select(t => new cof_dept_detail
{
AllotId = allot.ID,
CreateTime = DateTime.Now,
Settings = t.Settings,
});
_perforCofDeptDetailRepository.AddRange(newCofDeptDetail.ToArray());
}
}
}
public void Copy_AttendanceType(per_allot allot, int prevAllotId, bool delHistotyData = false)
{
var flag = delHistotyData;
......
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