首检完成
This commit is contained in:
@@ -20,6 +20,8 @@ namespace ZR.Service.mes.pro.IService
|
||||
|
||||
|
||||
public (List<ProWorkorder_v2>, int) GetWorkorderList(int pageNum, int pageSize, int year, int week, int date, int isSchedule);
|
||||
public (List<ProWorkorder_v2>, int) GetWorkorderList_Piliang(int pageNum, int pageSize, int year, int week, int date, int isSchedule);
|
||||
|
||||
|
||||
public string ImportExceldata(List<ProWorkorder_v2> proWorklplans);
|
||||
|
||||
|
||||
@@ -46,6 +46,21 @@ namespace ZR.Service.mes.pro
|
||||
|
||||
return (proWorkorderList, totalCount);
|
||||
}
|
||||
|
||||
public (List<ProWorkorder_v2>, int) GetWorkorderList_Piliang(int pageNum, int pageSize, int year, int week, int date, int isSchedule)
|
||||
{
|
||||
|
||||
var predicate = Expressionable.Create<ProWorkorder_v2>()
|
||||
.AndIF(year > 0, it => it.Year == year)
|
||||
.AndIF(week > 0, it => it.Week == week)
|
||||
.AndIF(date > 0, it => it.Date == date)
|
||||
.ToExpression();
|
||||
|
||||
int totalCount = 0;
|
||||
List<ProWorkorder_v2> proWorkorderList = Context.Queryable<ProWorkorder_v2>().Where(predicate).Where(it=>it.Remark3=="是").OrderBy(it => it.Sort).ToPageList(pageNum, pageSize, ref totalCount);
|
||||
|
||||
return (proWorkorderList, totalCount);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取生产计划id
|
||||
/// </summary>
|
||||
@@ -163,15 +178,8 @@ namespace ZR.Service.mes.pro
|
||||
//2.0 保存为excel
|
||||
IWebHostEnvironment webHostEnvironment = (IWebHostEnvironment)App.ServiceProvider.GetService(typeof(IWebHostEnvironment));
|
||||
string sFileName = $"{year}年{week}周{date}日计划-{DateTime.Now:MM-dd-HHmmss}.xlsx";
|
||||
|
||||
|
||||
string fullPath = Path.Combine(webHostEnvironment.WebRootPath, "export", sFileName);
|
||||
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
|
||||
|
||||
|
||||
|
||||
var Sheet1 = new
|
||||
{
|
||||
year = year,
|
||||
@@ -183,20 +191,9 @@ namespace ZR.Service.mes.pro
|
||||
};
|
||||
string templatePath = Path.Combine(webHostEnvironment.WebRootPath, "ImportTemplate", "日生产计划模板1.xlsx");
|
||||
MiniExcel.SaveAsByTemplate(fullPath, templatePath, Sheet1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// MiniExcel.SaveAs(fullPath, list);
|
||||
|
||||
|
||||
//3.0 返回路径和文件名
|
||||
return (sFileName, fullPath);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -209,6 +206,8 @@ namespace ZR.Service.mes.pro
|
||||
{
|
||||
return Context.Deleteable<ProWorkorder_v2>().Where(it => it.Year == year && it.Week == week && it.Date == date).ExecuteCommand();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取生产计划id
|
||||
/// </summary>
|
||||
@@ -268,7 +267,8 @@ namespace ZR.Service.mes.pro
|
||||
{
|
||||
workorder.Remark3 = "是";
|
||||
}
|
||||
return Context.Updateable(workorder).ExecuteCommand();
|
||||
|
||||
return Context.Updateable(workorder).IgnoreColumns(it => new { it.CreatedBy, it.CreatedTime,it.Remark4,it.Sort }).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user