Commit 37d43a91 authored by 黄奎's avatar 黄奎

新增实体类

parent a8401417
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.StudyAbroad
{
/// <summary>
/// 留学就业实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_StudyAbroad
{
/// <summary>
/// 项目编号(主键编号)
/// </summary>
public int Id { get; set; }
/// <summary>
/// 类别(1-留学,2-就业)
/// </summary>
public int Type { get; set; }
/// <summary>
/// 项目名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 供应编号
/// </summary>
public int SupplierId { get; set; }
/// <summary>
/// 供应商合同(url)
/// </summary>
public string SupplierContract { get; set; }
/// <summary>
/// 佣金利润说明
/// </summary>
public string CommissionProfits { get; set; }
/// <summary>
/// 卖价
/// </summary>
public decimal SellPrice { get; set; }
/// <summary>
/// 直接成本价
/// </summary>
public decimal CostPrice { get; set; }
/// <summary>
/// 成本价包含内容
/// </summary>
public string CostInfo { get; set; }
/// <summary>
/// 同行返佣
/// </summary>
public decimal B2BCommission { get; set; }
/// <summary>
/// 同行返佣类型(0-价格,1-比例)
/// </summary>
public int B2BCommissionType { get; set; }
/// <summary>
/// 销售返佣
/// </summary>
public decimal SaleCommission { get; set; }
/// <summary>
/// 销售返佣类型(0-价格,1-比例)
/// </summary>
public int SaleCommissionType { get; set; }
/// <summary>
/// 校企报价
/// </summary>
public decimal OfferPrice { get; set; }
/// <summary>
/// 校企报价返佣类型(0-价格,1-比例)
/// </summary>
public int OfferCommissionType { get; set; }
/// <summary>
/// 校企返佣金额
/// </summary>
public decimal OfferCommission { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 销售状态(0-待完善,1-上架审核中,2-上架)
/// </summary>
public int SaleState { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
}
}
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.StudyAbroad
{
/// <summary>
/// 供应商实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Supplier
{
/// <summary>
/// 供应商编号(主键)
/// </summary>
public int Id { get; set; }
/// <summary>
/// 供应商类型
/// </summary>
public int Type { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
}
}
using Edu.Model.Entity.StudyAbroad;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.StudyAbroad
{
/// <summary>
/// 留学就业视图实体类
/// </summary>
public class RB_StudyAbroad_ViewModel : RB_StudyAbroad
{
}
}
using Edu.Model.Entity.StudyAbroad;
namespace Edu.Model.ViewModel.StudyAbroad
{
/// <summary>
/// 供应商视图实体类
/// </summary>
public class RB_Supplier_ViewModel : RB_Supplier
{
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Edu.Aop\Edu.Aop.csproj" />
<ProjectReference Include="..\Edu.Common\Edu.Common.csproj" />
<ProjectReference Include="..\Edu.Model\Edu.Model.csproj" />
<ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" />
</ItemGroup>
</Project>
using Edu.Model.ViewModel.StudyAbroad;
using Edu.Repository.StudyAbroad;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Module.StudyAbroad
{
/// <summary>
/// 留学就业处理类
/// </summary>
public class StudyAbroadModule
{
/// <summary>
/// 留学就业仓储层对象
/// </summary>
private readonly RB_StudyAbroadRepository studyAbroadRepository = new RB_StudyAbroadRepository();
/// <summary>
/// 获取留学就业分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_StudyAbroad_ViewModel> GetStudyAbroadPageModule(int pageIndex, int pageSize, out long rowsCount, RB_StudyAbroad_ViewModel query)
{
return studyAbroadRepository.GetStudyAbroadPageRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 获取留学就业列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_StudyAbroad_ViewModel> GetStudyAbroadListModule(RB_StudyAbroad_ViewModel query)
{
return studyAbroadRepository.GetStudyAbroadListRepository(query);
}
/// <summary>
/// 新增修改留学就业产品
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStudyAbroadModule(RB_StudyAbroad_ViewModel model)
{
bool flag = false;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_StudyAbroad_ViewModel.Type),model.Type},
{ nameof(RB_StudyAbroad_ViewModel.Name),model.Name.Trim()},
};
flag = studyAbroadRepository.Update(fileds, new WhereHelper(nameof(RB_StudyAbroad_ViewModel.Id), model.Id));
}
else
{
var newId = studyAbroadRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 根据编号获取留学就业产品信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_StudyAbroad_ViewModel GetStudyAbroadModule(object Id)
{
return studyAbroadRepository.GetEntity<RB_StudyAbroad_ViewModel>(Id);
}
/// <summary>
/// 更新留学就业产品状态
/// </summary>
/// <param name="Id">供应商编号</param>
/// <param name="Status">状态(0-正常,1-删除)</param>
/// <returns></returns>
public bool RemoveStudyAbroadModule(int Id, int Status)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_StudyAbroad_ViewModel.Status),Status},
};
bool flag = studyAbroadRepository.Update(fileds, new WhereHelper(nameof(RB_StudyAbroad_ViewModel.Id), Id));
return flag;
}
}
}
using Edu.Model.ViewModel.StudyAbroad;
using Edu.Repository.StudyAbroad;
using System.Collections.Generic;
using VT.FW.DB;
namespace Edu.Module.StudyAbroad
{
/// <summary>
/// 供应商处理类
/// </summary>
public class SupplierModule
{
/// <summary>
/// 供应商仓储层对象
/// </summary>
private readonly RB_SupplierRepository supplierRepository = new RB_SupplierRepository();
/// <summary>
/// 获取供应商分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Supplier_ViewModel> GetSupplierPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Supplier_ViewModel query)
{
return supplierRepository.GetSupplierPageRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 获取供应商列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Supplier_ViewModel> GetSupplierListModule(RB_Supplier_ViewModel query)
{
return supplierRepository.GetSupplierListRepository(query);
}
/// <summary>
/// 新增修改供应商
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetSupplierModule(RB_Supplier_ViewModel model)
{
bool flag = false;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Supplier_ViewModel.Type),model.Type},
{ nameof(RB_Supplier_ViewModel.Name),model.Name.Trim()},
};
flag = supplierRepository.Update(fileds, new WhereHelper(nameof(RB_Supplier_ViewModel.Id), model.Id));
}
else
{
var newId = supplierRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 获取供应商信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Supplier_ViewModel GetSupplierModule(object Id)
{
return supplierRepository.GetEntity<RB_Supplier_ViewModel>(Id);
}
/// <summary>
/// 更新供应商状态
/// </summary>
/// <param name="Id">供应商编号</param>
/// <param name="Status">状态(0-正常,1-删除)</param>
/// <returns></returns>
public bool RemoveSupplierModule(int Id, int Status)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Supplier_ViewModel.Status),Status},
};
bool flag = supplierRepository.Update(fileds, new WhereHelper(nameof(RB_Supplier_ViewModel.Id), Id));
return flag;
}
}
}
using Edu.Common.Enum;
using Edu.Model.Entity.StudyAbroad;
using Edu.Model.ViewModel.StudyAbroad;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.StudyAbroad
{
/// <summary>
/// 留学就业仓储层
/// </summary>
public class RB_StudyAbroadRepository : BaseRepository<RB_StudyAbroad>
{
/// <summary>
/// 获取留学就业分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_StudyAbroad_ViewModel> GetStudyAbroadPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_StudyAbroad_ViewModel query)
{
rowsCount = 0;
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_StudyAbroad AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_StudyAbroad_ViewModel>();
}
else
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_StudyAbroad_ViewModel.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
return GetPage<RB_StudyAbroad_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
/// <summary>
/// 获取留学就业列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_StudyAbroad_ViewModel> GetStudyAbroadListRepository(RB_StudyAbroad_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_StudyAbroad AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_StudyAbroad_ViewModel>();
}
else
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_StudyAbroad_ViewModel.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
return Get<RB_StudyAbroad_ViewModel>(builder.ToString(), parameters).ToList();
}
}
}
}
using Edu.Common.Enum;
using Edu.Model.Entity.StudyAbroad;
using Edu.Model.ViewModel.StudyAbroad;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.StudyAbroad
{
/// <summary>
/// 供应商仓储层
/// </summary>
public class RB_SupplierRepository : BaseRepository<RB_Supplier>
{
/// <summary>
/// 获取供应商分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Supplier_ViewModel> GetSupplierPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Supplier_ViewModel query)
{
rowsCount = 0;
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Supplier AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_Supplier_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_Supplier_ViewModel>();
}
else
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_Supplier_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Supplier_ViewModel.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
return GetPage<RB_Supplier_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
/// <summary>
/// 获取供应商列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Supplier_ViewModel> GetSupplierListRepository(RB_Supplier_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Supplier AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_Supplier_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_Supplier_ViewModel>();
}
else
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_Supplier_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Supplier_ViewModel.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
return Get<RB_Supplier_ViewModel>(builder.ToString(), parameters).ToList();
}
}
}
}
\ No newline at end of file
using Edu.Module.StudyAbroad;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Edu.WebApi.Controllers.StudyAbroad
{
/// <summary>
/// 留学就业控制器相关
/// </summary>
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class StudyAbroadController : BaseController
{
/// <summary>
/// 留学就业处理对象
/// </summary>
private readonly StudyAbroadModule studyAbroadModule = new StudyAbroadModule();
/// <summary>
/// 供应商处理对象
/// </summary>
private readonly SupplierModule supplierModule = new SupplierModule();
}
}
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<ProjectReference Include="..\Edu.Module.OKR\Edu.Module.OKR.csproj" /> <ProjectReference Include="..\Edu.Module.OKR\Edu.Module.OKR.csproj" />
<ProjectReference Include="..\Edu.Module.Public\Edu.Module.Public.csproj" /> <ProjectReference Include="..\Edu.Module.Public\Edu.Module.Public.csproj" />
<ProjectReference Include="..\Edu.Module.Question\Edu.Module.Question.csproj" /> <ProjectReference Include="..\Edu.Module.Question\Edu.Module.Question.csproj" />
<ProjectReference Include="..\Edu.Module.StudyAbroad\Edu.Module.StudyAbroad.csproj" />
<ProjectReference Include="..\Edu.Module.System\Edu.Module.System.csproj" /> <ProjectReference Include="..\Edu.Module.System\Edu.Module.System.csproj" />
<ProjectReference Include="..\Edu.Module.User\Edu.Module.User.csproj" /> <ProjectReference Include="..\Edu.Module.User\Edu.Module.User.csproj" />
<ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" /> <ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" />
......
...@@ -56,6 +56,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.OKR", "Edu.Modul ...@@ -56,6 +56,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.OKR", "Edu.Modul
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Test", "Edu.Test\Edu.Test.csproj", "{672E00D8-BF3A-43D0-81DF-A7A70E28DD92}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Test", "Edu.Test\Edu.Test.csproj", "{672E00D8-BF3A-43D0-81DF-A7A70E28DD92}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edu.Module.StudyAbroad", "Edu.Module.StudyAbroad\Edu.Module.StudyAbroad.csproj", "{2ED4527A-351A-49C0-94E0-D926F6EE2844}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -130,6 +132,10 @@ Global ...@@ -130,6 +132,10 @@ Global
{672E00D8-BF3A-43D0-81DF-A7A70E28DD92}.Debug|Any CPU.Build.0 = Debug|Any CPU {672E00D8-BF3A-43D0-81DF-A7A70E28DD92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{672E00D8-BF3A-43D0-81DF-A7A70E28DD92}.Release|Any CPU.ActiveCfg = Release|Any CPU {672E00D8-BF3A-43D0-81DF-A7A70E28DD92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{672E00D8-BF3A-43D0-81DF-A7A70E28DD92}.Release|Any CPU.Build.0 = Release|Any CPU {672E00D8-BF3A-43D0-81DF-A7A70E28DD92}.Release|Any CPU.Build.0 = Release|Any CPU
{2ED4527A-351A-49C0-94E0-D926F6EE2844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2ED4527A-351A-49C0-94E0-D926F6EE2844}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2ED4527A-351A-49C0-94E0-D926F6EE2844}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2ED4527A-351A-49C0-94E0-D926F6EE2844}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
...@@ -150,6 +156,7 @@ Global ...@@ -150,6 +156,7 @@ Global
{A737D901-5EC5-4593-867A-899482FAA67A} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915} {A737D901-5EC5-4593-867A-899482FAA67A} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
{FF7B1BD4-0F06-4D22-91EB-9140E65A87AE} = {5B0BC66C-B15F-4174-8966-0968C61F816F} {FF7B1BD4-0F06-4D22-91EB-9140E65A87AE} = {5B0BC66C-B15F-4174-8966-0968C61F816F}
{DA20EF60-D6D6-4EE3-950B-96F231A2F6F2} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915} {DA20EF60-D6D6-4EE3-950B-96F231A2F6F2} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
{2ED4527A-351A-49C0-94E0-D926F6EE2844} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8763B446-FAB1-46BF-9743-F2628533241B} SolutionGuid = {8763B446-FAB1-46BF-9743-F2628533241B}
......
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