dengjunjie
9 天以前 74daecd6a3f5eb5c96eef1a4b2db0491ec77c2f1
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs
@@ -62,7 +62,7 @@
        /// <summary>
        /// pda查询出库单信息
        /// pda查询入库单信息
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
@@ -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,
@@ -740,6 +740,12 @@
        }
        #endregion
        /// <summary>
        /// äººå·¥å…¥åº“完成
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public WebResponseContent FinishInOrder(int key)
        {
            WebResponseContent content = new WebResponseContent();
@@ -748,6 +754,7 @@
                Dt_CabinOrder cabinOrder = BaseDal.QueryFirst(x => x.Id == key);
                List<Dt_CabinOrder> cabinOrders = Db.Queryable<Dt_CabinOrder>().Where(x => x.Order_no == cabinOrder.Order_no).Includes(x => x.Details).ToList();//找出所有出库单号相同的出库单
                _unitOfWorkManage.BeginTran();
                foreach (var item in cabinOrders)
                {
                    if (item.Details != null)
@@ -757,16 +764,22 @@
                    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)