安灯区域工作安排
This commit is contained in:
parent
e09908954e
commit
4e8dcb6677
103
ZR.Admin.WebApi/Controllers/mes/andon/AndonWorkTimeController.cs
Normal file
103
ZR.Admin.WebApi/Controllers/mes/andon/AndonWorkTimeController.cs
Normal file
@ -0,0 +1,103 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.MES.andon;
|
||||
using ZR.Model.MES.andon.Dto;
|
||||
using ZR.Service.mes.andon.Iservice;
|
||||
|
||||
//创建时间:2025-12-10
|
||||
namespace ZR.Admin.WebApi.Controllers.andon
|
||||
{
|
||||
/// <summary>
|
||||
/// 安灯区域工作时间表
|
||||
/// </summary>
|
||||
[Route("mes/AndonWorkTime")]
|
||||
[AllowAnonymous]
|
||||
public class AndonWorkTimeController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 安灯区域工作时间表接口
|
||||
/// </summary>
|
||||
private readonly IAndonWorkTimeService _AndonWorkTimeService;
|
||||
|
||||
public AndonWorkTimeController(IAndonWorkTimeService AndonWorkTimeService)
|
||||
{
|
||||
_AndonWorkTimeService = AndonWorkTimeService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询安灯区域工作时间表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "andonworktime:list")]
|
||||
public IActionResult QueryAndonWorkTime([FromQuery] AndonWorkTimeQueryDto parm)
|
||||
{
|
||||
var response = _AndonWorkTimeService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询安灯区域工作时间表详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "andonworktime:query")]
|
||||
public IActionResult GetAndonWorkTime(int Id)
|
||||
{
|
||||
var response = _AndonWorkTimeService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<AndonWorkTimeDto>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安灯区域工作时间表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "andonworktime:add")]
|
||||
[Log(Title = "安灯区域工作时间表", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddAndonWorkTime([FromBody] AndonWorkTimeDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<AndonWorkTime>().ToCreate(HttpContext);
|
||||
|
||||
var response = _AndonWorkTimeService.AddAndonWorkTime(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新安灯区域工作时间表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "andonworktime:edit")]
|
||||
[Log(Title = "安灯区域工作时间表", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateAndonWorkTime([FromBody] AndonWorkTimeDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<AndonWorkTime>().ToUpdate(HttpContext);
|
||||
var response = _AndonWorkTimeService.UpdateAndonWorkTime(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除安灯区域工作时间表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("delete/{ids}")]
|
||||
[ActionPermissionFilter(Permission = "andonworktime:delete")]
|
||||
[Log(Title = "安灯区域工作时间表", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteAndonWorkTime([FromRoute]string ids)
|
||||
{
|
||||
var idArr = Tools.SplitAndConvert<int>(ids);
|
||||
|
||||
return ToResponse(_AndonWorkTimeService.Delete(idArr));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key id="4c5a762f-ed89-4b83-9e83-1c6332c4533c" version="1">
|
||||
<creationDate>2026-03-02T01:41:42.9641519Z</creationDate>
|
||||
<activationDate>2026-03-02T01:41:42.5206762Z</activationDate>
|
||||
<expirationDate>2026-05-31T01:41:42.5206762Z</expirationDate>
|
||||
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||
<descriptor>
|
||||
<encryption algorithm="AES_256_CBC" />
|
||||
<validation algorithm="HMACSHA256" />
|
||||
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||
<!-- Warning: the key below is in an unencrypted form. -->
|
||||
<value>xfS+ygjRceZfpuNFbvY8bQrghrWegseQPBcKncW1jPTWeDqcSTdGFQDrwgGsUpK3jcoNVz8mQPy2/IQyhMH8QQ==</value>
|
||||
</masterKey>
|
||||
</descriptor>
|
||||
</descriptor>
|
||||
</key>
|
||||
@ -21,8 +21,8 @@ using ZR.Service.Utils.MyAlarmLigth;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
//后台定时任务
|
||||
//builder.Services.AddHostedService<ScheduledBackgroundService>();
|
||||
//builder.Services.AddHostedService<SocketBackgroundService>();
|
||||
builder.Services.AddHostedService<ScheduledBackgroundService>();
|
||||
builder.Services.AddHostedService<SocketBackgroundService>();
|
||||
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
@ -15,7 +15,8 @@
|
||||
|
||||
//外网连接服务器
|
||||
// "Conn": "Data Source=47.116.122.230;Port=3307;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=ZrAdmin;Port=3308;AllowLoadLocalInfile=true",
|
||||
//"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=ZrAdmin;Port=3308;AllowLoadLocalInfile=true",
|
||||
"Conn": "Data Source=47.101.40.214;User ID=root;Password=Rizo123456@;Initial Catalog=ZrAdmin;Port=3306;",
|
||||
//"Conn": "Data Source=192.168.1.48;User ID=root;Password=123456;Initial Catalog=ZrAdmin;Port=3306;AllowLoadLocalInfile=true",
|
||||
//"Conn": "Data Source=127.0.0.1;User ID=root;Password=123456;Initial Catalog=ZrAdmin;Port=3306;AllowLoadLocalInfile=true",
|
||||
// 干巷服务器
|
||||
@ -33,7 +34,8 @@
|
||||
"CodeGenDbConfig": {
|
||||
//代码生成连接字符串,注意{dbName}为固定格式,不要填写数据库名
|
||||
//"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog={dbName};Port=3308",
|
||||
"Conn": "Data Source=192.168.1.48;User ID=root;Password=123456;Initial Catalog={dbName};Port=3306",
|
||||
//"Conn": "Data Source=192.168.1.48;User ID=root;Password=123456;Initial Catalog={dbName};Port=3306",
|
||||
"Conn": "Data Source=47.101.40.214;User ID=root;Password=Rizo123456@;Initial Catalog={dbName};Port=3306",
|
||||
"DbType": 0,
|
||||
"IsAutoCloseConnection": true,
|
||||
"DbName": "ZrAdmin" //代码生成默认连接数据库
|
||||
|
||||
@ -116,6 +116,12 @@ namespace ZR.Model.MES.andon
|
||||
[SugarColumn(ColumnName = "remarks")]
|
||||
public string Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 故障开始时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "faulttime")]
|
||||
public DateTime? FaultTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
|
||||
66
ZR.Model/MES/andon/AndonWorkTime.cs
Normal file
66
ZR.Model/MES/andon/AndonWorkTime.cs
Normal file
@ -0,0 +1,66 @@
|
||||
|
||||
namespace ZR.Model.MES.andon
|
||||
{
|
||||
/// <summary>
|
||||
/// 安灯区域工作时间表
|
||||
/// </summary>
|
||||
[SugarTable("andon_work_time")]
|
||||
public class AndonWorkTime
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父区域
|
||||
/// </summary>
|
||||
public string Area1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子区域
|
||||
/// </summary>
|
||||
public string Area2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 起始时间
|
||||
/// </summary>
|
||||
public DateTime? Starttime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 停止时间
|
||||
/// </summary>
|
||||
public DateTime? Endtime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工作时长(分钟)
|
||||
/// </summary>
|
||||
public int? Workminute { 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,6 +57,8 @@ namespace ZR.Model.MES.andon.Dto
|
||||
public string Receiver4 { get; set; }
|
||||
[ExcelColumn(Name = "四级接收人")]
|
||||
public string Receiver4Name { get; set; }
|
||||
[ExcelColumn(Name = "故障开始时间")]
|
||||
public DateTime? FaultTime { get; set; }
|
||||
[ExcelColumn(Ignore = true)]
|
||||
public int? Sequence { get; set; }
|
||||
[ExcelColumn(Name = "停机持续时间")]
|
||||
|
||||
42
ZR.Model/MES/andon/Dto/AndonWorkTimeDto.cs
Normal file
42
ZR.Model/MES/andon/Dto/AndonWorkTimeDto.cs
Normal file
@ -0,0 +1,42 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.MES.andon.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 安灯区域工作时间表查询对象
|
||||
/// </summary>
|
||||
public class AndonWorkTimeQueryDto : PagerInfo
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安灯区域工作时间表输入输出对象
|
||||
/// </summary>
|
||||
public class AndonWorkTimeDto
|
||||
{
|
||||
[Required(ErrorMessage = "主键不能为空")]
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Area1 { get; set; }
|
||||
|
||||
public string Area2 { get; set; }
|
||||
|
||||
public DateTime Starttime { get; set; }
|
||||
|
||||
public DateTime Endtime { get; set; }
|
||||
|
||||
public int Workminute { get; set; }
|
||||
|
||||
public string? CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string? UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -26,7 +26,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="MES\andon\Dto\" />
|
||||
<Folder Include="MES\qc\defectReport\" />
|
||||
<Folder Include="MES\qc\qualificationRateReport\" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="mes\andon\IService\" />
|
||||
<Folder Include="mes\qc\defectReport\" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
83
ZR.Service/mes/andon/AndonWorkTimeService.cs
Normal file
83
ZR.Service/mes/andon/AndonWorkTimeService.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Model;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using ZR.Model.MES.andon;
|
||||
using ZR.Model.MES.andon.Dto;
|
||||
using ZR.Repository;
|
||||
using ZR.Service.mes.andon.Iservice;
|
||||
|
||||
|
||||
namespace ZR.Service.mes.andon
|
||||
{
|
||||
/// <summary>
|
||||
/// 安灯区域工作时间表Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IAndonWorkTimeService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class AndonWorkTimeService : BaseService<AndonWorkTime>, IAndonWorkTimeService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询安灯区域工作时间表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<AndonWorkTimeDto> GetList(AndonWorkTimeQueryDto parm)
|
||||
{
|
||||
var predicate = QueryExp(parm);
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<AndonWorkTime, AndonWorkTimeDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public AndonWorkTime GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安灯区域工作时间表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public AndonWorkTime AddAndonWorkTime(AndonWorkTime model)
|
||||
{
|
||||
return Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安灯区域工作时间表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateAndonWorkTime(AndonWorkTime model)
|
||||
{
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询导出表达式
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
private static Expressionable<AndonWorkTime> QueryExp(AndonWorkTimeQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<AndonWorkTime>();
|
||||
|
||||
return predicate;
|
||||
}
|
||||
}
|
||||
}
|
||||
25
ZR.Service/mes/andon/IService/IAndonWorkTimeService.cs
Normal file
25
ZR.Service/mes/andon/IService/IAndonWorkTimeService.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.MES.andon;
|
||||
using ZR.Model.MES.andon.Dto;
|
||||
using Infrastructure.Model;
|
||||
|
||||
namespace ZR.Service.mes.andon.Iservice
|
||||
{
|
||||
/// <summary>
|
||||
/// 安灯区域工作时间表service接口
|
||||
/// </summary>
|
||||
public interface IAndonWorkTimeService : IBaseService<AndonWorkTime>
|
||||
{
|
||||
PagedInfo<AndonWorkTimeDto> GetList(AndonWorkTimeQueryDto parm);
|
||||
|
||||
AndonWorkTime GetInfo(int Id);
|
||||
|
||||
|
||||
AndonWorkTime AddAndonWorkTime(AndonWorkTime parm);
|
||||
int UpdateAndonWorkTime(AndonWorkTime parm);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user