chengsc
2024-10-13 4b2a864dfba4038feb6a3887724f6446f72a83a3
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -373,48 +373,49 @@
                    rowDetailCount = Db.Ado.ExecuteCommand(sqlDetailStr);
                }
                Db.Ado.CommitTran();
                if (rowCount > 0 && rowDetailCount > 0)
                {
                    new OperationASNServer().AddLogOperationAsn("入库作业", "入库单据", model.ASNNo, "添加", $"添加了单据号为{model.ASNNo}的单据信息", Convert.ToInt32(model.CreateUser));
                //if (rowCount > 0 && rowDetailCount > 0)  判断需要添加上单据类型
                //{
                //    new OperationASNServer().AddLogOperationAsn("入库作业", "入库单据", model.ASNNo, "添加", $"添加了单据号为{model.ASNNo}的单据信息", Convert.ToInt32(model.CreateUser));
                    if (addOder.Count > 0)
                    {
                        // 正式运行程序放开
                        var jsonData = JsonConvert.SerializeObject(addOder);
                        string response = "";
                //    if (addOder.Count > 0)
                //    {
                //        // 正式运行程序放开
                //        var jsonData = JsonConvert.SerializeObject(addOder);
                //        string response = "";
                        try
                        {
                            var time1 = DateTime.Now;//发送时间 .ToString("yyyy-MM-dd HH:mm:ss")
                            //给WCS下发入库单信息
                            response = HttpHelper.DoPost(url, jsonData, "下发给WCS出库命令", "WCS");
                //        try
                //        {
                //            var time1 = DateTime.Now;//发送时间 .ToString("yyyy-MM-dd HH:mm:ss")
                //            //给WCS下发入库单信息
                //            response = HttpHelper.DoPost(url, jsonData, "下发给WCS出库命令", "WCS");
                            //////解析返回数据
                            var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response);
                            if (wcsModel.StatusCode == 0)
                            {
                //            //////解析返回数据
                //            var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response);
                //            if (wcsModel.StatusCode == 0)
                //            {
                                
                            }
                            if (wcsModel.StatusCode == -1)
                            {
                //            }
                //            if (wcsModel.StatusCode == -1)
                //            {
                            }
                        }
                        catch (Exception ex)
                        {
                            throw new Exception(ex.Message);
                        }
                    }
                //            }
                //        }
                //        catch (Exception ex)
                //        {
                //            throw new Exception(ex.Message);
                //        }
                //    }
                    return strMessage;
                }
                else
                {
                    Db.Ado.RollbackTran();
                    return "-2:添加失败数据回滚!";
                }
                //}
                //else
                //{
                //    Db.Ado.RollbackTran();
                //    return "-2:添加失败数据回滚!";
                //}
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                throw new Exception(ex.Message);
            }
        }