Commit 8a40daec authored by liudong1993's avatar liudong1993

1 甲鹤简易报表调整

parent c0bc9587
......@@ -3978,11 +3978,35 @@ namespace Edu.Module.Finance
/// <param name="contractNo"></param>
/// <param name="groupId"></param>
/// <returns></returns>
public List<ExcelDataSource> GetStudentConsumptionHoursDetialPageListToExcel(int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId)
public object GetStudentConsumptionHoursDetialStat(int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId, int studentId)
{
//根据学生签到表 查询
var list = class_CheckRepository.GetStudentConsumptionHoursDetialList(teacherId, schoolId, classId, startMonth, endMonth, studentName, orderId, contractNo, groupId, "", studentId);
return new
{
TClassHours = list?.Sum(x => x.CurrentDeductionHours) ?? 0,
TXHMoney = list?.Sum(x => Math.Round(x.UnitPrice * x.CurrentDeductionHours, 6, MidpointRounding.AwayFromZero)) ?? 0
};
}
/// <summary>
/// 导出Excel
/// </summary>
/// <param name="teacherId"></param>
/// <param name="schoolId"></param>
/// <param name="classId"></param>
/// <param name="startMonth"></param>
/// <param name="endMonth"></param>
/// <param name="studentName"></param>
/// <param name="orderId"></param>
/// <param name="contractNo"></param>
/// <param name="groupId"></param>
/// <returns></returns>
public List<ExcelDataSource> GetStudentConsumptionHoursDetialPageListToExcel(int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId, int studentId)
{
List<ExcelDataSource> RList = new List<ExcelDataSource>();
//根据学生签到表 查询
var list = class_CheckRepository.GetStudentConsumptionHoursDetialList(teacherId, schoolId, classId, startMonth, endMonth, studentName, orderId, contractNo, groupId);
var list = class_CheckRepository.GetStudentConsumptionHoursDetialList(teacherId, schoolId, classId, startMonth, endMonth, studentName, orderId, contractNo, groupId, "", studentId);
if (list.Any())
{
//查询关联销售
......
......@@ -717,7 +717,7 @@ ORDER BY tt.ClassDate ASC
/// <param name="contractNo"></param>
/// <param name="groupId"></param>
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetStudentConsumptionHoursDetialList(int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId, string classIds = "")
public List<RB_Class_Check_ViewModel> GetStudentConsumptionHoursDetialList(int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId, string classIds = "", int StudentId = 0)
{
string where = $@" ";
if (teacherId > 0)
......@@ -744,6 +744,10 @@ ORDER BY tt.ClassDate ASC
{
where += $@" and t2.OrderId ={orderId}";
}
if (StudentId > 0)
{
where += $@" and t2.Id ={StudentId}";
}
if (!string.IsNullOrEmpty(contractNo))
{
where += $@" and ec.ContractNo ='{contractNo}'";
......
......@@ -2134,6 +2134,44 @@ namespace Edu.WebApi.Controllers.Finance
return ApiResult.Success("", pageModel);
}
/// <summary>
/// 获取学生课耗统计
/// </summary>
/// <returns></returns>
public ApiResult GetStudentConsumptionHoursDetialStat() {
var userInfo = base.UserInfo;
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
int TeacherId = base.ParmJObj.GetInt("TeacherId", 0);
int SchoolId = base.ParmJObj.GetInt("SchoolId", 0);
int ClassId = base.ParmJObj.GetInt("ClassId", 0);
string StartMonth = base.ParmJObj.GetStringValue("StartMonth");
string EndMonth = base.ParmJObj.GetStringValue("EndMonth");
string StudentName = base.ParmJObj.GetStringValue("StudentName");//学生名称
int StudentId = base.ParmJObj.GetInt("StudentId", 0);//学员id
int OrderId = base.ParmJObj.GetInt("OrderId", 0);//订单
string ContractNo = base.ParmJObj.GetStringValue("ContractNo");//合同编号
if (string.IsNullOrEmpty(StartMonth))
{
return ApiResult.ParamIsNull("请选择开始月份");
}
if (string.IsNullOrEmpty(EndMonth))
{
return ApiResult.ParamIsNull("请选择结束月份");
}
try
{
StartMonth = Convert.ToDateTime(StartMonth + "-01").ToString("yyyy-MM-dd");
EndMonth = Convert.ToDateTime(EndMonth + "-01").AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
}
catch (Exception)
{
return ApiResult.Failed("日期格式有误");
}
var list = financeModule.GetStudentConsumptionHoursDetialStat(TeacherId, SchoolId, ClassId, StartMonth, EndMonth, StudentName, OrderId, ContractNo, userInfo.Group_Id, StudentId);
return ApiResult.Success("", list);
}
/// <summary>
/// 获取学生课时统计明细列表 Excel导出
/// </summary>
......@@ -2174,6 +2212,7 @@ namespace Edu.WebApi.Controllers.Finance
string EndMonth = base.ParmJObj.GetStringValue("EndMonth");
string StudentName = base.ParmJObj.GetStringValue("StudentName");//学生名称
int OrderId = base.ParmJObj.GetInt("OrderId", 0);//订单
int StudentId = base.ParmJObj.GetInt("StudentId", 0);//学员id
string ContractNo = base.ParmJObj.GetStringValue("ContractNo");//合同编号
if (string.IsNullOrEmpty(StartMonth))
{
......@@ -2196,7 +2235,7 @@ namespace Edu.WebApi.Controllers.Finance
return File(byteData1, "application/octet-stream", ExcelName);
}
var list = financeModule.GetStudentConsumptionHoursDetialPageListToExcel(TeacherId, SchoolId, ClassId, StartMonth, EndMonth, StudentName, OrderId, ContractNo, userInfo.Group_Id);
var list = financeModule.GetStudentConsumptionHoursDetialPageListToExcel(TeacherId, SchoolId, ClassId, StartMonth, EndMonth, StudentName, OrderId, ContractNo, userInfo.Group_Id, StudentId);
try
{
......
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