Commit 9e1e83a4 authored by liudong1993's avatar liudong1993

1

parent e6735709
...@@ -333,5 +333,10 @@ namespace REBORN.Model.Entity ...@@ -333,5 +333,10 @@ namespace REBORN.Model.Entity
/// 企业码生成的员工ID(支付宝员工id) /// 企业码生成的员工ID(支付宝员工id)
/// </summary> /// </summary>
public string AlipayId { get; set; } public string AlipayId { get; set; }
/// <summary>
/// 是否集团共享账号 1是 (用于不同公司下拉 普通人员均可显示此账号)
/// </summary>
public int IsGroupShow { get; set; }
} }
} }
...@@ -431,9 +431,9 @@ namespace REBORN.Module.PlatformModule ...@@ -431,9 +431,9 @@ namespace REBORN.Module.PlatformModule
/// </summary> /// </summary>
/// <param name="EmName"></param> /// <param name="EmName"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Employee_Extend> GetEmpAndImByEmpName(string EmName, int RB_Group_id,int EmpId) public List<RB_Employee_Extend> GetEmpAndImByEmpName(string EmName, int RB_Group_id,int EmpId, int branchId)
{ {
return new Rb_employeeRepository().GetEmpAndImByEmpName(EmName, RB_Group_id,EmpId); return new Rb_employeeRepository().GetEmpAndImByEmpName(EmName, RB_Group_id, EmpId, branchId);
} }
......
...@@ -432,6 +432,30 @@ namespace REBORN.Module.UserModule ...@@ -432,6 +432,30 @@ namespace REBORN.Module.UserModule
return repository.UpdateBatch(query); return repository.UpdateBatch(query);
} }
/// <summary>
/// 设置账号集团里显示
/// </summary>
/// <param name="id"></param>
/// <param name="rB_Group_id"></param>
/// <returns></returns>
public string SetEmployeeGroupShow(int id, int rB_Group_id)
{
var emodel = repository.GetEntity(id);
if (emodel.RB_Group_id != rB_Group_id) { return "账号有误"; }
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Employee.IsGroupShow), emodel.IsGroupShow==1?0:1}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_Employee.EmployeeId),
FiledValue = id,
OperatorEnum = OperatorEnum.Equal
}
};
bool flag = repository.Update(keyValues, wheres);
return flag ? "" : "出错了,请联系管理员";
}
/// <summary> /// <summary>
/// 修改员工密码或离职时间 /// 修改员工密码或离职时间
/// </summary> /// </summary>
......
...@@ -897,7 +897,7 @@ where a.RB_Group_id={groupId} and ((b.DepartmentName like'%地接部%' or b.Depa ...@@ -897,7 +897,7 @@ where a.RB_Group_id={groupId} and ((b.DepartmentName like'%地接部%' or b.Depa
/// <param name="RB_Group_id"></param> /// <param name="RB_Group_id"></param>
/// <param name="EmpId"></param> /// <param name="EmpId"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Employee_Extend> GetEmpAndImByEmpName(string EmName, int RB_Group_id, int EmpId) public List<RB_Employee_Extend> GetEmpAndImByEmpName(string EmName, int RB_Group_id, int EmpId, int branchId)
{ {
EmName = EmName.Replace("'", ""); EmName = EmName.Replace("'", "");
string sql = $@"SELECT e.*,m.OpenAccount,d.DepartmentName,p.PostName,b.BName as CompanyName from rb_employee e string sql = $@"SELECT e.*,m.OpenAccount,d.DepartmentName,p.PostName,b.BName as CompanyName from rb_employee e
...@@ -905,11 +905,14 @@ where a.RB_Group_id={groupId} and ((b.DepartmentName like'%地接部%' or b.Depa ...@@ -905,11 +905,14 @@ where a.RB_Group_id={groupId} and ((b.DepartmentName like'%地接部%' or b.Depa
left join rb_department d on e.RB_Department_Id=d.DepartmentID left join rb_department d on e.RB_Department_Id=d.DepartmentID
left join rb_post p on e.RB_Post_Id=p.PostId left join rb_post p on e.RB_Post_Id=p.PostId
left join rb_branch b on e.RB_Branch_id=b.Id left join rb_branch b on e.RB_Branch_id=b.Id
where e.EmName like '%{EmName}%' and e.RB_Group_id={RB_Group_id} and e.IsLeave = 0"; where e.EmName like '%{EmName}%' and e.RB_Group_id={RB_Group_id} and e.IsLeave = 0 ";
if (EmpId != 0) if (EmpId != 0)
{ {
sql = $"{sql} and e.EmployeeId={EmpId}"; sql = $"{sql} and e.EmployeeId={EmpId}";
} }
if (branchId >= 0) {
sql += $" and (e.RB_Branch_id={branchId} or e.IsGroupShow=1)";
}
return Get<RB_Employee_Extend>(sql).ToList(); return Get<RB_Employee_Extend>(sql).ToList();
} }
......
...@@ -2277,7 +2277,7 @@ namespace REBORN.Services.FinanceService ...@@ -2277,7 +2277,7 @@ namespace REBORN.Services.FinanceService
List<RB_ClientBankAccount> KingdeeClientBankAccountList = new List<RB_ClientBankAccount>(); List<RB_ClientBankAccount> KingdeeClientBankAccountList = new List<RB_ClientBankAccount>();
if (ID == 0) if (ID == 0)
{ {
model.RB_GroupName = new CacheManager.User.RbBranchMongoCache().GetBranch(model.RB_Branch_Id.Value)?.FinanceTitle ?? "";//集团使用配置的 model.RB_GroupName = new CacheManager.User.RbBranchMongoCache().GetBranch(userInfo.RB_Branch_id)?.FinanceTitle ?? "";//集团使用配置的
if (string.IsNullOrEmpty(model.RB_GroupName)) { model.RB_GroupName = userInfo.GroupName; } if (string.IsNullOrEmpty(model.RB_GroupName)) { model.RB_GroupName = userInfo.GroupName; }
obj = new obj = new
{ {
......
...@@ -256,11 +256,12 @@ namespace REBORN.Services.PlatformService ...@@ -256,11 +256,12 @@ namespace REBORN.Services.PlatformService
JObject parm = JObject.Parse(request.msg.ToString()); JObject parm = JObject.Parse(request.msg.ToString());
string EmNmae = parm.GetStringValue("EmName"); string EmNmae = parm.GetStringValue("EmName");
int EmpId = parm.GetInt("EmpId", 0); int EmpId = parm.GetInt("EmpId", 0);
int BranchId = parm.GetInt("BranchId", -1);
if (string.IsNullOrWhiteSpace(EmNmae)) if (string.IsNullOrWhiteSpace(EmNmae))
{ {
return ApiResult.Failed("参数不能为空!"); return ApiResult.Failed("参数不能为空!");
} }
var EmList = branchmodule.GetEmpAndImByEmpName(EmNmae, userInfo.RB_Group_id, EmpId).Select(t => new { name = t.EmName, empId = t.EmployeeId, icon = Config.GetFileUrl(t.EmPhoto), postName = t.PostName, departmentName = t.DepartmentName, companyName = t.CompanyName, imAccount = t.OpenAccount }); var EmList = branchmodule.GetEmpAndImByEmpName(EmNmae, userInfo.RB_Group_id, EmpId, BranchId).Select(t => new { name = t.EmName, empId = t.EmployeeId, icon = Config.GetFileUrl(t.EmPhoto), postName = t.PostName, departmentName = t.DepartmentName, companyName = t.CompanyName, imAccount = t.OpenAccount });
return ApiResult.Success("", EmList); return ApiResult.Success("", EmList);
} }
} }
......
...@@ -294,6 +294,7 @@ namespace REBORN.Services.UserService ...@@ -294,6 +294,7 @@ namespace REBORN.Services.UserService
EmLeave = x.IsLeave == 1 ? x.EmLeave != null ? Convert.ToDateTime(x.EmLeave).ToString("yyyy-MM-dd") : "" : "", EmLeave = x.IsLeave == 1 ? x.EmLeave != null ? Convert.ToDateTime(x.EmLeave).ToString("yyyy-MM-dd") : "" : "",
x.EmployeeId, x.EmployeeId,
x.EnterpriseWeChatId, x.EnterpriseWeChatId,
x.IsGroupShow
}); });
return ApiResult.Success(data: data); return ApiResult.Success(data: data);
} }
...@@ -406,8 +407,29 @@ namespace REBORN.Services.UserService ...@@ -406,8 +407,29 @@ namespace REBORN.Services.UserService
})); }));
} }
/// <summary>
/// 设置员工账号 集团下均可查询
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public virtual ApiResult SetEmployeeGroupShow(RequestParm request) {
UserInfo userInfo = CacheManager.User.RbUserCache.GetUserLoginInfo(request.uid);
JObject parm = JObject.Parse(request.msg.ToString());
int Id = parm.GetInt("Id");
if (Id == 0)
{
return ApiResult.ParamIsNull();
}
string msg = employeemodule.SetEmployeeGroupShow(Id, userInfo.RB_Group_id);
if (msg == "")
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed(msg);
}
}
/// <summary> /// <summary>
/// 集团下部门管理 树形结构 /// 集团下部门管理 树形结构
......
...@@ -157,6 +157,12 @@ ...@@ -157,6 +157,12 @@
"method": "GetPageList", "method": "GetPageList",
"url": "" "url": ""
}, },
{
"cmd": "admin_post_SetEmployeeGroupShow",//设置员工帐号 集团均可查询
"fullName": "REBORN.Services.UserService.EmployeeService",
"method": "SetEmployeeGroupShow",
"url": ""
},
{ {
"cmd": "admin_get_GetGroupEmployeeNum", //获取员工数量统计 "cmd": "admin_get_GetGroupEmployeeNum", //获取员工数量统计
"fullName": "REBORN.Services.UserService.EmployeeService", "fullName": "REBORN.Services.UserService.EmployeeService",
......
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