Commit 7ca1f0bf authored by 吴春's avatar 吴春

提交代码

parent 3cfdf44e
...@@ -32,6 +32,10 @@ namespace Mall.Common ...@@ -32,6 +32,10 @@ namespace Mall.Common
/// <summary>
/// 教育学生id
/// </summary>
public int EduStudentId { get; set; }
/// 用户店铺id /// 用户店铺id
/// </summary> /// </summary>
public int SmallShopId { get; set; } public int SmallShopId { get; set; }
......
...@@ -104,6 +104,12 @@ namespace Mall.Common.API ...@@ -104,6 +104,12 @@ namespace Mall.Common.API
/// 微店id /// 微店id
/// </summary> /// </summary>
public int SmallShopsId { get; set; } public int SmallShopsId { get; set; }
/// <summary>
/// 教育对应的学生id
/// </summary>
public int EduStudentId { get; set; }
public int open_school { get; set; } public int open_school { get; set; }
/// <summary> /// <summary>
......
...@@ -233,5 +233,11 @@ namespace Mall.Model.Entity.Education ...@@ -233,5 +233,11 @@ namespace Mall.Model.Entity.Education
public decimal CommissionPrice { get; set; } public decimal CommissionPrice { get; set; }
/// <summary>
/// 0-甲鹤,1-甲小鹤
/// </summary>
public int WeiXinType { get; set; }
} }
} }
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Education;
namespace Mall.Model.Extend.Education
{
/// <summary>
/// 账号视图实体类
/// </summary>
[Serializable]
public class RB_Account_ViewModel : RB_Account
{
/// <summary>
/// 账户用户名称
/// </summary>
public string AccountName { get; set; }
/// <summary>
/// 账号ids
/// </summary>
public string QIds { get; set; }
/// <summary>
/// 子项表编号
/// </summary>
public string QAccountIds { get; set; }
/// <summary>
/// 集团名称
/// </summary>
public string GroupName { get; set; }
/// <summary>
/// 查询账户正常 1是
/// </summary>
public int IsSelectLevelNor { get; set; }
/// <summary>
/// 离职状态
/// </summary>
public int LeaveStatus { get; set; }
/// <summary>
/// 学校名称
/// </summary>
public string SchoolName { get; set; }
/// <summary>
/// 集团Logo
/// </summary>
public string GroupLogo { get; set; }
/// <summary>
/// 用户头像
/// </summary>
public string UserIcon { get; set; }
/// <summary>
/// 部门编号
/// </summary>
public int Dept_Id { get; set; }
/// <summary>
/// 部门ids
/// </summary>
public string DeptIds { get; set; }
/// <summary>
/// 岗位编号
/// </summary>
public int Post_Id { get; set; }
/// <summary>
/// 岗位编号
/// </summary>
public string QPostIds { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DeptName { get; set; }
/// <summary>
/// 岗位名称
/// </summary>
public string PostName { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string Email { get; set; }
}
}
...@@ -191,5 +191,10 @@ namespace Mall.Model.Extend.Education ...@@ -191,5 +191,10 @@ namespace Mall.Model.Extend.Education
/// 活动安排 2021-06-25 Add By:W /// 活动安排 2021-06-25 Add By:W
/// </summary> /// </summary>
public List<RB_Education_ActivityTitle_Extend> ActivityTitleList { get; set; } public List<RB_Education_ActivityTitle_Extend> ActivityTitleList { get; set; }
/// <summary>
/// 教育erp学生id
/// </summary>
public int EduStudentId { get; set; }
} }
} }
...@@ -76,6 +76,11 @@ namespace Mall.Model.Extend.Education ...@@ -76,6 +76,11 @@ namespace Mall.Model.Extend.Education
/// </summary> /// </summary>
public string EduSellName { get; set; } public string EduSellName { get; set; }
/// <summary>
/// 学生名称
/// </summary>
public string EduStudentName { get; set; }
/// <summary> /// <summary>
/// 生日 /// 生日
/// </summary> /// </summary>
......
...@@ -61,6 +61,13 @@ namespace Mall.Model.Query ...@@ -61,6 +61,13 @@ namespace Mall.Model.Query
/// </summary> /// </summary>
public decimal Unit_Price { get; set; } public decimal Unit_Price { get; set; }
/// <summary>
/// 单价
/// </summary>
public decimal EndUnit_Price { get; set; }
/// <summary> /// <summary>
/// 数量 /// 数量
/// </summary> /// </summary>
......
...@@ -411,7 +411,7 @@ namespace Mall.Module.Education ...@@ -411,7 +411,7 @@ namespace Mall.Module.Education
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.Plugin.LogHelper.Write(ex, string.Format("SetActivityModule_Msg:{0}",Common.Plugin.JsonHelper.Serialize(model))); Common.Plugin.LogHelper.Write(ex, string.Format("SetActivityModule_Msg:{0}", Common.Plugin.JsonHelper.Serialize(model)));
education_ActivityRepository.DBSession.Rollback("SetActivityModule"); education_ActivityRepository.DBSession.Rollback("SetActivityModule");
return false; return false;
} }
...@@ -629,6 +629,19 @@ namespace Mall.Module.Education ...@@ -629,6 +629,19 @@ namespace Mall.Module.Education
/// <summary>
/// 获取学员账号列表扩展列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Account_ViewModel> GetStudentExt(RB_Account_ViewModel query)
{
return RB_AccountRepository.GetStudentExt(query);
}
/// <summary> /// <summary>
/// 获取教育用户的基础信息 /// 获取教育用户的基础信息
/// </summary> /// </summary>
...@@ -816,6 +829,12 @@ namespace Mall.Module.Education ...@@ -816,6 +829,12 @@ namespace Mall.Module.Education
var employeeList = RB_AccountRepository.GetEmployeeListRepository(new Employee_ViewModel { QIds = qIds }).ToList(); 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 : ""); list.ForEach(x => x.EduSellName = x.EduUserId > 0 ? employeeList.Where(y => y.Id == x.EduUserId).FirstOrDefault()?.EmployeeName : "");
} }
if (list.Any(x => x.EduStudentId > 0))
{
string qIds = string.Join(",", list.Where(x => x.EduStudentId > 0).Distinct().Select(x => x.EduStudentId));
var employeeList = RB_AccountRepository.GetStudentExt(new RB_Account_ViewModel { QIds = qIds }).ToList();
list.ForEach(x => x.EduStudentName = x.EduStudentId > 0 ? employeeList.Where(y => y.Id == x.EduStudentId).FirstOrDefault()?.AccountName : "");
}
List<RB_Finance_Extend> flist = new List<RB_Finance_Extend>(); List<RB_Finance_Extend> flist = new List<RB_Finance_Extend>();
string orderIds = string.Join(",", list.Select(x => x.Id)); string orderIds = string.Join(",", list.Select(x => x.Id));
flist = financeRepository.GetListJH(new RB_Finance_Extend() { ReFinanceIds2 = orderIds }); flist = financeRepository.GetListJH(new RB_Finance_Extend() { ReFinanceIds2 = orderIds });
......
...@@ -211,5 +211,63 @@ WHERE 1=1 AND A.FunctionCode='{0}' AND A.Id IN(SELECT Action_Id FROM rb_role_fun ...@@ -211,5 +211,63 @@ WHERE 1=1 AND A.FunctionCode='{0}' AND A.Id IN(SELECT Action_Id FROM rb_role_fun
return result > 0; return result > 0;
} }
/// <summary>
/// 获取学员账号列表扩展列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Account_ViewModel> GetStudentExt(RB_Account_ViewModel query)
{
StringBuilder where = new StringBuilder();
StringBuilder where2 = new StringBuilder();
if (query != null)
{
if (query.Group_Id > 0)
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Account_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrWhiteSpace(query.Account))
{
where.AppendFormat(" AND A.{0}='{1}' ", nameof(RB_Account_ViewModel.Account), query.Account.Trim());
}
if (query.AccountType > 0)
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Account_ViewModel.AccountType), (int)query.AccountType);
}
if (query.Id > 0)
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Account_ViewModel.Id), query.Id);
}
if (!string.IsNullOrEmpty(query.QIds))
{
where.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Account_ViewModel.Id), query.QIds);
}
if (query.AccountId > 0)
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Account_ViewModel.AccountId), query.AccountId);
}
if (!string.IsNullOrEmpty(query.QAccountIds))
{
where.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Account_ViewModel.AccountId), query.QAccountIds);
}
if (!string.IsNullOrEmpty(query.OpenId))
{
where.AppendFormat(" AND A.{0}='{1}' ", nameof(RB_Account_ViewModel.OpenId), query.OpenId);
}
}
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName,IFNULL(G.Logo,'') AS GroupLogo
,IFNULL(B.StuName,'') AS AccountName
FROM rb_account AS A INNER JOIN rb_student AS B ON A.AccountId=B.StuId
LEFT JOIN rb_group AS g ON A.Group_Id=g.GId
LEFT JOIN rb_school AS s ON A.School_Id=s.SId
WHERE 1=1 {0}
", where.ToString());
var list = Get<RB_Account_ViewModel>(builder.ToString()).ToList();
return list;
}
} }
} }
...@@ -229,6 +229,10 @@ WHERE 1=1 ...@@ -229,6 +229,10 @@ WHERE 1=1
if (query.CreateBy > 0) if (query.CreateBy > 0)
{ {
builder.AppendFormat(" AND D.{0}={1} ", nameof(RB_Education_Consult_Extend.UserId), query.CreateBy); builder.AppendFormat(" AND D.{0}={1} ", nameof(RB_Education_Consult_Extend.UserId), query.CreateBy);
} //当前用户参加的活动
if (query.EduStudentId > 0)
{
builder.AppendFormat(" AND D.{0}={1} ", nameof(RB_Education_Consult_Extend.EduStudentId), query.EduStudentId);
} }
} }
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Education_Activity_Extend.Id)); builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Education_Activity_Extend.Id));
......
...@@ -640,6 +640,10 @@ WHERE 1=1 ...@@ -640,6 +640,10 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND c.{0}={1} ", nameof(RB_Education_Consult_Extend.UserId), query.UserId); builder.AppendFormat(" AND c.{0}={1} ", nameof(RB_Education_Consult_Extend.UserId), query.UserId);
} }
if (query.EduStudentId > 0)
{
builder.AppendFormat(" AND c.{0}={1} ", nameof(RB_Education_Consult_Extend.EduStudentId), query.EduStudentId);
}
} }
builder.AppendFormat(" order by c.Id desc"); builder.AppendFormat(" order by c.Id desc");
return GetPage<RB_Education_Consult_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return GetPage<RB_Education_Consult_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......
...@@ -71,7 +71,7 @@ namespace Mall.Repository.Product ...@@ -71,7 +71,7 @@ namespace Mall.Repository.Product
where += $@" and o.{nameof(RB_Goods_Order.IsOffline)}={(int)dmodel.IsOffline}"; where += $@" and o.{nameof(RB_Goods_Order.IsOffline)}={(int)dmodel.IsOffline}";
} }
if (dmodel.IsNotSelectCancel == 1) if (dmodel.IsNotSelectCancel == 1)
{ {
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)} <> {(int)OrderStatusEnum.Cancel}"; where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)} <> {(int)OrderStatusEnum.Cancel}";
...@@ -688,9 +688,9 @@ WHERE od.GoodsId={goodsId} and o.`Status`=0 and o.OrderStatus <> 7 GROUP BY o.Us ...@@ -688,9 +688,9 @@ WHERE od.GoodsId={goodsId} and o.`Status`=0 and o.OrderStatus <> 7 GROUP BY o.Us
SELECT SUM(od.Number) as OrderNum FROM rb_goods_order o SELECT SUM(od.Number) as OrderNum FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
WHERE od.GoodsId={goodsId} and o.`Status`=0 and o.OrderStatus <> 7"; WHERE od.GoodsId={goodsId} and o.`Status`=0 and o.OrderStatus <> 7";
var model2 = Get<RB_Goods_Order_Extend>(sql2).FirstOrDefault(); var model2 = Get<RB_Goods_Order_Extend>(sql2).FirstOrDefault();
if (model2 != null) if (model2 != null)
{ {
return model2.OrderNum ?? 0; return model2.OrderNum ?? 0;
...@@ -1134,7 +1134,7 @@ LEFT JOIN rb_member_user as c on b.UserId=c.Id ...@@ -1134,7 +1134,7 @@ LEFT JOIN rb_member_user as c on b.UserId=c.Id
where += $@" and a.{nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}"; where += $@" and a.{nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}";
payMemerNumWhere += $@" and {nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}"; payMemerNumWhere += $@" and {nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}";
} }
if (dmodel.PlatformType > 0 && dmodel.OrderStatus != 4 && dmodel.OrderStatus !=5) if (dmodel.PlatformType > 0 && dmodel.OrderStatus != 4 && dmodel.OrderStatus != 5)
{ {
where += $@" and a.{nameof(RB_Goods_Order.OrderSource)}={(int)dmodel.PlatformType}"; where += $@" and a.{nameof(RB_Goods_Order.OrderSource)}={(int)dmodel.PlatformType}";
payMemerNumWhere += $@" and {nameof(RB_Goods_Order.OrderSource)}={(int)dmodel.PlatformType}"; payMemerNumWhere += $@" and {nameof(RB_Goods_Order.OrderSource)}={(int)dmodel.PlatformType}";
...@@ -1217,13 +1217,13 @@ AS t GROUP BY t.CreateDate DESC "; ...@@ -1217,13 +1217,13 @@ AS t GROUP BY t.CreateDate DESC ";
/// <param name="startDate">开始日期</param> /// <param name="startDate">开始日期</param>
/// <param name="endDate">结束日期</param> /// <param name="endDate">结束日期</param>
/// <returns></returns> /// <returns></returns>
public List<RB_Member_User_Extend> GetOrderUserStatisticsRepository(DataStatistics_Query dmodel,string startDate,string endDate) public List<RB_Member_User_Extend> GetOrderUserStatisticsRepository(DataStatistics_Query dmodel, string startDate, string endDate)
{ {
string where = ""; string where = "";
if (dmodel.TenantId > 0) if (dmodel.TenantId > 0)
{ {
where += $@" and a.{nameof(RB_Goods_Order.TenantId)}={dmodel.TenantId}"; where += $@" and a.{nameof(RB_Goods_Order.TenantId)}={dmodel.TenantId}";
} }
if (dmodel.MallBaseId > 0) if (dmodel.MallBaseId > 0)
{ {
...@@ -1246,7 +1246,7 @@ INNER JOIN ...@@ -1246,7 +1246,7 @@ INNER JOIN
WHERE 1=1 {2} WHERE 1=1 {2}
", startDate, endDate, where); ", startDate, endDate, where);
var list = Get<RB_Member_User_Extend>(builder.ToString()).ToList(); var list = Get<RB_Member_User_Extend>(builder.ToString()).ToList();
return list; return list;
} }
...@@ -1582,7 +1582,18 @@ GROUP BY od.GoodsId,o.OrderId ...@@ -1582,7 +1582,18 @@ GROUP BY od.GoodsId,o.OrderId
{ {
where += $" and b.CompanyId={dmodel.CompanyId} "; where += $" and b.CompanyId={dmodel.CompanyId} ";
} }
if (dmodel.Unit_Price > 0)
{
where += $" and b.Unit_Price >= {dmodel.Unit_Price} ";
}
if (dmodel.EndUnit_Price > 0)
{
where += $" and b.Unit_Price <={dmodel.EndUnit_Price} ";
}
if (dmodel.CompanyId > 0)
{
where += $" and b.CompanyId={dmodel.CompanyId} ";
}
if (!string.IsNullOrWhiteSpace(dmodel.StartDate)) if (!string.IsNullOrWhiteSpace(dmodel.StartDate))
{ {
where += $" and DATE_FORMAT(a.PaymentTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) "; where += $" and DATE_FORMAT(a.PaymentTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
...@@ -1724,7 +1735,14 @@ GROUP BY b.Id order by b.Id asc"; ...@@ -1724,7 +1735,14 @@ GROUP BY b.Id order by b.Id asc";
{ {
where += $" and b.CompanyId={dmodel.CompanyId} "; where += $" and b.CompanyId={dmodel.CompanyId} ";
} }
if (dmodel.Unit_Price > 0)
{
where += $" and b.Unit_Price >= {dmodel.Unit_Price} ";
}
if (dmodel.EndUnit_Price > 0)
{
where += $" and b.Unit_Price <={dmodel.EndUnit_Price} ";
}
if (!string.IsNullOrWhiteSpace(dmodel.StartDate)) if (!string.IsNullOrWhiteSpace(dmodel.StartDate))
{ {
where += $" and DATE_FORMAT(a.PaymentTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) "; where += $" and DATE_FORMAT(a.PaymentTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
...@@ -1790,6 +1808,14 @@ GROUP BY b.Id order by b.Id asc"; ...@@ -1790,6 +1808,14 @@ GROUP BY b.Id order by b.Id asc";
{ {
where += $" and b.CompanyId={dmodel.CompanyId} "; where += $" and b.CompanyId={dmodel.CompanyId} ";
} }
if (dmodel.Unit_Price > 0)
{
where += $" and b.Unit_Price >= {dmodel.Unit_Price} ";
}
if (dmodel.EndUnit_Price > 0)
{
where += $" and b.Unit_Price <={dmodel.EndUnit_Price} ";
}
if (!string.IsNullOrWhiteSpace(dmodel.Ids)) if (!string.IsNullOrWhiteSpace(dmodel.Ids))
{ {
where += $" and b.Id in({dmodel.Ids}) "; where += $" and b.Id in({dmodel.Ids}) ";
...@@ -1928,6 +1954,14 @@ GROUP BY b.Id order by b.Id asc"; ...@@ -1928,6 +1954,14 @@ GROUP BY b.Id order by b.Id asc";
{ {
where += $" and b.Id in({dmodel.Ids}) "; where += $" and b.Id in({dmodel.Ids}) ";
} }
if (dmodel.Unit_Price > 0)
{
where += $" and b.Unit_Price >= {dmodel.Unit_Price} ";
}
if (dmodel.EndUnit_Price > 0)
{
where += $" and b.Unit_Price <={dmodel.EndUnit_Price} ";
}
//if (!string.IsNullOrWhiteSpace(dmodel.StartDate)) //if (!string.IsNullOrWhiteSpace(dmodel.StartDate))
//{ //{
// where += $" and DATE_FORMAT(oa.FinishTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) "; // where += $" and DATE_FORMAT(oa.FinishTime,'%Y-%m-%d' )>=DATE_FORMAT('{dmodel.StartDate}','%Y-%m-%d' ) ";
...@@ -2336,7 +2370,7 @@ GROUP BY o.OrderId ...@@ -2336,7 +2370,7 @@ GROUP BY o.OrderId
/// <param name="GoodsId"></param> /// <param name="GoodsId"></param>
/// <param name="UserId"></param> /// <param name="UserId"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Goods_Order_Extend> GetCourseOrderIsPay(string GoodsIds,int UserId) public List<RB_Goods_Order_Extend> GetCourseOrderIsPay(string GoodsIds, int UserId)
{ {
string sql = $@" string sql = $@"
SELECT o.OrderId,od.GoodsId,o.PaymentTime FROM rb_goods_order o SELECT o.OrderId,od.GoodsId,o.PaymentTime FROM rb_goods_order o
...@@ -2623,7 +2657,8 @@ WHERE gc.CategoryId in ({dmodel.RangeIds}) ...@@ -2623,7 +2657,8 @@ WHERE gc.CategoryId in ({dmodel.RangeIds})
GROUP BY od.Id "; GROUP BY od.Id ";
return Get<RB_Goods_Activity_Extend>(sql).ToList(); return Get<RB_Goods_Activity_Extend>(sql).ToList();
} }
else { else
{
string sql = $@" string sql = $@"
SELECT od.Id,od.Number,od.Final_Price,o.OrderId,o.{(dmodel.ActiveObject == 1 ? "DistributorTree" : "UserTree")} as UserTree FROM rb_goods_orderdetail od SELECT od.Id,od.Number,od.Final_Price,o.OrderId,o.{(dmodel.ActiveObject == 1 ? "DistributorTree" : "UserTree")} as UserTree FROM rb_goods_orderdetail od
LEFT JOIN rb_goods_order o ON o.OrderId = od.OrderId LEFT JOIN rb_goods_order o ON o.OrderId = od.OrderId
......
...@@ -754,13 +754,24 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -754,13 +754,24 @@ namespace Mall.WebApi.Controllers.AppletWeChat
{ {
totalReturn = Math.Round((totalReturn * (Convert.ToDecimal(Config.SettlementRate) / 100)), 2, MidpointRounding.AwayFromZero); totalReturn = Math.Round((totalReturn * (Convert.ToDecimal(Config.SettlementRate) / 100)), 2, MidpointRounding.AwayFromZero);
} }
decimal AvgGrossProfit = 0;
int GoodsNum = 0;
decimal totalGrossProfit = 0;
if (list != null && list.Any())
{
totalGrossProfit = list.Sum(x => x.GrossProfit);
GoodsNum = list.Sum(x => x.Number);
if (GoodsNum > 0)
{
AvgGrossProfit = (Math.Round((totalGrossProfit / Convert.ToDecimal(GoodsNum)), 2, MidpointRounding.AwayFromZero));
}
}
var retult = new var retult = new
{ {
OrderNo = "", OrderNo = "",
GoodsName = "", GoodsName = "",
Unit_Price = list.Sum(x => x.Unit_Price),//单价 Unit_Price = list.Sum(x => x.Unit_Price),//单价
Number = list.Sum(x => x.Number),//数量 Number = GoodsNum, //数量
SupplierName = "", SupplierName = "",
Final_Price = list.Sum(x => x.Final_Price),//数量 Final_Price = list.Sum(x => x.Final_Price),//数量
FreightMoney = list.Sum(x => !string.IsNullOrWhiteSpace(x.FreightMoney) ? Convert.ToDecimal(x.FreightMoney) : 0), FreightMoney = list.Sum(x => !string.IsNullOrWhiteSpace(x.FreightMoney) ? Convert.ToDecimal(x.FreightMoney) : 0),
...@@ -787,8 +798,9 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -787,8 +798,9 @@ namespace Mall.WebApi.Controllers.AppletWeChat
RealMoney = list.Sum(x => x.RealMoney), RealMoney = list.Sum(x => x.RealMoney),
YFMoney = list.Sum(x => x.YFMoney), YFMoney = list.Sum(x => x.YFMoney),
PayMoney = list.Sum(x => x.PayMoney), PayMoney = list.Sum(x => x.PayMoney),
GrossProfit = list.Sum(x => x.GrossProfit), GrossProfit = totalGrossProfit,
CompanyName = "", CompanyName = "",
AvgGrossProfit,//平均毛利率
GrossProfitRate,//毛利率的平均值 GrossProfitRate,//毛利率的平均值
}; };
...@@ -1385,7 +1397,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -1385,7 +1397,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
model?.PresentFXMonth, model?.PresentFXMonth,
model?.Advertising, model?.Advertising,
model?.SubName, model?.SubName,
MarketingLogo= tempLogo, MarketingLogo = tempLogo,
model?.ShelvesDate, model?.ShelvesDate,
model?.DownDate, model?.DownDate,
model?.VideoType, model?.VideoType,
...@@ -1412,7 +1424,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -1412,7 +1424,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat
var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
JObject parms = JObject.Parse(requestParm.msg.ToString()); JObject parms = JObject.Parse(requestParm.msg.ToString());
string Month = parms.GetStringValue("Month");//月份 string Month = parms.GetStringValue("Month");//月份
if (string.IsNullOrEmpty(Month)) { if (string.IsNullOrEmpty(Month))
{
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
try try
...@@ -1508,7 +1521,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -1508,7 +1521,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]
public ApiResult GetDSMoreMonthStatistics(object requestMsg) { public ApiResult GetDSMoreMonthStatistics(object requestMsg)
{
var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
JObject parms = JObject.Parse(requestParm.msg.ToString()); JObject parms = JObject.Parse(requestParm.msg.ToString());
string StartTime = parms.GetStringValue("StartTime");//开始时间 月 string StartTime = parms.GetStringValue("StartTime");//开始时间 月
...@@ -1628,11 +1642,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -1628,11 +1642,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]
public ApiResult GetDSYearStartistics(object requestMsg) { public ApiResult GetDSYearStartistics(object requestMsg)
{
var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
JObject parms = JObject.Parse(requestParm.msg.ToString()); JObject parms = JObject.Parse(requestParm.msg.ToString());
int StartYear = parms.GetInt("StartYear",0);//开始时间 年 int StartYear = parms.GetInt("StartYear", 0);//开始时间 年
int EndYear = parms.GetInt("EndYear",0);//结束时间 年 int EndYear = parms.GetInt("EndYear", 0);//结束时间 年
if (StartYear <= 0 || EndYear <= 0) if (StartYear <= 0 || EndYear <= 0)
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
...@@ -1653,7 +1668,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -1653,7 +1668,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]
public FileContentResult GetDSYearStartisticsToExcel(object requestMsg) { public FileContentResult GetDSYearStartisticsToExcel(object requestMsg)
{
var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
JObject parms = JObject.Parse(requestParm.msg.ToString()); JObject parms = JObject.Parse(requestParm.msg.ToString());
int StartYear = parms.GetInt("StartYear", 0);//开始时间 年 int StartYear = parms.GetInt("StartYear", 0);//开始时间 年
......
...@@ -924,6 +924,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -924,6 +924,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
demodel.EduStudentId = (bmodel != null && bmodel.Id > 0) ? bmodel.StudentId : 0; demodel.EduStudentId = (bmodel != null && bmodel.Id > 0) ? bmodel.StudentId : 0;
demodel.IsCommission = 1; demodel.IsCommission = 1;
demodel.IsRollCall = 1; demodel.IsRollCall = 1;
demodel.WeiXinType = 0;
var umodel = userModule.GetMemberUserInfo(demodel.UserId); var umodel = userModule.GetMemberUserInfo(demodel.UserId);
demodel.OrderSource = umodel.Source; demodel.OrderSource = umodel.Source;
//判断当前人的点数 //判断当前人的点数
...@@ -988,8 +989,155 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -988,8 +989,155 @@ namespace Mall.WebApi.Controllers.AppletWeChat
#endregion #endregion
#region 甲小鹤活动报名
/// <summary>
/// 活动报名
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
[HttpPost]
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
public ApiResult SetActivityEnrollInfoJXH()
{
bool flag = false;
var request = RequestParm;
var userInfo = AppletUserInfo;
if (userInfo == null)
{
userInfo = new AppletUserInfo
{
UserId = RequestParm.UserId,
MallBaseId = RequestParm.MallBaseId,
TenantId = RequestParm.TenantId,
EduStudentId = RequestParm.EduStudentId
};
}
Model.Extend.Education.RB_Education_Consult_Extend demodel = JsonConvert.DeserializeObject<Model.Extend.Education.RB_Education_Consult_Extend>(request.msg.ToString());
demodel.EduStudentId = userInfo.EduStudentId;
var model = activityModule.GetActivityModule(demodel.ActivityId);
var list = activityModule.GetCommerceConsultListRepository(new Model.Extend.Education.RB_Education_Consult_Extend() { TenantId = model.TenantId, MallBaseId = model.MallBaseId, ActivityId = demodel.ActivityId, EnrollState = 1, EduStudentId = userInfo.EduStudentId, OrderStatus = 1 });
if (list.Any()) { return ApiResult.Failed("已存在报名信息"); }
if (model == null || model.Status == Common.Enum.DateStateEnum.Delete) { return ApiResult.Failed("活动不存在"); }
if (model.SignStartTime >= DateTime.Now)
{
return ApiResult.Failed("报名还未开始,无法报名");
}
if (model.SignEndTime <= DateTime.Now)
{
return ApiResult.Failed("已过了报名时间,无法报名");
}
var bmodel = activityModule.GetEducationBaseInfo(new Model.Extend.Education.RB_Education_BaseInfo_Extend() { MallBaseId = model.MallBaseId, TenantId = model.TenantId, UserId = userInfo.UserId }).FirstOrDefault();
if (model.Distinguish == 0)
{
if (demodel.Sex == 0)
{
return ApiResult.Failed("您的性别保密,无法报名");
}
if (demodel.Sex == 1)
{
int ManPeopleNum = activityModule.GetActivityEnrollNum(demodel.ActivityId, 1);
if (model.ManNum <= ManPeopleNum) { return ApiResult.Failed("已报满,无法报名"); }
}
else if (demodel.Sex == 2)
{
int WoManPeopleNum = activityModule.GetActivityEnrollNum(demodel.ActivityId, 2);
if (model.WoManNum <= WoManPeopleNum) { return ApiResult.Failed("已报满,无法报名"); }
}
else
{
return ApiResult.Failed("性别未维护,无法报名");
}
}
else
{
int ManPeopleNum = activityModule.GetActivityEnrollNum(demodel.ActivityId, 0);
if (model.ManNum <= ManPeopleNum) { return ApiResult.Failed("已报满,无法报名"); }
}
if (model.AgeLimit == 0)
{
if (string.IsNullOrWhiteSpace(demodel.StuBirth))
{
return ApiResult.Failed("您未绑定学员信息无法获取到年龄,无法报名");
}
int Age = Convert.ToInt32(Common.Plugin.StringHelper.GetAge(demodel.StuBirth));
if (model.StartAge > 0 && model.EndAge > 0)
{
if (Age < model.StartAge || Age > model.EndAge)
{
return ApiResult.Failed($"年龄限制在{model.StartAge}-{model.EndAge}岁,无法报名");
}
}
else if (model.StartAge > 0 && model.EndAge == 0)
{
if (Age < model.StartAge)
{
return ApiResult.Failed($"年龄必须大于{model.StartAge}岁,无法报名");
}
}
else if (model.StartAge == 0 && model.EndAge > 0)
{
if (Age > model.EndAge)
{
return ApiResult.Failed($"年龄必须小于{model.EndAge}岁,无法报名");
}
}
}
demodel.Sex = bmodel?.Sex ?? 0;
Random R = new Random();
int Rstr = R.Next(111, 999);
demodel.OrderNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + Rstr;
demodel.UserId = userInfo.UserId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.TenantId = userInfo.TenantId;
demodel.Status = 0;
demodel.IsCancelConfirm = model.IsCancelConfirm;
demodel.CreateTime = System.DateTime.Now;
demodel.IsCommission = 1;
demodel.IsRollCall = 1;
demodel.WeiXinType = 1;
var umodel = userModule.GetMemberUserInfo(demodel.UserId);
demodel.OrderSource = umodel.Source;
//判断当前人的点数
if (demodel.PaymentWay == Common.Enum.Goods.OrderPaymentTypeEnum.PayPoint)
{
if (umodel == null || umodel.Id == 0)
{
return ApiResult.Failed("用户信息不存在");
}
if (model.PointNum == demodel.TotalPoint)
{
if (umodel.PointNum < model.PointNum)
{
return ApiResult.Failed("您的点数不足,请充值后再试");
}
}
else
{
return ApiResult.Failed("支付点数不正确");
}
demodel.PaymentTime = System.DateTime.Now;
demodel.OrderStatus = 1;
flag = activityModule.SetActivityEnrollInfo(demodel, umodel) > 0;
return flag ? ApiResult.Success("报名成功") : ApiResult.Failed("出错了,请联系管理员");
}
else if (demodel.PaymentWay == Common.Enum.Goods.OrderPaymentTypeEnum.OnlinePayment)
{
return ApiResult.Failed("您暂时在线支付");
}
return ApiResult.Failed("支付方式错误");
}
#endregion
} }
} }
\ No newline at end of file
...@@ -2420,6 +2420,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2420,6 +2420,8 @@ namespace Mall.WebApi.Controllers.Education
x.UserId, x.UserId,
x.ActivityId, x.ActivityId,
x.EduStudentId, x.EduStudentId,
x.EduStudentName,
x.WeiXinType,
x.Remark, x.Remark,
x.IsApplyForCancel, x.IsApplyForCancel,
PaymentWay = x.PaymentWay.HasValue ? (int)x.PaymentWay : 0, PaymentWay = x.PaymentWay.HasValue ? (int)x.PaymentWay : 0,
......
...@@ -561,10 +561,13 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -561,10 +561,13 @@ namespace Mall.WebApi.Controllers.TradePavilion
if (oldModel.UserId != userInfo.UserId) { return ApiResult.Failed("无法修改此载体"); } if (oldModel.UserId != userInfo.UserId) { return ApiResult.Failed("无法修改此载体"); }
if (!string.IsNullOrWhiteSpace(query.StartingInfo) ) if (!string.IsNullOrWhiteSpace(query.StartingInfo))
{ {
query.FirstStoreTest = 1; query.FirstStoreTest = 1;
} }
else {
query.FirstStoreTest = 0;
}
if (query.OpenTime.HasValue) if (query.OpenTime.HasValue)
{ {
...@@ -572,6 +575,13 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -572,6 +575,13 @@ namespace Mall.WebApi.Controllers.TradePavilion
{ {
query.OpeningStatus = 1; query.OpeningStatus = 1;
} }
else
{
query.OpeningStatus = 0;
}
}
else {
query.OpeningStatus = 0;
} }
bool flag = carrierModule.SetCarrier(query); bool flag = carrierModule.SetCarrier(query);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
......
...@@ -1573,10 +1573,13 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1573,10 +1573,13 @@ namespace Mall.WebApi.Controllers.TradePavilion
query.MallBaseId = RequestParm.MallBaseId; query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId; query.TenantId = RequestParm.TenantId;
} }
if (!string.IsNullOrWhiteSpace(query.StartingInfo) ) if (!string.IsNullOrWhiteSpace(query.StartingInfo))
{ {
query.FirstStoreTest = 1; query.FirstStoreTest = 1;
} }
else {
query.FirstStoreTest = 0;
}
query.ShopNum = query.ShopNum ?? 0; query.ShopNum = query.ShopNum ?? 0;
query.BuiltUpArea = query.BuiltUpArea ?? 0; query.BuiltUpArea = query.BuiltUpArea ?? 0;
query.EndBuiltUpArea = query.EndBuiltUpArea ?? 0; query.EndBuiltUpArea = query.EndBuiltUpArea ?? 0;
......
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