物料清单搜索

This commit is contained in:
qianhao.xu 2024-08-30 15:15:08 +08:00
parent c675d60dcd
commit f92f5b3b4b
3 changed files with 20 additions and 14 deletions

View File

@ -125,12 +125,12 @@ namespace DOAN.Model.MES.base_.Dto
public class BaseMaterialListDto2
{
public string FkMaterialTypeCode { get; set; }
public string FkMaterialTypeName { get; set; }
public string Type_Name { get; set; }
public string Type_Code { get; set; }
public string SupplierName { get; set; }
//public string SupplierName { get; set; }
public string Id { get; set; }

View File

@ -80,6 +80,7 @@ namespace DOAN.Service.MES.ERP
else
{
var childDb = Context.AsTenant().GetConnectionWithAttr<BaseCustom>();//线程安全用GetConnectionWithAttrScope
childDb.Ado.ExecuteCommand("ALTER TABLE base_custom AUTO_INCREMENT = 1");
TypeAdapterConfig<CustDevMesCustomer, BaseCustom>.NewConfig()
.Map(dest => dest.CustomNo, src => src.CusCode)
@ -156,10 +157,10 @@ namespace DOAN.Service.MES.ERP
}
else
{
Context.AsTenant().DeleteableWithAttr<BaseSupplier>().ExecuteCommand();
// ALTER TABLE base_supplier AUTO_INCREMENT = 1
var childDb = Context.AsTenant().GetConnectionWithAttr<BaseSupplier>();//线程安全用GetConnectionWithAttrScope
childDb.DbMaintenance.TruncateTable<BaseSupplier>();
childDb.Ado.ExecuteCommand("ALTER TABLE base_supplier AUTO_INCREMENT = 1");
TypeAdapterConfig<CustDevMesVendor, BaseSupplier>.NewConfig()
.Map(dest => dest.SupplierNo, src => src.VenCode)
@ -196,9 +197,11 @@ namespace DOAN.Service.MES.ERP
List<CustDevMesInventoryClass> ERP_Datas = Context.AsTenant().QueryableWithAttr<CustDevMesInventoryClass>().ToList();
//清空表
Context.AsTenant().DeleteableWithAttr<BaseMaterialType>().ExecuteCommand();
var childDb = Context.AsTenant().GetConnectionWithAttr<BaseMaterialType>();//线程安全用GetConnectionWithAttrScope
//清空表
childDb.DbMaintenance.TruncateTable<BaseMaterialType>();
childDb.Ado.ExecuteCommand("ALTER TABLE base_material_type AUTO_INCREMENT = 1");
// 配置局部映射规则
@ -237,9 +240,11 @@ namespace DOAN.Service.MES.ERP
//清空表
Context.AsTenant().DeleteableWithAttr<BaseMaterialList>().ExecuteCommand();
var childDb = Context.AsTenant().GetConnectionWithAttr<BaseMaterialList>();//线程安全用GetConnectionWithAttrScope
//清空表
childDb.DbMaintenance.TruncateTable<BaseMaterialList>();
childDb.Ado.ExecuteCommand("ALTER TABLE base_material_list AUTO_INCREMENT = 1");
// 配置局部映射规则
@ -280,7 +285,8 @@ namespace DOAN.Service.MES.ERP
Task.Run(() =>
{
//清空表 耗时17s
childDb.Deleteable<BaseMaterialBom>().ExecuteCommand();
childDb.DbMaintenance.TruncateTable<BaseMaterialBom>();
childDb.Ado.ExecuteCommand("ALTER TABLE base_material_bom AUTO_INCREMENT = 1");
// 配置局部映射规则
TypeAdapterConfig<CustDevMesBom, BaseMaterialBom>.NewConfig()

View File

@ -45,13 +45,13 @@ namespace DOAN.Service.MES.base_
.Where(predicate.ToExpression());
var response = Context.Queryable(query01).LeftJoin<BaseMaterialType>((q, t) => q.FkMaterialTypeCode == t.Code)
.LeftJoin<BaseSupplier>((q, t, s) => q.FkSupplierId == s.Id)
.Select((q, t, s) => new BaseMaterialListDto2
// .LeftJoin<BaseSupplier>((q, t, s) => q.FkSupplierId == s.Id)
.Select((q, t) => new BaseMaterialListDto2
{
Type_Name = t.Name,
Type_Code = t.Code,
SupplierName = s.SupplierName
FkMaterialTypeName = t.Name,
FkMaterialTypeCode = t.Code,
}, true).ToPage<BaseMaterialListDto2, BaseMaterialListDto2>(parm);