| | |
| | | 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, |
| | | }; |
| | | |
| | | //销售员编码转ID,Fseller = customer.Fseller, |
| | | var entityFseller = Db.Queryable<MesStaff>() |
| | | .Where(x => x.StaffNo == customer.Fseller) |
| | | .Select(x => x.Id.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityFseller)) |
| | | { |
| | | entity.Fseller = entityFseller; |
| | | } |
| | | else |
| | | { |
| | | entity.Fseller = "0"; |
| | | } |
| | | |
| | | // ERP: 0=未禁用, 1=禁用 |
| | | // MES: A=未禁用, B=禁用 |
| | | if (customer.FForbidStatus.IsNullOrEmpty()) |