diff --git a/ZR.Admin.WebApi/Controllers/MES/dev/DeviceAccountController.cs b/ZR.Admin.WebApi/Controllers/MES/dev/DeviceAccountController.cs index 392ea72..3f22bd2 100644 --- a/ZR.Admin.WebApi/Controllers/MES/dev/DeviceAccountController.cs +++ b/ZR.Admin.WebApi/Controllers/MES/dev/DeviceAccountController.cs @@ -31,12 +31,24 @@ namespace ZR.Admin.WebApi.Controllers /// /// [HttpGet("list")] - [ActionPermissionFilter(Permission = "business:deviceaccount:list")] + [ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:list")] public IActionResult QueryDeviceAccount([FromQuery] DeviceAccountQueryDto parm) { var response = _DeviceAccountService.GetList(parm); return SUCCESS(response); } + /// + /// 查询绑定或者未绑定巡检任务的设备台账 + /// + /// + /// + [HttpGet("list_route_inspect")] + [AllowAnonymous] + public IActionResult QueryDeviceAccount_Route([FromQuery] DeviceAccountQueryDto2 parm) + { + var response = _DeviceAccountService.GetList_Route(parm); + return SUCCESS(response); + } /// @@ -45,7 +57,7 @@ namespace ZR.Admin.WebApi.Controllers /// /// [HttpGet("{Id}")] - [ActionPermissionFilter(Permission = "business:deviceaccount:query")] + [ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:query")] public IActionResult GetDeviceAccount(int Id) { var response = _DeviceAccountService.GetInfo(Id); @@ -59,7 +71,7 @@ namespace ZR.Admin.WebApi.Controllers /// /// [HttpPost] - [ActionPermissionFilter(Permission = "business:deviceaccount:add")] + [ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:add")] [Log(Title = "设备台账", BusinessType = BusinessType.INSERT)] public IActionResult AddDeviceAccount([FromBody] DeviceAccountDto parm) { @@ -75,7 +87,7 @@ namespace ZR.Admin.WebApi.Controllers /// /// [HttpPut] - [ActionPermissionFilter(Permission = "business:deviceaccount:edit")] + [ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:edit")] [Log(Title = "设备台账", BusinessType = BusinessType.UPDATE)] public IActionResult UpdateDeviceAccount([FromBody] DeviceAccountDto parm) { @@ -90,7 +102,7 @@ namespace ZR.Admin.WebApi.Controllers /// /// [HttpDelete("{ids}")] - [ActionPermissionFilter(Permission = "business:deviceaccount:delete")] + [ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:delete")] [Log(Title = "设备台账", BusinessType = BusinessType.DELETE)] public IActionResult DeleteDeviceAccount(string ids) { diff --git a/ZR.Admin.WebApi/DOAN.WebApi.csproj b/ZR.Admin.WebApi/DOAN.WebApi.csproj index e0602a7..002f07c 100644 --- a/ZR.Admin.WebApi/DOAN.WebApi.csproj +++ b/ZR.Admin.WebApi/DOAN.WebApi.csproj @@ -9,9 +9,13 @@ 1701;1702;1591,8603,8602,8604,8600,8618 + + + + @@ -32,7 +36,6 @@ - diff --git a/ZR.Admin.WebApi/wwwroot/2024/0520/40F0726C8C08D158.jpg b/ZR.Admin.WebApi/wwwroot/2024/0520/40F0726C8C08D158.jpg deleted file mode 100644 index 818dc10..0000000 Binary files a/ZR.Admin.WebApi/wwwroot/2024/0520/40F0726C8C08D158.jpg and /dev/null differ diff --git a/ZR.Admin.WebApi/wwwroot/2024/0521/4B2A74E4A58A75D7.jpg b/ZR.Admin.WebApi/wwwroot/2024/0521/4B2A74E4A58A75D7.jpg deleted file mode 100644 index 818dc10..0000000 Binary files a/ZR.Admin.WebApi/wwwroot/2024/0521/4B2A74E4A58A75D7.jpg and /dev/null differ diff --git a/ZR.Admin.WebApi/wwwroot/2024/0521/5CDA93D1A2B0F72F.xlsx b/ZR.Admin.WebApi/wwwroot/2024/0521/5CDA93D1A2B0F72F.xlsx deleted file mode 100644 index 7d6e46f..0000000 Binary files a/ZR.Admin.WebApi/wwwroot/2024/0521/5CDA93D1A2B0F72F.xlsx and /dev/null differ diff --git a/ZR.Admin.WebApi/wwwroot/2024/0521/AA1EC478D22168F3.png b/ZR.Admin.WebApi/wwwroot/2024/0521/AA1EC478D22168F3.png deleted file mode 100644 index a2c4549..0000000 Binary files a/ZR.Admin.WebApi/wwwroot/2024/0521/AA1EC478D22168F3.png and /dev/null differ diff --git a/ZR.Admin.WebApi/wwwroot/2024/0522/86DCBF984FD21F46.xlsx b/ZR.Admin.WebApi/wwwroot/2024/0522/86DCBF984FD21F46.xlsx deleted file mode 100644 index 24f99f8..0000000 Binary files a/ZR.Admin.WebApi/wwwroot/2024/0522/86DCBF984FD21F46.xlsx and /dev/null differ diff --git a/ZR.Admin.WebApi/wwwroot/Generatecode/ZrAdmin.NET-设备台账-0528155319.zip b/ZR.Admin.WebApi/wwwroot/Generatecode/ZrAdmin.NET-设备台账-0528155319.zip new file mode 100644 index 0000000..6152059 Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/Generatecode/ZrAdmin.NET-设备台账-0528155319.zip differ diff --git a/ZR.Admin.WebApi/wwwroot/avatar/2023/1207/43A6AE3EA419A3DF.ico b/ZR.Admin.WebApi/wwwroot/avatar/2023/1207/43A6AE3EA419A3DF.ico deleted file mode 100644 index 9f0e270..0000000 Binary files a/ZR.Admin.WebApi/wwwroot/avatar/2023/1207/43A6AE3EA419A3DF.ico and /dev/null differ diff --git a/ZR.Admin.WebApi/wwwroot/avatar/2023/1207/E8AC1A0119A2CC8B.ico b/ZR.Admin.WebApi/wwwroot/avatar/2023/1207/E8AC1A0119A2CC8B.ico deleted file mode 100644 index 9f0e270..0000000 Binary files a/ZR.Admin.WebApi/wwwroot/avatar/2023/1207/E8AC1A0119A2CC8B.ico and /dev/null differ diff --git a/ZR.Model/MES/dev/Dto/DeviceAccountDto.cs b/ZR.Model/MES/dev/Dto/DeviceAccountDto.cs index cd214fb..189cc3d 100644 --- a/ZR.Model/MES/dev/Dto/DeviceAccountDto.cs +++ b/ZR.Model/MES/dev/Dto/DeviceAccountDto.cs @@ -16,6 +16,25 @@ namespace ZR.Model.MES.dev.Dto public int? Status { get; set; } } + + /// + /// 适配设备巡检项 + /// + public class DeviceAccountQueryDto2 : PagerInfo + { + /// + /// 设备类型 + /// + public int FkDeviceType { get; set; } + public string DeviceName { get; set; } + public string DeviceSpecification { get; set; } + + /// + /// 巡检id + /// + public string fkRouteInspectionPlanId { get; set; } + } + /// /// 设备台账输入输出对象 /// diff --git a/ZR.Service/MES/dev/DeviceAccountService.cs b/ZR.Service/MES/dev/DeviceAccountService.cs index 75832d8..968f7c7 100644 --- a/ZR.Service/MES/dev/DeviceAccountService.cs +++ b/ZR.Service/MES/dev/DeviceAccountService.cs @@ -41,6 +41,28 @@ namespace ZR.Service.MES.dev return response; } + public PagedInfo GetList_Route(DeviceAccountQueryDto2 parm) + { + var predicate = Expressionable.Create() + .AndIF(!string.IsNullOrEmpty(parm.DeviceName), (a, r) => a.DeviceName.Contains(parm.DeviceName)) + .AndIF(!string.IsNullOrEmpty(parm.DeviceSpecification), (a, r) => a.DeviceSpecification.Contains(parm.DeviceSpecification)) + .And((a, r) => a.Status == 1) + .AndIF(parm.FkDeviceType > 0, (a, r) => a.FkDeviceType == parm.FkDeviceType) + .AndIF(!string.IsNullOrEmpty(parm.fkRouteInspectionPlanId), (a, r) =>r.FkRouteInspectionPlanId== parm.fkRouteInspectionPlanId) + .AndIF(string.IsNullOrEmpty(parm.fkRouteInspectionPlanId), (a, r) =>r.FkRouteInspectionPlanId!= parm.fkRouteInspectionPlanId|| r.FkRouteInspectionPlanId==null) + ; + + + var response = Context.Queryable() + .LeftJoin((a, r) =>a.Id==r.FkDeviceAccountId) + .Where(predicate.ToExpression()) + .Select((a,r)=>a) + .ToPage(parm); + + return response; + + } + /// /// 获取详情 diff --git a/ZR.Service/MES/dev/DeviceRelRpAt.cs b/ZR.Service/MES/dev/DeviceRelRpAt.cs new file mode 100644 index 0000000..0b4ec2e --- /dev/null +++ b/ZR.Service/MES/dev/DeviceRelRpAt.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZR.Service.MES.dev +{ + /// + /// 巡检计划与设备关联表 + /// + [SugarTable("device_rel_rp_at")] + public class DeviceRelRpAt + { + /// + /// 巡检计划 id + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_route_inspection_plan_id")] + public string FkRouteInspectionPlanId { get; set; } + + /// + /// 设备台账id + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_device_account_id")] + public int FkDeviceAccountId { get; set; } + + /// + /// 巡检设备顺序 + /// + public int? Sort { get; set; } + + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "cREATED_BY")] + public string CreatedBy { get; set; } + + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "cREATED_TIME")] + public DateTime? CreatedTime { get; set; } + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "uPDATED_BY")] + public string UpdatedBy { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "uPDATED_TIME")] + public DateTime? UpdatedTime { get; set; } + + } +} \ No newline at end of file diff --git a/ZR.Service/MES/dev/DeviceRouteInspectionPlanService.cs b/ZR.Service/MES/dev/DeviceRouteInspectionPlanService.cs index 2825570..aa12b95 100644 --- a/ZR.Service/MES/dev/DeviceRouteInspectionPlanService.cs +++ b/ZR.Service/MES/dev/DeviceRouteInspectionPlanService.cs @@ -71,27 +71,42 @@ namespace ZR.Service.MES.dev /// public int UpdateDeviceRouteInspectionPlan(DeviceRouteInspectionPlan model) { - //var response = Update(w => w.Id == model.Id, it => new DeviceRouteInspectionPlan() - //{ - // Name = model.Name, - // Status = model.Status, - // Type = model.Type, - // LifeCycleStart = model.LifeCycleStart, - // LifeCycleEnd = model.LifeCycleEnd, - // ExcuteCycleType = model.ExcuteCycleType, - // DayNum = model.DayNum, - // WeekList = model.WeekList, - // MonthDayList = model.MonthDayList, - // ExcuteDayStartTime = model.ExcuteDayStartTime, - // ExcuteDayEndTime = model.ExcuteDayEndTime, - // Remark = model.Remark, - // CreatedBy = model.CreatedBy, - // CreatedTime = model.CreatedTime, - // UpdatedBy = model.UpdatedBy, - // UpdatedTime = model.UpdatedTime, - //}); - //return response; - return Update(model, true); + switch (model.ExcuteCycleType) + { + // 每日 + case 1: + model.WeekList = ""; + model.MonthDayList = ""; + break; + //每周 + case 2: + model.DayNum = null; + model.MonthDayList = ""; + break; + //每月 + case 3: + model.WeekList = ""; + model.DayNum = null; + break; + } + var response = Update(w => w.Id == model.Id, it => new DeviceRouteInspectionPlan() + { + Name = model.Name, + Status = model.Status, + Type = model.Type, + LifeCycleStart = model.LifeCycleStart, + LifeCycleEnd = model.LifeCycleEnd, + ExcuteCycleType = model.ExcuteCycleType, + DayNum = model.DayNum, + WeekList = model.WeekList, + MonthDayList = model.MonthDayList, + Remark = model.Remark, + + UpdatedBy = model.UpdatedBy, + UpdatedTime = model.UpdatedTime, + }); + return response; + // return Update(model, true); } } diff --git a/ZR.Service/MES/dev/IService/IDeviceAccountService.cs b/ZR.Service/MES/dev/IService/IDeviceAccountService.cs index b8eacaa..919b887 100644 --- a/ZR.Service/MES/dev/IService/IDeviceAccountService.cs +++ b/ZR.Service/MES/dev/IService/IDeviceAccountService.cs @@ -14,6 +14,10 @@ namespace ZR.Service.Business.IBusinessService { PagedInfo GetList(DeviceAccountQueryDto parm); + PagedInfo GetList_Route(DeviceAccountQueryDto2 parm); + + + DeviceAccount GetInfo(int Id); DeviceAccount AddDeviceAccount(DeviceAccount parm);