| | |
| | | FDocumentStatus = erpDto.FDocumentStatus, // 单据状态 |
| | | FDate = !String.IsNullOrEmpty(erpDto.FDate) ? DateTime.ParseExact(erpDto.FDate, "yyyy-MM-dd HH:mm:ss", null) : null, // 申请日期 |
| | | FAppOrgId = erpDto.FAPPORGID, // 申请组织 |
| | | FBillTypeId = erpDto.FBillTypeID, // 单据类型 |
| | | |
| | | FBusinessType = erpDto.FBusinessType, // 业务类型 |
| | | FTransType = erpDto.FTRANSTYPE, // 调拨类型 |
| | | FTransferDirect = erpDto.FTransferDirect, // 调拨方向 |
| | | FOwnerTypeIdHead = erpDto.FOwnerTypeIdHead, // 调出货主类型 |
| | | FOwnerTypeInIdHead = erpDto.FOwnerTypeInIdHead, // 调入货主类型 |
| | | //FTransType = erpDto.FTRANSTYPE, // 调拨类型 |
| | | //FTransferDirect = erpDto.FTransferDirect, // 调拨方向 |
| | | //FOwnerTypeIdHead = erpDto.FOwnerTypeIdHead, // 调出货主类型 |
| | | //FOwnerTypeInIdHead = erpDto.FOwnerTypeInIdHead, // 调入货主类型 |
| | | FRemarks = erpDto.FRemarks, // 备注 |
| | | FCreatorId = erpDto.FCreatorId, // 创建人 |
| | | FCreateDate = !String.IsNullOrEmpty(erpDto.FCreateDate) ? DateTime.ParseExact(erpDto.FCreateDate, "yyyy-MM-dd HH:mm:ss", null) : null, // 创建日期 |
| | | FModifierId = erpDto.FModifierId, // 最后修改人 |
| | | FModifyDate = !String.IsNullOrEmpty(erpDto.FModifyDate) ? DateTime.ParseExact(erpDto.FModifyDate, "yyyy-MM-dd HH:mm:ss", null) : null, // 最后修改日期 |
| | | FApproveDate = !String.IsNullOrEmpty(erpDto.FAPPROVEDATE) ? DateTime.ParseExact(erpDto.FAPPROVEDATE, "yyyy-MM-dd HH:mm:ss", null) : null, // 审核日期 |
| | | FApproveDate = DateTime.Now,//审核状态 |
| | | FCloseStatus = erpDto.FCloseStatus, // 关闭状态 |
| | | FCloserId = erpDto.FCloserId, // 关闭人 |
| | | FCloseDate = !String.IsNullOrEmpty(erpDto.FCloseDate) ? DateTime.ParseExact(erpDto.FCloseDate, "yyyy-MM-dd HH:mm:ss", null) : null, // 关闭日期 |
| | | //FCloseDate = !String.IsNullOrEmpty(erpDto.FCloseDate) ? DateTime.ParseExact(erpDto.FCloseDate, "yyyy-MM-dd HH:mm:ss", null) : null, // 关闭日期 |
| | | FUnwBaseBomBb = erpDto.F_UNW_Base_BOMBB, // BOM版本 |
| | | FUnwBaseFxwlBm = erpDto.F_UNW_Base_FXWLBM, // 父项物料编号 |
| | | Source = "ERP",//单据来源 |
| | | FHasLink = true, |
| | | FApproveStatus = 1,//审核状态 |
| | | }; |
| | | |
| | | if (string.IsNullOrEmpty(erpDto.FCloserId.ToString())) |
| | | mesDbck.FCloseDate = !String.IsNullOrEmpty(erpDto.FCloseDate) ? DateTime.ParseExact(erpDto.FCloseDate, "yyyy-MM-dd HH:mm:ss", null) : null; // 关闭日期 |
| | | |
| | | if (erpDto.FBillTypeID == "DBSQD01_SYS") |
| | | { |
| | | mesDbck.FBillTypeId = "标准调拨申请单(DBSQD01_SYS)"; |
| | | mesDbck.DJTYPE = "标准直接调拨单(ZJDB01_SYS)"; |
| | | } |
| | | else if (erpDto.FBillTypeID == "DBSQD04_SYS") |
| | | { |
| | | mesDbck.FBillTypeId = "委外调拨申请单(DBSQD04_SYS)"; |
| | | mesDbck.DJTYPE = "委外直接调拨单(ZJDB03_SYS)"; |
| | | } |
| | | |
| | | |
| | | // 根据 FTRANSTYPE 设置调拨类型 |
| | | if (erpDto.FTRANSTYPE == "InnerOrgTransfer") |
| | | { |
| | | mesDbck.FTransType = "组织内调拨(InnerOrgTransfer)"; |
| | | } |
| | | else if (erpDto.FTRANSTYPE == "OverOrgTransfer") |
| | | { |
| | | mesDbck.FTransType = "跨组织调拨(OverOrgTransfer)"; |
| | | } |
| | | |
| | | // 根据 FTransferDirect 设置调拨方向 |
| | | if (erpDto.FTransferDirect == "GENERAL") |
| | | { |
| | | mesDbck.FTransferDirect = "普通(GENERAL)"; |
| | | } |
| | | else if (erpDto.FTransferDirect == "RETURN") |
| | | { |
| | | mesDbck.FTransferDirect = "退货(RETURN)"; |
| | | } |
| | | |
| | | // 根据 FOwnerTypeIdHead 设置调出货主类型 |
| | | if (erpDto.FOwnerTypeIdHead == "BD_OwnerOrg") |
| | | { |
| | | mesDbck.FOwnerTypeIdHead = "组织(BD_OwnerOrg)"; |
| | | } |
| | | else if (erpDto.FOwnerTypeIdHead == "BD_Supplier") |
| | | { |
| | | mesDbck.FOwnerTypeIdHead = "供应商(BD_Supplier)"; |
| | | } |
| | | else if (erpDto.FOwnerTypeIdHead == "BD_Customer") |
| | | { |
| | | mesDbck.FOwnerTypeIdHead = "客户(BD_Customer)"; |
| | | } |
| | | |
| | | // 根据 FOwnerTypeInIdHead 设置调入货主类型 |
| | | if (erpDto.FOwnerTypeInIdHead == "BD_OwnerOrg") |
| | | { |
| | | mesDbck.FOwnerTypeInIdHead = "组织(BD_OwnerOrg)"; |
| | | } |
| | | else if (erpDto.FOwnerTypeInIdHead == "BD_Supplier") |
| | | { |
| | | mesDbck.FOwnerTypeInIdHead = "供应商(BD_Supplier)"; |
| | | } |
| | | else if (erpDto.FOwnerTypeInIdHead == "BD_Customer") |
| | | { |
| | | mesDbck.FOwnerTypeInIdHead = "客户(BD_Customer)"; |
| | | } |
| | | |
| | | var single = base.GetSingle(it => it.ErpID == Convert.ToDecimal(erpDto.id)); |
| | | if (single != null) mesDbck.Id = single.Id; |
| | | |