日计划达成率
This commit is contained in:
parent
c0fd2b43a3
commit
ac59c97c74
@ -0,0 +1,110 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Service.MES.product.IService;
|
||||
using DOAN.Service.MES.product;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.product.Dto;
|
||||
using DOAN.Model.MES.product;
|
||||
|
||||
//创建时间:2025-10-16
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 日计划达成率
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/productManagement/ProPlanAchievementrate")]
|
||||
public class ProPlanAchievementrateController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 日计划达成率接口
|
||||
/// </summary>
|
||||
private readonly IProPlanAchievementrateService _ProPlanAchievementrateService;
|
||||
|
||||
public ProPlanAchievementrateController(IProPlanAchievementrateService ProPlanAchievementrateService)
|
||||
{
|
||||
_ProPlanAchievementrateService = ProPlanAchievementrateService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询日计划达成率列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "productManagement:proplanachievementrate:list")]
|
||||
public IActionResult QueryProPlanAchievementrate([FromQuery] ProPlanAchievementrateQueryDto parm)
|
||||
{
|
||||
var response = _ProPlanAchievementrateService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询日计划达成率详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "productManagement:proplanachievementrate:query")]
|
||||
public IActionResult GetProPlanAchievementrate(int Id)
|
||||
{
|
||||
var response = _ProPlanAchievementrateService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<ProPlanAchievementrate>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加日计划达成率
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "productManagement:proplanachievementrate:add")]
|
||||
[Log(Title = "日计划达成率", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddProPlanAchievementrate([FromBody] ProPlanAchievementrateDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<ProPlanAchievementrate>().ToCreate(HttpContext);
|
||||
|
||||
var response = _ProPlanAchievementrateService.AddProPlanAchievementrate(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新日计划达成率
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "productManagement:proplanachievementrate:edit")]
|
||||
[Log(Title = "日计划达成率", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateProPlanAchievementrate([FromBody] ProPlanAchievementrateDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<ProPlanAchievementrate>().ToUpdate(HttpContext);
|
||||
var response = _ProPlanAchievementrateService.UpdateProPlanAchievementrate(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除日计划达成率
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "productManagement:proplanachievementrate:delete")]
|
||||
[Log(Title = "日计划达成率", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteProPlanAchievementrate(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _ProPlanAchievementrateService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
88
DOAN.Model/MES/product/Dto/ProPlanAchievementrateDto.cs
Normal file
88
DOAN.Model/MES/product/Dto/ProPlanAchievementrateDto.cs
Normal file
@ -0,0 +1,88 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DOAN.Model.MES.product.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 日计划达成率查询对象
|
||||
/// </summary>
|
||||
public class ProPlanAchievementrateQueryDto : PagerInfo
|
||||
{
|
||||
public string Project { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 日计划达成率输入输出对象
|
||||
/// </summary>
|
||||
public class ProPlanAchievementrateDto
|
||||
{
|
||||
[Required(ErrorMessage = "自增主键不能为空")]
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Project { get; set; }
|
||||
|
||||
public string AgroupMonitor { get; set; }
|
||||
|
||||
public int? AgroupProductNum { get; set; }
|
||||
|
||||
public int? AgroupStandardYield { get; set; }
|
||||
|
||||
public int? AgroupPlanNum { get; set; }
|
||||
|
||||
public decimal AgroupCompletionRate { get; set; }
|
||||
|
||||
public string BgroupMonitor { get; set; }
|
||||
|
||||
public int? BgroupProductNum { get; set; }
|
||||
|
||||
public int? BgroupStandardYield { get; set; }
|
||||
|
||||
public int? BgroupPlanNum { get; set; }
|
||||
|
||||
public decimal BgroupCompletionRate { get; set; }
|
||||
|
||||
public int? SummaryActualNum { get; set; }
|
||||
|
||||
public int? SummaryPlanNum { get; set; }
|
||||
|
||||
public decimal SummaryPlanAchievementRate { get; set; }
|
||||
|
||||
public int? DownQuality { get; set; }
|
||||
|
||||
public int? DownSuppler { get; set; }
|
||||
|
||||
public int? DownDeviceFailure { get; set; }
|
||||
|
||||
public int? DownDeviceDebug { get; set; }
|
||||
|
||||
public int? DownLogisticsWaitMaterial { get; set; }
|
||||
|
||||
public int? DownLackMaterial { get; set; }
|
||||
|
||||
public int? DownProject { get; set; }
|
||||
|
||||
public int? DownInjection { get; set; }
|
||||
|
||||
public int? DownAssembly { get; set; }
|
||||
|
||||
public int? AllLineStopTime { get; set; }
|
||||
|
||||
public string MainProblemDescription { get; set; }
|
||||
|
||||
public string Strategy { get; set; }
|
||||
|
||||
public string ResponsiblePerson { get; set; }
|
||||
|
||||
public DateTime? RecordDate { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
207
DOAN.Model/MES/product/ProPlanAchievementrate.cs
Normal file
207
DOAN.Model/MES/product/ProPlanAchievementrate.cs
Normal file
@ -0,0 +1,207 @@
|
||||
|
||||
namespace DOAN.Model.MES.product
|
||||
{
|
||||
/// <summary>
|
||||
/// 日计划达成率
|
||||
/// </summary>
|
||||
[SugarTable("pro_plan_achievementrate")]
|
||||
public class ProPlanAchievementrate
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增主键
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目号(线别)
|
||||
/// </summary>
|
||||
public string Project { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A班组长
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "agroup_monitor")]
|
||||
public string AgroupMonitor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A班生产数量
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "agroup_product_num")]
|
||||
public int? AgroupProductNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A班标准班产
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "agroup_standard_yield")]
|
||||
public int? AgroupStandardYield { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A班计划数量
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "agroup_plan_num")]
|
||||
public int? AgroupPlanNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A班完成率
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "agroup_completion_rate")]
|
||||
public decimal AgroupCompletionRate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// B班组长
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "bgroup_monitor")]
|
||||
public string BgroupMonitor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// B班生产数量
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "bgroup_product_num")]
|
||||
public int? BgroupProductNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// B班标准班产
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "bgroup_standard_yield")]
|
||||
public int? BgroupStandardYield { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// B班计划数量
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "bgroup_plan_num")]
|
||||
public int? BgroupPlanNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// B班完成率
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "bgroup_completion_rate")]
|
||||
public decimal BgroupCompletionRate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日汇总-实际数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "summary_actual_num")]
|
||||
public int? SummaryActualNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日汇总-计划数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "summary_plan_num")]
|
||||
public int? SummaryPlanNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日汇总-计划达成率
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "summary_plan_achievement_rate")]
|
||||
public decimal SummaryPlanAchievementRate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 质量问题
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "down_quality")]
|
||||
public int? DownQuality { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商问题
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "down_suppler")]
|
||||
public int? DownSuppler { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备故障
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "down_device_failure")]
|
||||
public int? DownDeviceFailure { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备调试
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "down_device_debug")]
|
||||
public int? DownDeviceDebug { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物流待料
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "down_logistics_wait_material")]
|
||||
public int? DownLogisticsWaitMaterial { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 缺货待料
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "down_lack_material")]
|
||||
public int? DownLackMaterial { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "down_project")]
|
||||
public int? DownProject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 注塑
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "down_injection")]
|
||||
public int? DownInjection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 装配
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "down_assembly")]
|
||||
public int? DownAssembly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总停线时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "all_line_stop_time")]
|
||||
public int? AllLineStopTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主要问题描述
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "main_problem_description")]
|
||||
public string MainProblemDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 策略
|
||||
/// </summary>
|
||||
public string Strategy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 责任人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "responsible_person")]
|
||||
public string ResponsiblePerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 记录日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "record_date")]
|
||||
public DateTime? RecordDate { 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; }
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Model.MES.product;
|
||||
using DOAN.Model.MES.product.Dto;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DOAN.Service.MES.product.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 日计划达成率service接口
|
||||
/// </summary>
|
||||
public interface IProPlanAchievementrateService : IBaseService<ProPlanAchievementrate>
|
||||
{
|
||||
PagedInfo<ProPlanAchievementrateDto> GetList(ProPlanAchievementrateQueryDto parm);
|
||||
|
||||
ProPlanAchievementrate GetInfo(int Id);
|
||||
|
||||
ProPlanAchievementrate AddProPlanAchievementrate(ProPlanAchievementrate parm);
|
||||
|
||||
int UpdateProPlanAchievementrate(ProPlanAchievementrate parm);
|
||||
|
||||
}
|
||||
}
|
||||
111
DOAN.Service/MES/product/ProPlanAchievementrateService.cs
Normal file
111
DOAN.Service/MES/product/ProPlanAchievementrateService.cs
Normal file
@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.Dto;
|
||||
using DOAN.Model.MES.product;
|
||||
using DOAN.Model.MES.product.Dto;
|
||||
using DOAN.Repository;
|
||||
using DOAN.Service.MES.product.IService;
|
||||
using System.Linq;
|
||||
namespace DOAN.Service.MES.product
|
||||
{
|
||||
/// <summary>
|
||||
/// 日计划达成率Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IProPlanAchievementrateService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class ProPlanAchievementrateService : BaseService<ProPlanAchievementrate>, IProPlanAchievementrateService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询日计划达成率列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<ProPlanAchievementrateDto> GetList(ProPlanAchievementrateQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<ProPlanAchievementrate>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Project), it => it.Project.Contains(parm.Project))
|
||||
|
||||
;
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<ProPlanAchievementrate, ProPlanAchievementrateDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public ProPlanAchievementrate GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加日计划达成率
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public ProPlanAchievementrate AddProPlanAchievementrate(ProPlanAchievementrate model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改日计划达成率
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateProPlanAchievementrate(ProPlanAchievementrate model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new ProPlanAchievementrate()
|
||||
//{
|
||||
// Project = model.Project,
|
||||
// AgroupMonitor = model.AgroupMonitor,
|
||||
// AgroupProductNum = model.AgroupProductNum,
|
||||
// AgroupStandardYield = model.AgroupStandardYield,
|
||||
// AgroupPlanNum = model.AgroupPlanNum,
|
||||
// AgroupCompletionRate = model.AgroupCompletionRate,
|
||||
// BgroupMonitor = model.BgroupMonitor,
|
||||
// BgroupProductNum = model.BgroupProductNum,
|
||||
// BgroupStandardYield = model.BgroupStandardYield,
|
||||
// BgroupPlanNum = model.BgroupPlanNum,
|
||||
// BgroupCompletionRate = model.BgroupCompletionRate,
|
||||
// SummaryActualNum = model.SummaryActualNum,
|
||||
// SummaryPlanNum = model.SummaryPlanNum,
|
||||
// SummaryPlanAchievementRate = model.SummaryPlanAchievementRate,
|
||||
// DownQuality = model.DownQuality,
|
||||
// DownSuppler = model.DownSuppler,
|
||||
// DownDeviceFailure = model.DownDeviceFailure,
|
||||
// DownDeviceDebug = model.DownDeviceDebug,
|
||||
// DownLogisticsWaitMaterial = model.DownLogisticsWaitMaterial,
|
||||
// DownLackMaterial = model.DownLackMaterial,
|
||||
// DownProject = model.DownProject,
|
||||
// DownInjection = model.DownInjection,
|
||||
// DownAssembly = model.DownAssembly,
|
||||
// AllLineStopTime = model.AllLineStopTime,
|
||||
// MainProblemDescription = model.MainProblemDescription,
|
||||
// Strategy = model.Strategy,
|
||||
// ResponsiblePerson = model.ResponsiblePerson,
|
||||
// RecordDate = model.RecordDate,
|
||||
// CreatedBy = model.CreatedBy,
|
||||
// CreatedTime = model.CreatedTime,
|
||||
// UpdatedBy = model.UpdatedBy,
|
||||
// UpdatedTime = model.UpdatedTime,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user