| | |
| | | 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 //销售组织 |
| | | |
| | | }; |
| | | |