Config.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. using OASystem.Domain.Entities.Groups;
  2. using OASystem.Domain.ViewModels.CRM;
  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. /// <summary>
  39. /// 团组通知-国交群(3天内结束行程)
  40. /// </summary>
  41. [Description("GuoJiaoChat01")]
  42. GuoJiaoChat01,
  43. }
  44. public class MarkdownLib
  45. {
  46. /// <summary>
  47. /// 通知文本-确认出团
  48. /// </summary>
  49. /// <param name="info"></param>
  50. /// <returns></returns>
  51. public static string GroupStatus_Create(GroupStatus_CreateModel info)
  52. {
  53. string result = string.Format(@" `确认出团`
  54. >团组名称:<font color='info'>{0}</font>
  55. >团组类型:{1}
  56. >出访日期:<font color='comment'>{2}</font>
  57. >出访人数/天数:{3}人/{4}天
  58. >客户单位:{5}
  59. >客户名称:{6}
  60. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)
  61. ", info.TeamName, info.TeamDid_Text, info.VisitDateRange, info.VisitPNumber, info.VisitDays, info.ClientUnit, info.ClientName);
  62. return result;
  63. }
  64. /// <summary>
  65. /// 通知文本-费用申请
  66. /// </summary>
  67. /// <returns></returns>
  68. public static string GroupStatus_ApplyFee(GroupStatus_ApplyFeeModel info)
  69. {
  70. string result = string.Format(@" `团组费用录入`
  71. >团组:<font color='info'>{0}</font>
  72. <font color='comment'>- </font>{7}
  73. >费用模块:{1}
  74. >费用名称:<font color='warning'>{2}</font>
  75. >付款金额:<font color='warning'>{3}</font>
  76. >申请人:{4}
  77. >申请时间:<font color='comment'>{5}</font>
  78. <font color='comment'>- </font>当前团组费用待审核数量: {6}
  79. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.TeamName, info.PriceModule, info.PriceName, info.Price, info.CreateUser, info.CreateDt, info.QueueCount, info.TitleStr);
  80. return result;
  81. }
  82. /// <summary>
  83. /// 费用审核通知-团组费用-群聊
  84. /// </summary>
  85. /// <param name="info"></param>
  86. /// <returns></returns>
  87. public static string AuditResult_ApplyFee_Chat(AuditResult_ApplyFee_GroupModel info)
  88. {
  89. string result = string.Format(@" `{0}`
  90. <font color='{1}'>{2}</font>
  91. >审核时间:<font color='comment'>{8}</font>
  92. >团组:{3}
  93. >费用模块:{4}
  94. >费用名称:<font color='warning'>{5}</font>
  95. >付款金额:<font color='warning'>{6}</font>
  96. >申请人:{7}
  97. [详细信息请前往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);
  98. return result;
  99. }
  100. /// <summary>
  101. /// 费用审核通知-团组费用-用户
  102. /// </summary>
  103. /// <param name="info"></param>
  104. /// <returns></returns>
  105. public static string AuditResult_ApplyFee_User(AuditResult_ApplyFee_GroupModel info)
  106. {
  107. string result = string.Format(@" `{0}`
  108. <font color='{1}'>{2}</font>
  109. >审核时间:<font color='comment'>{7}</font>
  110. >团组:{3}
  111. >费用模块:{4}
  112. >费用名称:<font color='warning'>{5}</font>
  113. >付款金额:<font color='warning'>{6}</font>
  114. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.Title, info.ResultColor, info.Result, info.TeamName, info.PriceModule, info.PriceName, info.Price, info.GMAuditDate);
  115. return result;
  116. }
  117. /// <summary>
  118. /// 费用支付通知-团组费用-用户
  119. /// </summary>
  120. /// <param name="info"></param>
  121. /// <returns></returns>
  122. public static string PayResult_Group_ToUser(PayResult_Group_ToUserModel info)
  123. {
  124. string result = string.Format(@" `团组费用支付`
  125. >团组:{0}
  126. >费用模块:{1}
  127. >费用名称:<font color='warning'>{2}</font>
  128. >付款金额:<font color='warning'>{3}</font>
  129. ><font color='info'>该笔费用已支付</font>
  130. >支付时间:<font color='comment'>{4}</font>
  131. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.TeamName, info.PriceModule, info.PriceName, info.Price, info.PayDt);
  132. return result;
  133. }
  134. /// <summary>
  135. /// 团组出发前一周提醒财务检查合同、尾款
  136. /// </summary>
  137. /// <returns></returns>
  138. public static string GroupRemindersToGuojiao(List<Grp_DelegationInfo> list_3day)
  139. {
  140. string teamNames2 = "><font color='comment'>暂无</font>";
  141. if (list_3day.Count > 0)
  142. {
  143. teamNames2 = "";
  144. foreach (var item in list_3day)
  145. {
  146. string endDt = item.VisitEndDate.ToString("yyyy-MM-dd");
  147. teamNames2 += ">(" + endDt + ")" + item.TeamName + " \n\n";
  148. }
  149. //list_3day.ForEach(s => teamNames2 += ">" + s.TeamName + "\n\n");
  150. }
  151. string result = string.Format(@" `团组行程结束提醒`
  152. ><font color='warning'> - 下列团组将于3天内结束:</font>
  153. {0}
  154. <font color='info'>请各位注意检查业务费用是否录入完整</font>
  155. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", teamNames2);
  156. return result;
  157. }
  158. /// <summary>
  159. /// 团组出发前一周提醒HR
  160. /// </summary>
  161. /// <returns></returns>
  162. public static string GroupRemindersToHR(List<Grp_DelegationInfo> list_7day)
  163. {
  164. string teamNames2 = "><font color='comment'>暂无</font>";
  165. if (list_7day.Count > 0)
  166. {
  167. teamNames2 = "";
  168. foreach (var item in list_7day)
  169. {
  170. string startDt = item.VisitStartDate.ToString("yyyy-MM-dd");
  171. teamNames2 += ">(" + startDt + ")" + item.TeamName + " \n\n";
  172. }
  173. }
  174. string result = string.Format(@" `团组行程提醒`
  175. ><font color='warning'> - 下列团组将于7天内出发:</font>
  176. {0}
  177. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", teamNames2);
  178. return result;
  179. }
  180. /// <summary>
  181. /// 团组出发前一周提醒财务检查合同、尾款
  182. /// </summary>
  183. /// <returns></returns>
  184. public static string GroupRemindersToCaiwuChat(List<Grp_DelegationInfo> list_7day, List<Grp_DelegationInfo> list_3day, List<Grp_DelegationInfo> list_minus1day)
  185. {
  186. string teamNames1 = "><font color='comment'>暂无</font>";
  187. string teamNames2 = "><font color='comment'>暂无</font>";
  188. string teamNames3 = "><font color='comment'>暂无</font>";
  189. if (list_7day.Count > 0)
  190. {
  191. teamNames1 = "";
  192. foreach (var item in list_7day)
  193. {
  194. string startDt = item.VisitStartDate.ToString("yyyy-MM-dd");
  195. teamNames1 += ">(" + startDt + ")" + item.TeamName + " \n\n";
  196. }
  197. //list_7day.ForEach(s => teamNames1 += ">" + s.TeamName + "\n\n");
  198. }
  199. if (list_3day.Count > 0)
  200. {
  201. teamNames2 = "";
  202. foreach (var item in list_3day)
  203. {
  204. string endDt = item.VisitEndDate.ToString("yyyy-MM-dd");
  205. teamNames2 += ">(" + endDt + ")" + item.TeamName + " \n\n";
  206. }
  207. //list_3day.ForEach(s => teamNames2 += ">" + s.TeamName + "\n\n");
  208. }
  209. if (list_minus1day.Count > 0)
  210. {
  211. teamNames3 = "";
  212. foreach (var item in list_minus1day)
  213. {
  214. string endDt = item.VisitEndDate.ToString("yyyy-MM-dd");
  215. teamNames3 += ">(" + endDt + ")" + item.TeamName + " \n\n";
  216. }
  217. }
  218. string result = string.Format(@" `团组状态提醒`
  219. ><font color='warning'> - 下列团组将于7天内出发:</font>
  220. {0}
  221. ><font color='warning'> - 下列团组将于3天内结束:</font>
  222. {1}
  223. ><font color='warning'> - 下列团组已于昨日结束行程:</font>
  224. {2}
  225. <font color='info'>请注意检查合同、尾款状态</font>
  226. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", teamNames1, teamNames2, teamNames3);
  227. return result;
  228. }
  229. /// <summary>
  230. /// 日付申请提交时推送财务群
  231. /// </summary>
  232. /// <returns></returns>
  233. public static string DailyPayReminders_Create_ToCaiwuChat(DailyPayReminders_Create_ToCaiwuChatModel info)
  234. {
  235. string result = string.Format(@" `日付申请录入`
  236. <font color='comment'>- </font>{6}
  237. >费用名称:<font color='warning'>{0}</font>
  238. >公司:<font color='comment'>{5}</font>
  239. >费用标识:<font color='comment'>{4}</font>
  240. >付款金额:<font color='warning'>{1}</font>
  241. >申请人:{2}
  242. >申请时间:<font color='comment'>{3}</font>
  243. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.PriceName, info.Price, info.CreateUser, info.CreateDt, info.FeeSign, info.Company, info.TitleStr);
  244. return result;
  245. }
  246. /// <summary>
  247. /// 日付申请审核结果推送给申请人
  248. /// </summary>
  249. /// <returns></returns>
  250. public static string DailyPayReminder_Audit_ToUser(DailyPayReminder_Audit_ToUserModel info)
  251. {
  252. string result = string.Format(@" `日付申请`
  253. <font color='{0}'>{1}</font>
  254. >费用名称:{2}
  255. >付款金额:<font color='warning'>{3}</font>
  256. >审核时间:<font color='comment'>{4}</font>
  257. ", info.ResultColor, info.Result, info.PriceName, info.Price, info.AuditDate);
  258. return result;
  259. }
  260. /// <summary>
  261. /// 日付申请审核结果推送给财务群(总经理审核通过)
  262. /// </summary>
  263. /// <returns></returns>
  264. public static string DailyPayReminder_Audit_ToCaiwuChat(DailyPayReminder_Audit_ToCaiwuChatModel info)
  265. {
  266. string result = string.Format(@" `日付申请`
  267. <font color='info'> - 新增一笔通过总经理审核的日付申请</font>
  268. >费用名称:{0}
  269. >付款金额:<font color='warning'>{1}</font>
  270. >申请人:{2}
  271. >审核时间:<font color='comment'>{3}</font>
  272. ", info.PriceName, info.Price, info.CreateUser, info.AuditDate);
  273. return result;
  274. }
  275. /// <summary>
  276. /// 日付申请已付款推送给申请人
  277. /// </summary>
  278. /// <returns></returns>
  279. public static string DailyPayReminder_Pay_ToUser(DailyPayReminder_Pay_ToUserModel info)
  280. {
  281. string result = string.Format(@" `日付申请`
  282. <font color='info'>你有一笔日付申请费用已付款</font>
  283. >费用名称:{0}
  284. >付款金额:<font color='warning'>{1}</font>
  285. >支付时间:<font color='comment'>{2}</font>
  286. ", info.PriceName, info.Price, info.PayDt);
  287. return result;
  288. }
  289. /// <summary>
  290. /// 成本通知发送给用户
  291. /// </summary>
  292. /// <returns></returns>
  293. public static string GroupShare_ToUser(GroupShare_ToUserModel info)
  294. {
  295. string result = string.Format(@" `成本通知`
  296. <font color='info'>团组成本费用已更新</font>
  297. >团组名称:{0}
  298. >更新时间:<font color='warning'>{1}</font>
  299. ><font color='comment'>请注意在费用录入页面中核对成本信息</font>
  300. ><font color='comment'>若无对应团组权限请联系国交部经理或信息部人员</font>
  301. ", info.TeamName, info.RefreshDate);
  302. return result;
  303. }
  304. /// <summary>
  305. /// 出入境费用明细更改通知发送给用户
  306. /// </summary>
  307. /// <returns></returns>
  308. public static string GroupShare_ToGM(GroupShare_ToGMModel info)
  309. {
  310. string result = string.Format(@" `出入境费用明细操作通知`
  311. >团组:<font color='info'>{0}</font>
  312. >操作人员:{1}
  313. >操作时间:<font color='comment'>{2}</font>
  314. [请点击进入明细进行查看或确认]({3}) ", info.TeamName, info.CreateUser, info.RefreshDate, info.Url);
  315. return result;
  316. }
  317. /// <summary>
  318. /// 出入境费用 确认 通知发送给 财务相关人员
  319. /// </summary>
  320. /// <returns></returns>
  321. public static string GroupShare_ToFinance(GroupShare_ToUserModel info)
  322. {
  323. string result = string.Format(@" `出入境费用确认操作通知`
  324. >团组:<font color='info'>{0}</font>
  325. >操作时间:<font color='comment'>{1}</font>
  326. [出入境费用已确认,请进行相关流程操作。] ", info.TeamName, info.RefreshDate);
  327. return result;
  328. }
  329. /// <summary>
  330. /// CRM统计通知(周)
  331. /// </summary>
  332. /// <param name="info"></param>
  333. /// <returns></returns>
  334. public static string CRMStatistics_ToUser(List<CRMWeekStatisticsView> list, string beginDt, string endDt)
  335. {
  336. string users = "暂无";
  337. if (list.Count > 0)
  338. {
  339. users = "";
  340. foreach (var item in list)
  341. {
  342. users += ">【" + item.UserName + "】 - 新增 " + item.InsertNum + " 条,删除 " + item.DeleteNum + " 条\n\n";
  343. }
  344. }
  345. string result = string.Format(@" `市场客户资料周统计({0} - {1})`
  346. {2}
  347. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", beginDt, endDt, users);
  348. return result;
  349. }
  350. /// <summary>
  351. /// CRM统计通知(月)
  352. /// </summary>
  353. /// <param name="info"></param>
  354. /// <returns></returns>
  355. public static string CRMStatistics_Month_ToUser(List<CRMWeekStatisticsView> list, string beginDt, string endDt, int totalInsert, int totalDelete)
  356. {
  357. string users = "暂无";
  358. if (list.Count > 0)
  359. {
  360. users = "";
  361. foreach (var item in list)
  362. {
  363. users += ">【" + item.UserName + "】 - 新增 " + item.InsertNum + " 条,删除 " + item.DeleteNum + " 条\n\n";
  364. }
  365. }
  366. string result = string.Format(@" `市场客户资料月统计({0} - {1})`
  367. > 总共 - 新增 <font color='info'>{3}</font> 条,删除 <font color='warning'> {4}</font> 条
  368. {2}
  369. [详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", beginDt, endDt, users, totalInsert, totalDelete);
  370. return result;
  371. }
  372. }
  373. #region 实体类
  374. public class GroupShare_ToGMModel : GroupShare_ToUserModel
  375. {
  376. public string CreateUser { get; set; }
  377. public string Url { get; set; }
  378. }
  379. public class GroupShare_ToUserModel
  380. {
  381. public string TeamName { get; set; }
  382. public string RefreshDate { get; set; }
  383. }
  384. public class DailyPayReminder_Pay_ToUserModel
  385. {
  386. public string PriceName { get; set; }
  387. public string Price { get; set; }
  388. public string PayDt { get; set; }
  389. }
  390. public class DailyPayReminder_Audit_ToCaiwuChatModel
  391. {
  392. public string PriceName { get; set; }
  393. public string Price { get; set; }
  394. public string CreateUser { get; set; }
  395. public string AuditDate { get; set; }
  396. }
  397. public class DailyPayReminder_Audit_ToUserModel
  398. {
  399. public string ResultColor { get; set; } = "info"; //warning
  400. public string Result { get; set; } = "你有一笔日付申请已通过审核"; // 你有一笔日付申请未通过财务/总经理审核
  401. public string PriceName { get; set; }
  402. public string Price { get; set; }
  403. /// <summary>
  404. /// 财务或总经理审核时间
  405. /// </summary>
  406. public string AuditDate { get; set; }
  407. }
  408. public class DailyPayReminders_Create_ToCaiwuChatModel
  409. {
  410. public string PriceName { get; set; }
  411. public string Price { get; set; }
  412. public string CreateUser { get; set; }
  413. public string CreateDt { get; set; }
  414. public string FeeSign { get; set; }
  415. public string Company { get; set; }
  416. /// <summary>
  417. /// [更新]一项费用待审核
  418. /// </summary>
  419. public string TitleStr { get; set; } = "[新增]一项费用待审核";
  420. }
  421. public class PayResult_Group_ToUserModel
  422. {
  423. public string TeamName { get; set; }
  424. public string PriceModule { get; set; }
  425. public string PriceName { get; set; }
  426. public string Price { get; set; }
  427. public string PayDt { get; set; }
  428. }
  429. public class AuditResult_ApplyFee_GroupModel
  430. {
  431. public string Title { get; set; } = "团组费用审核结果";
  432. public string ResultColor { get; set; } = "info"; //info 或 warning
  433. public string Result { get; set; } = "总经理审核通过"; //总经理审核通过 或 总经理审核未通过
  434. public string TeamName { get; set; }
  435. public string PriceModule { get; set; }
  436. public string PriceName { get; set; }
  437. public string Price { get; set; }
  438. public string CreateUser { get; set; }
  439. public string GMAuditDate { get; set; }
  440. }
  441. public class GroupStatus_ApplyFeeModel
  442. {
  443. public string TeamName { get; set; }
  444. public string PriceModule { get; set; }
  445. public string PriceName { get; set; }
  446. public string Price { get; set; }
  447. public string CreateUser { get; set; }
  448. public string CreateDt { get; set; }
  449. public int QueueCount { get; set; }
  450. /// <summary>
  451. /// [更新]一项费用待审核
  452. /// </summary>
  453. public string TitleStr { get; set; } = "[新增]一项费用待审核";
  454. }
  455. public class GroupStatus_CreateModel
  456. {
  457. public string TeamName { get; set; }
  458. public string TeamDid_Text { get; set; }
  459. public string VisitDateRange { get; set; }
  460. public int VisitPNumber { get; set; }
  461. public int VisitDays { get; set; }
  462. public string ClientUnit { get; set; }
  463. public string ClientName { get; set; }
  464. }
  465. #endregion
  466. }