Commit 6334cdf3 authored by 黄奎's avatar 黄奎

新增同行幸福存折

parent 63546557
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_BalanceDetail
{
/// <summary>
/// 客户幸福存折明细id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 客户Id
/// </summary>
public int CustomerId { get; set; }
/// <summary>
/// 来源id
/// </summary>
public int SourceId { get; set; }
/// <summary>
/// 来源类型
/// </summary>
public int OrderSource { get; set; }
/// <summary>
/// 类型 1存入 2扣除
/// </summary>
public int Type { get; set; }
/// <summary>
/// 变更金额
/// </summary>
public decimal Money { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 发生时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 账户余额
/// </summary>
public decimal AccountMoney { get; set; }
/// <summary>
/// 报名人数
/// </summary>
public int PeopleNum { get; set; }
/// <summary>
/// 销售编号
/// </summary>
public int EmployeeId { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 校区编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 班级编号
/// </summary>
public int ClassId { 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_BalanceDetail_ViewModel : RB_Customer_BalanceDetail
{
}
}
This diff is collapsed.
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
namespace Edu.Repository.Customer
{
/// <summary>
/// 客户幸福存折仓储层
/// </summary>
public class RB_Customer_BalanceDetailRepository : BaseRepository<RB_Customer_BalanceDetail>
{
/// <summary>
/// 获取客户幸福存折分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_BalanceDetail_ViewModel> GetCustomerBalanceDetailPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Customer_BalanceDetail_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Customer_BalanceDetail AS A
WHERE 1=1
");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_BalanceDetail_ViewModel.Group_Id), query.Group_Id);
}
if (query.CustomerId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_BalanceDetail_ViewModel.CustomerId), query.CustomerId);
}
}
return GetPage<RB_Customer_BalanceDetail_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
}
...@@ -46,8 +46,9 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -46,8 +46,9 @@ namespace Edu.WebApi.Controllers.Customer
{ {
Group_Id = base.UserInfo.Group_Id, Group_Id = base.UserInfo.Group_Id,
CustomerName = base.ParmJObj.GetStringValue("CustomerName"), CustomerName = base.ParmJObj.GetStringValue("CustomerName"),
ApproveState=base.ParmJObj.GetInt("ApproveState"), ContactNumber = base.ParmJObj.GetStringValue("ContactNumber"),
QCustomerState=base.ParmJObj.GetInt("QCustomerState"), ApproveState = base.ParmJObj.GetInt("ApproveState"),
QCustomerState = base.ParmJObj.GetInt("QCustomerState"),
}; };
var list = customerModule.GetCustomerPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var list = customerModule.GetCustomerPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list) foreach (var item in list)
...@@ -194,22 +195,22 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -194,22 +195,22 @@ namespace Edu.WebApi.Controllers.Customer
var model = new RB_Customer_Task_Extend() var model = new RB_Customer_Task_Extend()
{ {
Id = base.ParmJObj.GetInt("Id"), Id = base.ParmJObj.GetInt("Id"),
TaskName=base.ParmJObj.GetStringValue("TaskName"), TaskName = base.ParmJObj.GetStringValue("TaskName"),
TaskSubTitle=base.ParmJObj.GetStringValue("TaskSubTitle"), TaskSubTitle = base.ParmJObj.GetStringValue("TaskSubTitle"),
TaskKudo =base.ParmJObj.GetStringValue("TaskKudo"), TaskKudo = base.ParmJObj.GetStringValue("TaskKudo"),
TaskStartTime =base.ParmJObj.GetDateTime("TaskStartTime"), TaskStartTime = base.ParmJObj.GetDateTime("TaskStartTime"),
TaskEndTime=base.ParmJObj.GetDateTime("TaskEndTime"), TaskEndTime = base.ParmJObj.GetDateTime("TaskEndTime"),
TaskDesc=base.ParmJObj.GetStringValue("TaskDesc"), TaskDesc = base.ParmJObj.GetStringValue("TaskDesc"),
ExchangeEndTime=base.ParmJObj.GetDateTime("ExchangeEndTime"), ExchangeEndTime = base.ParmJObj.GetDateTime("ExchangeEndTime"),
}; };
string taskImageList = base.ParmJObj.GetStringValue("TaskImageList"); string taskImageList = base.ParmJObj.GetStringValue("TaskImageList");
List<string> imgList = new List<string>(); List<string> imgList = new List<string>();
if (!string.IsNullOrEmpty(taskImageList)) if (!string.IsNullOrEmpty(taskImageList))
{ {
imgList = JsonHelper.DeserializeObject<List<string>>(taskImageList); imgList = JsonHelper.DeserializeObject<List<string>>(taskImageList);
} }
model.TaskImage = JsonHelper.Serialize(imgList); model.TaskImage = JsonHelper.Serialize(imgList);
string taskKudoImgList = base.ParmJObj.GetStringValue("TaskKudoImgList"); string taskKudoImgList = base.ParmJObj.GetStringValue("TaskKudoImgList");
List<string> KudoImgList = new List<string>(); List<string> KudoImgList = new List<string>();
if (!string.IsNullOrEmpty(taskKudoImgList)) if (!string.IsNullOrEmpty(taskKudoImgList))
...@@ -246,8 +247,8 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -246,8 +247,8 @@ namespace Edu.WebApi.Controllers.Customer
TaskId = jobj.GetInt("TaskId"), TaskId = jobj.GetInt("TaskId"),
TaskType = (TaskTypeEnum)jobj.GetInt("TaskType"), TaskType = (TaskTypeEnum)jobj.GetInt("TaskType"),
TargetId = string.Join(",", targetIds), TargetId = string.Join(",", targetIds),
TaskFinishType=jobj.GetInt("TaskFinishType"), TaskFinishType = jobj.GetInt("TaskFinishType"),
TaskFinishValue=jobj.GetDecimal("TaskFinishValue"), TaskFinishValue = jobj.GetDecimal("TaskFinishValue"),
}); });
} }
} }
...@@ -258,8 +259,8 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -258,8 +259,8 @@ namespace Edu.WebApi.Controllers.Customer
} }
if (model.DetailsList != null) if (model.DetailsList != null)
{ {
var groupList= model.DetailsList.GroupBy(qitem => new { qitem.TaskType }) var groupList = model.DetailsList.GroupBy(qitem => new { qitem.TaskType })
.Select(qitem => new { qitem.Key.TaskType, TaskTypeCount = qitem.Count() }); .Select(qitem => new { qitem.Key.TaskType, TaskTypeCount = qitem.Count() });
foreach (var item in groupList) foreach (var item in groupList)
{ {
if (item.TaskTypeCount > 1) if (item.TaskTypeCount > 1)
...@@ -268,6 +269,33 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -268,6 +269,33 @@ namespace Edu.WebApi.Controllers.Customer
} }
} }
} }
foreach (var item in model.DetailsList)
{
switch (item.TaskType)
{
case TaskTypeEnum.Course:
if (item.TargetIdList == null || (item.TargetIdList != null && item.TargetIdList.Count == 0))
{
return ApiResult.ParamIsNull(message: $"请选择【{item.TaskType.ToName()}】类型的任务条件!");
}
break;
case TaskTypeEnum.CourseCate:
if (item.TargetIdList == null || (item.TargetIdList != null && item.TargetIdList.Count == 0))
{
return ApiResult.ParamIsNull(message: $"请选择【{item.TaskType.ToName()}】类型的任务条件!");
}
break;
case TaskTypeEnum.CourseSuject:
if (item.TargetIdList == null || (item.TargetIdList != null && item.TargetIdList.Count == 0))
{
return ApiResult.ParamIsNull(message: $"请选择【{item.TaskType.ToName()}】类型的任务条件!");
}
break;
case TaskTypeEnum.GlobalUse:
item.TargetId = "";
break;
}
}
var flag = taskModule.SetCustomerTaskModule(model); var flag = taskModule.SetCustomerTaskModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
......
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