主体工程完成
This commit is contained in:
@@ -10,13 +10,9 @@ using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Common;
|
||||
using ZR.Model.mes.md;
|
||||
using ZR.Model.mes.pro;
|
||||
using ZR.Model.MES.wm;
|
||||
using ZR.Service.mes.pro.IService;
|
||||
using ZR.Service.MES.md.IService;
|
||||
using static System.Net.WebRequestMethods;
|
||||
|
||||
using JinianNet.JNTemplate;
|
||||
using static Aliyun.OSS.Model.LiveChannelStat;
|
||||
using ZR.Model.MES.pro.DTO;
|
||||
@@ -28,6 +24,7 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using MiniExcelLibs;
|
||||
using System.IO;
|
||||
using SqlSugar.Extensions;
|
||||
using ZR.Model.mes.pro;
|
||||
|
||||
namespace ZR.Service.mes.pro
|
||||
{
|
||||
@@ -100,7 +97,7 @@ namespace ZR.Service.mes.pro
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
UseTran(() =>
|
||||
{
|
||||
// 删除之前的工单
|
||||
@@ -165,7 +162,7 @@ namespace ZR.Service.mes.pro
|
||||
{
|
||||
year = year,
|
||||
week = week,
|
||||
date=date,
|
||||
date = date,
|
||||
title = $"{year}年车镜实业涂装事业{week}周{date}生产滚动表",
|
||||
|
||||
workorder = list
|
||||
@@ -177,7 +174,7 @@ namespace ZR.Service.mes.pro
|
||||
|
||||
|
||||
|
||||
// MiniExcel.SaveAs(fullPath, list);
|
||||
// MiniExcel.SaveAs(fullPath, list);
|
||||
|
||||
|
||||
//3.0 返回路径和文件名
|
||||
@@ -198,7 +195,45 @@ 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>
|
||||
/// <returns></returns>
|
||||
private int Getworkorderid_max()
|
||||
{
|
||||
|
||||
ProWorkorder_v2 max_workorder = Context.Queryable<ProWorkorder_v2>().OrderBy(it => it.Id, OrderByType.Desc).First();
|
||||
if (max_workorder != null && !string.IsNullOrEmpty(max_workorder.Id) && max_workorder.Id.Substring(2, 8) == DateTime.Now.ToString("yyyyMMdd"))
|
||||
{
|
||||
int num = Convert.ToInt32(max_workorder.Id.Substring(10)) + 1;
|
||||
return num;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public int AddWorkOrder(ProWorkorder_v2 workorder)
|
||||
{
|
||||
|
||||
|
||||
workorder.Id = "WO" + DateTime.Now.ToString("yyyyMMdd") + Getworkorderid_max().ToString("000");
|
||||
|
||||
return Context.Insertable(workorder).ExecuteCommand();
|
||||
}
|
||||
|
||||
public int DeleteWorkOrder(string id)
|
||||
{
|
||||
return Context.Deleteable<ProWorkorder_v2>().In(id).ExecuteCommand();
|
||||
|
||||
}
|
||||
|
||||
public int UpdateWorkOrder(ProWorkorder_v2 workorder)
|
||||
{
|
||||
return Context.Updateable(workorder).ExecuteCommand();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user