涂装数据采集
This commit is contained in:
parent
2f368ff35c
commit
7f780dd36e
109
ZR.Admin.WebApi/Controllers/mes/dc/FnproductionController.cs
Normal file
109
ZR.Admin.WebApi/Controllers/mes/dc/FnproductionController.cs
Normal file
@ -0,0 +1,109 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.dc;
|
||||
using ZR.Model.MES.dc.Dto;
|
||||
using ZR.Service.Business.IBusinessService;
|
||||
|
||||
//创建时间:2025-05-23
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器人涂装数据采集表
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("business/Fnproduction")]
|
||||
public class FnproductionController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器人涂装数据采集表接口
|
||||
/// </summary>
|
||||
private readonly IFnproductionService _FnproductionService;
|
||||
|
||||
public FnproductionController(IFnproductionService FnproductionService)
|
||||
{
|
||||
_FnproductionService = FnproductionService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询机器人涂装数据采集表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "business:fnproduction:list")]
|
||||
public IActionResult QueryFnproduction([FromQuery] FnproductionQueryDto parm)
|
||||
{
|
||||
var response = _FnproductionService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询机器人涂装数据采集表详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "business:fnproduction:query")]
|
||||
public IActionResult GetFnproduction(int Id)
|
||||
{
|
||||
var response = _FnproductionService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<Fnproduction>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加机器人涂装数据采集表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "business:fnproduction:add")]
|
||||
[Log(Title = "机器人涂装数据采集表", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddFnproduction([FromBody] FnproductionDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<Fnproduction>().ToCreate(HttpContext);
|
||||
|
||||
var response = _FnproductionService.AddFnproduction(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新机器人涂装数据采集表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "business:fnproduction:edit")]
|
||||
[Log(Title = "机器人涂装数据采集表", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateFnproduction([FromBody] FnproductionDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<Fnproduction>().ToUpdate(HttpContext);
|
||||
var response = _FnproductionService.UpdateFnproduction(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除机器人涂装数据采集表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "business:fnproduction:delete")]
|
||||
[Log(Title = "机器人涂装数据采集表", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteFnproduction(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _FnproductionService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -11,7 +11,8 @@
|
||||
{
|
||||
//"Conn": "Data Source=147.116.122.230;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
//"Conn": "Data Source=47.116.122.230;Port=3307;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
"Conn": "Data Source=192.168.60.251;Port=3306;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
//"Conn": "Data Source=192.168.60.251;Port=3306;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=shgx_injection_mes_db;Port=3308",
|
||||
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4
|
||||
"ConfigId": "0", //多租户唯一标识
|
||||
"IsAutoCloseConnection": true
|
||||
|
||||
Binary file not shown.
48
ZR.Model/MES/dc/Dto/FnproductionDto.cs
Normal file
48
ZR.Model/MES/dc/Dto/FnproductionDto.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.MES.dc.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器人涂装数据采集表查询对象
|
||||
/// </summary>
|
||||
public class FnproductionQueryDto : PagerInfo
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 机器人涂装数据采集表输入输出对象
|
||||
/// </summary>
|
||||
public class FnproductionDto
|
||||
{
|
||||
public string DateTimeSt { get; set; }
|
||||
|
||||
public string DateTimeEnd { get; set; }
|
||||
|
||||
public string PlcStyle { get; set; }
|
||||
|
||||
public string PlcColor { get; set; }
|
||||
|
||||
public string PlcVar { get; set; }
|
||||
|
||||
public int? PlcStartphoncount { get; set; }
|
||||
|
||||
public int? PlcStartlsshiftcount { get; set; }
|
||||
|
||||
public string RobotNo { get; set; }
|
||||
|
||||
public string RobotProNo { get; set; }
|
||||
|
||||
public string RobotCcv { get; set; }
|
||||
|
||||
public string RobotVar { get; set; }
|
||||
|
||||
public int? RobotFlux { get; set; }
|
||||
|
||||
public string RobotBrushNo { get; set; }
|
||||
|
||||
public string EndStatus { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
95
ZR.Model/MES/dc/Fnproduction.cs
Normal file
95
ZR.Model/MES/dc/Fnproduction.cs
Normal file
@ -0,0 +1,95 @@
|
||||
|
||||
namespace ZR.Model.dc
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器人涂装数据采集表
|
||||
/// </summary>
|
||||
[SugarTable("fnproduction")]
|
||||
public class Fnproduction
|
||||
{
|
||||
/// <summary>
|
||||
/// DateTimeSt
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "date_time_st")]
|
||||
public string DateTimeSt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DateTimeEnd
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "date_time_end")]
|
||||
public string DateTimeEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PlcStyle
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "plc_style")]
|
||||
public string PlcStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PlcColor
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "plc_color")]
|
||||
public string PlcColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PlcVar
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "plc_var")]
|
||||
public string PlcVar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PlcStartphoncount
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "plc_startPHoncount")]
|
||||
public int? PlcStartphoncount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PlcStartlsshiftcount
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "plc_startLSshiftcount")]
|
||||
public int? PlcStartlsshiftcount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RobotNo
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "robot_no")]
|
||||
public string RobotNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RobotProNo
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "robot_pro_no")]
|
||||
public string RobotProNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RobotCcv
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "robot_ccv")]
|
||||
public string RobotCcv { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RobotVar
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "robot_var")]
|
||||
public string RobotVar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RobotFlux
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "robot_flux")]
|
||||
public int? RobotFlux { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RobotBrushNo
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "robot_brush_no")]
|
||||
public string RobotBrushNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// EndStatus
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "end_status")]
|
||||
public string EndStatus { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
92
ZR.Service/mes/dc/FnproductionService.cs
Normal file
92
ZR.Service/mes/dc/FnproductionService.cs
Normal file
@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.Business;
|
||||
using ZR.Repository;
|
||||
using ZR.Service.Business.IBusinessService;
|
||||
using System.Linq;
|
||||
using ZR.Model.dc;
|
||||
using ZR.Model.MES.dc.Dto;
|
||||
|
||||
namespace ZR.Service.Business
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器人涂装数据采集表Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IFnproductionService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class FnproductionService : BaseService<Fnproduction>, IFnproductionService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询机器人涂装数据采集表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<FnproductionDto> GetList(FnproductionQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<Fnproduction>();
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<Fnproduction, FnproductionDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public Fnproduction GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
//.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加机器人涂装数据采集表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public Fnproduction AddFnproduction(Fnproduction model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改机器人涂装数据采集表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateFnproduction(Fnproduction model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new Fnproduction()
|
||||
//{
|
||||
// DateTimeSt = model.DateTimeSt,
|
||||
// DateTimeEnd = model.DateTimeEnd,
|
||||
// PlcStyle = model.PlcStyle,
|
||||
// PlcColor = model.PlcColor,
|
||||
// PlcVar = model.PlcVar,
|
||||
// PlcStartphoncount = model.PlcStartphoncount,
|
||||
// PlcStartlsshiftcount = model.PlcStartlsshiftcount,
|
||||
// RobotNo = model.RobotNo,
|
||||
// RobotProNo = model.RobotProNo,
|
||||
// RobotCcv = model.RobotCcv,
|
||||
// RobotVar = model.RobotVar,
|
||||
// RobotFlux = model.RobotFlux,
|
||||
// RobotBrushNo = model.RobotBrushNo,
|
||||
// EndStatus = model.EndStatus,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
25
ZR.Service/mes/dc/IService/IFnproductionService.cs
Normal file
25
ZR.Service/mes/dc/IService/IFnproductionService.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.Business;
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.MES.dc.Dto;
|
||||
using ZR.Model.dc;
|
||||
|
||||
namespace ZR.Service.Business.IBusinessService
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器人涂装数据采集表service接口
|
||||
/// </summary>
|
||||
public interface IFnproductionService : IBaseService<Fnproduction>
|
||||
{
|
||||
PagedInfo<FnproductionDto> GetList(FnproductionQueryDto parm);
|
||||
|
||||
Fnproduction GetInfo(int Id);
|
||||
|
||||
Fnproduction AddFnproduction(Fnproduction parm);
|
||||
|
||||
int UpdateFnproduction(Fnproduction parm);
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text.RegularExpressions;
|
||||
using Infrastructure.Attribute;
|
||||
using SqlSugar;
|
||||
@ -158,6 +159,10 @@ namespace ZR.Service.mes.wms
|
||||
CreatedTime = DateTime.Now,
|
||||
};
|
||||
int recordNum = Context.Insertable(record).ExecuteCommand();
|
||||
|
||||
Context.Ado.UseTran(() =>{
|
||||
Context.Insertable(record).ExecuteCommand();
|
||||
});
|
||||
if (recordNum == 0)
|
||||
{
|
||||
Context.Ado.RollbackTran();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user