主体工程完成

This commit is contained in:
qianhao.xu
2024-01-22 15:22:56 +08:00
parent e3ef300dfb
commit 835025afe9
6 changed files with 116 additions and 28 deletions

View File

@@ -7,7 +7,7 @@ using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZR.Model.mes.pro;
using ZR.Model.MES.op.DTO;
using ZR.Model.MES.pro;
using ZR.Model.MES.pro.DTO;
@@ -27,5 +27,15 @@ namespace ZR.Service.mes.pro.IService
public int DeleteAllWorkorder(int year, int week, int date);
public int AddWorkOrder(ProWorkorder_v2 workorder);
public int DeleteWorkOrder(string id);
public int UpdateWorkOrder(ProWorkorder_v2 workorder);
}
}

View File

@@ -9,6 +9,7 @@ using System.Threading.Tasks;
using ZR.Model.mes.pro;
using ZR.Model.MES.op.DTO;
using ZR.Model.MES.pro.DTO;
using ZR.Model.mes.pro;
namespace ZR.Service.mes.pro.IService
{
@@ -22,7 +23,7 @@ namespace ZR.Service.mes.pro.IService
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public List<ProWorkplan> GetProWorkplanById(string id);
public List<ProWorklplan_v2> GetProWorkplanById(string id);
public int AddWorkPlan(ProWorklplan_v2 proWorkplan);

View File

@@ -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();
}
}
}

View File

@@ -14,7 +14,6 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZR.Model.mes.md;
using ZR.Model.mes.pro;
using ZR.Model.MES.pro.DTO;
using ZR.Service.mes.pro.IService;
@@ -41,9 +40,9 @@ namespace ZR.Service.mes.pro
}
public List<ProWorkplan> GetProWorkplanById(string id)
public List<ProWorklplan_v2> GetProWorkplanById(string id)
{
return Context.Queryable<ProWorkplan>().Where(it => it.Id == id).ToList();
return Context.Queryable<ProWorklplan_v2>().Where(it => it.Id == id).ToList();
}
@@ -245,8 +244,6 @@ namespace ZR.Service.mes.pro
return Context.Deleteable<ProWorklplan_v2>().Where(it => it.Year == year && it.Week == week).ExecuteCommand();
}
}
}