| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.AspNetCore.Http;
- using Microsoft.Extensions.Logging;
- using Microsoft.Extensions.Options;
- using Microsoft.AspNetCore.Authorization;
- using System.Web;
- using MySystem.Models.Main2;
- using MySystem.Service.Main2;
- using LitJson;
- using Library;
- namespace MySystem.Areas.Api.Controllers.v1.Main2
- {
- [Area("Api")]
- [Route("/v1/QrCodePlateMain/[controller]/[action]")]
- public class ConsumerProfitController : BaseController
- {
- public ConsumerProfitController(IHttpContextAccessor accessor) : base(accessor)
- {
- }
- #region 交易查询-银联商户订单分账记录
- [Authorize]
- public JsonResult UnionPayOrderProfitList(string value)
- {
- value = PublicFunction.DesDecrypt(value);
- JsonData data = JsonMapper.ToObject(value);
- List<Dictionary<string, object>> dataList = UnionPayOrderProfitListDo(value);
- return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
- }
- private List<Dictionary<string, object>> UnionPayOrderProfitListDo(string value)
- {
- JsonData data = JsonMapper.ToObject(value);
- string OrderId = data["OrderId"].ToString(); //订单Id
- int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
- int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
- var orderId = int.Parse(OrderId);
- var order = ConsumerOrdersService.Query(orderId);
- var Status = 0;
- if (order.IsAct == 0 && order.DivideFlag == 0)
- {
- Status = -1;
- }
- if (order.IsAct == 1 && order.DivideFlag == 0)
- {
- Status = 0;
- }
- if (order.IsAct == 1 && order.DivideFlag == 1)
- {
- Status = 2;
- }
- if (order.IsAct == 1 && order.DivideFlag == 2)
- {
- Status = 1;
- }
- List<RelationData> relationData = new List<RelationData>();
- List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
- List<Dictionary<string, object>> source = ConsumerProfitService.List(relationData, " and OrderId=" + orderId + "", pageNum, pageSize);
- foreach (Dictionary<string, object> subdata in source)
- {
- Dictionary<string, object> curData = new Dictionary<string, object>();
- curData.Add("Id", int.Parse(subdata["Id"].ToString())); //Id
- curData.Add("OrderNo", order.OrderNo); //来源单号
- curData.Add("Amount", decimal.Parse(subdata["GetMoney"].ToString()).ToString("f2")); //分红金额
- curData.Add("DivideDate", subdata["CreateDate"].ToString() == "" ? "" : DateTime.Parse(subdata["CreateDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss")); //分红时间
- curData.Add("Status", Status); //分账状态(-1无 0 未分账 2 分账中 1 已完成)
- curData.Add("SetRecordId", order.SetRecordId); //活动Id
- dataList.Add(curData);
- }
- return dataList;
- }
- #endregion
- }
- }
|