Commit 89c23fc3 authored by 黄奎's avatar 黄奎

页面修改

parent 6c0fb21f
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 客户完成任务和订单关联实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Customer_Finishdetails
{
/// <summary>
/// 主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public int TaskId { get; set; }
/// <summary>
/// 任务子项编号
/// </summary>
public int DetailId { get; set; }
/// <summary>
/// 客户编号
/// </summary>
public int CustomerId { get; set; }
/// <summary>
/// 订单编号
/// </summary>
public int OrderId { get; set; }
/// <summary>
/// 完成类型(1-人数,2-订单金额)
/// </summary>
public int FinishType { get;set; }
/// <summary>
/// 使用值
/// </summary>
public decimal FinishValue { get; set; }
}
}
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 客户任务完成实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Customer_Finishtask
{
/// <summary>
/// 主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public int TaskId { get; set; }
/// <summary>
/// 子项任务编号
/// </summary>
public int DetailsId { get; set; }
/// <summary>
/// 客户编号
/// </summary>
public int CustomerId { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 小程序编号
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 商户编号
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 兑换码
/// </summary>
public string ExchangeCode { get; set; }
/// <summary>
/// 兑换状态(0-默认,1-已领取,2-已兑换,3-已过期)
/// </summary>
public int ExchangeStatus { get; set; }
/// <summary>
/// 领取时间
/// </summary>
public DateTime? ReceiveTime { get; set; }
/// <summary>
/// 兑换奖品时间
/// </summary>
public DateTime? ExchangeTime { 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_Finishdetails_Extend : RB_Customer_Finishdetails
{
/// <summary>
/// 学员数量
/// </summary>
public int GuestNum { get; set; }
/// <summary>
/// 兑换人数
/// </summary>
public int ExchangeNum { get; set; }
/// <summary>
/// 实收
/// </summary>
public decimal Income { get; set; }
/// <summary>
/// 兑换金额
/// </summary>
public decimal ExchangeMoney { get; set; }
/// <summary>
/// 完成类型
/// </summary>
public string FinishTypeStr
{
get
{
string str = "";
if (this.FinishType == 1)
{
str = "报名人数";
}
else if (this.FinishType == 2)
{
str = "完成订单金额";
}
return str;
}
}
}
}
using Edu.Common.Plugin;
using Edu.Model.Entity.Customer;
using System.Collections.Generic;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 客户任务完成扩展实体类
/// </summary>
public class RB_Customer_Finishtask_Extend : RB_Customer_Finishtask
{
/// <summary>
/// 任务编号
/// </summary>
public string QTaskIds { get; set; }
/// <summary>
/// 完成类型
/// </summary>
public int FinishType { get; set; }
/// <summary>
/// 完成值
/// </summary>
public decimal FinishValue { get; set; }
/// <summary>
/// 领取时间
/// </summary>
public string ReceiveTimeStr { get { return Common.ConvertHelper.FormatTime(this.ReceiveTime); } }
/// <summary>
/// 兑换时间
/// </summary>
public string ExchangeTimeStr { get { return Common.ConvertHelper.FormatTime(this.ExchangeTime); } }
/// <summary>
/// 奖品名称
/// </summary>
public string TaskKudo { get; set; }
/// <summary>
/// 奖品图片
/// </summary>
public string TaskKudoImg { get; set; }
/// <summary>
/// 奖品图片数组
/// </summary>
public List<string> TaskKudoImgList
{
get
{
List<string> list = new List<string>();
if (!string.IsNullOrEmpty(this.TaskKudoImg))
{
list = JsonHelper.DeserializeObject<List<string>>(this.TaskKudoImg);
}
return list;
}
}
/// <summary>
/// 奖品描述
/// </summary>
public string KudoDescription { get; set; }
/// <summary>
/// 兑换状态(0-默认,1-已领取,2-已兑换,3-已过期)
/// </summary>
public string ExchangeStatusStr
{
get
{
string str = "";
if (this.ExchangeStatus == 1)
{
str = "已领取";
}
else if (this.ExchangeStatus == 2)
{
str = "已兑换";
}
else if (ExchangeStatus == 3)
{
str = "已过期";
}
return str;
}
}
/// <summary>
/// 客户名称
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// 任务名称
/// </summary>
public string TaskName { get; set; }
}
}
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file
......@@ -41,6 +41,16 @@ namespace Edu.Module.Customer
/// </summary>
private readonly RB_Course_SubjectRepository course_SubjectRepository = new RB_Course_SubjectRepository();
/// <summary>
/// 客户完成任务仓储层对象
/// </summary>
private readonly RB_Customer_FinishtaskRepository customer_FinishtaskRepository = new RB_Customer_FinishtaskRepository();
/// <summary>
/// 客户任务完成详情仓储层对象
/// </summary>
private readonly RB_Customer_FinishdetailsRepository customer_FinishdetailsRepository = new RB_Customer_FinishdetailsRepository();
/// <summary>
/// 获取任务分页列表
/// </summary>
......@@ -190,10 +200,11 @@ namespace Edu.Module.Customer
flag = newId > 0;
}
if (model.DetailsList != null && model.DetailsList.Count > 0)
{
var oldList = detailsRepository.GetTaskDetailsListRepository(new RB_TaskDetails_Extend() {
var oldList = detailsRepository.GetTaskDetailsListRepository(new RB_TaskDetails_Extend()
{
TaskId = model.Id
});
//以前没有任务详情信息【直接新增】
......@@ -244,7 +255,7 @@ namespace Edu.Module.Customer
{nameof(RB_TaskDetails_Extend.TaskKudoImg),item.TaskKudoImg },
{nameof(RB_TaskDetails_Extend.KudoDescription),item.KudoDescription },
};
detailsRepository.Update(subFileds,new WhereHelper(nameof(RB_TaskDetails_Extend.DetailId),item.DetailId));
detailsRepository.Update(subFileds, new WhereHelper(nameof(RB_TaskDetails_Extend.DetailId), item.DetailId));
}
}
}
......@@ -291,5 +302,30 @@ namespace Edu.Module.Customer
}
return extModel;
}
/// <summary>
/// 获取客户完成任务分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Finishtask_Extend> GetCustomerFinishtaskPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Customer_Finishtask_Extend query)
{
var list = customer_FinishtaskRepository.GetCustomerFinishtaskPageRepository(pageIndex, pageSize, out rowsCount, query);
return list;
}
/// <summary>
/// 获取任务和订单关联列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Finishdetails_Extend> GetCustomerFinishdetailsPageModule(int pageIndex, int pageSize,out long rowsCount, RB_Customer_Finishdetails_Extend query)
{
var list = customer_FinishdetailsRepository.GetCustomerFinishdetailsPageRepository(pageIndex, pageSize, out rowsCount, query);
return list;
}
}
}
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file
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_FinishdetailsRepository : BaseRepository<RB_Customer_Finishdetails>
{
/// <summary>
/// 获取任务和订单关联列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="RB_Customer_Finishdetails_Extend"></param>
/// <param name=""></param>
/// <returns></returns>
public List<RB_Customer_Finishdetails_Extend> GetCustomerFinishdetailsPageRepository(int pageIndex,int pageSize,out long rowsCount, RB_Customer_Finishdetails_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(@"
SELECT A.*,B.GuestNum,B.ExchangeNum,B.Income,B.ExchangeMoney
FROM RB_Customer_Finishdetails AS A LEFT JOIN rb_order AS B ON A.OrderId=B.OrderId
WHERE 1=1
");
if (query != null)
{
if (query.TaskId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Customer_Finishdetails_Extend.TaskId), query.TaskId);
}
if (query.DetailId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Customer_Finishdetails_Extend.DetailId), query.DetailId);
}
if (query.OrderId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Customer_Finishdetails_Extend.OrderId), query.OrderId);
}
if (query.CustomerId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Customer_Finishdetails_Extend.CustomerId), query.CustomerId);
}
}
return GetPage<RB_Customer_Finishdetails_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
}
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_FinishtaskRepository : BaseRepository<RB_Customer_Finishtask>
{
/// <summary>
/// 获取客户完成任务分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Finishtask_Extend> GetCustomerFinishtaskPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Customer_Finishtask_Extend query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,B.TaskKudo,B.TaskKudoImg,B.KudoDescription,C.CustomerName,D.TaskName
FROM RB_Customer_Finishtask AS A INNER JOIN rb_taskdetails AS B ON A.TaskId=B.TaskId AND A.DetailsId=B.DetailId
LEFT JOIN rb_customer AS C ON A.CustomerId=C.CustomerId
LEFT JOIN rb_task AS D ON A.TaskId=D.Id
WHERE 1=1
");
builder.Append(" AND A.ExchangeStatus>0 ");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Finishtask_Extend.Group_Id), query.Group_Id);
}
if (query.CustomerId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Finishtask_Extend.CustomerId), query.CustomerId);
}
if (query.TaskId > 0)
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Customer_Finishtask_Extend.TaskId), query.TaskId);
}
if (query.DetailsId > 0)
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Customer_Finishtask_Extend.DetailsId), query.DetailsId);
}
if (!string.IsNullOrEmpty(query.QTaskIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Customer_Finishtask_Extend.TaskId), query.QTaskIds);
}
if (!string.IsNullOrEmpty(query.CustomerName))
{
builder.AppendFormat(" AND C.{0} LIKE @CustomerName ", nameof(RB_Customer_Finishtask_Extend.CustomerName));
parameters.Add("CustomerName", "%" + query.CustomerName.Trim() + "%");
}
if (query.ExchangeStatus > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Finishtask_Extend.ExchangeStatus), query.ExchangeStatus);
}
if (!string.IsNullOrEmpty(query.TaskName))
{
builder.AppendFormat(" AND D .{0} LIKE @TaskName ", nameof(RB_Customer_Finishtask_Extend.TaskName));
parameters.Add("TaskName", "%" + query.TaskName.Trim() + "%");
}
}
return GetPage<RB_Customer_Finishtask_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
}
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file
......@@ -361,5 +361,54 @@ namespace Edu.WebApi.Controllers.Customer
}
#endregion
#region 同行完成任务列表
/// <summary>
/// 获取客户完成任务分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCustomerFinishtaskPage()
{
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Customer_Finishtask_Extend()
{
Group_Id = base.UserInfo.Group_Id,
CustomerName = base.ParmJObj.GetStringValue("CustomerName"),
TaskName=base.ParmJObj.GetStringValue("TaskName"),
ExchangeStatus=base.ParmJObj.GetInt("ExchangeStatus"),
};
var list = taskModule.GetCustomerFinishtaskPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
}
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 根据编号获取任务完成详情列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCustomerFinishtaskDetailsPage()
{
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Customer_Finishdetails_Extend()
{
TaskId = base.ParmJObj.GetInt("TaskId"),
DetailId = base.ParmJObj.GetInt("DetailId"),
CustomerId=base.ParmJObj.GetInt("CustomerId"),
};
var list = taskModule.GetCustomerFinishdetailsPageModule(pageModel.PageIndex,pageModel.PageSize,out long rowsCount, query);
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
#endregion
}
}
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