提交
This commit is contained in:
parent
7cc39713fe
commit
b59a522e19
109
ZR.Admin.WebApi/Controllers/MES/dev/DeviceInspectController.cs
Normal file
109
ZR.Admin.WebApi/Controllers/MES/dev/DeviceInspectController.cs
Normal file
@ -0,0 +1,109 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Model.Dto;
|
||||
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Service.MES.dev.IService;
|
||||
using ZR.Model.MES.dev;
|
||||
|
||||
//创建时间:2024-05-21
|
||||
namespace ZR.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")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:deviceinspect:list")]
|
||||
public IActionResult QueryDeviceInspect([FromQuery] DeviceInspectQueryDto parm)
|
||||
{
|
||||
var response = _DeviceInspectService.GetList(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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -8,7 +8,7 @@
|
||||
},
|
||||
"dbConfigs": [
|
||||
{
|
||||
"Conn": "Data Source=192.168.0.36;User ID=root;Password=doantech123;Initial Catalog=GXAssembly;Port=3306",
|
||||
"Conn": "Data Source=192.168.0.10;User ID=root;Password=doantech123;Initial Catalog=GXAssembly;Port=3306",
|
||||
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4
|
||||
"ConfigId": "0", //多租户唯一标识
|
||||
"IsAutoCloseConnection": true
|
||||
@ -18,7 +18,7 @@
|
||||
//代码生成数据库配置
|
||||
"CodeGenDbConfig": {
|
||||
//代码生成连接字符串,注意{dbName}为固定格式,不要填写数据库名
|
||||
"Conn": "Data Source=192.168.0.36;User ID=root;Password=doantech123;Initial Catalog={dbName};",
|
||||
"Conn": "Data Source=192.168.0.10;User ID=root;Password=doantech123;Initial Catalog={dbName};",
|
||||
"DbType": 0,
|
||||
"IsAutoCloseConnection": true,
|
||||
"DbName": "GXAssembly" //代码生成默认连接数据库,Oracle库是实例的名称
|
||||
|
||||
78
ZR.Model/MES/dev/DeviceInspect.cs
Normal file
78
ZR.Model/MES/dev/DeviceInspect.cs
Normal file
@ -0,0 +1,78 @@
|
||||
|
||||
namespace ZR.Model.MES.dev
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检查项
|
||||
/// </summary>
|
||||
[SugarTable("device_inspect")]
|
||||
public class DeviceInspect
|
||||
{
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 图片
|
||||
/// </summary>
|
||||
public string Image { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查顺序
|
||||
/// </summary>
|
||||
public int? Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查项类型(重点)
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查项状态
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string Descride { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查项名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
57
ZR.Model/MES/dev/DeviceRelAccountInspect.cs
Normal file
57
ZR.Model/MES/dev/DeviceRelAccountInspect.cs
Normal file
@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZR.Model.MES.dev
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检查项与设备台账关联表
|
||||
/// </summary>
|
||||
[SugarTable("device_rel_account_inspect")]
|
||||
public class DeviceRelAccountInspect
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检项id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_inspect_id")]
|
||||
public int FkInspectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备台账id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "fk_account_id")]
|
||||
public int FkAccountId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int? Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
47
ZR.Model/MES/dev/Dto/DeviceInspectDto.cs
Normal file
47
ZR.Model/MES/dev/Dto/DeviceInspectDto.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.MES.dev
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检查项查询对象
|
||||
/// </summary>
|
||||
public class DeviceInspectQueryDto : PagerInfo
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备检查项输入输出对象
|
||||
/// </summary>
|
||||
public class DeviceInspectDto
|
||||
{
|
||||
[Required(ErrorMessage = "id不能为空")]
|
||||
public int Id { get; set; }
|
||||
|
||||
|
||||
|
||||
public string Image { get; set; }
|
||||
|
||||
public int? Sort { get; set; }
|
||||
|
||||
public string Type { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
public string Status { get; set; }
|
||||
|
||||
public string Descride { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,7 @@ using System.Linq;
|
||||
using ZR.Model.MES.dev;
|
||||
using ZR.Model.MES.dev.Dto;
|
||||
|
||||
namespace ZR.Service.Business
|
||||
namespace ZR.Service.MES.dev
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备台账Service业务层处理
|
||||
|
||||
88
ZR.Service/MES/dev/DeviceInspectService.cs
Normal file
88
ZR.Service/MES/dev/DeviceInspectService.cs
Normal file
@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using ZR.Model;
|
||||
|
||||
|
||||
using ZR.Repository;
|
||||
using ZR.Service.Business.IBusinessService;
|
||||
using System.Linq;
|
||||
using ZR.Service.MES.dev.IService;
|
||||
using ZR.Model.MES.dev;
|
||||
|
||||
namespace ZR.Service.MES.dev
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检查项Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IDeviceInspectService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class DeviceInspectService : BaseService<DeviceInspect>, IDeviceInspectService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询设备检查项列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<DeviceInspectDto> GetList(DeviceInspectQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<DeviceInspect>();
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<DeviceInspect, DeviceInspectDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public DeviceInspect GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加设备检查项
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public DeviceInspect AddDeviceInspect(DeviceInspect model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改设备检查项
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateDeviceInspect(DeviceInspect model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new DeviceInspect()
|
||||
//{
|
||||
// Image = model.Image,
|
||||
// Sort = model.Sort,
|
||||
// Type = model.Type,
|
||||
// Remark = model.Remark,
|
||||
// Status = model.Status,
|
||||
// Name = model.Name,
|
||||
// CreatedBy = model.CreatedBy,
|
||||
// CreatedTime = model.CreatedTime,
|
||||
// UpdatedBy = model.UpdatedBy,
|
||||
// UpdatedTime = model.UpdatedTime,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,7 @@ namespace ZR.Service.MES.dev
|
||||
[AppService(ServiceType = typeof(IDeviceTypeService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class DeviceTypeService : BaseService<DeviceType>, IDeviceTypeService
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询1.设备类型列表
|
||||
/// </summary>
|
||||
@ -40,11 +40,8 @@ namespace ZR.Service.MES.dev
|
||||
return response.Adapt<List<DeviceTypeDto>>();
|
||||
}
|
||||
|
||||
public int UpdateDeviceType(DeviceType parm)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
@ -95,4 +92,5 @@ namespace ZR.Service.MES.dev
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
24
ZR.Service/MES/dev/IService/IDeviceInspectService.cs
Normal file
24
ZR.Service/MES/dev/IService/IDeviceInspectService.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using ZR.Model;
|
||||
|
||||
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.MES.dev;
|
||||
|
||||
namespace ZR.Service.MES.dev.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备检查项service接口
|
||||
/// </summary>
|
||||
public interface IDeviceInspectService : IBaseService<DeviceInspect>
|
||||
{
|
||||
PagedInfo<DeviceInspectDto> GetList(DeviceInspectQueryDto parm);
|
||||
|
||||
DeviceInspect GetInfo(int Id);
|
||||
|
||||
DeviceInspect AddDeviceInspect(DeviceInspect parm);
|
||||
|
||||
int UpdateDeviceInspect(DeviceInspect parm);
|
||||
|
||||
}
|
||||
}
|
||||
@ -15,10 +15,6 @@ namespace ZR.Service.MES.dev.IService
|
||||
{
|
||||
List<DeviceTypeDto> GetList(DeviceTypeQueryDto parm);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DeviceType GetInfo(int Id);
|
||||
|
||||
DeviceType AddDeviceType(DeviceType parm);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user