This commit is contained in:
qianhao.xu 2024-05-20 18:04:42 +08:00
parent 00327cb4ea
commit 9debe3642f
6 changed files with 221 additions and 4 deletions

View File

@ -0,0 +1,107 @@
using Microsoft.AspNetCore.Mvc;
using ZR.Admin.WebApi.Filters;
using ZR.Model.MES.dv.Dto;
using ZR.Model.MES.dv;
////创建时间2024-05-20
//namespace ZR.Admin.WebApi.Controllers
//{
// /// <summary>
// /// 1.设备类型
// /// </summary>
// [Route("business/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")]
// [ActionPermissionFilter(Permission = "business:devicetype: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]
// [ActionPermissionFilter(Permission = "business:devicetype:add")]
// [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>
// [HttpPut]
// [ActionPermissionFilter(Permission = "business:devicetype:edit")]
// [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>
// [HttpDelete("{ids}")]
// [ActionPermissionFilter(Permission = "business:devicetype:delete")]
// [Log(Title = "1.设备类型", BusinessType = BusinessType.DELETE)]
// public IActionResult DeleteDeviceType(string ids)
// {
// int[] idsArr = Tools.SpitIntArrary(ids);
// if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
// var response = _DeviceTypeService.Delete(idsArr);
// return ToResponse(response);
// }
// }
//}

View File

@ -30,9 +30,6 @@
</ItemGroup>
<ItemGroup>
<None Update="Controllers\MES\dev\1.txt">
<Generator>TextTemplatingFileGenerator</Generator>
</None>
<None Update="ip2region.db">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>

View File

@ -35,7 +35,7 @@
},
"InjectClass": [ "ZR.Repository", "ZR.Service", "ZR.Tasks", "ZR.ServiceCore" ], //
"ShowDbLog": true, //db
"InitDb": true, //db
"InitDb": false, //db
"DemoMode": false, //
"SingleLogin": false, //
"Upload": {

View File

@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZR.Model.MES.dv
{
/// <summary>
/// 1.设备类型
/// </summary>
[SugarTable("device_type")]
public class DeviceType
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>
/// 父id
/// </summary>
[SugarColumn(ColumnName = "parent_id")]
public int ParentId { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public int? Status { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { 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; }
}
}

View File

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZR.Model.MES.dv.Dto
{
/// <summary>
/// 1.设备类型查询对象
/// </summary>
public class DeviceTypeQueryDto : PagerInfo
{
}
/// <summary>
/// 1.设备类型输入输出对象
/// </summary>
public class DeviceTypeDto
{
[Required(ErrorMessage = "id不能为空")]
public int Id { get; set; }
[Required(ErrorMessage = "父id不能为空")]
public int ParentId { get; set; }
public string Name { get; set; }
public int? Status { get; set; }
public string Remark { get; set; }
public string CreatedBy { get; set; }
public DateTime? CreatedTime { get; set; }
public string UpdatedBy { get; set; }
public DateTime? UpdatedTime { get; set; }
}
}