Commit 64009dd9 authored by liudong1993's avatar liudong1993
parents 0d6821c2 d69882e7
......@@ -32,7 +32,7 @@ namespace Mall.AOP.CustomerAttribute
/// </summary>
public TransactionCallHandlerAttribute()
{
Timeout = 60;
Timeout = 30;
ScopeOption = TransactionScopeOption.Required;
IsolationLevel = IsolationLevel.ReadCommitted;
}
......@@ -49,11 +49,13 @@ namespace Mall.AOP.CustomerAttribute
{
Console.WriteLine("TransactionCallHandlerAttribute1");
TransactionOptions transactionOptions = new TransactionOptions();
//设置事务隔离级别
transactionOptions.IsolationLevel = this.IsolationLevel;
//设置事务超时时间为60秒
transactionOptions.Timeout = new TimeSpan(0, 0, this.Timeout);
TransactionOptions transactionOptions = new TransactionOptions
{
//设置事务隔离级别
IsolationLevel = this.IsolationLevel,
//设置事务超时时间为60秒
Timeout = new TimeSpan(0, 0, this.Timeout)
};
using (TransactionScope scope = new TransactionScope(this.ScopeOption, transactionOptions))
{
try
......
......@@ -8,7 +8,7 @@ namespace Mall.CacheManager.AppletWeChat
{
public class OrderPayReidsCache
{
static RedisHelper redis = new RedisHelper(DataStatistic.DataConstant.REDIS_DB2, DataStatistic.DataConstant.DATA_OrderPayId);
static readonly RedisHelper redis = new RedisHelper(DataStatistic.DataConstant.REDIS_DB2, DataStatistic.DataConstant.DATA_OrderPayId);
/// <summary>
/// 设置缓存
/// </summary>
......
......@@ -8,7 +8,7 @@ namespace Mall.CacheManager.AppletWeChat
{
public class WeiXinReidsCache
{
static RedisHelper redis = new RedisHelper(DataStatistic.DataConstant.REDIS_DB2, DataStatistic.DataConstant.DATA_WeiXinToken);
static readonly RedisHelper redis = new RedisHelper(DataStatistic.DataConstant.REDIS_DB2, DataStatistic.DataConstant.DATA_WeiXinToken);
/// <summary>
/// 设置缓存
/// </summary>
......
......@@ -12,7 +12,7 @@ namespace Mall.CacheManager.ByteDance
public class ByteDanceRedis
{
static RedisHelper redis = new RedisHelper(DataConstant.REDIS_DB2);
static readonly RedisHelper redis = new RedisHelper(DataConstant.REDIS_DB2);
/// <summary>
/// 获取微信用的formID
/// </summary>
......
......@@ -15,7 +15,7 @@ namespace Mall.CacheManager.User
/// </summary>
public class UserReidsCache
{
static RedisHelper redis = new RedisHelper(DataConstant.REDIS_DB2);
static readonly RedisHelper redis = new RedisHelper(DataConstant.REDIS_DB2);
/// <summary>
/// 设置缓存
......@@ -78,7 +78,7 @@ namespace Mall.CacheManager.User
/// <summary>
/// 商户信息仓储层对象
/// </summary>
private static Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository();
private static readonly Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository();
/// <summary>
/// 获取用户登录信息
......
......@@ -313,8 +313,15 @@ namespace Mall.Model.Query
public string CompanyName { get; set; }
/// <summary>
/// 订单状态
/// </summary>
public int OrderStatus { get; set; }
/// <summary>
/// 订单手续费
/// </summary>
public decimal ServiceCharge { get; set; }
}
}
......@@ -16,7 +16,7 @@ namespace Mall.Module.BaseSetUp
/// </summary>
public class DestinationModule
{
private Rb_destinationRepository rb_DestinationRepository = new Rb_destinationRepository();
private readonly Rb_destinationRepository rb_DestinationRepository = new Rb_destinationRepository();
/// <summary>
/// 根据父节点编号获取子列表
......@@ -48,7 +48,7 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public bool Set(RB_Destination model)
{
var flag = false;
bool flag;
if (model.ID > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......
......@@ -15,21 +15,21 @@ namespace Mall.Module.BaseSetUp
{
public class MallBaseModule
{
private RB_MiniProgramRepository miniProgramRepository = new RB_MiniProgramRepository();
private RB_MallBaseRepository mallBaseRepository = new RB_MallBaseRepository();
private RB_LogisticsRepository logisticsRepository = new RB_LogisticsRepository();
private RB_Logistics_RulesPriceRepository logisticsRulesPriceRepository = new RB_Logistics_RulesPriceRepository();
private RB_Logistics_RulesRegionRepository logisticsRulesRegionRepository = new RB_Logistics_RulesRegionRepository();
private RB_Logistics_RulesRepository logisticsRulesRepository = new RB_Logistics_RulesRepository();
private RB_Logistics_DeliveryRepository deliveryRepository = new RB_Logistics_DeliveryRepository();
private RB_Logistics_ExpressRepository expressRepository = new RB_Logistics_ExpressRepository();
private RB_ElectronicSheetRepository electronicSheetRepository = new RB_ElectronicSheetRepository();
private readonly RB_MiniProgramRepository miniProgramRepository = new RB_MiniProgramRepository();
private readonly RB_MallBaseRepository mallBaseRepository = new RB_MallBaseRepository();
private readonly RB_LogisticsRepository logisticsRepository = new RB_LogisticsRepository();
private readonly RB_Logistics_RulesPriceRepository logisticsRulesPriceRepository = new RB_Logistics_RulesPriceRepository();
private readonly RB_Logistics_RulesRegionRepository logisticsRulesRegionRepository = new RB_Logistics_RulesRegionRepository();
private readonly RB_Logistics_RulesRepository logisticsRulesRepository = new RB_Logistics_RulesRepository();
private readonly RB_Logistics_DeliveryRepository deliveryRepository = new RB_Logistics_DeliveryRepository();
private readonly RB_Logistics_ExpressRepository expressRepository = new RB_Logistics_ExpressRepository();
private readonly RB_ElectronicSheetRepository electronicSheetRepository = new RB_ElectronicSheetRepository();
private RB_File_StoreRepository storeRepository = new RB_File_StoreRepository();
private RB_FreeShippingCategoryRepository freeShippingCategoryRepository = new RB_FreeShippingCategoryRepository();
private RB_FreeShippingRepository freeShippingRepository = new RB_FreeShippingRepository();
private readonly RB_File_StoreRepository storeRepository = new RB_File_StoreRepository();
private readonly RB_FreeShippingCategoryRepository freeShippingCategoryRepository = new RB_FreeShippingCategoryRepository();
private readonly RB_FreeShippingRepository freeShippingRepository = new RB_FreeShippingRepository();
private RB_MicroShop_BasicsRepository microShopBasicsRepository = new RB_MicroShop_BasicsRepository();
private readonly RB_MicroShop_BasicsRepository microShopBasicsRepository = new RB_MicroShop_BasicsRepository();
......@@ -79,8 +79,8 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public bool AddOrUpdateMallBase(RB_MallBase_Extend model)
{
bool flag = false;
var trans = mallBaseRepository.DbTransaction;
bool flag;
try
{
if (model.ID == 0)
......@@ -196,8 +196,10 @@ namespace Mall.Module.BaseSetUp
}
else
{
model = new RB_Logistics_Rules_Extend();
model.Detail = new List<RB_Logistics_RulesPrice_Extend>();
model = new RB_Logistics_Rules_Extend
{
Detail = new List<RB_Logistics_RulesPrice_Extend>()
};
}
return model;
}
......@@ -206,8 +208,8 @@ namespace Mall.Module.BaseSetUp
public bool SetDefaultLogisticsRules(RB_Logistics_Rules_Extend query)
{
bool flag = false;
var trans = logisticsRulesRepository.DbTransaction;
bool flag;
try
{
IDictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -393,8 +395,8 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public bool DelRulesInfo(int id, int uid, int mallBaseId)
{
bool flag = false;
var trans = logisticsRulesRepository.DbTransaction;
bool flag;
try
{
Dictionary<string, object> cols = new Dictionary<string, object>()
......@@ -586,8 +588,8 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public bool DelPinkageInfo(int id, int uid, int mallBaseId)
{
bool flag = false;
var trans = logisticsRulesRepository.DbTransaction;
bool flag;
try
{
Dictionary<string, object> cols = new Dictionary<string, object>()
......@@ -1137,8 +1139,8 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public bool DelFreeShipping(int id, int uid, int mallBaseId)
{
bool flag = false;
var trans = freeShippingRepository.DbTransaction;
bool flag;
try
{
Dictionary<string, object> cols = new Dictionary<string, object>()
......
......@@ -20,15 +20,15 @@ namespace Mall.Module.MarketingCenter
{
public class CouponModule
{
private RB_CouponRepository couponRepository = new RB_CouponRepository();
private RB_DiscountCouponRepository discountCouponRepository = new RB_DiscountCouponRepository();
private RB_DiscountCoupon_ProductRepository productRepository = new RB_DiscountCoupon_ProductRepository();
private readonly RB_CouponRepository couponRepository = new RB_CouponRepository();
private readonly RB_DiscountCouponRepository discountCouponRepository = new RB_DiscountCouponRepository();
private readonly RB_DiscountCoupon_ProductRepository productRepository = new RB_DiscountCoupon_ProductRepository();
private Repository.User.RB_Member_CouponRepository memberCouponRepository = new Repository.User.RB_Member_CouponRepository();
private RB_Coupon_SelfMotionMemberRepository selfMotionMemberRepository = new RB_Coupon_SelfMotionMemberRepository();
private readonly RB_Member_CouponRepository memberCouponRepository = new Repository.User.RB_Member_CouponRepository();
private readonly RB_Coupon_SelfMotionMemberRepository selfMotionMemberRepository = new RB_Coupon_SelfMotionMemberRepository();
private RB_Coupon_SelfMotionRepository selfMotionRepository = new RB_Coupon_SelfMotionRepository();
private readonly RB_Coupon_SelfMotionRepository selfMotionRepository = new RB_Coupon_SelfMotionRepository();
/// <summary>
/// 会员信息
......@@ -262,8 +262,8 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool DelDiscountCoupon(int id, int uid, int mallBaseId)
{
bool flag = false;
var trans = discountCouponRepository.DbTransaction;
bool flag;
try
{
Dictionary<string, object> cols1 = new Dictionary<string, object>()
......@@ -338,8 +338,7 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool DelMemberCoupon(int id, int uid, int mallBaseId)
{
bool flag = false;
bool flag;
try
{
Dictionary<string, object> cols1 = new Dictionary<string, object>()
......@@ -431,20 +430,14 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool GrantCoupon(List<RB_Member_DiscountCoupon_Extend> list, RB_DiscountCoupon_Extend model)
{
bool flag = false;
var trans = memberCouponRepository.DbTransaction;
bool flag;
try
{
//foreach (var item in list)
//{
flag = memberCouponRepository.InsertBatch(list, trans);
// }
if (model != null && flag)
{
Dictionary<string, object> cols1;
if (model.TotalNum != -1)
{
cols1 = new Dictionary<string, object>()
......@@ -665,8 +658,8 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool DelDiscountSelfMotion(int id, int uid, int mallBaseId)
{
bool flag = false;
var trans = selfMotionRepository.DbTransaction;
bool flag;
try
{
Dictionary<string, object> cols1 = new Dictionary<string, object>()
......
......@@ -12,9 +12,10 @@ namespace Mall.Module.MarketingCenter
{
public class IntegralModule
{
private RB_Integral_SettingsRepository settingsRepository = new RB_Integral_SettingsRepository();
private readonly RB_Integral_SettingsRepository settingsRepository = new RB_Integral_SettingsRepository();
private readonly RB_Member_IntegralRepository recordRepository = new RB_Member_IntegralRepository();
private RB_Member_IntegralRepository recordRepository = new RB_Member_IntegralRepository();
#region 积分设置
/// <summary>
......@@ -46,8 +47,6 @@ namespace Mall.Module.MarketingCenter
}
#endregion
#region 积分记录
/// <summary>
......
......@@ -103,7 +103,7 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetMiniprogramPageTemplModule(RB_Miniprogram_Page_Templ_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -147,12 +147,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetMiniprogramPageTemplIsUseModule(object Id, int IsUse)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Miniprogram_Page_Templ_Extend.IsUse),IsUse }
};
flag = pageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_Page_Templ_Extend.Id), Id));
bool flag = pageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_Page_Templ_Extend.Id), Id));
return flag;
}
......@@ -165,8 +164,7 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetMiniprogramPageTemplIsHomeModule(object Id, int IsHome,int MallBaseId)
{
bool flag = false;
flag = pageRepository.UpdateIsHomeRepository(MallBaseId);
bool flag = pageRepository.UpdateIsHomeRepository(MallBaseId);
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Miniprogram_Page_Templ_Extend.IsHome),IsHome }
......@@ -183,12 +181,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool RemoveMiniprogramPageTemplModule(object Id, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Miniprogram_Page_Templ_Extend.Status),Status }
};
flag = pageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_Page_Templ_Extend.Id), Id));
bool flag = pageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_Page_Templ_Extend.Id), Id));
return flag;
}
......@@ -199,8 +196,7 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool RemoveMiniprogramPageTemplDetailsModule(object Id)
{
bool flag = false;
flag = detailsRepository.Delete(Id)>0;
bool flag = detailsRepository.Delete(Id) > 0;
return flag;
}
}
......
......@@ -77,7 +77,7 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetMiniprogramTemplateModule(RB_Miniprogram_Template_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -389,12 +389,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool RemoveMiniprogramTemplateModule(object Id, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Miniprogram_Template_Extend.Status),Status }
};
flag = miniprogram_TemplateRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_Template_Extend.Id), Id));
bool flag = miniprogram_TemplateRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_Template_Extend.Id), Id));
return flag;
}
}
......
......@@ -3,29 +3,26 @@ using Mall.Model.Entity.MarketingCenter;
using Mall.Model.Entity.User;
using Mall.Model.Extend.MarketingCenter;
using Mall.Model.Extend.User;
using Mall.Repository;
using Mall.Repository.MarketingCenter;
using Mall.Repository.Product;
using Mall.Repository.User;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Module.MarketingCenter
{
public class RechargeModule
{
private RB_Recharge_RulesRepository rulesRepository = new RB_Recharge_RulesRepository();
private readonly RB_Recharge_RulesRepository rulesRepository = new RB_Recharge_RulesRepository();
private RB_Member_BalanceRepository balanceRepository = new RB_Member_BalanceRepository();
private RB_Member_IntegralRepository integralRepository = new RB_Member_IntegralRepository();
private RB_Recharge_SettingsRepository settingsRepository = new RB_Recharge_SettingsRepository();
private readonly RB_Member_BalanceRepository balanceRepository = new RB_Member_BalanceRepository();
private readonly RB_Member_IntegralRepository integralRepository = new RB_Member_IntegralRepository();
private readonly RB_Recharge_SettingsRepository settingsRepository = new RB_Recharge_SettingsRepository();
private RB_Recharge_CustomRepository customRepository = new RB_Recharge_CustomRepository();
private RB_Member_BalanceRechargeRepository balanceRechargeRepository = new RB_Member_BalanceRechargeRepository();
private readonly RB_Recharge_CustomRepository customRepository = new RB_Recharge_CustomRepository();
private readonly RB_Member_BalanceRechargeRepository balanceRechargeRepository = new RB_Member_BalanceRechargeRepository();
/// <summary>
/// 会员信息
/// </summary>
......@@ -270,7 +267,6 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool UpdateBalanceRecharge(int UserId, int OrderId, string Out_Trade_No, string Transaction_Id, Common.Enum.Goods.OrderPayTypeEnum PayWay, string PayType, decimal Money, DateTime Time_End)
{
bool flag = false;
var umodel = member_UserRepository.GetEntity(UserId);
if (umodel == null)
{
......@@ -292,6 +288,7 @@ namespace Mall.Module.MarketingCenter
}
var trans = balanceRechargeRepository.DbTransaction;
bool flag;
try
{
......@@ -311,37 +308,41 @@ namespace Mall.Module.MarketingCenter
};
flag = balanceRechargeRepository.Update(keyValues, wheres, trans);//更新充值记录
//新增余额
RB_Member_Balance memberBalanceModel = new RB_Member_Balance();
memberBalanceModel.UserId = model.UserId;
memberBalanceModel.Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income;
memberBalanceModel.Balance = model.Balance + Convert.ToDecimal(model.GiveMoney);
memberBalanceModel.Description = "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + Convert.ToDecimal(model.GiveMoney)) : "");
memberBalanceModel.CreateDate = model.RechargeTime;
memberBalanceModel.TenantId = model.TenantId;
memberBalanceModel.MallBaseId = model.MallBaseId;
memberBalanceModel.Remarks = "订单号:" + model.OrderNo + "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + Convert.ToDecimal(model.GiveMoney)) : "");
memberBalanceModel.PlatformType = model.OrderSource;
RB_Member_Balance memberBalanceModel = new RB_Member_Balance
{
UserId = model.UserId,
Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income,
Balance = model.Balance + Convert.ToDecimal(model.GiveMoney),
Description = "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + Convert.ToDecimal(model.GiveMoney)) : ""),
CreateDate = model.RechargeTime,
TenantId = model.TenantId,
MallBaseId = model.MallBaseId,
Remarks = "订单号:" + model.OrderNo + "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + Convert.ToDecimal(model.GiveMoney)) : ""),
PlatformType = model.OrderSource
};
balanceRepository.Insert(memberBalanceModel, trans);
//判断是否赠送积分
if (model.GiveIntegral > 0)//有赠送的积分
{
RB_Member_Integral memberIntegralModel = new RB_Member_Integral();
memberIntegralModel.UserId = model.UserId;
memberIntegralModel.Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income;
memberIntegralModel.PlatformType = model.OrderSource;
memberIntegralModel.Integral = model.GiveIntegral;
memberIntegralModel.Description = "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + model.GiveIntegral + "积分") : "");
memberIntegralModel.TenantId = model.TenantId;
memberIntegralModel.MallBaseId = model.MallBaseId;
memberIntegralModel.Remarks = "订单号:" + model.OrderNo + "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + model.GiveIntegral + "积分") : "");
memberIntegralModel.CreateDate = model.RechargeTime;
memberIntegralModel.OrderId = 0;
RB_Member_Integral memberIntegralModel = new RB_Member_Integral
{
UserId = model.UserId,
Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income,
PlatformType = model.OrderSource,
Integral = model.GiveIntegral,
Description = "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + model.GiveIntegral + "积分") : ""),
TenantId = model.TenantId,
MallBaseId = model.MallBaseId,
Remarks = "订单号:" + model.OrderNo + "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + model.GiveIntegral + "积分") : ""),
CreateDate = model.RechargeTime,
OrderId = 0
};
integralRepository.Insert(memberIntegralModel, trans);
}
goods_Online_TradeRepository.Insert(new Model.Entity.Product.RB_Goods_Online_Trade()
goods_Online_TradeRepository.Insert(new Model.Entity.Product.RB_Goods_Online_Trade()
{
Id = 0,
User_Id = UserId,
......@@ -363,7 +364,7 @@ namespace Mall.Module.MarketingCenter
TenantId = umodel.TenantId,
Transaction_Id = Transaction_Id,
Type = 3
}) ;
});
balanceRechargeRepository.DBSession.Commit();
}
catch (Exception ex)
......
......@@ -170,7 +170,7 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetShareCategoryModule(RB_Share_Category_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -199,12 +199,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool RemoveShareCategoryModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Share_Category_Extend.Status),(int) DateStateEnum.Delete},
};
flag = share_CategoryRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Category_Extend.Id), Id));
bool flag = share_CategoryRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Category_Extend.Id), Id));
return flag;
}
......@@ -237,8 +236,7 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetShareFriendModule(RB_Share_Friend_Extend extModel)
{
bool flag = false;
flag = share_FriendRepository.SetShareFrendRepository(extModel);
bool flag = share_FriendRepository.SetShareFrendRepository(extModel);
return flag;
}
......@@ -272,12 +270,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool RemoveShareFriendModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Share_Friend_Extend.Status),(int) DateStateEnum.Delete},
};
flag = share_FriendRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Friend_Extend.Id), Id));
bool flag = share_FriendRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Friend_Extend.Id), Id));
return flag;
}
......@@ -289,12 +286,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetShareFriendIsTopModule(object Id, int IsTop)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Share_Friend_Extend.IsTop),IsTop},
};
flag = share_FriendRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Friend_Extend.Id), Id));
bool flag = share_FriendRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Friend_Extend.Id), Id));
return flag;
}
......@@ -306,12 +302,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetShareFriendIsUseModule(object Id, int IsUse)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Share_Friend_Extend.IsUse),IsUse},
};
flag = share_FriendRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Friend_Extend.Id), Id));
bool flag = share_FriendRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Friend_Extend.Id), Id));
return flag;
}
......@@ -323,12 +318,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetShareFriendSortNumModule(object Id, int SortNum)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Share_Friend_Extend.SortNum),SortNum},
};
flag = share_FriendRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Friend_Extend.Id), Id));
bool flag = share_FriendRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Friend_Extend.Id), Id));
return flag;
}
......@@ -340,12 +334,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetShareFriendMaterialInfoModule(object Id, string MaterialInfo)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Share_Friend_Extend.MaterialInfo),MaterialInfo},
};
flag = share_FriendRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Friend_Extend.Id), Id));
bool flag = share_FriendRepository.Update(fileds, new WhereHelper(nameof(RB_Share_Friend_Extend.Id), Id));
return flag;
}
......
......@@ -13,7 +13,7 @@ namespace Mall.Module.MarketingCenter
{
public class StatisticsModule
{
private RB_Goods_OrderRepository orderRepository = new RB_Goods_OrderRepository();
private readonly RB_Goods_OrderRepository orderRepository = new RB_Goods_OrderRepository();
/// <summary>
/// 返佣
/// </summary>
......@@ -294,12 +294,14 @@ namespace Mall.Module.MarketingCenter
{
for (int i = 1; i < 24; i++)
{
OrderLine modelOrderLine = new OrderLine();
modelOrderLine.OrderPay = List.Where(x => x.CreateDate.Value.ToString("dd") == ((i > 9) ? ("0" + i) : i.ToString())).Count();
modelOrderLine.PayMoney = List.Where(x => x.CreateDate.Value.ToString("dd") == ((i > 9) ? ("0" + i) : i.ToString())).Sum(x => x.Income ?? 0);
modelOrderLine.PayMemerNum = List.Where(x => x.CreateDate.Value.ToString("dd") == ((i > 9) ? ("0" + i) : i.ToString())).GroupBy(x => x.UserId).Count();
modelOrderLine.BuyNum = List.Where(x => x.CreateDate.Value.ToString("dd") == ((i > 9) ? ("0" + i) : i.ToString())).Sum(x => x.GoodsTotalNum);
modelOrderLine.DateStr = (i > 9) ? ("0" + i) : i.ToString();
OrderLine modelOrderLine = new OrderLine
{
OrderPay = List.Where(x => x.CreateDate.Value.ToString("dd") == ((i > 9) ? ("0" + i) : i.ToString())).Count(),
PayMoney = List.Where(x => x.CreateDate.Value.ToString("dd") == ((i > 9) ? ("0" + i) : i.ToString())).Sum(x => x.Income ?? 0),
PayMemerNum = List.Where(x => x.CreateDate.Value.ToString("dd") == ((i > 9) ? ("0" + i) : i.ToString())).GroupBy(x => x.UserId).Count(),
BuyNum = List.Where(x => x.CreateDate.Value.ToString("dd") == ((i > 9) ? ("0" + i) : i.ToString())).Sum(x => x.GoodsTotalNum),
DateStr = (i > 9) ? ("0" + i) : i.ToString()
};
model.OrderLineList.Add(modelOrderLine);
}
}
......@@ -307,12 +309,14 @@ namespace Mall.Module.MarketingCenter
{
for (int i = 0; i < 7; i++)
{
OrderLine modelOrderLine = new OrderLine();
modelOrderLine.OrderPay = List.Where(x => x.CreateDate.Value.ToString("yyyy-MM-dd") == System.DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")).Count();
modelOrderLine.PayMoney = List.Where(x => x.CreateDate.Value.ToString("yyyy-MM-dd") == System.DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")).Sum(x => x.Income ?? 0);
modelOrderLine.PayMemerNum = List.Where(x => x.CreateDate.Value.ToString("yyyy-MM-dd") == System.DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")).GroupBy(x => x.UserId).Count();
modelOrderLine.BuyNum = List.Where(x => x.CreateDate.Value.ToString("yyyy-MM-dd") == System.DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")).Sum(x => x.GoodsTotalNum);
modelOrderLine.DateStr = System.DateTime.Now.AddDays(i).ToString("yyyy-MM-dd");
OrderLine modelOrderLine = new OrderLine
{
OrderPay = List.Where(x => x.CreateDate.Value.ToString("yyyy-MM-dd") == System.DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")).Count(),
PayMoney = List.Where(x => x.CreateDate.Value.ToString("yyyy-MM-dd") == System.DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")).Sum(x => x.Income ?? 0),
PayMemerNum = List.Where(x => x.CreateDate.Value.ToString("yyyy-MM-dd") == System.DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")).GroupBy(x => x.UserId).Count(),
BuyNum = List.Where(x => x.CreateDate.Value.ToString("yyyy-MM-dd") == System.DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")).Sum(x => x.GoodsTotalNum),
DateStr = System.DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")
};
model.OrderLineList.Add(modelOrderLine);
}
}
......
......@@ -55,7 +55,7 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool SetTemplateMarketModule(RB_Template_Market_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -96,12 +96,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool RemoveTemplateMarketModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Template_Market_Extend.Status),1 },
};
flag = template_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Template_Market_Extend.Id), Id));
bool flag = template_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Template_Market_Extend.Id), Id));
return flag;
}
......@@ -113,12 +112,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool UpdateTemplateMarketIsShowModule(object Id,int IsShow)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Template_Market_Extend.IsShow),IsShow },
};
flag = template_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Template_Market_Extend.Id), Id));
bool flag = template_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Template_Market_Extend.Id), Id));
return flag;
}
......@@ -130,12 +128,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool UpdateTemplateMarketIsUseModule(object Id, int IsUse)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Template_Market_Extend.IsUse),IsUse },
};
flag = template_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Template_Market_Extend.Id), Id));
bool flag = template_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Template_Market_Extend.Id), Id));
return flag;
}
......
......@@ -89,10 +89,7 @@ namespace Mall.Module.Property
/// 采购单明细
/// </summary>
private readonly RB_Procurement_DetailRepository procurement_DetailRepository = new RB_Procurement_DetailRepository();
/// <summary>
/// 员工
/// </summary>
private readonly RB_EmployeeRepository employeeRepository = new RB_EmployeeRepository();
/// <summary>
/// 仓库
/// </summary>
......@@ -268,17 +265,19 @@ namespace Mall.Module.Property
}
else
{
item.SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
item.SpecificationPriceList.Add(new RB_Goods_SpecificationPrice_Extend()
item.SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>
{
Id = item.GoodsId ?? 0,
GoodsId = item.GoodsId,
GoodsNumbers = item.GoodsNumbers,
GoodsWeight = item.GoodsWeight,
InventoryNum = item.InventoryNum,
SpecificationSort = "",
AttrList = new List<string>() { "规格:" + item.DefaultSpecificationName }
});
new RB_Goods_SpecificationPrice_Extend()
{
Id = item.GoodsId ?? 0,
GoodsId = item.GoodsId,
GoodsNumbers = item.GoodsNumbers,
GoodsWeight = item.GoodsWeight,
InventoryNum = item.InventoryNum,
SpecificationSort = "",
AttrList = new List<string>() { "规格:" + item.DefaultSpecificationName }
}
};
}
}
}
......@@ -637,20 +636,22 @@ namespace Mall.Module.Property
}
#region 生成入库单
RB_Supplies_StockIn_Extend stockInModel = new RB_Supplies_StockIn_Extend();
stockInModel.ProcurementId = pModel.Id;
stockInModel.WarehouseId = pModel.WareHouseId;
stockInModel.StockInDate = DateTime.Now;
stockInModel.Status = 0;
stockInModel.RB_Branch_Id = eRPBranchId;
stockInModel.RB_Group_Id = eRPGroupId;
stockInModel.CreateBy = eRPEmpId;
stockInModel.CreateDate = DateTime.Now;
stockInModel.UpdateBy = eRPEmpId;
stockInModel.UpdateDate = DateTime.Now;
stockInModel.SupplierName = pModel.SupplierName;
stockInModel.DetailList = new List<RB_Supplies_StockInDetail_Extend>();
stockInModel.Money = 0;
RB_Supplies_StockIn_Extend stockInModel = new RB_Supplies_StockIn_Extend
{
ProcurementId = pModel.Id,
WarehouseId = pModel.WareHouseId,
StockInDate = DateTime.Now,
Status = 0,
RB_Branch_Id = eRPBranchId,
RB_Group_Id = eRPGroupId,
CreateBy = eRPEmpId,
CreateDate = DateTime.Now,
UpdateBy = eRPEmpId,
UpdateDate = DateTime.Now,
SupplierName = pModel.SupplierName,
DetailList = new List<RB_Supplies_StockInDetail_Extend>(),
Money = 0
};
foreach (var item in demodel.DetailList)
{
var dModel = DetailList.Where(x => x.GoodsId == item.GoodsId && x.SpecificationKey == item.SpecificationKey).FirstOrDefault();
......
......@@ -19,27 +19,27 @@ namespace Mall.Module.User
/// <summary>
/// 专题分类表仓储层对象
/// </summary>
private RB_Topic_TypeRepository topic_TypeRepository = new RB_Topic_TypeRepository();
private readonly RB_Topic_TypeRepository topic_TypeRepository = new RB_Topic_TypeRepository();
/// <summary>
/// 门店表仓储层对象
/// </summary>
private RB_StoresRepository storesRepository = new RB_StoresRepository();
private readonly RB_StoresRepository storesRepository = new RB_StoresRepository();
/// <summary>
/// 视频表仓储层对象
/// </summary>
private RB_VideoRepository videoRepository = new RB_VideoRepository();
private readonly RB_VideoRepository videoRepository = new RB_VideoRepository();
/// <summary>
/// 文章表仓储层对象
/// </summary>
private RB_ArticleRepository articleRepository = new RB_ArticleRepository();
private readonly RB_ArticleRepository articleRepository = new RB_ArticleRepository();
/// <summary>
/// 专题仓储层对象
/// </summary>
private RB_TopicRepository topicRepository = new RB_TopicRepository();
private readonly RB_TopicRepository topicRepository = new RB_TopicRepository();
#region 专题分类
......@@ -73,7 +73,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetTopicTypeModule(RB_Topic_Type_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -110,12 +110,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveTopicTypeModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Topic_Type_Extend.Status),1},
};
flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id));
bool flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id));
return flag;
}
......@@ -127,12 +126,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool UpdateTopicTypeStatusModule(object Id,int IsDisable)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Topic_Type_Extend.IsDisable),IsDisable},
};
flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id));
bool flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id));
return flag;
}
#endregion
......@@ -169,7 +167,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetTopicModule(RB_Topic_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -235,12 +233,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveTopicModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Topic_Extend.Status),1},
};
flag = topicRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Extend.Id), Id));
bool flag = topicRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Extend.Id), Id));
return flag;
}
#endregion
......@@ -277,7 +274,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetStoresModule(RB_Stores_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -322,12 +319,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveStoresModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Stores_Extend.Status),1},
};
flag = storesRepository.Update(fileds, new WhereHelper(nameof(RB_Stores_Extend.Id), Id));
bool flag = storesRepository.Update(fileds, new WhereHelper(nameof(RB_Stores_Extend.Id), Id));
return flag;
}
......@@ -364,7 +360,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetVideoModule(RB_Video_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -404,12 +400,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveVideoModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Video_Extend.Status),1},
};
flag = videoRepository.Update(fileds, new WhereHelper(nameof(RB_Video_Extend.Id), Id));
bool flag = videoRepository.Update(fileds, new WhereHelper(nameof(RB_Video_Extend.Id), Id));
return flag;
}
#endregion
......@@ -446,7 +441,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetArticleModule(RB_Article_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -484,12 +479,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveArticleModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Article_Extend.Status),1},
};
flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id));
bool flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id));
return flag;
}
......@@ -501,12 +495,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool UpdateArticleIsDisableModule(object Id,int IsDisable)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Article_Extend.IsDisable),IsDisable},
};
flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id));
bool flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id));
return flag;
}
#endregion
......
......@@ -98,7 +98,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetRoleModule(RB_Role_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.RoleId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -135,12 +135,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveRoleModule(object RoleId)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Role_Extend.Status),1},
};
flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Role_Extend.RoleId), RoleId));
bool flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Role_Extend.RoleId), RoleId));
return flag;
}
......@@ -178,7 +177,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetEmployeeModule(RB_Employee_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.EmpId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -205,12 +204,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetEmployeePwdModule(RB_Employee_Extend extModel)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Employee_Extend.EmpPwd),extModel.EmpPwd},
};
flag = employeeRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), extModel.EmpId));
bool flag = employeeRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), extModel.EmpId));
return flag;
}
......@@ -231,12 +229,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveEmployeeModule(object EmpId)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Employee_Extend.Status),1},
};
flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), EmpId));
bool flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), EmpId));
return flag;
}
......@@ -267,12 +264,12 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetEmpConfigModule(RB_Emp_Config_Extend extModel)
{
bool flag = false;
var defaultModel = GetEmpConfigListModule(new RB_Emp_Config_Extend() { MallBaseId = extModel.MallBaseId, TenantId = extModel.TenantId });
if (defaultModel != null && defaultModel.ConfigId>0)
{
extModel.ConfigId = defaultModel.ConfigId;
}
bool flag;
if (extModel.ConfigId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......
......@@ -24,9 +24,9 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetGroupBuyConfigModule(RB_GroupBuyConfig_Extend extModel)
{
bool flag = false;
var oldEntity = GetGroupBuyConfigModule(extModel);
extModel.GroupByConfigId = oldEntity?.GroupByConfigId ?? 0;
bool flag;
if (extModel.GroupByConfigId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -63,9 +63,9 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetGroupBuyConfigMessageModule(RB_GroupBuyConfig_Extend extModel)
{
bool flag = false;
var oldEntity = GetGroupBuyConfigModule(extModel);
extModel.GroupByConfigId = oldEntity?.GroupByConfigId ?? 0;
bool flag;
if (extModel.GroupByConfigId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......
using Mall.Model.Extend.User;
using Mall.Repository.User;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
using System.Linq;
namespace Mall.Module.User
{
......
......@@ -48,7 +48,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMenuModule(RB_Menu_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.MenuId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -80,12 +80,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMenuModule(object MenuId, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Menu_Extend.Status),Status},
};
flag = menuRepository.Update(fileds, new WhereHelper(nameof(RB_Menu_Extend.MenuId), MenuId));
bool flag = menuRepository.Update(fileds, new WhereHelper(nameof(RB_Menu_Extend.MenuId), MenuId));
return flag;
}
......
......@@ -28,46 +28,46 @@ namespace Mall.Module.User
/// <summary>
/// 商户仓储层对象
/// </summary>
private Mall.Repository.User.RB_MiniProgramRepository programRepository = new Repository.User.RB_MiniProgramRepository();
private readonly RB_MiniProgramRepository programRepository = new Repository.User.RB_MiniProgramRepository();
/// <summary>
/// 底部导航仓储层对象
/// </summary>
private Repository.User.RB_Miniprogram_BottomnavRepository bottomnavRepository = new Repository.User.RB_Miniprogram_BottomnavRepository();
private readonly RB_Miniprogram_BottomnavRepository bottomnavRepository = new Repository.User.RB_Miniprogram_BottomnavRepository();
/// <summary>
/// 用户中心仓储层对象
/// </summary>
private Repository.User.RB_MiniProgram_UserCenterMenuRepository centerMenuRepository = new Repository.User.RB_MiniProgram_UserCenterMenuRepository();
private readonly RB_MiniProgram_UserCenterMenuRepository centerMenuRepository = new Repository.User.RB_MiniProgram_UserCenterMenuRepository();
/// <summary>
/// 会员订阅消息仓储层对象
/// </summary>
private Repository.User.RB_Member_SubscriptionRepository subscriptionRepository = new Repository.User.RB_Member_SubscriptionRepository();
private readonly RB_Member_SubscriptionRepository subscriptionRepository = new Repository.User.RB_Member_SubscriptionRepository();
/// <summary>
/// 会员仓储层对象
/// </summary>
private Repository.User.RB_Member_UserRepository userRepository = new Repository.User.RB_Member_UserRepository();
private readonly RB_Member_UserRepository userRepository = new Repository.User.RB_Member_UserRepository();
/// <summary>
/// 直播房间仓储层对象
/// </summary>
private Repository.AppletWeChat.RB_Live_HouseRepository liveHouseRepository = new Repository.AppletWeChat.RB_Live_HouseRepository();
private readonly RB_Live_HouseRepository liveHouseRepository = new Repository.AppletWeChat.RB_Live_HouseRepository();
/// <summary>
/// 直播房间仓储层对象
/// </summary>
private Repository.AppletWeChat.RB_Live_HouseImgRepository liveHouseImgRepository = new Repository.AppletWeChat.RB_Live_HouseImgRepository();
private readonly RB_Live_HouseImgRepository liveHouseImgRepository = new Repository.AppletWeChat.RB_Live_HouseImgRepository();
/// <summary>
/// 轮播图表仓储层对象
/// </summary>
private RB_Mall_NavRepository navRepository = new RB_Mall_NavRepository();
private readonly RB_Mall_NavRepository navRepository = new RB_Mall_NavRepository();
/// <summary>
/// 图片魔方表仓储层对象
/// </summary>
private RB_Mall_MagicRepository magicRepository = new RB_Mall_MagicRepository();
private readonly RB_Mall_MagicRepository magicRepository = new RB_Mall_MagicRepository();
/// <summary>
/// 用户共用模块
......@@ -116,7 +116,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMallNavModule(RB_Mall_Nav_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -158,12 +158,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMallNavModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Mall_Nav_Extend.Status),1},
};
flag = navRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Nav_Extend.Id), Id));
bool flag = navRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Nav_Extend.Id), Id));
return flag;
}
......@@ -211,7 +210,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMallMagicModule(RB_Mall_Magic_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -257,12 +256,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMallMagicModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Mall_Magic_Extend.Status),1},
};
flag = magicRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Magic_Extend.Id), Id));
bool flag = magicRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Magic_Extend.Id), Id));
return flag;
}
#endregion
......@@ -325,11 +323,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgramModule(RB_MiniProgram_Extend extModel)
{
bool flag = false;
if (extModel.IsEffective == 1)
{
extModel.MallValidate = null;
}
bool flag;
if (extModel.MallBaseId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -523,12 +521,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgramModule(object MallBaseId, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.Status),Status},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
bool flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
return flag;
}
......@@ -540,12 +537,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgramStatusModule(object MallBaseId, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.Status),Status},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
bool flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
return flag;
}
......@@ -557,12 +553,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgramRecycleModule(object MallBaseId, int Is_Recycle)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.Is_Recycle),Is_Recycle},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
bool flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
return flag;
}
......@@ -642,8 +637,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMiniProgramMallTagModule(string TagId)
{
var flag = false;
flag = bottomnavRepository.DeleteBottomnavRepository(TagId);
bool flag = bottomnavRepository.DeleteBottomnavRepository(TagId);
return flag;
}
......@@ -846,8 +840,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMiniUserCenterMenuModule(object DetailId)
{
bool flag = false;
flag = centerMenuRepository.Delete(DetailId) > 0;
bool flag = centerMenuRepository.Delete(DetailId) > 0;
return flag;
}
......@@ -1841,7 +1834,7 @@ namespace Mall.Module.User
var postdata = new
{
action = "get_replay",
room_id = room_id,
room_id,
start = 0,
limit = 100
};
......@@ -1987,8 +1980,6 @@ namespace Mall.Module.User
/// <returns></returns>
public bool DelLiveHouseImg(int id, int uid, int mallBaseId)
{
bool flag = false;
Dictionary<string, object> cols = new Dictionary<string, object>()
{
{ nameof(RB_Live_HouseImg.Status),1},
......@@ -2010,7 +2001,7 @@ namespace Mall.Module.User
OperatorEnum=OperatorEnum.Equal
}
};
flag = liveHouseImgRepository.Update(cols, wheres1);
bool flag = liveHouseImgRepository.Update(cols, wheres1);
return flag;
}
......@@ -2154,9 +2145,9 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetLiveConfigModule(RB_Live_Config_Extend extModel)
{
var flag = false;
var oldModel = GetLiveConfigModule(extModel);
if (oldModel!=null&&oldModel.Id > 0)
bool flag;
if (oldModel != null && oldModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
......
......@@ -25,17 +25,17 @@ namespace Mall.Module.User
/// <summary>
/// 商户仓储层对象
/// </summary>
private Mall.Repository.User.RB_MiniProgramRepository programRepository = new Repository.User.RB_MiniProgramRepository();
private readonly RB_MiniProgramRepository programRepository = new RB_MiniProgramRepository();
/// <summary>
/// 会员订阅消息仓储层对象
/// </summary>
private Repository.User.RB_Member_SubscriptionRepository subscriptionRepository = new Repository.User.RB_Member_SubscriptionRepository();
private readonly RB_Member_SubscriptionRepository subscriptionRepository = new Repository.User.RB_Member_SubscriptionRepository();
/// <summary>
/// 会员仓储层对象
/// </summary>
private Repository.User.RB_Member_UserRepository userRepository = new Repository.User.RB_Member_UserRepository();
private readonly RB_Member_UserRepository userRepository = new Repository.User.RB_Member_UserRepository();
......
......@@ -15,7 +15,7 @@ namespace Mall.Module.User
/// <summary>
/// 导航图标仓储层对象
/// </summary>
private Mall.Repository.User.RB_MiniProgram_NaviconRepository naviconRepository = new Repository.User.RB_MiniProgram_NaviconRepository();
private readonly Repository.User.RB_MiniProgram_NaviconRepository naviconRepository = new Repository.User.RB_MiniProgram_NaviconRepository();
/// <summary>
/// 根据查询条件获取小程序导航图标列表
......@@ -48,8 +48,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgramNaviconModule(RB_MiniProgram_Navicon_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.NavIconId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -78,13 +77,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMiniProgramNaviconModule(object NavIconId)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Navicon_Extend.NavIconStatus),1},
};
flag = naviconRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Navicon_Extend.NavIconId), NavIconId));
bool flag = naviconRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Navicon_Extend.NavIconId), NavIconId));
return flag;
}
......
......@@ -60,7 +60,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgram_Page_Module(RB_MiniProgram_Page_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -248,12 +248,12 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniprogram_PageManage_Module(RB_Miniprogram_PageManage_Extend extModel)
{
bool flag = false;
if (extModel.IsParameter == 0)
{
extModel.ParameterValue = "";
extModel.TipText = "";
}
bool flag;
if (extModel.PageId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -286,12 +286,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMiniprogram_PageManage_Module(object PageId, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Miniprogram_PageManage_Extend.Status),Status},
};
flag = miniprogram_PageManageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_PageManage_Extend.PageId), PageId));
bool flag = miniprogram_PageManageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_PageManage_Extend.PageId), PageId));
return flag;
}
......
......@@ -16,13 +16,13 @@ namespace Mall.Module.User
/// <summary>
/// 分销海报仓储层对象
/// </summary>
private RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
private readonly RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
/// <summary>
/// 商品分销仓储层对象
/// </summary>
private RB_MiniProgram_GoodPosterRepository goodPosterRepository = new RB_MiniProgram_GoodPosterRepository();
private readonly RB_MiniProgram_GoodPosterRepository goodPosterRepository = new RB_MiniProgram_GoodPosterRepository();
/// <summary>
/// 根据查询条件获取分销海报实体
......@@ -41,7 +41,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetFenXiaoPosterModule(RB_MiniProgram_FenXiaoPoster_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -90,7 +90,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetGoodPosterModule(RB_MiniProgram_GoodPoster_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......
......@@ -90,7 +90,7 @@ namespace Mall.Module.User
/// <summary>
/// 财务单据规则
/// </summary>
private static RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
private static readonly RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
/// <summary>
/// 可简化
......@@ -215,10 +215,9 @@ namespace Mall.Module.User
/// </summary>
/// <param name="smallShopsId"></param>
/// <param name="commission"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <param name="empId"></param>
/// <returns></returns>
public bool SetSmallShopsCommission(int smallShopsId, decimal commission, int tenantId, int mallBaseId, int empId)
public bool SetSmallShopsCommission(int smallShopsId, decimal commission,int empId)
{
var model = smallShops_InfoRepository.GetEntity(smallShopsId);
if (model == null) { return false; }
......
......@@ -16,9 +16,9 @@ namespace Mall.Module.User
{
public class SupplierModule
{
private RB_SupplierRepository supplierRepository = new RB_SupplierRepository();
private RB_SupplierCommissionRepository supplierCommissionRepository = new RB_SupplierCommissionRepository();
private RB_ClientBankAccountRepository clientBankAccountRepository = new RB_ClientBankAccountRepository();
private readonly RB_SupplierRepository supplierRepository = new RB_SupplierRepository();
private readonly RB_SupplierCommissionRepository supplierCommissionRepository = new RB_SupplierCommissionRepository();
private readonly RB_ClientBankAccountRepository clientBankAccountRepository = new RB_ClientBankAccountRepository();
/// <summary>
/// 分页列表
......@@ -216,7 +216,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveSupplier(int ID, int BankAccountId)
{
bool flag = false;
bool flag;
try
{
IDictionary<string, object> fileds = new Dictionary<string, object>()
......
......@@ -15,7 +15,7 @@ namespace Mall.Module.User
/// <summary>
/// 商户仓储层对象
/// </summary>
private Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository();
private readonly Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository();
/// <summary>
......@@ -75,10 +75,9 @@ namespace Mall.Module.User
{
extModel.Account = extModel.Account.Trim();
extModel.Password= Common.DES.Encrypt(extModel.Password, Common.Config.WebApiKey, Common.Config.WebApiIV);
bool flag = false;
int NewId = tenantRepository.Insert(extModel);
extModel.TenantId = NewId;
flag = NewId > 0;
bool flag = NewId > 0;
return flag;
}
......@@ -129,13 +128,12 @@ namespace Mall.Module.User
/// <returns></returns>
public bool UpdateTenantPwdModule(RB_Tenant_Extend extModel)
{
bool flag = false;
extModel.Password = Common.DES.Encrypt(extModel.Password, Common.Config.WebApiKey, Common.Config.WebApiIV);
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Tenant_Extend.Password),extModel.Password},
};
flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.MobilePhone), extModel.MobilePhone.Trim()));
bool flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.MobilePhone), extModel.MobilePhone.Trim()));
return flag;
}
......@@ -162,12 +160,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetTenantStatusModule(object TenantId, int AccountStatus)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Tenant_Extend.AccountStatus),AccountStatus},
};
flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.TenantId), TenantId));
bool flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.TenantId), TenantId));
return flag;
}
}
......
......@@ -131,40 +131,40 @@ namespace Mall.Module.User
/// <summary>
/// 财务单据规则
/// </summary>
private static RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
private static readonly RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
/// <summary>
/// 用户优惠券
/// </summary>
private RB_Member_CouponRepository memberCouponRepository = new RB_Member_CouponRepository();
private readonly RB_Member_CouponRepository memberCouponRepository = new RB_Member_CouponRepository();
/// <summary>
/// 分销海报仓储层对象
/// </summary>
private RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
private readonly RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
/// <summary>
/// 会员购买仓储层
/// </summary>
private RB_Member_BuyRepository memberBuyRepository = new RB_Member_BuyRepository();
private readonly RB_Member_BuyRepository memberBuyRepository = new RB_Member_BuyRepository();
/// <summary>
/// 粉象返佣等级
/// </summary>
private RB_Distributor_FXGradeRepository distributor_FXGradeRepository = new RB_Distributor_FXGradeRepository();
private readonly RB_Distributor_FXGradeRepository distributor_FXGradeRepository = new RB_Distributor_FXGradeRepository();
/// <summary>
/// vip购买返佣
/// </summary>
private RB_VipBuy_CommissionRepository vipBuy_CommissionRepository = new RB_VipBuy_CommissionRepository();
private readonly RB_VipBuy_CommissionRepository vipBuy_CommissionRepository = new RB_VipBuy_CommissionRepository();
/// <summary>
/// vip购买
/// </summary>
private RB_Vip_BuyRepository vip_BuyRepository = new RB_Vip_BuyRepository();
private readonly RB_Vip_BuyRepository vip_BuyRepository = new RB_Vip_BuyRepository();
/// <summary>
/// 粉象返佣金额
/// </summary>
private RB_Distributor_FXCommissionRepository distributor_FXCommissionRepository = new RB_Distributor_FXCommissionRepository();
private readonly RB_Distributor_FXCommissionRepository distributor_FXCommissionRepository = new RB_Distributor_FXCommissionRepository();
/// <summary>
/// 分销商日志
/// </summary>
private RB_Distributor_LogRepository distributor_LogRepository = new RB_Distributor_LogRepository();
private readonly RB_Distributor_LogRepository distributor_LogRepository = new RB_Distributor_LogRepository();
/// <summary>
/// 推荐供应商返佣账单
/// </summary>
......@@ -262,8 +262,7 @@ namespace Mall.Module.User
/// <returns></returns>
public int AddMemberUserInfo(RB_Member_User_Extend demodel)
{
int result = 0;
result = member_UserRepository.Insert(demodel);
int result = member_UserRepository.Insert(demodel);
//result = member_UserRepository.SetMemberUserRepository(demodel);
return result;
}
......@@ -1585,8 +1584,10 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetDistributorInfoForFX(int FXGradeId, int UserId, int TenantId, int MallBaseId)
{
var demodel = new RB_Distributor_Info_Extend();
demodel.UserId = UserId;
var demodel = new RB_Distributor_Info_Extend
{
UserId = UserId
};
demodel.TotalCommission ??= 0;
demodel.CommissionWithdrawal ??= 0;
demodel.Name ??= "";
......@@ -5332,11 +5333,13 @@ namespace Mall.Module.User
{
return ApiResult.Failed("未查询到普通会员等级");
}
List<string> TitleList = new List<string>();
TitleList.Add("等级名称");
TitleList.Add("级别标准");
TitleList.Add(pModel.GradeName);
TitleList.Add("间接普会");
List<string> TitleList = new List<string>
{
"等级名称",
"级别标准",
pModel.GradeName,
"间接普会"
};
foreach (var item in list)
{
if (item.Id != pModel.Id)
......@@ -5347,9 +5350,11 @@ namespace Mall.Module.User
List<object> ContenList = new List<object>();
foreach (var item in list)
{
List<string> itemList = new List<string>();
itemList.Add(item.GradeName);
itemList.Add((item.CommissionRatio ?? 0).ToString() + "%");
List<string> itemList = new List<string>
{
item.GradeName,
(item.CommissionRatio ?? 0).ToString() + "%"
};
foreach (var qitem in list)
{
if (qitem.Id == pModel.Id)
......@@ -6192,7 +6197,6 @@ namespace Mall.Module.User
/// <returns></returns>
public bool UpdateMemberBuy(int UserId, int OrderId, string Out_Trade_No, string Transaction_Id, Common.Enum.Goods.OrderPayTypeEnum PayWay, decimal Money, DateTime Time_End)
{
bool flag = false;
var umodel = member_UserRepository.GetEntity(UserId);
if (umodel == null)
{
......@@ -6214,6 +6218,7 @@ namespace Mall.Module.User
}
var trans = memberBuyRepository.DbTransaction;
bool flag;
try
{
......
......@@ -1260,8 +1260,8 @@ GROUP BY od.GoodsId,o.OrderId
#region 粉象收益核算表
public List<OrderStatistics_Query> GetFXOrderProfitLossList(int pageIndex, int pageSize, out long count, OrderStatistics_Query dmodel)
{
string where = "where 1=1 and a.OrderStatus in(2,3,4,5,6) ";
// string where = "where 1=1 and a.OrderStatus in(2,3,4,5,6) ";
string where = "where 1=1 and (a.OrderStatus in(2,3,4,5,6) or (a.OrderStatus=7 and a.PaymentTime is not NULL and a.CancelTime is not NULL and DATE_FORMAT(a.PaymentTime,'%Y-%m-%d' )<DATE_FORMAT(a.CancelTime,'%Y-%m-%d' ) ) ) ";
if (dmodel != null)
{
if (!string.IsNullOrWhiteSpace(dmodel.OrderNo))
......@@ -1296,11 +1296,11 @@ GROUP BY od.GoodsId,o.OrderId
if (!string.IsNullOrWhiteSpace(dmodel.StartDate))
{
where += $" and DATE_FORMAT(a.CreateDate,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
where += $" and DATE_FORMAT(a.PaymentTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
}
if (!string.IsNullOrWhiteSpace(dmodel.EndDate))
{
where += $" and DATE_FORMAT(a.CreateDate,'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' ) ";
where += $" and DATE_FORMAT(a.PaymentTime,'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' ) ";
}
}
......@@ -1318,7 +1318,7 @@ GROUP BY od.GoodsId,o.OrderId
//GROUP BY b.Id order by b.Id desc";
string sql = $@" SELECT B.Id,SUM(b.PaidCostMoney) as PaidCostMoney,MAX(b.OrderId) as OrderId,MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName,
string sql = $@" SELECT a.OrderStatus,B.Id,b.ServiceCharge,SUM(b.PaidCostMoney) as PaidCostMoney,MAX(b.OrderId) as OrderId,MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName,
SUM(b.Final_Price) as Final_Price,SUM(b.FreightMoney) as FreightMoney,SUM(b.Final_Price+b.FreightMoney) as AllPrice ,
SUM(IFNULL(b.CostMoney,0)*b.Number) as CostMoney,0 as PackingMoney, 0 as CostFreight,sum(b.FreightCostMoney) as GoodsFreight,
0 as OtherPrice,b.LiveCommission,b.LiveFinanceIds,b.LivePeopleNum,0 as Paid,oa.RefundActual,b.CouponMoney,b.CompanyProfitRate,b.CompanyId,muser.`Name` as CompanyName,b.YSMoney,b.RealMoney,b.YFMoney,b.PayMoney
......@@ -1336,7 +1336,7 @@ GROUP BY b.Id order by b.Id asc";
public List<OrderStatistics_Query> GetFXAllOrderProfitLossList(OrderStatistics_Query dmodel)
{
string where = "where 1=1 and a.OrderStatus in(2,3,4,5,6) ";
string where = "where 1=1 and (a.OrderStatus in(2,3,4,5,6) or (a.OrderStatus=7 and a.PaymentTime is not NULL and a.CancelTime is not NULL and DATE_FORMAT(a.PaymentTime,'%Y-%m-%d' )<DATE_FORMAT(a.CancelTime,'%Y-%m-%d' ) ) ) ";
DynamicParameters parameters = new DynamicParameters();
if (dmodel != null)
{
......@@ -1373,11 +1373,11 @@ GROUP BY b.Id order by b.Id asc";
if (!string.IsNullOrWhiteSpace(dmodel.StartDate))
{
where += $" and DATE_FORMAT(a.CreateDate,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
where += $" and DATE_FORMAT(a.PaymentTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
}
if (!string.IsNullOrWhiteSpace(dmodel.EndDate))
{
where += $" and DATE_FORMAT(a.CreateDate,'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' ) ";
where += $" and DATE_FORMAT(a.PaymentTime,'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' ) ";
}
}
......@@ -1395,7 +1395,7 @@ GROUP BY b.Id order by b.Id asc";
//GROUP BY b.Id ";
string sql = $@" SELECT B.Id,SUM(b.PaidCostMoney) as PaidCostMoney,MAX(b.OrderId) as OrderId,MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName,
string sql = $@" SELECT a.OrderStatus,B.Id,b.ServiceCharge,SUM(b.PaidCostMoney) as PaidCostMoney,MAX(b.OrderId) as OrderId,MAX( a.OrderNo) as OrderNo,MAX(b.GoodsName) as GoodsName,b.Specification,MAX(b.Unit_Price) as Unit_Price,SUM(b.Number) as Number,f.`Name` as SupplierName,
SUM(b.Final_Price) as Final_Price,SUM(b.FreightMoney) as FreightMoney,SUM(b.Final_Price+b.FreightMoney) as AllPrice ,
SUM(IFNULL(b.CostMoney,0)*b.Number) as CostMoney,0 as PackingMoney, 0 as CostFreight,sum(b.FreightCostMoney) as GoodsFreight,
0 as OtherPrice,b.LiveCommission,b.LiveFinanceIds,b.LivePeopleNum,0 as Paid,oa.RefundActual,b.CouponMoney,b.CompanyProfitRate,b.CompanyId,muser.`Name` as CompanyName,b.YSMoney,b.RealMoney,b.YFMoney,b.PayMoney
......@@ -1405,7 +1405,6 @@ LEFT JOIN rb_supplier as f on f.ID=b.SupplierId
LEFT JOIN rb_member_user as muser on muser.id=b.CompanyId
left join rb_goods_orderaftersale oa on b.ID= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5) {where}
GROUP BY b.Id order by b.Id asc ";
return Get<OrderStatistics_Query>(sql, parameters).ToList();
}
......
......@@ -152,10 +152,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat
foreach (var item in list)
{
item.ALLCommission = item.CostMoney + item.GoodsFreight + item.FXCommission + item.LiveCommission + item.CouponMoney + item.RefundActual + item.YFMoney;
item.ALLCommission = item.ServiceCharge + item.CostMoney + item.GoodsFreight + item.FXCommission + item.LiveCommission + item.CouponMoney + item.RefundActual + item.YFMoney;
item.NoPaid = item.ALLCommission;
item.RemitFXCommission = item.RemitFXCommission + (!string.IsNullOrWhiteSpace(item.LiveFinanceIds) ? item.LiveCommission : 0);
item.Paid = item.RefundActual + item.RemitFXCommission + item.CostMoney + item.GoodsFreight + item.PayMoney;
item.Paid = item.ServiceCharge + item.RefundActual + item.RemitFXCommission + item.CostMoney + item.GoodsFreight + item.PayMoney;
item.GrossProfit = item.AllPrice + item.YSMoney - item.ALLCommission;
if (item.AllPrice == 0)
{
......@@ -323,6 +323,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
ExcelRows = new List<ExcelColumn>(23) {
new ExcelColumn(value: "序号") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "订单号") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "订单状态") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "商品名称") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "单价") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "数量") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
......@@ -332,6 +333,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
new ExcelColumn(value: "已收") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "其他收入") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "合计收入") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "手续费") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "采购成本") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "运费支出") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "总返佣金额") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
......@@ -361,10 +363,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
foreach (var item in list)
{
item.ALLCommission = item.CostMoney + item.GoodsFreight + item.FXCommission + item.LiveCommission + item.CouponMoney + item.RefundActual + item.YFMoney;
item.ALLCommission = item.ServiceCharge + item.CostMoney + item.GoodsFreight + item.FXCommission + item.LiveCommission + item.CouponMoney + item.RefundActual + item.YFMoney;
item.NoPaid = item.ALLCommission;
item.RemitFXCommission = item.RemitFXCommission + (!string.IsNullOrWhiteSpace(item.LiveFinanceIds) ? item.LiveCommission : 0);
item.Paid = item.RefundActual + item.RemitFXCommission + item.CostMoney + item.GoodsFreight + item.PayMoney;
item.Paid = item.ServiceCharge + item.RefundActual + item.RemitFXCommission + item.CostMoney + item.GoodsFreight + item.PayMoney;
item.GrossProfit = item.AllPrice + item.YSMoney - item.ALLCommission;
if (item.AllPrice == 0)
{
......@@ -394,6 +396,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
};
datarow.ExcelRows.Add(new ExcelColumn(value: item.OrderNo) { });
datarow.ExcelRows.Add(new ExcelColumn(value: (item.OrderStatus==7?"已取消":"正常")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.GoodsName + item.Specification) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.Unit_Price.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.Number.ToString()) { });
......@@ -403,6 +406,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
datarow.ExcelRows.Add(new ExcelColumn(value: item.AllPrice.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.YSMoney.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: (item.AllPrice + item.YSMoney).ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.ServiceCharge.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.CostMoney.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.GoodsFreight.ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: item.FXCommission.ToString("#0.00")) { });
......@@ -456,6 +460,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
};
datarow.ExcelRows.Add(new ExcelColumn(value: "") { });
datarow.ExcelRows.Add(new ExcelColumn(value: "") { });
datarow.ExcelRows.Add(new ExcelColumn(value: "") { });
datarow.ExcelRows.Add(new ExcelColumn(value: list.Sum(x => x.Unit_Price).ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: list.Sum(x => x.Number).ToString()) { });
datarow.ExcelRows.Add(new ExcelColumn(value: "") { });
......@@ -464,6 +469,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
datarow.ExcelRows.Add(new ExcelColumn(value: list.Sum(x => x.AllPrice).ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: list.Sum(x => x.YSMoney).ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: list.Sum(x => x.AllPrice + x.YSMoney).ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: list.Sum(x => x.ServiceCharge).ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: list.Sum(x => x.CostMoney).ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: list.Sum(x => x.GoodsFreight).ToString("#0.00")) { });
datarow.ExcelRows.Add(new ExcelColumn(value: list.Sum(x => x.FXCommission).ToString("#0.00")) { });
......@@ -558,10 +564,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
foreach (var item in list)
{
item.ALLCommission = item.CostMoney + item.GoodsFreight + item.FXCommission + item.LiveCommission + item.CouponMoney + item.RefundActual + item.YFMoney;
item.ALLCommission = item.ServiceCharge + item.CostMoney + item.GoodsFreight + item.FXCommission + item.LiveCommission + item.CouponMoney + item.RefundActual + item.YFMoney;
item.NoPaid = item.ALLCommission;
item.RemitFXCommission = item.RemitFXCommission + (!string.IsNullOrWhiteSpace(item.LiveFinanceIds) ? item.LiveCommission : 0);
item.Paid = item.RefundActual + item.RemitFXCommission + item.CostMoney + item.GoodsFreight + item.PayMoney;
item.Paid = item.ServiceCharge + item.RefundActual + item.RemitFXCommission + item.CostMoney + item.GoodsFreight + item.PayMoney;
item.GrossProfit = item.AllPrice + item.YSMoney - item.ALLCommission;
if (item.AllPrice == 0)
{
......@@ -590,6 +596,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
Final_Price = list.Sum(x => x.Final_Price),//数量
FreightMoney = list.Sum(x => !string.IsNullOrWhiteSpace(x.FreightMoney) ? Convert.ToDecimal(x.FreightMoney) : 0),
AllPrice = list.Sum(x => x.AllPrice),
ServiceCharge = list.Sum(x => x.ServiceCharge),
CostMoney = list.Sum(x => x.CostMoney),
PackingMoney = list.Sum(x => x.PackingMoney),
GoodsFreight = list.Sum(x => x.GoodsFreight),
......
......@@ -81,6 +81,6 @@
"GradeEntranceImage": "1234566778"
},
"ShareConfig": {
"ShareImg": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/zanyang.png",
"ShareImg": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/zanyang.png"
}
}
\ 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