Commit 5a1e4b36 authored by liudong1993's avatar liudong1993

1

parent 0e9a6447
......@@ -3860,12 +3860,14 @@ namespace Edu.Module.Course
if (model != null && model.Status == -1)
{
var userModel = userReturnComissionRepository.GetModelBySourceId((int)model.OrderSourceType, model.OrderSourceId, model.CommissionType);
userModel.UnSettlementMoney += model.CommissionMoeny;
Dictionary<string, object> userKeyValues = new Dictionary<string, object>()
if (userModel != null)
{
userModel.UnSettlementMoney += model.CommissionMoeny;
Dictionary<string, object> userKeyValues = new Dictionary<string, object>()
{
{ nameof(RB_User_ReturnComission_ViewModel.UnSettlementMoney),userModel.UnSettlementMoney}
};
List<WhereHelper> userWheres = new List<WhereHelper>()
List<WhereHelper> userWheres = new List<WhereHelper>()
{
new WhereHelper()
{
......@@ -3886,12 +3888,12 @@ namespace Edu.Module.Course
OperatorEnum= OperatorEnum.Equal
}
};
userReturnComissionRepository.Update(userKeyValues, userWheres);
Dictionary<string, object> keyValues = new Dictionary<string, object>()
userReturnComissionRepository.Update(userKeyValues, userWheres);
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Order_ReturnComission.Status),0}
};
List<WhereHelper> wheres = new List<WhereHelper>()
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper()
{
......@@ -3906,7 +3908,8 @@ namespace Edu.Module.Course
OperatorEnum= OperatorEnum.Equal
}
};
returnComissionRepository.Update(keyValues, wheres);
returnComissionRepository.Update(keyValues, wheres);
}
}
}
......
......@@ -524,26 +524,33 @@ namespace Edu.Module.User
parentWorkDepartId = departmentRepository.GetEntity(extModel.ParentId)?.WorkDepartId ?? 1;
}
//需在微信端创建
var CDModle = QYWeiXinHelper.CreateDepartment(token, extModel.DeptName, parentWorkDepartId, extModel.DeptSort);
if (CDModle.errcode == Senparc.Weixin.ReturnCode_Work.请求成功)
try
{
extModel.WorkDepartId = Convert.ToInt32(CDModle.id);
//更新原部门微信部门Id绑定
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
var CDModle = QYWeiXinHelper.CreateDepartment(token, extModel.DeptName, parentWorkDepartId, extModel.DeptSort);
if (CDModle.errcode == Senparc.Weixin.ReturnCode_Work.请求成功)
{
extModel.WorkDepartId = Convert.ToInt32(CDModle.id);
//更新原部门微信部门Id绑定
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Department_ViewModel.WorkDepartId),extModel.WorkDepartId}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Department_ViewModel.DeptId),
FiledValue=extModel.DeptId,
OperatorEnum=OperatorEnum.Equal
}
};
departmentRepository.Update(keyValues, wheres);
departmentRepository.Update(keyValues, wheres);
}
else
{
LogHelper.Write("企业微信部门创建失败DeptId:" + extModel.DeptId + " 消息:" + CDModle.errcode);
}
}
else
catch (Exception ex)
{
LogHelper.Write("企业微信部门创建失败DeptId:" + extModel.DeptId + " 消息:" + CDModle.errcode);
LogHelper.Write("SetDepartmentModule企业微信部门创建失败DeptId:" + extModel.DeptId + " 消息:" + ex.Message);
}
});
}
......
......@@ -26,6 +26,10 @@ namespace Edu.WebApi.Controllers.Third
/// </summary>
private readonly EmployeeModule employeeModule = new EmployeeModule();
/// <summary>
/// 部门处理类
/// </summary>
private readonly DepartmentModule departmentModule = new DepartmentModule();
/// <summary>
/// 订单处理类
/// </summary>
private readonly OrderModule orderModule = new OrderModule();
......@@ -33,7 +37,6 @@ namespace Edu.WebApi.Controllers.Third
/// 业绩提成
/// </summary>
private readonly SellAchievementsModule sellAchievementsModule = new SellAchievementsModule();
/// <summary>
/// 员工人头奖励处理类
/// </summary>
......@@ -132,6 +135,51 @@ namespace Edu.WebApi.Controllers.Third
}));
}
/// <summary>
/// 获取部门的负责人
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpPost]
[AllowAnonymous]
public ApiResult GetDepartmentManager() {
JObject jobj = JObject.Parse(RequestParm.Msg.ToString());
int DeptId = jobj.GetInt("DeptId", 0);
if (DeptId <= 0)
{
return ApiResult.ParamIsNull(message: "请传递部门编号!");
}
var dmodel = departmentModule.GetDepartmentModule(DeptId);
string ManagerIds = "";
if (dmodel != null) {
ManagerIds = dmodel.ManagerIds ?? "";
}
var RList = new object();
if (ManagerIds != "")
{
//查询所有的人员
var empList = employeeModule.GetEmployeeListModule(new Model.ViewModel.User.Employee_ViewModel() { QIds = ManagerIds });
var result = empList?.Select(qitem => new
{
qitem.Id,
qitem.EmployeeName,
qitem.Dept_Id,
qitem.DeptName,
qitem.Post_Id,
qitem.PostName,
qitem.School_Id,
qitem.SchoolName,
qitem.Group_Id,
qitem.GroupName
});
return ApiResult.Success(data: result);
}
else
{
return ApiResult.Failed();
}
}
/// <summary>
/// 更新订单实收、退款金额
/// </summary>
......
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