/// <summary> /// 获取余额退费订单详情 /// <para>作 者:郭伟佳</para> /// <para>创建时间:2018-11-08</para> /// </summary> /// <param name="orderId">订单Id</param> /// <param name="companyId">公司编号</param> /// <returns>订单详情</returns> public override IOrderDetailResponse GetOrderDetail(long orderId, string companyId) { var result = new BalanceRefundOrderDetailResponse(); //获取余额退费订单信息 var refundInfo = _viewBalanceRepository.Value.GetBalanceRefundByOrderId(orderId); if (refundInfo != null) { result = Mapper.Map <BalanceRefundOrderDetailResponse>(refundInfo); //获取其他费用(扣款合计) var refundAmountTypeList = CostService.GetCosts(Dto.TypeCode.LEAVE_CLASS_FEE); var costList = _tblOdrRefundOrderCost.Value.GetrefundOrderIdByCost(orderId).Select(x => new CostDetail { CostName = refundAmountTypeList.FirstOrDefault(k => k.CostId == x.CostId)?.CostName, Amount = x.Amount }).ToList(); result.CostList = costList; //获取余额退班的附件 var attchmentList = new AttchmentService(base._schoolId).GetAttchList(orderId, AttchmentType.ORDER_BALANCE_REFUND); result.AttachmentList = attchmentList; } return(result); }
/// <summary> /// 描述:获取订单详情 /// <para>作 者:瞿琦</para> /// <para>创建时间:2018-11-7</para> /// </summary> /// <param name="refundOrderId">退费订单主键Id</param> /// <param name="companyId">公司编号</param> /// <returns>休学订单详情</returns> /// <exception cref="AMS.Core.BussinessException"> /// 异常ID:1,异常描述:系统不存在该退费订单 /// 异常ID:10,异常描述:系统不存在该休学信息 /// </exception> public override IOrderDetailResponse GetOrderDetail(long refundOrderId, string companyId) { var result = new LeaveSchoolOrderDetailResponse(); var refundOrder = base._tblOdrRefundOrderRepository.Value.GetRefundOrderIdByRefundOrder(refundOrderId); if (refundOrder == null) { throw new BussinessException((byte)ModelType.Order, 1); } var leaveShoolOrder = _tblOdrLeaveSchoolOrderRepository.Value.GetLeaveSchoolIdByOrder(refundOrderId); if (leaveShoolOrder == null) { throw new BussinessException((byte)ModelType.Order, 10); } //获取休学的附件 var attchmentService = new AttchmentService(base._schoolId); var attchmentList = attchmentService.GetAttchList(refundOrderId, AttchmentType.LEAVE_SCHOOL_APPLY); //休学费用明细 var leaveSchoolOrderDetailList = LeaveSchoolOrderService.GetRefundCourseAmountDetail(refundOrderId, companyId); result.OrderNo = refundOrder.OrderNo; result.CreateTime = refundOrder.CreateTime; result.CreatorName = refundOrder.CreatorName; result.LeaveTime = leaveShoolOrder.LeaveTime; result.ResumeTime = leaveShoolOrder.ResumeTime; result.Reason = leaveShoolOrder.Reason; result.Remark = leaveShoolOrder.Remark; result.AttchmentUrl = attchmentList; result.LeaveSchoolOrderDetailList = leaveSchoolOrderDetailList; return(result); }
/// <summary> /// 描述:获取订单详情 /// <para>作 者:瞿琦</para> /// <para>创建时间:2018-11-8</para> /// </summary> /// <param name="refundOrderId">退费订单表主键</param> /// <param name="companayId">公司编号</param> /// <returns>订单详情信息</returns> /// <exception cref="AMS.Core.BussinessException"> /// 异常ID:1,异常描述:系统不存在该退费订单 /// 异常ID:2,异常描述:系统不存在该退班信息 /// 异常ID:3,异常描述:系统不存在该退费订单的支付信息 /// </exception> public override IOrderDetailResponse GetOrderDetail(long refundOrderId, string companayId) { var result = new LeaveClassOrderDetailResponse(); //获取退费订单信息 var refundOrderEntity = base._tblOdrRefundOrderRepository.Value.GetRefundOrderIdByRefundOrder(refundOrderId); if (refundOrderEntity == null) { throw new BussinessException((byte)ModelType.Order, 1); } //获取退班信息 var leaveClassOrder = _tblOdrLeaveClassOrder.Value.GetRefundOrderByLeaveClassOrder(refundOrderId); if (leaveClassOrder == null) { throw new BussinessException((byte)ModelType.Order, 2); } //获取退费订单的支付信息 var refundPay = _tblOdrRefundPay.Value.GetRefundOrderIdByRefundPay(refundOrderId); if (refundPay == null) { throw new BussinessException((byte)ModelType.Order, 3); } //获取其他费用(扣款合计) var refundAmountTypeList = CostService.GetCosts(Dto.TypeCode.LEAVE_CLASS_FEE); var costList = _tblOdrRefundOrderCost.Value.GetrefundOrderIdByCost(refundOrderId).Select(x => new CostDetail { CostName = refundAmountTypeList.FirstOrDefault(k => k.CostId == x.CostId)?.CostName, Amount = x.Amount }).ToList(); //获取退班的附件 var attchmentService = new AttchmentService(base._schoolId); var attchmentList = attchmentService.GetAttchList(refundOrderId, AttchmentType.LEAVE_CLASS_APPLY); //获取退班的课程 var leaveClassOrderDetailList = LeaveSchoolOrderService.GetRefundCourseAmountDetail(refundOrderId, companayId); result.OrderNo = refundOrderEntity.OrderNo; result.RefundDate = refundOrderEntity.CreateTime; result.CreatorId = refundOrderEntity.CreatorId; result.CreatorName = refundOrderEntity.CreatorName; result.EnrollCourseList = leaveClassOrderDetailList; result.StopClassDate = leaveClassOrder.StopClassDate; result.ReceiptStatus = leaveClassOrder.ReceiptStatus; result.TotalDeductAmount = costList; result.Amount = refundOrderEntity.Amount; result.RefundType = (RefundType)refundPay.RefundType; result.Reason = leaveClassOrder.Reason; result.AttachmentUrl = attchmentList; result.BankName = refundPay.BankName; result.BankCardNo = refundPay.BankCardNo; result.BankUserName = refundPay.BankUserName; return(result); }
/// <summary> /// 描述:添加附件 /// <para>作 者:瞿 琦</para> /// <para>创建时间:2018-12-20</para> /// </summary> /// <param name="request">要写入的休学数据</param> /// <param name="leaveSchoolOrder">休学订单详情</param> /// <param name="unitOfWork">工作单元事务</param> /// <returns>无</returns> private void AddAttachment(LeaveSchoolOrderAddRequest request, TblOdrLeaveSchoolOrder leaveSchoolOrder, UnitOfWork unitOfWork) { //添加上传申请表附件到数据库 foreach (var item in request.AttachmentUrlList) { item.AttchmentType = AttchmentType.LEAVE_SCHOOL_APPLY; item.BusinessId = leaveSchoolOrder.RefundOrderId; } var attchmentService = new AttchmentService(base._schoolId, unitOfWork); attchmentService.Add(request.AttachmentUrlList); //添加附件 }