OrderDivideAccountsUtil.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using LitJson;
  6. using MySystem;
  7. using MySystem.Models.Main;
  8. namespace MySystem
  9. {
  10. /// <summary>
  11. /// 订单申请分账参数赋值
  12. /// </summary>
  13. public class OrderDivideAccountsUtil
  14. {
  15. /// <summary>
  16. ///
  17. /// </summary>
  18. /// <param name="applyNo">批次号</param>
  19. /// <param name="mchtNo">慧掌柜商户号</param>
  20. /// <param name="orderNo">交易订单号(好哒平台订单号,G开头)</param>
  21. /// <param name="acctNo">账户号,账户类型为商户收款账户时填收款商户号, 账户类型为分账接收方时填分账接收方账户号</param>
  22. /// <param name="acctType">账户类型(0:商户收款账户(大B),1:分账接收方账户(小B))</param>
  23. /// <param name="amount">金额(分)</param>
  24. /// <returns></returns>
  25. public static OrderDivideAccounts AddValue(string applyNo, string mchtNo, string orderNo, string acctNo, string sacctNo, string acctType, string amount, string seviceAmount)
  26. {
  27. OrderDivideAccounts orderDivideAccounts = new OrderDivideAccounts();
  28. orderDivideAccounts.applyNo = applyNo;
  29. orderDivideAccounts.mchtNo = mchtNo;
  30. orderDivideAccounts.orderNo = orderNo;
  31. List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
  32. Dictionary<string, object> obj = new Dictionary<string, object>();
  33. //分账接收方账户
  34. if(seviceAmount != "0")
  35. {
  36. obj = new Dictionary<string, object>();
  37. obj.Add("acctNo", "230817000000000278");
  38. obj.Add("acctType", "1");
  39. obj.Add("amount", seviceAmount);
  40. list.Add(obj);
  41. }
  42. //商户收款账户
  43. obj = new Dictionary<string, object>();
  44. obj.Add("acctNo", sacctNo);
  45. obj.Add("acctType", "0");
  46. obj.Add("amount", amount);
  47. list.Add(obj);
  48. orderDivideAccounts.detail = list;
  49. return orderDivideAccounts;
  50. }
  51. }
  52. }