Commit eda478b4 authored by 黄奎's avatar 黄奎

代码优化

parent ce20880e
......@@ -127,9 +127,7 @@ namespace Edu.Cache.App
Common.Plugin.LogHelper.Write(ex, "GetUserCode");
}
}
return code;
}
}
}
......@@ -224,12 +224,10 @@ namespace Edu.Common
public static string ConvertImageToBase64(string filePath)
{
Image file = Image.FromFile(filePath);
using (MemoryStream memoryStream = new MemoryStream())
{
file.Save(memoryStream, file.RawFormat);
byte[] imageBytes = memoryStream.ToArray();
return Convert.ToBase64String(imageBytes);
}
using MemoryStream memoryStream = new MemoryStream();
file.Save(memoryStream, file.RawFormat);
byte[] imageBytes = memoryStream.ToArray();
return Convert.ToBase64String(imageBytes);
}
/// <summary>
......
This diff is collapsed.
......@@ -19,7 +19,7 @@ namespace Edu.Common.Plugin
{
if (source == null)
{
return default(TOut);
return default;
}
else
{
......
......@@ -51,6 +51,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
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>
......
......@@ -2,7 +2,6 @@
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using Edu.Model.CacheModel;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.User;
using Edu.Repository.Course;
......
......@@ -54,10 +54,7 @@ namespace Edu.Module.Course
/// 课程计划
/// </summary>
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>
......@@ -533,9 +530,8 @@ namespace Edu.Module.Course
/// 设置订单使用最新的班级价格
/// </summary>
/// <param name="orderId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool SetClassOrderUseNewClassPrice(int orderId, UserInfo userInfo)
public bool SetClassOrderUseNewClassPrice(int orderId)
{
var demodel = orderRepository.GetEntity(orderId);
//查询班级信息
......
......@@ -734,7 +734,7 @@ namespace Edu.Module.Course
{
detailList.Add(new
{
CostTypeId = fcmodel.CostTypeId,
fcmodel.CostTypeId,
Number = (qitem.CourseHour + qitem.DCourseHour),
OriginalMoney = qitem.Money,
qitem.UnitPrice,
......
......@@ -9,36 +9,71 @@ using Edu.Repository.Finance;
namespace Edu.Module.Finance
{
/// <summary>
/// 财务处理类
/// </summary>
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)
{
......
......@@ -10,6 +10,9 @@ using Edu.Model.ViewModel.User;
namespace Edu.Module.Log
{
/// <summary>
/// 用户信息改变日志处理类
/// </summary>
public class UserChangeLogModule
{
/// <summary>
......
......@@ -1291,7 +1291,7 @@ namespace Edu.Module.OKR
//组装sql语句
string sql = $@" select {way}({ruleModel.Field}) from {ruleModel.DataBase}.{ruleModel.Table}
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值
var obj = oKR_RuleRepository.ExecuteScalar(sql);
decimal CurrentValue = obj == null ? 0 : Convert.ToDecimal(obj);
......@@ -7376,13 +7376,15 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
//查询目标状态
List<object> ObjectiveState = new List<object>();
ObjectiveState.Add(new
List<object> ObjectiveState = new List<object>
{
ProgressState = 0,
Name = "未更新",
Number = olist.Where(x => x.IsUpdated != 1).Count()
});
new
{
ProgressState = 0,
Name = "未更新",
Number = olist.Where(x => x.IsUpdated != 1).Count()
}
};
var ProgressStateList = EnumHelper.EnumToList(typeof(Common.Enum.OKR.ProgressStateEnum));
foreach (var item in ProgressStateList)
{
......@@ -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 + "]");
ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList();
}
int PeopleNum = 0, Type = 1;
decimal nowRate = 0, lastRate = 0, UpRate = 0;
GetProbabilityDeptRate(RList, LastRList, item, selectType, out PeopleNum, out nowRate, out lastRate, out Type, out UpRate);
GetProbabilityDeptRate(RList, LastRList, item, selectType, out int PeopleNum, out decimal nowRate, out decimal lastRate, out int Type, out decimal UpRate);
Rlist.Add(new
{
item.DeptId,
......@@ -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 + "]");
ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList();
}
int PeopleNum = 0, Type = 1;
decimal nowRate = 0, lastRate = 0, UpRate = 0;
GetProbabilityDeptRate(RList, LastRList, item, selectType, out PeopleNum, out nowRate, out lastRate, out Type, out UpRate);
GetProbabilityDeptRate(RList, LastRList, item, selectType, out int PeopleNum, out decimal nowRate, out decimal lastRate, out int Type, out decimal UpRate);
Rlist.Add(new
{
item.DeptId,
......@@ -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 + "]");
ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList();
}
int PeopleNum = 0, Type = 1;
decimal nowRate = 0, lastRate = 0, UpRate = 0;
GetProbabilityDeptRate(RList, LastRList, item, selectType, out PeopleNum, out nowRate, out lastRate, out Type, out UpRate);
GetProbabilityDeptRate(RList, LastRList, item, selectType, out int PeopleNum, out decimal nowRate, out decimal lastRate, out int Type, out decimal UpRate);
Rlist.Add(new
{
item.DeptId,
......@@ -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 + "]");
ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList();
}
int PeopleNum = 0, Type = 1;
decimal nowRate = 0, lastRate = 0, UpRate = 0;
GetProbabilityDeptRate(RList, LastRList, item, selectType, out PeopleNum, out nowRate, out lastRate, out Type, out UpRate);
GetProbabilityDeptRate(RList, LastRList, item, selectType, out int PeopleNum, out decimal nowRate, out decimal lastRate, out int Type, out decimal UpRate);
Rlist.Add(new
{
item.DeptId,
......@@ -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 + "]");
ManagerList1 = ManagerList.Where(x => ManagerIdList.Contains(x.Id)).ToList();
}
int PeopleNum = 0, Type = 1;
decimal nowRate = 0, lastRate = 0, UpRate = 0;
GetProbabilityDeptRate(RList, LastRList, item, selectType, out PeopleNum, out nowRate, out lastRate, out Type, out UpRate);
GetProbabilityDeptRate(RList, LastRList, item, selectType, out int PeopleNum, out decimal nowRate, out decimal lastRate, out int Type, out decimal UpRate);
Rlist.Add(new
{
item.DeptId,
......
......@@ -6,11 +6,16 @@ using VT.FW.DB;
namespace Edu.Module.Public
{
/// <summary>
/// 公共处理类
/// </summary>
public class PublicModule
{
/// <summary>
/// 上传配置仓储层对象
/// </summary>
private readonly RB_File_StoreRepository storeRepository = new RB_File_StoreRepository();
#region 上传设置
/// <summary>
/// 获取上传存储信息
......
......@@ -24,7 +24,6 @@ namespace Edu.Module.Question
/// </summary>
private readonly RB_QuestionRepository questionRepository = new RB_QuestionRepository();
/// <summary>
/// 知识点仓储层对象
/// </summary>
......
using Edu.AOP.CustomerAttribute;
using Edu.Common.Enum;
using Edu.Model.ViewModel.System;
using Edu.Repository.System;
using System;
using System.Collections.Generic;
using System.Linq;
using VT.FW.DB;
......
......@@ -81,7 +81,7 @@ namespace Edu.Module.User
}
if (!string.IsNullOrEmpty(persionName) && persionName != "")
{
persionName = persionName.Substring(1);
persionName = persionName[1..];
}
item.ManagerName = persionName;
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
}
if (askType != "")
{
description += askType.Substring(0, askType.Length - 1);
description += askType[0..^1];
}
description += " 并且 ";
}
......
......@@ -4086,7 +4086,7 @@ namespace Edu.Module.User
return ApiResult.Failed("当前审核人不存在,请核实后再试!");
}
ToAuditStr = ToAuditStr.Replace("," + empId + ",", "," + CareOfEmId + ",");
ToAuditStr = ToAuditStr.Substring(1, ToAuditStr.Length - 2);
ToAuditStr = ToAuditStr[1..^1];
#region 更新审核关联表转交
fileds = new Dictionary<string, object>
{
......
......@@ -85,6 +85,11 @@ WHERE 1=1
{
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));
return GetPage<RB_Course_Offer_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......
......@@ -8,6 +8,9 @@ using Edu.Model.ViewModel.Finance;
namespace Edu.Repository.Finance
{
/// <summary>
/// 费用类型仓储层
/// </summary>
public class RB_CosttypeRepository : BaseRepository<RB_Costtype>
{
/// <summary>
......
......@@ -8,7 +8,10 @@ using Edu.Model.ViewModel.Finance;
namespace Edu.Repository.Finance
{
public class RB_PlatformAccountRepository:BaseRepository<RB_PlatformAccount>
/// <summary>
/// 平台账户仓储层
/// </summary>
public class RB_PlatformAccountRepository:BaseRepository<RB_PlatformAccount>
{
/// <summary>
......
......@@ -7,6 +7,9 @@ using Edu.Model.ViewModel.Finance;
namespace Edu.Repository.Finance
{
/// <summary>
/// 财务单据凭证仓储层
/// </summary>
public class RB_VoucherRepository : BaseRepository<RB_Voucher>
{
......
......@@ -5,7 +5,9 @@
</PropertyGroup>
<ItemGroup>
<Folder Include="Oss\" />
<Compile Remove="Oss\**" />
<EmbeddedResource Remove="Oss\**" />
<None Remove="Oss\**" />
</ItemGroup>
<ItemGroup>
......
......@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Edu.WebApi.Controllers.Course
{
......@@ -44,7 +45,8 @@ namespace Edu.WebApi.Controllers.Course
CustomerInfo = base.ParmJObj.GetStringValue("CustomerInfo"),
CustomerSource = (CustomerSourceEnum)base.ParmJObj.GetInt("CustomerSource"),
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.School_Id = base.UserInfo.School_Id;
......@@ -61,7 +63,30 @@ namespace Edu.WebApi.Controllers.Course
}
}
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);
}
......@@ -145,7 +170,7 @@ namespace Edu.WebApi.Controllers.Course
extModel?.CustomerInfo,
extModel?.CustomerStatus,
extModel?.CreateBy,
extModel?.CreateByName,
CreateByName= extModel.CreateBy>0 ? UserReidsCache.GetUserLoginInfo(extModel.CreateBy)?.AccountName ?? "":"",
extModel?.SerialNum,
OfferDetails = extModel?.OfferDetails ?? new List<RB_Course_OfferDetails_ViewModel>()
};
......
......@@ -710,7 +710,7 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.ParamIsNull();
}
bool flag = orderModule.SetClassOrderUseNewClassPrice(OrderId, userInfo);
bool flag = orderModule.SetClassOrderUseNewClassPrice(OrderId);
if (flag)
{
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