Commit 62b0b219 authored by 黄奎's avatar 黄奎

页面修改

parent 70c5f01f
......@@ -14,11 +14,14 @@ namespace Edu.Common.WeChatPayAPIv3
/// </summary>
public class AesGcmHelper
{
private static string ALGORITHM = "AES/GCM/NoPadding";
private static int TAG_LENGTH_BIT = 128;
private static int NONCE_LENGTH_BYTE = 12;
private static string AES_KEY = string.Empty;
/// <summary>
/// 解密微信
/// </summary>
/// <param name="associatedData"></param>
/// <param name="nonce"></param>
/// <param name="ciphertext"></param>
/// <param name="APIV3Key"></param>
/// <returns></returns>
public static string AesGcmDecrypt(string associatedData, string nonce, string ciphertext, string APIV3Key)
{
GcmBlockCipher gcmBlockCipher = new GcmBlockCipher(new AesEngine());
......
......@@ -151,7 +151,6 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_PlatformAccountRepository platformAccountRepository = new RB_PlatformAccountRepository();
/// <summary>
/// 班级关联课程仓储层对象
/// </summary>
......@@ -220,6 +219,19 @@ namespace Edu.Module.Course
return list;
}
/// <summary>
/// 获取班级课程信息
/// </summary>
/// <param name="classId"></param>
/// <returns></returns>
public Dictionary<string,object> GetClassCourseListModule(int classId)
{
Dictionary<string, object> fileds = new Dictionary<string, object>();
var courseList = class_CourseRepository.GetClassCourseListRepository(new RB_Class_Course_Extend() { ClassId = classId });
return fileds;
}
/// <summary>
/// 获取班级名称
/// </summary>
......@@ -250,7 +262,7 @@ namespace Edu.Module.Course
/// <param name="userInfo"></param>
/// <returns></returns>
[TransactionCallHandler]
public bool SetClassOrder(RB_Order_ViewModel demodel, UserInfo userInfo,bool isEditOrder, out string message)
public virtual bool SetClassOrder(RB_Order_ViewModel demodel, UserInfo userInfo,bool isEditOrder, out string message)
{
bool flag = false;
message = "";
......@@ -577,7 +589,7 @@ namespace Edu.Module.Course
/// <param name="userInfo"></param>
/// <returns></returns>
[TransactionCallHandler]
public bool SetStudyOrder(RB_Order_ViewModel demodel, UserInfo userInfo, out string message)
public virtual bool SetStudyOrder(RB_Order_ViewModel demodel, UserInfo userInfo, out string message)
{
bool flag = false;
message = "";
......@@ -728,17 +740,7 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public RB_Order_ViewModel GetClassOrderInfo(int orderId)
{
return orderRepository.GetEntity<RB_Order_ViewModel>(orderId);
}
/// <summary>
/// 获取订单详情
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public RB_Order_ViewModel GetClassOrderInfo_V2(int orderId)
public RB_Order_ViewModel GetClassOrderInfoModule(int orderId)
{
var model = orderRepository.GetEntity<RB_Order_ViewModel>(orderId);
if (model != null)
......@@ -755,6 +757,8 @@ namespace Edu.Module.Course
return model;
}
/// <summary>
/// 获取订单阶梯价格
/// </summary>
......
......@@ -149,7 +149,6 @@ LEFT JOIN rb_teacher AS T ON a.TeacherId=T.TId
{
builder.AppendFormat(" AND A.{0} <='{1} 23:59:59' ", nameof(RB_Class_Plan_ViewModel.ClassDate), query.EndTime);
}
}
return Get<RB_Class_Plan_ViewModel>(builder.ToString()).ToList();
}
......
......@@ -59,16 +59,6 @@ WHERE 1=1
return Get<RB_Class_Time_ViewModel>(builder.ToString()).ToList();
}
/// <summary>
/// 根据班级编号删除班级上课时间
/// </summary>
/// <param name="ClassId">班级编号</param>
/// <returns></returns>
public bool DeleteClassTimeRepository(int ClassId)
{
return base.DeleteOne(new VT.FW.DB.WhereHelper(nameof(RB_Class_Time_ViewModel.ClassId), ClassId));
}
/// <summary>
/// 根据上课计划编号删除上课计划
/// </summary>
......
......@@ -437,7 +437,7 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.ParamIsNull();
}
var model = orderModule.GetClassOrderInfo(OrderId);
var model = orderModule.GetClassOrderInfoModule(OrderId);
if (model == null) {
return ApiResult.Failed("订单不存在");
}
......@@ -492,12 +492,11 @@ namespace Edu.WebApi.Controllers.Course
{
return ApiResult.ParamIsNull();
}
var model = orderModule.GetClassOrderInfo_V2(OrderId);
var model = orderModule.GetClassOrderInfoModule(OrderId);
if (model == null)
{
return ApiResult.Failed("订单不存在");
}
return ApiResult.Success("", new
{
model.OrderId,
......@@ -1542,5 +1541,19 @@ namespace Edu.WebApi.Controllers.Course
return flag ? ApiResult.Success(message: message) : ApiResult.Failed(message: message);
}
#endregion
#region 插班报入
/// <summary>
/// 获取插板报入配置信息
/// </summary>
/// <returns></returns>
public ApiResult GetChaClassInfo()
{
var ClassId = base.ParmJObj.GetInt("ClassId");
var otherClassList = orderModule.GetClassCourseListModule(ClassId);
return ApiResult.Success(data: otherClassList);
}
#endregion
}
}
......@@ -88,7 +88,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
[HttpPost]
[HttpGet]
[AllowAnonymous]
public async Task<WxPayCallbackRespModel> WxPayCallback(WxPayNotifyModel wxPayNotifyModel)
public WxPayCallbackRespModel WxPayCallback(WxPayNotifyModel wxPayNotifyModel)
{
var viewModel = new WxPayCallbackRespModel();
try
......@@ -112,7 +112,6 @@ namespace Edu.WebApi.Controllers.WeChatPay
}
else
{
if (payModel != null && payModel.trade_state == "SUCCESS")//生成财务单据
{ //然后进行数据库更新处理……等等其他操作
UpdateFinance(payModel);//生成财务单据以及生成支付记录
......@@ -123,6 +122,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "WxPayCallback");
viewModel.code = "FAIL";
viewModel.message = "数据解密失败";
}
......@@ -137,7 +137,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
/// <returns></returns>
[AllowAnonymous]
public async Task UpdateFinance(WxPayResourceDecryptModel payModel)
public void UpdateFinance(WxPayResourceDecryptModel payModel)
{
LogHelper.WriteInfo("我是回调" + System.DateTime.Now);
int contractId = Convert.ToInt32(payModel.out_trade_no[17..]);
......@@ -158,7 +158,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
{
LogHelper.WriteInfo(payModel.out_trade_no + "我要新增财务单据啦...." + System.DateTime.Now);
var orderModle = educationContractModule.GetEducationContractModule(contractId);
var orderModel = orderModule.GetClassOrderInfo(orderModle.OrderId);
var orderModel = orderModule.GetClassOrderInfoModule(orderModle.OrderId);
var financeConfig = educationContractModule.GetFinanceConfigList(new Model.ViewModel.Course.RB_Finance_Config_ViewModel { Group_Id = orderModle.Group_Id, Type = Common.Enum.Course.FinanceConfigTypeEnum.Tuition }).FirstOrDefault();
if (financeConfig == null)
{
......@@ -183,15 +183,17 @@ namespace Edu.WebApi.Controllers.WeChatPay
ServiceFee = OriginalFee
};
#region 财务单据数据组装
var detailList = new List<object>();
detailList.Add(new
var detailList = new List<object>
{
CostTypeId = financeConfig?.CostTypeId ?? 533,
Number = 1,
OriginalMoney = Convert.ToDecimal(payModel.amount.payer_total) / 100,
UnitPrice = Convert.ToDecimal(payModel.amount.payer_total) / 100,
Remark = orderModle.StudentName + orderModle.CourseName + payModel.out_trade_no
});
new
{
CostTypeId = financeConfig?.CostTypeId ?? 533,
Number = 1,
OriginalMoney = Convert.ToDecimal(payModel.amount.payer_total) / 100,
UnitPrice = Convert.ToDecimal(payModel.amount.payer_total) / 100,
Remark = orderModle.StudentName + orderModle.CourseName + payModel.out_trade_no
}
};
var financeObj = new
{
......@@ -216,8 +218,8 @@ namespace Edu.WebApi.Controllers.WeChatPay
RB_BranchName = userInfo.SchoolName,
RB_GroupName = userInfo.GroupName,
FinanceType = 2,
GuestId = orderModle.GuestId,
OrderId = orderModle.OrderId,
orderModle.GuestId,
orderModle.OrderId,
TCIDList = orderModel.ClassId > 0 ? new List<int>() { orderModel.ClassId } : new List<int>(),
};
#endregion
......@@ -363,7 +365,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
[HttpPost]
[HttpGet]
[AllowAnonymous]
public async Task<RefundsCallbackRespModel> RefundsCallback(RefundsCallbackModel wxPayNotifyModel)
public RefundsCallbackRespModel RefundsCallback(RefundsCallbackModel wxPayNotifyModel)
{
//我没有使用官方的那种验证数据安全性的方法,我解密出来数据之后,直接拿着商户退款订单号再去查询一下订单状态,然后再更新到数据库中。我嫌麻烦……
var resource = wxPayNotifyModel?.resource ?? new RefundsCallbackResourceModel();
......@@ -420,7 +422,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
[AllowAnonymous]
public async Task UpdateRefundsCallbackFinance(RefundsCallbackDecryptModel payModel)
public void UpdateRefundsCallbackFinance(RefundsCallbackDecryptModel payModel)
{
int contractId = Convert.ToInt32(payModel.out_trade_no[17..]);
bool isAdd = false;
......@@ -439,7 +441,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
if (isAdd)
{
var orderModle = educationContractModule.GetEducationContractModule(contractId);
var orderModel = orderModule.GetClassOrderInfo(orderModle.OrderId);
var orderModel = orderModule.GetClassOrderInfoModule(orderModle.OrderId);
var payOrderRecordModel = educationContractModule.GetOrderRecordList(new RB_Finance_OrderRecord { ContractId = contractId, OutTradeNo = payModel.out_trade_no }).FirstOrDefault();
var userInfo = employeeModule.GetEmployeeListModule(new Model.ViewModel.User.Employee_ViewModel { Id = orderModel.EnterID, Group_Id = orderModel.Group_Id }).ToList().FirstOrDefault();
var OriginalFee = Math.Round(Convert.ToDecimal((Convert.ToDecimal(Config.SettlementRate) / 100) * (Convert.ToDecimal(payModel.amount.payer_total) / 100)), 2, MidpointRounding.AwayFromZero);//手续费
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment