| | |
| | | using MES.Service.DB; |
| | | using Masuit.Tools; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | |
| | | private MesCustomer GetSysDepartment(ErpCustomer customer) |
| | | { |
| | | //ERP傳輸的接口數據轉換為MES數據庫字段 |
| | | var fForbidStatus = customer.FForbidStatus; |
| | | if (customer.FForbidStatus == "0") |
| | | { |
| | | fForbidStatus = "A"; |
| | | } |
| | | else if (customer.FForbidStatus == "1") |
| | | { |
| | | fForbidStatus = "B"; |
| | | } |
| | | |
| | | var entity = new MesCustomer |
| | | { |
| | | CustNo = customer.FNumber, |
| | |
| | | Anred = customer.FTContact, |
| | | Telf1 = customer.Fmobilephone, |
| | | Fseller = customer.Fseller, |
| | | Fforbidstatus = fForbidStatus, |
| | | FSubsidiary = string.IsNullOrEmpty(customer.FUseOrgId) |
| | | ? "1" |
| | | : customer.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(customer.FCreateOrgId) |
| | | ? "1" |
| | | : customer.FCreateOrgId, |
| | | // FSubsidiary = string.IsNullOrEmpty(customer.FUseOrgId) |
| | | // ? "1" |
| | | // : customer.FUseOrgId, |
| | | // Fumbrella = string.IsNullOrEmpty(customer.FCreateOrgId) |
| | | // ? "1" |
| | | // : customer.FCreateOrgId, |
| | | FSubsidiary = "1", |
| | | Fumbrella = "1", |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | |
| | | Type = customer.Type, |
| | | }; |
| | | |
| | | if (customer.FForbidStatus.IsNullOrEmpty()) |
| | | { |
| | | entity.Fforbidstatus = "A"; |
| | | } |
| | | else |
| | | { |
| | | //我期望的值是A=否,B=是 |
| | | //实际给我的值是0或1,我希望为我转换从A和B的方式 |
| | | entity.Fforbidstatus = customer.FForbidStatus == "1" ? "B" : "A"; |
| | | } |
| | | |
| | | // 查找是否已存在相同客户编码的记录 |
| | | var existingCustomer = Db.Queryable<MesCustomer>() |
| | | .Where(s => s.CustNo == entity.CustNo) |
| | |
| | | using MES.Service.DB; |
| | | using Masuit.Tools; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | |
| | | IsFkc = depots.FAllowMinusQty, |
| | | CreateBy = depots.FPrincipal, |
| | | Depottype = depots.FStockProperty, |
| | | IsNg = depots.FForbidStatus, |
| | | Zuid = depots.FGroup, |
| | | DocumentStatus = depots.FDocumentStatus, |
| | | |
| | | FSubsidiary = string.IsNullOrEmpty(depots.FUseOrgId) |
| | | ? "1" |
| | | : depots.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(depots.FCreateOrgId) |
| | | ? "1" |
| | | : depots.FCreateOrgId, |
| | | IsNg = "A", |
| | | FSubsidiary = "1", |
| | | Fumbrella = "1", |
| | | // IsNg = depots.FForbidStatus, |
| | | // FSubsidiary = string.IsNullOrEmpty(depots.FUseOrgId) |
| | | // ? "1" |
| | | // : depots.FUseOrgId, |
| | | // Fumbrella = string.IsNullOrEmpty(depots.FCreateOrgId) |
| | | // ? "1" |
| | | // : depots.FCreateOrgId, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |
| | | |
| | | //IsNg = depots.FForbidStatus, |
| | | if (depots.FForbidStatus.IsNullOrEmpty()) |
| | | { |
| | | entity.IsNg = "A"; |
| | | } |
| | | else |
| | | { |
| | | //我期望的值是A=否,B=是 |
| | | //实际给我的值是0或1,我希望为我转换从A和B的方式 |
| | | entity.IsNg = depots.FForbidStatus == "1" ? "B" : "A"; |
| | | } |
| | | |
| | | // 查找是否已存在相同仓库编码的记录 |
| | | var existingDepot = Db.Queryable<MesDepots>() |
| | |
| | | ProductionWorkshop = item.FWorkShopId, |
| | | ProduceUnit = item.FPRODUCEUNITID, |
| | | SubconUnit = item.FSUBCONUNITID, |
| | | FSubsidiary = string.IsNullOrEmpty(item.FUseOrgId) ? "1" : item.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(item.FCreateOrgId) ? "1" : item.FCreateOrgId, |
| | | FSubsidiary = "1", |
| | | Fumbrella = "1", |
| | | LossPercent = item.FLOSSPERCENT, |
| | | MnemonicCode = item.FMnemonicCode, |
| | | ExpPeriod = item.FExpPeriod, |
| | |
| | | PositionName = position.FName, |
| | | PositionDescription = position.FDESCRIPTIONS, |
| | | Department = position.FDept, |
| | | Fforbidstatus = position.FForbidStatus, |
| | | FSubsidiary = string.IsNullOrEmpty(position.FUseOrgId) |
| | | ? "1" |
| | | : position.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(position.FCreateOrgId) |
| | | ? "1" |
| | | : position.FCreateOrgId, |
| | | FSubsidiary = "1", |
| | | Fumbrella = "1", |
| | | CreationDate = position.FCreateDate != null |
| | | ? DateTime.ParseExact(position.FCreateDate, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | |
| | | : null, |
| | | }; |
| | | |
| | | if (position.FForbidStatus.IsNullOrEmpty()) |
| | | { |
| | | entity.Fforbidstatus = "A"; |
| | | } |
| | | else |
| | | { |
| | | //我期望的值是A=否,B=是 |
| | | //实际给我的值是0或1,我希望为我转换从A和B的方式 |
| | | entity.Fforbidstatus = position.FForbidStatus == "1" ? "B" : "A"; |
| | | } |
| | | |
| | | var mesPosition = Db.Queryable<MesPosition>() |
| | | .Where(s => s.PositionId == entity.PositionId) |
| | | .First(); |
| | |
| | | namespace MES.Service.service.BasicData; |
| | | using Masuit.Tools; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | |
| | | PositionCode = staff.FPostId, |
| | | PhoneNumber = staff.FMobile, |
| | | Remark = staff.FDescription, |
| | | FforbidStatus = staff.FForbidStatus, |
| | | FSubsidiary = string.IsNullOrEmpty(staff.FUseOrgId) |
| | | ? "1" |
| | | : staff.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(staff.FCreateOrgId) |
| | | ? "1" |
| | | : staff.FCreateOrgId, |
| | | FSubsidiary = "1", |
| | | Fumbrella = "1", |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Type = staff.Type |
| | | }; |
| | | |
| | | if (staff.FForbidStatus.IsNullOrEmpty()) |
| | | { |
| | | entity.FforbidStatus = "A"; |
| | | } |
| | | else |
| | | { |
| | | //我期望的值是A=否,B=是 |
| | | //实际给我的值是0或1,我希望为我转换从A和B的方式 |
| | | entity.FforbidStatus = staff.FForbidStatus == "1" ? "B" : "A"; |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(staff.FStaffStartDate)) |
| | | { |
| | | entity.StartDate = DateTime.ParseExact(staff.FStaffStartDate, |
| | |
| | | using MES.Service.DB; |
| | | using Masuit.Tools; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | |
| | | |
| | | private MesUnit GetMesUnit(ErpUnit unit) |
| | | { |
| | | var fForbidStatus = unit.FForbidStatus; |
| | | if (unit.FForbidStatus == "0") |
| | | { |
| | | fForbidStatus = "A"; |
| | | } |
| | | else if (unit.FForbidStatus == "1") |
| | | { |
| | | fForbidStatus = "B"; |
| | | } |
| | | |
| | | var entity = new MesUnit |
| | | { |
| | | Fnumber = unit.FNumber, |
| | |
| | | Froundtype = unit.FRoundType, |
| | | Fprecision = unit.FPrecision, |
| | | Fdescription = unit.FDescription, |
| | | Fforbidstatus = fForbidStatus, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | |
| | | Type = unit.Type |
| | | }; |
| | | |
| | | if (unit.FForbidStatus.IsNullOrEmpty()) |
| | | { |
| | | entity.Fforbidstatus = "A"; |
| | | } |
| | | else |
| | | { |
| | | //我期望的值是A=否,B=是 |
| | | //实际给我的值是0或1,我希望为我转换从A和B的方式 |
| | | entity.Fforbidstatus = unit.FForbidStatus == "1" ? "B" : "A"; |
| | | } |
| | | |
| | | // 查找是否已存在相同单位编码的记录 |
| | | var existingUnit = Db.Queryable<MesUnit>() |
| | | .Where(s => s.Fnumber == entity.Fnumber) |
| | |
| | | using MES.Service.DB; |
| | | using Masuit.Tools; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | |
| | | // 将 ErpDepartment 对象转换为 SysDepartment 对象的方法 |
| | | private SysDepartment GetSysDepartment(ErpDepartment department) |
| | | { |
| | | var fForbidStatus = department.FForbidStatus; |
| | | if (department.FForbidStatus == "0") |
| | | { |
| | | fForbidStatus = "A"; |
| | | } |
| | | else if (department.FForbidStatus == "1") |
| | | { |
| | | fForbidStatus = "B"; |
| | | } |
| | | |
| | | var entity = new SysDepartment |
| | | { |
| | | Departmentcode = department.FNumber, |
| | |
| | | Depextr1 = department.FDeptProperty, |
| | | Depextr2 = department.FGroup, |
| | | Depextr3 = department.FWIPStockID, |
| | | Depextr4 = fForbidStatus, |
| | | FParentID = department.FParentID, |
| | | FSubsidiary = string.IsNullOrEmpty(department.FUseOrgId) |
| | | ? "1" |
| | | : department.FUseOrgId, |
| | | Fumbrella = string.IsNullOrEmpty(department.FCreateOrgId) |
| | | ? "1" |
| | | : department.FCreateOrgId, |
| | | FSubsidiary = "1", |
| | | Fumbrella = "1", |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |
| | | |
| | | if (department.FForbidStatus.IsNullOrEmpty()) |
| | | { |
| | | entity.Depextr4 = "A"; |
| | | } |
| | | else |
| | | { |
| | | //我期望的值是A=否,B=是 |
| | | //实际给我的值是0或1,我希望为我转换从A和B的方式 |
| | | entity.Depextr4 = department.FForbidStatus == "1" ? "B" : "A"; |
| | | } |
| | | |
| | | // 查找是否已存在相同部门编码的记录 |
| | | var existingDepartment = Db.Queryable<SysDepartment>() |
| | | .Where(s => s.Departmentcode == entity.Departmentcode) |