Config.cs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. using MathNet.Numerics.Statistics;
  2. using OASystem.Domain.Entities.Groups;
  3. using System.ComponentModel;
  4. namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
  5. {
  6. public enum QiyeWeChatEnum
  7. {
  8. /// <summary>
  9. /// 测试用
  10. /// </summary>
  11. [Description("groupstatuschat01")]
  12. TestChat = 0,
  13. /// <summary>
  14. /// 团组通知-公司客户群(国交部经理、主管、财务部),发送条件(1.确认出团)
  15. /// </summary>
  16. [Description("CompanyCRMChat01")]
  17. CompanyCRMChat = 1,
  18. /// <summary>
  19. /// 团组通知-市场客户群(市场部经理、主管;国交部经理、主管)发送条件(1.确认出团) 暂时不用
  20. /// </summary>
  21. [Description("MarketCRMChat01")]
  22. MarketCRMChat,
  23. /// <summary>
  24. /// 团组通知-财务群(财务部全员),发送条件(1.费用审核-通过;2,团组出访时间出发-7 天,结束-3 天,通知财务三人签合同、收尾款)
  25. /// </summary>
  26. [Description("CaiWuChat01")]
  27. CaiWuChat,
  28. /// <summary>
  29. /// 团组通知-财务群(财务部全员),发送条件(团组出访时间出发-7 天,结束-3 天,第二天,通知财务三人签合同、收尾款)
  30. /// </summary>
  31. [Description("CaiWuChat02")]
  32. CaiWuChat02,
  33. /// <summary>
  34. /// 团组通知-国交管理群(国交部经理、主管),发送条件(1.费用审核-提交)
  35. /// </summary>
  36. [Description("GuoJiaoLeader01")]
  37. GuoJiaoLeaderChat,
  38. }
  39. public class MarkdownLib
  40. {
  41. /// <summary>
  42. /// 通知文本-确认出团
  43. /// </summary>
  44. /// <param name="info"></param>
  45. /// <returns></returns>
  46. public static string GroupStatus_Create(GroupStatus_CreateModel info)
  47. {
  48. string result = string.Format(@" `确认出团`
  49. >团组名称:<font color='info'>{0}</font>
  50. >团组类型:{1}
  51. >出访日期:<font color='comment'>{2}</font>
  52. >出访人数/天数:{3}人/{4}天
  53. >客户单位:{5}
  54. >客户名称:{6}
  55. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)
  56. ", info.TeamName, info.TeamDid_Text, info.VisitDateRange, info.VisitPNumber, info.VisitDays, info.ClientUnit, info.ClientName);
  57. return result;
  58. }
  59. /// <summary>
  60. /// 通知文本-费用申请
  61. /// </summary>
  62. /// <returns></returns>
  63. public static string GroupStatus_ApplyFee(GroupStatus_ApplyFeeModel info)
  64. {
  65. string result = string.Format(@" `团组费用录入`
  66. >团组:<font color='info'>{0}</font>
  67. <font color='comment'>- </font>{7}
  68. >费用模块:{1}
  69. >费用名称:<font color='warning'>{2}</font>
  70. >付款金额:<font color='warning'>{3}</font>
  71. >申请人:{4}
  72. >申请时间:<font color='comment'>{5}</font>
  73. <font color='comment'>- </font>当前团组费用待审核数量: {6}
  74. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.TeamName, info.PriceModule, info.PriceName, info.Price, info.CreateUser, info.CreateDt, info.QueueCount, info.TitleStr);
  75. return result;
  76. }
  77. /// <summary>
  78. /// 费用审核通知-团组费用-群聊
  79. /// </summary>
  80. /// <param name="info"></param>
  81. /// <returns></returns>
  82. public static string AuditResult_ApplyFee_Chat(AuditResult_ApplyFee_GroupModel info)
  83. {
  84. string result = string.Format(@" `{0}`
  85. <font color='{1}'>{2}</font>
  86. >审核时间:<font color='comment'>{8}</font>
  87. >团组:{3}
  88. >费用模块:{4}
  89. >费用名称:<font color='warning'>{5}</font>
  90. >付款金额:<font color='warning'>{6}</font>
  91. >申请人:{7}
  92. [详细信息请前往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);
  93. return result;
  94. }
  95. /// <summary>
  96. /// 费用审核通知-团组费用-用户
  97. /// </summary>
  98. /// <param name="info"></param>
  99. /// <returns></returns>
  100. public static string AuditResult_ApplyFee_User(AuditResult_ApplyFee_GroupModel info)
  101. {
  102. string result = string.Format(@" `{0}`
  103. <font color='{1}'>{2}</font>
  104. >审核时间:<font color='comment'>{7}</font>
  105. >团组:{3}
  106. >费用模块:{4}
  107. >费用名称:<font color='warning'>{5}</font>
  108. >付款金额:<font color='warning'>{6}</font>
  109. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.Title, info.ResultColor, info.Result, info.TeamName, info.PriceModule, info.PriceName, info.Price, info.GMAuditDate);
  110. return result;
  111. }
  112. /// <summary>
  113. /// 费用支付通知-团组费用-用户
  114. /// </summary>
  115. /// <param name="info"></param>
  116. /// <returns></returns>
  117. public static string PayResult_Group_ToUser(PayResult_Group_ToUserModel info)
  118. {
  119. string result = string.Format(@" `团组费用支付`
  120. >团组:{0}
  121. >费用模块:{1}
  122. >费用名称:<font color='warning'>{2}</font>
  123. >付款金额:<font color='warning'>{3}</font>
  124. ><font color='info'>该笔费用已支付</font>
  125. >支付时间:<font color='comment'>{4}</font>
  126. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.TeamName, info.PriceModule, info.PriceName, info.Price, info.PayDt);
  127. return result;
  128. }
  129. /// <summary>
  130. /// 团组出发前一周提醒财务检查合同、尾款
  131. /// </summary>
  132. /// <returns></returns>
  133. public static string GroupRemindersToCaiwuChat(List<Grp_DelegationInfo> list_7day, List<Grp_DelegationInfo> list_3day, List<Grp_DelegationInfo> list_minus1day)
  134. {
  135. string teamNames1 = "><font color='comment'>暂无</font>";
  136. string teamNames2 = "><font color='comment'>暂无</font>";
  137. string teamNames3 = "><font color='comment'>暂无</font>";
  138. if (list_7day.Count > 0)
  139. {
  140. teamNames1 = "";
  141. foreach (var item in list_7day)
  142. {
  143. string startDt = item.VisitStartDate.ToString("yyyy-MM-dd");
  144. teamNames1 += ">(" + startDt + ")" + item.TeamName + " \n\n";
  145. }
  146. //list_7day.ForEach(s => teamNames1 += ">" + s.TeamName + "\n\n");
  147. }
  148. if (list_3day.Count > 0)
  149. {
  150. teamNames2 = "";
  151. foreach (var item in list_3day)
  152. {
  153. string endDt = item.VisitEndDate.ToString("yyyy-MM-dd");
  154. teamNames2 += ">(" + endDt + ")" + item.TeamName + " \n\n";
  155. }
  156. //list_3day.ForEach(s => teamNames2 += ">" + s.TeamName + "\n\n");
  157. }
  158. if (list_minus1day.Count > 0)
  159. {
  160. teamNames3 = "";
  161. foreach (var item in list_minus1day)
  162. {
  163. string endDt = item.VisitEndDate.ToString("yyyy-MM-dd");
  164. teamNames3 += ">(" + endDt + ")" + item.TeamName + " \n\n";
  165. }
  166. }
  167. string result = string.Format(@" `团组状态提醒`
  168. ><font color='warning'> - 下列团组将于7天内出发:</font>
  169. {0}
  170. ><font color='warning'> - 下列团组将于3天内结束:</font>
  171. {1}
  172. ><font color='warning'> - 下列团组已于昨日结束行程:</font>
  173. {2}
  174. <font color='info'>请注意检查合同、尾款状态</font>
  175. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", teamNames1, teamNames2, teamNames3);
  176. return result;
  177. }
  178. /// <summary>
  179. /// 日付申请提交时推送财务群
  180. /// </summary>
  181. /// <returns></returns>
  182. public static string DailyPayReminders_Create_ToCaiwuChat(DailyPayReminders_Create_ToCaiwuChatModel info)
  183. {
  184. string result = string.Format(@" `日付申请录入`
  185. <font color='comment'>- </font>{6}
  186. >费用名称:<font color='warning'>{0}</font>
  187. >公司:<font color='comment'>{5}</font>
  188. >费用标识:<font color='comment'>{4}</font>
  189. >付款金额:<font color='warning'>{1}</font>
  190. >申请人:{2}
  191. >申请时间:<font color='comment'>{3}</font>
  192. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.PriceName, info.Price, info.CreateUser, info.CreateDt, info.FeeSign, info.Company, info.TitleStr);
  193. return result;
  194. }
  195. /// <summary>
  196. /// 日付申请审核结果推送给申请人
  197. /// </summary>
  198. /// <returns></returns>
  199. public static string DailyPayReminder_Audit_ToUser(DailyPayReminder_Audit_ToUserModel info)
  200. {
  201. string result = string.Format(@" `日付申请`
  202. <font color='{0}'>{1}</font>
  203. >费用名称:{2}
  204. >付款金额:<font color='warning'>{3}</font>
  205. >审核时间:<font color='comment'>{4}</font>
  206. ", info.ResultColor, info.Result, info.PriceName, info.Price, info.AuditDate);
  207. return result;
  208. }
  209. /// <summary>
  210. /// 日付申请审核结果推送给财务群(总经理审核通过)
  211. /// </summary>
  212. /// <returns></returns>
  213. public static string DailyPayReminder_Audit_ToCaiwuChat(DailyPayReminder_Audit_ToCaiwuChatModel info)
  214. {
  215. string result = string.Format(@" `日付申请`
  216. <font color='info'> - 新增一笔通过总经理审核的日付申请</font>
  217. >费用名称:{0}
  218. >付款金额:<font color='warning'>{1}</font>
  219. >申请人:{2}
  220. >审核时间:<font color='comment'>{3}</font>
  221. ", info.PriceName, info.Price, info.CreateUser, info.AuditDate);
  222. return result;
  223. }
  224. /// <summary>
  225. /// 日付申请已付款推送给申请人
  226. /// </summary>
  227. /// <returns></returns>
  228. public static string DailyPayReminder_Pay_ToUser(DailyPayReminder_Pay_ToUserModel info)
  229. {
  230. string result = string.Format(@" `日付申请`
  231. <font color='info'>你有一笔日付申请费用已付款</font>
  232. >费用名称:{0}
  233. >付款金额:<font color='warning'>{1}</font>
  234. >支付时间:<font color='comment'>{2}</font>
  235. ", info.PriceName, info.Price, info.PayDt);
  236. return result;
  237. }
  238. /// <summary>
  239. /// 成本通知发送给用户
  240. /// </summary>
  241. /// <returns></returns>
  242. public static string GroupShare_ToUser(GroupShare_ToUserModel info)
  243. {
  244. string result = string.Format(@" `成本通知`
  245. <font color='info'>团组成本费用已更新</font>
  246. >团组名称:{0}
  247. >更新时间:<font color='warning'>{1}</font>
  248. ><font color='comment'>请注意在费用录入页面中核对成本信息</font>
  249. ><font color='comment'>若无对应团组权限请联系国交部经理或信息部人员</font>
  250. ", info.TeamName, info.RefreshDate);
  251. return result;
  252. }
  253. /// <summary>
  254. /// 出入境费用明细更改通知发送给用户
  255. /// </summary>
  256. /// <returns></returns>
  257. public static string GroupShare_ToGM(GroupShare_ToGMModel info)
  258. {
  259. string result = string.Format(@" `出入境费用明细操作通知`
  260. >团组:<font color='info'>{0}</font>
  261. >操作人员:{1}
  262. >操作时间:<font color='comment'>{2}</font>
  263. [请点击进入明细进行查看或确认]({3}) ", info.TeamName, info.CreateUser, info.RefreshDate, info.Url);
  264. return result;
  265. }
  266. /// <summary>
  267. /// 出入境费用 确认 通知发送给 财务相关人员
  268. /// </summary>
  269. /// <returns></returns>
  270. public static string GroupShare_ToFinance(GroupShare_ToUserModel info)
  271. {
  272. string result = string.Format(@" `出入境费用确认操作通知`
  273. >团组:<font color='info'>{0}</font>
  274. >操作时间:<font color='comment'>{1}</font>
  275. [出入境费用已确认,请进行相关流程操作。] ", info.TeamName, info.RefreshDate);
  276. return result;
  277. }
  278. }
  279. #region 实体类
  280. public class GroupShare_ToGMModel : GroupShare_ToUserModel
  281. {
  282. public string CreateUser { get; set; }
  283. public string Url { get; set; }
  284. }
  285. public class GroupShare_ToUserModel
  286. {
  287. public string TeamName { get; set; }
  288. public string RefreshDate { get; set; }
  289. }
  290. public class DailyPayReminder_Pay_ToUserModel
  291. {
  292. public string PriceName { get; set; }
  293. public string Price { get; set; }
  294. public string PayDt { get; set; }
  295. }
  296. public class DailyPayReminder_Audit_ToCaiwuChatModel
  297. {
  298. public string PriceName { get; set; }
  299. public string Price { get; set; }
  300. public string CreateUser { get; set; }
  301. public string AuditDate { get; set; }
  302. }
  303. public class DailyPayReminder_Audit_ToUserModel
  304. {
  305. public string ResultColor { get; set; } = "info"; //warning
  306. public string Result { get; set; } = "你有一笔日付申请已通过审核"; // 你有一笔日付申请未通过财务/总经理审核
  307. public string PriceName { get; set; }
  308. public string Price { get; set; }
  309. /// <summary>
  310. /// 财务或总经理审核时间
  311. /// </summary>
  312. public string AuditDate { get; set; }
  313. }
  314. public class DailyPayReminders_Create_ToCaiwuChatModel
  315. {
  316. public string PriceName { get; set; }
  317. public string Price { get; set; }
  318. public string CreateUser { get; set; }
  319. public string CreateDt { get; set; }
  320. public string FeeSign { get; set; }
  321. public string Company { get; set; }
  322. /// <summary>
  323. /// [更新]一项费用待审核
  324. /// </summary>
  325. public string TitleStr { get; set; } = "[新增]一项费用待审核";
  326. }
  327. public class PayResult_Group_ToUserModel
  328. {
  329. public string TeamName { get; set; }
  330. public string PriceModule { get; set; }
  331. public string PriceName { get; set; }
  332. public string Price { get; set; }
  333. public string PayDt { get; set; }
  334. }
  335. public class AuditResult_ApplyFee_GroupModel
  336. {
  337. public string Title { get; set; } = "团组费用审核结果";
  338. public string ResultColor { get; set; } = "info"; //info 或 warning
  339. public string Result { get; set; } = "总经理审核通过"; //总经理审核通过 或 总经理审核未通过
  340. public string TeamName { get; set; }
  341. public string PriceModule { get; set; }
  342. public string PriceName { get; set; }
  343. public string Price { get; set; }
  344. public string CreateUser { get; set; }
  345. public string GMAuditDate { get; set; }
  346. }
  347. public class GroupStatus_ApplyFeeModel
  348. {
  349. public string TeamName { get; set; }
  350. public string PriceModule { get; set; }
  351. public string PriceName { get; set; }
  352. public string Price { get; set; }
  353. public string CreateUser { get; set; }
  354. public string CreateDt { get; set; }
  355. public int QueueCount { get; set; }
  356. /// <summary>
  357. /// [更新]一项费用待审核
  358. /// </summary>
  359. public string TitleStr { get; set; } = "[新增]一项费用待审核";
  360. }
  361. public class GroupStatus_CreateModel
  362. {
  363. public string TeamName { get; set; }
  364. public string TeamDid_Text { get; set; }
  365. public string VisitDateRange { get; set; }
  366. public int VisitPNumber { get; set; }
  367. public int VisitDays { get; set; }
  368. public string ClientUnit { get; set; }
  369. public string ClientName { get; set; }
  370. }
  371. #endregion
  372. }