| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 | using OASystem.Domain.Entities.Resource;using System.Text.Json.Serialization;namespace OASystem.Domain.ViewModels.Resource{    public class CountryFeeCostView : Res_CountryFeeCost    {        /// <summary>        /// 距今更新天数        /// </summary>        public int DaysSinceUpdate        {            get            {                var now = DateTime.Now;                if (!string.IsNullOrWhiteSpace(LastUpdateTime) && DateTime.TryParse(LastUpdateTime, out var lastTime))                {                    return (now - lastTime).Days;                }                return (now - CreateTime).Days;            }        }    }    /// <summary>    /// 省份签证费用详情    /// </summary>    public class VisaFeeStandardDetails    {        public int Id { get; set; }        /// <summary>        /// 签证费用表Id(Res_VisaFeeStandard)        /// </summary>        public int ParentId { get; set; }        /// <summary>        /// 签证费用归属省份Id(Sys_Cities)        /// </summary>        public int ProvinceId { get; set; }        /// <summary>        /// 省份名称        /// </summary>        public string ProvinceName { get; set; }        /// <summary>        /// 送签地址        /// </summary>        public string VisaAddress { get; set; }        /// <summary>        /// 是否落地签        /// </summary>        public bool IsVisaOnArrival { get; set; } = false;        /// <summary>        /// 是否电子签        /// </summary>        public bool IsElectronicSign { get; set; } = false;        /// <summary>        /// 签证时间(工作日)        /// </summary>        public string VisaTime { get; set; }        /// <summary>        ///  是否免签(大公务)        /// </summary>        public bool IsVisaExemptionLarge { get; set; } = false;        /// <summary>        /// 签证费用(大公务)        /// </summary>        public decimal LargeVisaPrice { get; set; }        /// <summary>        /// 代办费(大公务)        /// </summary>        public decimal LargeAgencyFee { get; set; } = 0.00m;        /// <summary>        ///  是否免签(小公务)        /// </summary>        public bool IsVisaExemptionSmall { get; set; } = false;        /// <summary>        /// 签证费用(小公务)        /// </summary>        public decimal SmallVisaPrice { get; set; } = 0.00m;        /// <summary>        /// 代办费(小公务)        /// </summary>        public decimal SmallAgencyFee { get; set; } = 0.00m;        /// <summary>        ///  外办费用(普通)        /// </summary>        public decimal NormExtFee { get; set; } = 0.00m;        /// <summary>        /// 外办费用(加急)        /// </summary>        public decimal UrgExtFee { get; set; } = 0.00m;        /// <summary>        /// 签证是否加急        /// </summary>        public bool IsUrgent { get; set; } = false;        /// <summary>        /// 加急时间(工作日)        /// </summary>        public int UrgentTime { get; set; }        /// <summary>        /// 加急费用        /// </summary>        public decimal UrgentPrice { get; set; }        /// <summary>        /// 加急费用描述         /// </summary>        public string UrgentPriceDesc { get; set; }        /// <summary>        /// 备注        /// </summary>        public string Remark { get; set; }        public VisaFeeStandardDetails() { }        /// <summary>        /// 按照指定的省份排序        /// </summary>        /// <param name="people">数据源</param>        /// <param name="specifiedOrder">省份排序集合</param>        /// <returns></returns>        public static List<VisaFeeStandardDetails> SortByProvinces(List<VisaFeeStandardDetails> people, List<string> specifiedOrder)        {            return people                .OrderBy(person => specifiedOrder.IndexOf(person.ProvinceName))                .ThenBy(person => person.ProvinceId) // 对未指定的省份按Id顺序排序                .ToList();        }    }    public class VisaFeeStandardDetailsView : VisaFeeStandardDetails    {        public string CountryName { get; set; }    }    /// <summary>    /// 签证info    /// </summary>    public class VisaFeeStandardInfo    {        /// <summary>        /// Id        /// </summary>        public int Id { get; set; }        /// <summary>        /// 洲名        /// </summary>        public string Continent { get; set; }        /// <summary>        /// 国家名        /// </summary>        public string Country { get; set; }        /// <summary>        /// 签证费用类型 0 因公 1 因私        /// </summary>        public int FeeType { get; set; } = 0;    }    /// <summary>    /// 签证info View    /// </summary>    public class VisaFeeStandardInfoView : VisaFeeStandardInfo    {        /// <summary>        /// 省份签证费用集合        /// </summary>        public List<VisaFeeStandardDetails> VisaFees { get; set; }    }    public class VisaFeeStandardListView : VisaFeeStandardInfo    {        /// <summary>        /// 省份签证费用集合        /// </summary>        [JsonIgnore]        public List<VisaFeeStandardDetails> VisaFees { get; set; }        /// <summary>        /// 省份签证费用描述        /// </summary>        public string ProvinceVisaFeeLabel        {            get            {                return GetVisaFeeLabel();            }        }        /// <summary>        /// 最后更新人        /// </summary>        public string LastUpdateUserName { get; set; }        /// <summary>        /// 最后更新时间        /// </summary>        public DateTime LastUpdateTime { get; set; }        /// <summary>        /// 距今更新天数        /// </summary>        public int DaysSinceUpdate        {            get            {                return (DateTime.Now - LastUpdateTime).Days;            }        }        /// <summary>        /// 获取省份签证描述        /// </summary>        /// <returns></returns>        private string GetVisaFeeLabel()        {            var label = new StringBuilder();            VisaFees.ForEach(info =>            {                label.AppendLine($"{info.ProvinceName}");                label.AppendLine();                if (FeeType == 0) //因公                {                    label.AppendLine($"送签地址: {info.VisaAddress}");                    var isVisaOnArrival = info.IsVisaOnArrival ? "是" : "否";                    label.AppendLine($"是否落地签:{isVisaOnArrival}");                    var isElectronicSign = info.IsElectronicSign ? "是" : "否";                    label.AppendLine($"是否电子签:{isElectronicSign}");                    label.AppendLine($"签证时间(工作日):{info.VisaTime}");                    var isVisaExemptionLarge = info.IsVisaExemptionLarge ? "是" : "否";                    label.AppendLine($"公务护照免签:{isVisaExemptionLarge}");                    label.AppendLine($"公务护照签证费:{info.LargeVisaPrice:#0.00}");                    label.AppendLine($"公务护照签证代办费:{info.LargeAgencyFee:#0.00}");                    var isVisaExemptionSmall = info.IsVisaExemptionSmall ? "是" : "否";                    label.AppendLine($"公务普通护照免签:{isVisaExemptionSmall}");                    label.AppendLine($"公务普通护照签证费:{info.SmallVisaPrice:#0.00}");                    label.AppendLine($"公务普通护照代办费:{info.SmallAgencyFee:#0.00}");                    if (info.ProvinceId == 103)                    {                        label.AppendLine($"重庆外办出入境证明费用(普通):{info.NormExtFee:#0.00}");                        label.AppendLine($"重庆外办出入境证明费用(加急):{info.UrgExtFee:#0.00}");                    }                    var isUrgent = info.IsUrgent ? "是" : "否";                    label.AppendLine($"签证是否加急:{isVisaExemptionSmall}");                    label.AppendLine($"加急时间(工作日):{info.UrgentTime}");                    label.AppendLine($"加急费用:{info.UrgentPrice:#0.00}");                    label.AppendLine($"加急费用描述 :{info.UrgentPriceDesc}");                    label.AppendLine($"备注 :{info.Remark}");                }                else if (FeeType == 1) //因私                {                    var isVisaExemptionSmall = info.IsVisaExemptionSmall ? "是" : "否";                    label.AppendLine($"普通护照免签:{isVisaExemptionSmall}");                    label.AppendLine($"签证费:{info.SmallVisaPrice:#0.00}");                    label.AppendLine($"送签地点:{info.VisaAddress}");                    label.AppendLine($"办理时间(工作日):{info.VisaTime}");                }                label.AppendLine();                label.AppendLine();            });            return label.ToString();        }    }}
 |