From a0ec3319b2b81c3c66733ce05f1d6abbc4494821 Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Wed, 19 Mar 2025 13:44:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E7=BB=84=E7=AE=A1=E7=90=86=E9=87=8D?= =?UTF-8?q?=E5=A4=A7=E6=9B=B4=E6=96=B0=EF=BC=9A=E7=BB=84=E5=8F=98=E4=B8=BA?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Group/GroupPersonOfSkillMatrixController.cs | 17 ++++++++++++----- .../MES/Group/GroupScheduleController.cs | 16 +++++++--------- DOAN.Model/MES/Group/Dto/GroupPersonSkillDto.cs | 4 ++-- .../MES/Group/Dto/GroupRelPersonGroupDto.cs | 2 +- DOAN.Model/MES/Group/GroupRelPersonGroup.cs | 4 ++-- DOAN.Service/MES/Group/GroupScheduleService.cs | 10 +++++----- .../MES/Group/IService/IGroupScheduleService.cs | 4 ++-- .../MES/Group/IService/ISkillMatrixService.cs | 6 +++--- DOAN.Service/MES/Group/SkillMatrixService.cs | 17 +++++++++++++++-- 9 files changed, 49 insertions(+), 31 deletions(-) diff --git a/DOAN.Admin.WebApi/Controllers/MES/Group/GroupPersonOfSkillMatrixController.cs b/DOAN.Admin.WebApi/Controllers/MES/Group/GroupPersonOfSkillMatrixController.cs index 7a76bf0..0aa78ba 100644 --- a/DOAN.Admin.WebApi/Controllers/MES/Group/GroupPersonOfSkillMatrixController.cs +++ b/DOAN.Admin.WebApi/Controllers/MES/Group/GroupPersonOfSkillMatrixController.cs @@ -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); } diff --git a/DOAN.Admin.WebApi/Controllers/MES/Group/GroupScheduleController.cs b/DOAN.Admin.WebApi/Controllers/MES/Group/GroupScheduleController.cs index 0fc2de1..9640b22 100644 --- a/DOAN.Admin.WebApi/Controllers/MES/Group/GroupScheduleController.cs +++ b/DOAN.Admin.WebApi/Controllers/MES/Group/GroupScheduleController.cs @@ -34,7 +34,7 @@ namespace DOAN.Admin.WebApi.Controllers /// /// [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); } diff --git a/DOAN.Model/MES/Group/Dto/GroupPersonSkillDto.cs b/DOAN.Model/MES/Group/Dto/GroupPersonSkillDto.cs index aebe8a3..640f51a 100644 --- a/DOAN.Model/MES/Group/Dto/GroupPersonSkillDto.cs +++ b/DOAN.Model/MES/Group/Dto/GroupPersonSkillDto.cs @@ -34,8 +34,8 @@ namespace DOAN.Model.MES.group.Dto /// public class GroupPersonSkillDto { - [Required(ErrorMessage = "雪花不能为空")] - public string Id { get; set; } + + public string? Id { get; set; } public string SkillName { get; set; } diff --git a/DOAN.Model/MES/Group/Dto/GroupRelPersonGroupDto.cs b/DOAN.Model/MES/Group/Dto/GroupRelPersonGroupDto.cs index f09af5b..297f6dc 100644 --- a/DOAN.Model/MES/Group/Dto/GroupRelPersonGroupDto.cs +++ b/DOAN.Model/MES/Group/Dto/GroupRelPersonGroupDto.cs @@ -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; } diff --git a/DOAN.Model/MES/Group/GroupRelPersonGroup.cs b/DOAN.Model/MES/Group/GroupRelPersonGroup.cs index 70f3006..bcadf78 100644 --- a/DOAN.Model/MES/Group/GroupRelPersonGroup.cs +++ b/DOAN.Model/MES/Group/GroupRelPersonGroup.cs @@ -10,8 +10,8 @@ namespace DOAN.Model.MES.group /// /// 组别id /// - [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; } /// /// 员工id diff --git a/DOAN.Service/MES/Group/GroupScheduleService.cs b/DOAN.Service/MES/Group/GroupScheduleService.cs index 80e6209..90c2490 100644 --- a/DOAN.Service/MES/Group/GroupScheduleService.cs +++ b/DOAN.Service/MES/Group/GroupScheduleService.cs @@ -146,7 +146,7 @@ namespace DOAN.Service.Business .Where((rel, p) => p.Status == 1) .Where((rel, p) => SqlFunc.Subqueryable().Where(it => it.ScheduleDate == SqlFunc.Subqueryable() .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() - .Where(it => it.FkGroupId == group_schedule_id) + .Where(it => it.GroupCode == group_code) .Where(it => it.FkPersonId == person_id) .ExecuteCommand(); } diff --git a/DOAN.Service/MES/Group/IService/IGroupScheduleService.cs b/DOAN.Service/MES/Group/IService/IGroupScheduleService.cs index e09660c..ade9ef1 100644 --- a/DOAN.Service/MES/Group/IService/IGroupScheduleService.cs +++ b/DOAN.Service/MES/Group/IService/IGroupScheduleService.cs @@ -28,8 +28,8 @@ namespace DOAN.Service.group.IService PagedInfo SearchPerson_group_bind_No(GroupScheduleQueryDto3 parm); List 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 GetMonthScheduleResult(int year,int HandleMonth); diff --git a/DOAN.Service/MES/Group/IService/ISkillMatrixService.cs b/DOAN.Service/MES/Group/IService/ISkillMatrixService.cs index f244515..8b19ab6 100644 --- a/DOAN.Service/MES/Group/IService/ISkillMatrixService.cs +++ b/DOAN.Service/MES/Group/IService/ISkillMatrixService.cs @@ -12,11 +12,11 @@ namespace DOAN.Service.MES.group.IService public interface ISkillMatrixService { - List GetAllGroups(DateTime date); - + //List GetAllGroups(DateTime date); + public List GetAllGroups(); List GetAllRoutes(); - List GetPersonsList(string group_schedule_id); + List GetPersonsList(string group_code); HandleSkillInfoDto GetSkillsDetailofPepole(HandleSkillQueryDto parm); } diff --git a/DOAN.Service/MES/Group/SkillMatrixService.cs b/DOAN.Service/MES/Group/SkillMatrixService.cs index be57dc7..31d94f5 100644 --- a/DOAN.Service/MES/Group/SkillMatrixService.cs +++ b/DOAN.Service/MES/Group/SkillMatrixService.cs @@ -33,19 +33,32 @@ namespace DOAN.Service.group } + public List GetAllGroups() + { + return Context.Queryable().Where(it => it.Status == 1).ToList(); + } + public List GetAllRoutes() { return Context.Queryable().Where(it => it.Status == 1).ToList(); } - public List GetPersonsList(string group_schedule_id) + public List GetPersonsList(string group_code) { var query = Context.Queryable() - .Where(it => it.FkGroupId == group_schedule_id); + .Where(it => it.GroupCode == group_code); var result = Context.Queryable(query).LeftJoin((q, p) => q.FkPersonId == p.Id) .Select((q, p) => p).ToList(); return result; } + // 获取组的人员列表 + + //public List GetPersonsList(string group_code) + //{ + + //} + + /// /// 获取人员在某一工艺流程下技能的详情