| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797 | using OASystem.Domain.Dtos.Groups;using OASystem.Domain.Entities.Groups;using OASystem.Domain.ViewModels.CRM;using System.ComponentModel;namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice{    public enum QiyeWeChatEnum    {        /// <summary>        /// 测试用        /// </summary>        [Description("groupstatuschat01")]        TestChat = 0,        /// <summary>        /// 团组通知-公司客户群(国交部经理、主管、财务部),发送条件(1.确认出团)        /// </summary>        [Description("CompanyCRMChat01")]        CompanyCRMChat = 1,        /// <summary>        /// 团组通知-市场客户群(市场部经理、主管;国交部经理、主管)发送条件(1.确认出团) 暂时不用        /// </summary>        [Description("MarketCRMChat01")]        MarketCRMChat,        /// <summary>        /// 团组通知-财务群(财务部全员),发送条件(1.费用审核-通过;2,团组出访时间出发-7 天,结束-3 天,通知财务三人签合同、收尾款)        /// </summary>        [Description("CaiWuChat01")]        CaiWuChat,        /// <summary>        /// 团组通知-财务群(财务部全员),发送条件(团组出访时间出发-7 天,结束-3 天,第二天,通知财务三人签合同、收尾款)        /// </summary>        [Description("CaiWuChat02")]        CaiWuChat02,        /// <summary>        /// 团组通知-国交管理群(国交部经理、主管),发送条件(1.费用审核-提交)        /// </summary>        [Description("GuoJiaoLeader01")]        GuoJiaoLeaderChat,        /// <summary>        /// 团组通知-国交群(3天内结束行程)        /// </summary>        [Description("GuoJiaoChat01")]        GuoJiaoChat01,    }    public class MarkdownLib    {        /// <summary>        /// 通知文本-确认出团        /// </summary>        /// <param name="info"></param>        /// <returns></returns>        public static string GroupStatus_Create(GroupStatus_CreateModel info)        {            string result = string.Format(@" `确认出团`  >团组名称:<font color='info'>{0}</font> >团组类型:{1}>出访日期:<font color='comment'>{2}</font> >出访人数/天数:{3}人/{4}天 >客户单位:{5}>客户名称:{6}[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)", info.TeamName, info.TeamDid_Text, info.VisitDateRange, info.VisitPNumber, info.VisitDays, info.ClientUnit, info.ClientName);            return result;        }        /// <summary>        /// 通知文本-费用申请        /// </summary>        /// <returns></returns>        public static string GroupStatus_ApplyFee(GroupStatus_ApplyFeeModel info)        {            string result = string.Format(@" `团组费用录入`  >团组:<font color='info'>{0}</font> <font color='comment'>- </font>{7}>费用模块:{1}>费用名称:<font color='warning'>{2}</font>>付款金额:<font color='warning'>{3}</font>>申请人:{4}>申请时间:<font color='comment'>{5}</font> <font color='comment'>- </font>当前团组费用待审核数量: {6}[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.TeamName, info.PriceModule, info.PriceName, info.Price, info.CreateUser, info.CreateDt, info.QueueCount, info.TitleStr);            return result;        }        /// <summary>        /// 费用审核通知-团组费用-群聊        /// </summary>        /// <param name="info"></param>        /// <returns></returns>        public static string AuditResult_ApplyFee_Chat(AuditResult_ApplyFee_GroupModel info)        {            string result = string.Format(@" `{0}`  <font color='{1}'>{2}</font>>审核时间:<font color='comment'>{8}</font>>团组:{3}>费用模块:{4}>费用名称:<font color='warning'>{5}</font>>付款金额:<font color='warning'>{6}</font>>申请人:{7}[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.Title, info.ResultColor, info.Result, info.TeamName, info.PriceModule, info.PriceName, info.Price, info.CreateUser, info.GMAuditDate);            return result;        }        /// <summary>        /// 费用审核通知-团组费用-用户        /// </summary>        /// <param name="info"></param>        /// <returns></returns>        public static string AuditResult_ApplyFee_User(AuditResult_ApplyFee_GroupModel info)        {            string result = string.Format(@" `{0}`  <font color='{1}'>{2}</font>>审核时间:<font color='comment'>{7}</font>>团组:{3}>费用模块:{4}>费用名称:<font color='warning'>{5}</font>>付款金额:<font color='warning'>{6}</font>[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.Title, info.ResultColor, info.Result, info.TeamName, info.PriceModule, info.PriceName, info.Price, info.GMAuditDate);            return result;        }        /// <summary>        /// 费用支付通知-团组费用-用户        /// </summary>        /// <param name="info"></param>        /// <returns></returns>        public static string PayResult_Group_ToUser(PayResult_Group_ToUserModel info)        {            string result = string.Format(@" `团组费用支付`  >团组:{0}>费用模块:{1}>费用名称:<font color='warning'>{2}</font>>付款金额:<font color='warning'>{3}</font>><font color='info'>该笔费用已支付</font>>支付时间:<font color='comment'>{4}</font>[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.TeamName, info.PriceModule, info.PriceName, info.Price, info.PayDt);            return result;        }        /// <summary>        /// 团组出发前一周提醒财务检查合同、尾款        /// </summary>        /// <returns></returns>        public static string GroupRemindersToGuojiao(List<Grp_DelegationInfo> list_3day)        {            string teamNames2 = "><font color='comment'>暂无</font>";            if (list_3day.Count > 0)            {                teamNames2 = "";                foreach (var item in list_3day)                {                    string endDt = item.VisitEndDate.ToString("yyyy-MM-dd");                    teamNames2 += ">(" + endDt + ")" + item.TeamName + " \n\n";                }                //list_3day.ForEach(s => teamNames2 += ">" + s.TeamName + "\n\n");            }            string result = string.Format(@" `团组行程结束提醒`  ><font color='warning'> - 下列团组将于3天内结束:</font>{0}<font color='info'>请各位注意检查业务费用是否录入完整</font>[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ", teamNames2);            return result;        }        /// <summary>        /// 团组出发前一周提醒HR        /// </summary>        /// <returns></returns>        public static string GroupRemindersToHR(List<Grp_DelegationInfo> list_7day)        {            string teamNames2 = "><font color='comment'>暂无</font>";            if (list_7day.Count > 0)            {                teamNames2 = "";                foreach (var item in list_7day)                {                    string startDt = item.VisitStartDate.ToString("yyyy-MM-dd");                    teamNames2 += ">(" + startDt + ")" + item.TeamName + " \n\n";                }            }            string result = string.Format(@" `团组行程提醒`  ><font color='warning'> - 下列团组将于7天内出发:</font>{0}[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ", teamNames2);            return result;        }        /// <summary>        /// 团组出发前一周提醒财务检查合同、尾款        /// </summary>        /// <returns></returns>        public static string GroupRemindersToCaiwuChat(List<Grp_DelegationInfo> list_7day, List<Grp_DelegationInfo> list_3day, List<Grp_DelegationInfo> list_minus1day)        {            string teamNames1 = "><font color='comment'>暂无</font>";            string teamNames2 = "><font color='comment'>暂无</font>";            string teamNames3 = "><font color='comment'>暂无</font>";            if (list_7day.Count > 0)            {                teamNames1 = "";                foreach (var item in list_7day)                {                    string startDt = item.VisitStartDate.ToString("yyyy-MM-dd");                    teamNames1 += ">(" + startDt + ")" + item.TeamName + " \n\n";                }                //list_7day.ForEach(s => teamNames1 += ">" + s.TeamName + "\n\n");            }            if (list_3day.Count > 0)            {                teamNames2 = "";                foreach (var item in list_3day)                {                    string endDt = item.VisitEndDate.ToString("yyyy-MM-dd");                    teamNames2 += ">(" + endDt + ")" + item.TeamName + " \n\n";                }                //list_3day.ForEach(s => teamNames2 += ">" + s.TeamName + "\n\n");            }            if (list_minus1day.Count > 0)            {                teamNames3 = "";                foreach (var item in list_minus1day)                {                    string endDt = item.VisitEndDate.ToString("yyyy-MM-dd");                    teamNames3 += ">(" + endDt + ")" + item.TeamName + " \n\n";                }            }            string result = string.Format(@" `团组状态提醒`  ><font color='warning'> - 下列团组将于7天内出发:</font>{0}><font color='warning'> - 下列团组将于3天内结束:</font>{1}><font color='warning'> - 下列团组已于昨日结束行程:</font>{2}<font color='info'>请注意检查合同、尾款状态</font>[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ", teamNames1, teamNames2, teamNames3);            return result;        }        /// <summary>        /// 日付申请提交时推送财务群        /// </summary>        /// <returns></returns>        public static string DailyPayReminders_Create_ToCaiwuChat(DailyPayReminders_Create_ToCaiwuChatModel info)        {            string result = string.Format(@" `日付申请录入`  <font color='comment'>- </font>{6}>费用名称:<font color='warning'>{0}</font>>公司:<font color='comment'>{5}</font>>费用标识:<font color='comment'>{4}</font>>付款金额:<font color='warning'>{1}</font>>申请人:{2}>申请时间:<font color='comment'>{3}</font>[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ", info.PriceName, info.Price, info.CreateUser, info.CreateDt, info.FeeSign, info.Company, info.TitleStr);            return result;        }        /// <summary>        /// 日付申请审核结果推送给申请人        /// </summary>        /// <returns></returns>        public static string DailyPayReminder_Audit_ToUser(DailyPayReminder_Audit_ToUserModel info)        {            string result = string.Format(@" `日付申请`  <font color='{0}'>{1}</font>>费用名称:{2}>付款金额:<font color='warning'>{3}</font>>审核时间:<font color='comment'>{4}</font> ", info.ResultColor, info.Result, info.PriceName, info.Price, info.AuditDate);            return result;        }        /// <summary>        /// 日付申请审核结果推送给财务群(总经理审核通过)        /// </summary>        /// <returns></returns>        public static string DailyPayReminder_Audit_ToCaiwuChat(DailyPayReminder_Audit_ToCaiwuChatModel info)        {            string result = string.Format(@" `日付申请`  <font color='info'> - 新增一笔通过总经理审核的日付申请</font>>费用名称:{0}>付款金额:<font color='warning'>{1}</font>>申请人:{2}>审核时间:<font color='comment'>{3}</font> ", info.PriceName, info.Price, info.CreateUser, info.AuditDate);            return result;        }        /// <summary>        /// 日付申请已付款推送给申请人        /// </summary>        /// <returns></returns>        public static string DailyPayReminder_Pay_ToUser(DailyPayReminder_Pay_ToUserModel info)        {            string result = string.Format(@" `日付申请`  <font color='info'>你有一笔日付申请费用已付款</font>>费用名称:{0}>付款金额:<font color='warning'>{1}</font>>支付时间:<font color='comment'>{2}</font> ", info.PriceName, info.Price, info.PayDt);            return result;        }        /// <summary>        /// 成本通知发送给用户        /// </summary>        /// <returns></returns>        public static string GroupShare_ToUser(GroupShare_ToUserModel info)        {            string result = string.Format(@" `成本通知`  <font color='info'>团组成本费用已更新</font>>团组名称:{0}>更新时间:<font color='warning'>{1}</font>><font color='comment'>请注意在费用录入页面中核对成本信息</font>><font color='comment'>若无对应团组权限请联系国交部经理或信息部人员</font> ", info.TeamName, info.RefreshDate);            return result;        }        /// <summary>        /// 出入境费用明细更改通知发送给用户        /// </summary>        /// <returns></returns>        public static string GroupShare_ToGM(GroupShare_ToGMModel info)        {            string result = string.Format(@" `出入境费用明细操作通知`  >团组:<font color='info'>{0}</font> >操作人员:{1}>操作时间:<font color='comment'>{2}</font> [请点击进入明细进行查看或确认]({3}) ", info.TeamName, info.CreateUser, info.RefreshDate, info.Url);            return result;        }        /// <summary>        /// 出入境费用 确认 通知发送给 财务相关人员        /// </summary>        /// <returns></returns>        public static string GroupShare_ToFinance(GroupShare_ToUserModel info)        {            string result = string.Format(@" `出入境费用确认操作通知`  >团组:<font color='info'>{0}</font> >操作时间:<font color='comment'>{1}</font> [出入境费用已确认,请进行相关流程操作。] ", info.TeamName, info.RefreshDate);            return result;        }        /// <summary>        /// CRM统计通知(周)        /// </summary>        /// <param name="list"></param>        /// <param name="beginDt"></param>        /// <param name="endDt"></param>        /// <returns></returns>        public static string CRMStatistics_ToUser(List<CRMWeekStatisticsView> list, string beginDt, string endDt)        {            string users = "暂无";            if (list.Count > 0)            {                users = "";                foreach (var item in list)                {                    users += ">【" + item.UserName + "】 - 新增 " + item.InsertNum + " 条,删除 " + item.DeleteNum + " 条\n\n";                }            }            string result = string.Format(@" `市场客户资料周统计({0} - {1})`  {2}[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ", beginDt, endDt, users);            return result;        }        /// <summary>        /// CRM统计通知(月)        /// </summary>        /// <param name="list"></param>        /// <param name="beginDt"></param>        /// <param name="endDt"></param>        /// <param name="totalInsert"></param>        /// <param name="totalDelete"></param>        /// <returns></returns>        public static string CRMStatistics_Month_ToUser(List<CRMWeekStatisticsView> list, string beginDt, string endDt, int totalInsert, int totalDelete)        {            string users = "暂无";            if (list.Count > 0)            {                users = "";                foreach (var item in list)                {                    users += ">【" + item.UserName + "】 - 新增 " + item.InsertNum + " 条,删除 " + item.DeleteNum + " 条\n\n";                }            }            string result = string.Format(@" `市场客户资料月统计({0} - {1})`  > 总共 - 新增 <font color='info'>{3}</font> 条,删除 <font color='warning'> {4}</font> 条{2}[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ", beginDt, endDt, users, totalInsert, totalDelete);            return result;        }        public static string BlackCodeInfo_ToVisaUser(BlackCodeInfo_ToVisaUser info)        {            string result = string.Format(@" `国家出入时间通知`  <font color='info'>详细时间</font>>团组名称:{0}>更新时间:<font color='warning'>{1}</font> ", info.TeamName, info.RefreshDate);            foreach (var item in info.info)            {                var black = string.Empty;                for (int i = 0; i < item.Country.Length; i++)                {                    black += "   ";                }                black += "   ";                result += $@"><font color='comment'>{item.Country}-抵达:{item.StartTime.ToString("yyyy-MM-dd HH:mm")}</font>><font color='comment'>{black}离开:{item.EndTime.ToString("yyyy-MM-dd HH:mm")}</font>";            }            return result;        }        public static string GroupDateTime_ToVisaUser(GroupDateTime_ToVisaUser info)        {            string result = string.Format(@" `团组时间通知`  <font color='info'>详细时间</font>>团组名称:{0}>更新时间:<font color='warning'>{1}</font>><font color='comment'>开始时间:{2}</font>><font color='comment'>结束时间:{3}</font> ", info.TeamName, info.RefreshDate, info.StartTime, info.EndTime);            return result;        }        /// <summary>        /// 任务创建推送给归属人        /// </summary>        /// <returns></returns>        public static string TaskAssignment_Create_ToUser(TaskAssignment_Create_ToUserModel dto)        {            string result = string.Format(@" `任务分配通知` >团组:<font color='info'>{0}</font>  <font color='info'>{1}</font>>操作人员:{2}>操作时间:<font color='comment'>{3}</font> [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ", dto.GroupName, dto.Title, dto.CreateUser, dto.RefreshDate);            return result;        }        public static string TaskInfo_ToUser(TaskInfo_ToUser info)        {            string result = string.Format(@" `{2}`  <font color='info'>请前往OA系统查看 【团组管理模块->部门任务】 </font>>任务名称:{0}>任务开始时间:{1}>任务数量:<font color='warning'>{3}</font>>加急任务数量:<font color='warning'>{4}</font> ", info.TaskName, info.StartTime, info.isNew ? "OA新任务通知" : "OA任务修改通知", info.TaskCount, info.UrgentCount);            return result;        }        public static string TaskInfo_SubMit_ToUser(TaskInfo_SubMit_ToUser info)        {            string result = string.Format(@" `有新的任务回执待审核`  <font color='info'>请前往OA系统查看 【团组管理模块->部门任务】 </font>>任务名称:{0}>任务开始时间:{1}>任务结束时间:{2} ", info.TaskName, info.StartTime, info.EndTime);            return result;        }        public static string TaskInfo_Audit_ToUser(TaskInfo_Audit_ToUser info)        {            string result = string.Format(@" `任务审核通知`  <font color='info'>请前往OA系统查看 【团组管理模块->部门任务】 </font>>任务名称:{0}", info.TaskName);            if (info.auditResult)            {                result += $@">审核结果:<font color='#67C23A'>审核通过</font>";            }            else            {                result += $@">审核结果:<font color='warning'>审核未通过</font>>未通过原因:{info.Message}";            }            return result;        }    }    #region 实体类    public class TaskAssignment_Create_ToUserModel    {        public string GroupName { get; set; }        public string Title { get; set; }        public string RefreshDate { get; set; }        public string CreateUser { get; set; }    }    public class GroupShare_ToGMModel : GroupShare_ToUserModel    {        public string CreateUser { get; set; }        public string Url { get; set; }    }    public class GroupShare_ToUserModel    {        public string TeamName { get; set; }        public string RefreshDate { get; set; }    }    public class DailyPayReminder_Pay_ToUserModel    {        public string PriceName { get; set; }        public string Price { get; set; }        public string PayDt { get; set; }    }    public class DailyPayReminder_Audit_ToCaiwuChatModel    {        public string PriceName { get; set; }        public string Price { get; set; }        public string CreateUser { get; set; }        public string AuditDate { get; set; }    }    public class DailyPayReminder_Audit_ToUserModel    {        public string ResultColor { get; set; } = "info"; //warning        public string Result { get; set; } = "你有一笔日付申请已通过审核"; // 你有一笔日付申请未通过财务/总经理审核        public string PriceName { get; set; }        public string Price { get; set; }        /// <summary>        /// 财务或总经理审核时间        /// </summary>        public string AuditDate { get; set; }    }    public class DailyPayReminders_Create_ToCaiwuChatModel    {        public string PriceName { get; set; }        public string Price { get; set; }        public string CreateUser { get; set; }        public string CreateDt { get; set; }        public string FeeSign { get; set; }        public string Company { get; set; }        /// <summary>        /// [更新]一项费用待审核        /// </summary>        public string TitleStr { get; set; } = "[新增]一项费用待审核";    }    public class PayResult_Group_ToUserModel    {        public string TeamName { get; set; }        public string PriceModule { get; set; }        public string PriceName { get; set; }        public string Price { get; set; }        public string PayDt { get; set; }    }    public class AuditResult_ApplyFee_GroupModel    {        public string Title { get; set; } = "团组费用审核结果";        public string ResultColor { get; set; } = "info";  //info 或 warning        public string Result { get; set; } = "总经理审核通过"; //总经理审核通过 或 总经理审核未通过         public string TeamName { get; set; }        public string PriceModule { get; set; }        public string PriceName { get; set; }        public string Price { get; set; }        public string CreateUser { get; set; }        public string GMAuditDate { get; set; }    }    public class GroupStatus_ApplyFeeModel    {        public string TeamName { get; set; }        public string PriceModule { get; set; }        public string PriceName { get; set; }        public string Price { get; set; }        public string CreateUser { get; set; }        public string CreateDt { get; set; }        public int QueueCount { get; set; }        /// <summary>        /// [更新]一项费用待审核        /// </summary>        public string TitleStr { get; set; } = "[新增]一项费用待审核";    }    public class GroupStatus_CreateModel    {        public string TeamName { get; set; }        public string TeamDid_Text { get; set; }        public string VisitDateRange { get; set; }        public int VisitPNumber { get; set; }        public int VisitDays { get; set; }        public string ClientUnit { get; set; }        public string ClientName { get; set; }    }    public class BlackCodeInfo_ToVisaUser    {        public string TeamName { get; set; }        public List<CountryDataTime> info { get; set; }        public string RefreshDate { get; set; }    }    public class GroupDateTime_ToVisaUser    {        public string TeamName { get; set; }        public string RefreshDate { get; set; }        public string StartTime { get; set; }        public string EndTime { get; set; }    }    public class TaskInfo_ToUser    {        public string TaskName { get; set; }        public string StartTime { get; set; }        public bool isNew { get; set; }        public int TaskCount { get; set; }        public int UrgentCount { get; set; }    }    public class TaskInfo_SubMit_ToUser    {        public string TaskName { get; set; }        public string StartTime { get; set; }        public string EndTime { get; set; }    }    public class TaskInfo_Audit_ToUser    {        public string TaskName { get; set; }        public bool auditResult { get; set; }        public string Message { get; set; }    }    #endregion}
 |