Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

622 lignes
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 / 7 + 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 - (7 - firstdayofweek);
  239. if (daysOutOneWeek <= 0)
  240. {
  241. return 1;
  242. }
  243. else
  244. {
  245. int weeks = daysOutOneWeek / 7;
  246. if (daysOutOneWeek % 7 != 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) * 7)).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) * 7)).AddDays(6).ToString("yyyy-MM-dd");// StartTime.AddDays(((curWeek - 1) * 14)).AddDays(10).ToString("yyyy-MM-dd");
  288. var timeTableList = new List<TimeTable>();
  289. //课程表
  290. var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  291. if (!string.IsNullOrEmpty(classNo))
  292. {
  293. var PKRoleId = Config.GetValue("PKRoleId");
  294. var loginInfoRoleIds = LoginUserInfo.Get().roleIds;
  295. if (loginInfoRoleIds.IndexOf(',') == -1)
  296. {
  297. if (loginInfoRoleIds == PKRoleId)
  298. {
  299. data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  300. }
  301. }
  302. else
  303. {
  304. if (loginInfoRoleIds.Split(',').Contains(PKRoleId))
  305. {
  306. data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  307. }
  308. }
  309. }
  310. else
  311. {
  312. if (userInfo.Description == "学生")
  313. {
  314. data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  315. }
  316. else if (userInfo.Description == "教师")
  317. {
  318. var empInfo = empInfoIbll.GetAllList().Where(x => x.EmpNo == userInfo.account);
  319. if (empInfo != null)
  320. {
  321. data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, "", empInfo.FirstOrDefault().EmpNo, "");
  322. }
  323. }
  324. else
  325. {
  326. data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  327. }
  328. }
  329. timeTableList.AddRange(data);
  330. //选修课课程表
  331. //var dataOfElective = arrangeLessonTermOfElectiveIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", "");
  332. //timeTableList.AddRange(dataOfElective);
  333. var timeTables = timeTableList.ToList();
  334. var noDataResult = new
  335. { schoolName = "课程表", semester = $"{strAcademicYear}学年度 第{strSemester}学期", weekList = "" };
  336. if (!timeTables.Any())
  337. {
  338. return JsonResult(noDataResult);
  339. }
  340. //学生课表请假记录
  341. var leaveList = stuAttendanceLeaveIBLL.GetListByJson("{\"StuNo\":\"" + userInfo.account + "\"}");
  342. var formatData = from d in timeTables.AsEnumerable()
  343. let tt = d.LessonTime.Split('-')[1]
  344. group d by tt into g
  345. orderby g.Key
  346. select new
  347. {
  348. time = g.Key,
  349. list = from e in timeTables.AsEnumerable()
  350. let ee = e.LessonTime.Split('-')[1]
  351. where ee == g.Key
  352. select new
  353. {
  354. ALTId = e.ALTId,
  355. day = e.LessonTime.Split('-')[0],
  356. curriculum = e.LessonSortNo == "2" ? e.LessonName + "[选修]" : e.LessonName,
  357. teacher = e?.EmpName,
  358. classRoom = string.IsNullOrEmpty(e.ClassroomName) ? "" : e.ClassroomName.Trim(),
  359. academicyear = semesterAndYear.AcademicYearShort,
  360. semester = strSemester,
  361. lessonNo = e?.LessonNo,
  362. teachClassNo = e?.TeachClassNo,
  363. empno = e?.EmpNo,
  364. lessonTime = e.LessonTime,
  365. lessonDate = e.LessonDate.ToString("yyyy-MM-dd"),
  366. classRoomNo = string.IsNullOrEmpty(e.ClassRoomNo) ? "" : e.ClassRoomNo.Trim(),
  367. lessonSortNo = e.LessonSortNo,
  368. e?.OLPEId,
  369. className = string.IsNullOrEmpty(e.ClassName) ? "" : e.ClassName,
  370. leaveType = leaveList.Any(c => c.LessonNo == e?.LessonNo && c.LessonDate == e.LessonDate && c.LessonTime == e.LessonTime) ? 1 : 0,
  371. checkType = leaveList.FirstOrDefault(c => c.LessonNo == e?.LessonNo && c.LessonDate == e.LessonDate && c.LessonTime == e.LessonTime)?.IsCheck,
  372. }
  373. }
  374. ;
  375. var result = new
  376. { schoolName = "课程表", semester = $"{strAcademicYear}学年度 第{strSemester}学期", weekList = formatData };
  377. return JsonResult(result);
  378. }
  379. #endregion
  380. #region 提交数据
  381. /// <summary>
  382. /// 删除实体数据
  383. /// <param name="keyValue">主键</param>
  384. /// <summary>
  385. /// <returns></returns>
  386. [HttpPost]
  387. [AjaxOnly]
  388. public ActionResult DeleteForm(string keyValue)
  389. {
  390. arrangeLessonTermIBLL.DeleteEntity(keyValue);
  391. return Success("删除成功!");
  392. }
  393. /// <summary>
  394. /// 保存实体数据(新增、修改)
  395. /// <param name="keyValue">主键</param>
  396. /// <summary>
  397. /// <returns></returns>
  398. [HttpPost]
  399. [ValidateAntiForgeryToken]
  400. [AjaxOnly]
  401. public ActionResult SaveForm(string keyValue, ArrangeLessonTermEntity entity)
  402. {
  403. arrangeLessonTermIBLL.SaveEntity(keyValue, entity);
  404. return Success("保存成功!");
  405. }
  406. /// <summary>
  407. /// 删除课程
  408. /// <param name="keyValue">主键</param>
  409. /// <summary>
  410. /// <returns></returns>
  411. [HttpPost]
  412. [AjaxOnly]
  413. public ActionResult DeleteLessonTerm(string keyValue, string WeekTime)
  414. {
  415. arrangeLessonTermIBLL.DeleteLessonTerm(keyValue, WeekTime);
  416. return Success("删除成功!");
  417. }
  418. /// <summary>
  419. ///修改课程
  420. /// <param name="keyValue">主键</param>
  421. /// <summary>
  422. /// <returns></returns>
  423. [HttpPost]
  424. [AjaxOnly]
  425. public ActionResult UpdateLessonTerm(string keyValue, string postdata)
  426. {
  427. UpdateLessonTermEntity model = postdata.ToObject<UpdateLessonTermEntity>();
  428. var res = arrangeLessonTermIBLL.UpdateLessonTerm(keyValue, model);
  429. if (!string.IsNullOrEmpty(res))
  430. {
  431. return Fail(res);
  432. }
  433. return Success("操作成功!");
  434. }
  435. #endregion
  436. /// <summary>
  437. /// 当前学期排课数据同步
  438. /// </summary>
  439. /// <returns></returns>
  440. [HttpGet]
  441. [AjaxOnly]
  442. public async Task<ActionResult> AsyncArrangeLessonData()
  443. {
  444. var data = await arrangeLessonTermIBLL.AsyncArrangeLessonData();
  445. return Success(data);
  446. }
  447. /// <summary>
  448. /// 清空当前学期排课数据
  449. /// </summary>
  450. /// <returns></returns>
  451. [HttpGet]
  452. [AjaxOnly]
  453. public async Task<ActionResult> AsyncModifyArrangeLessonData()
  454. {
  455. var data = await arrangeLessonTermIBLL.AsyncModifyArrangeLessonData();
  456. return Success(data);
  457. }
  458. /// <summary>
  459. /// 按条件清空排课数据
  460. /// </summary>
  461. /// <returns></returns>
  462. [HttpPost]
  463. [AjaxOnly]
  464. public async Task<ActionResult> AsyncModifyArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
  465. {
  466. var data = await arrangeLessonTermIBLL.AsyncModifyArrangeLessonDataByCondition(entity);
  467. return Success(data);
  468. }
  469. /// <summary>
  470. /// 按条件同步排课数据
  471. /// </summary>
  472. /// <returns></returns>
  473. [HttpPost]
  474. [AjaxOnly]
  475. public async Task<ActionResult> AsyncArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
  476. {
  477. var data = await arrangeLessonTermIBLL.AsyncArrangeLessonDataByCondition(entity);
  478. if (data)
  479. {
  480. //读取信息推送管理-课表同步推送(09)的配置
  481. var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("09");
  482. if (informationPushEntity != null && informationPushEntity.Status == true)
  483. {
  484. var title = string.Format("{0}学年第{1}学期必修课课表同步", entity.AcademicYearNo, entity.Semester);
  485. var needpostuserlist = userIbll.GetAllList().Where(m => m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师").ToList();
  486. //微信推送
  487. try
  488. {
  489. PushWeixin(needpostuserlist, title);
  490. }
  491. catch (Exception e)
  492. {
  493. }
  494. //飞星推送
  495. await Task.Run(async () =>
  496. {
  497. using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"]))
  498. {
  499. var hubProxy = hubConnection.CreateHubProxy("SignalRHub");
  500. await hubConnection.Start();
  501. 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)), "");
  502. }
  503. });
  504. }
  505. }
  506. return Success(data);
  507. }
  508. /// <summary>
  509. /// 按条件重置基础数据同步状态
  510. /// </summary>
  511. /// <param name="entity"></param>
  512. /// <returns></returns>
  513. [HttpPost]
  514. [AjaxOnly]
  515. public ActionResult InitAsyncDataByCondition(ArrangeLessonTermEntity entity)
  516. {
  517. var data = arrangeLessonTermIBLL.InitAsyncDataByCondition(entity);
  518. return Success(data);
  519. }
  520. public void PushWeixin(List<UserEntity> needpostuserlist, string title)
  521. {
  522. var WeChatConfigentity = weChatConfigIbll.GetEnableEntity();
  523. string appid = WeChatConfigentity.APPId;
  524. string secret = WeChatConfigentity.secret;
  525. var wechatemplete = weChatTempletIbll.GetWeChatTemplateEntityByCodeConfigId(WeChatConfigentity.ID, "task");
  526. string weixintaskurl = wechatemplete.TUrl;
  527. string weixintasktempid = wechatemplete.TempId;
  528. var responsejson = Util.HttpMethods.HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret);
  529. OperateLogModel operateLogModel = new OperateLogModel();
  530. operateLogModel.title = title;
  531. operateLogModel.type = OperationType.Other;
  532. operateLogModel.url = "ArrangeLessonTermController";
  533. operateLogModel.sourceObjectId = "002";
  534. operateLogModel.sourceContentJson = responsejson;
  535. OperatorHelper.Instance.WriteOperateLog(operateLogModel);
  536. foreach (UserEntity userinfo in needpostuserlist)
  537. {
  538. if (userinfo != null && !string.IsNullOrEmpty(userinfo.OpenIdForWeixin))
  539. {
  540. //执行推送任务
  541. if (!string.IsNullOrEmpty(appid) && !string.IsNullOrEmpty(secret) && !string.IsNullOrEmpty(weixintaskurl) && !string.IsNullOrEmpty(weixintasktempid))
  542. {
  543. if (!string.IsNullOrEmpty(responsejson))
  544. {
  545. var weixintokenobj = JsonConvert.DeserializeObject<dynamic>(responsejson);
  546. if (string.IsNullOrEmpty(weixintokenobj.errcode))
  547. {
  548. string access_token = weixintokenobj.access_token;
  549. string jsondata = "{\"touser\":\"" + userinfo.OpenIdForWeixin + "\"," +
  550. "\"template_id\":\"" + weixintasktempid + "\"," +
  551. "\"url\":\"" + weixintaskurl + "\"," +
  552. "\"data\":{" +
  553. "\"first\": {\"value\":\"您有新的课表同步\",\"color\":\"#173177\"}," +
  554. "\"keyword1\":{\"value\":\"课表同步\",\"color\":\"#173177\"}," +
  555. "\"keyword2\": {\"value\":\"" + title + "\",\"color\":\"#173177\"}," +
  556. "\"keyword3\": {\"value\":\"待查看\",\"color\":\"#173177\"}," +
  557. "\"keyword4\": {\"value\":\"您有新的课表同步【" + title + "】\",\"color\":\"#173177\"}" +
  558. "}" +
  559. "}";
  560. string pushresult = Util.HttpMethods.HttpPost("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, jsondata);
  561. operateLogModel.title = title;
  562. operateLogModel.type = OperationType.Other;
  563. operateLogModel.url = "ArrangeLessonTermController";
  564. operateLogModel.sourceObjectId = "002";
  565. operateLogModel.sourceContentJson = pushresult;
  566. OperatorHelper.Instance.WriteOperateLog(operateLogModel);
  567. }
  568. }
  569. }
  570. }
  571. }
  572. }
  573. }
  574. }