Commit 4db0c93a authored by liudong1993's avatar liudong1993

1

parent 768eb2da
......@@ -207,5 +207,9 @@ namespace Mall.Model.Entity.User
/// 是否开启和平下线审核 1是 2否
/// </summary>
public int? HpReferralsGradeAudit { get; set; }
/// <summary>
/// 是否必须提完所有
/// </summary>
public int? IsWithdrawAll { get; set; }
}
}
......@@ -95,7 +95,8 @@ namespace Mall.Module.User
WithdrawFee = 0,
WithdrawWay = "[" + (int)Common.Enum.User.DistrbutorWithdrawWayEnum.ZDDK + "]",
IsCommissionResidue = 2,
HpReferralsGradeAudit = 2
HpReferralsGradeAudit = 2,
IsWithdrawAll = 2
}) > 0;
}
else
......
......@@ -886,6 +886,8 @@ namespace Mall.Module.User
{ nameof(RB_Distributor_Basics.IndexImage),demodel.IndexImage},
{ nameof(RB_Distributor_Basics.UpdateDate),demodel.UpdateDate},
{ nameof(RB_Distributor_Basics.HpReferralsGradeAudit),demodel.HpReferralsGradeAudit},
{ nameof(RB_Distributor_Basics.IsCommissionResidue),demodel.IsCommissionResidue},
{ nameof(RB_Distributor_Basics.IsWithdrawAll),demodel.IsWithdrawAll},
};
List<WhereHelper> whereHelpers = new List<WhereHelper>() {
new WhereHelper(){
......@@ -1382,7 +1384,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetHpUserReferralsAudit(int userId, int type, AppletUserInfo userInfo)
{
if (GetHpDistributorIsEnabled(userInfo.TenantId, userInfo.MallBaseId) == 2)
if (GetHpDistributorIsEnabled(userInfo.TenantId, userInfo.MallBaseId) == 2 && userInfo.TenantId != 1)
{
return false;
}
......@@ -1400,6 +1402,7 @@ namespace Mall.Module.User
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Distributor_Info.AuditStatus),DistributorAuditStatusEnum.Audited},
{nameof(RB_Distributor_Info.HPGradeId),MinGradeId },
{nameof(RB_Distributor_Info.GradeId),userInfo.TenantId==1? 74:disModel.GradeId },
{nameof(RB_Distributor_Info.Remark),"上线自行审核通过"},
{nameof(RB_Distributor_Info.AuditDate),DateTime.Now }
};
......@@ -1410,7 +1413,28 @@ namespace Mall.Module.User
OperatorEnum=OperatorEnum.Equal
}
};
return distributor_InfoRepository.Update(keyValues, wheres);
bool flag = distributor_InfoRepository.Update(keyValues, wheres);
if (flag) {
//修改用户表状态
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Member_User.IsDistributor),1}
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Member_User.Id),
FiledValue=disModel.UserId,
OperatorEnum=OperatorEnum.Equal
}
};
member_UserRepository.Update(keyValues1, wheres1);
var umodel = GetMemberUserInfo(disModel.UserId ?? 0);
if (umodel != null)
{
new MiniProgramMsgModule().SendAuditResultMsg(disModel.TenantId, disModel.MallBaseId, umodel.OpenId, "分销商审核已通过", "通过", umodel.Name, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
}
}
return flag;
}
else
{
......@@ -1426,7 +1450,15 @@ namespace Mall.Module.User
OperatorEnum=OperatorEnum.Equal
}
};
return distributor_InfoRepository.Update(keyValues, wheres);
bool flag = distributor_InfoRepository.Update(keyValues, wheres);
if (flag) {
var umodel = GetMemberUserInfo(disModel.UserId ?? 0);
if (umodel != null)
{
new MiniProgramMsgModule().SendAuditResultMsg(disModel.TenantId, disModel.MallBaseId, umodel.OpenId, "分销商审核被拒绝", "拒绝", umodel.Name, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
}
}
return flag;
}
}
......@@ -1592,7 +1624,14 @@ namespace Mall.Module.User
}
};
bool flag = distributor_InfoRepository.Update(keyValues, wheres, trans);
if (flag)
{
var umodel = GetMemberUserInfo(item.UserId ?? 0);
if (umodel != null)
{
new MiniProgramMsgModule().SendAuditResultMsg(item.TenantId, item.MallBaseId, umodel.OpenId, "分销商审核被拒绝", "拒绝", umodel.Name, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
}
}
}
}
else if (type == 3)
......@@ -2787,7 +2826,7 @@ namespace Mall.Module.User
SuperiorId,
SuperiorName,
DistributorGradeEntrance = HpEnabled == 1 ? 2 : (basicsModel?.GradeEntrance ?? 2),
HpReferralsGradeAudit = HpEnabled == 1 ? (basicsModel?.HpReferralsGradeAudit ?? 2) : 2,
HpReferralsGradeAudit = userInfo.TenantId == 1 ? 1 : HpEnabled == 1 ? (basicsModel?.HpReferralsGradeAudit ?? 2) : 2,
CommissionWithdrawal = model.CommissionWithdrawal ?? 0,
TXCommission = commModel?.TXCommission ?? 0,
WJSCommission,
......@@ -2979,6 +3018,7 @@ namespace Mall.Module.User
CanRemitMoney,
basicsModel.MinimumWithdrawalLimit,
basicsModel.WithdrawFee,
basicsModel.IsWithdrawAll,
WithdrawWayList = WayList.Select(x => new
{
Id = Convert.ToInt32(x.Value),
......@@ -2994,7 +3034,6 @@ namespace Mall.Module.User
/// <returns></returns>
public string SetDistrbutorWithdrawDeposit(RB_Distributor_Remit_Extend demodel)
{
//验证金额
var disModel = distributor_InfoRepository.GetList(new RB_Distributor_Info_Extend() { UserId = demodel.UserId, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
if ((disModel.CommissionWithdrawal ?? 0) < (demodel.AppliedMoney ?? 0))
......
......@@ -753,6 +753,7 @@ namespace Mall.WebApi.Controllers.User
demodel.BackgroundImage ??= 0;
demodel.IndexImage ??= 0;
demodel.HpReferralsGradeAudit ??= 2;
demodel.IsWithdrawAll ??= 2;
demodel.TenantId = Convert.ToInt32(requestParm.uid);
demodel.MallBaseId = requestParm.MallBaseId;
demodel.CreateDate = DateTime.Now;
......@@ -804,6 +805,7 @@ namespace Mall.WebApi.Controllers.User
model.IndexImagePath,
model.IsCommissionResidue,
model.HpReferralsGradeAudit,
model.IsWithdrawAll,
UpdateDate = model.UpdateDate.HasValue ? model.UpdateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
});
}
......
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