yanjinhui
9 天以前 a356468e8421332d47fb1006b4dbdac5d639bde3
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs
@@ -270,7 +270,7 @@
                        Status = false,
                        StockQuantity = inventoryInfo.StockQuantity,
                        AvailableQuantity = inventoryInfo.StockQuantity,
                        ValidityPeriod = inventoryInfo.ValidityPeriod,
                        ValidityPeriod = inventoryInfo.ValidityPeriod.ObjToDate(),
                        SupplyQuantity = inventoryInfo.SupplyQuantity,
                    };
                    _inventory_BatchServices.AddData(inventory_Batch);
@@ -316,7 +316,7 @@
                        Warehouse_no = order.warehouse_no,
                        Details = order.details.Select(d => new Dt_CabinOrderDetail
                        {
                            Reservoirarea=order.warehouse_no,
                            Reservoirarea = order.warehouse_no,
                            Goods_no = d.goods_no,
                            Order_qty = Math.Abs(d.order_qty),
                            Batch_num = d.batch_num,
@@ -362,7 +362,6 @@
                        if (materielInfo == null) throw new Exception($"未找到药品编码【{item.goods_no}】的信息");
                        if (!Enum.IsDefined(typeof(MaterielSourceTypeEnum), materielInfo.MaterielSourceType))
                            throw new Exception($"请设置药品编号【{item.goods_no}】的属性分类");
                        if (materielInfo.BoxQty < 1) throw new Exception($"请设置药品编号【{item.goods_no}】的箱规数量");
                        #endregion
                        #region å¤§ä»¶
                        if (materielInfo.MaterielSourceType == MaterielSourceTypeEnum.PurchasePart)//如果物料是大件
@@ -382,6 +381,7 @@
                        #endregion
                        else
                        {
                            if (materielInfo.BoxQty < 1) throw new Exception($"请设置药品编号【{item.goods_no}】的箱规数量");
                            if (materielInfo.MinQty < 1) throw new Exception($"请设置药品编号【{item.goods_no}】的立库最低库存数");
                            Dt_CabinOrderDetail orderDetail = null;
                            var ys = item.order_qty % materielInfo.BoxQty; //不能整除箱规的散件数 
@@ -757,35 +757,29 @@
                foreach (var item in cabinOrders)
                {
                    if (item.Order_type == InOrderTypeEnum.Allocat.ObjToInt().ToString())
                    {
                        if (item.Details != null)
                        {
                            _cabinOrderDetailServices.Repository.DeleteAndMoveIntoHty(item.Details, OperateTypeEnum.人工完成);
                            item.Details = null;
                        }
                    }
                    else
                    {
                        if (item.Details != null)
                            _cabinOrderDetailServices.Repository.DeleteAndMoveIntoHty(item.Details, OperateTypeEnum.人工完成);
                        item.Modifier = App.User.UserName;
                        item.ModifyDate = DateTime.Now;
                        item.Details = null;
                    }
                    if (item.Details != null)
                        _cabinOrderDetailServices.Repository.DeleteAndMoveIntoHty(item.Details, OperateTypeEnum.人工完成);
                    item.Modifier = App.User.UserName;
                    item.ModifyDate = DateTime.Now;
                    item.Details = null;
                }
                BaseDal.DeleteAndMoveIntoHty(cabinOrders, OperateTypeEnum.人工完成);
                var url = "http://121.37.118.63:80/GYZ2/95fck/outOrderOk";
                var requestDate = new
                if (cabinOrder.Order_type == InOrderTypeEnum.Allocat.ObjToInt().ToString())
                    _unitOfWorkManage.CommitTran();
                else
                {
                    order_no = cabinOrder.Order_no
                };
                var result = HttpHelper.Post(url, requestDate.ToJsonString());
                var response = JsonConvert.DeserializeObject<UpstreamOrderResponse>(result);
                if (response == null) throw new Exception("上报ERP入库单完成失败!");
                if (response.resultCode != "0") throw new Exception(response.resultMsg);
                _unitOfWorkManage.CommitTran();
                    var url = "http://121.37.118.63:80/GYZ2/95fck/outOrderOk";
                    var requestDate = new
                    {
                        order_no = cabinOrder.Order_no
                    };
                    var result = HttpHelper.Post(url, requestDate.ToJsonString());
                    var response = JsonConvert.DeserializeObject<UpstreamOrderResponse>(result);
                    if (response == null) throw new Exception("上报ERP入库单完成失败!");
                    if (response.resultCode != "0") throw new Exception(response.resultMsg);
                    _unitOfWorkManage.CommitTran();
                }
                content.OK();
            }
            catch (Exception ex)