You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

623 lines
25 KiB

  1. using Learun.Application.Organization;
  2. using Learun.Application.TwoDevelopment.EducationalAdministration;
  3. using Learun.Application.TwoDevelopment.LR_Desktop;
  4. using Learun.Util;
  5. using Learun.Util.Operat;
  6. using Microsoft.AspNet.SignalR.Client;
  7. using Newtonsoft.Json;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Configuration;
  11. using System.Data;
  12. using System.Linq;
  13. using System.Threading.Tasks;
  14. using System.Web;
  15. using System.Web.Mvc;
  16. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  17. {
  18. /// <summary>
  19. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  20. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  21. /// 创 建:超级管理员
  22. /// 日 期:2019-02-27 11:05
  23. /// 描 述:排课
  24. /// </summary>
  25. public class ArrangeLessonTermController : MvcControllerBase
  26. {
  27. private ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL();
  28. private ArrangeLessonTermOfElectiveIBLL arrangeLessonTermOfElectiveIBLL = new ArrangeLessonTermOfElectiveBLL();
  29. private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL();
  30. private UserIBLL userIbll = new UserBLL();
  31. private WeChatConfigIBLL weChatConfigIbll = new WeChatConfigBLL();
  32. private WeChatTempletIBLL weChatTempletIbll = new WeChatTempletBLL();
  33. private SchoolCalendarIBLL schoolCalendarIbll = new SchoolCalendarBLL();
  34. private StuInfoBasicIBLL stuInfoBasicIbll = new StuInfoBasicBLL();
  35. private EmpInfoIBLL empInfoIbll = new EmpInfoBLL();
  36. private StuAttendanceLeaveIBLL stuAttendanceLeaveIBLL = new StuAttendanceLeaveBLL();
  37. #region 视图功能
  38. /// <summary>
  39. /// 主页面
  40. /// <summary>
  41. /// <returns></returns>
  42. [HttpGet]
  43. public ActionResult Index()
  44. {
  45. return View();
  46. }
  47. /// <summary>
  48. /// 表单页
  49. /// <summary>
  50. /// <returns></returns>
  51. [HttpGet]
  52. public ActionResult Form()
  53. {
  54. return View();
  55. }
  56. /// <summary>
  57. /// 按条件清空排课数据
  58. /// <summary>
  59. /// <returns></returns>
  60. [HttpGet]
  61. public ActionResult EmptyByConditionForm()
  62. {
  63. return View();
  64. }
  65. /// <summary>
  66. /// 按条件同步排课数据
  67. /// <summary>
  68. /// <returns></returns>
  69. [HttpGet]
  70. public ActionResult SyncByConditionForm()
  71. {
  72. return View();
  73. }
  74. [HttpGet]
  75. public ActionResult ClearByConditionForm()
  76. {
  77. return View();
  78. }
  79. [HttpGet]
  80. public ActionResult IndexLessonTerm()
  81. {
  82. return View();
  83. }
  84. /// <summary>
  85. /// 学生课表
  86. /// </summary>
  87. /// <returns></returns>
  88. [HttpGet]
  89. public ActionResult IndexLessonTermStu()
  90. {
  91. var LogInfo = LoginUserInfo.Get();
  92. if (LogInfo.Description == "学生")
  93. {
  94. var StuInfo = stuInfoBasicIbll.GetAllList().Where(x => x.StuNo == LogInfo.account);
  95. if (StuInfo != null)
  96. {
  97. ViewBag.ClassNo = StuInfo.FirstOrDefault().ClassNo;
  98. }
  99. }
  100. return View();
  101. }
  102. /// <summary>
  103. /// 教师课表
  104. /// </summary>
  105. /// <returns></returns>
  106. [HttpGet]
  107. public ActionResult IndexLessonTermTeach()
  108. {
  109. var LogInfo = LoginUserInfo.Get();
  110. if (LogInfo.Description == "教师")
  111. {
  112. var empInfo = empInfoIbll.GetAllList().Where(x => x.EmpNo == LogInfo.account);
  113. if (empInfo != null)
  114. {
  115. ViewBag.EmpNo = empInfo.FirstOrDefault().EmpNo;
  116. }
  117. }
  118. return View();
  119. }
  120. #endregion
  121. #region 获取数据
  122. /// <summary>
  123. /// 获取列表数据
  124. /// <summary>
  125. /// <returns></returns>
  126. [HttpGet]
  127. [AjaxOnly]
  128. public ActionResult GetList(string queryJson)
  129. {
  130. var data = arrangeLessonTermIBLL.GetList(queryJson).ToList()
  131. .OrderBy(x => x.AcademicYearNo).ThenBy(x => x.Semester).ThenBy(x => x.DeptNo).ThenBy(x => x.MajorNo).ThenBy(x => x.LessonNo).ThenBy(x => x.TeachClassNo.Replace(x.LessonName, "")).ThenBy(x => x.EmpNo).ThenBy(x => x.ClassroomNo).ThenBy(x => x.LessonDate);
  132. return Success(data);
  133. }
  134. /// <summary>
  135. /// 获取列表分页数据
  136. /// <param name="pagination">分页参数</param>
  137. /// <summary>
  138. /// <returns></returns>
  139. [HttpGet]
  140. [AjaxOnly]
  141. public ActionResult GetPageList(string pagination, string queryJson)
  142. {
  143. Pagination paginationobj = pagination.ToObject<Pagination>();
  144. var data = arrangeLessonTermIBLL.GetPageList(paginationobj, queryJson);
  145. var jsonData = new
  146. {
  147. rows = data,
  148. total = paginationobj.total,
  149. page = paginationobj.page,
  150. records = paginationobj.records
  151. };
  152. return Success(jsonData);
  153. }
  154. /// <summary>
  155. /// 排课管理 获取左侧树结构
  156. /// <summary>
  157. /// <returns></returns>
  158. [HttpGet]
  159. [AjaxOnly]
  160. public ActionResult GetTree()
  161. {
  162. var data = arrangeLessonTermIBLL.GetTree();
  163. return Success(data);
  164. }
  165. /// <summary>
  166. /// 获取表单数据
  167. /// <param name="keyValue">主键</param>
  168. /// <summary>
  169. /// <returns></returns>
  170. [HttpGet]
  171. [AjaxOnly]
  172. public ActionResult GetFormData(string keyValue)
  173. {
  174. var data = arrangeLessonTermIBLL.GetEntity(keyValue);
  175. return Success(data);
  176. }
  177. /// <summary>
  178. /// 获取周次
  179. /// <summary>
  180. /// <returns></returns>
  181. [HttpGet]
  182. [AjaxOnly]
  183. public ActionResult GetWeekTime()
  184. {
  185. int weekTimes = 0;
  186. int curWeek = 0;
  187. //开始时间
  188. var startdate = DateTime.Today;
  189. var startDate = Common.CalculateFirstDateOfWeek(startdate).ToString("yyyy-MM-dd");
  190. //var endDate = Common.CalculateLastDateOfWeek(startdate).ToString("yyyy-MM-dd");
  191. var semesterAndYear = Common.GetSemesterAndYear(startDate);
  192. //var strAcademicYear = semesterAndYear.AcademicYearShort;
  193. //var strSemester = semesterAndYear.Semester;
  194. var entity = schoolCalendarIbll.GetSchoolCalendarEntityByNo(semesterAndYear.AcademicYearShort, semesterAndYear.Semester);
  195. if (entity.StartTime.HasValue && entity.EndTime.HasValue)
  196. {
  197. weekTimes = GetYearWeekCount(entity.StartTime.Value, entity.EndTime.Value);
  198. curWeek = WeekOfYear(startdate, entity.StartTime.Value, entity.EndTime.Value);
  199. }
  200. var listObj = new List<Object>();
  201. for (int i = 1; i <= weekTimes; i++)
  202. {
  203. listObj.Add(new { text = i + "周", value = i });
  204. }
  205. var jsonData = new
  206. {
  207. weekList = listObj,
  208. curWeek = curWeek,
  209. };
  210. return Success(jsonData);
  211. }
  212. /// <summary>
  213. /// 有多少周
  214. /// 返回 int
  215. /// </summary>
  216. /// <returns>int</returns>
  217. private static int GetYearWeekCount(DateTime startTime, DateTime endTime)
  218. {
  219. string returnStr = "";
  220. var startDate = DateTime.Parse(Common.CalculateFirstDateOfWeek(startTime).ToString("yyyy-MM-dd"));
  221. //int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几
  222. int countDay = endTime.Subtract(startDate).Days;
  223. int countWeek = countDay / 14 + 1;
  224. return countWeek;
  225. }
  226. /// <summary>
  227. /// 求当前日期是第几周
  228. /// </summary>
  229. /// <param name="date"></param>
  230. /// <returns></returns>
  231. private static int WeekOfYear(DateTime curDay, DateTime startTime, DateTime endTime)
  232. {
  233. int firstdayofweek = Convert.ToInt32(startTime.DayOfWeek);
  234. var startDate = DateTime.Parse(Common.CalculateFirstDateOfWeek(startTime).ToString("yyyy-MM-dd"));
  235. int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几
  236. int days = curDay.Subtract(startTime).Days;
  237. //int days = curDay.DayOfYear;
  238. int daysOutOneWeek = days - (14 - firstdayofweek);
  239. if (daysOutOneWeek <= 0)
  240. {
  241. return 1;
  242. }
  243. else
  244. {
  245. int weeks = daysOutOneWeek / 14;
  246. if (daysOutOneWeek % 14 != 0)
  247. weeks++;
  248. return weeks + 1;
  249. }
  250. }
  251. /// <summary>
  252. /// 课程表【教务】
  253. /// </summary>
  254. /// <param name="classNo">班级</param>
  255. /// <param name="curWeek">当前第几周</param>
  256. /// <returns></returns>
  257. [HttpGet]
  258. [AjaxOnly]
  259. public ActionResult GetDataInEducation(string classNo, int curWeek)
  260. {
  261. var userInfo = LoginUserInfo.Get();
  262. //开始时间
  263. var startdate = DateTime.Today;
  264. var startDate = Common.CalculateFirstDateOfWeek(startdate).ToString("yyyy-MM-dd");
  265. var endDate = Common.CalculateLastDateOfWeek(startdate).ToString("yyyy-MM-dd");
  266. var semesterAndYear = Common.GetSemesterAndYear(startDate);
  267. var strAcademicYear = semesterAndYear.AcademicYearLong;
  268. var strSemester = semesterAndYear.Semester;
  269. if (string.IsNullOrEmpty(classNo))
  270. {
  271. if (userInfo.Description != "教师")
  272. {
  273. var res = new
  274. { schoolName = "课程表", semester = $"{strAcademicYear}学年度 第{strSemester}学期", weekList = "" };
  275. return JsonResult(res);
  276. }
  277. }
  278. //校历
  279. var entity = schoolCalendarIbll.GetSchoolCalendarEntityByNo(semesterAndYear.AcademicYearShort, semesterAndYear.Semester);
  280. var StartTime = entity.StartTime.Value;
  281. //根据第几周,计算查询的开始和结束日期
  282. startDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 14))).ToString("yyyy-MM-dd");//StartTime.AddDays(((curWeek - 1) * 14)).ToString("yyyy-MM-dd");
  283. if (curWeek == 1 && Convert.ToDateTime(startDate) < StartTime)
  284. {
  285. startDate = StartTime.ToString("yyyy-MM-dd");
  286. }
  287. endDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 14))).AddDays(10)
  288. .ToString("yyyy-MM-dd");// StartTime.AddDays(((curWeek - 1) * 14)).AddDays(10).ToString("yyyy-MM-dd");
  289. var timeTableList = new List<TimeTable>();
  290. //课程表
  291. var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  292. if (!string.IsNullOrEmpty(classNo))
  293. {
  294. var PKRoleId = Config.GetValue("PKRoleId");
  295. var loginInfoRoleIds = LoginUserInfo.Get().roleIds;
  296. if (loginInfoRoleIds.IndexOf(',') == -1)
  297. {
  298. if (loginInfoRoleIds == PKRoleId)
  299. {
  300. data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  301. }
  302. }
  303. else
  304. {
  305. if (loginInfoRoleIds.Split(',').Contains(PKRoleId))
  306. {
  307. data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  308. }
  309. }
  310. }
  311. else
  312. {
  313. if (userInfo.Description == "学生")
  314. {
  315. data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  316. }
  317. else if (userInfo.Description == "教师")
  318. {
  319. var empInfo = empInfoIbll.GetAllList().Where(x => x.EmpNo == userInfo.account);
  320. if (empInfo != null)
  321. {
  322. data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, "", empInfo.FirstOrDefault().EmpNo, "");
  323. }
  324. }
  325. else
  326. {
  327. data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  328. }
  329. }
  330. timeTableList.AddRange(data);
  331. //选修课课程表
  332. //var dataOfElective = arrangeLessonTermOfElectiveIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  333. //timeTableList.AddRange(dataOfElective);
  334. var timeTables = timeTableList.ToList();
  335. var noDataResult = new
  336. { schoolName = "课程表", semester = $"{strAcademicYear}学年度 第{strSemester}学期", weekList = "" };
  337. if (!timeTables.Any())
  338. {
  339. return JsonResult(noDataResult);
  340. }
  341. //学生课表请假记录
  342. var leaveList = stuAttendanceLeaveIBLL.GetListByJson("{\"StuNo\":\"" + userInfo.account + "\"}");
  343. var formatData = from d in timeTables.AsEnumerable()
  344. let tt = d.LessonTime.Split('-')[1]
  345. group d by tt into g
  346. orderby g.Key
  347. select new
  348. {
  349. time = g.Key,
  350. list = from e in timeTables.AsEnumerable()
  351. let ee = e.LessonTime.Split('-')[1]
  352. where ee == g.Key
  353. select new
  354. {
  355. ALTId = e.ALTId,
  356. day = e.LessonTime.Split('-')[0],
  357. curriculum = e.LessonSortNo == "2" ? e.LessonName + "[选修]" : e.LessonName,
  358. teacher = e?.EmpName,
  359. classRoom = string.IsNullOrEmpty(e.ClassroomName) ? "" : e.ClassroomName.Trim(),
  360. academicyear = semesterAndYear.AcademicYearShort,
  361. semester = strSemester,
  362. lessonNo = e?.LessonNo,
  363. teachClassNo = e?.TeachClassNo,
  364. empno = e?.EmpNo,
  365. lessonTime = e.LessonTime,
  366. lessonDate = e.LessonDate.ToString("yyyy-MM-dd"),
  367. classRoomNo = string.IsNullOrEmpty(e.ClassRoomNo) ? "" : e.ClassRoomNo.Trim(),
  368. lessonSortNo = e.LessonSortNo,
  369. e?.OLPEId,
  370. className = string.IsNullOrEmpty(e.ClassName) ? "" : e.ClassName,
  371. leaveType = leaveList.Any(c => c.LessonNo == e?.LessonNo && c.LessonDate == e.LessonDate && c.LessonTime == e.LessonTime) ? 1 : 0,
  372. checkType = leaveList.FirstOrDefault(c => c.LessonNo == e?.LessonNo && c.LessonDate == e.LessonDate && c.LessonTime == e.LessonTime)?.IsCheck,
  373. }
  374. }
  375. ;
  376. var result = new
  377. { schoolName = "课程表", semester = $"{strAcademicYear}学年度 第{strSemester}学期", weekList = formatData };
  378. return JsonResult(result);
  379. }
  380. #endregion
  381. #region 提交数据
  382. /// <summary>
  383. /// 删除实体数据
  384. /// <param name="keyValue">主键</param>
  385. /// <summary>
  386. /// <returns></returns>
  387. [HttpPost]
  388. [AjaxOnly]
  389. public ActionResult DeleteForm(string keyValue)
  390. {
  391. arrangeLessonTermIBLL.DeleteEntity(keyValue);
  392. return Success("删除成功!");
  393. }
  394. /// <summary>
  395. /// 保存实体数据(新增、修改)
  396. /// <param name="keyValue">主键</param>
  397. /// <summary>
  398. /// <returns></returns>
  399. [HttpPost]
  400. [ValidateAntiForgeryToken]
  401. [AjaxOnly]
  402. public ActionResult SaveForm(string keyValue, ArrangeLessonTermEntity entity)
  403. {
  404. arrangeLessonTermIBLL.SaveEntity(keyValue, entity);
  405. return Success("保存成功!");
  406. }
  407. /// <summary>
  408. /// 删除课程
  409. /// <param name="keyValue">主键</param>
  410. /// <summary>
  411. /// <returns></returns>
  412. [HttpPost]
  413. [AjaxOnly]
  414. public ActionResult DeleteLessonTerm(string keyValue, string WeekTime)
  415. {
  416. arrangeLessonTermIBLL.DeleteLessonTerm(keyValue, WeekTime);
  417. return Success("删除成功!");
  418. }
  419. /// <summary>
  420. ///修改课程
  421. /// <param name="keyValue">主键</param>
  422. /// <summary>
  423. /// <returns></returns>
  424. [HttpPost]
  425. [AjaxOnly]
  426. public ActionResult UpdateLessonTerm(string keyValue, string postdata)
  427. {
  428. UpdateLessonTermEntity model = postdata.ToObject<UpdateLessonTermEntity>();
  429. var res = arrangeLessonTermIBLL.UpdateLessonTerm(keyValue, model);
  430. if (!string.IsNullOrEmpty(res))
  431. {
  432. return Fail(res);
  433. }
  434. return Success("操作成功!");
  435. }
  436. #endregion
  437. /// <summary>
  438. /// 当前学期排课数据同步
  439. /// </summary>
  440. /// <returns></returns>
  441. [HttpGet]
  442. [AjaxOnly]
  443. public async Task<ActionResult> AsyncArrangeLessonData()
  444. {
  445. var data = await arrangeLessonTermIBLL.AsyncArrangeLessonData();
  446. return Success(data);
  447. }
  448. /// <summary>
  449. /// 清空当前学期排课数据
  450. /// </summary>
  451. /// <returns></returns>
  452. [HttpGet]
  453. [AjaxOnly]
  454. public async Task<ActionResult> AsyncModifyArrangeLessonData()
  455. {
  456. var data = await arrangeLessonTermIBLL.AsyncModifyArrangeLessonData();
  457. return Success(data);
  458. }
  459. /// <summary>
  460. /// 按条件清空排课数据
  461. /// </summary>
  462. /// <returns></returns>
  463. [HttpPost]
  464. [AjaxOnly]
  465. public async Task<ActionResult> AsyncModifyArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
  466. {
  467. var data = await arrangeLessonTermIBLL.AsyncModifyArrangeLessonDataByCondition(entity);
  468. return Success(data);
  469. }
  470. /// <summary>
  471. /// 按条件同步排课数据
  472. /// </summary>
  473. /// <returns></returns>
  474. [HttpPost]
  475. [AjaxOnly]
  476. public async Task<ActionResult> AsyncArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
  477. {
  478. var data = await arrangeLessonTermIBLL.AsyncArrangeLessonDataByCondition(entity);
  479. if (data)
  480. {
  481. //读取信息推送管理-课表同步推送(09)的配置
  482. var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("09");
  483. if (informationPushEntity != null && informationPushEntity.Status == true)
  484. {
  485. var title = string.Format("{0}学年第{1}学期必修课课表同步", entity.AcademicYearNo, entity.Semester);
  486. var needpostuserlist = userIbll.GetAllList().Where(m => m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师").ToList();
  487. //微信推送
  488. try
  489. {
  490. PushWeixin(needpostuserlist, title);
  491. }
  492. catch (Exception e)
  493. {
  494. }
  495. //飞星推送
  496. await Task.Run(async () =>
  497. {
  498. using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"]))
  499. {
  500. var hubProxy = hubConnection.CreateHubProxy("SignalRHub");
  501. await hubConnection.Start();
  502. await hubProxy.Invoke("PushAnnouncement", LoginUserInfo.Get().userId, "课表同步", Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(title)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(title)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(title)).Substring(0, 20), "synclesson", string.Join(",", needpostuserlist.Select(m => m.F_UserId)), "");
  503. }
  504. });
  505. }
  506. }
  507. return Success(data);
  508. }
  509. /// <summary>
  510. /// 按条件重置基础数据同步状态
  511. /// </summary>
  512. /// <param name="entity"></param>
  513. /// <returns></returns>
  514. [HttpPost]
  515. [AjaxOnly]
  516. public ActionResult InitAsyncDataByCondition(ArrangeLessonTermEntity entity)
  517. {
  518. var data = arrangeLessonTermIBLL.InitAsyncDataByCondition(entity);
  519. return Success(data);
  520. }
  521. public void PushWeixin(List<UserEntity> needpostuserlist, string title)
  522. {
  523. var WeChatConfigentity = weChatConfigIbll.GetEnableEntity();
  524. string appid = WeChatConfigentity.APPId;
  525. string secret = WeChatConfigentity.secret;
  526. var wechatemplete = weChatTempletIbll.GetWeChatTemplateEntityByCodeConfigId(WeChatConfigentity.ID, "task");
  527. string weixintaskurl = wechatemplete.TUrl;
  528. string weixintasktempid = wechatemplete.TempId;
  529. var responsejson = Util.HttpMethods.HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret);
  530. OperateLogModel operateLogModel = new OperateLogModel();
  531. operateLogModel.title = title;
  532. operateLogModel.type = OperationType.Other;
  533. operateLogModel.url = "ArrangeLessonTermController";
  534. operateLogModel.sourceObjectId = "002";
  535. operateLogModel.sourceContentJson = responsejson;
  536. OperatorHelper.Instance.WriteOperateLog(operateLogModel);
  537. foreach (UserEntity userinfo in needpostuserlist)
  538. {
  539. if (userinfo != null && !string.IsNullOrEmpty(userinfo.OpenIdForWeixin))
  540. {
  541. //执行推送任务
  542. if (!string.IsNullOrEmpty(appid) && !string.IsNullOrEmpty(secret) && !string.IsNullOrEmpty(weixintaskurl) && !string.IsNullOrEmpty(weixintasktempid))
  543. {
  544. if (!string.IsNullOrEmpty(responsejson))
  545. {
  546. var weixintokenobj = JsonConvert.DeserializeObject<dynamic>(responsejson);
  547. if (string.IsNullOrEmpty(weixintokenobj.errcode))
  548. {
  549. string access_token = weixintokenobj.access_token;
  550. string jsondata = "{\"touser\":\"" + userinfo.OpenIdForWeixin + "\"," +
  551. "\"template_id\":\"" + weixintasktempid + "\"," +
  552. "\"url\":\"" + weixintaskurl + "\"," +
  553. "\"data\":{" +
  554. "\"first\": {\"value\":\"您有新的课表同步\",\"color\":\"#173177\"}," +
  555. "\"keyword1\":{\"value\":\"课表同步\",\"color\":\"#173177\"}," +
  556. "\"keyword2\": {\"value\":\"" + title + "\",\"color\":\"#173177\"}," +
  557. "\"keyword3\": {\"value\":\"待查看\",\"color\":\"#173177\"}," +
  558. "\"keyword4\": {\"value\":\"您有新的课表同步【" + title + "】\",\"color\":\"#173177\"}" +
  559. "}" +
  560. "}";
  561. string pushresult = Util.HttpMethods.HttpPost("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, jsondata);
  562. operateLogModel.title = title;
  563. operateLogModel.type = OperationType.Other;
  564. operateLogModel.url = "ArrangeLessonTermController";
  565. operateLogModel.sourceObjectId = "002";
  566. operateLogModel.sourceContentJson = pushresult;
  567. OperatorHelper.Instance.WriteOperateLog(operateLogModel);
  568. }
  569. }
  570. }
  571. }
  572. }
  573. }
  574. }
  575. }