Commit b4299caf authored by liudong1993's avatar liudong1993

定时器提交

parent 9e0ee2f6
......@@ -760,7 +760,7 @@ namespace Mall.Module.Product
if (dlist.Any())
{
string orderDetailIds = string.Join(",", dlist.Select(x => x.Id));
var oasList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetailIds = orderDetailIds, TenantId = tenantId, MallBaseId = mallBaseId });
var oasList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetailIds = orderDetailIds, TenantId = tenantId, MallBaseId = mallBaseId }, false);
foreach (var item in dlist)
{
item.CoverImagePath = item.CoverImage;
......@@ -5485,7 +5485,7 @@ namespace Mall.Module.Product
int Rstr = R.Next(111, 999);
demodel.ReOrderNo = "RE" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + Rstr;
var oasList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetialId = demodel.OrderDetialId, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var oasList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetialId = demodel.OrderDetialId, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }, false);
if (oasList.Any())
{
return false;
......@@ -8468,7 +8468,11 @@ namespace Mall.Module.Product
decimal TotalCommission = 0, OldCommission = 0;
foreach (var item in ssList.Where(x => x.CommissionState == 1))
{
TotalCommission += (item.Commission ?? 0);
var afterSaleList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetialId = item.OrderDetailId, Type = 1, MallBaseId = mallBaseId, TenantId = tenantId });
if (!afterSaleList.Any())
{
TotalCommission += (item.Commission ?? 0);
}
}
#region 看微店佣金是否是负数 是的话 需要走总佣金里减去
OldCommission = TotalCommission;
......@@ -8639,36 +8643,41 @@ namespace Mall.Module.Product
var smallModel = smallShops_InfoRepository.GetList(new RB_SmallShops_Info_Extend() { UserId = ssmodel.UserId, TenantId = tenantId, MallBaseId = mallBaseId }).FirstOrDefault();
foreach (var item in ssList.Where(x => x.CommissionState == 1))
{
if (smallModel != null && smallModel.AuditStatus == DistributorAuditStatusEnum.Audited)
//查询是否有申请退款
var afterSaleList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetialId = item.OrderDetailId, Type = 1, MallBaseId = mallBaseId, TenantId = tenantId });
if (!afterSaleList.Any())
{
//更新微店佣金
Dictionary<string, object> keyValues2 = new Dictionary<string, object>() {
if (smallModel != null && smallModel.AuditStatus == DistributorAuditStatusEnum.Audited)
{
//更新微店佣金
Dictionary<string, object> keyValues2 = new Dictionary<string, object>() {
{ nameof(RB_SmallShops_Info_Extend.TotalCommission),(smallModel.TotalCommission??0)+(item.Commission??0)},
{ nameof(RB_SmallShops_Info_Extend.Commission),(smallModel.Commission??0)+(item.Commission??0)},
};
List<WhereHelper> wheres2 = new List<WhereHelper>() {
List<WhereHelper> wheres2 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_SmallShops_Info_Extend.Id),
FiledValue=smallModel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
bool flag1 = smallShops_InfoRepository.Update(keyValues2, wheres2);
if (flag1)
{
//更新返佣状态
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
bool flag1 = smallShops_InfoRepository.Update(keyValues2, wheres2);
if (flag1)
{
//更新返佣状态
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_SmallShops_Commission_Extend.CommissionState),2},
{ nameof(RB_SmallShops_Commission_Extend.UpdateDate),DateTime.Now},
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_SmallShops_Commission_Extend.Id),
FiledValue=item.Id,
OperatorEnum=OperatorEnum.Equal
}
};
smallShops_CommissionRepository.Update(keyValues1, wheres1);
smallShops_CommissionRepository.Update(keyValues1, wheres1);
}
}
}
}
......
......@@ -151,10 +151,12 @@ INNER JOIN rb_member_user mu on mu.Id=oas.UserId
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderAfterSale_Extend> GetList(RB_Goods_OrderAfterSale_Extend dmodel)
public List<RB_Goods_OrderAfterSale_Extend> GetList(RB_Goods_OrderAfterSale_Extend dmodel,bool IsNormal = true)
{
string where = $" where 1=1 and oas.{nameof(RB_Goods_OrderAfterSale.Status)}=0";
if (IsNormal) {
where += $" and oas.{nameof(RB_Goods_OrderAfterSale.ReOrderStatus)} <> {(int)Common.Enum.Goods.OrderAfterSaleStatusEnum.Rejected}";
}
if (dmodel.TenantId > 0)
{
where += $" and oas.{nameof(RB_Goods_OrderAfterSale.TenantId)}={dmodel.TenantId}";
......
This diff is collapsed.
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