基础信息:在数据库表内存在创建组织与使用组织的添加默认传入值1
| | |
| | | public string? remark3 { get; set; } |
| | | public string? remark4 { get; set; } |
| | | public string? remark5 { get; set; } |
| | | public string? FUseOrgId { get; set; } |
| | | public string? FCreateOrgId { get; set; } |
| | | } |
| | |
| | | public string? FName { get; set; }//工作中心名称 |
| | | public string? factory_name { get; set; }//工厂名称 |
| | | public string? Factory { get; set; }//工厂名称 |
| | | |
| | | public string? FUseOrgId { get; set; }//使用组织 |
| | | public string? FCreateOrgId { get; set; }//创建组织 |
| | | } |
| | |
| | | [SugarColumn(ColumnName = "remark5")] |
| | | public string? remark5 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 使用组织 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FSUBSIDIARY")] |
| | | public string? FSubsidiary { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 创建组织 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FUMBRELLA")] |
| | | public string? Fumbrella { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | } |
| | |
| | | using Masuit.Tools; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | /// <summary> |
| | | /// 客户信息 |
| | | /// </summary> |
| | | public class MesCustomerManager : Repository<MesCustomer> |
| | | { |
| | | public bool Save(ErpCustomer customer) |
| | |
| | | Fseller = customer.Fseller, |
| | | //Fforbidstatus = customer.FForbidStatus, |
| | | Remark = customer.FDescription, |
| | | FSubsidiary = "1", |
| | | Fumbrella = "1", |
| | | //FSubsidiary = "1", |
| | | //Fumbrella = "1", |
| | | // 如果存在,使用现有的CreateDate,后续将删除后重新插入 |
| | | // 如果不存在,设为当前时间 |
| | | CreateDate = existingCustomer?.CreateDate ?? DateTime.Now, |
| | |
| | | ItemC =null, |
| | | ItemSap=null, |
| | | LotFlag=null, |
| | | Iscommit= null |
| | | Iscommit= null, |
| | | |
| | | FSubsidiary = string.IsNullOrEmpty(customer.FUseOrgId) ? "1" : customer.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(customer.FCreateOrgId) ? "1" : customer.FCreateOrgId, |
| | | }; |
| | | |
| | | // ERP: 0=未禁用, 1=禁用 |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | /// <summary> |
| | | /// 仓库信息 |
| | | /// </summary> |
| | | public class MesDepotsManager : Repository<MesDepots> |
| | | { |
| | | // Save 方法用于保存单个仓库记录,根据类型执行不同的操作 |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 同步物料信息new_0/4 |
| | | /// 同步仓库信息new_0/4 |
| | | /// </summary> |
| | | /// <param name="db"></param> |
| | | /// <param name="entity"></param> |
| | |
| | | Depottype = depots.FStockProperty, |
| | | IsNg = depots.FForbidStatus, |
| | | Zuid = depots.FGroup, |
| | | FSubsidiary = depots.FUseOrgId, |
| | | Fumbrella = depots.FCreateOrgId, |
| | | //FSubsidiary = depots.FUseOrgId, |
| | | //Fumbrella = depots.FCreateOrgId, |
| | | // 如果存在,使用现有的CreateDate,后续将删除后重新插入 |
| | | // 如果不存在,设为当前时间 |
| | | CreateDate = existingCustomer?.CreateDate ?? DateTime.Now, |
| | |
| | | factory_name = depots.factory_name, |
| | | Remark4 = depots.remark4, |
| | | Remark5 = depots.remark5, |
| | | FSubsidiary = string.IsNullOrEmpty(depots.FUseOrgId) ? "1" : depots.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(depots.FCreateOrgId) ? "1" : depots.FCreateOrgId, |
| | | }; |
| | | // ERP: 0=未禁用, 1=禁用 |
| | | // MES: A=未禁用, B=禁用 |
| | |
| | | } |
| | | |
| | | // 批量更新仓库状态的方法 |
| | | private bool UpdateDepotStatusBatch(SqlSugarScope db, |
| | | List<MesDepots> depotList, string status) |
| | | private bool UpdateDepotStatusBatch(SqlSugarScope db,List<MesDepots> depotList, string status) |
| | | { |
| | | var ids = depotList.Select(it => it.DepotId).ToArray(); |
| | | var result = db.Updateable<MesDepots>() |
| | |
| | | } |
| | | |
| | | // 批量插入仓库的方法 |
| | | private bool InsertDepotBatch(SqlSugarScope db, |
| | | List<MesDepots> depotList) |
| | | private bool InsertDepotBatch(SqlSugarScope db,List<MesDepots> depotList) |
| | | { |
| | | var insertRange = db.Insertable(depotList).ExecuteCommand(); |
| | | if (insertRange > 0) |
| | |
| | | } |
| | | |
| | | // 批量插入或更新仓库的方法 |
| | | private bool InsertOrUpdateBatch(SqlSugarScope db, |
| | | List<MesDepots> depotList) |
| | | private bool InsertOrUpdateBatch(SqlSugarScope db,List<MesDepots> depotList) |
| | | { |
| | | return depotList.All(entity => InsertOrUpdate(db, entity)); |
| | | } |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | /// <summary> |
| | | /// 物料信息 |
| | | /// </summary> |
| | | public class MesItemsManager : Repository<MesItems> |
| | | { |
| | | public bool Save(ErpItems item) |
| | |
| | | ProductionWorkshop = item.FWorkShopId, |
| | | ProduceUnit = item.FPRODUCEUNITID, |
| | | SubconUnit = item.FSUBCONUNITID, |
| | | FSubsidiary = item.FUseOrgId, |
| | | Fumbrella = item.FCreateOrgId, |
| | | //FSubsidiary = item.FUseOrgId, |
| | | //Fumbrella = item.FCreateOrgId, |
| | | LastupdateDate = DateTime.Now, |
| | | // 如果存在,使用现有的CreateDate,后续将删除后重新插入 |
| | | // 如果不存在,设为当前时间 |
| | |
| | | ExpirationDate= item.Expirationdate, |
| | | ReviewPeriod= item.Reviewperiod, |
| | | LeadDays= item.FLeadDays, |
| | | Remark5 = item.FRemark5 |
| | | Remark5 = item.FRemark5, |
| | | |
| | | FSubsidiary = string.IsNullOrEmpty(item.FUseOrgId) ? "1" : item.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(item.FCreateOrgId) ? "1" : item.FCreateOrgId, |
| | | }; |
| | | |
| | | // ERP: 0=未禁用, 1=禁用 |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | /// <summary> |
| | | /// 岗位信息 |
| | | /// </summary> |
| | | public class MesPositionManager : Repository<MesPosition> |
| | | { |
| | | // 当前类已经继承了 Repository 增、删、查、改的方法 |
| | |
| | | PositionDescription = position.FDESCRIPTIONS, |
| | | Department = position.FDept, |
| | | Fforbidstatus = position.FForbidStatus, |
| | | FUseOrgId = position.FUseOrgId, |
| | | FCreateOrgId = position.FCreateOrgId, |
| | | //FUseOrgId = position.FUseOrgId, |
| | | //FCreateOrgId = position.FCreateOrgId, |
| | | //// 如果存在,使用现有的CreateDate,后续将删除后重新插入 |
| | | //// 如果不存在,设为当前时间 |
| | | //CreationDate = existingCustomer?.CreationDate ?? DateTime.Now, |
| | |
| | | DisabledDate = position.FForbidDate != null |
| | | ? DateTime.ParseExact(position.FForbidDate, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null |
| | | : null, |
| | | |
| | | FUseOrgId = string.IsNullOrEmpty(position.FUseOrgId) ? "1" : position.FUseOrgId, |
| | | FCreateOrgId = string.IsNullOrEmpty(position.FCreateOrgId) ? "1" : position.FCreateOrgId, |
| | | }; |
| | | |
| | | // ERP: 0=未禁用, 1=禁用 |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | /// <summary> |
| | | /// 员工信息 |
| | | /// </summary> |
| | | public class MesStaffManager : Repository<MesStaff> |
| | | { |
| | | // Save 方法用于保存单个员工记录,根据类型执行不同的操作 |
| | |
| | | PhoneNumber = staff.FMobile, |
| | | Remark = staff.FDescription, |
| | | FforbidStatus = staff.FForbidStatus, |
| | | FSubsidiary = staff.FUseOrgId, |
| | | Fumbrella = staff.FCreateOrgId, |
| | | //FSubsidiary = staff.FUseOrgId, |
| | | //Fumbrella = staff.FCreateOrgId, |
| | | // 如果存在,使用现有的CreateDate,后续将删除后重新插入 |
| | | // 如果不存在,设为当前时间 |
| | | CreateDate = existingCustomer?.CreateDate ?? DateTime.Now, |
| | | //CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Type = staff.Type |
| | | Type = staff.Type, |
| | | |
| | | FSubsidiary = string.IsNullOrEmpty(staff.FUseOrgId) ? "1" : staff.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(staff.FCreateOrgId) ? "1" : staff.FCreateOrgId, |
| | | }; |
| | | |
| | | if (staff.FStaffStartDate != null) |
| | |
| | | using Masuit.Tools; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | /// <summary> |
| | | /// 供应商信息 |
| | | /// </summary> |
| | | public class MesSupplierManager : Repository<MesSupplier> |
| | | { |
| | | public bool Save(ErpSupplier unit) |
| | |
| | | Fstaffid = supplier.FStaffId, |
| | | //Fforbidstatus = supplier.FForbidStatus, |
| | | Type = supplier.Type, |
| | | FSubsidiary = "1", |
| | | Fumbrella = "1", |
| | | //FSubsidiary = "1", |
| | | //Fumbrella = "1", |
| | | // 如果存在,使用现有的CreateDate,后续将删除后重新插入 |
| | | // 如果不存在,设为当前时间 |
| | | CreateDate = existingCustomer?.CreateDate ?? DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | Factory = "1000", |
| | | |
| | | FSubsidiary = string.IsNullOrEmpty(supplier.FUseOrgId) ? "1" : supplier.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(supplier.FCreateOrgId) ? "1" : supplier.FCreateOrgId, |
| | | }; |
| | | |
| | | // ERP: 0=未禁用, 1=禁用 |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | /// <summary> |
| | | /// 物料单位信息 |
| | | /// </summary> |
| | | public class MesUnitManager : Repository<MesUnit> |
| | | { |
| | | public bool Save(ErpUnit unit) |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | /// <summary> |
| | | /// 物料单位换算信息 |
| | | /// </summary> |
| | | public class MesUnitMatrixingManager : Repository<MesUnitMatrixing> |
| | | { |
| | | public bool Save(ErpUnitMatrixing unit) |
| | |
| | | CONVMOL=unit.FConvertMolecules, |
| | | CONVDEN=unit.FConvertDenominator, |
| | | AltUnits=unit.FCurrentUnitId, |
| | | ValStates=unit.FForbidStatus |
| | | ValStates=unit.FForbidStatus, |
| | | |
| | | FSubsidiary = string.IsNullOrEmpty(unit.FUseOrgId) ? "1" : unit.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(unit.FCreateOrgId) ? "1" : unit.FCreateOrgId, |
| | | }; |
| | | |
| | | // ERP: 0=未禁用, 1=禁用 |
| | |
| | | ? existingCustomer?.Factory |
| | | : department.Factory, |
| | | |
| | | FSubsidiary = string.IsNullOrEmpty(department.FUseOrgId) ? "1" : department.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(department.FCreateOrgId) ? "1" : department.FCreateOrgId, |
| | | |
| | | }; |
| | | |
| | | // ERP: 0=未禁用, 1=禁用 |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | /// <summary> |
| | | /// 部门信息 |
| | | /// </summary> |
| | | public class SysDepartmentManager : Repository<SysDepartment> |
| | | { |
| | | // 当前类已经继承了 Repository 增、删、查、改的方法 |
| | |
| | | Depextr3 = department.FWIPStockID, |
| | | Depextr4 = department.FForbidStatus, |
| | | FParentID = department.FParentID, |
| | | FSubsidiary = department.FUseOrgId, |
| | | Fumbrella = department.FCreateOrgId, |
| | | //FSubsidiary = department.FUseOrgId, |
| | | //Fumbrella = department.FCreateOrgId, |
| | | // 如果存在,使用现有的CreateDate,后续将删除后重新插入 |
| | | // 如果不存在,设为当前时间 |
| | | CreateDate = existingCustomer?.CreateDate ?? DateTime.Now, |
| | |
| | | ? existingCustomer?.Factory |
| | | : department.Factory, |
| | | |
| | | |
| | | FSubsidiary = string.IsNullOrEmpty(department.FUseOrgId) ? "1" : department.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(department.FCreateOrgId) ? "1" : department.FCreateOrgId, |
| | | }; |
| | | |
| | | // ERP: 0=未禁用, 1=禁用 |