LisController.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Microsoft.AspNetCore.Mvc;
  5. using Microsoft.AspNetCore.Http;
  6. using Microsoft.Extensions.Logging;
  7. using Microsoft.Extensions.Options;
  8. using Microsoft.AspNetCore.Authorization;
  9. using System.Web;
  10. using MySystem.MainModels;
  11. using LitJson;
  12. using Library;
  13. namespace MySystem.Areas.Api.Controllers.v1
  14. {
  15. [Area("Api")]
  16. [Route("Api/[controller]/[action]")]
  17. public class LisController : BaseController
  18. {
  19. public LisController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
  20. {
  21. }
  22. #region 设置押金
  23. public string SetDeposit(string value)
  24. {
  25. string content = "";
  26. try
  27. {
  28. JsonData data = JsonMapper.ToObject(value);
  29. string sn = data["sn"].ToString();
  30. int serviceFee = int.Parse(data["serviceFee"].ToString());
  31. content = PublicImportDataService.Instance.SetLiSDeposit(sn, serviceFee);
  32. }
  33. catch(Exception ex)
  34. {
  35. Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置立刷押金异常");
  36. }
  37. return content;
  38. }
  39. #endregion
  40. #region 设置费率
  41. public string SetFee(string value)
  42. {
  43. string content = "";
  44. try
  45. {
  46. JsonData data = JsonMapper.ToObject(value);
  47. string sn = data["sn"].ToString();
  48. decimal fee = decimal.Parse(data["fee"].ToString());
  49. content = PublicImportDataService.Instance.SetLiSFee(sn, fee);
  50. }
  51. catch(Exception ex)
  52. {
  53. Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置立刷费率异常");
  54. }
  55. return content;
  56. }
  57. #endregion
  58. }
  59. }