AppealController.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. using Microsoft.AspNetCore.Authorization;
  2. using Microsoft.AspNetCore.Http;
  3. using Microsoft.AspNetCore.Mvc;
  4. using Microsoft.EntityFrameworkCore;
  5. using System;
  6. using System.Collections;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.IO;
  10. using System.Linq;
  11. using System.Reflection;
  12. using System.Text.Json.Serialization;
  13. using System.Text.Json;
  14. using System.Threading.Tasks;
  15. using wispro.sp.api.Job;
  16. using wispro.sp.entity;
  17. using wispro.sp.share;
  18. namespace wispro.sp.api.Controllers
  19. {
  20. [Route("api/[controller]/[action]")]
  21. [ApiController]
  22. [Authorize]
  23. public class AppealController : ControllerBase
  24. {
  25. spDbContext Context;
  26. public AppealController(spDbContext context)
  27. {
  28. Context = context;
  29. }
  30. public List<AppealType> GetAppealTypes()
  31. {
  32. return Context.AppealTypes.ToList();
  33. }
  34. public List<InputField> GetInputField(int appealTypeId, int state)
  35. {
  36. var retList = Context.InputFields
  37. .Where<InputField>(ip => ip.AppealTypeId == appealTypeId && ip.AppealState == state)
  38. .Include(p => p.SelectValues)
  39. .ToList();
  40. string str = System.Text.Json.JsonSerializer.Serialize(retList, new JsonSerializerOptions()
  41. {
  42. ReferenceHandler = ReferenceHandler.Preserve
  43. });
  44. Log(str);
  45. foreach (var inputField in retList)
  46. {
  47. if (inputField.SelectValues != null)
  48. {
  49. foreach(var ifValue in inputField.SelectValues)
  50. {
  51. ifValue.InputField = null;
  52. }
  53. }
  54. }
  55. return retList;
  56. }
  57. /// <summary>
  58. /// 创建申诉流程
  59. /// </summary>
  60. /// <param name="ItemId"></param>
  61. /// <param name="typeid"></param>
  62. /// <param name="reviewerId"></param>
  63. /// <param name="appealObject"></param>
  64. /// <returns></returns>
  65. public ApiSaveResponse CreateAppeal(int ItemId, int typeid, int reviewerId, AppealObject appealObject)
  66. {
  67. ApiSaveResponse response = new ApiSaveResponse();
  68. response.Success = true;
  69. AppealRecord appealRecord = new AppealRecord();
  70. if(ItemId > 0)
  71. {
  72. appealRecord.ItemId = ItemId;
  73. }
  74. else
  75. {
  76. appealRecord.ItemId = null;
  77. }
  78. appealRecord.TypeId = typeid;
  79. appealRecord.ReviewerId = reviewerId;
  80. appealRecord.CreaterId = Context.Staffs.Where<Staff>(s => s.Name == User.Identity.Name).FirstOrDefault().Id;
  81. appealRecord.CreateTime = DateTime.Now;
  82. var t = Context.Database.BeginTransaction();
  83. try
  84. {
  85. Context.AppealRecords.Add(appealRecord);
  86. Context.SaveChanges();
  87. foreach (var fieldValue in appealObject.inputFieldValues)
  88. {
  89. fieldValue.InputField = null;
  90. fieldValue.AppealRecordId = appealRecord.Id;
  91. }
  92. Context.InputFieldValues.AddRange(appealObject.inputFieldValues);
  93. foreach (var file in appealObject.attachFiles)
  94. {
  95. var temFile = Context.AttachFiles.Where<AttachFile>(f => f.Id == file.Id).FirstOrDefault();
  96. temFile.AppealRecordId = appealRecord.Id;
  97. temFile.UploadUserId = appealRecord.CreaterId;
  98. }
  99. Context.SaveChanges();
  100. var temType = Context.AppealTypes.FirstOrDefault(c=>c.Id == appealRecord.TypeId);
  101. if (!string.IsNullOrEmpty(temType.ApplealObject))
  102. {
  103. IDoAppealObject doAppeal = (IDoAppealObject)Activator.CreateInstance(Type.GetType(appealRecord.Type.ApplealObject));
  104. doAppeal.DoAppeal(appealObject, appealRecord.Id, Context);
  105. }
  106. t.Commit();
  107. var Reviewer = Context.Staffs.Where<Staff>(s => s.Id == appealRecord.ReviewerId).FirstOrDefault();
  108. if(appealRecord.Type == null)
  109. {
  110. appealRecord.Type = Context.AppealTypes.FirstOrDefault(p=>p.Id == appealRecord.TypeId);
  111. }
  112. string strSubject = appealRecord.Type.Name;
  113. string strBody = $"<div style=\"position:absolute;width:800;height:300;margin-top:50px;margin-left:200px;margin-right:200px;box-shadow:0px 0px 3px 3px #ccc \"><div style= \"margin-top: 20px; margin-left:20px;;font-size:14px; \">{Reviewer.Name},您好!</div><div style= \"margin-top: 25px; margin-left:20px;font-size:14px; \"><div>{User.Identity.Name} 向您提交了{appealRecord.Type.Name}申诉,请使用<a href= \"http://1.116.113.26\">绩效系统</a>在<B>{utility.ConfigHelper.GetSectionValue("Lastest_feedback_date")}日</B>前完成审核!</div><div style= \"margin-top: 100px;margin-right:15px; padding-bottom: 20px; font-size:14px;color:#888888;float:right; \">小美集团绩效管理系统</div></div>";
  114. string strTo = Reviewer.Mail;
  115. if (!string.IsNullOrEmpty(strTo))
  116. {
  117. _ = QuartzUtil.AddMailJob(strSubject, strBody, Reviewer.Name, strTo);
  118. }
  119. strBody = $"<div style=\"position:absolute;width:800;height:300;margin-top:50px;margin-left:200px;margin-right:200px;box-shadow:0px 0px 3px 3px #ccc \"><div style= \"margin-top: 20px; margin-left:20px;;font-size:14px; \">{Reviewer.Name},您好!</div><div style= \"margin-top: 25px; margin-left:20px;font-size:14px; \"><div>{User.Identity.Name} 向您提交了{appealRecord.Type.Name}申诉,请使用<a href= \"http://1.116.113.26\">绩效系统</a>查看详情!</div><div style= \"margin-top: 100px;margin-right:15px; padding-bottom: 20px; font-size:14px;color:#888888;float:right; \">小美集团绩效管理系统</div></div>";
  120. _ = QuartzUtil.AddMailJob(strSubject, strBody, "钟子敏", "zhongzimin@china-wispro.com");
  121. _ = QuartzUtil.AddMailJob(strSubject, strBody, "夏敏", "xiamin@china-wispro.com");
  122. _ = QuartzUtil.AddMailJob(strSubject, strBody, "吴芳", "wufang@china-wispro.com");
  123. return response;
  124. }
  125. catch (Exception ex)
  126. {
  127. t.Rollback();
  128. response.Success = false;
  129. response.ErrorMessage = "申诉时发生错误!";
  130. return response;
  131. }
  132. }
  133. public ApiSaveResponse ReviewerAppeal(int appealRecordId,AppealObject appealObject)
  134. {
  135. ApiSaveResponse response = new ApiSaveResponse();
  136. response.Success = true;
  137. var appealRecord = Context.AppealRecords.Where<AppealRecord>(p => p.Id == appealRecordId).FirstOrDefault();
  138. if(appealRecord != null)
  139. {
  140. if (appealRecord.ItemId.HasValue)
  141. {
  142. var item = Context.PerformanceItems.Include(p=>p.CalMonth).FirstOrDefault(p => p.Id == appealRecord.ItemId.Value);
  143. if(item == null)
  144. {
  145. response.Success = false;
  146. response.ErrorMessage = "无效的ItemId!";
  147. return response;
  148. }
  149. else
  150. {
  151. if(item.CalMonth.Status != 0)
  152. {
  153. response.Success = false;
  154. response.ErrorMessage = "指定的绩效已经归档!";
  155. return response;
  156. }
  157. }
  158. }
  159. var t = Context.Database.BeginTransaction();
  160. try
  161. {
  162. appealRecord.ReviewerId = Context.Staffs.Where<Staff>(s => s.Name == User.Identity.Name).FirstOrDefault().Id;
  163. appealRecord.State = 1;
  164. appealRecord.ReviewTime = DateTime.Now;
  165. Context.SaveChanges();
  166. foreach (var fieldValue in appealObject.inputFieldValues)
  167. {
  168. fieldValue.InputField = null;
  169. fieldValue.AppealRecordId = appealRecord.Id;
  170. }
  171. Context.InputFieldValues.AddRange(appealObject.inputFieldValues);
  172. Context.SaveChanges();
  173. if (appealObject.attachFiles != null)
  174. {
  175. foreach (var file in appealObject.attachFiles)
  176. {
  177. var temFile = Context.AttachFiles.Where<AttachFile>(f => f.Id == file.Id).FirstOrDefault();
  178. temFile.AppealRecordId = appealRecord.Id;
  179. temFile.UploadUserId = appealRecord.ReviewerId;
  180. }
  181. }
  182. List<InputFieldValue> inputFieldValues = Context.InputFieldValues
  183. .Where<InputFieldValue>(p => p.AppealRecordId == appealRecordId
  184. && p.InputField.MapObjectField != null)
  185. .Include(i=>i.InputField)
  186. .ToList();
  187. foreach(InputFieldValue inputFieldValue in inputFieldValues)
  188. {
  189. SaveValueToMapObject(appealRecord, inputFieldValue);
  190. }
  191. Context.SaveChanges();
  192. if(appealRecord.Type == null)
  193. {
  194. appealRecord.Type = Context.AppealTypes.FirstOrDefault(s=>s.Id == appealRecord.TypeId);
  195. }
  196. if (!string.IsNullOrEmpty(appealRecord.Type.ReviewObject))
  197. {
  198. IDoAppealObject doAppeal = (IDoAppealObject)Activator.CreateInstance(Type.GetType(appealRecord.Type.ReviewObject));
  199. doAppeal.DoAppeal(appealObject, appealRecord.Id,Context);
  200. }
  201. Context.SaveChanges();
  202. if(appealRecord.ItemId.HasValue)
  203. {
  204. var item = Context.PerformanceItems
  205. .Include(p => p.ItemStaffs)
  206. .Include(p => p.Customer)
  207. .Include(p=>p.Reviewer)
  208. .FirstOrDefault(p=>p.Id == appealRecord.ItemId);
  209. new PerformanceItemController(Context, new Services.FileTaskCacheService()).RefreshPoint(item);
  210. }
  211. t.Commit();
  212. return response;
  213. }
  214. catch (Exception ex)
  215. {
  216. t.Rollback();
  217. response.Success = false;
  218. response.ErrorMessage = ex.Message;
  219. return response;
  220. }
  221. }
  222. else
  223. {
  224. response.Success = true;
  225. response.ErrorMessage = "申诉不存在!";
  226. return response;
  227. }
  228. }
  229. private object ConvertSimpleType(object value, Type destinationType)
  230. {
  231. object returnValue;
  232. if ((value == null) || destinationType.IsInstanceOfType(value))
  233. {
  234. return value;
  235. }
  236. string str = value as string;
  237. if ((str != null) && (str.Length == 0))
  238. {
  239. return null;
  240. }
  241. TypeConverter converter = TypeDescriptor.GetConverter(destinationType);
  242. bool flag = converter.CanConvertFrom(value.GetType());
  243. if (!flag)
  244. {
  245. converter = TypeDescriptor.GetConverter(value.GetType());
  246. }
  247. if (!flag && !converter.CanConvertTo(destinationType))
  248. {
  249. throw new InvalidOperationException("无法转换成类型:" + value.ToString() + "==>" + destinationType);
  250. }
  251. try
  252. {
  253. returnValue = flag ? converter.ConvertFrom(null, null, value) : converter.ConvertTo(null, null, value, destinationType);
  254. }
  255. catch (Exception e)
  256. {
  257. throw new InvalidOperationException("类型转换出错:" + value.ToString() + "==>" + destinationType, e);
  258. }
  259. return returnValue;
  260. }
  261. private void SaveValueToMapObject(AppealRecord appealRecord, InputFieldValue inputFieldValue)
  262. {
  263. if (!string.IsNullOrEmpty(inputFieldValue.InputField.MapObjectField))
  264. {
  265. bool isSave = false;
  266. if (!string.IsNullOrEmpty(inputFieldValue.InputField.MapSaveCondition))
  267. {
  268. string[] conditions = inputFieldValue.InputField.MapSaveCondition.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
  269. if (conditions.Length == 1)
  270. {
  271. if (appealRecord.State == int.Parse(conditions[0]))
  272. {
  273. isSave = true;
  274. }
  275. }
  276. else
  277. {
  278. if (appealRecord.State == int.Parse(conditions[0]))
  279. {
  280. InputFieldValue temValue =
  281. Context.InputFieldValues.Where<InputFieldValue>(v =>
  282. v.AppealRecordId == appealRecord.Id &&
  283. v.InputField.Id == int.Parse(conditions[1]) &&
  284. v.Value == conditions[2])
  285. .FirstOrDefault();
  286. if (temValue != null)
  287. {
  288. isSave = true;
  289. }
  290. }
  291. }
  292. }
  293. else
  294. {
  295. isSave = true;
  296. }
  297. if (isSave)
  298. {
  299. InputField field = inputFieldValue.InputField;
  300. PerformanceItem Item = Context.PerformanceItems.Where<PerformanceItem>(p =>
  301. p.Id == appealRecord.ItemId)
  302. .Include(p => p.ItemStaffs).ThenInclude(it=>it.DoPerson)
  303. .Include(p => p.Reviewer)
  304. .FirstOrDefault();
  305. bool ItemIsNull = false;
  306. if(Item == null)
  307. {
  308. ItemIsNull = true;
  309. Item = new PerformanceItem();
  310. }
  311. if (!string.IsNullOrEmpty(field.MapObjectField) && !string.IsNullOrEmpty(field.MapObjectFieldLabel))
  312. {
  313. List<InputFieldValue> temValues = new List<InputFieldValue>();
  314. string[] pList = field.MapObjectField.Split(new char[] { '.' });
  315. string[] plList = field.MapObjectFieldLabel.Split(new char[] { '.' });
  316. var pInfo = Item.GetType().GetProperty(pList[0]);
  317. var o = pInfo.GetValue(Item);
  318. if (Array.IndexOf(o.GetType().GetInterfaces(), typeof(IEnumerable)) > -1)
  319. {
  320. List<string> Values = new List<string>();
  321. List<string> Labels = new List<string>();
  322. var objList = o as IEnumerable;
  323. foreach (var obj in objList)
  324. {
  325. var objLabel = obj;
  326. for (int i = 1; i < plList.Length; i++)
  327. {
  328. objLabel = objLabel.GetType().GetProperty(plList[i]).GetValue(objLabel);
  329. }
  330. if (objLabel.ToString() == inputFieldValue.Label)
  331. {
  332. var objValue = obj;
  333. for (int i = 1; i < pList.Length - 1; i++)
  334. {
  335. objValue = objValue.GetType().GetProperty(pList[i]).GetValue(objValue);
  336. }
  337. objValue.GetType().GetProperty(pList[pList.Length - 1])
  338. .SetValue(objValue, ConvertSimpleType(inputFieldValue.Value,Type.GetType(inputFieldValue.InputField.FieldType)));
  339. }
  340. }
  341. }
  342. }
  343. else
  344. {
  345. Item.GetType().GetProperty(field.MapObjectField).SetValue(Item, ConvertSimpleType(inputFieldValue.Value, Type.GetType(inputFieldValue.InputField.FieldType)));
  346. }
  347. }
  348. }
  349. }
  350. public List<AppealRecord> GetAppealRecords(int userId)
  351. {
  352. try
  353. {
  354. var data = Context.AppealRecords.Where<AppealRecord>(p => p.Id > 0);
  355. if (userId > 0)
  356. {
  357. data = Context.AppealRecords.Where<AppealRecord>(ar => (ar.CreaterId == userId || (ar.ReviewerId == userId && ar.State != 1)) && ar.Type.NeedReview == true);
  358. }
  359. var retList = data
  360. //.Include(p => p.Reviewer)
  361. .Include(p => p.Creater)
  362. .Include(p => p.Item)
  363. .Include(p => p.Type)
  364. .ToList();
  365. foreach (var record in retList)
  366. {
  367. replaceDataForSerialize(record);
  368. }
  369. //string str = System.Text.Json.JsonSerializer.Serialize(retList);
  370. //System.Diagnostics.Debug.WriteLine(str);
  371. //Log(str);
  372. return retList;
  373. }
  374. catch (Exception ex)
  375. {
  376. Log(ex.ToString());
  377. return new List<AppealRecord>();
  378. }
  379. }
  380. private void replaceDataForSerialize(AppealRecord record)
  381. {
  382. if(record.Creater !=null)
  383. {
  384. Staff temStaff = new Staff()
  385. {
  386. Name = record.Creater.Name,
  387. Id = record.Creater.Id,
  388. ItemStaffs = null,
  389. ReviewerItems = null,
  390. Customers = null,
  391. Positions = null,
  392. StaffGrade = null,
  393. };
  394. record.Creater = temStaff;
  395. //record.Creater.ItemStaffs = null;
  396. //record.Creater.ReviewerItems = null;
  397. //record.Creater.Customers = null;
  398. //record.Creater.Positions = null;
  399. //record.Creater.StaffGrade = null;
  400. }
  401. if (record.Reviewer != null)
  402. {
  403. Staff temStaff = new Staff() {
  404. Name = record.Reviewer.Name,
  405. Id = record.Creater.Id,
  406. ItemStaffs = null,
  407. ReviewerItems = null,
  408. Customers = null,
  409. Positions = null,
  410. StaffGrade = null,
  411. };
  412. record.Reviewer = temStaff;
  413. //record.Reviewer.ItemStaffs = null;
  414. //record.Reviewer.Customers = null;
  415. //record.Reviewer.ReviewerItems = null;
  416. //record.Reviewer.Positions = null;
  417. //record.Reviewer.StaffGrade = null;
  418. }
  419. if (record.Item != null)
  420. {
  421. PerformanceItem temItem = new PerformanceItem()
  422. {
  423. Id = record.Item.Id,
  424. CaseNo = record.Item.CaseNo,
  425. CaseName = record.Item.CaseName,
  426. CalMonthId = record.Item.CalMonthId
  427. };
  428. record.Item = temItem;
  429. //record.Item.ItemStaffs = null;
  430. //record.Item.PreOastaff = null;
  431. //record.Item.Reviewer = null;
  432. //record.Item.WorkflowUser = null;
  433. //record.Item.Customer = null;
  434. //record.Item.CalMonth = null;
  435. }
  436. if(record.Type != null)
  437. {
  438. record.Type.ReviewerExpress = null;
  439. record.Type.CanDoExpress = null;
  440. record.Type.ApplealObject = null;
  441. record.Type.CanDoExpress = null;
  442. record.Type.ReviewerExpress = null;
  443. }
  444. //record.Type.ReviewerExpress = null;
  445. }
  446. [HttpPost]
  447. public List<AppealRecord> QueryByFilter(AppealRecordFilter filter)
  448. {
  449. var data = Context.AppealRecords.Where<AppealRecord>(s => true);
  450. if(filter.AppealTypeId > 0)
  451. {
  452. data = Context.AppealRecords.Where(f=>f.TypeId == filter.AppealTypeId);
  453. }
  454. if(!string.IsNullOrEmpty(filter.CaseNo))
  455. {
  456. data = data.Where(s=>s.Item.CaseNo.Contains(filter.CaseNo));
  457. }
  458. if (!string.IsNullOrEmpty(filter.CreateUser))
  459. {
  460. data = data.Where(s => s.Creater.Name.Contains(filter.CreateUser));
  461. }
  462. if (!string.IsNullOrEmpty(filter.Reviewer))
  463. {
  464. data = data.Where(s => s.Reviewer.Name.Contains(filter.Reviewer));
  465. }
  466. if (filter.beginCreateTime.HasValue)
  467. {
  468. data = data.Where(s => s.CreateTime>=filter.beginCreateTime.Value );
  469. }
  470. if (filter.endCreateTime.HasValue)
  471. {
  472. data = data.Where(s => s.CreateTime <= filter.endCreateTime.Value);
  473. }
  474. if (filter.beginReviewTime.HasValue)
  475. {
  476. data = data.Where(s => s.ReviewTime >= filter.beginReviewTime.Value);
  477. }
  478. if (filter.endReviewTime.HasValue)
  479. {
  480. data = data.Where(s => s.ReviewTime <= filter.endReviewTime.Value);
  481. }
  482. var retList = data
  483. .Include(p => p.Reviewer)
  484. .Include(p => p.Creater)
  485. .Include(p => p.Item)
  486. .Include(p => p.Type)
  487. .ToList();
  488. foreach (var record in retList)
  489. {
  490. replaceDataForSerialize(record);
  491. }
  492. return retList;
  493. }
  494. public AppealRecord GetAppealRecord(int Id)
  495. {
  496. var data = Context.AppealRecords.Where<AppealRecord>(ar => ar.Id == Id);
  497. return data.Include(p => p.Reviewer)
  498. .Include(p => p.Creater)
  499. .Include(p => p.Item)
  500. .Include(p => p.Type).FirstOrDefault();
  501. }
  502. public List<InputFieldValue> GetInputFieldValues(int id, int state)
  503. {
  504. var result = Context.InputFieldValues.Where<InputFieldValue>(f => f.AppealRecordId == id && f.InputField.AppealState == state);
  505. return result.Include(i => i.InputField).ToList();
  506. }
  507. public List<InputFieldValue> GetAllInputFieldValue(int id)
  508. {
  509. var result = Context.InputFieldValues.Where<InputFieldValue>(f => f.AppealRecordId == id);
  510. return result.Include(i => i.InputField).ToList();
  511. }
  512. public List<AttachFile> GetAppealRecordAttachFiles(int appealRecordId)
  513. {
  514. var result = Context.AttachFiles.Where<AttachFile>(at => at.AppealRecordId == appealRecordId).Include(f => f.UploadUser);
  515. return result.ToList();
  516. }
  517. public ApiSaveResponse ChangeRecordReviewer(int RecordId,int ReviewerId)
  518. {
  519. var data = Context.AppealRecords.FirstOrDefault<AppealRecord>(ar => ar.Id == RecordId);
  520. if(data != null)
  521. {
  522. var reviewer = Context.Staffs.FirstOrDefault(s => s.Id == ReviewerId);
  523. var CurrentUser = Context.Staffs.FirstOrDefault(s=>s.Name == User.Identity.Name);
  524. if ((CurrentUser.Id == data.CreaterId || CurrentUser.Id == data.ReviewerId) && data.State ==0)
  525. {
  526. if (reviewer != null)
  527. {
  528. data.ReviewerId = ReviewerId;
  529. Context.SaveChanges();
  530. return new ApiSaveResponse()
  531. {
  532. Success = true
  533. };
  534. }
  535. else
  536. {
  537. return new ApiSaveResponse()
  538. {
  539. Success = false,
  540. ErrorMessage = "指定的审核人不存在"
  541. };
  542. }
  543. }
  544. else
  545. {
  546. return new ApiSaveResponse()
  547. {
  548. Success = false,
  549. ErrorMessage = "只有申诉人和审核人在未审核状态时才能变更审核人"
  550. };
  551. }
  552. }
  553. else
  554. {
  555. return new ApiSaveResponse()
  556. {
  557. Success = false,
  558. ErrorMessage = "指定的申诉记录不存在"
  559. };
  560. }
  561. }
  562. private void Log(string strMessage)
  563. {
  564. StreamWriter sw = System.IO.File.AppendText("c:\\temp\\log.txt");
  565. sw.WriteLine($"{strMessage}");
  566. sw.Flush();
  567. sw.Close();
  568. sw.Dispose();
  569. }
  570. }
  571. }