工单号生成规则调整
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using BarTender;
|
||||
using DOAN.Infrastructure.Helper;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.BZFM;
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Model.MES.base_.Dto;
|
||||
using DOAN.Model.MES.product;
|
||||
@@ -145,9 +146,6 @@ namespace DOAN.Service.MES.product
|
||||
// }, true);
|
||||
//var response = query4.MergeTable().OrderBy(it => it.WorkorderDate).ToPage<ProWorkorderDto3, ProWorkorderDto3>(parm);
|
||||
|
||||
|
||||
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -305,9 +303,14 @@ namespace DOAN.Service.MES.product
|
||||
proWorkorder.WorkorderDate ?? DateTime.MinValue
|
||||
);
|
||||
// 获取 产品代号
|
||||
List<SysDictData> ProductCodeList = Context
|
||||
/*List<SysDictData> ProductCodeList = Context
|
||||
.Queryable<SysDictData>()
|
||||
.Where(it => it.DictType == "product_code")
|
||||
.ToList();*/
|
||||
// XXX 改为从物料清单获取信息
|
||||
List<MmMaterial> mmMaterials = Context
|
||||
.Queryable<MmMaterial>()
|
||||
.Where(it => it.Status == "启用")
|
||||
.ToList();
|
||||
DateTime handleDate = proWorkorder.WorkorderDate.Value;
|
||||
//插入工单
|
||||
@@ -330,9 +333,13 @@ namespace DOAN.Service.MES.product
|
||||
}
|
||||
// proWorkorder.Workorder = "K" + handleDate.ToString("yyyyMMdd") + "_" + proWorkorder.GroupCode + "_" + proWorkorder.RouteCode + "_" + index.ToString("000");
|
||||
|
||||
string nickCode = ProductCodeList
|
||||
/*string nickCode = ProductCodeList
|
||||
.Where(it => it.DictLabel == proWorkorder.productionCode)
|
||||
.Select(it => it.DictValue)
|
||||
.FirstOrDefault();*/
|
||||
string nickCode = mmMaterials
|
||||
.Where(it => it.MaterialCode == proWorkorder.productionCode)
|
||||
.Select(it => it.Type)
|
||||
.FirstOrDefault();
|
||||
proWorkorder.Workorder =
|
||||
"K"
|
||||
@@ -404,9 +411,13 @@ namespace DOAN.Service.MES.product
|
||||
}
|
||||
//proWorkorder.Workorder = "H" + handleDate.ToString("yyyyMMdd") + "_" + proWorkorder.GroupCode + "_" + proWorkorder.RouteCode + "_" + index.ToString("000");
|
||||
|
||||
string nickCode = ProductCodeList
|
||||
/*string nickCode = ProductCodeList
|
||||
.Where(it => it.DictLabel == proWorkorder.productionCode)
|
||||
.Select(it => it.DictValue)
|
||||
.FirstOrDefault();*/
|
||||
string nickCode = mmMaterials
|
||||
.Where(it => it.MaterialCode == proWorkorder.productionCode)
|
||||
.Select(it => it.Type)
|
||||
.FirstOrDefault();
|
||||
proWorkorder.Workorder =
|
||||
"H"
|
||||
@@ -494,9 +505,14 @@ namespace DOAN.Service.MES.product
|
||||
List<ProWorkorder> workorderList = new();
|
||||
DateTime dateValue = DateTime.MinValue;
|
||||
// 获取 产品代号
|
||||
List<SysDictData> ProductCodeList = Context
|
||||
/*List<SysDictData> ProductCodeList = Context
|
||||
.Queryable<SysDictData>()
|
||||
.Where(it => it.DictType == "product_code")
|
||||
.ToList();*/
|
||||
// XXX 改为从物料清单获取信息
|
||||
List<MmMaterial> mmMaterials = Context
|
||||
.Queryable<MmMaterial>()
|
||||
.Where(it => it.Status == "启用")
|
||||
.ToList();
|
||||
using (var stream = formFile.OpenReadStream())
|
||||
{
|
||||
@@ -638,8 +654,6 @@ namespace DOAN.Service.MES.product
|
||||
/*NPOI.SS.UserModel.ICell currentCell_0811 = currentRow.GetCell(6);
|
||||
workorder.PackageCapacity = (int)currentCell_0811?.NumericCellValue;*/
|
||||
|
||||
|
||||
|
||||
// 11车间code
|
||||
NPOI.SS.UserModel.ICell currentCell_18 = currentRow.GetCell(11);
|
||||
if (currentCell_18 == null)
|
||||
@@ -742,9 +756,14 @@ namespace DOAN.Service.MES.product
|
||||
workorder.Status = 1;
|
||||
//工单 2024-9-13-组-线-序号
|
||||
int index = (row - 3);
|
||||
string nickCode = ProductCodeList
|
||||
/*string nickCode = ProductCodeList
|
||||
.Where(it => it.DictLabel == workorder.productionCode)
|
||||
.Select(it => it.DictValue)
|
||||
.FirstOrDefault();*/
|
||||
//TODO nickCode改为从物料清单进行获取
|
||||
string nickCode = mmMaterials
|
||||
.Where(it => it.MaterialCode == workorder.productionCode)
|
||||
.Select(it => it.Type)
|
||||
.FirstOrDefault();
|
||||
workorder.Workorder =
|
||||
dateValue.ToString("yyyyMMdd")
|
||||
@@ -795,9 +814,14 @@ namespace DOAN.Service.MES.product
|
||||
DateTime dateValue = DateTime.MinValue;
|
||||
|
||||
// 获取 产品代号
|
||||
List<SysDictData> ProductCodeList = Context
|
||||
/*List<SysDictData> ProductCodeList = Context
|
||||
.Queryable<SysDictData>()
|
||||
.Where(it => it.DictType == "product_code")
|
||||
.ToList();*/
|
||||
// XXX 改为从物料清单获取信息
|
||||
List<MmMaterial> mmMaterials = Context
|
||||
.Queryable<MmMaterial>()
|
||||
.Where(it => it.Status == "启用")
|
||||
.ToList();
|
||||
using (var stream = formFile.OpenReadStream())
|
||||
{
|
||||
@@ -939,8 +963,6 @@ namespace DOAN.Service.MES.product
|
||||
/*NPOI.SS.UserModel.ICell currentCell_0811 = currentRow.GetCell(6);
|
||||
workorder.PackageCapacity = (int)currentCell_0811?.NumericCellValue;*/
|
||||
|
||||
|
||||
|
||||
// 11车间code
|
||||
NPOI.SS.UserModel.ICell currentCell_18 = currentRow.GetCell(11);
|
||||
if (currentCell_18 == null)
|
||||
@@ -1066,9 +1088,14 @@ namespace DOAN.Service.MES.product
|
||||
|
||||
//workorder.Workorder = dateValue.ToString("yyyyMMdd") + "_" + workorder.GroupCode + "_" + workorder.RouteCode + "_" + flowNum.ToString("000");
|
||||
|
||||
string nickCode = ProductCodeList
|
||||
/*string nickCode = ProductCodeList
|
||||
.Where(it => it.DictLabel == workorder.productionCode)
|
||||
.Select(it => it.DictValue)
|
||||
.FirstOrDefault();*/
|
||||
//TODO nickCode改为从物料清单进行获取
|
||||
string nickCode = mmMaterials
|
||||
.Where(it => it.MaterialCode == workorder.productionCode)
|
||||
.Select(it => it.Type)
|
||||
.FirstOrDefault();
|
||||
workorder.Workorder =
|
||||
dateValue.ToString("yyyyMMdd")
|
||||
@@ -1193,7 +1220,6 @@ namespace DOAN.Service.MES.product
|
||||
.ToList();
|
||||
}*/
|
||||
|
||||
|
||||
public List<BaseWorkRoute> GetAllRoute()
|
||||
{
|
||||
return Context.Queryable<BaseWorkRoute>().ToList();
|
||||
@@ -1526,9 +1552,7 @@ namespace DOAN.Service.MES.product
|
||||
/// </summary>
|
||||
/// <param name="param">工单号列表与打印路径</param>
|
||||
/// <returns></returns>
|
||||
public async Task<CustomException> PrintTicketsByTemplate(
|
||||
ProWorkorderExportDto param
|
||||
)
|
||||
public async Task<CustomException> PrintTicketsByTemplate(ProWorkorderExportDto param)
|
||||
{
|
||||
var dataList = await Context
|
||||
.Queryable<ProWorkorder>()
|
||||
|
||||
Reference in New Issue
Block a user