Commit be020b6e authored by 黄奎's avatar 黄奎

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents eac47786 e1c6451e
...@@ -164,7 +164,11 @@ namespace Edu.Common.Plugin ...@@ -164,7 +164,11 @@ namespace Edu.Common.Plugin
/// <returns>T</returns> /// <returns>T</returns>
public static T DeserializeObject<T>(this string value) where T : class public static T DeserializeObject<T>(this string value) where T : class
{ {
return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(value); JsonSerializerSettings jsSetting = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
};
return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(value, jsSetting);
} }
#region Json 字符串 转换为 DataTable数据集合 #region Json 字符串 转换为 DataTable数据集合
......
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using VT.FW.DB;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 教育合同协调实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Education_ContractAdjust
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 合同id
/// </summary>
public int ContractId { get; set; }
/// <summary>
/// 调整价格(正数表示减去)
/// </summary>
public decimal AdjustPrice { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// CreateBy
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// CreateTime
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateTime { get; set; }
}
}
...@@ -339,5 +339,10 @@ namespace Edu.Model.Entity.Finance ...@@ -339,5 +339,10 @@ namespace Edu.Model.Entity.Finance
/// 财务单据类型 1erp 2教育 /// 财务单据类型 1erp 2教育
/// </summary> /// </summary>
public int? FinanceType { get => financeType; set => financeType = value; } public int? FinanceType { get => financeType; set => financeType = value; }
/// <summary>
/// 学生名单id (教育)
/// </summary>
public int GuestId { get; set; }
} }
} }
using System;
using Edu.Common.Enum.Finance;
using VT.FW.DB;
namespace Edu.Model.Entity.Finance
{
/// <summary>
/// 教育轧账实体
/// </summary>
[Serializable]
[DB(ConnectionName = "FinanceConnection")]
public class RB_RollingAccount
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 月份
/// </summary>
public string Month { get; set; }
/// <summary>
/// 校区ids(-1表全部) 英文逗号分隔
/// </summary>
public string SchoolIds { get; set; }
/// <summary>
/// 状态 1正常 2停用
/// </summary>
public int State { get; set; }
/// <summary>
/// 集团id
/// </summary>
public int GroupId { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateTime { get; set; }
}
}
...@@ -28,6 +28,10 @@ namespace Edu.Model.ViewModel.Course ...@@ -28,6 +28,10 @@ namespace Edu.Model.ViewModel.Course
public int CheckNum { get; set; } public int CheckNum { get; set; }
/// <summary> /// <summary>
/// 已上课分钟数
/// </summary>
public int MinutesNum { get; set; }
/// 学员名称 /// 学员名称
/// </summary> /// </summary>
public string GuestName { get; set; } public string GuestName { get; set; }
......
using Edu.Model.Entity.Course;
using System;
using System.Collections.Generic;
namespace Edu.Model.ViewModel.Course
{
/// <summary>
/// 教育合同视协调图实体类
/// </summary>
public class RB_Education_ContractAdjust_ViewModel : RB_Education_ContractAdjust
{
}
}
...@@ -9,6 +9,78 @@ namespace Edu.Model.ViewModel.Course ...@@ -9,6 +9,78 @@ namespace Edu.Model.ViewModel.Course
/// </summary> /// </summary>
public class RB_Education_Contract_ViewModel : RB_Education_Contract public class RB_Education_Contract_ViewModel : RB_Education_Contract
{ {
#region 财务相关
/// <summary>
/// 财务单据
/// </summary>
public int FinanceId { get; set; }
/// <summary>
/// 交易方式
/// </summary>
public int TradeWay { get; set; }
/// <summary>
/// 账户id
/// </summary>
public int AccountId { get; set; }
#endregion
#region 统计相关
/// <summary>
/// 班级名称
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 调整金额
/// </summary>
public decimal AdjustPrice { get; set; }
/// <summary>
/// 财务单据列表
/// </summary>
public List<Model.ViewModel.Finance.RB_Finance_Extend> FinanceList { get; set; }
/// <summary>
/// 客人已交金额(出纳已审核)
/// </summary>
public decimal Income { get; set; }
/// <summary>
/// 支出金额
/// </summary>
public decimal Expend { get; set; }
/// <summary>
/// 已使用课时
/// </summary>
public int UseClassHours { get; set; }
/// <summary>
/// 单价
/// </summary>
public decimal Unit_Price { get; set; }
/// <summary>
/// 已使用课程费
/// </summary>
public decimal UseCourseFee { get; set; }
/// <summary>
/// 使用教材费
/// </summary>
public decimal UseBookFee { get; set; }
/// <summary>
/// 使用课件费
/// </summary>
public decimal UseCoursewareFee { get; set; }
#endregion
/// <summary> /// <summary>
/// 是否审核(1-是) /// 是否审核(1-是)
/// </summary> /// </summary>
......
...@@ -20,177 +20,7 @@ namespace Edu.Model.ViewModel.Finance ...@@ -20,177 +20,7 @@ namespace Edu.Model.ViewModel.Finance
/// 审批人信息 /// 审批人信息
/// </summary> /// </summary>
public List<AuditInfo> AuditList { get; set; } public List<AuditInfo> AuditList { get; set; }
#region 扩展属性
/// <summary>
/// 是否来自于日报表 1是 其他否
/// </summary>
public int? IsFromDayReport { get; set; }
/// <summary>
/// 合并单据ID
/// </summary>
public int? NewFinanceId { get; set; }
/// <summary>
/// 是否是平台款 合并 银行
/// </summary>
public int? IsPlatformMergeBank { get; set; }
/// <summary>
/// 签证产品 成本查询
/// </summary>
public int? IsVisaProductCost { get; set; }
/// <summary>
/// 是否是预付款单据 1是 其他否
/// </summary>
public int? IsAdvanceFinance { get; set; }
/// <summary>
/// 关联团队
/// </summary>
public int? ReTCID { get; set; }
/// <summary>
/// 查询会计设置的费用类型单据 1查询 其他不限
/// </summary>
public int? IsSelectKJSetCostType { get; set; }
/// <summary>
/// 会计设置费用类型id
/// </summary>
public int? KJCostTypeId { get; set; }
/// <summary>
/// 日本印象的 营业外收入 1是
/// </summary>
public int? IsJapanNonbusinessIncome { get; set; }
/// <summary>
/// 订单的交易方式
/// </summary>
public int? OrderTradeWay { get; set; }
/// <summary>
/// 平台名称
/// </summary>
public string PlatFormName { get; set; }
/// <summary>
/// 是否来自于收支款查询 1是 2否
/// </summary>
public int? IsFormRecPayQuery { get; set; }
/// <summary>
/// op提成期数的id
/// </summary>
public int? OPPeriodsId { get; set; }
/// <summary>
/// 账户员工id
/// </summary>
public int? AccountEmployeeId { get; set; }
/// <summary>
/// 资金池申请单流水号
/// </summary>
public string FApplyForNumber { get; set; }
/// <summary>
/// 公司名称
/// </summary>
public string BName { get; set; }
/// <summary>
/// 是否只查询外币单据 1是 其他否
/// </summary>
public int? IsSelectWBFinance { get; set; }
/// <summary>
/// 导入类型 1房 2餐
/// </summary>
public int? ImportType { get; set; }
/// <summary>
/// 团队用款补充
/// </summary>
public string TravelReplenish { get; set; }
/// <summary>
/// 机票损失航空公司类型
/// </summary>
public int? LossType { get; set; }
/// <summary>
/// 机票损失配置id
/// </summary>
public int? AirLossId { get; set; }
/// <summary>
/// 流程id
/// </summary>
public string TemplateIdStr { get; set; }
/// <summary>
/// 1是
/// </summary>
public int? IsRelevanceTravel { get; set; }
/// <summary>
/// 账户类型
/// </summary>
public BranchAccountEnum? BType { get; set; }
/// <summary>
/// 挂账冲抵金额
/// </summary>
public decimal? fmrMoney { get; set; }
/// <summary>
/// 团ids 2019-05-27 Add By:W
/// </summary>
public string TCIDs { get; set; }
/// <summary>
/// 团号
/// </summary>
public string TCNUM { get; set; }
/// <summary>
/// 地接团号
/// </summary>
public string DMCNum { get; set; }
/// <summary>
/// 酒店id
/// </summary>
public int? HotelId { get; set; }
/// <summary>
/// 订单状态
/// </summary>
public string StatusStr { get; set; }
/// <summary>
/// 详情表id
/// </summary>
public int? FdID { get; set; }
/// <summary>
/// 财务单据绑定的团id
/// </summary>
public int? FTCID { get; set; }
/// <summary>
/// 详情表id
/// </summary>
public string FdIDStr { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 是否来自于简易报表 1简易报表 2 年度排名统计 付款单需要根据创建日期查
/// </summary>
public int? IsFormEasyReport { get; set; }
/// <summary>
/// 来源 1票务阿米巴
/// </summary>
public int? SourceForm { get; set; }
/// <summary>
/// 支出原币金额
/// </summary>
public decimal? PayWBMoney { get; set; }
/// <summary>
/// 赔偿单id
/// </summary>
public int? ComplainID { get; set; }
/// <summary>
/// 国内票务期数的id
/// </summary>
public string BillIdStr { get; set; }
/// <summary> /// <summary>
/// 机票总金额 /// 机票总金额
/// </summary> /// </summary>
...@@ -199,77 +29,18 @@ namespace Edu.Model.ViewModel.Finance ...@@ -199,77 +29,18 @@ namespace Edu.Model.ViewModel.Finance
/// 机票总手续费 /// 机票总手续费
/// </summary> /// </summary>
public decimal? AirTotalPayMoney { get; set; } public decimal? AirTotalPayMoney { get; set; }
/// <summary>
/// 账户id
/// </summary>
public int? AccountId { get; set; }
/// <summary> /// <summary>
/// 账户列表 /// 账户列表
/// </summary> /// </summary>
public string AccountIdStr { get; set; } public string AccountIdStr { get; set; }
/// <summary>
/// 来源产品id str
/// </summary>
public string SourceIDStr { get; set; }
/// <summary>
/// 单据类型
/// </summary>
public string Types { get; set; }
/// <summary>
/// 1-常规单据,2-佣金单据
/// </summary>
public int? IsSpecial { get; set; }
/// <summary>
/// 是否查询非取消财务单据 1是 其他否
/// </summary>
public int? IsNotCancelFinance { get; set; }
/// <summary>
/// 是否查询非取消非驳回财务单据 1是 其他否
/// </summary>
public int? IsNotCancelAndRejectFinance { get; set; }
/// <summary> /// <summary>
/// 查询正常提交的订单 /// 查询正常提交的订单
/// </summary> /// </summary>
public int? IsSelectNormal { get; set; } public int? IsSelectNormal { get; set; }
/// <summary>
/// 是否是销售端的查询
/// </summary>
public int? IsSellOrderForm { get; set; }
/// <summary>
/// 是否是地接部专户查询
/// </summary>
public int? IsDiJieSelect { get; set; }
/// <summary>
/// 是否是票务部专户查询
/// </summary>
public int? IsAirTicketSelect { get; set; }
/// <summary>
/// 是否是机票责让查询 1是 其他否
/// </summary>
public int? IsAirResponsibilitySelect { get; set; }
/// <summary>
///
/// </summary>
//public List<RB_WorkflowAccount> walist { get; set; }
/// <summary>
/// 收款账号是否是平台账号
/// </summary>
public int? Is_Platform { get; set; }
/// <summary>
/// 财务单据颜色1-蓝色-已打单 2-平台出纳审核绿色- 3-银行出纳审核红色 4-通过
/// </summary>
public int? ColorType { get; set; }
///// <summary>
///// 排序0-团期1-汇款日期2-单号
///// </summary>
//public SortEnum? Sort { get; set; }
/// <summary> /// <summary>
/// 是否跟团相关 /// 是否跟团相关
/// </summary> /// </summary>
...@@ -279,46 +50,7 @@ namespace Edu.Model.ViewModel.Finance ...@@ -279,46 +50,7 @@ namespace Edu.Model.ViewModel.Finance
/// 是否查询利润专户 1不查询 其他查询 /// 是否查询利润专户 1不查询 其他查询
/// </summary> /// </summary>
public int? Is_ProfitFoHF { get; set; } public int? Is_ProfitFoHF { get; set; }
/// <summary>
/// 机票款没绑团显示线路名称
/// </summary>
public string LineName { get; set; }
/// <summary>
/// 外币期初金额
/// </summary>
public decimal? RStartMoney { get; set; }
/// <summary>g
/// 本位币期初金额
/// </summary>
public decimal? StartMoney { get; set; }
/// <summary>
/// 签证订单集合
/// </summary>
public string VisaIds { get; set; }
/// <summary>
/// 是否是合并单据1-是0-否
/// </summary>
public int Is_Merge { get; set; }
/// <summary>
/// 合并关系列表
/// </summary>
//public List<RB_FinanceRelation> financeRelations { get; set; }
/// <summary>
/// 单据ID集合
/// </summary>
public List<int> FrIDList { get; set; }
/// <summary>
/// 国内票务期数
/// </summary>
public string Term { get; set; }
/// <summary>
/// 开户人
/// </summary>
public string AccountHolder { get; set; }
/// <summary>
/// 是否临时领队0-临时1-正式
/// </summary>
public int? IsLeader { get; set; }
/// <summary> /// <summary>
///财务单据ID集合 ///财务单据ID集合
/// </summary> /// </summary>
...@@ -328,106 +60,13 @@ namespace Edu.Model.ViewModel.Finance ...@@ -328,106 +60,13 @@ namespace Edu.Model.ViewModel.Finance
/// 订单id /// 订单id
/// </summary> /// </summary>
public string OrderIdStr { get; set; } public string OrderIdStr { get; set; }
/// <summary>
/// 回调参数
/// </summary>
public object Obj { get; set; }
/// <summary>
/// 审批人信息
/// </summary>
//public List<AuditInfo> AuditList { get; set; }
/// <summary>
/// 指定审核人列表
/// </summary>
public List<int> emList { get; set; }
/// <summary>
/// 指定审核人姓名列表
/// </summary>
public List<string> emStrList { get; set; }
/// <summary>
/// 产品ID集合
/// </summary>
public List<int> TCIDList { get; set; }
/// <summary> /// <summary>
/// 团号和团队编号 /// 学生名单ids
/// </summary> /// </summary>
//public List<TCIDInfo> TCIDAndTCNUMList { get; set; } public string GuestIdStr { get; set; }
/// <summary>
/// 下一步审核ID
/// </summary>
public int? AuditId { get; set; }
/// <summary>
/// 下一步是否有审核人1-有2-最后一步
/// </summary>
public int? IsHave { get; set; }
/// <summary>
/// 节点描述
/// </summary>
public string AuditDescription { get; set; }
/// <summary>
/// 是否可以批量审批
/// </summary>
public int? IsBatchAudit { get; set; }
/// <summary> /// 方法
/// </summary>
public string Cmd { get; set; }
/// <summary>
/// 付款批次
/// </summary>
public string TicketNum { get; set; }
/// <summary>
/// 是否上传
/// </summary>
public int? IsUploadPic { get; set; }
/// <summary>
/// 订单下单据数量
/// </summary>
public int? FinanceNum { get; set; }
/// <summary>
/// 账户ID
/// </summary>
public int? BankID
{
get;
set;
}
/// <summary>
/// 账户类型
/// </summary>
public int? AccountType
{
get; set;
}
/// <summary>
/// 交易方式
/// </summary>
public BranchAccountEnum? TradeWay
{
get; set;
}
/// <summary>
/// 制单人ID
/// </summary>
public int? UpdateBy
{
get;
set;
}
/// <summary>
/// 单据名称
/// </summary>
public string FinanceName { get; set; }
/// <summary>
/// 制单开始时间
/// </summary>
public string sDate { get; set; }
/// <summary>
/// 制单结束时间
/// </summary>
public string eDate { get; set; }
/// <summary> /// <summary>
/// 审核开始时间 /// 审核开始时间
/// </summary> /// </summary>
...@@ -437,30 +76,10 @@ namespace Edu.Model.ViewModel.Finance ...@@ -437,30 +76,10 @@ namespace Edu.Model.ViewModel.Finance
/// </summary> /// </summary>
public DateTime? eAduitDate { get; set; } public DateTime? eAduitDate { get; set; }
/// <summary> /// <summary>
/// 费用类型ID
/// </summary>
public int? CostTypeID { get; set; }
/// <summary>
/// 费用类型名称 /// 费用类型名称
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// 费用类型集合
/// </summary>
public string CostTypeIDs { get; set; }
/// <summary>
/// 不包含的费用
/// </summary>
public string NotCostTypeIDs { get; set; }
/// <summary>
/// 费用类型Id
/// </summary>
public string CostTypeIdStr { get; set; }
/// <summary>
/// 客户idstr
/// </summary>
public string ClientIdStr { get; set; }
/// <summary>
/// 交易开始日期 /// 交易开始日期
/// </summary> /// </summary>
public string sTradeDate { get; set; } public string sTradeDate { get; set; }
...@@ -468,139 +87,23 @@ namespace Edu.Model.ViewModel.Finance ...@@ -468,139 +87,23 @@ namespace Edu.Model.ViewModel.Finance
/// 交易结束日期 /// 交易结束日期
/// </summary> /// </summary>
public string eTradeDate { get; set; } public string eTradeDate { get; set; }
/// <summary>
/// 发团开始时间
/// </summary>
public string QStartDate { get; set; }
/// <summary>
/// 发团结束时间
/// </summary>
public string QEndDate { get; set; }
/// <summary>
/// 开始金额
/// </summary>
public decimal? sMoney { get; set; }
/// <summary>
/// 结束金额
/// </summary>
public decimal? eMoney { get; set; }
/// <summary>
/// 币种ID
/// </summary>
public int? CurrencyId { get; set; }
/// <summary>
/// 币种名称
/// </summary>
public string CurrencyName { get; set; }
/// <summary>
/// 客户账户类型名称
/// </summary>
public string ClientTypeName { get; set; }
/// <summary>
/// 收入或者支出
/// </summary>
public string TypeName { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string CreateByStr { get; set; }
/// <summary>
/// 模板类型
/// </summary>
public WFTTemplateTypeEnum? TemplateType
{
get; set;
}
/// <summary>
/// 是否进入审核流程0-否1-是(审核驳回也为0)
/// </summary>
public int? InOrNotProcess
{
get; set;
}
/// <summary>
/// 是否催审 1是 0否
/// </summary>
public int? IsFinancePushOn { get; set; }
/// <summary>
/// 制单人和当前审核人是否是同一个人1-同一个人
/// </summary>
public int? Is_Self { get; set; }
/// <summary>
/// 窗口负责人
/// </summary>
//public List<RB_Window_Employee_Relation> WindowEmIdList { get; set; }
/// <summary>
/// 窗口ID
/// </summary>
public int? WindowId { get; set; }
///// <summary>
///// 出纳会计窗口
///// </summary>
//public WindowTypeEnum? WindowType { get; set; }
///// <summary>
///// 我发起的,我审批的,待我审批,抄送给我的,我作废的
///// </summary>
//public FinanceConditionEnum? Conditon { get; set; }
/// <summary> /// <summary>
/// 费用类型列表 /// 费用类型列表
/// </summary> /// </summary>
public List<string> CostTypeList { get; set; } public List<string> CostTypeList { get; set; }
/// <summary>
/// 原币金额列表
/// </summary>
public List<decimal> OriginalMoney { get; set; }
///// <summary>
///// 合并单据信息
///// </summary>
//public MergeInfo Merge { get; set; }
/// <summary>
/// 合并单据明细
/// </summary>
public List<RB_FinanceDetail_Extend> MergeDetailList { get; set; }
/// <summary>
/// 会计合并单据明细
/// </summary>
public List<RB_FinanceDetail_Extend> AccountantMergeDetailList { get; set; }
/// <summary>
/// 领队返款单据明细
/// </summary>
public List<RB_FinanceDetail_Extend> LeaderRefundDetailList { get; set; }
/// <summary>
/// 财务收据
/// </summary>
//public RB_Finance_Receipt_Extend ReceiptModel { get; set; }
/// <summary> /// <summary>
/// 单据明细 /// 单据明细
/// </summary> /// </summary>
public List<RB_FinanceDetail_Extend> detailList { get; set; } public List<RB_FinanceDetail_Extend> detailList { get; set; }
/// <summary>
/// 审核步骤
/// </summary>
public List<User.Rb_Workflow_AuditRelevance_Extend> AuditSteps { get; set; }
/// <summary>
/// 原路退款订单号
/// </summary>
//public List<RB_Online_Trade_Detail_Extend> TradeDetailList { get; set; }
/// <summary>
/// 地接一键审批单据
/// </summary>
public List<RB_FinanceDetail_Extend> DijieBathFinanceList { get; set; }
/// <summary> /// <summary>
/// 账户列表 /// 账户列表
/// </summary> /// </summary>
public List<RB_TradeWay_Extend> BankList { get; set; } public List<RB_TradeWay_Extend> BankList { get; set; }
/// <summary> /// <summary>
/// 合并后交易方式
/// </summary>
public List<RB_TradeWay_Extend> MergeBankList { get; set; }
/// <summary>
/// 凭证实体 /// 凭证实体
/// </summary> /// </summary>
public List<RB_Voucher_Extend> vorcherInos { get; set; } public List<RB_Voucher_Extend> vorcherInos { get; set; }
...@@ -610,108 +113,6 @@ namespace Edu.Model.ViewModel.Finance ...@@ -610,108 +113,6 @@ namespace Edu.Model.ViewModel.Finance
/// </summary> /// </summary>
public string TCIDStr { get; set; } public string TCIDStr { get; set; }
/// <summary>
/// 是否有效的状态 1是 其他否
/// </summary>
public int? EfficaciousStatus { get; set; }
/// <summary>
/// 是否自动产生财务单据
/// </summary>
public int? IsAutoPayFinance { get; set; }
#endregion
#region 统计数据
/// <summary>
/// 本位币上日余额
/// </summary>
public decimal? AgoMoney { get; set; }
/// <summary>
/// 外币上日余额
/// </summary>
public decimal? WBAgoMoney { get; set; }
/// <summary>
/// 外币借方金额
/// </summary>
public decimal? AgoIncome { get; set; }
/// <summary>
/// 本位币借方金额
/// </summary>
public decimal? Income { get; set; }
/// <summary>
/// 收据金额/未认款金额
/// </summary>
public decimal? ReceiptMoney { get; set; }
/// <summary>
/// 收据外币金额/未认款外币金额
/// </summary>
public decimal? ReceiptWBMoney { get; set; }
/// <summary>
/// 未付帐金额
/// </summary>
public decimal? NONPaymentMoney { get; set; }
/// <summary>
/// 未付帐外币
/// </summary>
public decimal? NONPaymentWBMoney { get; set; }
/// <summary>
/// 外币贷方金额
/// </summary>
public decimal? AgoOutCome { get; set; }
/// <summary>
/// 本位币贷方金额
/// </summary>
public decimal? OutCome { get; set; }
/// <summary>
/// 借方笔数
/// </summary>
public int? IncomeCount { get; set; }
/// <summary>
/// 贷方笔数
/// </summary>
public int? OutComeCount { get; set; }
/// <summary>
/// 别名
/// </summary>
public string Alias { get; set; }
/// <summary>
/// 账户类型ID
/// </summary>
public int? TypeId { get; set; }
/// <summary>
/// 账户类型名称
/// </summary>
public string AName { get; set; }
/// <summary>
/// 是否是银行
/// </summary>
public int? IsBank { get; set; }
#endregion
/// <summary>
/// 地接费领取总数
/// </summary>
public int DMCUsePriceCount { get; set; }
#region 收支款统计查询
/// <summary>
/// 应收金额
/// </summary>
public decimal? SumYingShou { get; set; }
/// <summary>
/// 实收金额
/// </summary>
public decimal? SumShiShou { get; set; }
/// <summary>
/// 应付金额
/// </summary>
public decimal? SumYingFu { get; set; }
/// <summary>
/// 实付金额
/// </summary>
public decimal? SumShiFu { get; set; }
#endregion
} }
/// <summary> /// <summary>
......
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Finance;
using VT.FW.DB;
namespace Edu.Model.ViewModel.Finance
{
/// <summary>
/// 教育轧账扩展表
/// </summary>
[Serializable]
[DB(ConnectionName = "FinanceConnection")]
public class RB_RollingAccount_Extend : RB_RollingAccount
{
/// <summary>
/// 校区id
/// </summary>
public int? SchoolId { get; set; }
/// <summary>
/// 姓名
/// </summary>
public string UpdateByName { get; set; }
/// <summary>
/// 校区列表
/// </summary>
public List<Model.ViewModel.User.RB_School_ViewModel> SchoolList { get; set; }
}
}
using Edu.AOP.CustomerAttribute; using Edu.AOP.CustomerAttribute;
using Edu.Cache.User; using Edu.Cache.User;
using Edu.Common;
using Edu.Common.API; using Edu.Common.API;
using Edu.Common.Enum; using Edu.Common.Enum;
using Edu.Common.Enum.Course; using Edu.Common.Enum.Course;
...@@ -10,6 +11,7 @@ using Edu.Model.ViewModel.Course; ...@@ -10,6 +11,7 @@ using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Log; using Edu.Model.ViewModel.Log;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Repository.Course; using Edu.Repository.Course;
using Edu.Repository.Finance;
using Edu.Repository.Log; using Edu.Repository.Log;
using Edu.Repository.StudyAbroad; using Edu.Repository.StudyAbroad;
using Edu.Repository.User; using Edu.Repository.User;
...@@ -94,6 +96,10 @@ namespace Edu.Module.Course ...@@ -94,6 +96,10 @@ namespace Edu.Module.Course
/// 合同 /// 合同
/// </summary> /// </summary>
private readonly RB_Education_ContractRepository education_ContractRepository = new RB_Education_ContractRepository(); private readonly RB_Education_ContractRepository education_ContractRepository = new RB_Education_ContractRepository();
/// <summary>
/// 合同协调金额
/// </summary>
private readonly RB_Education_ContractAdjustRepository education_ContractAdjustRepository = new RB_Education_ContractAdjustRepository();
/// <summary> /// <summary>
/// 留学就业仓储层对象 /// 留学就业仓储层对象
...@@ -105,6 +111,36 @@ namespace Edu.Module.Course ...@@ -105,6 +111,36 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
private readonly RB_Course_OfferRepository course_OfferRepository = new RB_Course_OfferRepository(); private readonly RB_Course_OfferRepository course_OfferRepository = new RB_Course_OfferRepository();
/// <summary>
/// 财务单据
/// </summary>
private readonly RB_FinanceRepository financeRepository = new RB_FinanceRepository();
/// <summary>
/// 财务单据详情
/// </summary>
private readonly RB_FinanceDetailRepository financeDetailRepository = new RB_FinanceDetailRepository();
/// <summary>
/// 交易方式
/// </summary>
private readonly RB_TradeWayRepository tradeWayRepository = new RB_TradeWayRepository();
/// <summary>
/// 币种
/// </summary>
private readonly RB_CurrencyRepository currencyRepository = new RB_CurrencyRepository();
/// <summary>
/// 银行账户
/// </summary>
private readonly RB_BackAccountRepository backAccountRepository = new RB_BackAccountRepository();
/// <summary>
/// 现金账户
/// </summary>
private readonly RB_CashPoolAccountRepository cashPoolAccountRepository = new RB_CashPoolAccountRepository();
/// <summary>
/// 平台账户
/// </summary>
private readonly RB_PlatformAccountRepository platformAccountRepository = new RB_PlatformAccountRepository();
#region 日语培训 #region 日语培训
...@@ -1719,5 +1755,187 @@ namespace Edu.Module.Course ...@@ -1719,5 +1755,187 @@ namespace Edu.Module.Course
return flag; return flag;
} }
#endregion #endregion
#region 财务统计
/// <summary>
/// 获取订单完成情况一览分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Education_Contract_ViewModel> GetOrderStudentClassHoursPageList(int pageIndex, int pageSize, out long count, RB_Education_Contract_ViewModel dmodel)
{
string datebaseStr = Config.ReadConfigKey("FinanceDateBase");//财务数据库
var list = education_ContractRepository.GetContractPageListForFinance(pageIndex, pageSize, out count, dmodel, datebaseStr);
if (list.Any()){
string orderIds = string.Join(",", list.Select(x => x.OrderId).Distinct());
string guestIds = string.Join(",", list.Select(x => x.GuestId).Distinct());
//查询所有的财务单据
var flist = financeRepository.GetListSingle(new Model.ViewModel.Finance.RB_Finance_Extend() { RB_Group_Id = dmodel.Group_Id, FinanceType = 2, IsSelectNormal = 1, OrderIdStr = orderIds, GuestIdStr = guestIds });
if (flist.Any()) {
string frIds = string.Join(",", flist.Select(x => x.FrID));
//查询单据明细
var fdlist = financeDetailRepository.GetList(new Model.ViewModel.Finance.RB_FinanceDetail_Extend() { GroupId = dmodel.Group_Id, FrIds = frIds });
//查询单据交易账户
var TradeList = tradeWayRepository.GetList(new Model.ViewModel.Finance.RB_TradeWay_Extend() { FrIdStr = frIds });
//获取币种列表
var CurrencyList = currencyRepository.GetList(new Model.Entity.Finance.RB_Currency() { RB_Group_Id = dmodel.Group_Id });
//查询四大账户
var BankList = new List<Model.ViewModel.Finance.RB_BackAccount_Extend>();
if (TradeList.Where(x => x.Type == Common.Enum.Finance.BranchAccountEnum.Bank).Any())
{
BankList = backAccountRepository.GetList(new Model.ViewModel.Finance.RB_BackAccount_Extend() { AccountIdStr = string.Join(",", TradeList.Where(x => x.Type == Common.Enum.Finance.BranchAccountEnum.Bank).Select(x => x.AccountId ?? 0).Distinct()) });
}
var CashPoolList = new List<Model.ViewModel.Finance.RB_CashPoolAccount_Extend>();
if (TradeList.Where(x => x.Type == Common.Enum.Finance.BranchAccountEnum.CashPool).Any())
{
CashPoolList = cashPoolAccountRepository.GetList(new Model.ViewModel.Finance.RB_CashPoolAccount_Extend() { AccountIdStr = string.Join(",", TradeList.Where(x => x.Type == Common.Enum.Finance.BranchAccountEnum.CashPool).Select(x => x.AccountId ?? 0).Distinct()) });
}
var PlatformList = new List<Model.ViewModel.Finance.RB_PlatformAccount_Extend>();
if (TradeList.Where(x => x.Type == Common.Enum.Finance.BranchAccountEnum.Platform).Any())
{
PlatformList = platformAccountRepository.GetList(new Model.ViewModel.Finance.RB_PlatformAccount_Extend() { AccountIdStr = string.Join(",", TradeList.Where(x => x.Type == Common.Enum.Finance.BranchAccountEnum.Platform).Select(x => x.AccountId ?? 0).Distinct()) });
}
List<Model.ViewModel.Finance.RB_TradeWay_Extend> tlist = new List<Model.ViewModel.Finance.RB_TradeWay_Extend>();
foreach (var TradeModel in TradeList)
{
Model.ViewModel.Finance.RB_TradeWay_Extend accountInFo = TradeModel.RefMapperTo<Model.ViewModel.Finance.RB_TradeWay_Extend>();
accountInFo.CurrencyName = CurrencyList.Where(x => x.ID == TradeModel.CurrencyId).FirstOrDefault()?.Name ?? "";
if (TradeModel.Type == Common.Enum.Finance.BranchAccountEnum.Bank)
{
var bank = BankList.Where(x => x.ID == TradeModel.AccountId).FirstOrDefault();
if (bank != null)
{
accountInFo.Alias = bank.Alias;
accountInFo.BankNo = bank.BackNo;
accountInFo.Type = Common.Enum.Finance.BranchAccountEnum.Bank;
accountInFo.AccountTypeId = bank.TypeId;
}
}
else if (TradeModel.Type == Common.Enum.Finance.BranchAccountEnum.CashPool)
{
var pool = CashPoolList.Where(x => x.ID == TradeModel.AccountId).FirstOrDefault();
if (pool != null)
{
accountInFo.Alias = pool.Alias;
accountInFo.BankNo = "";
accountInFo.Type = Common.Enum.Finance.BranchAccountEnum.CashPool;
accountInFo.AccountTypeId = pool.TypeId;
}
}
else if (TradeModel.Type == Common.Enum.Finance.BranchAccountEnum.Platform)
{
var platform = PlatformList.Where(x => x.ID == TradeModel.AccountId).FirstOrDefault();
if (platform != null)
{
accountInFo.Alias = platform.Alias;
accountInFo.BankNo = platform.PlatformNo;
accountInFo.Type = Common.Enum.Finance.BranchAccountEnum.Platform;
accountInFo.AccountTypeId = platform.TypeId;
}
}
tlist.Add(accountInFo);
}
foreach (var item in flist) {
item.detailList = fdlist.Where(x => x.FinanceId == item.FrID).ToList();
item.BankList = tlist.Where(x => x.FinanceId == item.FrID).ToList();
}
}
//查询所有学生的已上课时间
var stuTimeList = class_CheckRepository.GetClassGuestStudentTimeList(dmodel.Group_Id, guestIds);
//查询基础课时时长
var configModel = class_ConfigRepository.GetClassConfigRepository(new RB_Class_Config_ViewModel() { Group_Id = dmodel.Group_Id });
//用户信息
var userIds = string.Join(",", list.Select(x => x.CreateBy).Distinct());
var alist = accountRepository.GetAccountListExtRepository(new Model.ViewModel.User.RB_Account_ViewModel() { QIds = userIds });
foreach (var item in list) {
#region 财务单据
item.FinanceList = flist.Where(x => x.GuestId == item.GuestId).ToList();
item.Income = item.FinanceList.Where(x => x.Type == Common.Enum.Finance.WFTempLateClassEnum.IN && x.Is_Cashier == 1).Sum(x => (x.Money ?? 0) + (x.Fee ?? 0));//出纳审核算有效金额
item.Expend = item.FinanceList.Where(x => x.Type == Common.Enum.Finance.WFTempLateClassEnum.OUT).Sum(x => (x.Money ?? 0) + (x.Fee ?? 0));//制单就算
#endregion
var stuModel = stuTimeList.Where(x => x.OrderGuestId == item.GuestId).FirstOrDefault();
if (configModel == null || configModel.BasicMinutes <= 0) {
item.UseClassHours = 0;
}
else{
item.UseClassHours = (int)Math.Ceiling(Convert.ToDecimal(stuModel?.MinutesNum ?? 0) / configModel.BasicMinutes);// 已上课时 (暂时向上取整)
}
item.Unit_Price = 0;
item.UseCourseFee = 0;
if (item.TotalClassHours > 0)
{
if (item.TotalDiscountMoney > 0)
{
item.Unit_Price = Math.Round((item.TotalCourseFee - (item.TotalDiscountMoney / item.TotalSub) * item.TotalCourseFee) / item.TotalClassHours, 6, MidpointRounding.AwayFromZero);//根据合同计算(包含优惠, 需减去课件费等)
item.UseCourseFee = Math.Round((Convert.ToDecimal(item.UseClassHours) / item.TotalClassHours) * (item.TotalCourseFee - (item.TotalDiscountMoney / item.TotalSub) * item.TotalCourseFee), 6, MidpointRounding.AwayFromZero);
}
else
{
item.Unit_Price = Math.Round(item.TotalCourseFee / item.TotalClassHours, 6, MidpointRounding.AwayFromZero);//根据合同计算(包含优惠, 需减去课件费等)
item.UseCourseFee = Math.Round((Convert.ToDecimal(item.UseClassHours) / item.TotalClassHours) * item.TotalClassHours, 6, MidpointRounding.AwayFromZero);
}
}
item.UseBookFee = item.TotalBookFee;
item.UseCoursewareFee = item.TotalClassFee;
if (item.TotalDiscountMoney > 0)
{
item.UseBookFee = Math.Round(item.TotalBookFee - (item.TotalDiscountMoney / item.TotalSub) * item.TotalBookFee, 6, MidpointRounding.AwayFromZero);//(优惠比例)
item.UseCoursewareFee = Math.Round(item.TotalClassFee - (item.TotalDiscountMoney / item.TotalSub) * item.TotalClassFee, 6, MidpointRounding.AwayFromZero);//(优惠比例)
}
//用户信息
var amodel = alist.Where(x => x.Id == item.CreateBy).FirstOrDefault();
item.CreateByName = amodel?.AccountName ?? "";
item.CreateByPhoto = amodel?.UserIcon ?? "";
}
}
return list;
}
/// <summary>
/// 新增修改合同协调
/// </summary>
/// <param name="dmodel"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool SetContractAdjustPrice(RB_Education_ContractAdjust_ViewModel dmodel, UserInfo userInfo)
{
var list = education_ContractAdjustRepository.GetList(new RB_Education_ContractAdjust_ViewModel() { Group_Id = userInfo.Group_Id, ContractId = dmodel.ContractId });
if (list.Any())
{
var model = list.FirstOrDefault();
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Education_ContractAdjust_ViewModel.AdjustPrice),dmodel.AdjustPrice},
{ nameof(RB_Education_ContractAdjust_ViewModel.UpdateBy),userInfo.Id},
{ nameof(RB_Education_ContractAdjust_ViewModel.UpdateTime),DateTime.Now},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Education_ContractAdjust_ViewModel.Id),
FiledValue= model.Id,
OperatorEnum=OperatorEnum.Equal
}
};
return education_ContractAdjustRepository.Update(keyValues, wheres);
}
else {
return education_ContractAdjustRepository.Insert(new Model.Entity.Course.RB_Education_ContractAdjust()
{
Id = 0,
ContractId = dmodel.ContractId,
AdjustPrice = dmodel.AdjustPrice,
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
Group_Id = userInfo.Group_Id,
UpdateBy = userInfo.Id,
UpdateTime = DateTime.Now
}) > 0;
}
}
#endregion
} }
} }
...@@ -10,6 +10,7 @@ using Edu.Repository.Course; ...@@ -10,6 +10,7 @@ using Edu.Repository.Course;
using Edu.Repository.Finance; using Edu.Repository.Finance;
using Edu.Repository.StudyAbroad; using Edu.Repository.StudyAbroad;
using Edu.Repository.User; using Edu.Repository.User;
using VT.FW.DB;
namespace Edu.Module.Finance namespace Edu.Module.Finance
{ {
...@@ -103,9 +104,13 @@ namespace Edu.Module.Finance ...@@ -103,9 +104,13 @@ namespace Edu.Module.Finance
/// </summary> /// </summary>
private readonly RB_StudyAbroadRepository studyAbroadRepository = new RB_StudyAbroadRepository(); private readonly RB_StudyAbroadRepository studyAbroadRepository = new RB_StudyAbroadRepository();
/// <summary> /// <summary>
/// 供应商 /// 月结设置
/// </summary> /// </summary>
private readonly RB_SupplierRepository supplierRepository = new RB_SupplierRepository(); private readonly RB_RollingAccountRepository rollingAccountRepository = new RB_RollingAccountRepository();
/// <summary>
/// 账户
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
...@@ -2173,5 +2178,103 @@ namespace Edu.Module.Finance ...@@ -2173,5 +2178,103 @@ namespace Edu.Module.Finance
} }
#endregion #endregion
#region 月结窗口
/// <summary>
/// 月结设置分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_RollingAccount_Extend> GetFinanceMonthStatementPageList(int pageIndex, int pageSize, out long count, RB_RollingAccount_Extend dmodel)
{
var list = rollingAccountRepository.GetPageList(pageIndex, pageSize, out count, dmodel);
if (list.Any()) {
//查询校区
List<int> SchoolIdList = JsonHelper.DeserializeObject<List<int>>("[" + string.Join(",", list.Select(x => x.SchoolIds)) + "]");
string SchoolIds = string.Join(",", SchoolIdList.Where(x => x >= 0).Distinct().ToList());
var schoolList = schoolRepository.GetSchoolListRepository(new Model.ViewModel.User.RB_School_ViewModel() { Group_Id = dmodel.GroupId, QSIds = SchoolIds });
//查询创建人
string userIds = string.Join(',', list.Select(x => x.UpdateBy).Distinct());
var userList = accountRepository.GetEmployeeListRepository(new Model.ViewModel.User.Employee_ViewModel() { Group_Id = dmodel.GroupId, QIds = userIds });
foreach (var item in list) {
item.UpdateByName = userList.Where(x => x.Id == item.UpdateBy).FirstOrDefault()?.EmployeeName ?? "";
item.SchoolList = new List<Model.ViewModel.User.RB_School_ViewModel>();
if (item.SchoolIds == "-1")
{
item.SchoolList.Add(new Model.ViewModel.User.RB_School_ViewModel()
{
SId = -1,
SName = "全部"
});
}
else {
List<int> SchoolId2List = JsonHelper.DeserializeObject<List<int>>("[" + item.SchoolIds + "]");
var sList = schoolList.Where(x => SchoolId2List.Contains(x.SId)).ToList();
item.SchoolList = sList;
}
}
}
return list;
}
/// <summary>
/// 新增/修改 月结设置
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public string SetFinanceMonthStatementInfo(RB_RollingAccount_Extend dmodel)
{
if (dmodel.Id > 0)
{
//验证 除此之外 其他是否有包含
var list = rollingAccountRepository.GetList(new RB_RollingAccount_Extend() { GroupId = dmodel.GroupId, Month = dmodel.Month });
list = list.Where(x => x.Id != dmodel.Id).ToList();
if (list.Any()) {
foreach (var item in dmodel.SchoolList) {
if (list.Where(x => ("," + x.SchoolIds + ",").Contains("," + item.SId + ",")).Any()) {
return item.SName + "已存在其他设置里,请核实后再试";
}
}
}
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_RollingAccount_Extend.Month), dmodel.Month},
{ nameof(RB_RollingAccount_Extend.SchoolIds), dmodel.SchoolIds},
{ nameof(RB_RollingAccount_Extend.State), dmodel.State},
{ nameof(RB_RollingAccount_Extend.UpdateBy), dmodel.UpdateBy},
{ nameof(RB_RollingAccount_Extend.UpdateTime), dmodel.UpdateTime},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_RollingAccount_Extend.Id),
FiledValue=dmodel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
bool flag = rollingAccountRepository.Update(keyValues, wheres);
return flag ? "" : "出错了,请联系管理员";
}
else {
var list = rollingAccountRepository.GetList(new RB_RollingAccount_Extend() { GroupId = dmodel.GroupId, Month = dmodel.Month });
if (list.Any())
{
foreach (var item in dmodel.SchoolList)
{
if (list.Where(x => ("," + x.SchoolIds + ",").Contains("," + item.SId + ",")).Any())
{
return item.SName + "已存在其他设置里,请核实后再试";
}
}
}
bool flag = rollingAccountRepository.Insert(dmodel) >0;
return flag ? "" : "出错了,请联系管理员";
}
}
#endregion
} }
} }
...@@ -234,5 +234,16 @@ GROUP BY A.ClassId ...@@ -234,5 +234,16 @@ GROUP BY A.ClassId
return Get<RB_Class_Check_ViewModel>(builder.ToString()).ToList(); return Get<RB_Class_Check_ViewModel>(builder.ToString()).ToList();
} }
/// <summary>
/// 获取学生的上课时间
/// </summary>
/// <param name="groupId"></param>
/// <param name="guestIds"></param>
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetClassGuestStudentTimeList(int groupId,string guestIds)
{
string sql = $@"SELECT OrderGuestId, SUM(StudyNum) as MinutesNum FROM rb_class_check where `Status`=0 and Group_Id ={groupId} and CheckStatus =0 and OrderGuestId in ({guestIds}) group by OrderGuestId";
return Get<RB_Class_Check_ViewModel>(sql).ToList();
}
} }
} }
using Edu.Common.Enum;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
{
/// <summary>
/// 教育合同仓储层
/// </summary>
public class RB_Education_ContractAdjustRepository : BaseRepository<RB_Education_ContractAdjust>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_Education_ContractAdjust_ViewModel> GetList(RB_Education_ContractAdjust_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" AND {nameof(RB_Education_ContractAdjust_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.ContractId > 0)
{
where += $@" AND {nameof(RB_Education_ContractAdjust_ViewModel.ContractId)} ={demodel.ContractId}";
}
string sql = $@" SELECT * FROM RB_Education_ContractAdjust WHERE {where} ORDER BY Id DESC";
return Get<RB_Education_ContractAdjust_ViewModel>(sql).ToList();
}
}
}
...@@ -157,5 +157,81 @@ namespace Edu.Repository.Course ...@@ -157,5 +157,81 @@ namespace Edu.Repository.Course
var obj = base.ExecuteScalar(builder.ToString(), parameters); var obj = base.ExecuteScalar(builder.ToString(), parameters);
return obj == null ? 0 : Convert.ToInt32(obj); return obj == null ? 0 : Convert.ToInt32(obj);
} }
/// <summary>
/// 获取订单完成情况一览 分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <param name="datebaseStr"></param>
/// <returns></returns>
public List<RB_Education_Contract_ViewModel> GetContractPageListForFinance(int pageIndex, int pageSize, out long rowsCount, RB_Education_Contract_ViewModel demodel, string datebaseStr)
{
DynamicParameters parameters = new DynamicParameters();
string where = $@" 1=1";
where += $@" AND c.{nameof(RB_Education_Contract_ViewModel.Status)} =2 ";//只查询已审核通过的
if (demodel.Group_Id > 0)
{
where += $@" AND c.{nameof(RB_Education_Contract_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.School_Id > 0)
{
where += $@" AND c.{nameof(RB_Education_Contract_ViewModel.School_Id)} ={demodel.School_Id}";
}
if (demodel.OrderId > 0)
{
where += $@" AND c.{nameof(RB_Education_Contract_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (demodel.CType > 0)
{
where += $@" AND c.{nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
}
if (!string.IsNullOrEmpty(demodel.ContractNo))
{
where += $@" AND c.{nameof(RB_Education_Contract_ViewModel.ContractNo)} LIKE @ContractNo ";
parameters.Add("ContractNo", "%" + demodel.ContractNo.Trim() + "%");
}
if (!string.IsNullOrEmpty(demodel.StudentName))
{
where += $@" AND c.{nameof(RB_Education_Contract_ViewModel.StudentName)} LIKE @StudentName ";
parameters.Add("StudentName", "%" + demodel.StudentName.Trim() + "%");
}
if (!string.IsNullOrEmpty(demodel.CourseName))
{
where += $@" AND c.{nameof(RB_Education_Contract_ViewModel.CourseName)} LIKE @CourseName ";
parameters.Add("CourseName", "%" + demodel.CourseName.Trim() + "%");
}
if (!string.IsNullOrEmpty(demodel.ClassName))
{
where += $@" AND c1.{nameof(RB_Education_Contract_ViewModel.ClassName)} LIKE @ClassName ";
parameters.Add("ClassName", "%" + demodel.ClassName.Trim() + "%");
}
if (demodel.CreateBy > 0)
{
where += $@" AND c.{nameof(RB_Education_Contract_ViewModel.CreateBy)} ={demodel.CreateBy}";
}
if (demodel.FinanceId > 0)
{
where += $@" AND f.FrID ={demodel.FinanceId}";
}
if (demodel.TradeWay > 0)
{
where += $@" AND t.Type ={demodel.TradeWay}";
}
if (demodel.AccountId > 0)
{
where += $@" AND t.AccountId ={demodel.AccountId}";
}
string sql = $@" SELECT c.*,c1.ClassName,ca.AdjustPrice FROM RB_Education_Contract c
left join RB_Education_ContractAdjust ca on c.Id = ca.ContractId
left join rb_order o on c.OrderId = o.OrderId
left join rb_class c1 on o.ClassId = c1.ClassId
left join {datebaseStr}.rb_finance f on c.GuestId = f.GuestId and c.OrderId = f.OrderID and f.`Status` !=4
left join {datebaseStr}.rb_tradeway t on f.FrID = t.FinanceId
WHERE {where} GROUP BY c.Id ORDER BY c.Id DESC ";
return GetPage<RB_Education_Contract_ViewModel>(pageIndex, pageSize, out rowsCount, sql, parameters).ToList();
}
} }
} }
...@@ -85,6 +85,14 @@ namespace Edu.Repository.Finance ...@@ -85,6 +85,14 @@ namespace Edu.Repository.Finance
{ {
where += string.Format(" AND A." + nameof(RB_Finance.OrderID) + " in({0})", model.OrderIdStr); where += string.Format(" AND A." + nameof(RB_Finance.OrderID) + " in({0})", model.OrderIdStr);
} }
if (model.GuestId > 0)
{
where += string.Format(" AND A." + nameof(RB_Finance.GuestId) + " ={0}", model.GuestId);
}
if (!string.IsNullOrWhiteSpace(model.GuestIdStr))
{
where += string.Format(" AND A." + nameof(RB_Finance.GuestId) + " in({0})", model.GuestIdStr);
}
if (model.Type > 0) if (model.Type > 0)
{ {
where += string.Format(" AND A." + nameof(RB_Finance.Type) + " ={0}", (int)model.Type); where += string.Format(" AND A." + nameof(RB_Finance.Type) + " ={0}", (int)model.Type);
......
using System.Collections.Generic;
using System.Linq;
using Edu.Common.Enum;
using Edu.Model.Entity.Finance;
using Edu.Model.ViewModel.Finance;
namespace Edu.Repository.Finance
{
/// <summary>
/// 教育轧账仓储层
/// </summary>
public class RB_RollingAccountRepository : BaseRepository<RB_RollingAccount>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public List<RB_RollingAccount_Extend> GetList(RB_RollingAccount_Extend model)
{
string where = " WHERE 1=1 ";
if (model.GroupId > 0)
{
where += string.Format(" AND " + nameof(RB_RollingAccount_Extend.GroupId) + "={0} ", model.GroupId);
}
if (model.State > 0)
{
where += string.Format(" AND " + nameof(RB_RollingAccount_Extend.State) + "={0} ", model.State);
}
if (!string.IsNullOrEmpty(model.Month))
{
where += string.Format(" AND " + nameof(RB_RollingAccount_Extend.Month) + "='{0}' ", model.Month);
}
if (model.SchoolId >= 0)
{
where += string.Format(" AND FIND_IN_SET('{0}',"+ nameof(RB_RollingAccount_Extend.SchoolIds) + ") ", model.SchoolId);
}
string sql = "select * from RB_RollingAccount " + where +" order by Id desc";
return Get<RB_RollingAccount_Extend>(sql).ToList();
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="model"></param>
/// <returns></returns>
public List<RB_RollingAccount_Extend> GetPageList(int pageIndex,int pageSize,out long count,RB_RollingAccount_Extend model)
{
string where = " WHERE 1=1 ";
if (model.GroupId > 0)
{
where += string.Format(" AND " + nameof(RB_RollingAccount_Extend.GroupId) + "={0} ", model.GroupId);
}
if (model.State > 0)
{
where += string.Format(" AND " + nameof(RB_RollingAccount_Extend.State) + "={0} ", model.State);
}
if (!string.IsNullOrEmpty(model.Month))
{
where += string.Format(" AND " + nameof(RB_RollingAccount_Extend.Month) + "='{0}' ", model.Month);
}
if (model.SchoolId >= 0)
{
where += string.Format(" AND FIND_IN_SET('{0}'," + nameof(RB_RollingAccount_Extend.SchoolIds) + ") ", model.SchoolId);
}
string sql = "select * from RB_RollingAccount " + where + " order by Id desc";
return GetPage<RB_RollingAccount_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
}
}
...@@ -993,5 +993,416 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -993,5 +993,416 @@ namespace Edu.WebApi.Controllers.Finance
} }
#endregion #endregion
#region 财务查询
/// <summary>
/// 获取订单完成情况一览分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOrderStudentClassHoursPageList() {
var userInfo = base.UserInfo;
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var dmodel = JsonHelper.DeserializeObject<RB_Education_Contract_ViewModel>(RequestParm.Msg.ToString());
dmodel.Group_Id = userInfo.Group_Id;
dmodel.CType = Common.Enum.Course.ContractTypeEnum.Train;//这里只看培训的
var list = orderModule.GetOrderStudentClassHoursPageList(pageModel.PageIndex, pageModel.PageSize, out long count, dmodel);
pageModel.Count = Convert.ToInt32(count);
pageModel.PageData = list.Select(x => new
{
x.Id,
x.OrderId,
CreateTime = x.CreateTime.ToString("yyyy-MM-dd"),
x.ContractNo,
x.CourseName,
x.ClassName,
x.StudentName,
x.CreateByName,
x.CreateByPhoto,
x.TotalCourseFee,
x.TotalClassHours,
TotalUnitPrice = Math.Round(x.TotalCourseFee / x.TotalClassHours, 2, MidpointRounding.AwayFromZero),
x.TotalBookFee,
x.TotalClassFee,
x.TotalSub,
x.TotalDiscountMoney,
x.TotalMoney,
IncomeList = x.FinanceList.Where(x => x.Type == WFTempLateClassEnum.IN).Select(z => new
{
z.FrID,
TradeDate = z.TradeDate.HasValue ? z.TradeDate.Value.ToString("yyyy-MM-dd") : "",
Money = (z.Money ?? 0) + (z.Fee ?? 0),
DetailList = z.detailList.Select(y => new
{
y.ID,
y.CostTypeId,
y.CostTypeName,
y.CurrencyId,
y.CurrencyName,
y.Money
}),
TradeWayList = z.BankList.Select(y => new
{
y.ID,
y.Type,
TypeName = y.Type.ToName(),
y.AccountId,
y.Alias,
y.BankNo,
y.AccountTypeId
})
}),
ExpendList = x.FinanceList.Where(x => x.Type == WFTempLateClassEnum.OUT).Select(z => new
{
z.FrID,
CreateDate = z.CreateDate.HasValue ? z.CreateDate.Value.ToString("yyyy-MM-dd") : "",
Money = (z.Money ?? 0) + (z.Fee ?? 0),
DetailList = z.detailList.Select(y => new
{
y.ID,
y.CostTypeId,
y.CostTypeName,
y.CurrencyId,
y.CurrencyName,
y.Money
}),
TradeWayList = z.BankList.Select(y => new
{
y.ID,
y.Type,
TypeName = y.Type.ToName(),
y.AccountId,
y.Alias,
y.BankNo,
y.AccountTypeId
})
}),
PreferPrice = x.FinanceList.Where(x => x.Type == WFTempLateClassEnum.IN).Sum(x => (x.Money ?? 0) + (x.Fee ?? 0)),
EffectiveClassHours = Math.Round(x.Income / x.Unit_Price,2,MidpointRounding.AwayFromZero),
x.Income,
x.Expend,
x.UseBookFee,
x.UseCoursewareFee,
Progress = x.TotalClassHours > 0 ? Math.Round(Convert.ToDecimal(x.UseClassHours) / x.TotalClassHours * 100, 2, MidpointRounding.AwayFromZero) : 0,
x.UseClassHours,
x.Unit_Price,
x.UseCourseFee,
x.AdjustPrice,
SurplusCourseHours = x.TotalClassHours - x.UseClassHours,
SurplusMoney = x.Income - x.UseBookFee - x.UseCoursewareFee - x.UseCourseFee - x.AdjustPrice
});
return ApiResult.Success("", pageModel);
}
/// <summary>
/// 导出订单完成情况一览
/// </summary>
/// <returns></returns>
[Obsolete]
public FileContentResult OutToExcelOrderStudentClassHoursList()
{
List<ExcelDataSource> slist = new List<ExcelDataSource>();
ExcelDataSource headerTop = new ExcelDataSource()
{
ExcelRows = new List<ExcelColumn>(30) {
new ExcelColumn(value:"合同信息"){CellWidth=20,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER,Colspan=14 },
new ExcelColumn(value:"收款信息"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER,Colspan = 6 },
new ExcelColumn(value:"合同有效金额"){CellWidth=20,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER, Colspan = 2 },
new ExcelColumn(value:"消费情况"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER , Colspan = 7},
new ExcelColumn(value:"剩余情况"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER , Colspan = 3},
}
};
slist.Add(headerTop);
ExcelDataSource header = new ExcelDataSource()
{
ExcelRows = new List<ExcelColumn>(30) {
new ExcelColumn(value:"订单号"){CellWidth=20,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"签订时间"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"合同号"){CellWidth=20,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"产品名称"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"班级"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"学员名字"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"业务人员"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"课时"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"单价"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"课程费用"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"教材费"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"课件费"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"优惠金额"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"合同总金额"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"单据号"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"收款日期"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"收款金额"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"收款方式"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"收款账户"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"应收金额"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"有效课时"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"有效金额"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"消费教材费"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"消费课件费"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"上课进度"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"已上课时"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"折后单价"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"已上课金额"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"退/付款金额"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"协调金额"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"剩余课时"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"剩余金额"){CellWidth=15,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
}
};
slist.Add(header);
string ExcelName = "订单完成情况" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
var userInfo = base.UserInfo;
var dmodel = JsonHelper.DeserializeObject<RB_Education_Contract_ViewModel>(RequestParm.Msg.ToString());
dmodel.Group_Id = userInfo.Group_Id;
dmodel.CType = Common.Enum.Course.ContractTypeEnum.Train;//这里只看培训的
var list = orderModule.GetOrderStudentClassHoursPageList(1, 100000, out long count, dmodel);
try
{
foreach (var item in list)
{
var FinanceList = item.FinanceList.Where(x => x.Type == WFTempLateClassEnum.IN).ToList();
if (FinanceList.Any())
{
int Num = 0;
decimal PreferPrice = FinanceList.Where(x => x.Type == WFTempLateClassEnum.IN).Sum(x => (x.Money ?? 0) + (x.Fee ?? 0));
foreach (var qitem in FinanceList)
{
var bankModel = qitem.BankList.FirstOrDefault();
int Count = FinanceList.Count();
if (Num == 0)
{
ExcelDataSource firstRow = new ExcelDataSource(30)
{
ExcelRows = new List<ExcelColumn>()
{
new ExcelColumn(value: item.OrderId.ToString()){ Rowspan = Count },
new ExcelColumn(value: item.CreateTime.ToString("yyyy-MM-dd")){ Rowspan = Count },
new ExcelColumn(value: item.ContractNo){ Rowspan = Count },
new ExcelColumn(value: item.CourseName){ Rowspan = Count },
new ExcelColumn(value: item.ClassName){ Rowspan = Count },
new ExcelColumn(value: item.StudentName){ Rowspan = Count },
new ExcelColumn(value: item.CreateByName){ Rowspan = Count },
new ExcelColumn(value: item.TotalClassHours.ToString()){ Rowspan = Count },
new ExcelColumn(value: Math.Round(item.TotalCourseFee / item.TotalClassHours, 2, MidpointRounding.AwayFromZero).ToString()){ Rowspan = Count },
new ExcelColumn(value: item.TotalCourseFee.ToString()){ Rowspan = Count },
new ExcelColumn(value: item.TotalBookFee.ToString()){ Rowspan = Count },
new ExcelColumn(value: item.TotalClassFee.ToString()){ Rowspan = Count },
new ExcelColumn(value: item.TotalDiscountMoney.ToString()){ Rowspan = Count },
new ExcelColumn(value: item.TotalMoney.ToString()){ Rowspan = Count},
new ExcelColumn(value: qitem.FrID.ToString()){ },
new ExcelColumn(value: (qitem.TradeDate.HasValue ? qitem.TradeDate.Value.ToString("yyyy-MM-dd") : "")){ },
new ExcelColumn(value: ((qitem.Money??0)+(qitem.Fee??0)).ToString()){ },
new ExcelColumn(value: bankModel != null ? bankModel.Type.ToName() : ""){ },
new ExcelColumn(value: bankModel != null ? bankModel.Alias + bankModel.BankNo : ""){ },
new ExcelColumn(value: PreferPrice.ToString()){ Rowspan = Count },
new ExcelColumn(value: item.Income.ToString()){ Rowspan = Count },
new ExcelColumn(value: Math.Round(item.Income / item.Unit_Price,2,MidpointRounding.AwayFromZero).ToString()){ Rowspan = Count },
new ExcelColumn(value: item.UseBookFee.ToString("0.######")){ Rowspan = Count },
new ExcelColumn(value: item.UseCoursewareFee.ToString("0.######")){ Rowspan = Count },
new ExcelColumn(value: (item.TotalClassHours > 0 ? Math.Round(Convert.ToDecimal(item.UseClassHours) / item.TotalClassHours * 100, 2, MidpointRounding.AwayFromZero) : 0).ToString() + "%"){ Rowspan = Count },
new ExcelColumn(value: item.UseClassHours.ToString()){ Rowspan = Count },
new ExcelColumn(value: item.Unit_Price.ToString("0.######")){ Rowspan = Count },
new ExcelColumn(value: item.UseCourseFee.ToString("0.######")){ Rowspan = Count },
new ExcelColumn(value: item.Expend.ToString()){ Rowspan = Count },
new ExcelColumn(value: item.AdjustPrice.ToString("0.######")){ Rowspan = Count },
new ExcelColumn(value: (item.TotalClassHours - item.UseClassHours).ToString()){ Rowspan = Count },
new ExcelColumn(value: (item.Income - item.UseBookFee - item.UseCoursewareFee - item.UseCourseFee - item.AdjustPrice).ToString("0.######")){ Rowspan = Count },
}
};
slist.Add(firstRow);
}
else {
ExcelDataSource firstRow = new ExcelDataSource(30)
{
ExcelRows = new List<ExcelColumn>()
{
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: qitem.FrID.ToString()){ },
new ExcelColumn(value: (qitem.TradeDate.HasValue ? qitem.TradeDate.Value.ToString("yyyy-MM-dd") : "")){ },
new ExcelColumn(value: ((qitem.Money??0)+(qitem.Fee??0)).ToString()){ },
new ExcelColumn(value: bankModel != null ? bankModel.Type.ToName() : ""){ },
new ExcelColumn(value: bankModel != null ? bankModel.Alias + bankModel.BankNo : ""){ },
new ExcelColumn(value: PreferPrice.ToString()){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
}
};
slist.Add(firstRow);
}
Num++;
}
}
else {
ExcelDataSource firstRow = new ExcelDataSource(30)
{
ExcelRows = new List<ExcelColumn>()
{
new ExcelColumn(value: item.OrderId.ToString()){ },
new ExcelColumn(value: item.CreateTime.ToString("yyyy-MM-dd")){ },
new ExcelColumn(value: item.ContractNo){ },
new ExcelColumn(value: item.CourseName){ },
new ExcelColumn(value: item.ClassName){ },
new ExcelColumn(value: item.StudentName){ },
new ExcelColumn(value: item.CreateByName){ },
new ExcelColumn(value: item.TotalClassHours.ToString()){ },
new ExcelColumn(value: Math.Round(item.TotalCourseFee / item.TotalClassHours, 2, MidpointRounding.AwayFromZero).ToString()){ },
new ExcelColumn(value: item.TotalCourseFee.ToString()){ },
new ExcelColumn(value: item.TotalBookFee.ToString()){ },
new ExcelColumn(value: item.TotalClassFee.ToString()){ },
new ExcelColumn(value: item.TotalDiscountMoney.ToString()){ },
new ExcelColumn(value: item.TotalMoney.ToString()){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: ""){ },
new ExcelColumn(value: "0"){ },
new ExcelColumn(value: item.Income.ToString()){ },
new ExcelColumn(value: Math.Round(item.Income / item.Unit_Price,2,MidpointRounding.AwayFromZero).ToString()){ },
new ExcelColumn(value: item.UseBookFee.ToString("0.######")){ },
new ExcelColumn(value: item.UseCoursewareFee.ToString("0.######")){ },
new ExcelColumn(value: (item.TotalClassHours > 0 ? Math.Round(Convert.ToDecimal(item.UseClassHours) / item.TotalClassHours * 100, 2, MidpointRounding.AwayFromZero) : 0).ToString() + "%"){ },
new ExcelColumn(value: item.UseClassHours.ToString()){ },
new ExcelColumn(value: item.Unit_Price.ToString("0.######")){ },
new ExcelColumn(value: item.UseCourseFee.ToString("0.######")){ },
new ExcelColumn(value: item.Expend.ToString()){ },
new ExcelColumn(value: item.AdjustPrice.ToString("0.######")){ },
new ExcelColumn(value: (item.TotalClassHours - item.UseClassHours).ToString()){ },
new ExcelColumn(value: (item.Income - item.UseBookFee - item.UseCoursewareFee - item.UseCourseFee - item.AdjustPrice).ToString("0.######")){ },
}
};
slist.Add(firstRow);
}
}
var byteData = ExcelTempLateHelper.ToExcelExtend(slist);
return File(byteData, "application/octet-stream", ExcelName);
}
catch (Exception ex)
{
LogHelper.Write(ex, "OutToExcelOrderStudentClassHoursList");
var byteData1 = ExcelTempLateHelper.ToExcelExtend(slist);
return File(byteData1, "application/octet-stream", ExcelName);
}
}
/// <summary>
/// 修改合同协调金额
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetContractAdjustPrice()
{
var userInfo = base.UserInfo;
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var dmodel = JsonHelper.DeserializeObject<RB_Education_ContractAdjust_ViewModel>(RequestParm.Msg.ToString());
if (dmodel.ContractId <= 0) {
return ApiResult.ParamIsNull("请传递合同编号");
}
dmodel.Group_Id = userInfo.Group_Id;
bool flag = orderModule.SetContractAdjustPrice(dmodel, userInfo);
if (flag)
{
return ApiResult.Success();
}
else {
return ApiResult.Failed();
}
}
#endregion
#region 月结窗口
/// <summary>
/// 获取月结分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetFinanceMonthStatementPageList()
{
var userInfo = base.UserInfo;
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var dmodel = JsonHelper.DeserializeObject<RB_RollingAccount_Extend>(RequestParm.Msg.ToString());
dmodel.GroupId = userInfo.Group_Id;
var list = financeModule.GetFinanceMonthStatementPageList(pageModel.PageIndex, pageModel.PageSize, out long count, dmodel);
pageModel.Count = Convert.ToInt32(count);
pageModel.PageData = list.Select(x => new
{
x.Id,
x.Month,
x.SchoolIds,
x.State,
x.UpdateBy,
x.UpdateByName,
UpdateTime = x.UpdateTime.ToString("yyyy-MM-dd HH:mm"),
SchoolList = x.SchoolList.Select(z => new
{
z.SId,
z.SName
})
});
return ApiResult.Success("", pageModel);
}
/// <summary>
/// 新增修改月结设置
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetFinanceMonthStatementInfo() {
var userInfo = base.UserInfo;
var dmodel = JsonHelper.DeserializeObject<RB_RollingAccount_Extend>(RequestParm.Msg.ToString());
if (string.IsNullOrEmpty(dmodel.Month)) {
return ApiResult.ParamIsNull("请选择月份");
}
if (dmodel.SchoolList == null || !dmodel.SchoolList.Any()) {
return ApiResult.ParamIsNull("请选择校区");
}
dmodel.Month = Convert.ToDateTime(dmodel.Month).ToString("yyyy-MM");
dmodel.SchoolIds = string.Join(",", dmodel.SchoolList.Select(x => x.SId));
dmodel.State = dmodel.State == 0 ? 1 : dmodel.State;
dmodel.GroupId = userInfo.Group_Id;
dmodel.CreateBy = userInfo.Id;
dmodel.CreateTime = DateTime.Now;
dmodel.UpdateBy = userInfo.Id;
dmodel.UpdateTime = DateTime.Now;
string msg = financeModule.SetFinanceMonthStatementInfo(dmodel);
if (msg == "") { return ApiResult.Success(); }
else { return ApiResult.Failed(msg); }
}
#endregion
} }
} }
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
"WkHtmlToPdfPath": "D:/wkhtmltopdf/bin/", "WkHtmlToPdfPath": "D:/wkhtmltopdf/bin/",
"FinanceKey": "FinanceMallInsertToERPViitto2020", "FinanceKey": "FinanceMallInsertToERPViitto2020",
"PaymentFinanceApi": "http://192.168.1.13:8083/api/Mall/InsertFinanceBatchForMallOut", "PaymentFinanceApi": "http://192.168.1.13:8083/api/Mall/InsertFinanceBatchForMallOut",
"FinanceDateBase": "test_reborn_finance",
"RabbitMqConfig": { "RabbitMqConfig": {
"HostName": "47.96.25.130", "HostName": "47.96.25.130",
"VirtualHost": "/", "VirtualHost": "/",
......
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