Commit b52eaff6 authored by liudong1993's avatar liudong1993

简易报表调整

parent 2f083632
......@@ -273,5 +273,10 @@ namespace Edu.Model.Entity.Course
/// 预约单号
/// </summary>
public int VisitorReserveId { get; set; }
/// <summary>
/// 留学确认时间(确认后 才能发提成 才进报表)
/// </summary>
public DateTime? LXConfirmDate { get; set; }
}
}
......@@ -21,7 +21,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 年份
/// </summary>
public int? Year
public int Year
{
get;
set;
......@@ -37,7 +37,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 一月
/// </summary>
public decimal? January
public decimal January
{
get;
set;
......@@ -45,7 +45,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 二月
/// </summary>
public decimal? February
public decimal February
{
get;
set;
......@@ -53,7 +53,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 三月
/// </summary>
public decimal? March
public decimal March
{
get;
set;
......@@ -61,7 +61,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 第一季度
/// </summary>
public decimal? FirstQuarter
public decimal FirstQuarter
{
get;
set;
......@@ -69,7 +69,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 四月
/// </summary>
public decimal? April
public decimal April
{
get;
set;
......@@ -77,7 +77,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 五月
/// </summary>
public decimal? May
public decimal May
{
get;
set;
......@@ -85,7 +85,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 六月
/// </summary>
public decimal? June
public decimal June
{
get;
set;
......@@ -93,7 +93,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 第二季度
/// </summary>
public decimal? SecondQuarter
public decimal SecondQuarter
{
get;
set;
......@@ -101,7 +101,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 上半年报
/// </summary>
public decimal? HalfReport
public decimal HalfReport
{
get;
set;
......@@ -109,7 +109,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 七月
/// </summary>
public decimal? July
public decimal July
{
get;
set;
......@@ -117,7 +117,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 八月
/// </summary>
public decimal? August
public decimal August
{
get;
set;
......@@ -125,7 +125,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 九月
/// </summary>
public decimal? September
public decimal September
{
get;
set;
......@@ -133,7 +133,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 第三季度
/// </summary>
public decimal? ThirdQuarter
public decimal ThirdQuarter
{
get;
set;
......@@ -141,7 +141,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 十月
/// </summary>
public decimal? October
public decimal October
{
get;
set;
......@@ -149,7 +149,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 十一月
/// </summary>
public decimal? November
public decimal November
{
get;
set;
......@@ -157,7 +157,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 十二月
/// </summary>
public decimal? December
public decimal December
{
get;
set;
......@@ -165,7 +165,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 第四季度
/// </summary>
public decimal? FourthQuarter
public decimal FourthQuarter
{
get;
set;
......@@ -173,7 +173,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 下半年报
/// </summary>
public decimal? LastHalfReport
public decimal LastHalfReport
{
get;
set;
......@@ -181,7 +181,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 总计
/// </summary>
public decimal? Total
public decimal Total
{
get;
set;
......@@ -189,7 +189,7 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 集团ID
/// </summary>
public int? Rb_Group_Id
public int Rb_Group_Id
{
get;
set;
......@@ -197,16 +197,21 @@ namespace Edu.Model.Entity.Finance
/// <summary>
/// 所属公司
/// </summary>
public int? BranchId
public int BranchId
{
get; set;
}
/// <summary>
/// 排序
/// </summary>
public int? Sort
public int Sort
{
get; set;
}
/// <summary>
/// 费用类型
/// </summary>
public string CostTypeIds { get; set; }
}
}
......@@ -105,12 +105,17 @@ namespace Edu.Model.Entity.Finance
set;
}
/// <summary>
/// 是否进入营收报表
/// 是否进入营收报表 1是
/// </summary>
public int? Is_Report { get; set; }
/// <summary>
/// 是否是机密费用 1是 0否
/// </summary>
public int? IsSecret { get; set; }
/// <summary>
/// 费用类型 1费用(计算利润) 2往来 3其他
/// </summary>
public int ReportType { get; set; }
}
}
......@@ -137,10 +137,5 @@ namespace Edu.Model.Entity.StudyAbroad
/// </summary>
public string ImgCover { get; set; }
/// <summary>
/// 确认时间(确认后 才能发提成 才进报表)
/// </summary>
public DateTime? ConfirmDate { get; set; }
}
}
......@@ -117,6 +117,16 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string OPEndTime { get; set; }
/// <summary>
/// 确认开始时间
/// </summary>
public string ConfirmSTime { get; set; }
/// <summary>
/// 确认结束时间
/// </summary>
public string ConfirmETime { get; set; }
/// <summary>
/// 未收款
/// </summary>
......
......@@ -30,5 +30,65 @@ namespace Edu.Model.ViewModel.Finance
/// 跨年统计 起始月份
/// </summary>
public string StartMonth { get; set; }
/// <summary>
/// 是否更新 1是
/// </summary>
public int IsUpdate { get; set; }
}
/// <summary>
/// 报表分组
/// </summary>
public class ReportGroupModel {
/// <summary>
/// 费用id
/// </summary>
public int CostTypeId { get; set; }
/// <summary>
/// 费用名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 类型 1费用(计算利润) 2往来 3其他
/// </summary>
public int ReportType { get; set; }
/// <summary>
/// 收支 1收 2支
/// </summary>
public int IncomeType { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 子集
/// </summary>
public List<ReportChildModel> ChildList { get; set; }
}
/// <summary>
/// 子集
/// </summary>
public class ReportChildModel {
/// <summary>
/// 费用id
/// </summary>
public int CostTypeId { get; set; }
/// <summary>
/// 费用名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
}
}
......@@ -70,6 +70,10 @@ namespace Edu.Model.ViewModel.Finance
/// </summary>
public string GuestIdStr { get; set; }
/// <summary>
/// 费用类型id
/// </summary>
public int CostTypeId { get; set; }
/// <summary>
/// 审核开始时间
......
......@@ -84,15 +84,5 @@ namespace Edu.Model.ViewModel.StudyAbroad
/// 结束时间
/// </summary>
public string EndTime { get; set; }
/// <summary>
/// 确认开始时间
/// </summary>
public string ConfirmSTime { get; set; }
/// <summary>
/// 确认结束时间
/// </summary>
public string ConfirmETime { get; set; }
}
}
......@@ -558,7 +558,7 @@ namespace Edu.Module.Course
decimal TotalMoney = 0;
foreach (var item in plist)
{
var dateqList = DateList.Where(x => x.TeacherId == item.TeacherId && x.Date == item.ClassDate).ToList();
var dateqList = DateList.Where(x => x.TeacherId == item.TeacherId && x.ClassId == item.ClassId && x.Date == item.ClassDate).ToList();
//查询课时
decimal ksNum = dateqList.Sum(x => x.KSNum);
//查询课单价
......
This diff is collapsed.
......@@ -233,7 +233,8 @@ namespace Edu.Module.StudyAbroad
{
var model = studyAbroadRepository.GetStudyAbroadListExtRepository(new RB_StudyAbroad_ViewModel()
{
Id = Id
Id = Id,
School_Id = -1
})?.FirstOrDefault();
if (model != null && IsGetPrice == 1)
{
......
......@@ -666,12 +666,15 @@ GROUP BY tt.ClassId,tt.OrderGuestId
/// <param name="classNo"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetAllClassNowMonthStatistics(string startTime, string endTime, int classId, string classNo, int group_Id)
public List<RB_Class_Check_ViewModel> GetAllClassNowMonthStatistics(string startTime, string endTime, int classId, string classNo, int schoolId, int group_Id)
{
string where = "";
if (classId > 0) {
where += " and cc.ClassId =" + classId;
}
if (schoolId >= 0) {
where += " and c.School_Id =" + schoolId;
}
if (!string.IsNullOrEmpty(classNo)) {
where += " and c.ClassNo ='" + classNo + "'";
}
......
......@@ -90,6 +90,14 @@ namespace Edu.Repository.Course
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} =3";
}
}
if (!string.IsNullOrEmpty(demodel.ConfirmSTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.LXConfirmDate)} >='{demodel.ConfirmSTime}'";
}
if (!string.IsNullOrEmpty(demodel.ConfirmETime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.LXConfirmDate)} <='{demodel.ConfirmETime} 23:59:59'";
}
if (demodel.IsChaBan ==1 )
{
where += $@" and o.{nameof(RB_Order_ViewModel.IsChaBan)} ={demodel.IsChaBan}";
......@@ -810,5 +818,121 @@ where {where} order by {orderBy}
}
#endregion
#region 简易报表
/// <summary>
/// 获取列表留学
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Order_ViewModel> GetListForReport(RB_Order_ViewModel demodel)
{
string where = $@" 1=1 ";
if (demodel.Group_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.School_Id >= 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.School_Id)} ={demodel.School_Id}";
}
if (demodel.OrderId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (demodel.OrderType > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderType)} ={(int)demodel.OrderType}";
}
if (demodel.ClassId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
}
if (demodel.SourceId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.SourceId)} ={demodel.SourceId}";
}
if (demodel.CourseId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.CourseId)} ={demodel.CourseId}";
}
if (!string.IsNullOrEmpty(demodel.ClassIds))
{
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} in({demodel.ClassIds})";
}
if (!string.IsNullOrEmpty(demodel.SourceIds))
{
where += $@" and o.{nameof(RB_Order_ViewModel.SourceId)} in({demodel.SourceIds})";
}
if (demodel.OrderState > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} ={(int)demodel.OrderState}";
}
if (demodel.OrderSource > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if (demodel.OrderForm > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (demodel.Q_OrderState > 0)
{
if (demodel.Q_OrderState == 1)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} in(1,2)";
}
else if (demodel.Q_OrderState == 2)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} =3";
}
}
if (!string.IsNullOrEmpty(demodel.ConfirmSTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.LXConfirmDate)} >='{demodel.ConfirmSTime}'";
}
if (!string.IsNullOrEmpty(demodel.ConfirmETime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.LXConfirmDate)} <='{demodel.ConfirmETime} 23:59:59'";
}
if (demodel.IsChaBan == 1)
{
where += $@" and o.{nameof(RB_Order_ViewModel.IsChaBan)} ={demodel.IsChaBan}";
}
if (!string.IsNullOrEmpty(demodel.Q_EffectTime))
{
where += string.Format(" and DATE_FORMAT(o.EffectTime,'%y/%m/%d')=DATE_FORMAT('{0}','%y/%m/%d') ", demodel.Q_EffectTime);
}
string orderBy = " o.OrderId asc";
if (demodel.Q_OrderBy == 1)
{
orderBy = " o.OrderId asc";
}
else if (demodel.Q_OrderBy == 2)
{
orderBy = " o.CreateTime desc";
}
string sql = $@"
SELECT o.*,c.ClassName,t.TeacherName,t.TeacherIcon,IFNULL(course.CourseName,'') AS CourseName,c.OpenTime,IFNULL(course.ClassHours,0) AS ClassHours
FROM RB_Order o
LEFT JOIN rb_class c on o.ClassId = c.ClassId
LEFT JOIN rb_teacher t on c.Teacher_Id = t.TId
LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1)
WHERE {where}
ORDER BY {orderBy}
";
return Get<RB_Order_ViewModel>(sql).ToList();
}
#endregion
}
}
......@@ -40,7 +40,7 @@ namespace Edu.Repository.Finance
{
where += string.Format(" AND A." + nameof(RB_SimpleReport_Extend.BranchId) + " !=-1 ");
}
string sql = string.Format(@"SELECT * FROM {0} AS A WHERE {1} ", nameof(RB_SimpleReport), where);
string sql = string.Format(@"SELECT * FROM {0} AS A WHERE {1} order by Sort asc", nameof(RB_SimpleReport), where);
return Get<RB_SimpleReport_Extend>(sql).ToList();
}
}
......
......@@ -244,7 +244,7 @@ WHERE {1} {2} ", TableName, where, " ORDER BY A.FrID DESC");
where.Append(" AND b." + nameof(RB_Finance.FinanceType) + "=" + model.FinanceType + "");
}
builder.AppendFormat(@"select distinct b.FrID,IFNULL(b.MatchMoney,0) as MatchMoney,IFNULL(E.TCID,0)TCID,D.Name,b.Status,b.TradeDate,b.CreateDate,b.RB_Branch_Id,a.ID,a.CostTypeId,IFNULL(b.Is_Cashier,0)Is_Cashier,a.Money,b.OrderID,b.OrderSource,b.SourceID,IFNULL(b.PayMoney,0)PayMoney,IFNULL(b.Fee,0)Fee,b.Type
builder.AppendFormat(@"select distinct b.FrID,IFNULL(b.MatchMoney,0) as MatchMoney,IFNULL(E.TCID,0)TCID,D.Name,b.Status,b.TradeDate,b.CreateDate,b.RB_Branch_Id,a.ID,a.CostTypeId,IFNULL(b.Is_Cashier,0)Is_Cashier,a.Money,IFNULL(b.OrderID,0) OrderID,b.OrderSource,b.SourceID,IFNULL(b.PayMoney,0)PayMoney,IFNULL(b.Fee,0)Fee,b.Type
from rb_financedetail a INNER JOIN rb_finance as b on a.FinanceId=b.FrID and a.`Status`=0
INNER JOIN rb_costtype AS D ON D.ID=a.CostTypeId
LEFT JOIN rb_tradeway as td ON b.FrID=td.FinanceId
......
......@@ -196,6 +196,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id >= 0)
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_StudyAbroad_ViewModel.Name));
......@@ -229,14 +233,6 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0} <='{1} 23:59:59'", nameof(RB_StudyAbroad_ViewModel.CreateTime), query.EndTime);
}
if (!string.IsNullOrEmpty(query.ConfirmSTime))
{
builder.AppendFormat(" AND A.{0} >='{1}'", nameof(RB_StudyAbroad_ViewModel.ConfirmDate), query.ConfirmSTime);
}
if (!string.IsNullOrEmpty(query.ConfirmETime))
{
builder.AppendFormat(" AND A.{0} <='{1} 23:59:59'", nameof(RB_StudyAbroad_ViewModel.ConfirmDate), query.ConfirmETime);
}
return Get<RB_StudyAbroad_ViewModel>(builder.ToString(), parameters).ToList();
}
}
......
......@@ -884,7 +884,7 @@ namespace Edu.WebApi.Controllers.Finance
}
}
var obj = new { Status, UpdateStartTime, UpdateEndTime, list = list?.Select(y => new { y.ID, y.Year, y.BranchId, y.CostIds, y.Sort, ZhaiYao = y.Abstract, YiYue = y.January, ErYue = y.February, SanYue = y.March, DiYiJiDu = y.FirstQuarter, SiYue = y.April, WuYue = y.May, LiuYue = y.June, DiErJiDu = y.SecondQuarter, ShangBanNianBao = y.HalfReport, QiYue = y.July, BaYue = y.August, JiuYue = y.September, DiSanJiDu = y.ThirdQuarter, ShiYue = y.October, ShiYiYue = y.November, ShiErYue = y.December, DiSiJiDu = y.FourthQuarter, XiaBanNianBao = y.LastHalfReport, ZongJi = y.Total }) };
var obj = new { Status, UpdateStartTime, UpdateEndTime, list = list?.Select(y => new { y.ID, y.Year, y.BranchId, y.CostIds, y.CostTypeIds, y.Sort, ZhaiYao = y.Abstract, YiYue = y.January, ErYue = y.February, SanYue = y.March, DiYiJiDu = y.FirstQuarter, SiYue = y.April, WuYue = y.May, LiuYue = y.June, DiErJiDu = y.SecondQuarter, ShangBanNianBao = y.HalfReport, QiYue = y.July, BaYue = y.August, JiuYue = y.September, DiSanJiDu = y.ThirdQuarter, ShiYue = y.October, ShiYiYue = y.November, ShiErYue = y.December, DiSiJiDu = y.FourthQuarter, XiaBanNianBao = y.LastHalfReport, ZongJi = y.Total }) };
return ApiResult.Success("", obj);
}
......@@ -2000,6 +2000,7 @@ namespace Edu.WebApi.Controllers.Finance
string EndTime = base.ParmJObj.GetStringValue("EndTime");//结束时间
int ClassId = base.ParmJObj.GetInt("ClassId", 0);
string ClassNo = base.ParmJObj.GetStringValue("ClassNo");//班号
int SchoolId = base.ParmJObj.GetInt("SchoolId", -1);//校区id
if (string.IsNullOrEmpty(StartTime))
{
return ApiResult.ParamIsNull();
......@@ -2018,7 +2019,7 @@ namespace Edu.WebApi.Controllers.Finance
return ApiResult.Failed("日期格式有误,请核实后再试");
}
var Robj = financeModule.GetAllClassNowMonthStatistics(StartTime, EndTime, ClassId, ClassNo, userInfo);
var Robj = financeModule.GetAllClassNowMonthStatistics(StartTime, EndTime, ClassId, ClassNo, SchoolId, userInfo);
return ApiResult.Success("", Robj);
}
......
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