Commit 88b50c3f authored by 吴春's avatar 吴春

提交代码

parent 6c8cfcc3
......@@ -70,7 +70,12 @@ namespace Mall.Model.Entity.BaseSetUp
/// <summary>
/// 固定价格
/// </summary>
public decimal? FixedPrice { get; set; }
public decimal? CustomMinFixedPrice { get; set; }
/// <summary>
/// 固定价格
/// </summary>
public decimal? CustomMaxFixedPrice { get; set; }
/// <summary>
/// 结算方式 1-用户自提,2-系统自动现结(微信),3-转入余额
......
......@@ -90,7 +90,7 @@ namespace Mall.Module.MarketingCenter
if (list != null && list.Any())
{
//分销情况
var oclist = goods_OrderCommissionRepository.GetListGroupByUser(new RB_Goods_OrderCommission_Extend() { TenantId = dmodel.TenantId, MallBaseId = dmodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) });
var oclist = goods_OrderCommissionRepository.GetListGroupByOrderDetailIds(new RB_Goods_OrderCommission_Extend() { TenantId = dmodel.TenantId, MallBaseId = dmodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) });
if (oclist.Any())
{
//获取用户
......
......@@ -175,7 +175,7 @@ namespace Mall.Module.User
/// </summary>
private readonly RB_SupplierRepository supplierRepository = new RB_SupplierRepository();
private readonly RB_SmallShops_InfoRepository smallShopsInfoRepository = new RB_SmallShops_InfoRepository();
#region 基础配置
......@@ -2101,7 +2101,7 @@ namespace Mall.Module.User
/// <param name="mallBaseId"></param>
/// <param name="erpEmpId"></param>
/// <returns></returns>
public string SetDistributorRemitAudit(int remitId, int type, string remark, string uid, int mallBaseId,int erpEmpId)
public string SetDistributorRemitAudit(int remitId, int type, string remark, string uid, int mallBaseId, int erpEmpId)
{
if (type == 1)
{
......@@ -2315,7 +2315,7 @@ namespace Mall.Module.User
/// 生成提现单据
/// </summary>
/// <returns></returns>
public bool OrderIncomeFinanceModule(int remitId, int TenantId, int MallBaseId, string remark,int erpEmpId)
public bool OrderIncomeFinanceModule(int remitId, int TenantId, int MallBaseId, string remark, int erpEmpId)
{
var flag = false;
try
......@@ -5877,7 +5877,7 @@ namespace Mall.Module.User
/// <param name="mallBaseId"></param>
/// <param name="empId"></param>
/// <returns></returns>
public string SetRecommendOrdersBillRemit(int billId, int tenantId, int mallBaseId, int empId,string Remark ="")
public string SetRecommendOrdersBillRemit(int billId, int tenantId, int mallBaseId, int empId, string Remark = "")
{
var model = distributor_BillRepository.GetEntity(billId);
if (model == null) { return "账单不存在"; }
......@@ -5886,10 +5886,12 @@ namespace Mall.Module.User
{ nameof(RB_Distributor_Bill.BillState),2},
{ nameof(RB_Distributor_Bill.UpdateDate),DateTime.Now}
};
if (empId > 0) {
if (empId > 0)
{
keyValues.Add(nameof(RB_Distributor_Bill.EmpId), empId);
}
if (!string.IsNullOrEmpty(Remark)) {
if (!string.IsNullOrEmpty(Remark))
{
keyValues.Add(nameof(RB_Distributor_Bill.Remark), (model.Remark ?? "") + " " + Remark);
}
List<WhereHelper> wheres = new List<WhereHelper>() {
......@@ -6064,5 +6066,17 @@ namespace Mall.Module.User
#endregion
#region 申请微店
public bool ApplySmallShopsInfo(RB_SmallShops_Info_Extend model)
{
if (model.Id == 0)
{
return smallShopsInfoRepository.Insert(model) > 0;
}
return false;
}
#endregion
}
}
......@@ -88,6 +88,48 @@ left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and o
where {where} group by oc.OrderId,oc.UserId,oc.Grade,oc.Type order by oc.Grade asc";
return Get<RB_Goods_OrderCommission_Extend>(sql).ToList();
}
/// <summary>
/// 获取用户返佣
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderCommission_Extend> GetListGroupByOrderDetailIds(RB_Goods_OrderCommission_Extend dmodel)
{
string where = $" 1=1 and oa.ReOrderId is null";
if (dmodel.TenantId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.OrderId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)}={dmodel.OrderId}";
}
if (dmodel.UserId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.UserId)}={dmodel.UserId}";
}
//if (dmodel.Type > 0)
//{
// where += $@" and oc.{nameof(RB_Goods_OrderCommission.Type)}={dmodel.Type}";
//}
if (dmodel.OrderDetailId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderDetailId)}={dmodel.OrderDetailId}";
}
if (!string.IsNullOrEmpty(dmodel.OrderIds))
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)} in({dmodel.OrderIds})";
}
string sql = $@"SELECT oc.OrderDetailId,oc.UserId,oc.Grade,oc.Type,oc.CommissionState,SUM(oc.Commission) as Commission FROM RB_Goods_OrderCommission oc
left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5)
where {where} group by oc.OrderDetailId,oc.UserId,oc.Grade,oc.Type order by oc.Grade asc";
return Get<RB_Goods_OrderCommission_Extend>(sql).ToList();
}
/// <summary>
/// 获取用户返佣
......
......@@ -1120,11 +1120,11 @@ namespace Mall.WebApi.Controllers.User
RB_DiscountCoupon_Extend resultModel = couponModule.AutoCoupon(query);
if (resultModel != null && resultModel.ID > 0)
{
return ApiResult.CouponSuccess(ResultCode.Success,"", resultModel.Name);
return ApiResult.CouponSuccess(ResultCode.Success, "", resultModel.Name);
}
else
{
return ApiResult.CouponFailed(ResultCode.Fail,"", "");
return ApiResult.CouponFailed(ResultCode.Fail, "", "");
}
}
......@@ -1698,6 +1698,45 @@ namespace Mall.WebApi.Controllers.User
#region 开店申请
/// <summary>
/// 新增修改地址
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult ApplySmallShopsInfo()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
RB_SmallShops_Info_Extend demodel = JsonConvert.DeserializeObject<RB_SmallShops_Info_Extend>(req.msg.ToString());
//判断是否满足当前申请条件
if (string.IsNullOrEmpty(demodel.Name))
{
demodel.Name = userInfo.Name;
}
if (string.IsNullOrEmpty(demodel.Logo))
{
demodel.Name = userInfo.Photo;
}
demodel.UserId = userInfo.UserId;
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.CreateDate = DateTime.Now;
demodel.UpdateDate = DateTime.Now;
demodel.Status = 0;
demodel.AuditStatus = DistributorAuditStatusEnum.Auditing;
bool flag = userModule.ApplySmallShopsInfo(demodel);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
#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