160 lines
6.9 KiB
C#
160 lines
6.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web.Http;
|
|
using System.Web.Http.Description;
|
|
|
|
namespace GSYWApi.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 移动支付配置表相关接口
|
|
/// </summary>
|
|
public class MobilePaymentController : BaseController
|
|
{
|
|
#region 获取移动支付配置列表
|
|
/// <summary>
|
|
/// 获取移动支付配置列表
|
|
/// </summary>
|
|
/// <param name="Serverpart_ID">服务区内码</param>
|
|
/// <param name="Payment_Channel">支付通道</param>
|
|
/// <param name="BusinessShopCode_State">有效状态</param>
|
|
/// <param name="PageIndex">查询页码数</param>
|
|
/// <param name="PageSize">每页显示数量</param>
|
|
/// <param name="SortStr">排序字段</param>
|
|
/// <returns></returns>
|
|
[Route("MobilePayment/GetBusinessShopCodeList")]
|
|
[AcceptVerbs("GET")]
|
|
[ResponseType(typeof(Models.JsonMsg<Models.JsonList<Model.BUSINESSSHOPCODEModel>>))]
|
|
public IHttpActionResult GetBusinessShopCodeList(int? Serverpart_ID = null, int? Payment_Channel = null,
|
|
int? BusinessShopCode_State = null, int PageIndex = 1, int PageSize = 10, string SortStr = "")
|
|
{
|
|
string Parameter = "入参信息:查询页码【" + PageIndex + "】,每页显示数量【" + PageSize + "】";
|
|
try
|
|
{
|
|
int TotalCount = 0;
|
|
//获取移动支付配置表列表
|
|
List<Model.BUSINESSSHOPCODEModel> BUSINESSSHOPCODEList = Helper.BUSINESSSHOPCODEHelper.GetBUSINESSSHOPCODEList(
|
|
transaction, Serverpart_ID, Payment_Channel, BusinessShopCode_State, ref TotalCount, PageIndex, PageSize, SortStr);
|
|
|
|
//转化json形式
|
|
Models.JsonList<Model.BUSINESSSHOPCODEModel> jsonList = Models.JsonList<Model.BUSINESSSHOPCODEModel>.Success(
|
|
BUSINESSSHOPCODEList, TotalCount, PageIndex, PageSize);
|
|
|
|
return Ok(Models.JsonMsg<Models.JsonList<Model.BUSINESSSHOPCODEModel>>.Success(jsonList, 100, "查询成功"));
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//事务回滚
|
|
transaction.Rollback();
|
|
Helper.LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
|
|
DateTime.Now.ToString("yyyyMMdd") + "_GetBUSINESSSHOPCODEList");
|
|
return Ok(Helper.Common.ReturnJson(999, "查询失败" + ex.Message));
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取移动支付配置表明细
|
|
/// <summary>
|
|
/// 获取移动支付配置表明细
|
|
/// </summary>
|
|
/// <param name="BusinessShopCodeId">移动支付配置表内码</param>
|
|
/// <returns></returns>
|
|
[Route("MobilePayment/GetBusinessShopCodeDetail")]
|
|
[AcceptVerbs("GET")]
|
|
[ResponseType(typeof(Models.JsonMsg<Model.BUSINESSSHOPCODEModel>))]
|
|
public IHttpActionResult GetBusinessShopCodeDetail(int BusinessShopCodeId)
|
|
{
|
|
string Parameter = "入参信息:移动支付配置表内码【" + BusinessShopCodeId + "】";
|
|
try
|
|
{
|
|
//获取移动支付配置表明细
|
|
Model.BUSINESSSHOPCODEModel businessshopcodeModel = Helper.BUSINESSSHOPCODEHelper.GetBUSINESSSHOPCODEDetail(
|
|
transaction, BusinessShopCodeId);
|
|
|
|
return Ok(Models.JsonMsg<Model.BUSINESSSHOPCODEModel>.Success(businessshopcodeModel, 100, "查询成功"));
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//事务回滚
|
|
transaction.Rollback();
|
|
Helper.LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
|
|
DateTime.Now.ToString("yyyyMMdd") + "_GetBUSINESSSHOPCODEDetail");
|
|
return Ok(Helper.Common.ReturnJson(999, "查询失败" + ex.Message));
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 同步移动支付配置表
|
|
/// <summary>
|
|
/// 同步移动支付配置表
|
|
/// </summary>
|
|
/// <param name="businessshopcodeModel"></param>
|
|
/// <returns></returns>
|
|
[Route("MobilePayment/SynchroBusinessShopCode")]
|
|
[AcceptVerbs("POST")]
|
|
[ResponseType(typeof(Models.JsonMsg<string>))]
|
|
public IHttpActionResult SynchroBusinessShopCode(Model.BUSINESSSHOPCODEModel businessshopcodeModel)
|
|
{
|
|
try
|
|
{
|
|
//新增移动支付配置表
|
|
bool SynchroFlag = Helper.BUSINESSSHOPCODEHelper.SynchroBUSINESSSHOPCODE(transaction, businessshopcodeModel);
|
|
|
|
if (SynchroFlag)
|
|
{
|
|
return Ok(Helper.Common.ReturnJson(100, "同步成功"));
|
|
}
|
|
else
|
|
{
|
|
return Ok(Helper.Common.ReturnJson(200, "更新失败,数据不存在!"));
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//事务回滚
|
|
transaction.Rollback();
|
|
Helper.LogUtil.WriteLog(null, "同步失败!失败原因:" + ex.Message,
|
|
DateTime.Now.ToString("yyyyMMdd") + "_SynchroBUSINESSSHOPCODE");
|
|
return Ok(Helper.Common.ReturnJson(999, "同步失败" + ex.Message));
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 删除移动支付配置表
|
|
/// <summary>
|
|
/// 删除移动支付配置表
|
|
/// </summary>
|
|
/// <param name="BusinessShopCodeId">移动支付配置表内码</param>
|
|
/// <returns></returns>
|
|
[Route("MobilePayment/DeleteBusinessShopCode")]
|
|
[AcceptVerbs("GET", "POST")]
|
|
[ResponseType(typeof(Models.JsonMsg<string>))]
|
|
public IHttpActionResult DeleteBusinessShopCode(int BusinessShopCodeId)
|
|
{
|
|
string Parameter = "入参信息:移动支付配置表内码【" + BusinessShopCodeId + "】";
|
|
try
|
|
{
|
|
//删除移动支付配置表
|
|
bool DeleteFlag = Helper.BUSINESSSHOPCODEHelper.DeleteBUSINESSSHOPCODE(transaction, BusinessShopCodeId);
|
|
|
|
if (DeleteFlag)
|
|
{
|
|
return Ok(Helper.Common.ReturnJson(100, "删除成功"));
|
|
}
|
|
else
|
|
{
|
|
return Ok(Helper.Common.ReturnJson(200, "删除失败,数据不存在!"));
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//事务回滚
|
|
transaction.Rollback();
|
|
Helper.LogUtil.WriteLog(null, "删除失败!失败原因:" + ex.Message + "\r\n" + Parameter,
|
|
DateTime.Now.ToString("yyyyMMdd") + "_DeleteBUSINESSSHOPCODE");
|
|
return Ok(Helper.Common.ReturnJson(999, "删除失败" + ex.Message));
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|