Commit e6c049f0 authored by 吴春's avatar 吴春
parents 8a2486b1 81740e10
This diff is collapsed.
...@@ -157,6 +157,9 @@ namespace Mall.WebApi.Controllers.Finance ...@@ -157,6 +157,9 @@ namespace Mall.WebApi.Controllers.Finance
} }
//执行发放金额 //执行发放金额
if (model.WithdrawalWay == DistrbutorWithdrawWayEnum.ZDDK) if (model.WithdrawalWay == DistrbutorWithdrawWayEnum.ZDDK)
{
int IsNormalServer = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("IsNormalServer").Value);
if (IsNormalServer == 1)
{ {
var mallModel = userModule.GetMiniProgramExtend(MallBaseId); var mallModel = userModule.GetMiniProgramExtend(MallBaseId);
var umodel = userModule.GetMemberUserInfo(model.UserId ?? 0); var umodel = userModule.GetMemberUserInfo(model.UserId ?? 0);
...@@ -176,6 +179,15 @@ namespace Mall.WebApi.Controllers.Finance ...@@ -176,6 +179,15 @@ namespace Mall.WebApi.Controllers.Finance
return ApiResult.Failed("支付失败"); return ApiResult.Failed("支付失败");
} }
} }
else {
string msg1 = userModule.SetDistributorRemitAudit(RemitId, 2, Remark, TenantId.ToString(), MallBaseId);
if (msg1 != "")
{
return ApiResult.Failed("提现:" + RemitId + ",失败");
}
return ApiResult.Success();
}
}
else else
{ {
return ApiResult.Failed("暂不支持该类型打款"); return ApiResult.Failed("暂不支持该类型打款");
......
...@@ -94,12 +94,6 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -94,12 +94,6 @@ namespace Mall.WebApi.Controllers.MallBase
Common.Plugin.LogHelper.Error("MallController_GetHome", ex); Common.Plugin.LogHelper.Error("MallController_GetHome", ex);
} }
//获取小程序信息
var miniProgram = new RB_MiniProgram_Extend();
if (MiniAppId != null && !string.IsNullOrEmpty(MiniAppId))
{
miniProgram = programModule.GetMiniProgramModule(new Model.Extend.User.RB_MiniProgram_Extend() { MiniAppId = MiniAppId }, isGetHomeData: true, isGetNav: 1);
}
int page_id = parms.GetInt("page_id"); int page_id = parms.GetInt("page_id");
//首页数据 //首页数据
var homePage = new object(); var homePage = new object();
...@@ -119,6 +113,20 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -119,6 +113,20 @@ namespace Mall.WebApi.Controllers.MallBase
var user_info = new object(); var user_info = new object();
//小程序 //小程序
var mall = new object(); var mall = new object();
//获取小程序信息
var miniProgram = new RB_MiniProgram_Extend();
if (MiniAppId != null && !string.IsNullOrEmpty(MiniAppId))
{
miniProgram = programModule.GetMiniProgramModule(new Model.Extend.User.RB_MiniProgram_Extend() { MiniAppId = MiniAppId }, isGetHomeData: true, isGetNav: 1);
//基础配置
setting = MallHelper.GetBasicSetting(miniProgram);
//分销基础信息
share_setting = MallHelper.GetDistributorBasicsInfo(miniProgram);
//分销商设置
share_setting_custom = MallHelper.GetDistributorCustomInfo(miniProgram);
}
if (page_id > 0) if (page_id > 0)
{ {
var targetPage = miniprogramPageTemplModule.GetMiniprogramPageTemplModule(new RB_Miniprogram_Page_Templ_Extend() var targetPage = miniprogramPageTemplModule.GetMiniprogramPageTemplModule(new RB_Miniprogram_Page_Templ_Extend()
...@@ -342,14 +350,14 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -342,14 +350,14 @@ namespace Mall.WebApi.Controllers.MallBase
}; };
} }
} }
//基础配置 }
setting = MallHelper.GetBasicSetting(miniProgram);
//分销基础信息
share_setting = MallHelper.GetDistributorBasicsInfo(miniProgram);
//分销商设置
share_setting_custom = MallHelper.GetDistributorCustomInfo(miniProgram);
if (RequestParm.OpenId != null && !string.IsNullOrWhiteSpace(RequestParm.OpenId))
{
var memberModel = userModule.GetAppletUserCenterStatistics(RequestParm.OpenId);
user_info = memberModel;
}
}
#region 商品分类样式 #region 商品分类样式
var productCategoryStyle = productModule.GetProductCategoryStyleInfo(miniProgram.TenantId ?? 0, miniProgram.MallBaseId); var productCategoryStyle = productModule.GetProductCategoryStyleInfo(miniProgram.TenantId ?? 0, miniProgram.MallBaseId);
cat_style = new cat_style = new
...@@ -377,14 +385,6 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -377,14 +385,6 @@ namespace Mall.WebApi.Controllers.MallBase
option = new List<object>(), option = new List<object>(),
setting, setting,
}; };
}
if (RequestParm.OpenId != null && !string.IsNullOrWhiteSpace(RequestParm.OpenId))
{
var memberModel = userModule.GetAppletUserCenterStatistics(RequestParm.OpenId);
user_info = memberModel;
}
}
var miniPageList = programPageModule.GetMiniprogram_Page_ListExtModule(new RB_MiniProgram_Page_Extend() { MallBaseId = RequestParm.MallBaseId }); var miniPageList = programPageModule.GetMiniprogram_Page_ListExtModule(new RB_MiniProgram_Page_Extend() { MallBaseId = RequestParm.MallBaseId });
var objResult = new var objResult = new
......
...@@ -1594,8 +1594,7 @@ namespace Mall.WebApi.Controllers ...@@ -1594,8 +1594,7 @@ namespace Mall.WebApi.Controllers
} }
//商城风格 //商城风格
var mallStyle = new object(); var mallStyle = new object();
if (miniProgram?.MallShopStyle > 0)
{
ResultMallShopStyle resultMallShopStyle = new ResultMallShopStyle(); ResultMallShopStyle resultMallShopStyle = new ResultMallShopStyle();
switch (miniProgram.MallShopStyle) switch (miniProgram.MallShopStyle)
{ {
...@@ -1635,7 +1634,6 @@ namespace Mall.WebApi.Controllers ...@@ -1635,7 +1634,6 @@ namespace Mall.WebApi.Controllers
resultMallShopStyle?.main, resultMallShopStyle?.main,
resultMallShopStyle?.secondary, resultMallShopStyle?.secondary,
}; };
}
var setting = new var setting = new
{ {
......
...@@ -17,6 +17,8 @@ using Mall.Common; ...@@ -17,6 +17,8 @@ using Mall.Common;
using Mall.Module.Product; using Mall.Module.Product;
using Mall.Common.Enum.Goods; using Mall.Common.Enum.Goods;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Json;
namespace Mall.WebApi.Controllers.MallBase namespace Mall.WebApi.Controllers.MallBase
{ {
...@@ -665,16 +667,50 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -665,16 +667,50 @@ namespace Mall.WebApi.Controllers.MallBase
if (omodel.IsApplyForCancel != 1) { if (omodel.IsApplyForCancel != 1) {
return ApiResult.Failed("该订单未申请取消该订单"); return ApiResult.Failed("该订单未申请取消该订单");
} }
int IsNormalServer = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("IsNormalServer").Value);
if (Type == 1 && IsNormalServer == 1)
{
//获取小程序信息
var mallModel = orderModule.GetMiniProgramExtend(req.MallBaseId);
int RefundNum = orderModule.GetOrderRefundOnlineTradeNum(OrderId, req.TenantId, req.MallBaseId);
string RefundOrderNo = omodel.OrderNo + (RefundNum + 1);
var pram = new Common.Pay.WeChatPat.PayParam()
{
TotalFee = Convert.ToInt32((omodel.Income ?? 0) * 100),
RefundFee = (omodel.Income ?? 0),
OrderNumber = omodel.MerchantsNo,
RefundNumber = RefundOrderNo
};
var Robj = new App_Code.PayUtil().Refund(pram, mallModel, _accessor);
if (Robj.IsSuccess)
{
bool flag = orderModule.SetOrderApplyForCancelAudit(omodel, Type, Remark, req.TenantId, req.MallBaseId); bool flag = orderModule.SetOrderApplyForCancelAudit(omodel, Type, Remark, req.TenantId, req.MallBaseId);
if (flag) if (flag)
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else
{
return ApiResult.Failed();
}
}
else { else {
return ApiResult.Failed(); return ApiResult.Failed();
} }
} }
else
{
bool flag = orderModule.SetOrderApplyForCancelAudit(omodel, Type, Remark, req.TenantId, req.MallBaseId);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
}
/// <summary> /// <summary>
/// 清空回收站 /// 清空回收站
...@@ -1418,6 +1454,9 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1418,6 +1454,9 @@ namespace Mall.WebApi.Controllers.MallBase
if (orderModel == null) { if (orderModel == null) {
return ApiResult.Failed("未查询到订单信息"); return ApiResult.Failed("未查询到订单信息");
} }
int IsNormalServer = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("IsNormalServer").Value);
if (IsNormalServer == 1)
{
//获取小程序信息 //获取小程序信息
var mallModel = orderModule.GetMiniProgramExtend(req.MallBaseId); var mallModel = orderModule.GetMiniProgramExtend(req.MallBaseId);
int RefundNum = orderModule.GetOrderRefundOnlineTradeNum(ReModel.OrderId ?? 0, req.TenantId, req.MallBaseId); int RefundNum = orderModule.GetOrderRefundOnlineTradeNum(ReModel.OrderId ?? 0, req.TenantId, req.MallBaseId);
...@@ -1430,9 +1469,11 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1430,9 +1469,11 @@ namespace Mall.WebApi.Controllers.MallBase
RefundNumber = RefundOrderNo RefundNumber = RefundOrderNo
}; };
var Robj = new App_Code.PayUtil().Refund(pram, mallModel, _accessor); var Robj = new App_Code.PayUtil().Refund(pram, mallModel, _accessor);
if (Robj.IsSuccess) { if (Robj.IsSuccess)
{
bool flag = orderModule.SetOrderAfterSaleForRefunds(ReOrderId, Refund, req.TenantId, req.MallBaseId); bool flag = orderModule.SetOrderAfterSaleForRefunds(ReOrderId, Refund, req.TenantId, req.MallBaseId);
if (flag == false) { if (flag == false)
{
//日志记录 //日志记录
LogHelper.Write("售后订单:" + ReOrderId + ",金额:" + Refund + " 退款记录失败"); LogHelper.Write("售后订单:" + ReOrderId + ",金额:" + Refund + " 退款记录失败");
} }
...@@ -1440,6 +1481,17 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1440,6 +1481,17 @@ namespace Mall.WebApi.Controllers.MallBase
} }
return ApiResult.Failed(); return ApiResult.Failed();
} }
else {
bool flag = orderModule.SetOrderAfterSaleForRefunds(ReOrderId, Refund, req.TenantId, req.MallBaseId);
if (flag)
{
return ApiResult.Success("");
}
else {
return ApiResult.Failed();
}
}
}
......
...@@ -16,6 +16,8 @@ using Newtonsoft.Json.Linq; ...@@ -16,6 +16,8 @@ using Newtonsoft.Json.Linq;
using Mall.Common; using Mall.Common;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Json;
namespace Mall.WebApi.Controllers.User namespace Mall.WebApi.Controllers.User
{ {
...@@ -1812,6 +1814,9 @@ namespace Mall.WebApi.Controllers.User ...@@ -1812,6 +1814,9 @@ namespace Mall.WebApi.Controllers.User
} }
//执行发放金额 //执行发放金额
if (model.WithdrawalWay == DistrbutorWithdrawWayEnum.ZDDK) if (model.WithdrawalWay == DistrbutorWithdrawWayEnum.ZDDK)
{
int IsNormalServer = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("IsNormalServer").Value);
if (IsNormalServer == 1)
{ {
var mallModel = userModule.GetMiniProgramExtend(re.MallBaseId); var mallModel = userModule.GetMiniProgramExtend(re.MallBaseId);
var umodel = userModule.GetMemberUserInfo(model.UserId ?? 0); var umodel = userModule.GetMemberUserInfo(model.UserId ?? 0);
...@@ -1825,10 +1830,20 @@ namespace Mall.WebApi.Controllers.User ...@@ -1825,10 +1830,20 @@ namespace Mall.WebApi.Controllers.User
} }
return ApiResult.Success(); return ApiResult.Success();
} }
else { else
{
return ApiResult.Failed("支付失败"); return ApiResult.Failed("支付失败");
} }
} }
else {
string msg1 = userModule.SetDistributorRemitAudit(RemitId, Type, Remark, re.uid, re.MallBaseId);
if (msg1 != "")
{
return ApiResult.Failed("提现:" + RemitId + ",失败");
}
return ApiResult.Success();
}
}
else else
{ {
return ApiResult.Failed("暂不支持该类型打款"); return ApiResult.Failed("暂不支持该类型打款");
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
}, },
"VirtualDirectory": "WebFile", "VirtualDirectory": "WebFile",
"FileService": "2", "FileService": "2",
"IsNormalServer": 2,
"FinanceSetting": { "FinanceSetting": {
"TenantId": 1, "TenantId": 1,
"MallBaseId": 1, "MallBaseId": 1,
......
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