班组管理重大更新:组变为基本数据
This commit is contained in:
@@ -24,10 +24,17 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
|
||||
|
||||
//TODO 1 获取班组
|
||||
//[HttpGet("get_all_group")]
|
||||
//public IActionResult GetAllGroups(DateTime date)
|
||||
//{
|
||||
// var response = _SkillMatrixService.GetAllGroups(date.Date);
|
||||
// return SUCCESS(response);
|
||||
//}
|
||||
|
||||
[HttpGet("get_all_group")]
|
||||
public IActionResult GetAllGroups(DateTime date)
|
||||
public IActionResult GetAllGroups()
|
||||
{
|
||||
var response = _SkillMatrixService.GetAllGroups(date.Date);
|
||||
var response = _SkillMatrixService.GetAllGroups();
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
@@ -44,11 +51,11 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
|
||||
//TODO 3 根据班组获取人员
|
||||
[HttpGet("get_persons")]
|
||||
public IActionResult GetPersonsList(string group_schedule_id) {
|
||||
public IActionResult GetPersonsList(string group_code) {
|
||||
|
||||
if (string.IsNullOrWhiteSpace(group_schedule_id)) { return SUCCESS(null); }
|
||||
if (string.IsNullOrWhiteSpace(group_code)) { return SUCCESS(null); }
|
||||
|
||||
var response = _SkillMatrixService.GetPersonsList(group_schedule_id);
|
||||
var response = _SkillMatrixService.GetPersonsList(group_code);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
// [ActionPermissionFilter(Permission = "business:groupschedule:list")]
|
||||
//[ActionPermissionFilter(Permission = "business:groupschedule:list")]
|
||||
public IActionResult QueryGroupSchedule([FromQuery] GroupScheduleQueryDto parm)
|
||||
{
|
||||
var response = _GroupScheduleService.GetList(parm);
|
||||
@@ -187,21 +187,19 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
|
||||
var response = _GroupScheduleService.SearchPerson_group_bind_No(parm);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
//TODO 班组添加人员
|
||||
[HttpGet("add_person")]
|
||||
public IActionResult GroupAddPerson(string group_schedule_id, string person_id)
|
||||
public IActionResult GroupAddPerson(string group_code, string person_id)
|
||||
{
|
||||
if (string.IsNullOrEmpty(group_schedule_id)) { return SUCCESS(null); }
|
||||
if (string.IsNullOrEmpty(group_code)) { return SUCCESS(null); }
|
||||
if (string.IsNullOrEmpty(person_id)) { return SUCCESS(null); }
|
||||
var response = _GroupScheduleService
|
||||
.GroupAddPerson(group_schedule_id, person_id, HttpContext.GetName());
|
||||
.GroupAddPerson(group_code, person_id, HttpContext.GetName());
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
@@ -209,14 +207,14 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
|
||||
//TODO 班组删除人员
|
||||
[HttpGet("delete_person")]
|
||||
public IActionResult GroupRemovePerson(string group_schedule_id, string person_id)
|
||||
public IActionResult GroupRemovePerson(string group_code, string person_id)
|
||||
{
|
||||
if (string.IsNullOrEmpty(group_schedule_id)) { return SUCCESS(null); }
|
||||
if (string.IsNullOrEmpty(group_code)) { return SUCCESS(null); }
|
||||
if (string.IsNullOrEmpty(person_id)) { return SUCCESS(null); }
|
||||
|
||||
|
||||
var response = _GroupScheduleService
|
||||
.GroupRemovePerson(group_schedule_id, person_id);
|
||||
.GroupRemovePerson(group_code, person_id);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace DOAN.Model.MES.group.Dto
|
||||
/// </summary>
|
||||
public class GroupPersonSkillDto
|
||||
{
|
||||
[Required(ErrorMessage = "雪花不能为空")]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string? Id { get; set; }
|
||||
|
||||
public string SkillName { get; set; }
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace DOAN.Model.MES.group.Dto
|
||||
public class GroupRelPersonGroupDto
|
||||
{
|
||||
[Required(ErrorMessage = "组别id不能为空")]
|
||||
public string FkGroupId { get; set; }
|
||||
public string GroupCode { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "员工id不能为空")]
|
||||
public string FkPersonId { get; set; }
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace DOAN.Model.MES.group
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_group_id")]
|
||||
public string FkGroupId { get; set; }
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "group_code")]
|
||||
public string GroupCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工id
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace DOAN.Service.Business
|
||||
.Where((rel, p) => p.Status == 1)
|
||||
.Where((rel, p) => SqlFunc.Subqueryable<GroupSchedule>().Where(it => it.ScheduleDate == SqlFunc.Subqueryable<GroupSchedule>()
|
||||
.Where(it => it.Id == parm.group_schedule_id)
|
||||
.Select(it => it.ScheduleDate)).Where(it => it.Id == rel.FkGroupId).Any()).Where((rel, p) => p.Id == it.Id).NotAny());
|
||||
.Select(it => it.ScheduleDate)).Where(it => it.Id == rel.GroupCode).Any()).Where((rel, p) => p.Id == it.Id).NotAny());
|
||||
|
||||
|
||||
return Context.Queryable(query)
|
||||
@@ -170,20 +170,20 @@ namespace DOAN.Service.Business
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public int GroupAddPerson(string group_schedule_id, string person_id, string CreatedBy)
|
||||
public int GroupAddPerson(string group_code, string person_id, string CreatedBy)
|
||||
{
|
||||
GroupRelPersonGroup relPersonGroup = new GroupRelPersonGroup();
|
||||
relPersonGroup.FkGroupId = group_schedule_id;
|
||||
relPersonGroup.GroupCode = group_code;
|
||||
relPersonGroup.FkPersonId = person_id;
|
||||
relPersonGroup.CreatedTime = DateTime.Now;
|
||||
relPersonGroup.CreatedBy = CreatedBy;
|
||||
return Context.Insertable(relPersonGroup).ExecuteCommand();
|
||||
}
|
||||
|
||||
public int GroupRemovePerson(string group_schedule_id, string person_id)
|
||||
public int GroupRemovePerson(string group_code, string person_id)
|
||||
{
|
||||
return Context.Deleteable<GroupRelPersonGroup>()
|
||||
.Where(it => it.FkGroupId == group_schedule_id)
|
||||
.Where(it => it.GroupCode == group_code)
|
||||
.Where(it => it.FkPersonId == person_id)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ namespace DOAN.Service.group.IService
|
||||
PagedInfo<GroupPersonDto> SearchPerson_group_bind_No(GroupScheduleQueryDto3 parm);
|
||||
|
||||
List<BaseGroup> GetALLGroup(string group_code,string group_name);
|
||||
int GroupAddPerson(string group_schedule_id, string person_id, string CreatedBy);
|
||||
int GroupRemovePerson(string group_schedule_id, string person_id);
|
||||
int GroupAddPerson(string group_code, string person_id, string CreatedBy);
|
||||
int GroupRemovePerson(string group_code, string person_id);
|
||||
|
||||
List<SchedulingSituation> GetMonthScheduleResult(int year,int HandleMonth);
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ namespace DOAN.Service.MES.group.IService
|
||||
public interface ISkillMatrixService
|
||||
{
|
||||
|
||||
List<GroupSchedule> GetAllGroups(DateTime date);
|
||||
|
||||
//List<GroupSchedule> GetAllGroups(DateTime date);
|
||||
public List<BaseGroup> GetAllGroups();
|
||||
List<BaseWorkRoute> GetAllRoutes();
|
||||
|
||||
List<GroupPerson> GetPersonsList(string group_schedule_id);
|
||||
List<GroupPerson> GetPersonsList(string group_code);
|
||||
|
||||
HandleSkillInfoDto GetSkillsDetailofPepole(HandleSkillQueryDto parm);
|
||||
}
|
||||
|
||||
@@ -33,19 +33,32 @@ namespace DOAN.Service.group
|
||||
|
||||
}
|
||||
|
||||
public List<BaseGroup> GetAllGroups()
|
||||
{
|
||||
return Context.Queryable<BaseGroup>().Where(it => it.Status == 1).ToList();
|
||||
}
|
||||
|
||||
public List<BaseWorkRoute> GetAllRoutes()
|
||||
{
|
||||
return Context.Queryable<BaseWorkRoute>().Where(it => it.Status == 1).ToList();
|
||||
}
|
||||
public List<GroupPerson> GetPersonsList(string group_schedule_id)
|
||||
public List<GroupPerson> GetPersonsList(string group_code)
|
||||
{
|
||||
var query = Context.Queryable<GroupRelPersonGroup>()
|
||||
.Where(it => it.FkGroupId == group_schedule_id);
|
||||
.Where(it => it.GroupCode == group_code);
|
||||
var result = Context.Queryable(query).LeftJoin<GroupPerson>((q, p) => q.FkPersonId == p.Id)
|
||||
.Select((q, p) => p).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
// 获取组的人员列表
|
||||
|
||||
//public List<GroupPerson> GetPersonsList(string group_code)
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取人员在某一工艺流程下技能的详情
|
||||
|
||||
Reference in New Issue
Block a user