设备管理
This commit is contained in:
@@ -0,0 +1,236 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Model.MES.dev;
|
||||
|
||||
//创建时间:2024-05-20
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备台账
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/deviceManagement/DeviceAccount")]
|
||||
public class DeviceAccountController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备台账接口
|
||||
/// </summary>
|
||||
private readonly IDeviceAccountService _DeviceAccountService;
|
||||
|
||||
public DeviceAccountController(IDeviceAccountService DeviceAccountService)
|
||||
{
|
||||
_DeviceAccountService = DeviceAccountService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询设备台账列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:list")]
|
||||
public IActionResult QueryDeviceAccount([FromQuery] DeviceAccountQueryDto parm)
|
||||
{
|
||||
var response = _DeviceAccountService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询绑定或者未绑定巡检任务的设备台账
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list_route_inspect")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult QueryDeviceAccount_Route([FromQuery] DeviceAccountQueryDto2 parm)
|
||||
{
|
||||
var response = _DeviceAccountService.GetList_Route(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询设备台账详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:query")]
|
||||
public IActionResult GetDeviceAccount(int Id)
|
||||
{
|
||||
var response = _DeviceAccountService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DeviceAccount>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加设备台账
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:add")]
|
||||
[Log(Title = "设备台账", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDeviceAccount([FromBody] DeviceAccountDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceAccount>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DeviceAccountService.AddDeviceAccount(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新设备台账
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:edit")]
|
||||
[Log(Title = "设备台账", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDeviceAccount([FromBody] DeviceAccountDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceAccount>().ToUpdate(HttpContext);
|
||||
var response = _DeviceAccountService.UpdateDeviceAccount(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除设备台账
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:delete")]
|
||||
[Log(Title = "设备台账", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDeviceAccount(string ids)
|
||||
{
|
||||
string[] idsArr = ids.Split(',');
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DeviceAccountService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备下拉选择树
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getSelectTree")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceaccount:list")]
|
||||
public IActionResult GetSelectTree([FromQuery] DeviceAccountQueryDto parm)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = _DeviceAccountService.GetSelectTree(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ToResponse(ApiResult.Error(500, ex.Message));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加绑定关系 巡检计划和设备台账
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("AddRelation")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult AddRelation([FromBody] DeviceAccount_routeinspect_Dto parm)
|
||||
{
|
||||
if (parm == null || parm.FkDeviceAccountIdList == null)
|
||||
{
|
||||
SUCCESS(null);
|
||||
}
|
||||
var response = _DeviceAccountService.AddRelation(parm, HttpContext.GetName());
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除关系
|
||||
/// </summary>
|
||||
/// <param name="FkRouteInspectionPlanId"></param>
|
||||
/// <param name="FkDeviceAccountId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("remove_relation")]
|
||||
public IActionResult Remove_relation(string FkRouteInspectionPlanId,int FkDeviceAccountId)
|
||||
{
|
||||
var response = _DeviceAccountService.Remove_relation(FkRouteInspectionPlanId, FkDeviceAccountId);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询绑定或者未绑定点检任务的设备台账
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list_point_inspect")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult QueryDeviceAccount_point([FromQuery] DeviceAccountQueryDto3 parm)
|
||||
{
|
||||
var response = _DeviceAccountService.GetList_Point(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加绑定关系 点检计划和设备台账
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("AddRelation_point_account")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult AddRelationPointAccount([FromBody] DeviceAccount_pointinspect_Dto parm)
|
||||
{
|
||||
if (parm == null || parm.FkDeviceAccountIdList == null)
|
||||
{
|
||||
SUCCESS(null);
|
||||
}
|
||||
var response = _DeviceAccountService.AddRelationPointAccount(parm, HttpContext.GetName());
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除关系
|
||||
/// </summary>
|
||||
/// <param name="FkRouteInspectionPlanId"></param>
|
||||
/// <param name="FkDeviceAccountId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("remove_relation_point_account")]
|
||||
public IActionResult RemoveRelationPointAccount(string FkPointInspectionPlanId, int FkDeviceAccountId)
|
||||
{
|
||||
var response = _DeviceAccountService.RemoveRelationPointAccount(FkPointInspectionPlanId, FkDeviceAccountId);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备状态 设备看板用
|
||||
/// </summary>
|
||||
/// <param name="devicetype_id">设备类型id</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getDeviceStatusBoardData")]
|
||||
public IActionResult GetDeviceStatus(int devicetype_id)
|
||||
{
|
||||
DeviceStatusAnalysisDto response= _DeviceAccountService.GetDeviceStatus(devicetype_id);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
|
||||
using DOAN.Model.MES.dev;
|
||||
|
||||
//创建时间:2024-05-22
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检查项表单配置表
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/deviceManagement/DeviceFormConfig")]
|
||||
public class DeviceFormConfigController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检查项表单配置表接口
|
||||
/// </summary>
|
||||
private readonly IDeviceFormConfigService _DeviceFormConfigService;
|
||||
|
||||
public DeviceFormConfigController(IDeviceFormConfigService DeviceFormConfigService)
|
||||
{
|
||||
_DeviceFormConfigService = DeviceFormConfigService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询设备检查项表单配置表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "business:deviceformconfig:list")]
|
||||
public IActionResult QueryDeviceFormConfig([FromQuery] DeviceFormConfigQueryDto parm)
|
||||
{
|
||||
var response = _DeviceFormConfigService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询设备检查项表单配置表详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "business:deviceformconfig:query")]
|
||||
public IActionResult GetDeviceFormConfig(string Id)
|
||||
{
|
||||
var response = _DeviceFormConfigService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DeviceFormConfig>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加设备检查项表单配置表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "business:deviceformconfig:add")]
|
||||
[Log(Title = "设备检查项表单配置表", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDeviceFormConfig([FromBody] DeviceFormConfigDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceFormConfig>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DeviceFormConfigService.AddDeviceFormConfig(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新设备检查项表单配置表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "business:deviceformconfig:edit")]
|
||||
[Log(Title = "设备检查项表单配置表", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDeviceFormConfig([FromBody] DeviceFormConfigDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceFormConfig>().ToUpdate(HttpContext);
|
||||
var response = _DeviceFormConfigService.UpdateDeviceFormConfig(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除设备检查项表单配置表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "business:deviceformconfig:delete")]
|
||||
[Log(Title = "设备检查项表单配置表", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDeviceFormConfig(string ids)
|
||||
{
|
||||
|
||||
string[] strIds = ids.Split(",", (char)StringSplitOptions.RemoveEmptyEntries);
|
||||
if (strIds.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DeviceFormConfigService.Delete(strIds);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
|
||||
using DOAN.Model.MES.dev;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using Aliyun.OSS;
|
||||
|
||||
//创建时间:2024-05-21
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检查项
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/deviceManagement/DeviceInspect")]
|
||||
public class DeviceInspectController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检查项接口
|
||||
/// </summary>
|
||||
private readonly IDeviceInspectService _DeviceInspectService;
|
||||
|
||||
public DeviceInspectController(IDeviceInspectService DeviceInspectService)
|
||||
{
|
||||
_DeviceInspectService = DeviceInspectService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询设备检查项列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
|
||||
public IActionResult QueryDeviceInspect([FromQuery] DeviceInspectQueryDto parm)
|
||||
{
|
||||
var response = _DeviceInspectService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备绑定模块 查询未绑定且状态为1 的设备检查项 Isbind=1 获取已经绑定 Isbind=0 获取未绑定
|
||||
/// </summary>
|
||||
/// <param name="parm"> </param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list2")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceinspect:list")]
|
||||
public IActionResult QueryDeviceInspect2([FromQuery] DeviceInspectQueryDto2 parm)
|
||||
{
|
||||
var response = _DeviceInspectService.GetList2(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询设备检查项详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceinspect:query")]
|
||||
public IActionResult GetDeviceInspect(int Id)
|
||||
{
|
||||
var response = _DeviceInspectService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DeviceInspect>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加设备检查项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceinspect:add")]
|
||||
[Log(Title = "设备检查项", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDeviceInspect([FromBody] DeviceInspectDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceInspect>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DeviceInspectService.AddDeviceInspect(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新设备检查项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceinspect:edit")]
|
||||
[Log(Title = "设备检查项", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDeviceInspect([FromBody] DeviceInspectDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceInspect>().ToUpdate(HttpContext);
|
||||
var response = _DeviceInspectService.UpdateDeviceInspect(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除设备检查项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceinspect:delete")]
|
||||
[Log(Title = "设备检查项", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDeviceInspect(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DeviceInspectService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 增加设备和设备检查项绑定关系
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("addbind")]
|
||||
public IActionResult AddBindrelative([FromBody] DeviceInspectQueryDto3 parm)
|
||||
{
|
||||
if (parm == null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
var response = _DeviceInspectService.AddBindrelative(parm,HttpContext.GetName());
|
||||
|
||||
return SUCCESS(response);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除设备和设备检查项绑定关系
|
||||
/// </summary>
|
||||
/// <param name="account_id"></param>
|
||||
/// <param name="inspect_id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("removebind")]
|
||||
public IActionResult RemoveBindrelative(int account_id, int inspect_id)
|
||||
{
|
||||
if (inspect_id <= 0 || account_id <= 0)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
var response = _DeviceInspectService.RemoveBindrelative(account_id, inspect_id);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排关系
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("sort")]
|
||||
public IActionResult SortBindrelative([FromBody] List<DeviceRelAccountInspect> parm)
|
||||
{
|
||||
if (parm == null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
|
||||
var modal = parm.ToUpdate(HttpContext);
|
||||
var response = _DeviceInspectService.SortBindrelative(parm);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Model.MES.dev;
|
||||
|
||||
//创建时间:2024-05-27
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 维修记录
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/deviceManagement/DeviceMaintenanceRecord")]
|
||||
public class DeviceMaintenanceRecordController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 维修记录接口
|
||||
/// </summary>
|
||||
private readonly IDeviceMaintenanceRecordService _DeviceMaintenanceRecordService;
|
||||
|
||||
public DeviceMaintenanceRecordController(IDeviceMaintenanceRecordService DeviceMaintenanceRecordService)
|
||||
{
|
||||
_DeviceMaintenanceRecordService = DeviceMaintenanceRecordService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询维修记录列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
// [ActionPermissionFilter(Permission = "business:devicemaintenancerecord:list")]
|
||||
public IActionResult QueryDeviceMaintenanceRecord([FromQuery] DeviceMaintenanceRecordQueryDto parm)
|
||||
{
|
||||
var response = _DeviceMaintenanceRecordService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询维修记录详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "business:devicemaintenancerecord:query")]
|
||||
public IActionResult GetDeviceMaintenanceRecord(string Id)
|
||||
{
|
||||
var response = _DeviceMaintenanceRecordService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DeviceMaintenanceRecord>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加维修记录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "business:devicemaintenancerecord:add")]
|
||||
[Log(Title = "维修记录", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDeviceMaintenanceRecord([FromBody] DeviceMaintenanceRecordDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceMaintenanceRecord>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DeviceMaintenanceRecordService.AddDeviceMaintenanceRecord(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新维修记录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "business:devicemaintenancerecord:edit")]
|
||||
[Log(Title = "维修记录", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDeviceMaintenanceRecord([FromBody] DeviceMaintenanceRecordDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceMaintenanceRecord>().ToUpdate(HttpContext);
|
||||
var response = _DeviceMaintenanceRecordService.UpdateDeviceMaintenanceRecord(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除维修记录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "business:devicemaintenancerecord:delete")]
|
||||
[Log(Title = "维修记录", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDeviceMaintenanceRecord(string ids)
|
||||
{
|
||||
string[] idsArr = ids.Split(',');
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DeviceMaintenanceRecordService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Model.MES.dev;
|
||||
|
||||
//创建时间:2024-05-27
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 点检任务
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/deviceManagement/DevicePointInspectionPlan")]
|
||||
public class DevicePointInspectionPlanController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 点检任务接口
|
||||
/// </summary>
|
||||
private readonly IDevicePointInspectionPlanService _DevicePointInspectionPlanService;
|
||||
|
||||
public DevicePointInspectionPlanController(IDevicePointInspectionPlanService DevicePointInspectionPlanService)
|
||||
{
|
||||
_DevicePointInspectionPlanService = DevicePointInspectionPlanService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询点检任务列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
|
||||
public IActionResult QueryDevicePointInspectionPlan([FromQuery] DevicePointInspectionPlanQueryDto parm)
|
||||
{
|
||||
var response = _DevicePointInspectionPlanService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询点检任务详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicepointinspectionplan:query")]
|
||||
public IActionResult GetDevicePointInspectionPlan(string Id)
|
||||
{
|
||||
var response = _DevicePointInspectionPlanService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DevicePointInspectionPlan>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加点检任务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicepointinspectionplan:add")]
|
||||
[Log(Title = "点检任务", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDevicePointInspectionPlan([FromBody] DevicePointInspectionPlanDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DevicePointInspectionPlan>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DevicePointInspectionPlanService.AddDevicePointInspectionPlan(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新点检任务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicepointinspectionplan:edit")]
|
||||
[Log(Title = "点检任务", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDevicePointInspectionPlan([FromBody] DevicePointInspectionPlanDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DevicePointInspectionPlan>().ToUpdate(HttpContext);
|
||||
var response = _DevicePointInspectionPlanService.UpdateDevicePointInspectionPlan(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除点检任务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicepointinspectionplan:delete")]
|
||||
[Log(Title = "点检任务", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDevicePointInspectionPlan(string ids)
|
||||
{
|
||||
string[] idsArr = ids.Split(',');
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DevicePointInspectionPlanService.Delete(idsArr);
|
||||
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Model.MES.dev;
|
||||
|
||||
//创建时间:2024-05-28
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 报修单
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("business/DeviceRepair")]
|
||||
public class DeviceRepairController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 报修单接口
|
||||
/// </summary>
|
||||
private readonly IDeviceRepairService _DeviceRepairService;
|
||||
|
||||
public DeviceRepairController(IDeviceRepairService DeviceRepairService)
|
||||
{
|
||||
_DeviceRepairService = DeviceRepairService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询报修单列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("list")]
|
||||
|
||||
public IActionResult QueryDeviceRepair([FromBody] DeviceRepairQueryDto parm)
|
||||
{
|
||||
var response = _DeviceRepairService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询报修单详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerepair:query")]
|
||||
public IActionResult GetDeviceRepair(string Id)
|
||||
{
|
||||
var response = _DeviceRepairService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DeviceRepair>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加报修单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerepair:add")]
|
||||
[Log(Title = "报修单", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDeviceRepair([FromBody] DeviceRepairDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceRepair>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DeviceRepairService.AddDeviceRepair(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新报修单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerepair:edit")]
|
||||
[Log(Title = "报修单", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDeviceRepair([FromBody] DeviceRepairDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceRepair>().ToUpdate(HttpContext);
|
||||
var response = _DeviceRepairService.UpdateDeviceRepair(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除报修单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerepair:delete")]
|
||||
[Log(Title = "报修单", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDeviceRepair(string ids)
|
||||
{
|
||||
string[] idsArr = ids.Split(',');
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DeviceRepairService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Model.MES.dev;
|
||||
|
||||
//创建时间:2024-05-27
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 巡检计划
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/deviceManagement/DeviceRouteInspectionPlan")]
|
||||
public class DeviceRouteInspectionPlanController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 巡检计划接口
|
||||
/// </summary>
|
||||
private readonly IDeviceRouteInspectionPlanService _DeviceRouteInspectionPlanService;
|
||||
|
||||
public DeviceRouteInspectionPlanController(IDeviceRouteInspectionPlanService DeviceRouteInspectionPlanService)
|
||||
{
|
||||
_DeviceRouteInspectionPlanService = DeviceRouteInspectionPlanService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询巡检计划列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
|
||||
public IActionResult QueryDeviceRouteInspectionPlan([FromQuery] DeviceRouteInspectionPlanQueryDto parm)
|
||||
{
|
||||
var response = _DeviceRouteInspectionPlanService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询巡检计划详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerouteinspectionplan:query")]
|
||||
public IActionResult GetDeviceRouteInspectionPlan(string Id)
|
||||
{
|
||||
var response = _DeviceRouteInspectionPlanService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DeviceRouteInspectionPlan>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加巡检计划
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerouteinspectionplan:add")]
|
||||
[Log(Title = "巡检计划", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDeviceRouteInspectionPlan([FromBody] DeviceRouteInspectionPlanDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceRouteInspectionPlan>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DeviceRouteInspectionPlanService.AddDeviceRouteInspectionPlan(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新巡检计划
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerouteinspectionplan:edit")]
|
||||
[Log(Title = "巡检计划", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDeviceRouteInspectionPlan([FromBody] DeviceRouteInspectionPlanDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceRouteInspectionPlan>().ToUpdate(HttpContext);
|
||||
var response = _DeviceRouteInspectionPlanService.UpdateDeviceRouteInspectionPlan(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除巡检计划
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerouteinspectionplan:delete")]
|
||||
[Log(Title = "巡检计划", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDeviceRouteInspectionPlan(string ids)
|
||||
{
|
||||
string[] idsArr = ids.Split(',');
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DeviceRouteInspectionPlanService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,357 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.Dto;
|
||||
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using MiniExcelLibs;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Model.MES.dev;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
|
||||
//创建时间:2024-05-31
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务执行
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/deviceManagement/DeviceTaskExecute")]
|
||||
public class DeviceTaskExecuteController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务执行接口
|
||||
/// </summary>
|
||||
private readonly IDeviceTaskExecuteService _DeviceTaskExecuteService;
|
||||
|
||||
public DeviceTaskExecuteController(IDeviceTaskExecuteService DeviceTaskExecuteService)
|
||||
{
|
||||
_DeviceTaskExecuteService = DeviceTaskExecuteService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询任务执行列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("list")]
|
||||
|
||||
public IActionResult QueryDeviceTaskExecute([FromBody] DeviceTaskExecuteQueryDto parm)
|
||||
{
|
||||
var response = _DeviceTaskExecuteService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询任务执行详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecute:query")]
|
||||
public IActionResult GetDeviceTaskExecute(string Id)
|
||||
{
|
||||
var response = _DeviceTaskExecuteService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DeviceTaskExecute>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加任务执行
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecute:add")]
|
||||
[Log(Title = "任务执行", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDeviceTaskExecute([FromBody] DeviceTaskExecuteDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceTaskExecute>().ToCreate(HttpContext).ToUpdate(HttpContext);
|
||||
|
||||
var response = _DeviceTaskExecuteService.AddDeviceTaskExecute(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新任务执行
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecute:edit")]
|
||||
[Log(Title = "任务执行", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDeviceTaskExecute([FromBody] DeviceTaskExecuteDto parm)
|
||||
{
|
||||
|
||||
Console.WriteLine(HttpContext.User?.Identity?.Name);
|
||||
var modal = parm.Adapt<DeviceTaskExecute>().ToUpdate(HttpContext);
|
||||
var response = _DeviceTaskExecuteService.UpdateDeviceTaskExecute(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更改任务状态
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("update_task_status")]
|
||||
public IActionResult Update_task_status([FromQuery]DeviceTaskExecuteQueryDto2 parm)
|
||||
{
|
||||
if(parm == null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
parm.ToUpdate();
|
||||
var response = _DeviceTaskExecuteService.Update_task_status(parm);
|
||||
|
||||
return ToResponse(response);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除任务执行
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecute:delete")]
|
||||
[Log(Title = "任务执行", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDeviceTaskExecute(string ids)
|
||||
{
|
||||
|
||||
if(string.IsNullOrEmpty(ids))
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
string[] idsArr = ids.Split(",");
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DeviceTaskExecuteService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出任务执行
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "任务执行", BusinessType = BusinessType.EXPORT, IsSaveResponseData = false)]
|
||||
[HttpGet("export")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecute:export")]
|
||||
public IActionResult Export([FromQuery] DeviceTaskExecuteQueryDto parm)
|
||||
{
|
||||
parm.PageNum = 1;
|
||||
parm.PageSize = 100000;
|
||||
var list = _DeviceTaskExecuteService.GetList(parm).Result;
|
||||
if (list == null || list.Count <= 0)
|
||||
{
|
||||
return ToResponse(ResultCode.FAIL, "没有要导出的数据");
|
||||
}
|
||||
var result = ExportExcelMini(list, "任务执行", "任务执行");
|
||||
return ExportExcel(result.Item2, result.Item1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清空任务执行
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "任务执行", BusinessType = BusinessType.CLEAN)]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecute:delete")]
|
||||
[HttpDelete("clean")]
|
||||
public IActionResult Clear()
|
||||
{
|
||||
if (!HttpContextExtension.IsAdmin(HttpContext))
|
||||
{
|
||||
return ToResponse(ResultCode.FAIL, "操作失败");
|
||||
}
|
||||
return SUCCESS(_DeviceTaskExecuteService.TruncateDeviceTaskExecute());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导入
|
||||
/// </summary>
|
||||
/// <param name="formFile"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("importData")]
|
||||
[Log(Title = "任务执行导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false)]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecute:import")]
|
||||
public IActionResult ImportData([FromForm(Name = "file")] IFormFile formFile)
|
||||
{
|
||||
List<DeviceTaskExecuteDto> list = new();
|
||||
using (var stream = formFile.OpenReadStream())
|
||||
{
|
||||
list = stream.Query<DeviceTaskExecuteDto>(startCell: "A1").ToList();
|
||||
}
|
||||
|
||||
return SUCCESS(_DeviceTaskExecuteService.ImportDeviceTaskExecute(list.Adapt<List<DeviceTaskExecute>>()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 任务执行导入模板下载
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("importTemplate")]
|
||||
[Log(Title = "任务执行模板", BusinessType = BusinessType.EXPORT, IsSaveResponseData = false)]
|
||||
[AllowAnonymous]
|
||||
public IActionResult ImportTemplateExcel()
|
||||
{
|
||||
var result = DownloadImportTemplate(new List<DeviceTaskExecuteDto>() { }, "DeviceTaskExecute");
|
||||
return ExportExcel(result.Item2, result.Item1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 立刻派发任务
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
[HttpGet("dispatch/{id}")]
|
||||
[Log(Title = "任务立刻执行")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult ExecutionTask_point(string id)
|
||||
{
|
||||
if(string.IsNullOrEmpty(id))
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
var response = _DeviceTaskExecuteService.ExecutionTask_point(id);
|
||||
|
||||
return SUCCESS(response);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取任务执行绑定的巡检任务和点检任务绑定的设备
|
||||
/// </summary>
|
||||
/// <param name="id">device_task_execute表的主键</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("get_bind_device/{id}")]
|
||||
public IActionResult AchieveTaskbindDevice(string id)
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
var response = _DeviceTaskExecuteService.AchieveTaskbindDevice(id);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备绑定的检查项
|
||||
/// </summary>
|
||||
/// <param name="fk_device_id">device_rel_account_inspect表的fk_account_id 属性</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("get_bind_inspect")]
|
||||
public IActionResult AchieveDevicebindInspect(int? fk_account_id,string fkPlanId,int planType)
|
||||
{
|
||||
if (fk_account_id == null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
var response = _DeviceTaskExecuteService.AchieveDevicebindInspect(fk_account_id ?? 0, fkPlanId, planType);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取检查项绑定的检查表单
|
||||
/// </summary>
|
||||
/// <param name="fk_device_inspect_id">device_form_config表的fk_device_inspect_id字段</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("bind_form/{fk_device_inspect_id}")]
|
||||
public IActionResult AchieveInspectbindForm(int? fk_device_inspect_id)
|
||||
{
|
||||
if (fk_device_inspect_id==null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
|
||||
var response = _DeviceTaskExecuteService.AchieveInspectbindForm(fk_device_inspect_id??0);
|
||||
|
||||
return SUCCESS(response);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取表单结果
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("get_form_result")]
|
||||
public IActionResult AchieveFormResult([FromBody] DeviceTaskExecuteResult1QueryDto_TaskExecute query)
|
||||
{
|
||||
if(query==null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
if(query.PlanType!=1&&query.PlanType!=2)
|
||||
{
|
||||
|
||||
return ToResponse(ResultCode.CUSTOM_ERROR, "数据不合法:只能是1或者2");
|
||||
}
|
||||
|
||||
var response = _DeviceTaskExecuteService.AchieveFormResult2(query);
|
||||
|
||||
return SUCCESS(response);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改表单结果
|
||||
/// </summary>
|
||||
/// <param name="result"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("update_form_result")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult UpdateFormResult([FromBody] DeviceTaskExecuteResultDto result)
|
||||
{
|
||||
if(result==null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
result.ToUpdate_nickName(HttpContext);
|
||||
int res=_DeviceTaskExecuteService.UpdateFormResult(result);
|
||||
return SUCCESS(res);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 增加任务开始时间
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("add_task_start")]
|
||||
public IActionResult AddTaskStartTime(string Id)
|
||||
{
|
||||
if(string.IsNullOrEmpty(Id))
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
|
||||
int res = _DeviceTaskExecuteService.AddDeviceTaskExecute(Id,HttpContext.GetNickName());
|
||||
return SUCCESS(res);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加任务结束时间
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("add_task_finally")]
|
||||
public IActionResult AddTaskFinallyTime(string Id)
|
||||
{
|
||||
if (string.IsNullOrEmpty(Id))
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
|
||||
int res = _DeviceTaskExecuteService.AddTaskFinallyTime(Id);
|
||||
return SUCCESS(res);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Model.MES.dev;
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Service.MES.dev;
|
||||
|
||||
//创建时间:2024-06-11
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 巡检/点检任务结果表
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/deviceManagement/DeviceTaskExecuteResult")]
|
||||
public class DeviceTaskExecuteResultController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 巡检/点检任务结果表接口
|
||||
/// </summary>
|
||||
private readonly IDeviceTaskExecuteResultService _DeviceTaskExecuteResultService;
|
||||
|
||||
public DeviceTaskExecuteResultController(IDeviceTaskExecuteResultService DeviceTaskExecuteResult1Service)
|
||||
{
|
||||
_DeviceTaskExecuteResultService = DeviceTaskExecuteResult1Service;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询巡检/点检任务结果表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
public IActionResult QueryDeviceTaskExecuteResult1([FromQuery] DeviceTaskExecuteResultQueryDto parm)
|
||||
{
|
||||
var response = _DeviceTaskExecuteResultService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询巡检/点检任务结果表详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
// [ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecuteresult1:query")]
|
||||
public IActionResult GetDeviceTaskExecuteResult1(string Id)
|
||||
{
|
||||
var response = _DeviceTaskExecuteResultService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DeviceTaskExecuteResult>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加巡检/点检任务结果表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
// [ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecuteresult1:add")]
|
||||
[Log(Title = "巡检/点检任务结果表", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDeviceTaskExecuteResult1([FromBody] DeviceTaskExecuteResultDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceTaskExecuteResult>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DeviceTaskExecuteResultService.AddDeviceTaskExecuteResult(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新巡检/点检任务结果表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
// [ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecuteresult1:edit")]
|
||||
[Log(Title = "巡检/点检任务结果表", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDeviceTaskExecuteResult1([FromBody] DeviceTaskExecuteResultDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceTaskExecuteResult>().ToUpdate(HttpContext);
|
||||
var response = _DeviceTaskExecuteResultService.UpdateDeviceTaskExecuteResult(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除巡检/点检任务结果表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
// [ActionPermissionFilter(Permission = "deviceManagement:devicetaskexecuteresult1:delete")]
|
||||
[Log(Title = "巡检/点检任务结果表", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDeviceTaskExecuteResult1(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DeviceTaskExecuteResultService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
107
DOAN.Admin.WebApi/Controllers/MES/Device/DeviceTypeController.cs
Normal file
107
DOAN.Admin.WebApi/Controllers/MES/Device/DeviceTypeController.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
using DOAN.Model.MES.dev;
|
||||
using DOAN.Service.MES.dev.IService;
|
||||
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 1.设备类型
|
||||
/// </summary>
|
||||
|
||||
[Route("mes/deviceManagement/DeviceType")]
|
||||
public class DeviceTypeController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 1.设备类型接口
|
||||
/// </summary>
|
||||
private readonly IDeviceTypeService _DeviceTypeService;
|
||||
|
||||
public DeviceTypeController(IDeviceTypeService DeviceTypeService)
|
||||
{
|
||||
_DeviceTypeService = DeviceTypeService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询1.设备类型列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
|
||||
public IActionResult QueryDeviceType([FromQuery] DeviceTypeQueryDto parm)
|
||||
{
|
||||
var response = _DeviceTypeService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询1.设备类型详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "business:devicetype:query")]
|
||||
public IActionResult GetDeviceType(int Id)
|
||||
{
|
||||
var response = _DeviceTypeService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DeviceType>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加1.设备类型
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("insert")]
|
||||
|
||||
[Log(Title = "1.设备类型", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDeviceType([FromBody] DeviceTypeDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceType>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DeviceTypeService.AddDeviceType(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新1.设备类型
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("update")]
|
||||
[Log(Title = "1.设备类型", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDeviceType([FromBody] DeviceTypeDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceType>().ToUpdate(HttpContext);
|
||||
var response = _DeviceTypeService.UpdateDeviceType(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除1.设备类型
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("delete/{id}")]
|
||||
|
||||
[Log(Title = "1.设备类型", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDeviceType(long id)
|
||||
{
|
||||
|
||||
if (id <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DeviceTypeService.Delete(id);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user