工单完成
This commit is contained in:
@@ -93,19 +93,47 @@ namespace ZR.Admin.WebApi.Controllers.mes.pro
|
||||
//读取列表数据
|
||||
try
|
||||
{
|
||||
var list = stream.Query<ProWorkorder_v2>(sheetName: "Sheet1", startCell: "A3")
|
||||
.Where(it => it.FinishedPartNumber != null)
|
||||
.Where(it =>it.BlankNumber!=null&&!it.BlankNumber.Contains("圈数"))
|
||||
.ToList();
|
||||
list.ForEach(it =>
|
||||
{
|
||||
it.ToCreate(HttpContext);
|
||||
it.Year = year;
|
||||
it.Week = week;
|
||||
it.Date = date;
|
||||
var list = stream.Query<ProWorkorder_v2>(sheetName: "Sheet1", startCell: "A3").ToList(); ;
|
||||
|
||||
});
|
||||
string result = proWorkorderService.ImportExceldata(list);
|
||||
|
||||
foreach (ProWorkorder_v2 item in list)
|
||||
{
|
||||
if (item.BlankNumber == null)
|
||||
item.BlankNumber = "";
|
||||
if (item.FinishedPartNumber == null)
|
||||
item.FinishedPartNumber = "";
|
||||
if (item.ProductDescription == null)
|
||||
item.ProductDescription = "";
|
||||
if (item.Colour == null)
|
||||
item.Colour = "";
|
||||
if (item.FinishedPartNumber == null)
|
||||
item.FinishedPartNumber = "";
|
||||
if (item.ProductDescription == null)
|
||||
item.ProductDescription = "";
|
||||
if (item.Colour == null)
|
||||
item.Colour = "";
|
||||
if (item.Specifications == null)
|
||||
item.Specifications = "";
|
||||
if (item.CylinderNumber == null)
|
||||
item.CylinderNumber = "";
|
||||
if (item.Remark1 == null)
|
||||
item.Remark1 = "";
|
||||
if (item.Remark2 == null)
|
||||
item.Remark2 = "";
|
||||
if (item.Remark3 == null)
|
||||
item.Remark3 = "";
|
||||
if (item.Remark4 == null)
|
||||
item.Remark4 = "";
|
||||
if (item.ClientWorkorder == null)
|
||||
item.ClientWorkorder = "";
|
||||
item.ToCreate(HttpContext);
|
||||
item.Year = year;
|
||||
item.Week = week;
|
||||
item.Date = date;
|
||||
}
|
||||
var final_list = list.Where(it => !it.BlankNumber.Contains("圈数")).ToList();
|
||||
|
||||
string result = proWorkorderService.ImportExceldata(final_list);
|
||||
return SUCCESS(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -124,13 +152,13 @@ namespace ZR.Admin.WebApi.Controllers.mes.pro
|
||||
/// <returns></returns>
|
||||
[HttpGet("downloadWorkorder")]
|
||||
[Log(Title = "下载生产工单", BusinessType = BusinessType.EXPORT)]
|
||||
public IActionResult UserExport(int? year, int? week,int? date)
|
||||
public IActionResult UserExport(int? year, int? week, int? date)
|
||||
{
|
||||
if (year == null || week == null || date==null)
|
||||
if (year == null || week == null || date == null)
|
||||
{
|
||||
return SUCCESS(0);
|
||||
}
|
||||
var result = proWorkorderService.ExportExceldata((int)year, (int)week,(int)date);
|
||||
var result = proWorkorderService.ExportExceldata((int)year, (int)week, (int)date);
|
||||
|
||||
|
||||
return ExportExcel(result.Item2, result.Item1);
|
||||
@@ -147,7 +175,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.pro
|
||||
if (week != null && week > 0)
|
||||
{
|
||||
if (year != null && year > 0)
|
||||
data = proWorkorderService.DeleteAllWorkorder((int)year, (int)week,(int)date);
|
||||
data = proWorkorderService.DeleteAllWorkorder((int)year, (int)week, (int)date);
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
@@ -212,6 +240,74 @@ namespace ZR.Admin.WebApi.Controllers.mes.pro
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除本周所有计划
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("updateSort")]
|
||||
public IActionResult UpdateSort(string id, int? sort)
|
||||
{
|
||||
int data = 0;
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
|
||||
data = proWorkorderService.UpdateworkorderSort(id, (int)sort);
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 工单开始上线
|
||||
/// </summary>
|
||||
/// <param name="id">工单ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("startOnline/{id}")]
|
||||
public IActionResult StartOnline(string id)
|
||||
{
|
||||
int data = 0;
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
data = proWorkorderService.StartWorkOrder(id);
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 工单下线
|
||||
/// </summary>
|
||||
/// <param name="id">工单ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("cancelOnline/{id}")]
|
||||
public IActionResult CancelOnline(string id)
|
||||
{
|
||||
int data = 0;
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
data = proWorkorderService.CancelWorkOrder(id);
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 生成工单号
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("generateWorkorder")]
|
||||
public IActionResult GenerateWorkorder(int? year, int? week, int? date)
|
||||
{
|
||||
int data = 0;
|
||||
data = proWorkorderService.GenerateWorkorder((int)year, (int)week,(int)date);
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.pro
|
||||
[AllowAnonymous] //不需要授权 就可以访问
|
||||
public IActionResult ImportTemplateExcel()
|
||||
{
|
||||
(string, string) result = DownloadImportTemplate("周生产计划模板");//返回文件名和路径
|
||||
(string, string) result = DownloadImportTemplate("周计划标准模板");//返回文件名和路径
|
||||
return ExportExcel(result.Item2, result.Item1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user