Commit 8a298d62 authored by 吴春's avatar 吴春

提交

parent e741890c
......@@ -207,46 +207,55 @@ namespace Mall.Model.Entity.User
// get;
// set;
//}
///// <summary>
///// 待打款佣金描述
///// </summary>
//public string CommissionTobePaidName
//{
// get;
// set;
//}
///// <summary>
///// 用户须知描述
///// </summary>
//public string UserNotesName
//{
// get;
// set;
//}
///// <summary>
///// 我要提现描述
///// </summary>
//public string IWantToWithdrawName
//{
// get;
// set;
//}
///// <summary>
///// 提现金额描述
///// </summary>
//public string WithdrawalAmountName
//{
// get;
// set;
//}
///// <summary>
///// 提现方式描述
///// </summary>
//public string WithdrawalWayName
//{
// get;
// set;
//}
/// <summary>
/// 待打款佣金描述
/// </summary>
public string CommissionTobePaidName
{
get;
set;
}
/// <summary>
/// 用户须知描述
/// </summary>
public string UserNotesName
{
get;
set;
}
/// <summary>
/// 用户须知
/// </summary>
public string UserNotes
{
get;
set;
}
/// <summary>
/// 我要提现描述
/// </summary>
public string IWantToWithdrawName
{
get;
set;
}
/// <summary>
/// 提现金额描述
/// </summary>
public string WithdrawalAmountName
{
get;
set;
}
/// <summary>
/// 提现方式描述
/// </summary>
public string WithdrawalWayName
{
get;
set;
}
public int Status { get; set; }
......
This diff is collapsed.
......@@ -223,11 +223,18 @@ SELECT a.ID as MemberCouponId,a.UserId,b.`Name`,b.CouponType,b.UseType,b.MinCons
userWhere += $" AND {nameof(RB_DiscountCoupon_Extend.UserId)}={query.UserId}";
}
}
// string sql = @$" SELECT t.*,c.MemberNum from (SELECT a.ID,a.`Name`,a.`Describe`,a.CouponType,a.UseType,a.StartDate,a.EndDate,a.MinConsumePrice,a.MaxDiscountsPrice,a.DiscountsPrice,a.IndateDay,a.IndateType from rb_discountcoupon as a
// {where} and a.IndateType=1
//UNION ALL
//SELECT a.ID,a.`Name`,a.`Describe`,a.CouponType,a.UseType,a.StartDate,a.EndDate,a.MinConsumePrice,a.MaxDiscountsPrice,a.DiscountsPrice,a.IndateDay,a.IndateType from rb_discountcoupon as a
// {where} and a.IndateType=2 and a.StartDate>NOW() and a.EndDate<NOW() )
//as t LEFT JOIN (SELECT CouponId,COUNT(*) as MemberNum from rb_member_discountcoupon where `Status`=0 and UseState!=2 {userWhere} GROUP BY CouponId) as c on t.ID=c.CouponId ";
string sql = @$" SELECT t.*,c.MemberNum from (SELECT a.ID,a.`Name`,a.`Describe`,a.CouponType,a.UseType,a.StartDate,a.EndDate,a.MinConsumePrice,a.MaxDiscountsPrice,a.DiscountsPrice,a.IndateDay,a.IndateType from rb_discountcoupon as a
{where} and a.IndateType=1
UNION ALL
SELECT a.ID,a.`Name`,a.`Describe`,a.CouponType,a.UseType,a.StartDate,a.EndDate,a.MinConsumePrice,a.MaxDiscountsPrice,a.DiscountsPrice,a.IndateDay,a.IndateType from rb_discountcoupon as a
{where} and a.IndateType=2 and a.StartDate>NOW() and a.EndDate<NOW() )
{where} and a.IndateType=2 and a.EndDate>NOW() )
as t LEFT JOIN (SELECT CouponId,COUNT(*) as MemberNum from rb_member_discountcoupon where `Status`=0 and UseState!=2 {userWhere} GROUP BY CouponId) as c on t.ID=c.CouponId ";
return GetPage<RB_DiscountCoupon_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
......@@ -332,7 +339,7 @@ SELECT a.*,b.TriggerType,b.GrantNum from rb_coupon_selfmotion as b LEFT JOIN rb_
LEFT JOIN rb_coupon_selfmotionmember as c on c.SelfMotionId=b.ID
where (a.IndateType=1 or (a.IndateType=2 and a.StartDate<NOW() and a.EndDate>NOW())) {builder.ToString()}
and a.`Status`=0 and b.`Status`=0 and IsAll=1 {userWhere} ";
return Get<RB_DiscountCoupon_Extend> (sql).ToList();
return Get<RB_DiscountCoupon_Extend>(sql).ToList();
}
#endregion
......
......@@ -980,6 +980,16 @@ as t GROUP BY t.CreateDate desc";
where += $" and a.OrderNo like'%{dmodel.OrderNo}%'";
}
if (dmodel.TenantId > 0)
{
where += $" and a.TenantId={dmodel.TenantId} ";
}
if (dmodel.MallBaseId > 0)
{
where += $" and a.MallBaseId={dmodel.MallBaseId} ";
}
if (dmodel.SupplierId > 0)
{
where += $" and b.SupplierId={dmodel.SupplierId} ";
......@@ -1029,7 +1039,15 @@ GROUP BY b.GoodsId,b.SupplierId,b.OrderId ";
{
where += $" and a.OrderNo like'%{dmodel.OrderNo}%'";
}
if (dmodel.TenantId > 0)
{
where += $" and a.TenantId={dmodel.TenantId} ";
}
if (dmodel.MallBaseId > 0)
{
where += $" and a.MallBaseId={dmodel.MallBaseId} ";
}
if (dmodel.SupplierId > 0)
{
where += $" and b.SupplierId={dmodel.SupplierId} ";
......@@ -1130,7 +1148,15 @@ GROUP BY od.GoodsId,o.OrderId
{
where += $" and a.OrderNo like'%{dmodel.OrderNo}%'";
}
if (dmodel.TenantId > 0)
{
where += $" and a.TenantId={dmodel.TenantId} ";
}
if (dmodel.MallBaseId > 0)
{
where += $" and a.MallBaseId={dmodel.MallBaseId} ";
}
if (dmodel.SupplierId > 0)
{
where += $" and b.SupplierId={dmodel.SupplierId} ";
......@@ -1180,7 +1206,15 @@ GROUP BY b.Id";
{
where += $" and a.OrderNo like'%{dmodel.OrderNo}%'";
}
if (dmodel.TenantId > 0)
{
where += $" and a.TenantId={dmodel.TenantId} ";
}
if (dmodel.MallBaseId > 0)
{
where += $" and a.MallBaseId={dmodel.MallBaseId} ";
}
if (dmodel.SupplierId > 0)
{
where += $" and b.SupplierId={dmodel.SupplierId} ";
......
......@@ -6,21 +6,21 @@ using System.Text;
namespace Mall.Repository.User
{
public class RB_SmallShops_CustomRepository:BaseRepository<RB_SmallShops_Custom>
public class RB_SmallShops_CustomRepository : BaseRepository<RB_SmallShops_Custom>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_SmallShops_Custom); } }
/// <summary>
/// 物料规则列表
/// 微信自定义分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_SmallShops_Custom> GetPageListRepository(int pageIndex, int pageSize, out long rowCount, RB_SmallShops_Custom query)
public List<RB_SmallShops_Custom> GetSmallShopsCustomPageList(int pageIndex, int pageSize, out long rowCount, RB_SmallShops_Custom query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_SmallShops_Custom.Status)}=0");
......@@ -35,21 +35,18 @@ namespace Mall.Repository.User
{
builder.Append($" AND {nameof(RB_SmallShops_Custom.MallBaseId)}={query.MallBaseId}");
}
}
return GetPage<RB_SmallShops_Custom>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
/// 物流规则列表
/// 微信自定义列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_SmallShops_Custom> GetLogisticsRulesList(RB_SmallShops_Custom query)
public List<RB_SmallShops_Custom> GetSmallShopsCustomList(RB_SmallShops_Custom query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_SmallShops_Custom.Status)}=0 ");
......@@ -67,7 +64,7 @@ namespace Mall.Repository.User
{
builder.Append($" AND {nameof(RB_SmallShops_Custom.MallBaseId)}={query.MallBaseId}");
}
}
return Get<RB_SmallShops_Custom>(builder.ToString()).ToList();
}
......
......@@ -19,6 +19,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Json;
using Google.Protobuf.WellKnownTypes;
using Mall.Model.Entity.User;
namespace Mall.WebApi.Controllers.User
{
......@@ -186,13 +187,15 @@ namespace Mall.WebApi.Controllers.User
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetSmallShopsCommission() {
public ApiResult SetSmallShopsCommission()
{
var req = RequestParm;
JObject parms = JObject.Parse(req.msg.ToString());
int SmallShopsId = parms.GetInt("SmallShopsId", 0);
decimal Commission = parms.GetDecimal("Commission");
if (SmallShopsId <= 0) {
if (SmallShopsId <= 0)
{
return ApiResult.Failed();
}
......@@ -201,11 +204,197 @@ namespace Mall.WebApi.Controllers.User
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed();
}
}
#endregion
#region 微店自定义
/// <summary>
/// 新增分销商自定义
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetDistributorCustomInfo()
{
var requestParm = RequestParm;
RB_SmallShops_Custom demodel = JsonConvert.DeserializeObject<RB_SmallShops_Custom>(requestParm.msg.ToString());
if (string.IsNullOrWhiteSpace(demodel.HeadBackImage))
{
return ApiResult.ParamIsNull("请传递头部背景图片");
}
if (string.IsNullOrEmpty(demodel.WithdrawalText))
{
return ApiResult.ParamIsNull("请传递提现按钮文本");
}
if (string.IsNullOrEmpty(demodel.WithdrawalColor))
{
return ApiResult.ParamIsNull("请传递提现按钮颜色");
}
if (string.IsNullOrEmpty(demodel.WithdrawalTextColor))
{
return ApiResult.ParamIsNull("请传递按钮文字颜色");
}
if (string.IsNullOrEmpty(demodel.WithdrawalImage))
{
return ApiResult.ParamIsNull("请传递提现图标");
}
if (string.IsNullOrEmpty(demodel.SmallShopOrderName))
{
return ApiResult.ParamIsNull("请传递店铺订单名称");
}
if (string.IsNullOrEmpty(demodel.SmallShopOrderImage))
{
return ApiResult.ParamIsNull("请传递店铺订单图片");
}
if (demodel.WithdrawalDetailName == null || string.IsNullOrWhiteSpace(demodel.WithdrawalDetailName))
{
return ApiResult.ParamIsNull("请传递提现明细");
}
if (string.IsNullOrEmpty(demodel.WithdrawalDetailImage))
{
return ApiResult.ParamIsNull("请传递提现明细图片");
}
if (demodel.MyCustomerName == null || string.IsNullOrWhiteSpace(demodel.MyCustomerName))
{
return ApiResult.ParamIsNull("请传递我的客户");
}
if (string.IsNullOrEmpty(demodel.MyCustomerImage))
{
return ApiResult.ParamIsNull("请传递我的客户图片");
}
if (demodel.SmallShopQRCodeName == null || string.IsNullOrWhiteSpace(demodel.SmallShopQRCodeName))
{
return ApiResult.ParamIsNull("请传递店铺二维码");
}
if (string.IsNullOrEmpty(demodel.SmallShopQRCodeImage))
{
return ApiResult.ParamIsNull("请传递店铺二维码图片");
}
if (demodel.SmallShopSetUpName == null || string.IsNullOrWhiteSpace(demodel.SmallShopSetUpName))
{
return ApiResult.ParamIsNull("请传递店铺设置");
}
if (string.IsNullOrEmpty(demodel.SmallShopSetUpImage))
{
return ApiResult.ParamIsNull("请传递店铺设置图片");
}
if (demodel.LiveName == null || string.IsNullOrWhiteSpace(demodel.LiveName))
{
return ApiResult.ParamIsNull("请传递直播名称");
}
//
if (string.IsNullOrEmpty(demodel.LiveImage))
{
return ApiResult.ParamIsNull("请传递直播图标");
}
if (string.IsNullOrEmpty(demodel.CommissionWithdrawnName))
{
return ApiResult.ParamIsNull("请传递已提现佣金描述");
}
if (string.IsNullOrEmpty(demodel.OutstandingCommissionName))
{
return ApiResult.ParamIsNull("请传递未结算佣金描述");
}
if (string.IsNullOrEmpty(demodel.WithdrawableName))
{
return ApiResult.ParamIsNull("请传递可提现佣金描述");
}
if (string.IsNullOrEmpty(demodel.CommissionTobePaidName))
{
return ApiResult.ParamIsNull("请传递待打款佣金描述");
}
if (string.IsNullOrEmpty(demodel.UserNotesName))
{
return ApiResult.ParamIsNull("请传递用户须知描述");
}
if (string.IsNullOrEmpty(demodel.UserNotes))
{
return ApiResult.ParamIsNull("请传递用户须知");
}
if (string.IsNullOrWhiteSpace(demodel.IWantToWithdrawName))
{
return ApiResult.Failed("请传递我要提现描述");
}
if (string.IsNullOrWhiteSpace(demodel.WithdrawalAmountName))
{
return ApiResult.Failed("请传递提现金额描述");
}
if (string.IsNullOrWhiteSpace(demodel.WithdrawalWayName))
{
return ApiResult.Failed("请传递提现方式描述");
}
demodel.TenantId = Convert.ToInt32(requestParm.uid);
demodel.MallBaseId = requestParm.MallBaseId;
demodel.CreateDate = DateTime.Now;
demodel.UpdateDate = DateTime.Now;
bool flag = smallShopsModule.SetSmallShopsCustomInfo(demodel);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
/// <summary>
/// 获取分销商自定义
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetDistributorCustomInfo()
{
var requestParm = RequestParm;
var model = smallShopsModule.GetSmallShopsCustomList(new Model.Entity.User.RB_SmallShops_Custom { TenantId = requestParm.TenantId, MallBaseId = requestParm.MallBaseId }).FirstOrDefault();
if (model == null)
{
model = new Model.Entity.User.RB_SmallShops_Custom();
}
return ApiResult.Success("", new
{
model.Id,
model.HeadBackImage,
model.WithdrawalFilletPX,
model.WithdrawalText,
model.WithdrawalColor,
model.WithdrawalTextColor,
model.WithdrawalImage,
model.SmallShopOrderName,
model.SmallShopOrderImage,
model.WithdrawalDetailName,
model.WithdrawalDetailImage,
model.MyCustomerName,
model.MyCustomerImage,
model.SmallShopQRCodeName,
model.SmallShopQRCodeImage,
model.SmallShopSetUpName,
model.SmallShopSetUpImage,
model.LiveName,
model.LiveImage,
model.CommissionWithdrawnName,
model.OutstandingCommissionName,
model.WithdrawableName,
model.CommissionTobePaidName,
model.UserNotesName,
model.UserNotes,
model.IWantToWithdrawName,
model.WithdrawalAmountName,
model.WithdrawalWayName,
UpdateDate = model.UpdateDate.HasValue ? model.UpdateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
});
}
#endregion
}
}
\ No newline at end of file
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