This commit is contained in:
17630416519 2025-09-15 18:10:40 +08:00
parent 7cf3ff8850
commit d7f620bfe0
4 changed files with 14 additions and 9 deletions

View File

@ -71,6 +71,7 @@ namespace DOAN.WebApi.Controllers.MES.product
//TODO 导出excel指定日计划
[HttpGet("ExportWeekDatePlan")]
[AllowAnonymous]
public IActionResult ExportWeekDatePlan(int year, int week, string dayofweek)
{
try

View File

@ -141,7 +141,7 @@ namespace DOAN.Model.MES.product.Dto
/// <summary>
/// 计划状态0未开始1执行中2已完成3暂停4取消
/// </summary>
public byte PlanStatus { get; set; } = 0;
public string PlanStatus { get; set; }
/// <summary>
/// 车间计划员工号如EMP00123

View File

@ -165,9 +165,9 @@ namespace DOAN.Model.MES.product
/// <summary>
/// 计划状态0未开始1执行中2已完成3暂停4取消
/// </summary>
[SugarColumn(ColumnDataType = "tinyint", IsNullable = false, ColumnDescription = "计划状态0未开始1执行中2已完成3暂停4取消", ColumnName = "plan_status")]
[SugarColumn(ColumnDataType = "varchar(64)", IsNullable = false, ColumnDescription = "计划状态define", ColumnName = "plan_status")]
[Required(ErrorMessage = "计划状态不能为空")]
public byte PlanStatus { get; set; } = 0;
public string PlanStatus { get; set; } = string.Empty;
/// <summary>
/// 车间计划员工号如EMP00123

View File

@ -51,7 +51,7 @@ namespace DOAN.Service.MES.product
IWorkbook workbook = new XSSFWorkbook(stream);
ISheet sheet = workbook.GetSheetAt(0);
ISheet sheet = workbook.GetSheet("Sheet1");
// 处理第2行 获取日期
IRow secondRow = sheet.GetRow(1);
@ -90,10 +90,14 @@ namespace DOAN.Service.MES.product
//产品零件号
string _Specification = currentRow.GetCell(4)?.ToString();
proWeeklyPlan.Specification = _Specification;
if (string.IsNullOrEmpty(_ProductCode) && string.IsNullOrEmpty(_ProductName) && string.IsNullOrEmpty(_Specification))
{
continue;
}
//生产状态
string _PlanStatus = currentRow.GetCell(5)?.ToString();
if (!string.IsNullOrEmpty(_PlanStatus))
proWeeklyPlan.PlanStatus = byte.Parse(_PlanStatus);
proWeeklyPlan.PlanStatus = _PlanStatus;
//车间计划员
string planner = currentRow.GetCell(6)?.ToString();
@ -115,9 +119,9 @@ namespace DOAN.Service.MES.product
proWeeklyDatePlan.FkWeeklyId = proWeeklyPlan.Id;
proWeeklyDatePlan.PlanCode = proWeeklyPlan.PlanCode;
int weekdayindex = 9;
DateTime? MondayDate = sheet.GetRow(2).GetCell(weekdayindex)?.DateCellValue;
proWeeklyDatePlan.WeekDate = (DateTime)MondayDate;
proWeeklyPlan.PlanStartDate = (DateTime)MondayDate;
DateTime? MondayDate = sheet.GetRow(2).GetCell(weekdayindex)?.DateCellValue;
proWeeklyDatePlan.WeekDate = MondayDate??DateTime.MinValue;
proWeeklyPlan.PlanStartDate = MondayDate ?? DateTime.MinValue;
proWeeklyPlan.PlanYear = MondayDate.Value.Year;
year = MondayDate.Value.Year;
@ -373,7 +377,7 @@ namespace DOAN.Service.MES.product
string planStatus = row.GetCell(5)?.ToString();
if (!string.IsNullOrEmpty(planStatus))
{
proWeeklyPlan.PlanStatus = byte.Parse(planStatus);
proWeeklyPlan.PlanStatus = planStatus;
}
//车间计划员