Commit a66c2e1e authored by 吴春's avatar 吴春

提交代码

parent af0dcc90
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Plugin;
namespace Mall.Common.Enum.Education
{
public enum ConsultOrderExportEnum
{
/// <summary>
/// 订单号
/// </summary>
[EnumField("订单号")]
OrderId = 1,
/// <summary>
/// 联系人
/// </summary>
[EnumField("联系人")]
LinkMan = 2,
/// <summary>
/// 联系电话
/// </summary>
[EnumField("联系电话")]
LinkTel = 3,
/// <summary>
/// 单价
/// </summary>
[EnumField("单价")]
UnitPrice = 4,
/// <summary>
/// 应收
/// </summary>
[EnumField("应收")]
Money = 5,
/// <summary>
/// 实收
/// </summary>
[EnumField("实收")]
Income = 6,
/// <summary>
/// 退款
/// </summary>
[EnumField("退款")]
RefundPrice = 7,
/// <summary>
/// 平台税金
/// </summary>
[EnumField("平台税金")]
PlatformTax = 8,
/// <summary>
/// 待收金额
/// </summary>
[EnumField("待收金额")]
DueInMoney = 9,
/// <summary>
/// 状态
/// </summary>
[EnumField("状态")]
Status = 10,
/// <summary>
/// 备注
/// </summary>
[EnumField("备注")]
Remark = 11,
/// <summary>
/// 报名时间
/// </summary>
[EnumField("报名时间")]
CreateTime = 12
}
}
......@@ -80,6 +80,8 @@ namespace Mall.Model.Extend.Education
/// 生日
/// </summary>
public string StuBirth { get; set; }
public List<int> ExcelEnumIds { get; set; }
}
......
......@@ -276,6 +276,9 @@ namespace Mall.Module.Education
return list;
}
/// <summary>
/// 获取当前用户参加商会活动分页列表
/// </summary>
......@@ -383,7 +386,7 @@ namespace Mall.Module.Education
}
catch (Exception ex)
{
education_ActivityRepository.DBSession.Rollback("SetActivityModule");
education_ActivityRepository.DBSession.Rollback("SetActivityModule");
return false;
}
}
......@@ -764,7 +767,7 @@ namespace Mall.Module.Education
public List<RB_Education_Consult_Extend> GetCommerceConsultListRepository_V3(int pageIndex, int pageSize, out long rowsCount, RB_Education_Consult_Extend query)
{
var list = education_ConsultRepository.GetCommerceConsultListRepository_V3(pageIndex, pageSize, out rowsCount, query);
if (list.Any() && list.Any())
if (list!=null && list.Any())
{
if (list.Any(x => x.EduUserId > 0))
{
......@@ -832,7 +835,29 @@ namespace Mall.Module.Education
return list;
}
/// <summary>
/// 获取用户的报名列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Education_Consult_Extend> GetExportCommerceConsultList(RB_Education_Consult_Extend query)
{
var list = education_ConsultRepository.GetExportCommerceConsultList(query);
if (list != null && list.Any())
{
if (list.Any(x => x.EduUserId > 0))
{
string qIds = string.Join(",", list.Where(x => x.EduUserId > 0).Distinct().Select(x => x.EduUserId));
var employeeList = RB_AccountRepository.GetEmployeeListRepository(new Employee_ViewModel { QIds = qIds }).ToList();
list.ForEach(x => x.EduSellName = x.EduUserId > 0 ? employeeList.Where(y => y.Id == x.EduUserId).FirstOrDefault()?.EmployeeName : "");
}
}
return list;
}
/// <summary>
/// 获取商会活动报名分页列表
......@@ -1080,7 +1105,7 @@ namespace Mall.Module.Education
var miniProgramModel = GetMiniProgramExtend(model.MallBaseId);
var userInfo = RB_AccountRepository.GetEmployeeListRepository(new Employee_ViewModel { Id = financeConfig.CreateBy, Group_Id = financeConfig.Group_Id }).ToList().FirstOrDefault();
// var OriginalFee = Math.Round((Convert.ToDecimal(Config.SettlementRate) / 100) * (Convert.ToDecimal(model.Money)), 2, MidpointRounding.AwayFromZero);//手续费
// var OriginalFee = Math.Round((Convert.ToDecimal(Config.SettlementRate) / 100) * (Convert.ToDecimal(model.Money)), 2, MidpointRounding.AwayFromZero);//手续费
Model.Entity.Finance.RB_Online_Trade_Detail model1 = new Model.Entity.Finance.RB_Online_Trade_Detail();
#region 财务单据数据组装
var detailList = new List<object>
......@@ -1107,7 +1132,7 @@ namespace Mall.Module.Education
OrderSource = 17,
Remark = System.DateTime.Now.ToString("yyyy年MM月dd日") + "自动生成财务单据",
detailList,
OriginalFee= PlatformTax,
OriginalFee = PlatformTax,
CreateBy = userInfo.Id,
RemitterName = umodel.Name,
RB_Branch_Id = userInfo.School_Id,
......@@ -1202,8 +1227,8 @@ namespace Mall.Module.Education
{
model.OrderStatus = 1;
}
// model.PlatformTax = model.PlatformTax + PlatformTax;
// model.PlatformTax = model.PlatformTax + PlatformTax;
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Education_Consult_Extend.PaymentTime),System.DateTime.Now},
{ nameof(RB_Education_Consult_Extend.OrderStatus),model.OrderStatus},
......
......@@ -125,6 +125,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Education_Activity_Extend.TenantId), query.TenantId);
}
if (query.Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Education_Activity_Extend.Id), query.Id);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Education_Activity_Extend.MallBaseId), query.MallBaseId);
......@@ -269,5 +273,11 @@ WHERE 1=1
}
return Get<RB_Education_Activity_Extend>(builder.ToString()).ToList();
}
}
}
......@@ -334,7 +334,119 @@ left join rb_education_activity b on a.ActivityId = b.Id where 1=1
return GetPage<RB_Education_Consult_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取用户的报名列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Education_Consult_Extend> GetExportCommerceConsultList( RB_Education_Consult_Extend query)
{
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT a.*,b.ActivityName,b.CoverImg,b.StartTime,b.EndTime,b.LocationName
FROM RB_Education_Consult a
left join rb_education_activity b on a.ActivityId = b.Id where 1=1
");
if (query == null)
{
return new List<RB_Education_Consult_Extend>();
}
else
{
if (query.EnrollState > 0)
{
if (query.EnrollState == 1)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Education_Consult_Extend.Status), (int)DateStateEnum.Normal);
}
else if (query.EnrollState == 2)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Education_Consult_Extend.Status), (int)DateStateEnum.Delete);
}
}
else
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Education_Consult_Extend.Status), (int)DateStateEnum.Normal);
}
if (query.TenantId > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Education_Consult_Extend.TenantId), query.TenantId);
}
if (query.OrderStatus > -1)
{
if (query.OrderStatus == 1)
{
builder.AppendFormat(" AND (a.{0}=1 or a.{1}={2} ) ", nameof(RB_Education_Consult_Extend.OrderStatus), nameof(RB_Education_Consult_Extend.PaymentWay), (int)Common.Enum.Goods.OrderPaymentTypeEnum.OfflinePay);
}
else
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Education_Consult_Extend.OrderStatus), query.OrderStatus);
}
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Education_Consult_Extend.MallBaseId), query.MallBaseId);
}
if (!string.IsNullOrEmpty(query.LinkMan))
{
builder.AppendFormat(" AND a.{0} LIKE @Name ", nameof(RB_Education_Consult_Extend.LinkMan));
parameters.Add("Name", "%" + query.LinkMan.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.ActivityName))
{
builder.AppendFormat(" AND b.{0} LIKE '%{1}%' ", nameof(RB_Education_Activity_Extend.ActivityName), query.ActivityName.Trim());
}
if (query.ActivityId > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Education_Consult_Extend.ActivityId), query.ActivityId);
}
if (!string.IsNullOrWhiteSpace(query.CreateStartTime))//报名时间
{
builder.AppendFormat($" and DATE_FORMAT(a.{ nameof(RB_Education_Consult_Extend.CreateTime)},'%Y-%m-%d' )>=DATE_FORMAT('{query.CreateStartTime}','%Y-%m-%d' ) ");
}
if (!string.IsNullOrWhiteSpace(query.CreateEndTime))//报名时间
{
builder.AppendFormat($" and DATE_FORMAT(a.{nameof(RB_Education_Consult_Extend.CreateTime)},'%Y-%m-%d' )<= DATE_FORMAT('{query.CreateEndTime}','%Y-%m-%d' ) ");
}
if (query.StartTime.HasValue && query.StartTime.Value.ToString("yyyy-MM-dd") != "0001-01-01")//活动开始时间
{
builder.AppendFormat($" and DATE_FORMAT(b.{ nameof(RB_Education_Activity_Extend.StartTime)},'%Y-%m-%d' )>=DATE_FORMAT('{query.StartTime.Value.ToString("yyyy-MM-dd")}','%Y-%m-%d' ) ");
}
if (query.EndTime.HasValue && query.StartTime.Value.ToString("yyyy-MM-dd") != "0001-01-01")//活动开始时间
{
builder.AppendFormat($" and DATE_FORMAT(b.{nameof(RB_Education_Consult_Extend.StartTime)},'%Y-%m-%d' )<= DATE_FORMAT('{query.EndTime.Value.ToString("yyyy-MM-dd")}','%Y-%m-%d' ) ");
}
if (!string.IsNullOrEmpty(query.QActivityIds))
{
builder.AppendFormat(" AND a.{0} IN({1}) ", nameof(RB_Education_Consult_Extend.ActivityId), query.QActivityIds);
}
if (!string.IsNullOrEmpty(query.QUserIds))
{
builder.AppendFormat(" AND a.{0} IN({1}) ", nameof(RB_Education_Consult_Extend.UserId), query.QUserIds);
}
if (query.UserId > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Education_Consult_Extend.UserId), query.UserId);
}
if (query.EduUserId > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Education_Consult_Extend.EduUserId), query.EduUserId);
}
if (query.Id > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Education_Consult_Extend.Id), query.Id);
}
}
builder.AppendFormat(" order by a.Id desc");
return Get<RB_Education_Consult_Extend>( builder.ToString(), parameters).ToList();
}
/// <summary>
......
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