Commit 9c2edb14 authored by 黄奎's avatar 黄奎

新增字段

parent ccc9b6ae
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Sale
{
/// <summary>
/// 供应商类型枚举
/// </summary>
public enum SupplierTypeEnum
{
/// <summary>
/// 私塾
/// </summary>
[EnumField("私塾")]
PrivateSchool = 1,
/// <summary>
/// 语言学校
/// </summary>
[EnumField("语言学校")]
LanguageSchool = 2,
/// <summary>
/// 研究生项目
/// </summary>
[EnumField("研究生项目")]
GraduatePrograms = 3,
/// <summary>
/// 就业
/// </summary>
[EnumField("就业")]
ObtainEmployment = 4,
/// <summary>
/// 别科
/// </summary>
[EnumField("别科")]
OtherBranches = 5,
}
}
using Edu.Common.Enum;
using Edu.Common.Enum.Sale;
using System;
using VT.FW.DB;
......@@ -19,7 +20,7 @@ namespace Edu.Model.Entity.StudyAbroad
/// <summary>
/// 供应商类型
/// </summary>
public int Type { get; set; }
public SupplierTypeEnum Type { get; set; }
/// <summary>
/// 供应商名称
......@@ -80,5 +81,15 @@ namespace Edu.Model.Entity.StudyAbroad
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 返佣类型(0-百分比,1-固定金额)
/// </summary>
public int CommissionType { get; set; }
/// <summary>
/// 返佣值
/// </summary>
public decimal CommissionMoney { get; set; }
}
}
......@@ -56,6 +56,8 @@ namespace Edu.Module.StudyAbroad
{ nameof(RB_Supplier_ViewModel.LinkTel),model.LinkTel},
{ nameof(RB_Supplier_ViewModel.LinkAddress),model.LinkAddress},
{ nameof(RB_Supplier_ViewModel.Remark),model.Remark},
{ nameof(RB_Supplier_ViewModel.CommissionType),model.CommissionType},
{ nameof(RB_Supplier_ViewModel.CommissionMoney),model.CommissionMoney},
};
flag = supplierRepository.Update(fileds, new WhereHelper(nameof(RB_Supplier_ViewModel.Id), model.Id));
}
......
......@@ -48,6 +48,10 @@ WHERE 1=1
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Supplier_ViewModel.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
if (query.Type > 0)
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_Supplier_ViewModel.Type),(int)query.Type);
}
return GetPage<RB_Supplier_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
......@@ -82,6 +86,10 @@ WHERE 1=1
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Supplier_ViewModel.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
if (query.Type > 0)
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_Supplier_ViewModel.Type), (int)query.Type);
}
return Get<RB_Supplier_ViewModel>(builder.ToString(), parameters).ToList();
}
}
......
......@@ -46,6 +46,7 @@ namespace Edu.WebApi.Controllers.StudyAbroad
var query = new RB_Supplier_ViewModel()
{
Name = base.ParmJObj.GetStringValue("Name"),
Type=(SupplierTypeEnum)base.ParmJObj.GetInt("Type"),
};
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
......@@ -64,12 +65,15 @@ namespace Edu.WebApi.Controllers.StudyAbroad
{
item.Id,
item.Type,
TypeName=Common.Plugin.EnumHelper.ToName(item.Type),
item.Name,
item.LinkMan,
item.LinkTel,
item.LinkAddress,
item.Remark,
item.CreateByName,
item.CommissionType,
item.CommissionMoney,
CreateTimeStr = Common.ConvertHelper.FormatTime(item.CreateTime),
item.UpdateByName,
UpdateTimeStr = Common.ConvertHelper.FormatTime(item.UpdateTime),
......@@ -92,6 +96,7 @@ namespace Edu.WebApi.Controllers.StudyAbroad
var query = new RB_Supplier_ViewModel()
{
Name = base.ParmJObj.GetStringValue("Name"),
Type = (SupplierTypeEnum)base.ParmJObj.GetInt("Type"),
};
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
......@@ -121,7 +126,7 @@ namespace Edu.WebApi.Controllers.StudyAbroad
var extModel = new RB_Supplier_ViewModel()
{
Id = base.ParmJObj.GetInt("Id"),
Type = base.ParmJObj.GetInt("Type"),
Type =(SupplierTypeEnum)base.ParmJObj.GetInt("Type"),
Name = base.ParmJObj.GetStringValue("Name"),
LinkMan = base.ParmJObj.GetStringValue("LinkMan"),
LinkTel = base.ParmJObj.GetStringValue("LinkTel"),
......@@ -133,6 +138,8 @@ namespace Edu.WebApi.Controllers.StudyAbroad
UpdateTime = DateTime.Now,
Group_Id = this.UserInfo.Group_Id,
School_Id = base.ParmJObj.GetInt("School_Id"),
CommissionMoney=base.ParmJObj.GetDecimal("CommissionMoney"),
CommissionType=base.ParmJObj.GetInt("CommissionType"),
};
bool flag = supplierModule.SetSupplierModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
......@@ -156,6 +163,8 @@ namespace Edu.WebApi.Controllers.StudyAbroad
LinkTel = extModel?.LinkTel ?? "",
LinkAddress = extModel?.LinkAddress ?? "",
Remark = extModel?.Remark ?? "",
CommissionType = extModel?.CommissionType ?? 0,
CommissionMoney = extModel?.CommissionMoney ?? 0,
};
return ApiResult.Success(data: obj);
}
......@@ -172,6 +181,17 @@ namespace Edu.WebApi.Controllers.StudyAbroad
var flag = supplierModule.RemoveSupplierModule(Id, Status);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取供应商类型列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetSupplierType()
{
var list = Common.Plugin.EnumHelper.EnumToList(typeof(SupplierTypeEnum));
return ApiResult.Success(data: list);
}
#endregion
#region 留学就业管理
......
@echo off
dotnet publish -o F:\վ\edu_publish -c realease
iisreset /STOP
dotnet publish -o E:\publish\edu.oytour.com -c realease
iisreset /START
exit
\ 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