| | |
| | | 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); |
| | | |
| | |
| | | db.Deleteable<Womcab>() |
| | | .Where(s => s.Pid == mesWomcaa.Erpid).ExecuteCommand(); |
| | | |
| | | //插入忽略空字段 |
| | | //单条插入忽略空字段 |
| | | var orUpdate = db.Insertable(mesWomcaa) |
| | | .IgnoreColumns(true).ExecuteCommand() > 0; |
| | | |
| | | //批量插入忽略空字段 |
| | | var baOrUpdate = db.Insertable(mesWomcabs).PageSize(1) |
| | | .IgnoreColumnsNull() |
| | | .ExecuteCommand() > 0; |
| | |
| | | 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, /// 产线 |
| | |
| | | PlanId = dto.FPlannerID, /// 计划员 |
| | | Caa010 = dto.FPlanStartDate, /// 预计开工时间 |
| | | Caa011 = dto.FPlanFinishDate, /// 预计完工时间 |
| | | Caa005 = dto.FConveyDate, /// 开单日期 |
| | | Caa005 = DateTime.TryParse(dto.FConveyDate, out var conveyDate) |
| | | ? (conveyDate <= new DateTime(1900, 1, 1) ? null : conveyDate.ToString()) |
| | | : null, /// 开单日期 |
| | | StockInlimith = dto.FStockInLimitH, /// 入库上限 |
| | | StockInlimitl = dto.FStockInLimitL, /// 入库下限 |
| | | Mtono = dto.FMTONO, /// 计划跟踪号 |
| | |
| | | // PackingListNumber = dto.F_XIFG_Text_yrr, /// 包装单号 |
| | | // CustomerName = dto.F_XIFG_Text_qtr1, /// 客户名称 |
| | | // Customer = dto.F_XIFG_Base_83g1, /// 客户 |
| | | Caa0111 = dto.FPlanFinishDate /// 预计完工时间备份 |
| | | Caa0111 = dto.FPlanFinishDate, /// 预计完工时间备份 |
| | | Typea = dto.TypeA, /// 预计完工时间备份 |
| | | //Typeb = dto.TypeB /// 预计完工时间备份 |
| | | SynchronousDate = DateTime.Now |
| | | }; |
| | | |
| | | var single = base.GetSingle(it => it.Erpid == entity.Erpid); |
| | |
| | | ? Convert.ToDecimal(dto.FNeedQty) |
| | | : null, /// 需领用量 |
| | | Cab007 = !string.IsNullOrEmpty(dto.FPickedQty) |
| | | ? Convert.ToInt32(dto.FPickedQty) |
| | | ? Convert.ToDecimal(dto.FPickedQty) |
| | | : null, /// 已领用量 |
| | | PositionNo = dto.FPositionNO, /// 位置号 |
| | | SupplyOrganization = dto.FChildSupplyOrgId, /// 供应组织 |
| | |
| | | Freplacegroup = Convert.ToInt32(dto.FReplaceGroup), |
| | | UseRate = Convert.ToDecimal(dto.FUseRate), |
| | | MaterialType = dto.FMaterialType, |
| | | MustQty = Convert.ToDecimal(dto.FMustQty) |
| | | MustQty = Convert.ToDecimal(dto.FMustQty), |
| | | Typeb = dto.TypeB |
| | | // Fsaleorderno = dto.FSALEORDERNO, /// 销售订单 |
| | | // |
| | | // CustomerItemNumber = dto.F_XIFG_Text_re5, /// 客户货号 |