| | |
| | | using LifePayment.Application.Contracts; |
| | | using LifePayment.Domain; |
| | | using LifePayment.Domain.Shared; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | using Volo.Abp; |
| | | using Volo.Abp.AspNetCore.Mvc; |
| | | using Volo.Abp.AspNetCore.WebClientInfo; |
| | | using Volo.Abp.EventBus.Distributed; |
| | | using Volo.Abp.Identity; |
| | | using Volo.Abp.Uow; |
| | | using ZeroD.Util; |
| | | using ZeroD.Util.Fadd; |
| | | using LifePayment.Application.Contracts; |
| | | |
| | | namespace LifePayment.HttpApi |
| | | { |
| | |
| | | /// 获取电费面值 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | public async Task<ElectricParValueResponse> GetElectricParValue() |
| | | [ChannelFilter] |
| | | public async Task<ElectricParValueResponse> GetElectricParValue(ChannelsBaseInput input) |
| | | { |
| | | return await _lifePayService.GetElectricParValue(); |
| | | } |
| | |
| | | /// 获取电费充值区域 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | public async Task<ElectricSupportAreaResponse> GetElectricSupportArea() |
| | | [ChannelFilter] |
| | | public async Task<ElectricSupportAreaResponse> GetElectricSupportArea(ChannelsBaseInput input) |
| | | { |
| | | var aresResult = await _lifePayService.GetElectricSupportArea(); |
| | | var parValues = await _lifePayService.GetElectricParValue(); |
| | | |
| | | foreach(var item in aresResult.ElectricAreaList) |
| | | foreach (var item in aresResult.ElectricAreaList) |
| | | { |
| | | var paritem = parValues.ElectricParValue.Where(r=>r.AreaName == item.CityName).FirstOrDefault(); |
| | | if(paritem != null) |
| | | var paritem = parValues.ElectricParValue.Where(r => r.AreaName == item.CityName).FirstOrDefault(); |
| | | if (paritem != null) |
| | | { |
| | | item.ElectricType = paritem.ElectricType; |
| | | item.ParValue = paritem.ParValue; |
| | |
| | | /// 获取话费面值 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | public async Task<PhoneParValueResponse> GetPhoneParValue() |
| | | [ChannelFilter] |
| | | public async Task<PhoneParValueResponse> GetPhoneParValue(ChannelsBaseInput input) |
| | | { |
| | | return await _lifePayService.GetPhoneParValue(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取燃气面值 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<GasParValueResponse> GetGasParValue(ChannelsBaseInput input) |
| | | { |
| | | return await _lifePayService.GetGasParValue(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取燃气支持商户 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<GasOrgTypeValueResponse> GetGasOrgType(ChannelsBaseInput input) |
| | | { |
| | | return await _lifePayService.GetGasOrgType(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<PageOutput<UserLifePayOrderOutput>> GetUserLifePayOrderPage(QueryLifePayOrderListInput input) |
| | | { |
| | | return await _lifePayService.GetUserLifePayOrderPage(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据订单号获取支付状态 |
| | | /// 获取我的订单详情 |
| | | /// </summary> |
| | | /// <param name="orderNo"></param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public async Task<LifePayStatusEnum> GetPayStatusByOrderNo(string orderNo) |
| | | public async Task<UserLifePayOrderOutput> GetUserLifePayOrderDetail(string orderNo) |
| | | { |
| | | return await _lifePayService.GetPayStatusByOrderNo(orderNo); |
| | | return await _lifePayService.GetUserLifePayOrderDetail(orderNo); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据订单号获取支付状态 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<LifePayStatusEnum> GetPayStatusByOrderNo(GetPayStatusByOrderNoInput input) |
| | | { |
| | | return await _lifePayService.GetPayStatusByOrderNo(input.OrderNo); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取缴费渠道列表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<PageOutput<CreateEditPayChannelsInput>> GetLifePayChannlesPage(PageInput input) |
| | | { |
| | | return await _lifePayService.GetLifePayChannlesPage(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取渠道详情 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public async Task<CreateEditPayChannelsInput> GetLifePayChannlesDto(Guid id) |
| | | { |
| | | return await _lifePayService.GetLifePayChannlesDto(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 用户查看生活缴费退款失败详情 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public async Task<UserLifePayOrderRefundOutput> GetUserLifePayOrderRefund(Guid id) |
| | | { |
| | | return await _lifePayService.GetUserLifePayOrderRefund(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取用户户号分页数据 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<PageOutput<UserAccountOutput>> GetAccountPage(QueryUserAccountListInput input) |
| | | { |
| | | return await _lifePayService.GetAccountPage(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取我的户号列表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<PageOutput<UserAccountOutput>> GetUserAccountList(QueryUserAccountListInput input) |
| | | { |
| | | return await _lifePayService.GetUserAccountList(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取我的全部户号列表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<List<UserAccountOutput>> GetUserAccountAllList(QueryUserAccountAllListInput input) |
| | | { |
| | | return await _lifePayService.GetUserAccountAllList(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取我的户号详情 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public async Task<UserAccountOutput> GetUserAccountDetail(Guid id) |
| | | { |
| | | return await _lifePayService.GetUserAccountDetail(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导出订单Excel |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<ActionResult> GetLifePayOrderPageExport(QueryLifePayOrderListInput input) |
| | | { |
| | | var data = await _lifePayService.GetLifePayOrderPageExport(input); |
| | | if (data.Any()) |
| | | { |
| | | var bytes = ExcelHelper.ListToByteForExcel(data, "xlsx"); |
| | | return File(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "订单管理" + ".xlsx"); |
| | | } |
| | | |
| | | return Json(default); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<CreateLifePayOrderOutput> CreateLifePayPhoneOrder(CreateLifePayOrderInput<LifePhoneData> input) |
| | | { |
| | | return await _lifePayService.CreateLifePayPhoneOrder(input); |
| | |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<CreateLifePayOrderOutput> CreateLifePayElectricOrder(CreateLifePayOrderInput<LifeElectricData> input) |
| | | { |
| | | return await _lifePayService.CreateLifePayElectricOrder(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 创建生活缴费燃气订单 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<CreateLifePayOrderOutput> CreateLifePayGasOrder(CreateLifePayOrderInput<LifeGasData> input) |
| | | { |
| | | return await _lifePayService.CreateLifePayGasOrder(input); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 用户发起生活缴费退款 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<int> RefundUserLifePayOrder(RefundUserLifePayOrderInput input) |
| | | { |
| | | await _lifePayService.RefundUserLifePayOrder(input); |
| | | return Constant.SUCCESS; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加或修改我的户号 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<int> AddUpdateUserAccount(AddUpdateUserAccountInput input) |
| | | { |
| | | await _lifePayService.AddUpdateUserAccount(input); |
| | | return Constant.SUCCESS; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除我的户号 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | public async Task<int> DeleteUserAccount(Guid id) |
| | | { |
| | | await _lifePayService.DeleteUserAccount(id); |
| | | return Constant.SUCCESS; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 退款驳回 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<int> RejectRefundLifePayOrder(RefundLifePayOrderInput input) |
| | | { |
| | | await _lifePayService.RejectRefundLifePayOrder(input); |
| | | return Constant.SUCCESS; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 渠道管理 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<int> CreateEditPayChannels(CreateEditPayChannelsInput input) |
| | | { |
| | | await _lifePayService.CreateEditPayChannels(input); |
| | | return Constant.SUCCESS; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置渠道启用状态 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="status"></param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public async Task<int> SetLifePayChannelsStatus(Guid id, LifePayChannelsStatsEnum status) |
| | | { |
| | | await _lifePayService.SetLifePayChannelsStatus(id, status); |
| | | return Constant.SUCCESS; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 折扣配置 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<int> CreateEditLifePayRate(List<LifePayRateInput> input) |
| | | { |
| | | await _lifePayService.CreateEditLifePayRate(input); |
| | | return Constant.SUCCESS; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置生活缴费支付类型 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<string> SetLifePayOrderPayType(SetLifePayOrderPayTypeInput input) |
| | | { |
| | | |
| | |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [AllowAnonymous] |
| | | [ChannelFilter] |
| | | public async Task<ModelPaymentMiniPay> GetPayOrderForJsAPI(GetPayOrderForJsAPIInput input) |
| | | { |
| | | return await _lifePayService.GetPayOrderForJsAPI(input, _webClientInfoProvider.ClientIpAddress); |