แก้รายงาน รองรับด้านแบบ Multi ในบัญชี 1

This commit is contained in:
Suphonchai Phoonsawat 2023-06-07 15:34:06 +07:00
parent aeb61be218
commit 9c24102b62
7 changed files with 78 additions and 8 deletions

View file

@ -1,4 +1,5 @@
using BMA.EHR.MetaData.Service.Models;
using BMA.EHR.Organization.Service.Models;
using BMA.EHR.Organization.Service.Models.Report2;
using BMA.EHR.Profile.Service.Models;
using BMA.EHR.Profile.Service.Models.HR;

View file

@ -0,0 +1,62 @@

namespace BMA.EHR.Organization.Service.Extensions
{
public class PositionPathSideObject
{
public Guid? Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Note { get; set; } = string.Empty;
}
public class PositionExecutiveSideObject
{
public Guid? Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Note { get; set; } = string.Empty;
}
public static class ListObjectExtensions
{
public static string GetNameList(this List<PositionPathSideObject> list)
{
if (list == null || list.Count == 0) return "";
else
{
var ret = string.Empty;
foreach (var p in list)
{
ret += $"{p.Name} หรือ\r\n";
}
ret = $"({ret.Substring(0, ret.Length - 7)})";
return ret;
}
}
public static string GetNameList(this List<PositionExecutiveSideObject> list)
{
if (list == null || list.Count == 0) return "";
else
{
var ret = string.Empty;
foreach (var p in list)
{
ret += $"{p.Name} หรือ\r\n";
}
ret = $"({ret.Substring(0, ret.Length - 7)})";
return ret;
}
}
}
}

View file

@ -1,4 +1,5 @@

using BMA.EHR.Organization.Service.Models;
using BMA.EHR.Report.Service.Models;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;

View file

@ -1,4 +1,5 @@
using BMA.EHR.Report.Service.Models;
using BMA.EHR.Organization.Service.Models;
using BMA.EHR.Report.Service.Models;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

View file

@ -1,9 +1,9 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using BMA.EHR.Report.Service.Models;
using BMA.EHR.MetaData.Service.Models;
namespace BMA.EHR.Profile.Service.Models
namespace BMA.EHR.Organization.Service.Models
{
public class PositionMasterEntity : EntityBase
{
@ -65,8 +65,12 @@ namespace BMA.EHR.Profile.Service.Models
[Column(Order = 14), Comment("IsDirector")]
public bool? IsDirector { get; set; }
//public List<AvailablePositionLevelEntity> AvailablePositionLevels { get; } = new();
public string? PositionPathSideObject { get; set; }
public string? PositionExecutiveSideObject { get; set; }
//public List<AvailablePositionLevelEntity> AvailablePositionLevels { get; } = new();
//public List<PositionMasterHistoryEntity> PositionMasterHistorys { get; } = new();
}
}

Binary file not shown.

View file

@ -1,5 +1,6 @@
using Amazon.Internal;
using BMA.EHR.Extensions;
using BMA.EHR.Organization.Service.Extensions;
using BMA.EHR.Profile.Service.Services;
using BMA.EHR.Report.Service.Data;
using Microsoft.EntityFrameworkCore;
@ -102,10 +103,10 @@ namespace BMA.EHR.Report.Service.Services
ShortName = sn.Name,
PositionNumber = pn.Name,
PositionLevel = _profileService.GetPositionLevel(pm.Id),
PositionName = pp.Name,
PositionSide = pp_pps == null ? "" : $"({pp_pps.Name})",
PositionExecutive = pm_exp == null ? "" : pm_exp.Name,
PositionExecutiveSide = pm_exp_s == null ? "" : $"({pm_exp_s.Name})",
PositionName = $"{pp.Name}\r\n",
PositionSide = pm.PositionPathSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionPathSideObject>>(pm.PositionPathSideObject).GetNameList(),
PositionExecutive = pm_exp == null ? "" : $"{pm_exp.Name}\r\n",
PositionExecutiveSide = pm.PositionExecutiveSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionExecutiveSideObject>>(pm.PositionExecutiveSideObject).GetNameList(),
Remark = op.PositionUserNote,
OcOrder = oc.OrganizationOrder.Value,
PositionType = pt.Name