Commit bd7ce160 authored by liudong1993's avatar liudong1993

教育调整

parent 4e26bced
...@@ -15,7 +15,7 @@ namespace Edu.Model.ViewModel.Course ...@@ -15,7 +15,7 @@ namespace Edu.Model.ViewModel.Course
public List<RB_Teaching_Rewards_Rate_ViewModel> FullClassList { get; set; } public List<RB_Teaching_Rewards_Rate_ViewModel> FullClassList { get; set; }
/// <summary> /// <summary>
/// 增加课时费 /// 增加课时费/奖金
/// </summary> /// </summary>
public decimal ClassMoney { get; set; } public decimal ClassMoney { get; set; }
......
...@@ -558,6 +558,19 @@ namespace Edu.Module.Course ...@@ -558,6 +558,19 @@ namespace Edu.Module.Course
{ {
LogHelper.Write(ex, "SetTeachingBonusAdd"); LogHelper.Write(ex, "SetTeachingBonusAdd");
teaching_BonusDetailRepository.DBSession.Rollback(); teaching_BonusDetailRepository.DBSession.Rollback();
#region 取消创建的奖励
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Teaching_Bonus_ViewModel.State), BonusStateEnum.Cancel}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Teaching_Bonus_ViewModel.Id),
FiledValue=bonusId,
OperatorEnum=OperatorEnum.Equal
}
};
teaching_BonusRepository.Update(keyValues, wheres);
#endregion
return "出错了,请联系管理员"; return "出错了,请联系管理员";
} }
} }
...@@ -982,7 +995,7 @@ namespace Edu.Module.Course ...@@ -982,7 +995,7 @@ namespace Edu.Module.Course
//获取班级类型 //获取班级类型
var list = teaching_Rewards_BaseRepository.GetList(new RB_Teaching_Rewards_Base_ViewModel() { Group_Id = classModel.Group_Id }); var list = teaching_Rewards_BaseRepository.GetList(new RB_Teaching_Rewards_Base_ViewModel() { Group_Id = classModel.Group_Id });
var baseModel = list.Where(x => ("," + x.ClassTypeIds + ",").Contains("," + classModel.ClassType + ",")).FirstOrDefault(); var baseModel = list.Where(x => ("," + x.ClassTypeIds + ",").Contains("," + classModel.ClassType + ",")).FirstOrDefault();
if (baseModel == null) { return "班级类型匹配到"; } if (baseModel == null) { return "班级类型匹配到"; }
var typeModel = class_TypeRepository.GetEntity(classModel.ClassType); var typeModel = class_TypeRepository.GetEntity(classModel.ClassType);
//获取奖金 课时费 比例 //获取奖金 课时费 比例
...@@ -1252,6 +1265,41 @@ namespace Edu.Module.Course ...@@ -1252,6 +1265,41 @@ namespace Edu.Module.Course
return msg; return msg;
} }
/// <summary>
/// 发送绩效通知
/// </summary>
/// <param name="perfId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public string SetTeachingPerfPush(int perfId, UserInfo userInfo)
{
var perfModel = teaching_PerfRepository.GetEntity(perfId);
if (perfModel == null || perfModel.Status != 0) { return "绩效不存在"; }
if (perfModel.PerfState != PerfStateEnum.Confirmed) { return "绩效状态不正确"; }
var teacherModel = teacherRepository.GetTeacherList(perfModel.TeacherId.ToString()).FirstOrDefault();
if (teacherModel == null)
{
return "教师不存在";
}
//给教师发送通知
//写入日志
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{
Id = 0,
Type = 1,
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
Group_Id = userInfo.Group_Id,
LogContent = "发送教师绩效通知【" + perfId + "】",
School_Id = userInfo.School_Id,
SourceId = 0
});
return "";
}
#endregion #endregion
} }
} }
...@@ -221,7 +221,6 @@ WHERE 1=1 ...@@ -221,7 +221,6 @@ WHERE 1=1
"); ");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.Status), 0); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.Status), 0);
builder.AppendFormat(" AND A.{0} in(1,2) ", nameof(RB_Class_ViewModel.ClassStatus)); builder.AppendFormat(" AND A.{0} in(1,2) ", nameof(RB_Class_ViewModel.ClassStatus));
builder.AppendFormat(" AND A.{0} >='{1}' ", nameof(RB_Class_ViewModel.EndOrderTime), DateTime.Now.ToString("yyyy-MM-dd"));
if (query != null) if (query != null)
{ {
if (query.Group_Id > 0) if (query.Group_Id > 0)
...@@ -270,6 +269,7 @@ WHERE 1=1 ...@@ -270,6 +269,7 @@ WHERE 1=1
if (query.Q_CanApply == 1) if (query.Q_CanApply == 1)
{ {
builder.AppendFormat(" AND (IFNULL(A.ClassPersion,0)-IFNULL(t.GuestNum,0))>0 "); builder.AppendFormat(" AND (IFNULL(A.ClassPersion,0)-IFNULL(t.GuestNum,0))>0 ");
builder.AppendFormat(" AND A.{0} >='{1}' ", nameof(RB_Class_ViewModel.EndOrderTime), DateTime.Now.ToString("yyyy-MM-dd"));
} }
} }
builder.AppendFormat(" order by A.{0} asc", nameof(RB_Class_ViewModel.OpenTime)); builder.AppendFormat(" order by A.{0} asc", nameof(RB_Class_ViewModel.OpenTime));
......
...@@ -438,10 +438,10 @@ namespace Edu.WebApi.Controllers.Course ...@@ -438,10 +438,10 @@ namespace Edu.WebApi.Controllers.Course
{ {
return ApiResult.ParamIsNull("请选择月份"); return ApiResult.ParamIsNull("请选择月份");
} }
//if (Convert.ToDateTime(dmodel.Month) >= Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM"))) if (Convert.ToDateTime(dmodel.Month) >= Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM")))
//{ {
// return ApiResult.ParamIsNull("只能选择之前月份"); return ApiResult.ParamIsNull("只能选择之前月份");
//} }
if (string.IsNullOrEmpty(dmodel.TeacherIds)) if (string.IsNullOrEmpty(dmodel.TeacherIds))
{ {
return ApiResult.ParamIsNull("请选择老师"); return ApiResult.ParamIsNull("请选择老师");
...@@ -714,6 +714,32 @@ namespace Edu.WebApi.Controllers.Course ...@@ -714,6 +714,32 @@ namespace Edu.WebApi.Controllers.Course
} }
} }
/// <summary>
/// 绩效消息推送
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetTeachingPerfPush()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int PerfId = parms.GetInt("PerfId", 0);
if (PerfId <= 0)
{
return ApiResult.ParamIsNull();
}
string msg = teachingRewardsModule.SetTeachingPerfPush(PerfId, userInfo);
if (msg == "")
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed(msg);
}
}
#endregion #endregion
} }
} }
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