Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

517 строки
20 KiB

  1. using Learun.Application.Base.SystemModule;
  2. using Learun.Application.OA;
  3. using Learun.Application.Organization;
  4. using Learun.Application.TwoDevelopment.EducationalAdministration;
  5. using Learun.Application.TwoDevelopment.Permission;
  6. using Learun.Application.WorkFlow;
  7. using Learun.Util;
  8. using Learun.Util.Operat;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Configuration;
  12. using System.Linq;
  13. using System.Web;
  14. using System.Web.Mvc;
  15. using Newtonsoft.Json;
  16. using Learun.Application.TwoDevelopment.AdmissionsPlatform;
  17. using Learun.Application.TwoDevelopment.ReceiveSendFeeManagement;
  18. namespace Learun.Application.Web.Controllers
  19. {
  20. [HandlerLogin(FilterMode.Ignore)]
  21. public class OnlineRegistrateController : MvcControllerBase
  22. {
  23. private CdMajorIBLL cdMajorIBLL = new CdMajorBLL();
  24. private DataItemIBLL dataItemIBLL = new DataItemBLL();
  25. private CompanyIBLL companyIBLL = new CompanyBLL();
  26. private AP_OnlineUserInfoIBLL onlineUserInfoIBLL = new AP_OnlineUserInfoBLL();
  27. private AP_OnlineStudentInfoIBLL onlineStudentInfoIBLL = new AP_OnlineStudentInfoBLL();
  28. private AP_CompanyPaymentAccountIBLL aP_CompanyPaymentAccountIBLL = new AP_CompanyPaymentAccountBLL();
  29. private FinaChargesStandardIBLL finaChargesStandardIBLL = new FinaChargesStandardBLL();
  30. private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL();
  31. private DIC_PROVINCEIBLL dIC_PROVINCEIBLL = new DIC_PROVINCEBLL();
  32. private DataSourceIBLL dataSourceIBLL = new DataSourceBLL();
  33. /// <summary>
  34. /// 选择专业
  35. /// </summary>
  36. /// <returns></returns>
  37. public ActionResult MajorInfo(string userId, bool isReselect = false)
  38. {
  39. //是否是重选专业
  40. ViewBag.UserId = userId;
  41. ViewBag.IsReselect = isReselect;
  42. //获取专业信息
  43. var majorInfoModel = new MajorInfoModel();
  44. var aaa = cdMajorIBLL.GetListByDeptNo("").GroupBy(x => x.RecruitObject).Select(x => new RecruitInfoModel()
  45. {
  46. RecruitObject = x.Key,
  47. RecruitObjectText = dataItemIBLL.GetDetailList("RecruitObject").FirstOrDefault(a => a.F_ItemValue == x.Key)?.F_ItemName,
  48. SchoolInfoList = x.GroupBy(y => y.F_SchoolId).Select(y => new SchoolInfoModel()
  49. {
  50. ShoolId = y.Key,
  51. Shool = companyIBLL.GetEntity(y.Key)?.F_FullName,
  52. MajorInfoList = y.Select(xx => new CdMajorEntity()
  53. {
  54. MajorNo = xx.MajorNo,
  55. MajorName = xx.MajorName
  56. }).OrderBy(xx => xx.MajorNo).ToList()
  57. }).ToList()
  58. }).OrderBy(x => x.RecruitObject).ToList();
  59. majorInfoModel.RecruitInfoList = aaa;
  60. return View(majorInfoModel);
  61. }
  62. /// <summary>
  63. /// 专业介绍
  64. /// </summary>
  65. /// <returns></returns>
  66. public ActionResult MajorIntroduce(string majorNo, string userId, bool isReselect = false)
  67. {
  68. //是否是重选专业
  69. ViewBag.UserId = userId;
  70. ViewBag.IsReselect = isReselect;
  71. var model = cdMajorIBLL.GetCdMajorEntityByMajorNo(majorNo);
  72. if (!string.IsNullOrEmpty(model.RecruitObject))
  73. {
  74. model.RecruitObjectText = dataItemIBLL.GetDetailList("RecruitObject").FirstOrDefault(a => a.F_ItemValue == model.RecruitObject)?.F_ItemName;
  75. }
  76. if (!string.IsNullOrEmpty(model.F_SchoolId))
  77. {
  78. model.SchoolName = companyIBLL.GetEntity(model.F_SchoolId)?.F_FullName;
  79. }
  80. //获取头像地址
  81. if (!string.IsNullOrEmpty(model.Photo))
  82. {
  83. var annexesFileEntity = annexesFileIBLL.GetEntityByFolderId(model.Photo);
  84. if (annexesFileEntity != null)
  85. {
  86. model.Photo = "/" + annexesFileEntity.F_FilePath.Substring(annexesFileEntity.F_FilePath.IndexOf("Resource"));
  87. }
  88. else
  89. {
  90. model.Photo = "";
  91. }
  92. }
  93. return View(model);
  94. }
  95. /// <summary>
  96. /// 填写信息
  97. /// </summary>
  98. /// <returns></returns>
  99. public ActionResult SignUp(string majorNo)
  100. {
  101. var model = cdMajorIBLL.GetCdMajorEntityByMajorNo(majorNo);
  102. if (!string.IsNullOrEmpty(model.RecruitObject))
  103. {
  104. model.RecruitObjectText = dataItemIBLL.GetDetailList("RecruitObject").FirstOrDefault(a => a.F_ItemValue == model.RecruitObject)?.F_ItemName;
  105. }
  106. if (!string.IsNullOrEmpty(model.F_SchoolId))
  107. {
  108. model.SchoolName = companyIBLL.GetEntity(model.F_SchoolId)?.F_FullName;
  109. }
  110. ViewBag.Sex = dataItemIBLL.GetDetailList("usersex");
  111. return View(model);
  112. }
  113. /// <summary>
  114. /// 报名成功
  115. /// </summary>
  116. /// <returns></returns>
  117. public ActionResult SignUpSuccess(string userId)
  118. {
  119. ViewBag.UserId = userId;
  120. return View();
  121. }
  122. /// <summary>
  123. /// 缴费
  124. /// </summary>
  125. /// <returns></returns>
  126. public ActionResult PaymentMoney(string userId, bool isLogin = false)
  127. {
  128. //是否是登录后点击的缴费
  129. ViewBag.IsLogin = isLogin;
  130. //基础信息
  131. var onlineUserInfo = onlineUserInfoIBLL.GetEntity(userId);
  132. if (onlineUserInfo != null)
  133. {
  134. onlineUserInfo.SexId = dataItemIBLL.GetDetailList("usersex").FirstOrDefault(a => a.F_ItemValue == onlineUserInfo.SexId)?.F_ItemName;
  135. var osinfo = onlineStudentInfoIBLL.GetEntityByUserId(onlineUserInfo.Id);
  136. onlineUserInfo.SchoolId = osinfo?.SchoolId;
  137. onlineUserInfo.MajorId = osinfo?.MajorId;
  138. onlineUserInfo.SchoolName = companyIBLL.GetEntity(onlineUserInfo.SchoolId)?.F_FullName;
  139. onlineUserInfo.MajorName = cdMajorIBLL.GetCdMajorEntityByMajorNo(onlineUserInfo.MajorId)?.MajorName;
  140. //费用信息
  141. var semesterAndYear = Common.GetSemesterAndYear();
  142. var finaChargesStandardEntities = finaChargesStandardIBLL.GetFinaChargesStandardListByMajorNoOfNotAll(osinfo?.MajorId, semesterAndYear.AcademicYearShort, semesterAndYear.Semester, semesterAndYear.AcademicYearShort.Substring(0, 2));
  143. if (finaChargesStandardEntities.Any())
  144. {
  145. ViewBag.feeList = finaChargesStandardEntities;
  146. ViewBag.feeTotal = finaChargesStandardEntities.Select(x => x.Standard).Sum();
  147. }
  148. }
  149. //支付方式
  150. ViewBag.AP_CompanyPaymentAccount = new AP_CompanyPaymentAccountEntity();
  151. var AP_CompanyPaymentAccountData = aP_CompanyPaymentAccountIBLL.GetList(null).FirstOrDefault(x => x.IsEnabled == true);
  152. if (AP_CompanyPaymentAccountData != null)
  153. {
  154. AP_CompanyPaymentAccountData.CompayId = companyIBLL.GetEntity(AP_CompanyPaymentAccountData.CompayId)?.F_FullName;
  155. ViewBag.AP_CompanyPaymentAccount = AP_CompanyPaymentAccountData;
  156. }
  157. return View(onlineUserInfo);
  158. }
  159. /// <summary>
  160. /// 登录
  161. /// </summary>
  162. /// <returns></returns>
  163. public ActionResult Login()
  164. {
  165. return View();
  166. }
  167. /// <summary>
  168. /// 登记表
  169. /// </summary>
  170. /// <returns></returns>
  171. public ActionResult RegistrateForm(string userId)
  172. {
  173. var ouinfo = new AP_OnlineUserInfoEntity();
  174. var onlineUserInfoEntity = onlineUserInfoIBLL.GetEntity(userId);
  175. if (onlineUserInfoEntity != null)
  176. {
  177. //获取头像地址
  178. if (!string.IsNullOrEmpty(onlineUserInfoEntity.PhotoUrl))
  179. {
  180. var annexesFileEntity = annexesFileIBLL.GetEntityByFolderId(onlineUserInfoEntity.PhotoUrl);
  181. if (annexesFileEntity != null)
  182. {
  183. onlineUserInfoEntity.PhotoUrl = "/" + annexesFileEntity.F_FilePath.Substring(annexesFileEntity.F_FilePath.IndexOf("Resource"));
  184. }
  185. else
  186. {
  187. onlineUserInfoEntity.PhotoUrl = "";
  188. }
  189. }
  190. //学生信息
  191. var onlineStudentInfoEntity = onlineUserInfoIBLL.GetAP_OnlineStudentInfoEntity(userId);
  192. if (onlineStudentInfoEntity != null)
  193. {
  194. onlineUserInfoEntity.AP_OnlineStudentInfoEntity = onlineStudentInfoEntity;
  195. }
  196. else
  197. {
  198. onlineUserInfoEntity.AP_OnlineStudentInfoEntity = new AP_OnlineStudentInfoEntity();
  199. }
  200. //简历
  201. var onlineStudentResumeInfo = onlineUserInfoIBLL.GetAP_OnlineStudentResumeInfoList(userId);
  202. if (onlineStudentResumeInfo.Any())
  203. {
  204. onlineUserInfoEntity.AP_OnlineStudentResumeInfoList = onlineStudentResumeInfo.ToList();
  205. }
  206. else
  207. {
  208. onlineUserInfoEntity.AP_OnlineStudentResumeInfoList = new List<AP_OnlineStudentResumeInfoEntity>();
  209. }
  210. //家庭成员
  211. var onlineStudentFamilyInfo = onlineUserInfoIBLL.GetAP_OnlineStudentFamilyInfoList(userId);
  212. if (onlineStudentFamilyInfo.Any())
  213. {
  214. onlineUserInfoEntity.AP_OnlineStudentFamilyInfoList = onlineStudentFamilyInfo.ToList();
  215. }
  216. else
  217. {
  218. onlineUserInfoEntity.AP_OnlineStudentFamilyInfoList = new List<AP_OnlineStudentFamilyInfoEntity>();
  219. }
  220. ouinfo = onlineUserInfoEntity;
  221. }
  222. return View(ouinfo);
  223. }
  224. /// <summary>
  225. /// 登记表完善
  226. /// </summary>
  227. /// <returns></returns>
  228. public ActionResult RegistrateFormEdit(string userId)
  229. {
  230. var ouinfo = new AP_OnlineUserInfoEntity();
  231. ViewBag.Url = "";
  232. var onlineUserInfoEntity = onlineUserInfoIBLL.GetEntity(userId);
  233. if (onlineUserInfoEntity != null)
  234. {
  235. //获取头像地址
  236. if (!string.IsNullOrEmpty(onlineUserInfoEntity.PhotoUrl))
  237. {
  238. var annexesFileEntity = annexesFileIBLL.GetEntityByFolderId(onlineUserInfoEntity.PhotoUrl);
  239. if (annexesFileEntity != null)
  240. {
  241. ViewBag.Url = "/" + annexesFileEntity.F_FilePath.Substring(annexesFileEntity.F_FilePath.IndexOf("Resource"));
  242. }
  243. }
  244. //学生信息
  245. var onlineStudentInfoEntity = onlineUserInfoIBLL.GetAP_OnlineStudentInfoEntity(userId);
  246. if (onlineStudentInfoEntity != null)
  247. {
  248. onlineUserInfoEntity.AP_OnlineStudentInfoEntity = onlineStudentInfoEntity;
  249. }
  250. else
  251. {
  252. onlineUserInfoEntity.AP_OnlineStudentInfoEntity = new AP_OnlineStudentInfoEntity();
  253. }
  254. //简历
  255. var onlineStudentResumeInfo = onlineUserInfoIBLL.GetAP_OnlineStudentResumeInfoList(userId);
  256. if (onlineStudentResumeInfo.Any())
  257. {
  258. onlineUserInfoEntity.AP_OnlineStudentResumeInfoList = onlineStudentResumeInfo.ToList();
  259. }
  260. else
  261. {
  262. onlineUserInfoEntity.AP_OnlineStudentResumeInfoList = new List<AP_OnlineStudentResumeInfoEntity>();
  263. }
  264. //家庭成员
  265. var onlineStudentFamilyInfo = onlineUserInfoIBLL.GetAP_OnlineStudentFamilyInfoList(userId);
  266. if (onlineStudentFamilyInfo.Any())
  267. {
  268. onlineUserInfoEntity.AP_OnlineStudentFamilyInfoList = onlineStudentFamilyInfo.ToList();
  269. }
  270. else
  271. {
  272. onlineUserInfoEntity.AP_OnlineStudentFamilyInfoList = new List<AP_OnlineStudentFamilyInfoEntity>();
  273. }
  274. ouinfo = onlineUserInfoEntity;
  275. }
  276. return View(ouinfo);
  277. }
  278. /// <summary>
  279. /// 修改密码
  280. /// </summary>
  281. /// <param name="userId"></param>
  282. /// <returns></returns>
  283. public ActionResult PasswordEdit(string userId)
  284. {
  285. var ouinfo = new AP_OnlineUserInfoEntity();
  286. var onlineUserInfoEntity = onlineUserInfoIBLL.GetEntity(userId);
  287. if (onlineUserInfoEntity != null)
  288. {
  289. //获取头像地址
  290. if (!string.IsNullOrEmpty(onlineUserInfoEntity.PhotoUrl))
  291. {
  292. var annexesFileEntity = annexesFileIBLL.GetEntity(onlineUserInfoEntity.PhotoUrl);
  293. if (annexesFileEntity != null)
  294. {
  295. onlineUserInfoEntity.PhotoUrl = "/" + annexesFileEntity.F_FilePath.Substring(annexesFileEntity.F_FilePath.IndexOf("Resource"));
  296. }
  297. else
  298. {
  299. onlineUserInfoEntity.PhotoUrl = "";
  300. }
  301. }
  302. //学生信息
  303. var onlineStudentInfoEntity = onlineUserInfoIBLL.GetAP_OnlineStudentInfoEntity(userId);
  304. if (onlineStudentInfoEntity != null)
  305. {
  306. onlineUserInfoEntity.AP_OnlineStudentInfoEntity = onlineStudentInfoEntity;
  307. }
  308. else
  309. {
  310. onlineUserInfoEntity.AP_OnlineStudentInfoEntity = new AP_OnlineStudentInfoEntity();
  311. }
  312. ouinfo = onlineUserInfoEntity;
  313. }
  314. return View(ouinfo);
  315. }
  316. /// <summary>
  317. /// 使用向导
  318. /// </summary>
  319. /// <returns></returns>
  320. public ActionResult UseGuid() {
  321. return View();
  322. }
  323. #region 提交数据
  324. /// <summary>
  325. /// 获取数据源数据
  326. /// </summary>
  327. /// <param name="code">数据源编号</param>
  328. /// <param name="strWhere">sql查询条件语句</param>
  329. /// <param name="queryJson">数据源请求条件字串</param>
  330. /// <returns></returns>
  331. [HttpGet]
  332. [AjaxOnly]
  333. public ActionResult GetDataSourceMap(string code, string where)
  334. {
  335. var data = dataSourceIBLL.GetDataTable(code, where);
  336. return JsonResult(data);
  337. }
  338. /// <summary>
  339. /// 获取数据源数据
  340. /// </summary>
  341. /// <param name="code">数据源编号</param>
  342. /// <param name="strWhere">sql查询条件语句</param>
  343. /// <param name="queryJson">数据源请求条件字串</param>
  344. /// <returns></returns>
  345. [HttpGet]
  346. [AjaxOnly]
  347. public ActionResult GetDataItemMap(string code)
  348. {
  349. var data = dataItemIBLL.GetDetailList(code, null);
  350. return JsonResult(data);
  351. }
  352. /// <summary>
  353. /// 保存【填写信息】
  354. /// <param name="keyValue">主键</param>
  355. /// <summary>
  356. /// <returns></returns>
  357. [HttpPost]
  358. [AjaxOnly]
  359. public ActionResult SaveOnlineRegistrate(string strEntity)
  360. {
  361. var entity = strEntity.ToObject<AP_OnlineUserInfoEntity>();
  362. var aa = onlineUserInfoIBLL.GetEntityByMobile(entity.Mobile);
  363. if (aa != null)
  364. {
  365. return Fail("该手机号已报名!");
  366. }
  367. onlineUserInfoIBLL.SaveOnlineRegistrate(entity);
  368. var aaa = onlineUserInfoIBLL.GetEntityByMobile(entity.Mobile);
  369. return Success("保存成功!", aaa);
  370. }
  371. /// <summary>
  372. /// 登录
  373. /// <param name="keyValue">主键</param>
  374. /// <summary>
  375. /// <returns></returns>
  376. [HttpPost]
  377. [AjaxOnly]
  378. public ActionResult Login(string userName, string passward)
  379. {
  380. var entity = onlineUserInfoIBLL.GetEntityByMobile(userName);
  381. if (entity == null)
  382. {
  383. return Fail("该手机号不存在!");
  384. }
  385. if (entity.Password != passward)
  386. {
  387. return Fail("密码错误!");
  388. }
  389. return Success("登录成功!", entity);
  390. }
  391. /// <summary>
  392. /// 完善资料
  393. /// <param name="keyValue">主键</param>
  394. /// <summary>
  395. /// <returns></returns>
  396. [HttpPost]
  397. [AjaxOnly]
  398. public ActionResult SaveRegistrateFormEdit(string keyValue, string strEntity, string strOnlineStudentResumeList, string strOnlineStudentFamilyList)
  399. {
  400. AP_OnlineUserInfoEntity entity = strEntity.ToObject<AP_OnlineUserInfoEntity>();
  401. entity.CreateDate = DateTime.Now;
  402. AP_OnlineStudentInfoEntity studentEntity = strEntity.ToObject<AP_OnlineStudentInfoEntity>();
  403. studentEntity.Id = entity.OSIId;
  404. studentEntity.CreateDate = DateTime.Now;
  405. List<AP_OnlineStudentResumeInfoEntity> onlineStudentResumeList = strOnlineStudentResumeList.ToObject<List<AP_OnlineStudentResumeInfoEntity>>();
  406. List<AP_OnlineStudentFamilyInfoEntity> onlineStudentFamilyList = strOnlineStudentFamilyList.ToObject<List<AP_OnlineStudentFamilyInfoEntity>>();
  407. onlineUserInfoIBLL.SaveRegistrateForm(keyValue, entity, studentEntity, onlineStudentResumeList, onlineStudentFamilyList);
  408. return Success("保存成功!");
  409. }
  410. /// <summary>
  411. /// 确定重选专业
  412. /// <param name="keyValue">主键</param>
  413. /// <summary>
  414. /// <returns></returns>
  415. [HttpPost]
  416. [AjaxOnly]
  417. public ActionResult SaveReselectMajor(string userId, string majorNo)
  418. {
  419. onlineUserInfoIBLL.SaveReselectMajor(userId, majorNo);
  420. return Success("保存成功!");
  421. }
  422. /// <summary>
  423. /// 提交修改密码
  424. /// <param name="keyValue">主键</param>
  425. /// <summary>
  426. /// <returns></returns>
  427. [HttpPost]
  428. [AjaxOnly]
  429. public ActionResult SavePasswordEdit(string userId, string oldPassword, string newPassword)
  430. {
  431. var ouientity = onlineUserInfoIBLL.GetEntity(userId);
  432. if (ouientity == null)
  433. {
  434. return Fail("学生不存在!");
  435. }
  436. if (oldPassword != ouientity.Password)
  437. {
  438. return Fail("旧密码不正确!");
  439. }
  440. if (string.IsNullOrEmpty(newPassword))
  441. {
  442. return Fail("新密码为空!");
  443. }
  444. ouientity.Password = newPassword;
  445. onlineUserInfoIBLL.SaveEntity(ouientity.Id, ouientity);
  446. return Success("保存成功!");
  447. }
  448. #endregion
  449. #region 模型
  450. /// <summary>
  451. /// 模型【选择专业】
  452. /// </summary>
  453. public class MajorInfoModel
  454. {
  455. public List<RecruitInfoModel> RecruitInfoList { get; set; }
  456. }
  457. public class RecruitInfoModel
  458. {
  459. /// <summary>
  460. /// 招生对象
  461. /// </summary>
  462. public string RecruitObject { get; set; }
  463. public string RecruitObjectText { get; set; }
  464. /// <summary>
  465. /// 校区
  466. /// </summary>
  467. public List<SchoolInfoModel> SchoolInfoList { get; set; }
  468. }
  469. public class SchoolInfoModel
  470. {
  471. /// <summary>
  472. /// 校区
  473. /// </summary>
  474. public string Shool { get; set; }
  475. /// <summary>
  476. /// 校区主键
  477. /// </summary>
  478. public string ShoolId { get; set; }
  479. /// <summary>
  480. /// 专业
  481. /// </summary>
  482. public List<CdMajorEntity> MajorInfoList { get; set; }
  483. }
  484. #endregion
  485. }
  486. }