| | |
| | | private bool SaveOrUpdateData(SqlSugarScope db, SalesDeliveryNotice mesSalesDelivery, |
| | | List<SalesDeliveryNoticeDetail> mesSalesDeliveryDatas, string type) |
| | | { |
| | | |
| | | // 1. 校验是否存在领料记录(MES_INV_ITEM_OUTS) |
| | | var hasMaterialOut = db.Queryable<MesInvItemOuts>() |
| | | .Any(x => x.WorkNo == mesSalesDelivery.BillNo); |
| | | |
| | | if (hasMaterialOut) |
| | | { |
| | | throw new Exception($"MES已有领料记录,单号:{mesSalesDelivery.BillNo},不能更新!"); |
| | | } |
| | | if (mesSalesDelivery.Id != null) base.DeleteById(mesSalesDelivery.Id); |
| | | |
| | | if (mesSalesDeliveryDatas.Count > 0) |
| | |
| | | CloseStatus = erpDto.FBillCloseStatus, // 关闭状态 |
| | | BillStatus = erpDto.FDocumentStatus, //单据状态 |
| | | DeliveryOrg = erpDto.FDeliveryOrgID, //发货组织 |
| | | SalesOrg = erpDto.FSaleOrgId //销售组织 |
| | | SalesOrg = erpDto.FSaleOrgId, //销售组织 |
| | | HbDh = erpDto.HbDh //销售组织 |
| | | |
| | | }; |
| | | |
| | |
| | | TerminationDate = ParseDateTime(erpDto.FTerminateDate),//业务终止日期 |
| | | SumOutQty = erpDto.FSumOutQty,//累计出库数量 |
| | | RemainOutQty = erpDto.FRemainOutQty,//未出库数量 |
| | | NOTE = erpDto.FEntrynote//备注 |
| | | NOTE = erpDto.FEntrynote,//备注 |
| | | Xsdd=erpDto.Xsdd, |
| | | XsddId=erpDto.Xsdd_id, |
| | | XsddLineId=erpDto.Xsdd_line_id, |
| | | |
| | | }; |
| | | |