Commit eda478b4 authored by 黄奎's avatar 黄奎

代码优化

parent ce20880e
...@@ -127,9 +127,7 @@ namespace Edu.Cache.App ...@@ -127,9 +127,7 @@ namespace Edu.Cache.App
Common.Plugin.LogHelper.Write(ex, "GetUserCode"); Common.Plugin.LogHelper.Write(ex, "GetUserCode");
} }
} }
return code; return code;
} }
} }
} }
...@@ -224,12 +224,10 @@ namespace Edu.Common ...@@ -224,12 +224,10 @@ namespace Edu.Common
public static string ConvertImageToBase64(string filePath) public static string ConvertImageToBase64(string filePath)
{ {
Image file = Image.FromFile(filePath); Image file = Image.FromFile(filePath);
using (MemoryStream memoryStream = new MemoryStream()) using MemoryStream memoryStream = new MemoryStream();
{ file.Save(memoryStream, file.RawFormat);
file.Save(memoryStream, file.RawFormat); byte[] imageBytes = memoryStream.ToArray();
byte[] imageBytes = memoryStream.ToArray(); return Convert.ToBase64String(imageBytes);
return Convert.ToBase64String(imageBytes);
}
} }
/// <summary> /// <summary>
......
...@@ -58,176 +58,6 @@ namespace Edu.Common ...@@ -58,176 +58,6 @@ namespace Edu.Common
#region 对称加密算法 #region 对称加密算法
#region 3DES对称加密算法
/// <summary>
/// 使用指定的128字节的密钥对8字节数组进行3Des加密
/// </summary>
/// <param name="plainStr"></param>
/// <param name="key">密钥长度,可以为128(16字节),或是192(24字节)</param>
/// <param name="iv">加密向量长度64位以上(8个字节以上)</param>
/// <param name="isBase64Code">是否是Base64编码,否则是16进制编码</param>
/// <param name="mode">加密模式</param>
/// <param name="padding">填充模式</param>
/// <returns>已加密的字符串</returns>
public static string TripleDESEncrypt(string plainStr, string key = Default3DESKey, string iv = Default3DESIV, bool isBase64Code = true, CipherMode mode = CipherMode.CBC, PaddingMode padding = PaddingMode.PKCS7)
{
byte[] bKey = Encoding.UTF8.GetBytes(key);
byte[] bIV = Encoding.UTF8.GetBytes(iv);
byte[] byteArray = Encoding.UTF8.GetBytes(plainStr);
string encrypt = null;
var tdsc = new TripleDESCryptoServiceProvider();
try
{
//加密模式,偏移
tdsc.Mode = mode;
tdsc.Padding = padding;
using (var mStream = new MemoryStream())
{
using (var cStream = new CryptoStream(mStream, tdsc.CreateEncryptor(bKey, bIV), CryptoStreamMode.Write))
{
cStream.Write(byteArray, 0, byteArray.Length);
cStream.FlushFinalBlock();
if (isBase64Code)
encrypt = Convert.ToBase64String(mStream.ToArray());
else
ToString(mStream.ToArray());
}
}
}
catch { }
tdsc.Clear();
return encrypt;
}
/// <summary>
/// 使用指定的128字节的密钥对8字节数组进行3Des解密
/// </summary>
/// <param name="encryptStr"></param>
/// <param name="key">密钥长度,可以为128(16字节),或是192(24字节)</param>
/// <param name="iv">加密向量长度64位以上(8个字节以上)</param>
/// <param name="isBase64Code">是否是Base64编码,否则是16进制编码</param>
/// <param name="mode">加密模式</param>
/// <param name="padding">填充模式</param>
/// <returns>已解密的字符串</returns>
public static string TripleDESDecrypt(string encryptStr, string key = Default3DESKey, string iv = Default3DESIV, bool isBase64Code = true, CipherMode mode = CipherMode.CBC, PaddingMode padding = PaddingMode.PKCS7)
{
byte[] bKey = Encoding.UTF8.GetBytes(key);
byte[] bIV = Encoding.UTF8.GetBytes(iv);
byte[] byteArray;
if (isBase64Code)
byteArray = Convert.FromBase64String(encryptStr);
else
byteArray = ToBytes(encryptStr);
string decrypt = null;
var tdsc = new TripleDESCryptoServiceProvider();
try
{
tdsc.Mode = mode;
tdsc.Padding = padding;
using (var mStream = new MemoryStream())
{
using (var cStream = new CryptoStream(mStream, tdsc.CreateDecryptor(bKey, bIV), CryptoStreamMode.Write))
{
cStream.Write(byteArray, 0, byteArray.Length);
cStream.FlushFinalBlock();
decrypt = Encoding.UTF8.GetString(mStream.ToArray());
}
}
}
catch { }
tdsc.Clear();
return decrypt;
}
#endregion
#region DES对称加密算法
/// <summary>
/// DES加密
/// </summary>
/// <param name="plainStr">明文字符串</param>
/// <param name="key">加密密钥长度64位(8字节)</param>
/// <param name="iv">加密向量长度64位以上(8个字节以上)</param>
/// <param name="isBase64Code">是否是Base64编码,否则是16进制编码</param>
/// <param name="mode">加密模式</param>
/// <param name="padding">填充模式</param>
/// <returns>密文</returns>
public static string DESEncrypt(string plainStr, string key = DefaultDESKey, string iv = DefaultDESIV, bool isBase64Code = true, CipherMode mode = CipherMode.CBC, PaddingMode padding = PaddingMode.PKCS7)
{
byte[] bKey = Encoding.UTF8.GetBytes(key);
byte[] bIV = Encoding.UTF8.GetBytes(iv);
byte[] byteArray = Encoding.UTF8.GetBytes(plainStr);
string encrypt = null;
var des = new DESCryptoServiceProvider();
try
{
des.Mode = mode;
des.Padding = padding;
using (var mStream = new MemoryStream())
{
using (var cStream = new CryptoStream(mStream, des.CreateEncryptor(bKey, bIV), CryptoStreamMode.Write))
{
cStream.Write(byteArray, 0, byteArray.Length);
cStream.FlushFinalBlock();
if (isBase64Code)
encrypt = Convert.ToBase64String(mStream.ToArray());
else
ToString(mStream.ToArray());
}
}
}
catch { }
des.Clear();
return encrypt;
}
/// <summary>
/// DES解密
/// </summary>
/// <param name="encryptStr">密文字符串</param>
/// <param name="key">加密密钥长度64位(8字节)</param>
/// <param name="iv">加密向量长度64位以上(8个字节以上)</param>
/// <param name="isBase64Code">是否是Base64编码,否则是16进制编码</param>
/// <param name="mode">加密模式</param>
/// <param name="padding">填充模式</param>
/// <returns>明文</returns>
public static string DESDecrypt(string encryptStr, string key = DefaultDESKey, string iv = DefaultDESIV, bool isBase64Code = true, CipherMode mode = CipherMode.CBC, PaddingMode padding = PaddingMode.PKCS7)
{
byte[] bKey = Encoding.UTF8.GetBytes(key);
byte[] bIV = Encoding.UTF8.GetBytes(iv);
byte[] byteArray;
if (isBase64Code)
byteArray = Convert.FromBase64String(encryptStr);
else
byteArray = ToBytes(encryptStr);
string decrypt = null;
var des = new DESCryptoServiceProvider();
try
{
des.Mode = mode;
des.Padding = padding;
using (var mStream = new MemoryStream())
{
using (var cStream = new CryptoStream(mStream, des.CreateDecryptor(bKey, bIV), CryptoStreamMode.Write))
{
cStream.Write(byteArray, 0, byteArray.Length);
cStream.FlushFinalBlock();
decrypt = Encoding.UTF8.GetString(mStream.ToArray());
}
}
}
catch { }
des.Clear();
return decrypt;
}
#endregion
#region AES加密算法 #region AES加密算法
/// <summary> /// <summary>
...@@ -323,15 +153,13 @@ namespace Edu.Common ...@@ -323,15 +153,13 @@ namespace Edu.Common
{ {
aes.Padding = padding; aes.Padding = padding;
aes.Mode = mode; aes.Mode = mode;
using (var mStream = new MemoryStream()) using var mStream = new MemoryStream();
using (CryptoStream cStream = new CryptoStream(mStream, aes.CreateEncryptor(bKey, bIV), CryptoStreamMode.Write))
{ {
using (var cStream = new CryptoStream(mStream, aes.CreateEncryptor(bKey, bIV), CryptoStreamMode.Write)) cStream.Write(byteArray, 0, byteArray.Length);
{ cStream.FlushFinalBlock();
cStream.Write(byteArray, 0, byteArray.Length);
cStream.FlushFinalBlock();
}
encrypt = mStream.ToArray();
} }
encrypt = mStream.ToArray();
} }
catch catch
{ {
...@@ -387,15 +215,11 @@ namespace Edu.Common ...@@ -387,15 +215,11 @@ namespace Edu.Common
{ {
aes.Mode = mode; aes.Mode = mode;
aes.Padding = padding; aes.Padding = padding;
using (var mStream = new MemoryStream()) using var mStream = new MemoryStream();
{ using var cStream = new CryptoStream(mStream, aes.CreateDecryptor(bKey, bIV), CryptoStreamMode.Write);
using (var cStream = new CryptoStream(mStream, aes.CreateDecryptor(bKey, bIV), CryptoStreamMode.Write)) cStream.Write(byteArray, 0, byteArray.Length);
{ cStream.FlushFinalBlock();
cStream.Write(byteArray, 0, byteArray.Length); decrypt = Encoding.UTF8.GetString(mStream.ToArray());
cStream.FlushFinalBlock();
decrypt = Encoding.UTF8.GetString(mStream.ToArray());
}
}
} }
catch { } catch { }
aes.Clear(); aes.Clear();
...@@ -428,15 +252,13 @@ namespace Edu.Common ...@@ -428,15 +252,13 @@ namespace Edu.Common
{ {
aes.Mode = mode; aes.Mode = mode;
aes.Padding = padding; aes.Padding = padding;
using (var mStream = new MemoryStream()) using var mStream = new MemoryStream();
using (var cStream = new CryptoStream(mStream, aes.CreateDecryptor(bKey, bIV), CryptoStreamMode.Write))
{ {
using (var cStream = new CryptoStream(mStream, aes.CreateDecryptor(bKey, bIV), CryptoStreamMode.Write)) cStream.Write(byteArray, 0, byteArray.Length);
{ cStream.FlushFinalBlock();
cStream.Write(byteArray, 0, byteArray.Length);
cStream.FlushFinalBlock();
}
decrypt = mStream.ToArray();
} }
decrypt = mStream.ToArray();
} }
catch { } catch { }
aes.Clear(); aes.Clear();
...@@ -469,18 +291,14 @@ namespace Edu.Common ...@@ -469,18 +291,14 @@ namespace Edu.Common
{ {
rc2.Padding = padding; rc2.Padding = padding;
rc2.Mode = mode; rc2.Mode = mode;
using (var mStream = new MemoryStream()) using var mStream = new MemoryStream();
{ using var cStream = new CryptoStream(mStream, rc2.CreateEncryptor(bKey, bIV), CryptoStreamMode.Write);
using (var cStream = new CryptoStream(mStream, rc2.CreateEncryptor(bKey, bIV), CryptoStreamMode.Write)) cStream.Write(byteArray, 0, byteArray.Length);
{ cStream.FlushFinalBlock();
cStream.Write(byteArray, 0, byteArray.Length); if (isBase64Code)
cStream.FlushFinalBlock(); encrypt = Convert.ToBase64String(mStream.ToArray());
if (isBase64Code) else
encrypt = Convert.ToBase64String(mStream.ToArray()); encrypt = ToString(mStream.ToArray());
else
encrypt = ToString(mStream.ToArray());
}
}
} }
catch { } catch { }
rc2.Clear(); rc2.Clear();
...@@ -514,15 +332,11 @@ namespace Edu.Common ...@@ -514,15 +332,11 @@ namespace Edu.Common
{ {
rc2.Mode = mode; rc2.Mode = mode;
rc2.Padding = padding; rc2.Padding = padding;
using (var mStream = new MemoryStream()) using var mStream = new MemoryStream();
{ using var cStream = new CryptoStream(mStream, rc2.CreateDecryptor(bKey, bIV), CryptoStreamMode.Write);
using (var cStream = new CryptoStream(mStream, rc2.CreateDecryptor(bKey, bIV), CryptoStreamMode.Write)) cStream.Write(byteArray, 0, byteArray.Length);
{ cStream.FlushFinalBlock();
cStream.Write(byteArray, 0, byteArray.Length); decrypt = Encoding.UTF8.GetString(mStream.ToArray());
cStream.FlushFinalBlock();
decrypt = Encoding.UTF8.GetString(mStream.ToArray());
}
}
} }
catch { } catch { }
rc2.Clear(); rc2.Clear();
...@@ -867,42 +681,7 @@ namespace Edu.Common ...@@ -867,42 +681,7 @@ namespace Edu.Common
data[i] = (byte)(h | l); data[i] = (byte)(h | l);
} }
return data; return data;
} }
/// <summary>
/// 解析手机号码
/// </summary>
/// <param name="encryptedDataStr"></param>
/// <param name="key"></param>
/// <param name="iv"></param>
/// <returns></returns>
public static string AES_decrypt(string encryptedDataStr, string key, string iv)
{
RijndaelManaged rijalg = new RijndaelManaged();
//-----------------
//设置 cipher 格式 AES-128-CBC
rijalg.KeySize = 128;
rijalg.Padding = PaddingMode.PKCS7;
rijalg.Mode = CipherMode.CBC;
rijalg.Key = Convert.FromBase64String(key);
rijalg.IV = Convert.FromBase64String(iv);
byte[] encryptedData = Convert.FromBase64String(encryptedDataStr);
//解密
ICryptoTransform decryptor = rijalg.CreateDecryptor(rijalg.Key, rijalg.IV);
string result;
using (MemoryStream msDecrypt = new MemoryStream(encryptedData))
{
using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))
{
using (StreamReader srDecrypt = new StreamReader(csDecrypt))
{
result = srDecrypt.ReadToEnd();
}
}
}
return result;
}
} }
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ namespace Edu.Common.Plugin ...@@ -19,7 +19,7 @@ namespace Edu.Common.Plugin
{ {
if (source == null) if (source == null)
{ {
return default(TOut); return default;
} }
else else
{ {
......
...@@ -51,6 +51,11 @@ namespace Edu.Model.ViewModel.Course ...@@ -51,6 +51,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary> /// </summary>
public string CustomerSourceName { get { return Common.Plugin.EnumHelper.ToName(this.CustomerSource); } } public string CustomerSourceName { get { return Common.Plugin.EnumHelper.ToName(this.CustomerSource); } }
/// <summary>
/// 客户确认状态字符串
/// </summary>
public string CustomerStatusName { get { return Common.Plugin.EnumHelper.ToName(this.CustomerStatus); } }
/// <summary> /// <summary>
/// 创建时间--开始 /// 创建时间--开始
/// </summary> /// </summary>
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
using Edu.Common.Enum; using Edu.Common.Enum;
using Edu.Common.Enum.Course; using Edu.Common.Enum.Course;
using Edu.Model.CacheModel; using Edu.Model.CacheModel;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course; using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Repository.Course; using Edu.Repository.Course;
......
...@@ -54,10 +54,7 @@ namespace Edu.Module.Course ...@@ -54,10 +54,7 @@ namespace Edu.Module.Course
/// 课程计划 /// 课程计划
/// </summary> /// </summary>
private readonly RB_Class_PlanRepository class_PlanRepository = new RB_Class_PlanRepository(); private readonly RB_Class_PlanRepository class_PlanRepository = new RB_Class_PlanRepository();
/// <summary>
/// 上课时间
/// </summary>
private readonly RB_Class_TimeRepository class_TimeRepository = new RB_Class_TimeRepository();
/// <summary> /// <summary>
/// 教师 /// 教师
/// </summary> /// </summary>
...@@ -533,9 +530,8 @@ namespace Edu.Module.Course ...@@ -533,9 +530,8 @@ namespace Edu.Module.Course
/// 设置订单使用最新的班级价格 /// 设置订单使用最新的班级价格
/// </summary> /// </summary>
/// <param name="orderId"></param> /// <param name="orderId"></param>
/// <param name="userInfo"></param>
/// <returns></returns> /// <returns></returns>
public bool SetClassOrderUseNewClassPrice(int orderId, UserInfo userInfo) public bool SetClassOrderUseNewClassPrice(int orderId)
{ {
var demodel = orderRepository.GetEntity(orderId); var demodel = orderRepository.GetEntity(orderId);
//查询班级信息 //查询班级信息
......
...@@ -734,7 +734,7 @@ namespace Edu.Module.Course ...@@ -734,7 +734,7 @@ namespace Edu.Module.Course
{ {
detailList.Add(new detailList.Add(new
{ {
CostTypeId = fcmodel.CostTypeId, fcmodel.CostTypeId,
Number = (qitem.CourseHour + qitem.DCourseHour), Number = (qitem.CourseHour + qitem.DCourseHour),
OriginalMoney = qitem.Money, OriginalMoney = qitem.Money,
qitem.UnitPrice, qitem.UnitPrice,
......
...@@ -9,36 +9,71 @@ using Edu.Repository.Finance; ...@@ -9,36 +9,71 @@ using Edu.Repository.Finance;
namespace Edu.Module.Finance namespace Edu.Module.Finance
{ {
/// <summary>
/// 财务处理类
/// </summary>
public class FinanceModule public class FinanceModule
{ {
/// <summary>
/// 财务单据
/// </summary>
private readonly RB_FinanceRepository RB_FinanceRepository = new RB_FinanceRepository();
/// <summary>
/// 财务单据详情
/// </summary>
private readonly RB_FinanceDetailRepository RB_FinanceDetailRepository = new RB_FinanceDetailRepository();
/// <summary>
/// 财务单据模板
/// </summary>
private readonly Rb_Workflow_TemplateRepository Finance_TemplateRepository = new Rb_Workflow_TemplateRepository();
/// <summary>
/// 交易方式
/// </summary>
private readonly RB_TradeWayRepository tradeWayRepository = new RB_TradeWayRepository();
/// <summary>
/// 银行账户
/// </summary>
private readonly RB_BackAccountRepository RB_BackAccountRepository = new RB_BackAccountRepository();
/// <summary>
/// 币种
/// </summary>
private readonly RB_CurrencyRepository RB_CurrencyRepository = new RB_CurrencyRepository();
/// <summary>
/// 现金账户
/// </summary>
private readonly RB_CashAccountRepository cashAccountRepository = new RB_CashAccountRepository();
/// <summary>
/// 资金池账户仓储层对象
/// </summary>
private readonly RB_CashPoolAccountRepository cashPoolAccountRepository = new RB_CashPoolAccountRepository();
/// <summary>
/// 平台账户仓储层对象
/// </summary>
private readonly RB_PlatformAccountRepository platformAccountRepository = new RB_PlatformAccountRepository();
/// <summary>
/// 费用类型仓储层对象
/// </summary>
private readonly RB_CosttypeRepository costtypeRepository = new RB_CosttypeRepository();
/// <summary>
/// 账户类型管理
/// </summary>
private readonly RB_AccountTypeRepository RB_AccountTypeRepository = new RB_AccountTypeRepository();
/// <summary>
/// 财务单据凭证仓储层对象
/// </summary>
private readonly RB_VoucherRepository voucherRepository = new RB_VoucherRepository();
//财务单据
private RB_FinanceRepository RB_FinanceRepository = new RB_FinanceRepository();
//财务单据详情
private RB_FinanceDetailRepository RB_FinanceDetailRepository = new RB_FinanceDetailRepository();
//财务单据模板
private Rb_Workflow_TemplateRepository Finance_TemplateRepository = new Rb_Workflow_TemplateRepository();
//交易方式
private RB_TradeWayRepository tradeWayRepository = new RB_TradeWayRepository();
//银行账户
private RB_BackAccountRepository RB_BackAccountRepository = new RB_BackAccountRepository();
//币种
private RB_CurrencyRepository RB_CurrencyRepository = new RB_CurrencyRepository();
//现金账户
private RB_CashAccountRepository cashAccountRepository = new RB_CashAccountRepository();
//
private RB_CashPoolAccountRepository cashPoolAccountRepository = new RB_CashPoolAccountRepository();
//
private RB_PlatformAccountRepository platformAccountRepository = new RB_PlatformAccountRepository();
private RB_CosttypeRepository costtypeRepository = new RB_CosttypeRepository();
//账户类型管理
private RB_AccountTypeRepository RB_AccountTypeRepository = new RB_AccountTypeRepository();
private RB_VoucherRepository voucherRepository = new RB_VoucherRepository();
public List<RB_Finance_Extend> GetFinanceInfoList(RB_Finance_Extend model) public List<RB_Finance_Extend> GetFinanceInfoList(RB_Finance_Extend model)
{ {
......
...@@ -10,6 +10,9 @@ using Edu.Model.ViewModel.User; ...@@ -10,6 +10,9 @@ using Edu.Model.ViewModel.User;
namespace Edu.Module.Log namespace Edu.Module.Log
{ {
/// <summary>
/// 用户信息改变日志处理类
/// </summary>
public class UserChangeLogModule public class UserChangeLogModule
{ {
/// <summary> /// <summary>
......
...@@ -1291,7 +1291,7 @@ namespace Edu.Module.OKR ...@@ -1291,7 +1291,7 @@ namespace Edu.Module.OKR
//组装sql语句 //组装sql语句
string sql = $@" select {way}({ruleModel.Field}) from {ruleModel.DataBase}.{ruleModel.Table} string sql = $@" select {way}({ruleModel.Field}) from {ruleModel.DataBase}.{ruleModel.Table}
where {ruleModel.State} and {ruleModel.Identity} in({string.Join(",", empIdList)}) where {ruleModel.State} and {ruleModel.Identity} in({string.Join(",", empIdList)})
and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ruleModel.Time} <='{dmodel.RuleETime.Value.ToString("yyyy-MM-dd HH:mm:ss")}'"; and {ruleModel.Time} >='{dmodel.RuleSTime.Value:yyyy-MM-dd}' and {ruleModel.Time} <='{dmodel.RuleETime.Value:yyyy-MM-dd HH:mm:ss}'";
//查询sql值 //查询sql值
var obj = oKR_RuleRepository.ExecuteScalar(sql); var obj = oKR_RuleRepository.ExecuteScalar(sql);
decimal CurrentValue = obj == null ? 0 : Convert.ToDecimal(obj); decimal CurrentValue = obj == null ? 0 : Convert.ToDecimal(obj);
...@@ -7376,13 +7376,15 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -7376,13 +7376,15 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
} }
//查询目标状态 //查询目标状态
List<object> ObjectiveState = new List<object>(); List<object> ObjectiveState = new List<object>
ObjectiveState.Add(new
{ {
ProgressState = 0, new
Name = "未更新", {
Number = olist.Where(x => x.IsUpdated != 1).Count() ProgressState = 0,
}); Name = "未更新",
Number = olist.Where(x => x.IsUpdated != 1).Count()
}
};
var ProgressStateList = EnumHelper.EnumToList(typeof(Common.Enum.OKR.ProgressStateEnum)); var ProgressStateList = EnumHelper.EnumToList(typeof(Common.Enum.OKR.ProgressStateEnum));
foreach (var item in ProgressStateList) foreach (var item in ProgressStateList)
{ {
...@@ -8562,9 +8564,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8562,9 +8564,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
List<int> ManagerIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ManagerIds + "]"); List<int> ManagerIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ManagerIds + "]");
ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList(); ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList();
} }
int PeopleNum = 0, Type = 1; GetProbabilityDeptRate(RList, LastRList, item, selectType, out int PeopleNum, out decimal nowRate, out decimal lastRate, out int Type, out decimal UpRate);
decimal nowRate = 0, lastRate = 0, UpRate = 0;
GetProbabilityDeptRate(RList, LastRList, item, selectType, out PeopleNum, out nowRate, out lastRate, out Type, out UpRate);
Rlist.Add(new Rlist.Add(new
{ {
item.DeptId, item.DeptId,
...@@ -8608,9 +8608,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8608,9 +8608,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
List<int> ManagerIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ManagerIds + "]"); List<int> ManagerIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ManagerIds + "]");
ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList(); ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList();
} }
int PeopleNum = 0, Type = 1; GetProbabilityDeptRate(RList, LastRList, item, selectType, out int PeopleNum, out decimal nowRate, out decimal lastRate, out int Type, out decimal UpRate);
decimal nowRate = 0, lastRate = 0, UpRate = 0;
GetProbabilityDeptRate(RList, LastRList, item, selectType, out PeopleNum, out nowRate, out lastRate, out Type, out UpRate);
Rlist.Add(new Rlist.Add(new
{ {
item.DeptId, item.DeptId,
...@@ -8656,9 +8654,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8656,9 +8654,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
List<int> ManagerIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ManagerIds + "]"); List<int> ManagerIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ManagerIds + "]");
ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList(); ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList();
} }
int PeopleNum = 0, Type = 1; GetProbabilityDeptRate(RList, LastRList, item, selectType, out int PeopleNum, out decimal nowRate, out decimal lastRate, out int Type, out decimal UpRate);
decimal nowRate = 0, lastRate = 0, UpRate = 0;
GetProbabilityDeptRate(RList, LastRList, item, selectType, out PeopleNum, out nowRate, out lastRate, out Type, out UpRate);
Rlist.Add(new Rlist.Add(new
{ {
item.DeptId, item.DeptId,
...@@ -8707,9 +8703,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8707,9 +8703,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
List<int> ManagerIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ManagerIds + "]"); List<int> ManagerIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ManagerIds + "]");
ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList(); ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList();
} }
int PeopleNum = 0, Type = 1; GetProbabilityDeptRate(RList, LastRList, item, selectType, out int PeopleNum, out decimal nowRate, out decimal lastRate, out int Type, out decimal UpRate);
decimal nowRate = 0, lastRate = 0, UpRate = 0;
GetProbabilityDeptRate(RList, LastRList, item, selectType, out PeopleNum, out nowRate, out lastRate, out Type, out UpRate);
Rlist.Add(new Rlist.Add(new
{ {
item.DeptId, item.DeptId,
...@@ -8755,9 +8749,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru ...@@ -8755,9 +8749,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
List<int> ManagerIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ManagerIds + "]"); List<int> ManagerIdList = JsonHelper.DeserializeObject<List<int>>("[" + item.ManagerIds + "]");
ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList(); ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList();
} }
int PeopleNum = 0, Type = 1; GetProbabilityDeptRate(RList, LastRList, item, selectType, out int PeopleNum, out decimal nowRate, out decimal lastRate, out int Type, out decimal UpRate);
decimal nowRate = 0, lastRate = 0, UpRate = 0;
GetProbabilityDeptRate(RList, LastRList, item, selectType, out PeopleNum, out nowRate, out lastRate, out Type, out UpRate);
Rlist.Add(new Rlist.Add(new
{ {
item.DeptId, item.DeptId,
......
...@@ -6,11 +6,16 @@ using VT.FW.DB; ...@@ -6,11 +6,16 @@ using VT.FW.DB;
namespace Edu.Module.Public namespace Edu.Module.Public
{ {
/// <summary>
/// 公共处理类
/// </summary>
public class PublicModule public class PublicModule
{ {
/// <summary>
/// 上传配置仓储层对象
/// </summary>
private readonly RB_File_StoreRepository storeRepository = new RB_File_StoreRepository(); private readonly RB_File_StoreRepository storeRepository = new RB_File_StoreRepository();
#region 上传设置 #region 上传设置
/// <summary> /// <summary>
/// 获取上传存储信息 /// 获取上传存储信息
......
...@@ -24,7 +24,6 @@ namespace Edu.Module.Question ...@@ -24,7 +24,6 @@ namespace Edu.Module.Question
/// </summary> /// </summary>
private readonly RB_QuestionRepository questionRepository = new RB_QuestionRepository(); private readonly RB_QuestionRepository questionRepository = new RB_QuestionRepository();
/// <summary> /// <summary>
/// 知识点仓储层对象 /// 知识点仓储层对象
/// </summary> /// </summary>
......
using Edu.AOP.CustomerAttribute; using Edu.AOP.CustomerAttribute;
using Edu.Common.Enum;
using Edu.Model.ViewModel.System; using Edu.Model.ViewModel.System;
using Edu.Repository.System; using Edu.Repository.System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using VT.FW.DB; using VT.FW.DB;
......
...@@ -81,7 +81,7 @@ namespace Edu.Module.User ...@@ -81,7 +81,7 @@ namespace Edu.Module.User
} }
if (!string.IsNullOrEmpty(persionName) && persionName != "") if (!string.IsNullOrEmpty(persionName) && persionName != "")
{ {
persionName = persionName.Substring(1); persionName = persionName[1..];
} }
item.ManagerName = persionName; item.ManagerName = persionName;
item.DeptPostList = deptPostList?.Where(qitem => qitem.Dept_Id == item.DeptId)?.ToList() ?? new List<RB_Department_Post_ViewModel>(); item.DeptPostList = deptPostList?.Where(qitem => qitem.Dept_Id == item.DeptId)?.ToList() ?? new List<RB_Department_Post_ViewModel>();
......
...@@ -169,7 +169,7 @@ namespace Edu.Module.User ...@@ -169,7 +169,7 @@ namespace Edu.Module.User
} }
if (askType != "") if (askType != "")
{ {
description += askType.Substring(0, askType.Length - 1); description += askType[0..^1];
} }
description += " 并且 "; description += " 并且 ";
} }
......
...@@ -4086,7 +4086,7 @@ namespace Edu.Module.User ...@@ -4086,7 +4086,7 @@ namespace Edu.Module.User
return ApiResult.Failed("当前审核人不存在,请核实后再试!"); return ApiResult.Failed("当前审核人不存在,请核实后再试!");
} }
ToAuditStr = ToAuditStr.Replace("," + empId + ",", "," + CareOfEmId + ","); ToAuditStr = ToAuditStr.Replace("," + empId + ",", "," + CareOfEmId + ",");
ToAuditStr = ToAuditStr.Substring(1, ToAuditStr.Length - 2); ToAuditStr = ToAuditStr[1..^1];
#region 更新审核关联表转交 #region 更新审核关联表转交
fileds = new Dictionary<string, object> fileds = new Dictionary<string, object>
{ {
......
...@@ -85,6 +85,11 @@ WHERE 1=1 ...@@ -85,6 +85,11 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Course_Offer_ViewModel.CreateTime), query.QEnd); builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Course_Offer_ViewModel.CreateTime), query.QEnd);
} }
if (!string.IsNullOrEmpty(query.SerialNum))
{
builder.AppendFormat(" AND A.{0} LIKE @SerialNum ", nameof(RB_Course_Offer_ViewModel.SerialNum));
parameters.Add("SerialNum", "%" + query.SerialNum.Trim() + "%");
}
} }
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Course_Offer_ViewModel.Id)); builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Course_Offer_ViewModel.Id));
return GetPage<RB_Course_Offer_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return GetPage<RB_Course_Offer_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......
...@@ -8,6 +8,9 @@ using Edu.Model.ViewModel.Finance; ...@@ -8,6 +8,9 @@ using Edu.Model.ViewModel.Finance;
namespace Edu.Repository.Finance namespace Edu.Repository.Finance
{ {
/// <summary>
/// 费用类型仓储层
/// </summary>
public class RB_CosttypeRepository : BaseRepository<RB_Costtype> public class RB_CosttypeRepository : BaseRepository<RB_Costtype>
{ {
/// <summary> /// <summary>
......
...@@ -8,7 +8,10 @@ using Edu.Model.ViewModel.Finance; ...@@ -8,7 +8,10 @@ using Edu.Model.ViewModel.Finance;
namespace Edu.Repository.Finance namespace Edu.Repository.Finance
{ {
public class RB_PlatformAccountRepository:BaseRepository<RB_PlatformAccount> /// <summary>
/// 平台账户仓储层
/// </summary>
public class RB_PlatformAccountRepository:BaseRepository<RB_PlatformAccount>
{ {
/// <summary> /// <summary>
......
...@@ -7,6 +7,9 @@ using Edu.Model.ViewModel.Finance; ...@@ -7,6 +7,9 @@ using Edu.Model.ViewModel.Finance;
namespace Edu.Repository.Finance namespace Edu.Repository.Finance
{ {
/// <summary>
/// 财务单据凭证仓储层
/// </summary>
public class RB_VoucherRepository : BaseRepository<RB_Voucher> public class RB_VoucherRepository : BaseRepository<RB_Voucher>
{ {
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Oss\" /> <Compile Remove="Oss\**" />
<EmbeddedResource Remove="Oss\**" />
<None Remove="Oss\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Cors; ...@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace Edu.WebApi.Controllers.Course namespace Edu.WebApi.Controllers.Course
{ {
...@@ -44,7 +45,8 @@ namespace Edu.WebApi.Controllers.Course ...@@ -44,7 +45,8 @@ namespace Edu.WebApi.Controllers.Course
CustomerInfo = base.ParmJObj.GetStringValue("CustomerInfo"), CustomerInfo = base.ParmJObj.GetStringValue("CustomerInfo"),
CustomerSource = (CustomerSourceEnum)base.ParmJObj.GetInt("CustomerSource"), CustomerSource = (CustomerSourceEnum)base.ParmJObj.GetInt("CustomerSource"),
CustomerType = (CustomerTypeEnum)base.ParmJObj.GetInt("CustomerType"), CustomerType = (CustomerTypeEnum)base.ParmJObj.GetInt("CustomerType"),
CustomerStatus = (CustomerStatusEnum)base.ParmJObj.GetInt("CustomerStatus") CustomerStatus = (CustomerStatusEnum)base.ParmJObj.GetInt("CustomerStatus"),
SerialNum=base.ParmJObj.GetStringValue("SerialNum")
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id; query.School_Id = base.UserInfo.School_Id;
...@@ -61,7 +63,30 @@ namespace Edu.WebApi.Controllers.Course ...@@ -61,7 +63,30 @@ namespace Edu.WebApi.Controllers.Course
} }
} }
pageModel.Count = rowsCount; pageModel.Count = rowsCount;
pageModel.PageData = list; pageModel.PageData = list.Select(qitem => new
{
qitem.Id,
qitem.SerialNum,
qitem.Name,
EffectiveStart = qitem.EffectiveStartStr,
EffectiveEnd = qitem.EffectiveEndStr,
qitem.CustomerType,
qitem.CustomerTypeName,
qitem.CustomerSource,
qitem.CustomerSourceName,
qitem.TotalOriginalPrice,
qitem.TotalPrice,
qitem.TotalDiscountPrice,
qitem.CustomerStatus,
qitem.CustomerStatusName,
qitem.CustomerInfo,
qitem.CreateBy,
qitem.CreateByName,
qitem.CreateTimeStr,
qitem.UpdateBy,
qitem.UpdateByName,
qitem.UpdateTimeStr,
});
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
} }
...@@ -145,7 +170,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -145,7 +170,7 @@ namespace Edu.WebApi.Controllers.Course
extModel?.CustomerInfo, extModel?.CustomerInfo,
extModel?.CustomerStatus, extModel?.CustomerStatus,
extModel?.CreateBy, extModel?.CreateBy,
extModel?.CreateByName, CreateByName= extModel.CreateBy>0 ? UserReidsCache.GetUserLoginInfo(extModel.CreateBy)?.AccountName ?? "":"",
extModel?.SerialNum, extModel?.SerialNum,
OfferDetails = extModel?.OfferDetails ?? new List<RB_Course_OfferDetails_ViewModel>() OfferDetails = extModel?.OfferDetails ?? new List<RB_Course_OfferDetails_ViewModel>()
}; };
......
...@@ -710,7 +710,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -710,7 +710,7 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
bool flag = orderModule.SetClassOrderUseNewClassPrice(OrderId, userInfo); bool flag = orderModule.SetClassOrderUseNewClassPrice(OrderId);
if (flag) if (flag)
{ {
return ApiResult.Success(); return ApiResult.Success();
......
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