Commit 20038fdb authored by 黄奎's avatar 黄奎

页面修改

parent 21ba393a
......@@ -64,9 +64,6 @@ namespace Edu.Model.Entity.EduTask
/// </summary>
public int AuditEmId { get; set; }
/// <summary>
/// 审核节点编号
/// </summary>
public int BackrelevanceId { get; set; }
}
}
......@@ -14,5 +14,15 @@ namespace Edu.Model.ViewModel.EduTask
/// 是否特殊节点
/// </summary>
public int SpecialNode { get; set; }
/// <summary>
/// 班级名称
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 班级编号
/// </summary>
public string ClassNo { get; set; }
}
}
......@@ -128,56 +128,6 @@ namespace Edu.Module.Course
public object GetStuBackInfoModule(int backId)
{
var obj = new List<object>();
////获取单据实体类
//var backModel = student_BackClassRepository.GetEntity(backId);
////获取审核记录
//var aurList = student_BackRecordRepository.GetStudentBackRecordListRepository(new RB_Student_BackRecord_ViewModel()
//{
// ConditionId = backId,
//});
////审核关联列表
//var arList = student_BackRelevanceRepository.GetStudentBackRelevanceListRepository(new RB_Education_Relevance_ViewModel()
//{
// ConditionId = backId
//});
//obj.Add(new
//{
// NodeName = "制单人",
// AduitStatus = 2,
// AuditWayName = "",
// AduitStatusName = "发起",
// SubList = new List<object>()
// {
// new{
// AduitName= UserReidsCache.GetUserLoginInfo(backModel.CreateBy)?.AccountName ?? "",
// Description=backModel.ApplyReason,
// CreateTime=Common.ConvertHelper.FormatTime(backModel.CreateTime),
// AuditStatus=WFRrocessStatus.AuditThrough,
// AuditStatusName = WFRrocessStatus.AuditThrough.ToName(),
// }
// }
//});
//var existsList = arList.Where(qitem => aurList.Any(oldItem => qitem.Id == oldItem.BackrelevanceId));
//foreach (var item in existsList)
//{
// obj.Add(new
// {
// NodeName = item.AuditDescription,
// AduitStatus = item.Stauts,
// AduitStatusName = GetWFRrocessStatusStrModule(item.Stauts),
// AuditWayName = item.AuditWay != WFTAuditWayEnum.Successively ? item.AuditWay.ToName() : "",
// SubList = aurList.Where(qitem => qitem.AuditId == item.Id).Select(qitem => new
// {
// AduitName = UserReidsCache.GetUserLoginInfo(qitem.AuditEmId)?.AccountName ?? "",
// Description = !string.IsNullOrEmpty(qitem.Description) ? qitem.Description : "无",
// CreateTime = Common.ConvertHelper.FormatTime(qitem.UpdateTime),
// qitem.AuditStatus,
// AuditStatusName = GetWFRrocessStatusStrModule(qitem.AuditStatus),
// })
// });
//}
return obj;
}
......
......@@ -75,6 +75,7 @@ namespace Edu.Module.EduTask
Title="调课申请",
ReceiptType= Common.Enum.Finance.ReceiptTypeEnum.ChangeClass,
RelationId=newId,
ClassId=extModel.ClassId,
Group_Id=extModel.Group_Id,
School_Id=extModel.School_Id,
CreateBy=extModel.CreateBy,
......
......@@ -139,6 +139,10 @@ namespace Edu.Module.EduTask
{
item.Id,
item.Title,
item.ClassId,
item.ClassName,
item.ClassNo,
item.OrderId,
item.ReceiptType,
DataObj,
item.SpecialNode,
......@@ -214,7 +218,7 @@ namespace Edu.Module.EduTask
}
});
var existsList = arList.Where(qitem => aurList.Any(oldItem => qitem.Id == oldItem.BackrelevanceId));
var existsList = arList.Where(qitem => aurList.Any(oldItem => qitem.Id == oldItem.AuditId));
foreach (var item in existsList)
{
obj.Add(new
......@@ -308,9 +312,11 @@ namespace Edu.Module.EduTask
{
model.AuditedId = user.Id.ToString();
}
#region 更新审核记录表状态
flag = UpdateEduRecordModule(WFRrocessStatus.AuditNotThrough, auditModel.Description, user.Id, amodel.Id);
#endregion
#region 更新审核关联表状态
flag = UpdateEduRelevanceModule(model.Id, model.Stauts, model.AuditedId);
#endregion
......@@ -366,6 +372,7 @@ namespace Edu.Module.EduTask
message = "尚未匹配到审核相关信息,请联系管理员!";
return false;
}
#region 更新审核记录表状态
flag = UpdateEduRecordModule(WFRrocessStatus.AuditThrough, auditModel.Description, user.Id, amodel.Id);
#endregion
......@@ -383,6 +390,7 @@ namespace Edu.Module.EduTask
{
model.AuditedId = user.Id.ToString();
}
#region 更新审核关联表状态
flag = UpdateEduRelevanceModule(model.Id, model.Stauts, model.AuditedId);
#endregion
......@@ -402,6 +410,7 @@ namespace Edu.Module.EduTask
{
model.AuditedId = user.Id.ToString();
}
#region 更新审核关联表状态
flag = UpdateEduRelevanceModule(model.Id, null, model.AuditedId);
#endregion
......@@ -425,6 +434,7 @@ namespace Edu.Module.EduTask
{
model.AuditedId = user.Id.ToString();
}
#region 更新审核记录表状态
flag = UpdateEduRecordModule(WFRrocessStatus.AuditThrough, auditModel.Description, user.Id, amodel.Id);
#endregion
......@@ -671,21 +681,19 @@ namespace Edu.Module.EduTask
public bool UpdateOtherModule(RB_Education_Receipt receiptModel, EduReceiptAudit auditModel)
{
bool flag = true;
//退课
if (receiptModel.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.BackClass)
{
var backModel = student_BackClassRepository.GetEntity(receiptModel.RelationId);
if (auditModel.AuditStatus == 2)
{
flag = UpdateStuBackBillStatusModule(BackClassAuditStatusEnum.Pass, auditModel.RecipientIds, backModel, SpecialNode: auditModel.SpecialNode, BackMoney: auditModel.BackMoney);
flag = UpdateOrderGuestStatusModule(2, backModel.StudentId);
flag = student_BackClassRepository.UpdateStudentBackClassRepository(receiptModel,auditModel);
}
if (auditModel.AuditStatus == 3)
{
flag = UpdateOrderGuestStatusModule(4, backModel.StudentId);
flag = UpdateStuBackBillStatusModule(BackClassAuditStatusEnum.Rejected, auditModel.RecipientIds, backModel, SpecialNode: auditModel.SpecialNode, BackMoney: auditModel.BackMoney);
flag = student_BackClassRepository.UpdateStudentBackClassRepository(receiptModel, auditModel);
}
}
//调课
if (receiptModel.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ChangeClass)
{
if (auditModel.AuditStatus == 2)
......@@ -696,63 +704,7 @@ namespace Edu.Module.EduTask
return flag;
}
/// <summary>
/// 更新退课主表状态
/// </summary>
/// <param name="statusEnum">审核状态</param>
/// <param name="newRecipientIds">抄送人</param>
/// <param name="backModel">退课表实体信息</param>
/// <param name="SpecialNode">是否是特殊节点(1-是)</param>
/// <param name="BackMoney">实际退款金额</param>
/// <returns></returns>
private bool UpdateStuBackBillStatusModule(BackClassAuditStatusEnum statusEnum, string newRecipientIds, RB_Student_BackClass backModel, int SpecialNode = 0, decimal BackMoney = 0)
{
Dictionary<string, object> backFileds = new Dictionary<string, object>()
{
{nameof(RB_Student_BackClass_ViewModel.AuditStatus), (int)statusEnum }
};
if (!string.IsNullOrEmpty(newRecipientIds))
{
backFileds.Add(nameof(RB_Student_BackClass_ViewModel.RecipientIds), newRecipientIds);
}
//特殊节点更新时间退课金额
if (SpecialNode == 1)
{
backFileds.Add(nameof(RB_Student_BackClass_ViewModel.RealityBackMoney), BackMoney);
}
bool flag = student_BackClassRepository.Update(backFileds, new WhereHelper(nameof(RB_Student_BackClass_ViewModel.BackId), backModel.BackId));
if (flag)
{
var guestList = order_GuestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() { OrderId = backModel.OrderId });
if (guestList != null && guestList.Where(qitem => qitem.GuestState == 2).Count() == guestList.Count())
{
//更新订单为退学状态
Dictionary<string, object> orderFileds = new Dictionary<string, object>()
{
{nameof(RB_Order.OrderState),OrderStateEnum.DropOut }
};
flag = orderRepository.Update(orderFileds, new WhereHelper(nameof(RB_Order.OrderId), backModel.OrderId));
}
}
return flag;
}
/// <summary>
/// 更新学员退课状态
/// </summary>
/// <param name="GuestState"></param>
/// <param name="guestId"></param>
/// <returns></returns>
private bool UpdateOrderGuestStatusModule(int GuestState, int guestId)
{
Dictionary<string, object> guestFileds = new Dictionary<string, object>()
{
{nameof(RB_Order_Guest_ViewModel.GuestState),GuestState }
};
return order_GuestRepository.Update(guestFileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), guestId));
}
/// <summary>
/// 更新审核记录表信息
/// </summary>
......@@ -890,7 +842,6 @@ namespace Edu.Module.EduTask
/// </summary>
/// <param name="empIds">审核人id集合</param>
/// <param name="wfId">工作流id</param>
/// <param name="auditRelevance">审核节点</param>
private void InsertBatcheAuditRecord(List<int> empIds, int wfId, RB_Education_Relevance_ViewModel auditRelevance)
{
......@@ -908,7 +859,6 @@ namespace Edu.Module.EduTask
UpdateTime = DateTime.Now,
ConditionId = wfId,
Description = "",
BackrelevanceId = auditRelevance.Id
};
auditrecordList.Add(auditrecord);
}
......
using Edu.Model.Entity.Course;
using Edu.Common.Enum.Course;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.EduTask;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.EduTask;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
......@@ -13,6 +17,16 @@ namespace Edu.Repository.Course
/// </summary>
public class RB_Student_BackClassRepository : BaseRepository<RB_Student_BackClass>
{
/// <summary>
/// 订单学员仓储层对象
/// </summary>
private readonly RB_Order_GuestRepository order_GuestRepository = new RB_Order_GuestRepository();
/// <summary>
/// 订单仓储层对象
/// </summary>
private readonly RB_OrderRepository orderRepository = new RB_OrderRepository();
/// <summary>
/// 获取学员退课单据列表
/// </summary>
......@@ -62,5 +76,62 @@ WHERE 1=1 ");
}
return result + 1;
}
/// <summary>
/// 更新退课相关信息
/// </summary>
/// <param name="receiptModel"></param>
/// <param name="auditModel"></param>
/// <returns></returns>
public bool UpdateStudentBackClassRepository(RB_Education_Receipt receiptModel, EduReceiptAudit auditModel)
{
var backModel = base.GetEntity(receiptModel.RelationId);
Dictionary<string, object> backFileds = new Dictionary<string, object>()
{
{nameof(RB_Student_BackClass_ViewModel.AuditStatus),auditModel.AuditStatus }
};
if (!string.IsNullOrEmpty(auditModel.RecipientIds))
{
backFileds.Add(nameof(RB_Student_BackClass_ViewModel.RecipientIds), auditModel.RecipientIds);
}
//特殊节点更新时间退课金额
if (auditModel.SpecialNode == 1)
{
backFileds.Add(nameof(RB_Student_BackClass_ViewModel.RealityBackMoney), auditModel.BackMoney);
}
bool flag = base.Update(backFileds, new WhereHelper(nameof(RB_Student_BackClass_ViewModel.BackId), backModel.BackId));
if (flag)
{
var guestList = order_GuestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() { OrderId = backModel.OrderId });
if (guestList != null && guestList.Where(qitem => qitem.GuestState == 2).Count() == guestList.Count())
{
//更新订单为退学状态
Dictionary<string, object> orderFileds = new Dictionary<string, object>()
{
{nameof(RB_Order.OrderState),OrderStateEnum.DropOut }
};
flag = orderRepository.Update(orderFileds, new WhereHelper(nameof(RB_Order.OrderId), backModel.OrderId));
}
}
if (flag)
{
int GuestState = 0;
if (auditModel.AuditStatus == 2)
{
GuestState = 2;
}
if (auditModel.AuditStatus == 3)
{
GuestState = 4;
}
///更新学员退课状态
Dictionary<string, object> guestFileds = new Dictionary<string, object>()
{
{nameof(RB_Order_Guest_ViewModel.GuestState),GuestState }
};
flag = order_GuestRepository.Update(guestFileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), backModel.GuestId));
}
return flag;
}
}
}
\ No newline at end of file
......@@ -66,8 +66,8 @@ namespace Edu.Repository.EduTask
}
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.* {0}
FROM RB_Education_Receipt AS A
SELECT A.*,IFNULL(B.ClassName,'') AS ClassName,IFNULL(B.ClassNo,'') AS ClassNo {0}
FROM RB_Education_Receipt AS A LEFT JOIN rb_class AS B ON A.ClassId=B.ClassId
WHERE 1=1
", isSpecNode);
if (query != null)
......
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