This commit is contained in:
gcw_MV9p2JJN 2025-10-17 13:22:27 +08:00
parent ac59c97c74
commit 12ce078ed4
3 changed files with 7 additions and 4 deletions

View File

@ -15,8 +15,8 @@ namespace DOAN.Model.MES.product.Dto
/// </summary>
public class ProPlanAchievementrateDto
{
[Required(ErrorMessage = "自增主键不能为空")]
public int Id { get; set; }
// [Required(ErrorMessage = "自增主键不能为空")]
// public int Id { get; set; }
public string Project { get; set; }

View File

@ -10,7 +10,7 @@ namespace DOAN.Model.MES.product
/// <summary>
/// 自增主键
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>

View File

@ -9,6 +9,8 @@ using DOAN.Model.MES.product.Dto;
using DOAN.Repository;
using DOAN.Service.MES.product.IService;
using System.Linq;
using Microsoft.AspNetCore.Http;
using Infrastructure;
namespace DOAN.Service.MES.product
{
/// <summary>
@ -58,7 +60,8 @@ namespace DOAN.Service.MES.product
/// <returns></returns>
public ProPlanAchievementrate AddProPlanAchievementrate(ProPlanAchievementrate model)
{
return Context.Insertable(model).ExecuteReturnEntity();
return Context.Insertable(model).IgnoreColumns(it => new { it.Id }).ExecuteReturnEntity();
}
/// <summary>