Config.cs 21 KB

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