Commit 264e1f6b authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents c83ed12e f2e16a05
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Customer
{
/// <summary>
/// 客户状态
/// </summary>
public enum CustomerStateEnum
{
/// <summary>
/// 正常
/// </summary>
[EnumField("正常")]
Normal = 1,
/// <summary>
/// 禁用
/// </summary>
[EnumField("禁用")]
Disable = 2,
/// <summary>
/// 删除
/// </summary>
[EnumField("删除")]
Delete = 3,
/// <summary>
/// 未激活
/// </summary>
[EnumField("未激活")]
NotActivation = 4
}
}
using Edu.Common.Plugin;
namespace Edu.Common.Enum.StudyAbroad
{
public enum StudyAbroadProductTypeEnum
{
/// <summary>
/// 公司自有产品
/// </summary>
[EnumField("公司自有产品")]
CompanyProduct = 1,
/// <summary>
/// 公司自有产品
/// </summary>
[EnumField("同业产品")]
B2BProduct = 2,
}
}
using Edu.Common.Enum;
using Edu.Common.Enum.Customer;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 同业客户管理实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Customer
{
/// <summary>
/// 客户资料id
/// </summary>
public int CustomerId { get; set; }
/// <summary>
/// 客户名称
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// 联系电话
/// </summary>
public string ContactNumber { get; set; }
/// <summary>
/// 传真
/// </summary>
public string Fax { get; set; }
/// <summary>
/// 业务QQ
/// </summary>
public string QQ { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string Email { get; set; }
/// <summary>
/// 客户地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 联系人性别 0 未知,1男, 2女
/// </summary>
public int Sex { get; set; }
/// <summary>
/// 图片
/// </summary>
public string Image { get; set; }
/// <summary>
/// 客户来源
/// </summary>
public int CustomerSourceType { get; set; }
/// <summary>
/// 客户来源信息
/// </summary>
public string CustomerSource { get; set; }
/// <summary>
/// 国家id
/// </summary>
public int CountryId { get; set; }
/// <summary>
/// 省id
/// </summary>
public int ProvinceId { get; set; }
/// <summary>
/// 市id
/// </summary>
public int CityId { get; set; }
/// <summary>
/// 区id
/// </summary>
public int DistrictId { get; set; }
/// <summary>
/// 经度纬度
/// </summary>
public string LngLat { get; set; }
/// <summary>
/// 同行幸福存折
/// </summary>
public decimal Client_Balance { get; set; }
/// <summary>
/// 账号
/// </summary>
public string Account { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Password { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { 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>
/// 状态 0正常,1删除
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 账号状态
/// </summary>
public CustomerStateEnum CustomerState { get; set; }
/// <summary>
/// 审批状态 1-审批通过,2-拒绝
/// </summary>
public int ApproveState { get; set; }
/// <summary>
/// 审批意见
/// </summary>
public string ApproveContent { get; set; }
/// <summary>
/// 审核人
/// </summary>
public int ApproveId { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public DateTime ApproveTime { get; set; }
/// <summary>
/// 微信用户OpenId
/// </summary>
public string OpenId { get; set; }
/// <summary>
/// 微信用户UnionId
/// </summary>
public string UnionId { get; set; }
/// <summary>
/// 微信昵称
/// </summary>
public string WeChatName { get; set; }
/// <summary>
/// 头像
/// </summary>
public string WeChatPhoto { get; set; }
}
}
\ No newline at end of file
using Edu.Common.Enum;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 同业客户任务实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Customer_Task
{
/// <summary>
/// 主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 任务名称
/// </summary>
public string TaskName { get; set; }
/// <summary>
/// 任务数量
/// </summary>
public int TaskNum { get; set; }
/// <summary>
/// 任务奖品
/// </summary>
public string TaskKudo { get; set; }
/// <summary>
/// 任务开始时间
/// </summary>
public DateTime TaskStartTime { get; set; }
/// <summary>
/// 任务结束时间
/// </summary>
public DateTime TaskEndTime { 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 System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 同业客户任务详情实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Customer_TaskDetails
{
/// <summary>
/// 任务详情编号
/// </summary>
public int DetailId { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public int TaskId { get; set; }
/// <summary>
/// 任务类型(1-课程)
/// </summary>
public int TaskType { get; set; }
/// <summary>
/// 目标编号
/// </summary>
public int TargetId { get; set; }
}
}
using Edu.Common.Enum;
using Edu.Common.Enum.Sale;
using Edu.Common.Enum.StudyAbroad;
using System;
using VT.FW.DB;
......@@ -137,5 +138,14 @@ namespace Edu.Model.Entity.StudyAbroad
/// </summary>
public string ImgCover { get; set; }
}
/// <summary>
/// 产品类型
/// </summary>
public StudyAbroadProductTypeEnum ProductType { get; set; }
/// <summary>
/// 特色
/// </summary>
public string StudyFeature { get; set; }
}
}
using Edu.Common.Plugin;
using Edu.Model.Entity.Customer;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 同业客户信息扩展实体类
/// </summary>
public class RB_Customer_Extend : RB_Customer
{
/// <summary>
/// 创建人
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTimeStr { get { return Common.ConvertHelper.FormatTime(this.CreateTime); } }
/// <summary>
/// 修改时间
/// </summary>
public string UpdateTimeStr { get { return Common.ConvertHelper.FormatTime(this.UpdateTime); } }
/// <summary>
/// 客户状态
/// </summary>
public string CustomerStateStr
{
get
{
return this.CustomerState.ToName();
}
}
/// <summary>
/// 审核状态
/// </summary>
public string ApproveStateStr
{
get
{
string str = "待审核";
if (this.ApproveState == 0)
{
str = "待审核";
}
else if (this.ApproveState == 1)
{
str = "通过";
}
else
{
str = "拒绝";
}
return str;
}
}
/// <summary>
/// 审核人
/// </summary>
public string ApproveName { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public string ApproveTimeStr { get { return Common.ConvertHelper.FormatTime(this.ApproveTime); } }
}
}
using Edu.Model.Entity.Customer;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 同业客户任务详情扩展实体类
/// </summary>
public class RB_Customer_TaskDetails_Extend: RB_Customer_TaskDetails
{
/// <summary>
/// 任务编号【逗号分割】
/// </summary>
public string QTaskIds { get; set; }
/// <summary>
/// 关联目标名称
/// </summary>
public string TargetName { get; set; }
}
}
using Edu.Model.Entity.Customer;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 同业客户任务扩展实体类
/// </summary>
public class RB_Customer_Task_Extend : RB_Customer_Task
{
/// <summary>
/// 创建人
/// </summary>
public string CreateByName { get; set;}
/// <summary>
/// 任务详情列表
/// </summary>
public List<RB_Customer_TaskDetails_Extend> DetailsList { get; set; }
/// <summary>
/// 任务开始时间
/// </summary>
public string TaskStartTimeStr { get { return Common.ConvertHelper.FormatTime(this.TaskStartTime); } }
/// <summary>
/// 任务结束时间
/// </summary>
public string TaskEndTimeStr { get { return Common.ConvertHelper.FormatTime(this.TaskEndTime); } }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTimeStr { get { return Common.ConvertHelper.FormatTime(this.CreateTime); } }
}
}
......@@ -1569,7 +1569,6 @@ namespace Edu.Module.Course
#endregion
#region 小程序商品
public int SetMallGoods(RB_Course_ViewModel model)
{
......@@ -1744,7 +1743,8 @@ namespace Edu.Module.Course
}
}
else
{ //修改
{
//修改
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Goods.Name),demodel.Name},
{ nameof(RB_Goods.CarouselImage),demodel.CarouselImage},
......
using Edu.Cache.User;
using Edu.Common.Enum;
using Edu.Model.ViewModel.Customer;
using Edu.Repository.Customer;
using System;
using System.Collections.Generic;
using VT.FW.DB;
namespace Edu.Module.Customer
{
/// <summary>
/// 同业客户管理处理类
/// </summary>
public class CustomerModule
{
/// <summary>
/// 同业客户管理仓储层对象
/// </summary>
private readonly RB_CustomerRepository customerRepository = new RB_CustomerRepository();
/// <summary>
/// 获取客户分页列表..
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Extend> GetCustomerPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Customer_Extend query)
{
var list = customerRepository.GetCustomerPageRepository(pageIndex, pageSize, out rowsCount, query);
return list;
}
/// <summary>
/// 新增修改客户资料
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetCustomerModule(RB_Customer_Extend model)
{
bool flag;
if (model.CustomerId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Customer_Extend.CustomerName),model.CustomerName },
{nameof(RB_Customer_Extend.ContactNumber),model.ContactNumber },
{nameof(RB_Customer_Extend.Fax),model.Fax },
{nameof(RB_Customer_Extend.QQ),model.QQ },
{nameof(RB_Customer_Extend.Email),model.Email },
{nameof(RB_Customer_Extend.Address),model.Address },
{nameof(RB_Customer_Extend.Sex),model.Sex },
{nameof(RB_Customer_Extend.CustomerSourceType),model.CustomerSourceType },
{nameof(RB_Customer_Extend.CustomerSource),model.CustomerSource },
{nameof(RB_Customer_Extend.CountryId),model.CountryId },
{nameof(RB_Customer_Extend.ProvinceId),model.ProvinceId },
{nameof(RB_Customer_Extend.CityId),model.CityId },
{nameof(RB_Customer_Extend.DistrictId),model.DistrictId },
{nameof(RB_Customer_Extend.LngLat),model.LngLat },
{nameof(RB_Customer_Extend.Account),model.Account },
{nameof(RB_Customer_Extend.Remark),model.Remark },
{nameof(RB_Customer_Extend.UpdateTime),model.UpdateTime },
};
flag = customerRepository.Update(fileds, new WhereHelper(nameof(RB_Customer_Extend.CustomerId), model.CustomerId));
}
else
{
model.ApproveState = 0;
model.CustomerState = Common.Enum.Customer.CustomerStateEnum.NotActivation;
model.Password = Common.DES.Encrypt(Common.Config.DefaultPwd);
var newId = customerRepository.Insert(model);
model.CustomerId = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 根据编号删除客户信息
/// </summary>
/// <param name="CustomerId"></param>
/// <returns></returns>
public bool RemoveCustomerModule(object CustomerId)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Customer_Extend.Status),(int)DateStateEnum.Delete},
};
var flag = customerRepository.Update(fileds, new WhereHelper(nameof(RB_Customer_Extend.CustomerId), CustomerId));
return flag;
}
/// <summary>
/// 根据客户编号获取客户实体类
/// </summary>
/// <param name="CustomerId"></param>
/// <returns></returns>
public RB_Customer_Extend GetCustomerModule(object CustomerId)
{
var extModel = customerRepository.GetEntity<RB_Customer_Extend>(CustomerId);
if (extModel != null)
{
if (extModel.ApproveId > 0)
{
extModel.ApproveName = UserReidsCache.GetUserLoginInfo(extModel.ApproveId)?.AccountName ?? "";
}
}
return extModel;
}
/// <summary>
/// 客户审批
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool AuditCustomerModule(RB_Customer_Extend model)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Customer_Extend.ApproveState),model.ApproveState},
{nameof(RB_Customer_Extend.ApproveContent),model.ApproveContent},
{nameof(RB_Customer_Extend.ApproveId),model.ApproveId},
{nameof(RB_Customer_Extend.ApproveTime),model.ApproveTime},
};
var flag = customerRepository.Update(fileds, new WhereHelper(nameof(RB_Customer_Extend.CustomerId), model.CustomerId));
return flag;
}
}
}
using Edu.Model.ViewModel.Customer;
using Edu.Repository.Customer;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using VT.FW.DB;
using Edu.Common.Enum;
namespace Edu.Module.Customer
{
/// <summary>
/// 同行任务处理类
/// </summary>
public class CustomerTaskModule
{
/// <summary>
/// 任务仓储层对象
/// </summary>
private readonly RB_Customer_TaskRepository customer_TaskRepository = new RB_Customer_TaskRepository();
/// <summary>
/// 任务详情仓储层对象
/// </summary>
private readonly RB_Customer_TaskDetailsRepository detailsRepository = new RB_Customer_TaskDetailsRepository();
/// <summary>
/// 获取任务分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Task_Extend> GetCustomerTaskPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Customer_Task_Extend query)
{
var list = customer_TaskRepository.GetCustomerTaskPageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
string Ids = string.Join(",", list.Select(qitem => qitem.Id));
var detailsList = new List<RB_Customer_TaskDetails_Extend>();
if (!string.IsNullOrEmpty(Ids))
{
detailsList = detailsRepository.GetCustomerTaskDetailsListRepository(new RB_Customer_TaskDetails_Extend()
{
QTaskIds = Ids
});
}
foreach (var item in list)
{
item.DetailsList = detailsList?.Where(qitem => qitem.TaskId == item.Id)?.ToList();
}
}
return list;
}
/// <summary>
/// 新增修改任务信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetCustomerTaskModule(RB_Customer_Task_Extend model)
{
bool flag = false;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Customer_Task_Extend.TaskName),model.TaskName },
{nameof(RB_Customer_Task_Extend.TaskNum),model.TaskNum },
{nameof(RB_Customer_Task_Extend.TaskKudo),model.TaskKudo },
{nameof(RB_Customer_Task_Extend.TaskStartTime),model.TaskStartTime },
{nameof(RB_Customer_Task_Extend.TaskEndTime),model.TaskEndTime },
{nameof(RB_Customer_Task_Extend.UpdateBy),model.UpdateBy },
{nameof(RB_Customer_Task_Extend.UpdateTime),model.UpdateTime },
};
flag = customer_TaskRepository.Update(fileds, new WhereHelper(nameof(RB_Customer_Task_Extend.Id), model.Id));
}
else
{
var newId = customer_TaskRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
if (model.DetailsList != null && model.DetailsList.Count > 0)
{
var oldList = detailsRepository.GetCustomerTaskDetailsListRepository(new RB_Customer_TaskDetails_Extend() {
TaskId = model.Id
});
//以前没有任务详情信息【直接新增】
if (oldList == null || (oldList != null && oldList.Count == 0))
{
if (model.DetailsList != null && model.DetailsList.Count > 0)
{
foreach (var item in model.DetailsList)
{
item.TaskId = model.Id;
detailsRepository.Insert(item);
}
}
}
else
{
//现在没有任务详情了【直接删除以前的任务详情】
if (model.DetailsList == null || (model.DetailsList != null && model.DetailsList.Count == 0))
{
detailsRepository.DeleteByTaskIdRepository(model.Id);
}
//找出差异的数据
var deleteList = oldList.Where(qitem => !model.DetailsList.Any(oldItem => qitem.DetailId == oldItem.DetailId)).ToList();
foreach (var dItem in deleteList)
{
if (dItem.DetailId > 0)
{
detailsRepository.Delete(dItem.DetailId);
}
}
foreach (var item in model.DetailsList)
{
if (item.DetailId == 0)
{
detailsRepository.Insert(item);
}
else
{
detailsRepository.Update(item);
}
}
}
}
else
{
detailsRepository.DeleteByTaskIdRepository(model.Id);
}
return flag;
}
/// <summary>
/// 根据任务编号删除任务
/// </summary>
/// <param name="CustomerId"></param>
/// <returns></returns>
public bool RemoveCustomerTaskModule(object Id)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Customer_Task_Extend.Status),(int)DateStateEnum.Delete},
};
var flag = customer_TaskRepository.Update(fileds, new WhereHelper(nameof(RB_Customer_Task_Extend.Id), Id));
return flag;
}
/// <summary>
/// 根据任务编号获取任务实体类
/// </summary>
/// <param name="CustomerId"></param>
/// <returns></returns>
public RB_Customer_Task_Extend GetCustomerTaskModule(object Id)
{
var extModel = customer_TaskRepository.GetEntity<RB_Customer_Task_Extend>(Id);
if (extModel != null)
{
extModel.DetailsList = detailsRepository.GetCustomerTaskDetailsListRepository(new RB_Customer_TaskDetails_Extend()
{
TaskId = extModel.Id
});
}
return extModel;
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Edu.Aop\Edu.Aop.csproj" />
<ProjectReference Include="..\Edu.Cache\Edu.Cache.csproj" />
<ProjectReference Include="..\Edu.Common\Edu.Common.csproj" />
<ProjectReference Include="..\Edu.Model\Edu.Model.csproj" />
<ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" />
</ItemGroup>
</Project>
......@@ -152,6 +152,8 @@ namespace Edu.Module.StudyAbroad
{ nameof(RB_StudyAbroad_ViewModel.Remark),model.Remark},
{ nameof(RB_StudyAbroad_ViewModel.School_Id),model.School_Id},
{ nameof(RB_StudyAbroad_ViewModel.ImgCover),model.ImgCover},
{ nameof(RB_StudyAbroad_ViewModel.ProductType),model.ProductType},
{ nameof(RB_StudyAbroad_ViewModel.StudyFeature),model.StudyFeature},
};
flag = studyAbroadRepository.Update(fileds, new WhereHelper(nameof(RB_StudyAbroad_ViewModel.Id), model.Id));
}
......
using Edu.Common.Enum;
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Customer
{
/// <summary>
/// 同业客户管理仓储层
/// </summary>
public class RB_CustomerRepository : BaseRepository<RB_Customer>
{
/// <summary>
/// 获取客户分页列表..
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Extend> GetCustomerPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Customer_Extend query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Customer AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Extend.Group_Id),query.Group_Id);
}
if (!string.IsNullOrEmpty(query.CustomerName))
{
builder.AppendFormat(" AND A.{0} LIKE @CustomerName ", nameof(RB_Customer_Extend.CustomerName));
parameters.Add("CustomerName", "%" + query.CustomerName.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.ContactNumber))
{
builder.AppendFormat(" AND A.{0} LIKE @ContactNumber ", nameof(RB_Customer_Extend.ContactNumber));
parameters.Add("ContactNumber", "%" + query.ContactNumber.Trim() + "%");
}
if (query.ApproveState > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Extend.ApproveState), query.ApproveState);
}
}
return GetPage<RB_Customer_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
}
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Customer
{
/// <summary>
/// 同业客户任务详情仓储层
/// </summary>
public class RB_Customer_TaskDetailsRepository : BaseRepository<RB_Customer_TaskDetails>
{
/// <summary>
/// 获取任务详情列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_TaskDetails_Extend> GetCustomerTaskDetailsListRepository(RB_Customer_TaskDetails_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.CourseName,'') AS TargetName
FROM RB_Customer_TaskDetails AS A LEFT JOIN rb_course AS B ON (A.TargetId=B.CourseId AND A.TaskType=1)
WHERE 1=1
");
if (query != null)
{
if (query.TaskId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Customer_TaskDetails_Extend.TaskId), query.TaskId);
}
if (!string.IsNullOrEmpty(query.QTaskIds))
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Customer_TaskDetails_Extend.TaskId), query.QTaskIds);
}
}
return Get<RB_Customer_TaskDetails_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 根本任务编号删除任务详情
/// </summary>
/// <param name="TaskId"></param>
/// <returns></returns>
public bool DeleteByTaskIdRepository(int TaskId)
{
string sql = string.Format(" DELETE FROM RB_Customer_TaskDetails WHERE TaskId IN({0}) ", TaskId);
return base.Execute(sql) > 0;
}
}
}
using Edu.Common.Enum;
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Customer
{
/// <summary>
/// 同业客户任务仓储层
/// </summary>
public class RB_Customer_TaskRepository : BaseRepository<RB_Customer_Task>
{
/// <summary>
/// 获取任务分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Task_Extend> GetCustomerTaskPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Customer_Task_Extend query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Customer_Task AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Task_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Task_Extend.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.TaskName))
{
builder.AppendFormat(" AND A.{0} LIKE @TaskName ", nameof(RB_Customer_Task_Extend.TaskName));
parameters.Add("TaskName", "%" + query.TaskName.Trim() + "%");
}
}
return GetPage<RB_Customer_Task_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
}
......@@ -92,7 +92,5 @@ namespace Edu.WebApi.Controllers
AppStudentLoginError userInfo = AppStudentReidsCache.GetStudentErrorLogin(Id);
return userInfo;
}
}
}
\ No newline at end of file
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Customer;
using Edu.Module.Customer;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Edu.WebApi.Controllers.Customer
{
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class B2BCustomerController : BaseController
{
/// <summary>
/// 同行管理处理类对象
/// </summary>
private readonly CustomerModule customerModule = new CustomerModule();
/// <summary>
/// 同行任务处理类对象
/// </summary>
private readonly CustomerTaskModule taskModule = new CustomerTaskModule();
#region 同行管理
/// <summary>
/// 获取同行分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCustomerPage()
{
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Customer_Extend()
{
Group_Id = base.UserInfo.Group_Id,
CustomerName = base.ParmJObj.GetStringValue("CustomerName"),
ApproveState=base.ParmJObj.GetInt("ApproveState"),
};
var list = customerModule.GetCustomerPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
}
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 新增修改同业客户资料
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetCustomer()
{
var model = new RB_Customer_Extend()
{
CustomerId = base.ParmJObj.GetInt("CustomerId"),
CustomerName = base.ParmJObj.GetStringValue("CustomerName"),
ContactNumber = base.ParmJObj.GetStringValue("ContactNumber"),
Fax = base.ParmJObj.GetStringValue("Fax"),
QQ = base.ParmJObj.GetStringValue("QQ"),
Email = base.ParmJObj.GetStringValue("Email"),
Address = base.ParmJObj.GetStringValue("Address"),
Sex = base.ParmJObj.GetInt("Sex"),
Image = base.ParmJObj.GetStringValue("Image"),
CustomerSourceType = base.ParmJObj.GetInt("CustomerSourceType"),
CustomerSource = base.ParmJObj.GetStringValue("CustomerSource"),
CountryId = base.ParmJObj.GetInt("CountryId"),
ProvinceId = base.ParmJObj.GetInt("ProvinceId"),
CityId = base.ParmJObj.GetInt("CityId"),
DistrictId = base.ParmJObj.GetInt("DistrictId"),
LngLat = base.ParmJObj.GetStringValue("LngLat"),
Account = base.ParmJObj.GetStringValue("Account"),
Remark = base.ParmJObj.GetStringValue("Remark"),
};
model.Status = Common.Enum.DateStateEnum.Normal;
model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
model.UpdateTime = DateTime.Now;
model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id;
var flag = customerModule.SetCustomerModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号删除客户
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveCustomer()
{
var CustomerId = base.ParmJObj.GetInt("CustomerId");
var flag = customerModule.RemoveCustomerModule(CustomerId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取客户详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCustomer()
{
var CustomerId = base.ParmJObj.GetInt("CustomerId");
var data = customerModule.GetCustomerModule(CustomerId);
return ApiResult.Success(data: data);
}
/// <summary>
/// 客户审批
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult AuditCustomer()
{
var model = new RB_Customer_Extend()
{
CustomerId = base.ParmJObj.GetInt("CustomerId"),
ApproveState = base.ParmJObj.GetInt("ApproveState"),
ApproveContent = base.ParmJObj.GetStringValue("ApproveContent"),
ApproveId = base.UserInfo.Id,
ApproveTime = DateTime.Now
};
var flag = customerModule.AuditCustomerModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
#region 任务管理
/// <summary>
/// 获取同行任务分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCustomerTaskPage()
{
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Customer_Task_Extend()
{
Group_Id = base.UserInfo.Group_Id,
TaskName = base.ParmJObj.GetStringValue("TaskName"),
};
var list = taskModule.GetCustomerTaskPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
}
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 新增修改同业客户资料
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetCustomerTask()
{
var model = new RB_Customer_Task_Extend()
{
Id = base.ParmJObj.GetInt("Id"),
TaskName=base.ParmJObj.GetStringValue("TaskName"),
TaskNum=base.ParmJObj.GetInt("TaskNum"),
TaskKudo=base.ParmJObj.GetStringValue("TaskKudo"),
TaskStartTime=base.ParmJObj.GetDateTime("TaskStartTime"),
TaskEndTime=base.ParmJObj.GetDateTime("TaskEndTime"),
};
model.Status = Common.Enum.DateStateEnum.Normal;
model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
model.UpdateTime = DateTime.Now;
model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id;
model.DetailsList = new List<RB_Customer_TaskDetails_Extend>();
string details = base.ParmJObj.GetStringValue("DetailsList");
if (!string.IsNullOrEmpty(details))
{
JArray jarray = JArray.Parse(details);
if (jarray != null && jarray.Count > 0)
{
foreach (var jItem in jarray)
{
JObject jobj = JObject.Parse(jItem.ToString());
model.DetailsList.Add(new RB_Customer_TaskDetails_Extend()
{
DetailId = jobj.GetInt("DetailId"),
TaskId = jobj.GetInt("TaskId"),
TaskType = jobj.GetInt("TaskType"),
TargetId = jobj.GetInt("TargetId"),
});
}
}
}
var flag = taskModule.SetCustomerTaskModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据任务编号删除任务
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveCustomerTask()
{
var Id = base.ParmJObj.GetInt("Id");
var flag = taskModule.RemoveCustomerTaskModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据任务编号获取任务实体类
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCustomerTask()
{
var Id = base.ParmJObj.GetInt("Id");
var data = taskModule.GetCustomerTaskModule(Id);
return ApiResult.Success(data: data);
}
#endregion
}
}
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Enum.Sale;
using Edu.Common.Enum.StudyAbroad;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.StudyAbroad;
using Edu.Module.StudyAbroad;
......@@ -198,6 +199,12 @@ namespace Edu.WebApi.Controllers.StudyAbroad
#endregion
#region 留学就业管理
[HttpPost]
public ApiResult GetProductTypeList()
{
var list = Common.Plugin.EnumHelper.EnumToList(typeof(StudyAbroadProductTypeEnum));
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取留学就业分页列表
......@@ -270,6 +277,9 @@ namespace Edu.WebApi.Controllers.StudyAbroad
ManagerAuditTime = Common.ConvertHelper.FormatTime(item.ManagerAuditTime),
item.ImgCover,
item.Status,
item.ProductType,
ProductTypeName=item.ProductType.ToName(),
item.StudyFeature,
});
}
pageModel.Count = rowsCount;
......@@ -409,6 +419,8 @@ namespace Edu.WebApi.Controllers.StudyAbroad
Group_Id = this.UserInfo.Group_Id,
School_Id = base.ParmJObj.GetInt("School_Id"),
ImgCover=base.ParmJObj.GetStringValue("ImgCover"),
ProductType=(StudyAbroadProductTypeEnum)base.ParmJObj.GetInt("ProductType"),
StudyFeature=base.ParmJObj.GetStringValue("StudyFeature"),
};
extModel.SaleState =Common.Enum.Sale.SaleStateEnum.NoPerfect;
bool flag = studyAbroadModule.SetStudyAbroadModule(extModel);
......@@ -499,6 +511,8 @@ namespace Edu.WebApi.Controllers.StudyAbroad
ManagerName = UserReidsCache.GetUserLoginInfo(extModel.ManagerId)?.AccountName ?? "",
extModel.PreferentialList,
extModel.ImgCover,
extModel.ProductType,
extModel.StudyFeature,
};
return ApiResult.Success(data: obj);
}
......
......@@ -39,6 +39,7 @@
<ProjectReference Include="..\Edu.Model\Edu.Model.csproj" />
<ProjectReference Include="..\Edu.Module.Advertising\Edu.Module.Advertising.csproj" />
<ProjectReference Include="..\Edu.Module.Course\Edu.Module.Course.csproj" />
<ProjectReference Include="..\Edu.Module.Customer\Edu.Module.Customer.csproj" />
<ProjectReference Include="..\Edu.Module.Duty\Edu.Module.Duty.csproj" />
<ProjectReference Include="..\Edu.Module.EduTask\Edu.Module.EduTask.csproj" />
<ProjectReference Include="..\Edu.Module.Exam\Edu.Module.Exam.csproj" />
......
{
"ConnectionStrings": {
"DefaultConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_edu;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"DefaultConnection": "server=192.168.10.214;user id=reborn;password=Reborn@2018;database=reborn_edu;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"DefaultConnectionPName": "MySql.Data.MySqlClient",
"FinanceConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"FinanceConnection": "server=192.168.10.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"FinanceConnectionPName": "MySql.Data.MySqlClient",
"DataStatisticsConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_datastatistics;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"DataStatisticsConnection": "server=192.168.10.214;user id=reborn;password=Reborn@2018;database=reborn_datastatistics;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"DataStatisticsConnectionPName": "MySql.Data.MySqlClient",
"LogConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_sys;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"LogConnection": "server=192.168.10.214;user id=reborn;password=Reborn@2018;database=reborn_sys;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"LogConnectionPName": "MySql.Data.MySqlClient",
"MallConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"MallConnection": "server=192.168.10.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"MallConnectionPName": "MySql.Data.MySqlClient"
},
"Logging": {
......
......@@ -68,7 +68,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.EduTask", "Edu.M
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.QYWeChat", "Edu.Module.QYWeChat\Edu.Module.QYWeChat.csproj", "{00E05F5A-A5B7-46ED-AE5F-9D54D67FA78F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edu.Module.Exam", "Edu.Module.Exam\Edu.Module.Exam.csproj", "{81C24D63-1109-4476-99AB-590EF54972E5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.Exam", "Edu.Module.Exam\Edu.Module.Exam.csproj", "{81C24D63-1109-4476-99AB-590EF54972E5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edu.Module.Customer", "Edu.Module.Customer\Edu.Module.Customer.csproj", "{11365608-C76C-4CF7-9DBE-78A61A934448}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -172,6 +174,10 @@ Global
{81C24D63-1109-4476-99AB-590EF54972E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81C24D63-1109-4476-99AB-590EF54972E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81C24D63-1109-4476-99AB-590EF54972E5}.Release|Any CPU.Build.0 = Release|Any CPU
{11365608-C76C-4CF7-9DBE-78A61A934448}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11365608-C76C-4CF7-9DBE-78A61A934448}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11365608-C76C-4CF7-9DBE-78A61A934448}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11365608-C76C-4CF7-9DBE-78A61A934448}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -199,6 +205,7 @@ Global
{FEDB8D19-2C7E-4393-8D91-332256EC89CC} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
{00E05F5A-A5B7-46ED-AE5F-9D54D67FA78F} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
{81C24D63-1109-4476-99AB-590EF54972E5} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
{11365608-C76C-4CF7-9DBE-78A61A934448} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
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