1.委外订单主表入参新增fbillno
2.erp-》mes调拨单新增有无源单字段
3.生产订单优化
| | |
| | | |
| | | public class ErpProductionOrderSubDto |
| | | { |
| | | public string? FBILLNO { get; set; } // 序号 |
| | | public string? FSEQ { get; set; } // 序号 |
| | | public string? FMaterialID2 { get; set; } // 子项物料编码 |
| | | public string? FMustQty { get; set; } // 需领用量 |
| | |
| | | using SqlSugar; |
| | | using System.Reflection.Metadata; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DJTYPE")] |
| | | public string? DJTYPE { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 单据类型(调拨单) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FHasLink")] |
| | | public bool? FHasLink { get; set; } |
| | | } |
| | |
| | | private readonly ProductionOrderSubManager _productionOrderSubManager = |
| | | new(); |
| | | |
| | | private string ORDERNO = ""; |
| | | |
| | | |
| | | //ErpWYOrder |
| | | public bool Save(ErpWYOrder wyOrder) |
| | | { |
| | | var erpProductionOrderDto = wyOrder.OrderDto; |
| | | var mesRohIn = ConvertErpToProductionOrder(erpProductionOrderDto); |
| | | var mesRohIn = ConvertErpToProductionOrder(erpProductionOrderDto, wyOrder.Items[0].FBILLNO); |
| | | var mesRohInDatas = |
| | | ConvertErpToProductionOrderSub(wyOrder.Items); |
| | | |
| | |
| | | } |
| | | |
| | | private ProductionOrder ConvertErpToProductionOrder( |
| | | ErpProductionOrderDto erpDto) |
| | | ErpProductionOrderDto erpDto,string SUBBOM) |
| | | { |
| | | DateTime parsedDate; |
| | | |
| | |
| | | |
| | | var productionOrder = new ProductionOrder |
| | | { |
| | | OrderNo = erpDto.FBillNo, |
| | | OrderNo = SUBBOM, |
| | | Warehouse = erpDto.FStockID, |
| | | OrderDate = ParseDateTime(erpDto.FDate) ?? null, |
| | | OrderType = erpDto.FBillType, |
| | |
| | | Typea = erpDto.TypeA, |
| | | }; |
| | | |
| | | var single = base.GetSingle(it => it.ErpId == erpDto.FID); |
| | | var single = base.GetSingle(it => it.ErpProductionEntryCode == erpDto.FSUBENTRYID); |
| | | if (single != null) productionOrder.Guid = single.Guid; |
| | | |
| | | return productionOrder; |
| | |
| | | FDocumentStatus = erpDto.FDocumentStatus, // 单据状态 |
| | | FDate = !String.IsNullOrEmpty(erpDto.FDate) ? DateTime.ParseExact(erpDto.FDate, "yyyy-MM-dd HH:mm:ss", null) : null, // 申请日期 |
| | | FAppOrgId = erpDto.FAPPORGID, // 申请组织 |
| | | |
| | | |
| | | FBusinessType = erpDto.FBusinessType, // 业务类型 |
| | | //FTransType = erpDto.FTRANSTYPE, // 调拨类型 |
| | | //FTransferDirect = erpDto.FTransferDirect, // 调拨方向 |
| | |
| | | FUnwBaseBomBb = erpDto.F_UNW_Base_BOMBB, // BOM版本 |
| | | FUnwBaseFxwlBm = erpDto.F_UNW_Base_FXWLBM, // 父项物料编号 |
| | | Source = "ERP",//单据来源 |
| | | FHasLink = true, |
| | | FApproveStatus = 1,//审核状态 |
| | | }; |
| | | |
| | |
| | | public bool Save(ErpWOM wom) |
| | | { |
| | | var womErpCaa = wom.ErpCaa; |
| | | var mesWomcaa = MapErpCAAtoWomcaa(womErpCaa); |
| | | |
| | | var mesWomcaa = MapErpCAAtoWomcaa(womErpCaa, wom.ErpCabs[0].FBillNo); |
| | | var mesWomcabs = |
| | | MapErpCABtoWomcab(wom.ErpCabs); |
| | | |
| | |
| | | throw new NotImplementedException("更新失败"); |
| | | } |
| | | |
| | | private Womcaa MapErpCAAtoWomcaa(ErpCAA dto) |
| | | private Womcaa MapErpCAAtoWomcaa(ErpCAA dto,string PPBOMNO) |
| | | { |
| | | var entity = new Womcaa |
| | | { |
| | | Erpid = Convert.ToInt32(dto.Id), /// ERPID |
| | | Caa001 = dto.FBillNo, /// 单号 |
| | | Caa001 = PPBOMNO, /// 单号 |
| | | Caa021 = dto.FWorkShopID, /// 工作车间 |
| | | RoutingId = dto.FRoutingId, /// 工艺路线 |
| | | WorkShopId = dto.FREMWorkShopId, /// 产线 |